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