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