1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
4 ; The mask is all-ones, potentially shifted.
6 ;------------------------------------------------------------------------------;
8 ;------------------------------------------------------------------------------;
12 define i8 @test_i8_7_mask_lshr_1(i8 %a0) {
13 ; CHECK-LABEL: test_i8_7_mask_lshr_1:
15 ; CHECK-NEXT: ubfx w0, w0, #1, #2
22 define i8 @test_i8_28_mask_lshr_1(i8 %a0) {
23 ; CHECK-LABEL: test_i8_28_mask_lshr_1:
25 ; CHECK-NEXT: and w8, w0, #0x1c
26 ; CHECK-NEXT: lsr w0, w8, #1
32 define i8 @test_i8_28_mask_lshr_2(i8 %a0) {
33 ; CHECK-LABEL: test_i8_28_mask_lshr_2:
35 ; CHECK-NEXT: ubfx w0, w0, #2, #3
41 define i8 @test_i8_28_mask_lshr_3(i8 %a0) {
42 ; CHECK-LABEL: test_i8_28_mask_lshr_3:
44 ; CHECK-NEXT: ubfx w0, w0, #3, #2
50 define i8 @test_i8_28_mask_lshr_4(i8 %a0) {
51 ; CHECK-LABEL: test_i8_28_mask_lshr_4:
53 ; CHECK-NEXT: ubfx w0, w0, #4, #1
60 define i8 @test_i8_224_mask_lshr_1(i8 %a0) {
61 ; CHECK-LABEL: test_i8_224_mask_lshr_1:
63 ; CHECK-NEXT: and w8, w0, #0xe0
64 ; CHECK-NEXT: lsr w0, w8, #1
70 define i8 @test_i8_224_mask_lshr_4(i8 %a0) {
71 ; CHECK-LABEL: test_i8_224_mask_lshr_4:
73 ; CHECK-NEXT: and w8, w0, #0xe0
74 ; CHECK-NEXT: lsr w0, w8, #4
80 define i8 @test_i8_224_mask_lshr_5(i8 %a0) {
81 ; CHECK-LABEL: test_i8_224_mask_lshr_5:
83 ; CHECK-NEXT: ubfx w0, w0, #5, #3
89 define i8 @test_i8_224_mask_lshr_6(i8 %a0) {
90 ; CHECK-LABEL: test_i8_224_mask_lshr_6:
92 ; CHECK-NEXT: ubfx w0, w0, #6, #2
101 define i8 @test_i8_7_mask_ashr_1(i8 %a0) {
102 ; CHECK-LABEL: test_i8_7_mask_ashr_1:
104 ; CHECK-NEXT: ubfx w0, w0, #1, #2
111 define i8 @test_i8_28_mask_ashr_1(i8 %a0) {
112 ; CHECK-LABEL: test_i8_28_mask_ashr_1:
114 ; CHECK-NEXT: and w8, w0, #0x1c
115 ; CHECK-NEXT: lsr w0, w8, #1
121 define i8 @test_i8_28_mask_ashr_2(i8 %a0) {
122 ; CHECK-LABEL: test_i8_28_mask_ashr_2:
124 ; CHECK-NEXT: ubfx w0, w0, #2, #3
130 define i8 @test_i8_28_mask_ashr_3(i8 %a0) {
131 ; CHECK-LABEL: test_i8_28_mask_ashr_3:
133 ; CHECK-NEXT: ubfx w0, w0, #3, #2
139 define i8 @test_i8_28_mask_ashr_4(i8 %a0) {
140 ; CHECK-LABEL: test_i8_28_mask_ashr_4:
142 ; CHECK-NEXT: ubfx w0, w0, #4, #1
149 define i8 @test_i8_224_mask_ashr_1(i8 %a0) {
150 ; CHECK-LABEL: test_i8_224_mask_ashr_1:
152 ; CHECK-NEXT: and w8, w0, #0xe0
153 ; CHECK-NEXT: sbfx w0, w8, #1, #7
155 %t0 = and i8 %a0, 224
159 define i8 @test_i8_224_mask_ashr_4(i8 %a0) {
160 ; CHECK-LABEL: test_i8_224_mask_ashr_4:
162 ; CHECK-NEXT: and w8, w0, #0xe0
163 ; CHECK-NEXT: sbfx w0, w8, #4, #4
165 %t0 = and i8 %a0, 224
169 define i8 @test_i8_224_mask_ashr_5(i8 %a0) {
170 ; CHECK-LABEL: test_i8_224_mask_ashr_5:
172 ; CHECK-NEXT: sbfx w0, w0, #5, #3
174 %t0 = and i8 %a0, 224
178 define i8 @test_i8_224_mask_ashr_6(i8 %a0) {
179 ; CHECK-LABEL: test_i8_224_mask_ashr_6:
181 ; CHECK-NEXT: sbfx w0, w0, #6, #2
183 %t0 = and i8 %a0, 224
190 define i8 @test_i8_7_mask_shl_1(i8 %a0) {
191 ; CHECK-LABEL: test_i8_7_mask_shl_1:
193 ; CHECK-NEXT: and w8, w0, #0x7
194 ; CHECK-NEXT: lsl w0, w8, #1
200 define i8 @test_i8_7_mask_shl_4(i8 %a0) {
201 ; CHECK-LABEL: test_i8_7_mask_shl_4:
203 ; CHECK-NEXT: and w8, w0, #0x7
204 ; CHECK-NEXT: lsl w0, w8, #4
210 define i8 @test_i8_7_mask_shl_5(i8 %a0) {
211 ; CHECK-LABEL: test_i8_7_mask_shl_5:
213 ; CHECK-NEXT: lsl w0, w0, #5
219 define i8 @test_i8_7_mask_shl_6(i8 %a0) {
220 ; CHECK-LABEL: test_i8_7_mask_shl_6:
222 ; CHECK-NEXT: lsl w0, w0, #6
229 define i8 @test_i8_28_mask_shl_1(i8 %a0) {
230 ; CHECK-LABEL: test_i8_28_mask_shl_1:
232 ; CHECK-NEXT: and w8, w0, #0x1c
233 ; CHECK-NEXT: lsl w0, w8, #1
239 define i8 @test_i8_28_mask_shl_2(i8 %a0) {
240 ; CHECK-LABEL: test_i8_28_mask_shl_2:
242 ; CHECK-NEXT: and w8, w0, #0x1c
243 ; CHECK-NEXT: lsl w0, w8, #2
249 define i8 @test_i8_28_mask_shl_3(i8 %a0) {
250 ; CHECK-LABEL: test_i8_28_mask_shl_3:
252 ; CHECK-NEXT: and w8, w0, #0x1c
253 ; CHECK-NEXT: lsl w0, w8, #3
259 define i8 @test_i8_28_mask_shl_4(i8 %a0) {
260 ; CHECK-LABEL: test_i8_28_mask_shl_4:
262 ; CHECK-NEXT: and w8, w0, #0xc
263 ; CHECK-NEXT: lsl w0, w8, #4
270 define i8 @test_i8_224_mask_shl_1(i8 %a0) {
271 ; CHECK-LABEL: test_i8_224_mask_shl_1:
273 ; CHECK-NEXT: and w8, w0, #0x60
274 ; CHECK-NEXT: lsl w0, w8, #1
276 %t0 = and i8 %a0, 224
281 ;------------------------------------------------------------------------------;
283 ;------------------------------------------------------------------------------;
287 define i16 @test_i16_127_mask_lshr_1(i16 %a0) {
288 ; CHECK-LABEL: test_i16_127_mask_lshr_1:
290 ; CHECK-NEXT: ubfx w0, w0, #1, #6
292 %t0 = and i16 %a0, 127
293 %t1 = lshr i16 %t0, 1
297 define i16 @test_i16_2032_mask_lshr_3(i16 %a0) {
298 ; CHECK-LABEL: test_i16_2032_mask_lshr_3:
300 ; CHECK-NEXT: and w8, w0, #0x7f0
301 ; CHECK-NEXT: lsr w0, w8, #3
303 %t0 = and i16 %a0, 2032
304 %t1 = lshr i16 %t0, 3
307 define i16 @test_i16_2032_mask_lshr_4(i16 %a0) {
308 ; CHECK-LABEL: test_i16_2032_mask_lshr_4:
310 ; CHECK-NEXT: ubfx w0, w0, #4, #7
312 %t0 = and i16 %a0, 2032
313 %t1 = lshr i16 %t0, 4
316 define i16 @test_i16_2032_mask_lshr_5(i16 %a0) {
317 ; CHECK-LABEL: test_i16_2032_mask_lshr_5:
319 ; CHECK-NEXT: ubfx w0, w0, #5, #6
321 %t0 = and i16 %a0, 2032
322 %t1 = lshr i16 %t0, 5
325 define i16 @test_i16_2032_mask_lshr_6(i16 %a0) {
326 ; CHECK-LABEL: test_i16_2032_mask_lshr_6:
328 ; CHECK-NEXT: ubfx w0, w0, #6, #5
330 %t0 = and i16 %a0, 2032
331 %t1 = lshr i16 %t0, 6
335 define i16 @test_i16_65024_mask_lshr_1(i16 %a0) {
336 ; CHECK-LABEL: test_i16_65024_mask_lshr_1:
338 ; CHECK-NEXT: and w8, w0, #0xfe00
339 ; CHECK-NEXT: lsr w0, w8, #1
341 %t0 = and i16 %a0, 65024
342 %t1 = lshr i16 %t0, 1
345 define i16 @test_i16_65024_mask_lshr_8(i16 %a0) {
346 ; CHECK-LABEL: test_i16_65024_mask_lshr_8:
348 ; CHECK-NEXT: and w8, w0, #0xfe00
349 ; CHECK-NEXT: lsr w0, w8, #8
351 %t0 = and i16 %a0, 65024
352 %t1 = lshr i16 %t0, 8
355 define i16 @test_i16_65024_mask_lshr_9(i16 %a0) {
356 ; CHECK-LABEL: test_i16_65024_mask_lshr_9:
358 ; CHECK-NEXT: ubfx w0, w0, #9, #7
360 %t0 = and i16 %a0, 65024
361 %t1 = lshr i16 %t0, 9
364 define i16 @test_i16_65024_mask_lshr_10(i16 %a0) {
365 ; CHECK-LABEL: test_i16_65024_mask_lshr_10:
367 ; CHECK-NEXT: ubfx w0, w0, #10, #6
369 %t0 = and i16 %a0, 65024
370 %t1 = lshr i16 %t0, 10
376 define i16 @test_i16_127_mask_ashr_1(i16 %a0) {
377 ; CHECK-LABEL: test_i16_127_mask_ashr_1:
379 ; CHECK-NEXT: ubfx w0, w0, #1, #6
381 %t0 = and i16 %a0, 127
382 %t1 = ashr i16 %t0, 1
386 define i16 @test_i16_2032_mask_ashr_3(i16 %a0) {
387 ; CHECK-LABEL: test_i16_2032_mask_ashr_3:
389 ; CHECK-NEXT: and w8, w0, #0x7f0
390 ; CHECK-NEXT: lsr w0, w8, #3
392 %t0 = and i16 %a0, 2032
393 %t1 = ashr i16 %t0, 3
396 define i16 @test_i16_2032_mask_ashr_4(i16 %a0) {
397 ; CHECK-LABEL: test_i16_2032_mask_ashr_4:
399 ; CHECK-NEXT: ubfx w0, w0, #4, #7
401 %t0 = and i16 %a0, 2032
402 %t1 = ashr i16 %t0, 4
405 define i16 @test_i16_2032_mask_ashr_5(i16 %a0) {
406 ; CHECK-LABEL: test_i16_2032_mask_ashr_5:
408 ; CHECK-NEXT: ubfx w0, w0, #5, #6
410 %t0 = and i16 %a0, 2032
411 %t1 = ashr i16 %t0, 5
414 define i16 @test_i16_2032_mask_ashr_6(i16 %a0) {
415 ; CHECK-LABEL: test_i16_2032_mask_ashr_6:
417 ; CHECK-NEXT: ubfx w0, w0, #6, #5
419 %t0 = and i16 %a0, 2032
420 %t1 = ashr i16 %t0, 6
424 define i16 @test_i16_65024_mask_ashr_1(i16 %a0) {
425 ; CHECK-LABEL: test_i16_65024_mask_ashr_1:
427 ; CHECK-NEXT: and w8, w0, #0xfe00
428 ; CHECK-NEXT: sbfx w0, w8, #1, #15
430 %t0 = and i16 %a0, 65024
431 %t1 = ashr i16 %t0, 1
434 define i16 @test_i16_65024_mask_ashr_8(i16 %a0) {
435 ; CHECK-LABEL: test_i16_65024_mask_ashr_8:
437 ; CHECK-NEXT: and w8, w0, #0xfe00
438 ; CHECK-NEXT: sbfx w0, w8, #8, #8
440 %t0 = and i16 %a0, 65024
441 %t1 = ashr i16 %t0, 8
444 define i16 @test_i16_65024_mask_ashr_9(i16 %a0) {
445 ; CHECK-LABEL: test_i16_65024_mask_ashr_9:
447 ; CHECK-NEXT: sbfx w0, w0, #9, #7
449 %t0 = and i16 %a0, 65024
450 %t1 = ashr i16 %t0, 9
453 define i16 @test_i16_65024_mask_ashr_10(i16 %a0) {
454 ; CHECK-LABEL: test_i16_65024_mask_ashr_10:
456 ; CHECK-NEXT: sbfx w0, w0, #10, #6
458 %t0 = and i16 %a0, 65024
459 %t1 = ashr i16 %t0, 10
465 define i16 @test_i16_127_mask_shl_1(i16 %a0) {
466 ; CHECK-LABEL: test_i16_127_mask_shl_1:
468 ; CHECK-NEXT: and w8, w0, #0x7f
469 ; CHECK-NEXT: lsl w0, w8, #1
471 %t0 = and i16 %a0, 127
475 define i16 @test_i16_127_mask_shl_8(i16 %a0) {
476 ; CHECK-LABEL: test_i16_127_mask_shl_8:
478 ; CHECK-NEXT: and w8, w0, #0x7f
479 ; CHECK-NEXT: lsl w0, w8, #8
481 %t0 = and i16 %a0, 127
485 define i16 @test_i16_127_mask_shl_9(i16 %a0) {
486 ; CHECK-LABEL: test_i16_127_mask_shl_9:
488 ; CHECK-NEXT: lsl w0, w0, #9
490 %t0 = and i16 %a0, 127
494 define i16 @test_i16_127_mask_shl_10(i16 %a0) {
495 ; CHECK-LABEL: test_i16_127_mask_shl_10:
497 ; CHECK-NEXT: lsl w0, w0, #10
499 %t0 = and i16 %a0, 127
500 %t1 = shl i16 %t0, 10
504 define i16 @test_i16_2032_mask_shl_3(i16 %a0) {
505 ; CHECK-LABEL: test_i16_2032_mask_shl_3:
507 ; CHECK-NEXT: and w8, w0, #0x7f0
508 ; CHECK-NEXT: lsl w0, w8, #3
510 %t0 = and i16 %a0, 2032
514 define i16 @test_i16_2032_mask_shl_4(i16 %a0) {
515 ; CHECK-LABEL: test_i16_2032_mask_shl_4:
517 ; CHECK-NEXT: and w8, w0, #0x7f0
518 ; CHECK-NEXT: lsl w0, w8, #4
520 %t0 = and i16 %a0, 2032
524 define i16 @test_i16_2032_mask_shl_5(i16 %a0) {
525 ; CHECK-LABEL: test_i16_2032_mask_shl_5:
527 ; CHECK-NEXT: and w8, w0, #0x7f0
528 ; CHECK-NEXT: lsl w0, w8, #5
530 %t0 = and i16 %a0, 2032
534 define i16 @test_i16_2032_mask_shl_6(i16 %a0) {
535 ; CHECK-LABEL: test_i16_2032_mask_shl_6:
537 ; CHECK-NEXT: and w8, w0, #0x3f0
538 ; CHECK-NEXT: lsl w0, w8, #6
540 %t0 = and i16 %a0, 2032
545 define i16 @test_i16_65024_mask_shl_1(i16 %a0) {
546 ; CHECK-LABEL: test_i16_65024_mask_shl_1:
548 ; CHECK-NEXT: and w8, w0, #0x7e00
549 ; CHECK-NEXT: lsl w0, w8, #1
551 %t0 = and i16 %a0, 65024
556 ;------------------------------------------------------------------------------;
558 ;------------------------------------------------------------------------------;
562 define i32 @test_i32_32767_mask_lshr_1(i32 %a0) {
563 ; CHECK-LABEL: test_i32_32767_mask_lshr_1:
565 ; CHECK-NEXT: ubfx w0, w0, #1, #14
567 %t0 = and i32 %a0, 32767
568 %t1 = lshr i32 %t0, 1
572 define i32 @test_i32_8388352_mask_lshr_7(i32 %a0) {
573 ; CHECK-LABEL: test_i32_8388352_mask_lshr_7:
575 ; CHECK-NEXT: and w8, w0, #0x7fff00
576 ; CHECK-NEXT: lsr w0, w8, #7
578 %t0 = and i32 %a0, 8388352
579 %t1 = lshr i32 %t0, 7
582 define i32 @test_i32_8388352_mask_lshr_8(i32 %a0) {
583 ; CHECK-LABEL: test_i32_8388352_mask_lshr_8:
585 ; CHECK-NEXT: ubfx w0, w0, #8, #15
587 %t0 = and i32 %a0, 8388352
588 %t1 = lshr i32 %t0, 8
591 define i32 @test_i32_8388352_mask_lshr_9(i32 %a0) {
592 ; CHECK-LABEL: test_i32_8388352_mask_lshr_9:
594 ; CHECK-NEXT: ubfx w0, w0, #9, #14
596 %t0 = and i32 %a0, 8388352
597 %t1 = lshr i32 %t0, 9
600 define i32 @test_i32_8388352_mask_lshr_10(i32 %a0) {
601 ; CHECK-LABEL: test_i32_8388352_mask_lshr_10:
603 ; CHECK-NEXT: ubfx w0, w0, #10, #13
605 %t0 = and i32 %a0, 8388352
606 %t1 = lshr i32 %t0, 10
610 define i32 @test_i32_4294836224_mask_lshr_1(i32 %a0) {
611 ; CHECK-LABEL: test_i32_4294836224_mask_lshr_1:
613 ; CHECK-NEXT: and w8, w0, #0xfffe0000
614 ; CHECK-NEXT: lsr w0, w8, #1
616 %t0 = and i32 %a0, 4294836224
617 %t1 = lshr i32 %t0, 1
620 define i32 @test_i32_4294836224_mask_lshr_16(i32 %a0) {
621 ; CHECK-LABEL: test_i32_4294836224_mask_lshr_16:
623 ; CHECK-NEXT: and w8, w0, #0xfffe0000
624 ; CHECK-NEXT: lsr w0, w8, #16
626 %t0 = and i32 %a0, 4294836224
627 %t1 = lshr i32 %t0, 16
630 define i32 @test_i32_4294836224_mask_lshr_17(i32 %a0) {
631 ; CHECK-LABEL: test_i32_4294836224_mask_lshr_17:
633 ; CHECK-NEXT: lsr w0, w0, #17
635 %t0 = and i32 %a0, 4294836224
636 %t1 = lshr i32 %t0, 17
639 define i32 @test_i32_4294836224_mask_lshr_18(i32 %a0) {
640 ; CHECK-LABEL: test_i32_4294836224_mask_lshr_18:
642 ; CHECK-NEXT: lsr w0, w0, #18
644 %t0 = and i32 %a0, 4294836224
645 %t1 = lshr i32 %t0, 18
651 define i32 @test_i32_32767_mask_ashr_1(i32 %a0) {
652 ; CHECK-LABEL: test_i32_32767_mask_ashr_1:
654 ; CHECK-NEXT: ubfx w0, w0, #1, #14
656 %t0 = and i32 %a0, 32767
657 %t1 = ashr i32 %t0, 1
661 define i32 @test_i32_8388352_mask_ashr_7(i32 %a0) {
662 ; CHECK-LABEL: test_i32_8388352_mask_ashr_7:
664 ; CHECK-NEXT: and w8, w0, #0x7fff00
665 ; CHECK-NEXT: lsr w0, w8, #7
667 %t0 = and i32 %a0, 8388352
668 %t1 = ashr i32 %t0, 7
671 define i32 @test_i32_8388352_mask_ashr_8(i32 %a0) {
672 ; CHECK-LABEL: test_i32_8388352_mask_ashr_8:
674 ; CHECK-NEXT: ubfx w0, w0, #8, #15
676 %t0 = and i32 %a0, 8388352
677 %t1 = ashr i32 %t0, 8
680 define i32 @test_i32_8388352_mask_ashr_9(i32 %a0) {
681 ; CHECK-LABEL: test_i32_8388352_mask_ashr_9:
683 ; CHECK-NEXT: ubfx w0, w0, #9, #14
685 %t0 = and i32 %a0, 8388352
686 %t1 = ashr i32 %t0, 9
689 define i32 @test_i32_8388352_mask_ashr_10(i32 %a0) {
690 ; CHECK-LABEL: test_i32_8388352_mask_ashr_10:
692 ; CHECK-NEXT: ubfx w0, w0, #10, #13
694 %t0 = and i32 %a0, 8388352
695 %t1 = ashr i32 %t0, 10
699 define i32 @test_i32_4294836224_mask_ashr_1(i32 %a0) {
700 ; CHECK-LABEL: test_i32_4294836224_mask_ashr_1:
702 ; CHECK-NEXT: and w8, w0, #0xfffe0000
703 ; CHECK-NEXT: asr w0, w8, #1
705 %t0 = and i32 %a0, 4294836224
706 %t1 = ashr i32 %t0, 1
709 define i32 @test_i32_4294836224_mask_ashr_16(i32 %a0) {
710 ; CHECK-LABEL: test_i32_4294836224_mask_ashr_16:
712 ; CHECK-NEXT: and w8, w0, #0xfffe0000
713 ; CHECK-NEXT: asr w0, w8, #16
715 %t0 = and i32 %a0, 4294836224
716 %t1 = ashr i32 %t0, 16
719 define i32 @test_i32_4294836224_mask_ashr_17(i32 %a0) {
720 ; CHECK-LABEL: test_i32_4294836224_mask_ashr_17:
722 ; CHECK-NEXT: asr w0, w0, #17
724 %t0 = and i32 %a0, 4294836224
725 %t1 = ashr i32 %t0, 17
728 define i32 @test_i32_4294836224_mask_ashr_18(i32 %a0) {
729 ; CHECK-LABEL: test_i32_4294836224_mask_ashr_18:
731 ; CHECK-NEXT: asr w0, w0, #18
733 %t0 = and i32 %a0, 4294836224
734 %t1 = ashr i32 %t0, 18
740 define i32 @test_i32_32767_mask_shl_1(i32 %a0) {
741 ; CHECK-LABEL: test_i32_32767_mask_shl_1:
743 ; CHECK-NEXT: and w8, w0, #0x7fff
744 ; CHECK-NEXT: lsl w0, w8, #1
746 %t0 = and i32 %a0, 32767
750 define i32 @test_i32_32767_mask_shl_16(i32 %a0) {
751 ; CHECK-LABEL: test_i32_32767_mask_shl_16:
753 ; CHECK-NEXT: and w8, w0, #0x7fff
754 ; CHECK-NEXT: lsl w0, w8, #16
756 %t0 = and i32 %a0, 32767
757 %t1 = shl i32 %t0, 16
760 define i32 @test_i32_32767_mask_shl_17(i32 %a0) {
761 ; CHECK-LABEL: test_i32_32767_mask_shl_17:
763 ; CHECK-NEXT: lsl w0, w0, #17
765 %t0 = and i32 %a0, 32767
766 %t1 = shl i32 %t0, 17
769 define i32 @test_i32_32767_mask_shl_18(i32 %a0) {
770 ; CHECK-LABEL: test_i32_32767_mask_shl_18:
772 ; CHECK-NEXT: lsl w0, w0, #18
774 %t0 = and i32 %a0, 32767
775 %t1 = shl i32 %t0, 18
779 define i32 @test_i32_8388352_mask_shl_7(i32 %a0) {
780 ; CHECK-LABEL: test_i32_8388352_mask_shl_7:
782 ; CHECK-NEXT: and w8, w0, #0x7fff00
783 ; CHECK-NEXT: lsl w0, w8, #7
785 %t0 = and i32 %a0, 8388352
789 define i32 @test_i32_8388352_mask_shl_8(i32 %a0) {
790 ; CHECK-LABEL: test_i32_8388352_mask_shl_8:
792 ; CHECK-NEXT: and w8, w0, #0x7fff00
793 ; CHECK-NEXT: lsl w0, w8, #8
795 %t0 = and i32 %a0, 8388352
799 define i32 @test_i32_8388352_mask_shl_9(i32 %a0) {
800 ; CHECK-LABEL: test_i32_8388352_mask_shl_9:
802 ; CHECK-NEXT: and w8, w0, #0x7fff00
803 ; CHECK-NEXT: lsl w0, w8, #9
805 %t0 = and i32 %a0, 8388352
809 define i32 @test_i32_8388352_mask_shl_10(i32 %a0) {
810 ; CHECK-LABEL: test_i32_8388352_mask_shl_10:
812 ; CHECK-NEXT: and w8, w0, #0x3fff00
813 ; CHECK-NEXT: lsl w0, w8, #10
815 %t0 = and i32 %a0, 8388352
816 %t1 = shl i32 %t0, 10
820 define i32 @test_i32_4294836224_mask_shl_1(i32 %a0) {
821 ; CHECK-LABEL: test_i32_4294836224_mask_shl_1:
823 ; CHECK-NEXT: and w8, w0, #0x7ffe0000
824 ; CHECK-NEXT: lsl w0, w8, #1
826 %t0 = and i32 %a0, 4294836224
831 ;------------------------------------------------------------------------------;
833 ;------------------------------------------------------------------------------;
837 define i64 @test_i64_2147483647_mask_lshr_1(i64 %a0) {
838 ; CHECK-LABEL: test_i64_2147483647_mask_lshr_1:
840 ; CHECK-NEXT: ubfx x0, x0, #1, #30
842 %t0 = and i64 %a0, 2147483647
843 %t1 = lshr i64 %t0, 1
847 define i64 @test_i64_140737488289792_mask_lshr_15(i64 %a0) {
848 ; CHECK-LABEL: test_i64_140737488289792_mask_lshr_15:
850 ; CHECK-NEXT: and x8, x0, #0x7fffffff0000
851 ; CHECK-NEXT: lsr x0, x8, #15
853 %t0 = and i64 %a0, 140737488289792
854 %t1 = lshr i64 %t0, 15
857 define i64 @test_i64_140737488289792_mask_lshr_16(i64 %a0) {
858 ; CHECK-LABEL: test_i64_140737488289792_mask_lshr_16:
860 ; CHECK-NEXT: ubfx x0, x0, #16, #31
862 %t0 = and i64 %a0, 140737488289792
863 %t1 = lshr i64 %t0, 16
866 define i64 @test_i64_140737488289792_mask_lshr_17(i64 %a0) {
867 ; CHECK-LABEL: test_i64_140737488289792_mask_lshr_17:
869 ; CHECK-NEXT: ubfx x0, x0, #17, #30
871 %t0 = and i64 %a0, 140737488289792
872 %t1 = lshr i64 %t0, 17
875 define i64 @test_i64_140737488289792_mask_lshr_18(i64 %a0) {
876 ; CHECK-LABEL: test_i64_140737488289792_mask_lshr_18:
878 ; CHECK-NEXT: ubfx x0, x0, #18, #29
880 %t0 = and i64 %a0, 140737488289792
881 %t1 = lshr i64 %t0, 18
885 define i64 @test_i64_18446744065119617024_mask_lshr_1(i64 %a0) {
886 ; CHECK-LABEL: test_i64_18446744065119617024_mask_lshr_1:
888 ; CHECK-NEXT: and x8, x0, #0xfffffffe00000000
889 ; CHECK-NEXT: lsr x0, x8, #1
891 %t0 = and i64 %a0, 18446744065119617024
892 %t1 = lshr i64 %t0, 1
895 define i64 @test_i64_18446744065119617024_mask_lshr_32(i64 %a0) {
896 ; CHECK-LABEL: test_i64_18446744065119617024_mask_lshr_32:
898 ; CHECK-NEXT: and x8, x0, #0xfffffffe00000000
899 ; CHECK-NEXT: lsr x0, x8, #32
901 %t0 = and i64 %a0, 18446744065119617024
902 %t1 = lshr i64 %t0, 32
905 define i64 @test_i64_18446744065119617024_mask_lshr_33(i64 %a0) {
906 ; CHECK-LABEL: test_i64_18446744065119617024_mask_lshr_33:
908 ; CHECK-NEXT: lsr x0, x0, #33
910 %t0 = and i64 %a0, 18446744065119617024
911 %t1 = lshr i64 %t0, 33
914 define i64 @test_i64_18446744065119617024_mask_lshr_34(i64 %a0) {
915 ; CHECK-LABEL: test_i64_18446744065119617024_mask_lshr_34:
917 ; CHECK-NEXT: lsr x0, x0, #34
919 %t0 = and i64 %a0, 18446744065119617024
920 %t1 = lshr i64 %t0, 34
926 define i64 @test_i64_2147483647_mask_ashr_1(i64 %a0) {
927 ; CHECK-LABEL: test_i64_2147483647_mask_ashr_1:
929 ; CHECK-NEXT: ubfx x0, x0, #1, #30
931 %t0 = and i64 %a0, 2147483647
932 %t1 = ashr i64 %t0, 1
936 define i64 @test_i64_140737488289792_mask_ashr_15(i64 %a0) {
937 ; CHECK-LABEL: test_i64_140737488289792_mask_ashr_15:
939 ; CHECK-NEXT: and x8, x0, #0x7fffffff0000
940 ; CHECK-NEXT: lsr x0, x8, #15
942 %t0 = and i64 %a0, 140737488289792
943 %t1 = ashr i64 %t0, 15
946 define i64 @test_i64_140737488289792_mask_ashr_16(i64 %a0) {
947 ; CHECK-LABEL: test_i64_140737488289792_mask_ashr_16:
949 ; CHECK-NEXT: ubfx x0, x0, #16, #31
951 %t0 = and i64 %a0, 140737488289792
952 %t1 = ashr i64 %t0, 16
955 define i64 @test_i64_140737488289792_mask_ashr_17(i64 %a0) {
956 ; CHECK-LABEL: test_i64_140737488289792_mask_ashr_17:
958 ; CHECK-NEXT: ubfx x0, x0, #17, #30
960 %t0 = and i64 %a0, 140737488289792
961 %t1 = ashr i64 %t0, 17
964 define i64 @test_i64_140737488289792_mask_ashr_18(i64 %a0) {
965 ; CHECK-LABEL: test_i64_140737488289792_mask_ashr_18:
967 ; CHECK-NEXT: ubfx x0, x0, #18, #29
969 %t0 = and i64 %a0, 140737488289792
970 %t1 = ashr i64 %t0, 18
974 define i64 @test_i64_18446744065119617024_mask_ashr_1(i64 %a0) {
975 ; CHECK-LABEL: test_i64_18446744065119617024_mask_ashr_1:
977 ; CHECK-NEXT: and x8, x0, #0xfffffffe00000000
978 ; CHECK-NEXT: asr x0, x8, #1
980 %t0 = and i64 %a0, 18446744065119617024
981 %t1 = ashr i64 %t0, 1
984 define i64 @test_i64_18446744065119617024_mask_ashr_32(i64 %a0) {
985 ; CHECK-LABEL: test_i64_18446744065119617024_mask_ashr_32:
987 ; CHECK-NEXT: and x8, x0, #0xfffffffe00000000
988 ; CHECK-NEXT: asr x0, x8, #32
990 %t0 = and i64 %a0, 18446744065119617024
991 %t1 = ashr i64 %t0, 32
994 define i64 @test_i64_18446744065119617024_mask_ashr_33(i64 %a0) {
995 ; CHECK-LABEL: test_i64_18446744065119617024_mask_ashr_33:
997 ; CHECK-NEXT: asr x0, x0, #33
999 %t0 = and i64 %a0, 18446744065119617024
1000 %t1 = ashr i64 %t0, 33
1003 define i64 @test_i64_18446744065119617024_mask_ashr_34(i64 %a0) {
1004 ; CHECK-LABEL: test_i64_18446744065119617024_mask_ashr_34:
1006 ; CHECK-NEXT: asr x0, x0, #34
1008 %t0 = and i64 %a0, 18446744065119617024
1009 %t1 = ashr i64 %t0, 34
1015 define i64 @test_i64_2147483647_mask_shl_1(i64 %a0) {
1016 ; CHECK-LABEL: test_i64_2147483647_mask_shl_1:
1018 ; CHECK-NEXT: and x8, x0, #0x7fffffff
1019 ; CHECK-NEXT: lsl x0, x8, #1
1021 %t0 = and i64 %a0, 2147483647
1022 %t1 = shl i64 %t0, 1
1025 define i64 @test_i64_2147483647_mask_shl_32(i64 %a0) {
1026 ; CHECK-LABEL: test_i64_2147483647_mask_shl_32:
1028 ; CHECK-NEXT: and w8, w0, #0x7fffffff
1029 ; CHECK-NEXT: lsl x0, x8, #32
1031 %t0 = and i64 %a0, 2147483647
1032 %t1 = shl i64 %t0, 32
1035 define i64 @test_i64_2147483647_mask_shl_33(i64 %a0) {
1036 ; CHECK-LABEL: test_i64_2147483647_mask_shl_33:
1038 ; CHECK-NEXT: lsl x0, x0, #33
1040 %t0 = and i64 %a0, 2147483647
1041 %t1 = shl i64 %t0, 33
1044 define i64 @test_i64_2147483647_mask_shl_34(i64 %a0) {
1045 ; CHECK-LABEL: test_i64_2147483647_mask_shl_34:
1047 ; CHECK-NEXT: lsl x0, x0, #34
1049 %t0 = and i64 %a0, 2147483647
1050 %t1 = shl i64 %t0, 34
1054 define i64 @test_i64_140737488289792_mask_shl_15(i64 %a0) {
1055 ; CHECK-LABEL: test_i64_140737488289792_mask_shl_15:
1057 ; CHECK-NEXT: and x8, x0, #0x7fffffff0000
1058 ; CHECK-NEXT: lsl x0, x8, #15
1060 %t0 = and i64 %a0, 140737488289792
1061 %t1 = shl i64 %t0, 15
1064 define i64 @test_i64_140737488289792_mask_shl_16(i64 %a0) {
1065 ; CHECK-LABEL: test_i64_140737488289792_mask_shl_16:
1067 ; CHECK-NEXT: and x8, x0, #0x7fffffff0000
1068 ; CHECK-NEXT: lsl x0, x8, #16
1070 %t0 = and i64 %a0, 140737488289792
1071 %t1 = shl i64 %t0, 16
1074 define i64 @test_i64_140737488289792_mask_shl_17(i64 %a0) {
1075 ; CHECK-LABEL: test_i64_140737488289792_mask_shl_17:
1077 ; CHECK-NEXT: and x8, x0, #0x7fffffff0000
1078 ; CHECK-NEXT: lsl x0, x8, #17
1080 %t0 = and i64 %a0, 140737488289792
1081 %t1 = shl i64 %t0, 17
1084 define i64 @test_i64_140737488289792_mask_shl_18(i64 %a0) {
1085 ; CHECK-LABEL: test_i64_140737488289792_mask_shl_18:
1087 ; CHECK-NEXT: and x8, x0, #0x3fffffff0000
1088 ; CHECK-NEXT: lsl x0, x8, #18
1090 %t0 = and i64 %a0, 140737488289792
1091 %t1 = shl i64 %t0, 18
1095 define i64 @test_i64_18446744065119617024_mask_shl_1(i64 %a0) {
1096 ; CHECK-LABEL: test_i64_18446744065119617024_mask_shl_1:
1098 ; CHECK-NEXT: and x8, x0, #0x7ffffffe00000000
1099 ; CHECK-NEXT: lsl x0, x8, #1
1101 %t0 = and i64 %a0, 18446744065119617024
1102 %t1 = shl i64 %t0, 1