1 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 ; CHECK: r[[R00:[0-9]+]]:[[R01:[0-9]+]] = combine(r0,r1)
5 ; CHECK: r[[R02:[0-9]+]]:[[R03:[0-9]+]] = asl(r[[R00]]:[[R01]],#17)
6 define i32 @f0(i32 %a0, i32 %a1) #1 {
8 %v0 = tail call i32 @llvm.fshl.i32(i32 %a0, i32 %a1, i32 17)
13 ; CHECK: r[[R10:[0-9]+]]:[[R11:[0-9]+]] = combine(r0,r1)
14 ; CHECK: r[[R12:[0-9]+]]:[[R13:[0-9]+]] = asl(r[[R10]]:[[R11]],r2)
15 define i32 @f1(i32 %a0, i32 %a1, i32 %a2) #1 {
17 %v0 = tail call i32 @llvm.fshl.i32(i32 %a0, i32 %a1, i32 %a2)
22 ; CHECK: r[[R20:[0-9]+]]:[[R21:[0-9]+]] = asl(r1:0,#17)
23 ; CHECK: r[[R20]]:[[R21]] |= lsr(r3:2,#47)
24 define i64 @f2(i64 %a0, i64 %a1) #1 {
26 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 17)
31 ; CHECK: r[[R30:[0-9]+]]:[[R31:[0-9]+]] = asl(r1:0,r4)
32 ; CHECK: r[[R32:[0-9]+]] = sub(#64,r4)
33 ; CHECK: r[[R30]]:[[R31]] |= lsr(r3:2,r[[R32]])
34 define i64 @f3(i64 %a0, i64 %a1, i64 %a2) #1 {
36 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 %a2)
41 ; CHECK: r[[R40:[0-9]+]]:[[R41:[0-9]+]] = combine(r0,r1)
42 ; CHECK: r[[R42:[0-9]+]]:[[R43:[0-9]+]] = lsr(r[[R40]]:[[R41]],#17)
43 define i32 @f4(i32 %a0, i32 %a1) #1 {
45 %v0 = tail call i32 @llvm.fshr.i32(i32 %a0, i32 %a1, i32 17)
50 ; CHECK: r[[R50:[0-9]+]]:[[R51:[0-9]+]] = combine(r0,r1)
51 ; CHECK: r[[R52:[0-9]+]]:[[R53:[0-9]+]] = lsr(r[[R50]]:[[R51]],r2)
52 define i32 @f5(i32 %a0, i32 %a1, i32 %a2) #1 {
54 %v0 = tail call i32 @llvm.fshr.i32(i32 %a0, i32 %a1, i32 %a2)
59 ; CHECK: r[[R60:[0-9]+]]:[[R61:[0-9]+]] = lsr(r3:2,#17)
60 ; CHECK: r[[R60]]:[[R61]] |= asl(r1:0,#47)
61 define i64 @f6(i64 %a0, i64 %a1) #1 {
63 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 17)
68 ; CHECK: r[[R70:[0-9]+]]:[[R71:[0-9]+]] = lsr(r3:2,r4)
69 ; CHECK: r[[R72:[0-9]+]] = sub(#64,r4)
70 ; CHECK: r[[R70]]:[[R71]] |= asl(r1:0,r6)
71 define i64 @f7(i64 %a0, i64 %a1, i64 %a2) #1 {
73 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 %a2)
78 ; CHECK: r[[R80:[0-9]+]] = rol(r0,#17)
79 define i32 @f8(i32 %a0) #1 {
81 %v0 = tail call i32 @llvm.fshl.i32(i32 %a0, i32 %a0, i32 17)
86 ; CHECK: r[[R90:[0-9]+]]:[[R91:[0-9]+]] = combine(r0,r0)
87 ; CHECK: r[[R92:[0-9]+]]:[[R93:[0-9]+]] = asl(r[[R90]]:[[R91]],r1)
88 define i32 @f9(i32 %a0, i32 %a1) #1 {
90 %v0 = tail call i32 @llvm.fshl.i32(i32 %a0, i32 %a0, i32 %a1)
95 ; CHECK: r[[RA0:[0-9]+]]:[[RA1:[0-9]+]] = rol(r1:0,#17)
96 define i64 @f10(i64 %a0, i64 %a1) #1 {
98 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a0, i64 17)
103 ; CHECK: r[[RB0:[0-9]+]]:[[RB1:[0-9]+]] = asl(r1:0,r2)
104 ; CHECK: r[[RB2:[0-9]+]] = sub(#64,r2)
105 ; CHECK: r[[RB0]]:[[RB1]] |= lsr(r1:0,r[[RB2]])
106 define i64 @f11(i64 %a0, i64 %a1) #1 {
108 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a0, i64 %a1)
113 ; CHECK: r[[RC0:[0-9]+]] = rol(r0,#15)
114 define i32 @f12(i32 %a0, i32 %a1) #1 {
116 %v0 = tail call i32 @llvm.fshr.i32(i32 %a0, i32 %a0, i32 17)
121 ; CHECK: r[[RD0:[0-9]+]]:[[RD1:[0-9]+]] = combine(r0,r0)
122 ; CHECK: r[[RD2:[0-9]+]]:[[RD3:[0-9]+]] = lsr(r[[RD0]]:[[RD1]],r1)
123 define i32 @f13(i32 %a0, i32 %a1) #1 {
125 %v0 = tail call i32 @llvm.fshr.i32(i32 %a0, i32 %a0, i32 %a1)
130 ; CHECK: r[[RE0:[0-9]+]]:[[RE1:[0-9]+]] = rol(r1:0,#47)
131 define i64 @f14(i64 %a0, i64 %a1) #1 {
133 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a0, i64 17)
138 ; CHECK: r[[RF0:[0-9]+]]:[[RF1:[0-9]+]] = lsr(r1:0,r2)
139 ; CHECK: r[[RF2:[0-9]+]] = sub(#64,r2)
140 ; CHECK: r[[RF0]]:[[RF1]] |= asl(r1:0,r[[RF2]])
141 define i64 @f15(i64 %a0, i64 %a1) #1 {
143 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a0, i64 %a1)
148 ; CHECK: r[[RG0:[0-9]+]]:[[RG1:[0-9]+]] = valignb(r1:0,r3:2,#7)
149 define i64 @f16(i64 %a0, i64 %a1) #1 {
151 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 8)
156 ; CHECK: r[[RH0:[0-9]+]]:[[RH1:[0-9]+]] = valignb(r1:0,r3:2,#6)
157 define i64 @f17(i64 %a0, i64 %a1) #1 {
159 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 16)
164 ; CHECK: r[[RI0:[0-9]+]]:[[RI1:[0-9]+]] = valignb(r1:0,r3:2,#5)
165 define i64 @f18(i64 %a0, i64 %a1) #1 {
167 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 24)
172 ; CHECK: r[[RJ0:[0-9]+]]:[[RJ1:[0-9]+]] = valignb(r1:0,r3:2,#4)
173 define i64 @f19(i64 %a0, i64 %a1) #1 {
175 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 32)
180 ; CHECK: r[[RK0:[0-9]+]]:[[RK1:[0-9]+]] = valignb(r1:0,r3:2,#3)
181 define i64 @f20(i64 %a0, i64 %a1) #1 {
183 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 40)
188 ; CHECK: r[[RL0:[0-9]+]]:[[RL1:[0-9]+]] = valignb(r1:0,r3:2,#2)
189 define i64 @f21(i64 %a0, i64 %a1) #1 {
191 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 48)
196 ; CHECK: r[[RM0:[0-9]+]]:[[RM1:[0-9]+]] = valignb(r1:0,r3:2,#1)
197 define i64 @f22(i64 %a0, i64 %a1) #1 {
199 %v0 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a1, i64 56)
204 ; CHECK: r[[RN0:[0-9]+]]:[[RN1:[0-9]+]] = valignb(r1:0,r3:2,#1)
205 define i64 @f23(i64 %a0, i64 %a1) #1 {
207 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 8)
212 ; CHECK: r[[RO0:[0-9]+]]:[[RO1:[0-9]+]] = valignb(r1:0,r3:2,#2)
213 define i64 @f24(i64 %a0, i64 %a1) #1 {
215 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 16)
220 ; CHECK: r[[RP0:[0-9]+]]:[[RP1:[0-9]+]] = valignb(r1:0,r3:2,#3)
221 define i64 @f25(i64 %a0, i64 %a1) #1 {
223 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 24)
228 ; CHECK: r[[RQ0:[0-9]+]]:[[RQ1:[0-9]+]] = valignb(r1:0,r3:2,#4)
229 define i64 @f26(i64 %a0, i64 %a1) #1 {
231 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 32)
236 ; CHECK: r[[RR0:[0-9]+]]:[[RR1:[0-9]+]] = valignb(r1:0,r3:2,#5)
237 define i64 @f27(i64 %a0, i64 %a1) #1 {
239 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 40)
244 ; CHECK: r[[RS0:[0-9]+]]:[[RS1:[0-9]+]] = valignb(r1:0,r3:2,#6)
245 define i64 @f28(i64 %a0, i64 %a1) #1 {
247 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 48)
252 ; CHECK: r[[RT0:[0-9]+]]:[[RT1:[0-9]+]] = valignb(r1:0,r3:2,#7)
253 define i64 @f29(i64 %a0, i64 %a1) #1 {
255 %v0 = tail call i64 @llvm.fshr.i64(i64 %a0, i64 %a1, i64 56)
260 ; CHECK: r[[R00:[0-9]+]] = combine(r0.l,r1.h)
261 define i32 @f30(i32 %a0, i32 %a1) #1 {
263 %v0 = tail call i32 @llvm.fshl.i32(i32 %a0, i32 %a1, i32 16)
268 ; CHECK: r[[R00:[0-9]+]] = combine(r0.l,r1.h)
269 define i32 @f31(i32 %a0, i32 %a1) #1 {
271 %v0 = tail call i32 @llvm.fshr.i32(i32 %a0, i32 %a1, i32 16)
275 declare i32 @llvm.fshl.i32(i32, i32, i32) #0
276 declare i32 @llvm.fshr.i32(i32, i32, i32) #0
277 declare i64 @llvm.fshl.i64(i64, i64, i64) #0
278 declare i64 @llvm.fshr.i64(i64, i64, i64) #0
280 attributes #0 = { nounwind readnone speculatable }
281 attributes #1 = { nounwind readnone "target-cpu"="hexagonv60" "target-features"="-packets" }