Daniel Sanders | de39332 | 2016-06-23 12:42:53 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -target-abi=n64 | FileCheck %s |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 2 | |
| 3 | define i64 @dext(i64 %i) nounwind readnone { |
| 4 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 5 | ; CHECK-LABEL: dext: |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 6 | ; CHECK: dext ${{[0-9]+}}, ${{[0-9]+}}, 5, 10 |
| 7 | %shr = lshr i64 %i, 5 |
| 8 | %and = and i64 %shr, 1023 |
| 9 | ret i64 %and |
| 10 | } |
| 11 | |
| 12 | define i64 @dextm(i64 %i) nounwind readnone { |
| 13 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 14 | ; CHECK-LABEL: dextm: |
| 15 | ; CHECK: dextm ${{[0-9]+}}, ${{[0-9]+}}, 5, 34 |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 16 | %shr = lshr i64 %i, 5 |
| 17 | %and = and i64 %shr, 17179869183 |
| 18 | ret i64 %and |
| 19 | } |
| 20 | |
| 21 | define i64 @dextu(i64 %i) nounwind readnone { |
| 22 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 23 | ; CHECK-LABEL: dextu: |
| 24 | ; CHECK: dextu ${{[0-9]+}}, ${{[0-9]+}}, 34, 6 |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 25 | %shr = lshr i64 %i, 34 |
| 26 | %and = and i64 %shr, 63 |
| 27 | ret i64 %and |
| 28 | } |
| 29 | |
| 30 | define i64 @dins(i64 %i, i64 %j) nounwind readnone { |
| 31 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 32 | ; CHECK-LABEL: dins: |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 33 | ; CHECK: dins ${{[0-9]+}}, ${{[0-9]+}}, 8, 10 |
| 34 | %shl2 = shl i64 %j, 8 |
| 35 | %and = and i64 %shl2, 261888 |
| 36 | %and3 = and i64 %i, -261889 |
| 37 | %or = or i64 %and3, %and |
| 38 | ret i64 %or |
| 39 | } |
| 40 | |
| 41 | define i64 @dinsm(i64 %i, i64 %j) nounwind readnone { |
| 42 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 43 | ; CHECK-LABEL: dinsm: |
Simon Dardis | 28365b3 | 2017-09-14 10:58:00 +0000 | [diff] [blame] | 44 | ; CHECK: dinsm ${{[0-9]+}}, ${{[0-9]+}}, 10, 33 |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 45 | %shl4 = shl i64 %j, 10 |
| 46 | %and = and i64 %shl4, 8796093021184 |
| 47 | %and5 = and i64 %i, -8796093021185 |
| 48 | %or = or i64 %and5, %and |
| 49 | ret i64 %or |
| 50 | } |
| 51 | |
| 52 | define i64 @dinsu(i64 %i, i64 %j) nounwind readnone { |
| 53 | entry: |
Daniel Sanders | 611eb82 | 2016-02-29 15:26:54 +0000 | [diff] [blame] | 54 | ; CHECK-LABEL: dinsu: |
Simon Dardis | 28365b3 | 2017-09-14 10:58:00 +0000 | [diff] [blame] | 55 | ; CHECK: dinsu ${{[0-9]+}}, ${{[0-9]+}}, 40, 13 |
Akira Hatanaka | 20cee2e | 2011-12-05 21:26:34 +0000 | [diff] [blame] | 56 | %shl4 = shl i64 %j, 40 |
| 57 | %and = and i64 %shl4, 9006099743113216 |
| 58 | %and5 = and i64 %i, -9006099743113217 |
| 59 | %or = or i64 %and5, %and |
| 60 | ret i64 %or |
| 61 | } |