Akira Hatanaka | c7bafe9 | 2011-09-30 18:51:46 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=mips64el -mcpu=mips64r2 < %s | FileCheck %s |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 2 | |
| 3 | define i64 @f0(i64 %a0, i64 %a1) nounwind readnone { |
| 4 | entry: |
| 5 | ; CHECK: dsllv |
| 6 | %shl = shl i64 %a0, %a1 |
| 7 | ret i64 %shl |
| 8 | } |
| 9 | |
| 10 | define i64 @f1(i64 %a0, i64 %a1) nounwind readnone { |
| 11 | entry: |
| 12 | ; CHECK: dsrav |
| 13 | %shr = ashr i64 %a0, %a1 |
| 14 | ret i64 %shr |
| 15 | } |
| 16 | |
| 17 | define i64 @f2(i64 %a0, i64 %a1) nounwind readnone { |
| 18 | entry: |
| 19 | ; CHECK: dsrlv |
| 20 | %shr = lshr i64 %a0, %a1 |
| 21 | ret i64 %shr |
| 22 | } |
| 23 | |
| 24 | define i64 @f3(i64 %a0) nounwind readnone { |
| 25 | entry: |
Akira Hatanaka | d80c13b | 2011-09-30 17:19:21 +0000 | [diff] [blame] | 26 | ; CHECK: dsll ${{[0-9]+}}, ${{[0-9]+}}, 10 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 27 | %shl = shl i64 %a0, 10 |
| 28 | ret i64 %shl |
| 29 | } |
| 30 | |
| 31 | define i64 @f4(i64 %a0) nounwind readnone { |
| 32 | entry: |
Akira Hatanaka | d80c13b | 2011-09-30 17:19:21 +0000 | [diff] [blame] | 33 | ; CHECK: dsra ${{[0-9]+}}, ${{[0-9]+}}, 10 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 34 | %shr = ashr i64 %a0, 10 |
| 35 | ret i64 %shr |
| 36 | } |
| 37 | |
| 38 | define i64 @f5(i64 %a0) nounwind readnone { |
| 39 | entry: |
Akira Hatanaka | d80c13b | 2011-09-30 17:19:21 +0000 | [diff] [blame] | 40 | ; CHECK: dsrl ${{[0-9]+}}, ${{[0-9]+}}, 10 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 41 | %shr = lshr i64 %a0, 10 |
| 42 | ret i64 %shr |
| 43 | } |
| 44 | |
| 45 | define i64 @f6(i64 %a0) nounwind readnone { |
| 46 | entry: |
Akira Hatanaka | ee97314 | 2011-12-19 19:44:09 +0000 | [diff] [blame] | 47 | ; CHECK: dsll ${{[0-9]+}}, ${{[0-9]+}}, 40 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 48 | %shl = shl i64 %a0, 40 |
| 49 | ret i64 %shl |
| 50 | } |
| 51 | |
| 52 | define i64 @f7(i64 %a0) nounwind readnone { |
| 53 | entry: |
Akira Hatanaka | ee97314 | 2011-12-19 19:44:09 +0000 | [diff] [blame] | 54 | ; CHECK: dsra ${{[0-9]+}}, ${{[0-9]+}}, 40 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 55 | %shr = ashr i64 %a0, 40 |
| 56 | ret i64 %shr |
| 57 | } |
| 58 | |
| 59 | define i64 @f8(i64 %a0) nounwind readnone { |
| 60 | entry: |
Akira Hatanaka | ee97314 | 2011-12-19 19:44:09 +0000 | [diff] [blame] | 61 | ; CHECK: dsrl ${{[0-9]+}}, ${{[0-9]+}}, 40 |
Akira Hatanaka | 25a7d94 | 2011-09-30 03:18:46 +0000 | [diff] [blame] | 62 | %shr = lshr i64 %a0, 40 |
| 63 | ret i64 %shr |
| 64 | } |
Akira Hatanaka | c7bafe9 | 2011-09-30 18:51:46 +0000 | [diff] [blame] | 65 | |
| 66 | define i64 @f9(i64 %a0, i64 %a1) nounwind readnone { |
| 67 | entry: |
| 68 | ; CHECK: drotrv |
| 69 | %shr = lshr i64 %a0, %a1 |
| 70 | %sub = sub i64 64, %a1 |
| 71 | %shl = shl i64 %a0, %sub |
| 72 | %or = or i64 %shl, %shr |
| 73 | ret i64 %or |
| 74 | } |
| 75 | |
| 76 | define i64 @f10(i64 %a0, i64 %a1) nounwind readnone { |
| 77 | entry: |
| 78 | ; CHECK: drotrv |
| 79 | %shl = shl i64 %a0, %a1 |
| 80 | %sub = sub i64 64, %a1 |
| 81 | %shr = lshr i64 %a0, %sub |
| 82 | %or = or i64 %shr, %shl |
| 83 | ret i64 %or |
| 84 | } |
| 85 | |
| 86 | define i64 @f11(i64 %a0) nounwind readnone { |
| 87 | entry: |
| 88 | ; CHECK: drotr ${{[0-9]+}}, ${{[0-9]+}}, 10 |
| 89 | %shr = lshr i64 %a0, 10 |
| 90 | %shl = shl i64 %a0, 54 |
| 91 | %or = or i64 %shr, %shl |
| 92 | ret i64 %or |
| 93 | } |
| 94 | |
| 95 | define i64 @f12(i64 %a0) nounwind readnone { |
| 96 | entry: |
Akira Hatanaka | ee97314 | 2011-12-19 19:44:09 +0000 | [diff] [blame] | 97 | ; CHECK: drotr ${{[0-9]+}}, ${{[0-9]+}}, 54 |
Akira Hatanaka | c7bafe9 | 2011-09-30 18:51:46 +0000 | [diff] [blame] | 98 | %shl = shl i64 %a0, 10 |
| 99 | %shr = lshr i64 %a0, 54 |
| 100 | %or = or i64 %shl, %shr |
| 101 | ret i64 %or |
| 102 | } |
| 103 | |
| 104 | |