1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -O0 -mtriple=arm64-unknown-unknown -global-isel -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
7 tracksRegLiveness: true
10 liveins: $w0, $w1, $w2
12 ; CHECK-LABEL: name: fshl_i8
13 ; CHECK: liveins: $w0, $w1, $w2
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
16 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
17 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
18 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
19 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
20 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
21 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[C1]]
22 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
23 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[COPY3]]
24 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
25 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C2]]
26 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND2]](s32)
27 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
28 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
29 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND3]], [[C3]](s64)
30 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[AND1]], [[C2]]
31 ; CHECK-NEXT: [[AND5:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]]
32 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND5]], [[AND4]](s32)
33 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
34 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
35 ; CHECK-NEXT: RET_ReallyLR implicit $w0
37 %0:_(s8) = G_TRUNC %3(s32)
39 %1:_(s8) = G_TRUNC %4(s32)
41 %2:_(s8) = G_TRUNC %5(s32)
42 %6:_(s8) = G_FSHL %0, %1, %2(s8)
43 %7:_(s32) = G_ANYEXT %6(s8)
45 RET_ReallyLR implicit $w0
52 tracksRegLiveness: true
55 liveins: $w0, $w1, $w2
57 ; CHECK-LABEL: name: fshl_i16
58 ; CHECK: liveins: $w0, $w1, $w2
60 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
61 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
62 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
63 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
64 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
65 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
66 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[C1]]
67 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY [[C]](s32)
68 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[COPY3]]
69 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
70 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C2]]
71 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND2]](s32)
72 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
73 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
74 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND3]], [[C3]](s64)
75 ; CHECK-NEXT: [[AND4:%[0-9]+]]:_(s32) = G_AND [[AND1]], [[C2]]
76 ; CHECK-NEXT: [[AND5:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]]
77 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND5]], [[AND4]](s32)
78 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
79 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
80 ; CHECK-NEXT: RET_ReallyLR implicit $w0
82 %0:_(s16) = G_TRUNC %3(s32)
84 %1:_(s16) = G_TRUNC %4(s32)
86 %2:_(s16) = G_TRUNC %5(s32)
87 %6:_(s16) = G_FSHL %0, %1, %2(s16)
88 %7:_(s32) = G_ANYEXT %6(s16)
90 RET_ReallyLR implicit $w0
97 tracksRegLiveness: true
100 liveins: $w0, $w1, $w2
102 ; CHECK-LABEL: name: fshl_i32
103 ; CHECK: liveins: $w0, $w1, $w2
105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
106 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
107 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
108 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
109 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C]]
110 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
111 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[C1]]
112 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[C]]
113 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32)
114 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
115 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s64)
116 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[LSHR]], [[AND1]](s32)
117 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
118 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
119 ; CHECK-NEXT: RET_ReallyLR implicit $w0
123 %3:_(s32) = G_FSHL %0, %1, %2(s32)
125 RET_ReallyLR implicit $w0
132 tracksRegLiveness: true
135 liveins: $x0, $x1, $x2
137 ; CHECK-LABEL: name: fshl_i64
138 ; CHECK: liveins: $x0, $x1, $x2
140 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
141 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
142 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
143 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
144 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY2]], [[C]]
145 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1
146 ; CHECK-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[COPY2]], [[C1]]
147 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[XOR]], [[C]]
148 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
149 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[AND]](s64)
150 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[C2]](s64)
151 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[LSHR]], [[AND1]](s64)
152 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[SHL]], [[LSHR1]]
153 ; CHECK-NEXT: $x0 = COPY [[OR]](s64)
154 ; CHECK-NEXT: RET_ReallyLR implicit $x0
158 %3:_(s64) = G_FSHL %0, %1, %2(s64)
160 RET_ReallyLR implicit $x0
165 name: fshl_i8_const_shift
167 tracksRegLiveness: true
172 ; CHECK-LABEL: name: fshl_i8_const_shift
173 ; CHECK: liveins: $w0, $w1
175 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
176 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
177 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
178 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
179 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
180 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
181 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C]](s64)
182 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR]]
183 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
184 ; CHECK-NEXT: RET_ReallyLR implicit $w0
186 %0:_(s8) = G_TRUNC %2(s32)
188 %1:_(s8) = G_TRUNC %3(s32)
189 %7:_(s8) = G_CONSTANT i8 4
190 %5:_(s8) = G_FSHL %0, %1, %7(s8)
191 %6:_(s32) = G_ANYEXT %5(s8)
193 RET_ReallyLR implicit $w0
198 name: fshl_i8_const_overshift
200 tracksRegLiveness: true
205 ; CHECK-LABEL: name: fshl_i8_const_overshift
206 ; CHECK: liveins: $w0, $w1
208 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
209 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
210 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
211 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
212 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
213 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
214 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 6
215 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s64)
216 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR]]
217 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
218 ; CHECK-NEXT: RET_ReallyLR implicit $w0
220 %0:_(s8) = G_TRUNC %2(s32)
222 %1:_(s8) = G_TRUNC %3(s32)
223 %7:_(s8) = G_CONSTANT i8 10
224 %5:_(s8) = G_FSHL %0, %1, %7(s8)
225 %6:_(s32) = G_ANYEXT %5(s8)
227 RET_ReallyLR implicit $w0
232 name: fshl_i8_shift_by_bitwidth
234 tracksRegLiveness: true
239 ; CHECK-LABEL: name: fshl_i8_shift_by_bitwidth
240 ; CHECK: liveins: $w0, $w1
242 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
243 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
244 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
245 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
246 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
247 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
248 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
249 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s64)
250 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C1]]
251 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
252 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[C3]](s64)
253 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
254 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
255 ; CHECK-NEXT: RET_ReallyLR implicit $w0
257 %0:_(s8) = G_TRUNC %2(s32)
259 %1:_(s8) = G_TRUNC %3(s32)
260 %7:_(s8) = G_CONSTANT i8 8
261 %5:_(s8) = G_FSHL %0, %1, %7(s8)
262 %6:_(s32) = G_ANYEXT %5(s8)
264 RET_ReallyLR implicit $w0
269 name: fshl_i16_const_shift
271 tracksRegLiveness: true
276 ; CHECK-LABEL: name: fshl_i16_const_shift
277 ; CHECK: liveins: $w0, $w1
279 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
280 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
281 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
282 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
283 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
284 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
285 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
286 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s64)
287 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR]]
288 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
289 ; CHECK-NEXT: RET_ReallyLR implicit $w0
291 %0:_(s16) = G_TRUNC %2(s32)
293 %1:_(s16) = G_TRUNC %3(s32)
294 %4:_(s16) = G_CONSTANT i16 12
295 %5:_(s16) = G_FSHL %0, %1, %4(s16)
296 %6:_(s32) = G_ANYEXT %5(s16)
298 RET_ReallyLR implicit $w0
303 name: fshl_i16_const_overshift
305 tracksRegLiveness: true
310 ; CHECK-LABEL: name: fshl_i16_const_overshift
311 ; CHECK: liveins: $w0, $w1
313 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
314 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
315 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
316 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
317 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
318 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
319 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
320 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s64)
321 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR]]
322 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
323 ; CHECK-NEXT: RET_ReallyLR implicit $w0
325 %0:_(s16) = G_TRUNC %2(s32)
327 %1:_(s16) = G_TRUNC %3(s32)
328 %4:_(s16) = G_CONSTANT i16 20
329 %5:_(s16) = G_FSHL %0, %1, %4(s16)
330 %6:_(s32) = G_ANYEXT %5(s16)
332 RET_ReallyLR implicit $w0
337 name: fshl_i16_shift_by_bitwidth
339 tracksRegLiveness: true
344 ; CHECK-LABEL: name: fshl_i16_shift_by_bitwidth
345 ; CHECK: liveins: $w0, $w1
347 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
348 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
349 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
350 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
351 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
352 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
353 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
354 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s64)
355 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C1]]
356 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
357 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[C3]](s64)
358 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
359 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
360 ; CHECK-NEXT: RET_ReallyLR implicit $w0
362 %0:_(s16) = G_TRUNC %2(s32)
364 %1:_(s16) = G_TRUNC %3(s32)
365 %4:_(s16) = G_CONSTANT i16 16
366 %5:_(s16) = G_FSHL %0, %1, %4(s16)
367 %6:_(s32) = G_ANYEXT %5(s16)
369 RET_ReallyLR implicit $w0
374 name: fshl_i32_const_shift
376 tracksRegLiveness: true
381 ; CHECK-LABEL: name: fshl_i32_const_shift
382 ; CHECK: liveins: $w0, $w1
384 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
385 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
386 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 23
387 ; CHECK-NEXT: [[FSHR:%[0-9]+]]:_(s32) = G_FSHR [[COPY]], [[COPY1]], [[C]](s64)
388 ; CHECK-NEXT: $w0 = COPY [[FSHR]](s32)
389 ; CHECK-NEXT: RET_ReallyLR implicit $w0
392 %2:_(s32) = G_CONSTANT i32 9
393 %3:_(s32) = G_FSHL %0, %1, %2(s32)
395 RET_ReallyLR implicit $w0
400 name: fshl_i32_const_overshift
402 tracksRegLiveness: true
407 ; CHECK-LABEL: name: fshl_i32_const_overshift
408 ; CHECK: liveins: $w0, $w1
410 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
411 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
412 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 22
413 ; CHECK-NEXT: [[FSHR:%[0-9]+]]:_(s32) = G_FSHR [[COPY]], [[COPY1]], [[C]](s64)
414 ; CHECK-NEXT: $w0 = COPY [[FSHR]](s32)
415 ; CHECK-NEXT: RET_ReallyLR implicit $w0
418 %4:_(s32) = G_CONSTANT i32 42
419 %3:_(s32) = G_FSHL %0, %1, %4(s32)
421 RET_ReallyLR implicit $w0
426 name: fshl_i32_shift_by_bandwidth
428 tracksRegLiveness: true
433 ; CHECK-LABEL: name: fshl_i32_shift_by_bandwidth
434 ; CHECK: liveins: $w0, $w1
436 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
437 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
438 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
439 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s64)
440 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
441 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C1]](s64)
442 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
443 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[LSHR]], [[C2]](s64)
444 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[SHL]], [[LSHR1]]
445 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
446 ; CHECK-NEXT: RET_ReallyLR implicit $w0
449 %4:_(s32) = G_CONSTANT i32 32
450 %3:_(s32) = G_FSHL %0, %1, %4(s32)
452 RET_ReallyLR implicit $w0
457 name: fshl_i64_const_shift
459 tracksRegLiveness: true
464 ; CHECK-LABEL: name: fshl_i64_const_shift
465 ; CHECK: liveins: $x0, $x1
467 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
468 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
469 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 23
470 ; CHECK-NEXT: [[FSHR:%[0-9]+]]:_(s64) = G_FSHR [[COPY]], [[COPY1]], [[C]](s64)
471 ; CHECK-NEXT: $x0 = COPY [[FSHR]](s64)
472 ; CHECK-NEXT: RET_ReallyLR implicit $x0
475 %4:_(s64) = G_CONSTANT i64 41
476 %3:_(s64) = G_FSHL %0, %1, %4(s64)
478 RET_ReallyLR implicit $x0
483 name: fshl_i64_const_overshift
485 tracksRegLiveness: true
490 ; CHECK-LABEL: name: fshl_i64_const_overshift
491 ; CHECK: liveins: $x0, $x1
493 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
494 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
495 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
496 ; CHECK-NEXT: [[FSHR:%[0-9]+]]:_(s64) = G_FSHR [[COPY]], [[COPY1]], [[C]](s64)
497 ; CHECK-NEXT: $x0 = COPY [[FSHR]](s64)
498 ; CHECK-NEXT: RET_ReallyLR implicit $x0
501 %4:_(s64) = G_CONSTANT i64 72
502 %3:_(s64) = G_FSHL %0, %1, %4(s64)
504 RET_ReallyLR implicit $x0
509 name: fshl_i64_shift_by_bandwidth
511 tracksRegLiveness: true
516 ; CHECK-LABEL: name: fshl_i64_shift_by_bandwidth
517 ; CHECK: liveins: $x0, $x1
519 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
520 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
521 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
522 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
523 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
524 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C1]](s64)
525 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY1]], [[C2]](s64)
526 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(s64) = G_LSHR [[LSHR]], [[C]](s64)
527 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[SHL]], [[LSHR1]]
528 ; CHECK-NEXT: $x0 = COPY [[OR]](s64)
529 ; CHECK-NEXT: RET_ReallyLR implicit $x0
532 %4:_(s64) = G_CONSTANT i64 64
533 %3:_(s64) = G_FSHL %0, %1, %4(s64)
535 RET_ReallyLR implicit $x0
542 name: fshl_v4i32_shift_by_bitwidth
544 tracksRegLiveness: true
549 ; CHECK-LABEL: name: fshl_v4i32_shift_by_bitwidth
550 ; CHECK: liveins: $q0, $q1
552 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
553 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1
554 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
555 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
556 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32), [[C1]](s32), [[C1]](s32)
557 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
558 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
559 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C2]](s32), [[C2]](s32), [[C2]](s32), [[C2]](s32)
560 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(<4 x s32>) = G_SHL [[COPY]], [[BUILD_VECTOR]](<4 x s32>)
561 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY1]], [[BUILD_VECTOR2]](<4 x s32>)
562 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[LSHR]], [[BUILD_VECTOR1]](<4 x s32>)
563 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(<4 x s32>) = G_OR [[SHL]], [[LSHR1]]
564 ; CHECK-NEXT: $q0 = COPY [[OR]](<4 x s32>)
565 ; CHECK-NEXT: RET_ReallyLR implicit $q0
566 %0:_(<4 x s32>) = COPY $q0
567 %1:_(<4 x s32>) = COPY $q1
568 %3:_(s32) = G_CONSTANT i32 32
569 %2:_(<4 x s32>) = G_BUILD_VECTOR %3(s32), %3(s32), %3(s32), %3(s32)
570 %4:_(<4 x s32>) = G_FSHL %0, %1, %2(<4 x s32>)
571 $q0 = COPY %4(<4 x s32>)
572 RET_ReallyLR implicit $q0