• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=mips64el -mcpu=mips64r2 -target-abi=n64 | FileCheck %s
2
3define i64 @dext(i64 %i) nounwind readnone {
4entry:
5; CHECK-LABEL: dext:
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
12define i64 @dextm(i64 %i) nounwind readnone {
13entry:
14; CHECK-LABEL: dextm:
15; CHECK: dextm ${{[0-9]+}}, ${{[0-9]+}}, 5, 34
16  %shr = lshr i64 %i, 5
17  %and = and i64 %shr, 17179869183
18  ret i64 %and
19}
20
21define i64 @dextu(i64 %i) nounwind readnone {
22entry:
23; CHECK-LABEL: dextu:
24; CHECK: dextu ${{[0-9]+}}, ${{[0-9]+}}, 34, 6
25  %shr = lshr i64 %i, 34
26  %and = and i64 %shr, 63
27  ret i64 %and
28}
29
30define i64 @dins(i64 %i, i64 %j) nounwind readnone {
31entry:
32; CHECK-LABEL: dins:
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
41define i64 @dinsm(i64 %i, i64 %j) nounwind readnone {
42entry:
43; CHECK-LABEL: dinsm:
44; CHECK: dinsm ${{[0-9]+}}, ${{[0-9]+}}, 10, 33
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
52define i64 @dinsu(i64 %i, i64 %j) nounwind readnone {
53entry:
54; CHECK-LABEL: dinsu:
55; CHECK: dinsu ${{[0-9]+}}, ${{[0-9]+}}, 40, 13
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}
62