1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 # Check that we select a 32-bit GPR G_ADD into ADDWrr on GPR32.
5 # Also check that we constrain the register class of the COPY to GPR32.
11 - { id: 0, class: gpr }
12 - { id: 1, class: gpr }
13 - { id: 2, class: gpr }
19 ; CHECK-LABEL: name: add_s32_gpr
20 ; CHECK: liveins: $w0, $w1
22 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
23 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
24 ; CHECK-NEXT: [[ADDWrr:%[0-9]+]]:gpr32 = ADDWrr [[COPY]], [[COPY1]]
25 ; CHECK-NEXT: $w0 = COPY [[ADDWrr]]
28 %2(s32) = G_ADD %0, %1
33 # Same as add_s32_gpr, for 64-bit operations.
39 - { id: 0, class: gpr }
40 - { id: 1, class: gpr }
41 - { id: 2, class: gpr }
47 ; CHECK-LABEL: name: add_s64_gpr
48 ; CHECK: liveins: $x0, $x1
50 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
51 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
52 ; CHECK-NEXT: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[COPY1]]
53 ; CHECK-NEXT: $x0 = COPY [[ADDXrr]]
56 %2(s64) = G_ADD %0, %1
66 - { id: 0, class: gpr }
67 - { id: 1, class: gpr }
68 - { id: 2, class: gpr }
74 ; CHECK-LABEL: name: add_imm_s32_gpr
75 ; CHECK: liveins: $w0, $w1
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
78 ; CHECK-NEXT: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[COPY]], 1, 0
79 ; CHECK-NEXT: $w0 = COPY [[ADDWri]]
81 %1(s32) = G_CONSTANT i32 1
82 %2(s32) = G_ADD %0, %1
92 - { id: 0, class: gpr }
93 - { id: 1, class: gpr }
94 - { id: 2, class: gpr }
100 ; CHECK-LABEL: name: add_imm_s64_gpr
101 ; CHECK: liveins: $x0, $w1
103 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
104 ; CHECK-NEXT: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 1, 0
105 ; CHECK-NEXT: $x0 = COPY [[ADDXri]]
107 %1(s64) = G_CONSTANT i64 1
108 %2(s64) = G_ADD %0, %1
113 name: add_neg_s32_gpr
115 regBankSelected: true
118 - { id: 0, class: gpr }
119 - { id: 1, class: gpr }
120 - { id: 2, class: gpr }
125 ; We should be able to turn the ADD into a SUB.
126 ; CHECK-LABEL: name: add_neg_s32_gpr
127 ; CHECK: liveins: $w1, $w2
129 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32sp = COPY $w1
130 ; CHECK-NEXT: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def dead $nzcv
131 ; CHECK-NEXT: $w2 = COPY [[SUBSWri]]
133 %1(s32) = G_CONSTANT i32 -1
134 %2(s32) = G_ADD %0, %1
139 name: add_neg_s64_gpr
141 regBankSelected: true
144 - { id: 0, class: gpr }
145 - { id: 1, class: gpr }
146 - { id: 2, class: gpr }
151 ; We should be able to turn the ADD into a SUB.
152 ; CHECK-LABEL: name: add_neg_s64_gpr
153 ; CHECK: liveins: $x0, $x1
155 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
156 ; CHECK-NEXT: [[SUBSXri:%[0-9]+]]:gpr64 = SUBSXri [[COPY]], 1, 0, implicit-def dead $nzcv
157 ; CHECK-NEXT: $x0 = COPY [[SUBSXri]]
159 %1(s64) = G_CONSTANT i64 -1
160 %2(s64) = G_ADD %0, %1
165 name: add_neg_invalid_immed_s32
167 regBankSelected: true
170 - { id: 0, class: gpr }
171 - { id: 1, class: gpr }
172 - { id: 2, class: gpr }
177 ; We can't select this if the value is out of range.
178 ; CHECK-LABEL: name: add_neg_invalid_immed_s32
179 ; CHECK: liveins: $x0, $x1
181 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
182 ; CHECK-NEXT: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -5000
183 ; CHECK-NEXT: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[MOVi64imm]]
184 ; CHECK-NEXT: $x0 = COPY [[ADDXrr]]
186 %1(s64) = G_CONSTANT i64 -5000
187 %2(s64) = G_ADD %0, %1
192 name: add_neg_invalid_immed_s64
194 regBankSelected: true
197 - { id: 0, class: gpr }
198 - { id: 1, class: gpr }
199 - { id: 2, class: gpr }
204 ; We can't select this if the value is out of range.
205 ; CHECK-LABEL: name: add_neg_invalid_immed_s64
206 ; CHECK: liveins: $x0, $x1
208 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
209 ; CHECK-NEXT: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -5000
210 ; CHECK-NEXT: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[MOVi64imm]]
211 ; CHECK-NEXT: $x0 = COPY [[ADDXrr]]
213 %1(s64) = G_CONSTANT i64 -5000
214 %2(s64) = G_ADD %0, %1
221 regBankSelected: true
224 - { id: 0, class: gpr }
225 - { id: 1, class: gpr }
226 - { id: 2, class: gpr }
231 ; We shouldn't get a SUB here, because "cmp wN, $0" and "cmp wN, #0" have
232 ; opposite effects on the C flag.
233 ; CHECK-LABEL: name: add_imm_0_s32
234 ; CHECK: liveins: $x0, $x1
236 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
237 ; CHECK-NEXT: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 0, 0
238 ; CHECK-NEXT: $x0 = COPY [[ADDXri]]
240 %1(s64) = G_CONSTANT i64 0
241 %2(s64) = G_ADD %0, %1
248 regBankSelected: true
251 - { id: 0, class: gpr }
252 - { id: 1, class: gpr }
253 - { id: 2, class: gpr }
258 ; We shouldn't get a SUB here, because "cmp xN, $0" and "cmp xN, #0" have
259 ; opposite effects on the C flag.
260 ; CHECK-LABEL: name: add_imm_0_s64
261 ; CHECK: liveins: $x0, $x1
263 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
264 ; CHECK-NEXT: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 0, 0
265 ; CHECK-NEXT: $x0 = COPY [[ADDXri]]
267 %1(s64) = G_CONSTANT i64 0
268 %2(s64) = G_ADD %0, %1
273 name: add_imm_s32_gpr_bb
275 regBankSelected: true
278 - { id: 0, class: gpr }
279 - { id: 1, class: gpr }
280 - { id: 2, class: gpr }
283 ; CHECK-LABEL: name: add_imm_s32_gpr_bb
285 ; CHECK-NEXT: successors: %bb.1(0x80000000)
286 ; CHECK-NEXT: liveins: $w0, $w1
288 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
289 ; CHECK-NEXT: B %bb.1
292 ; CHECK-NEXT: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[COPY]], 1, 0
293 ; CHECK-NEXT: $w0 = COPY [[ADDWri]]
299 %1(s32) = G_CONSTANT i32 1
303 %2(s32) = G_ADD %0, %1
308 # Same as add_s32_gpr, for G_SUB operations.
311 regBankSelected: true
314 - { id: 0, class: gpr }
315 - { id: 1, class: gpr }
316 - { id: 2, class: gpr }
322 ; CHECK-LABEL: name: sub_s32_gpr
323 ; CHECK: liveins: $w0, $w1
325 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
326 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
327 ; CHECK-NEXT: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr [[COPY]], [[COPY1]], implicit-def dead $nzcv
328 ; CHECK-NEXT: $w0 = COPY [[SUBSWrr]]
331 %2(s32) = G_SUB %0, %1
336 # Same as add_s64_gpr, for G_SUB operations.
339 regBankSelected: true
342 - { id: 0, class: gpr }
343 - { id: 1, class: gpr }
344 - { id: 2, class: gpr }
350 ; CHECK-LABEL: name: sub_s64_gpr
351 ; CHECK: liveins: $x0, $x1
353 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
354 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
355 ; CHECK-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr [[COPY]], [[COPY1]], implicit-def dead $nzcv
356 ; CHECK-NEXT: $x0 = COPY [[SUBSXrr]]
359 %2(s64) = G_SUB %0, %1
364 # Same as add_s32_gpr, for G_OR operations.
367 regBankSelected: true
370 - { id: 0, class: gpr }
371 - { id: 1, class: gpr }
372 - { id: 2, class: gpr }
378 ; CHECK-LABEL: name: or_s32_gpr
379 ; CHECK: liveins: $w0, $w1
381 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
382 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
383 ; CHECK-NEXT: [[ORRWrr:%[0-9]+]]:gpr32 = ORRWrr [[COPY]], [[COPY1]]
384 ; CHECK-NEXT: $w0 = COPY [[ORRWrr]]
387 %2(s32) = G_OR %0, %1
392 # Same as add_s64_gpr, for G_OR operations.
395 regBankSelected: true
398 - { id: 0, class: gpr }
399 - { id: 1, class: gpr }
400 - { id: 2, class: gpr }
406 ; CHECK-LABEL: name: or_s64_gpr
407 ; CHECK: liveins: $x0, $x1
409 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
410 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
411 ; CHECK-NEXT: [[ORRXrr:%[0-9]+]]:gpr64 = ORRXrr [[COPY]], [[COPY1]]
412 ; CHECK-NEXT: $x0 = COPY [[ORRXrr]]
415 %2(s64) = G_OR %0, %1
420 # 64-bit G_OR on vector registers.
423 regBankSelected: true
426 - { id: 0, class: fpr }
427 - { id: 1, class: fpr }
428 - { id: 2, class: fpr }
430 # The actual OR does not matter as long as it is operating
431 # on 64-bit width vector.
436 ; CHECK-LABEL: name: or_v2s32_fpr
437 ; CHECK: liveins: $d0, $d1
439 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
440 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
441 ; CHECK-NEXT: [[ORRv8i8_:%[0-9]+]]:fpr64 = ORRv8i8 [[COPY]], [[COPY1]]
442 ; CHECK-NEXT: $d0 = COPY [[ORRv8i8_]]
443 %0(<2 x s32>) = COPY $d0
444 %1(<2 x s32>) = COPY $d1
445 %2(<2 x s32>) = G_OR %0, %1
446 $d0 = COPY %2(<2 x s32>)
450 # Same as add_s32_gpr, for G_AND operations.
453 regBankSelected: true
456 - { id: 0, class: gpr }
457 - { id: 1, class: gpr }
458 - { id: 2, class: gpr }
464 ; CHECK-LABEL: name: and_s32_gpr
465 ; CHECK: liveins: $w0, $w1
467 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
468 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
469 ; CHECK-NEXT: [[ANDWrr:%[0-9]+]]:gpr32 = ANDWrr [[COPY]], [[COPY1]]
470 ; CHECK-NEXT: $w0 = COPY [[ANDWrr]]
473 %2(s32) = G_AND %0, %1
478 # Same as add_s64_gpr, for G_AND operations.
481 regBankSelected: true
484 - { id: 0, class: gpr }
485 - { id: 1, class: gpr }
486 - { id: 2, class: gpr }
492 ; CHECK-LABEL: name: and_s64_gpr
493 ; CHECK: liveins: $x0, $x1
495 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
496 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
497 ; CHECK-NEXT: [[ANDXrr:%[0-9]+]]:gpr64 = ANDXrr [[COPY]], [[COPY1]]
498 ; CHECK-NEXT: $x0 = COPY [[ANDXrr]]
501 %2(s64) = G_AND %0, %1
506 # Same as add_s32_gpr, for G_SHL operations.
509 regBankSelected: true
512 - { id: 0, class: gpr }
513 - { id: 1, class: gpr }
514 - { id: 2, class: gpr }
520 ; CHECK-LABEL: name: shl_s32_gpr
521 ; CHECK: liveins: $w0, $w1
523 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
524 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
525 ; CHECK-NEXT: [[LSLVWr:%[0-9]+]]:gpr32 = LSLVWr [[COPY]], [[COPY1]]
526 ; CHECK-NEXT: $w0 = COPY [[LSLVWr]]
529 %2(s32) = G_SHL %0, %1
536 regBankSelected: true
539 - { id: 0, class: gpr }
540 - { id: 1, class: gpr }
541 - { id: 2, class: gpr }
547 ; CHECK-LABEL: name: shl_s32_64_gpr
548 ; CHECK: liveins: $w0, $x1
550 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
551 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64all = COPY $x1
552 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr32 = COPY [[COPY1]].sub_32
553 ; CHECK-NEXT: [[LSLVWr:%[0-9]+]]:gpr32 = LSLVWr [[COPY]], [[COPY2]]
554 ; CHECK-NEXT: $w0 = COPY [[LSLVWr]]
557 %2(s32) = G_SHL %0, %1
562 # Same as add_s64_gpr, for G_SHL operations.
565 regBankSelected: true
568 - { id: 0, class: gpr }
569 - { id: 1, class: gpr }
570 - { id: 2, class: gpr }
576 ; CHECK-LABEL: name: shl_s64_gpr
577 ; CHECK: liveins: $x0, $x1
579 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
580 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
581 ; CHECK-NEXT: [[LSLVXr:%[0-9]+]]:gpr64 = LSLVXr [[COPY]], [[COPY1]]
582 ; CHECK-NEXT: $x0 = COPY [[LSLVXr]]
585 %2(s64) = G_SHL %0, %1
590 # Same as add_s32_gpr, for G_LSHR operations.
593 regBankSelected: true
596 - { id: 0, class: gpr }
597 - { id: 1, class: gpr }
598 - { id: 2, class: gpr }
604 ; CHECK-LABEL: name: lshr_s32_gpr
605 ; CHECK: liveins: $w0, $w1
607 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
608 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
609 ; CHECK-NEXT: [[LSRVWr:%[0-9]+]]:gpr32 = LSRVWr [[COPY]], [[COPY1]]
610 ; CHECK-NEXT: $w0 = COPY [[LSRVWr]]
613 %2(s32) = G_LSHR %0, %1
618 # Same as add_s64_gpr, for G_LSHR operations.
621 regBankSelected: true
624 - { id: 0, class: gpr }
625 - { id: 1, class: gpr }
626 - { id: 2, class: gpr }
632 ; CHECK-LABEL: name: lshr_s64_gpr
633 ; CHECK: liveins: $x0, $x1
635 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
636 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
637 ; CHECK-NEXT: [[LSRVXr:%[0-9]+]]:gpr64 = LSRVXr [[COPY]], [[COPY1]]
638 ; CHECK-NEXT: $x0 = COPY [[LSRVXr]]
641 %2(s64) = G_LSHR %0, %1
646 # Same as add_s32_gpr, for G_ASHR operations.
649 regBankSelected: true
652 - { id: 0, class: gpr }
653 - { id: 1, class: gpr }
654 - { id: 2, class: gpr }
660 ; CHECK-LABEL: name: ashr_s32_gpr
661 ; CHECK: liveins: $w0, $w1
663 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
664 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
665 ; CHECK-NEXT: [[ASRVWr:%[0-9]+]]:gpr32 = ASRVWr [[COPY]], [[COPY1]]
666 ; CHECK-NEXT: $w0 = COPY [[ASRVWr]]
669 %2(s32) = G_ASHR %0, %1
674 # Same as add_s64_gpr, for G_ASHR operations.
677 regBankSelected: true
680 - { id: 0, class: gpr }
681 - { id: 1, class: gpr }
682 - { id: 2, class: gpr }
688 ; CHECK-LABEL: name: ashr_s64_gpr
689 ; CHECK: liveins: $x0, $x1
691 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
692 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
693 ; CHECK-NEXT: [[ASRVXr:%[0-9]+]]:gpr64 = ASRVXr [[COPY]], [[COPY1]]
694 ; CHECK-NEXT: $x0 = COPY [[ASRVXr]]
697 %2(s64) = G_ASHR %0, %1
702 # Check that we select s32 GPR G_MUL. This is trickier than other binops because
703 # there is only MADDWrrr, and we have to use the WZR physreg.
706 regBankSelected: true
709 - { id: 0, class: gpr }
710 - { id: 1, class: gpr }
711 - { id: 2, class: gpr }
717 ; CHECK-LABEL: name: mul_s32_gpr
718 ; CHECK: liveins: $w0, $w1
720 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
721 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
722 ; CHECK-NEXT: [[MADDWrrr:%[0-9]+]]:gpr32 = MADDWrrr [[COPY]], [[COPY1]], $wzr
723 ; CHECK-NEXT: $w0 = COPY [[MADDWrrr]]
726 %2(s32) = G_MUL %0, %1
731 # Same as mul_s32_gpr for the s64 type.
734 regBankSelected: true
737 - { id: 0, class: gpr }
738 - { id: 1, class: gpr }
739 - { id: 2, class: gpr }
745 ; CHECK-LABEL: name: mul_s64_gpr
746 ; CHECK: liveins: $x0, $x1
748 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
749 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
750 ; CHECK-NEXT: [[MADDXrrr:%[0-9]+]]:gpr64 = MADDXrrr [[COPY]], [[COPY1]], $xzr
751 ; CHECK-NEXT: $x0 = COPY [[MADDXrrr]]
754 %2(s64) = G_MUL %0, %1
759 # Same as mul_s32_gpr for the s64 type.
762 regBankSelected: true
769 ; CHECK-LABEL: name: mulh_s64_gpr
770 ; CHECK: liveins: $x0, $x1
772 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
773 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
774 ; CHECK-NEXT: [[SMULHrr:%[0-9]+]]:gpr64 = SMULHrr [[COPY]], [[COPY1]]
775 ; CHECK-NEXT: [[UMULHrr:%[0-9]+]]:gpr64 = UMULHrr [[COPY]], [[COPY1]]
776 ; CHECK-NEXT: $x0 = COPY [[SMULHrr]]
777 ; CHECK-NEXT: $x0 = COPY [[UMULHrr]]
778 %0:gpr(s64) = COPY $x0
779 %1:gpr(s64) = COPY $x1
780 %2:gpr(s64) = G_SMULH %0, %1
781 %3:gpr(s64) = G_UMULH %0, %1
787 # Same as add_s32_gpr, for G_SDIV operations.
790 regBankSelected: true
793 - { id: 0, class: gpr }
794 - { id: 1, class: gpr }
795 - { id: 2, class: gpr }
801 ; CHECK-LABEL: name: sdiv_s32_gpr
802 ; CHECK: liveins: $w0, $w1
804 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
805 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
806 ; CHECK-NEXT: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[COPY]], [[COPY1]]
807 ; CHECK-NEXT: $w0 = COPY [[SDIVWr]]
810 %2(s32) = G_SDIV %0, %1
815 # Same as add_s64_gpr, for G_SDIV operations.
818 regBankSelected: true
821 - { id: 0, class: gpr }
822 - { id: 1, class: gpr }
823 - { id: 2, class: gpr }
829 ; CHECK-LABEL: name: sdiv_s64_gpr
830 ; CHECK: liveins: $x0, $x1
832 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
833 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
834 ; CHECK-NEXT: [[SDIVXr:%[0-9]+]]:gpr64 = SDIVXr [[COPY]], [[COPY1]]
835 ; CHECK-NEXT: $x0 = COPY [[SDIVXr]]
838 %2(s64) = G_SDIV %0, %1
843 # Same as add_s32_gpr, for G_UDIV operations.
846 regBankSelected: true
849 - { id: 0, class: gpr }
850 - { id: 1, class: gpr }
851 - { id: 2, class: gpr }
857 ; CHECK-LABEL: name: udiv_s32_gpr
858 ; CHECK: liveins: $w0, $w1
860 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
861 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
862 ; CHECK-NEXT: [[UDIVWr:%[0-9]+]]:gpr32 = UDIVWr [[COPY]], [[COPY1]]
863 ; CHECK-NEXT: $w0 = COPY [[UDIVWr]]
866 %2(s32) = G_UDIV %0, %1
871 # Same as add_s64_gpr, for G_UDIV operations.
874 regBankSelected: true
877 - { id: 0, class: gpr }
878 - { id: 1, class: gpr }
879 - { id: 2, class: gpr }
885 ; CHECK-LABEL: name: udiv_s64_gpr
886 ; CHECK: liveins: $x0, $x1
888 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
889 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
890 ; CHECK-NEXT: [[UDIVXr:%[0-9]+]]:gpr64 = UDIVXr [[COPY]], [[COPY1]]
891 ; CHECK-NEXT: $x0 = COPY [[UDIVXr]]
894 %2(s64) = G_UDIV %0, %1
899 # Check that we select a s32 FPR G_FADD into FADDSrr.
902 regBankSelected: true
905 - { id: 0, class: fpr }
906 - { id: 1, class: fpr }
907 - { id: 2, class: fpr }
913 ; CHECK-LABEL: name: fadd_s32_fpr
914 ; CHECK: liveins: $s0, $s1
916 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
917 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
918 ; CHECK-NEXT: [[FADDSrr:%[0-9]+]]:fpr32 = nofpexcept FADDSrr [[COPY]], [[COPY1]], implicit $fpcr
919 ; CHECK-NEXT: $s0 = COPY [[FADDSrr]]
922 %2(s32) = G_FADD %0, %1
929 regBankSelected: true
932 - { id: 0, class: fpr }
933 - { id: 1, class: fpr }
934 - { id: 2, class: fpr }
940 ; CHECK-LABEL: name: fadd_s64_fpr
941 ; CHECK: liveins: $d0, $d1
943 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
944 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
945 ; CHECK-NEXT: [[FADDDrr:%[0-9]+]]:fpr64 = nofpexcept FADDDrr [[COPY]], [[COPY1]], implicit $fpcr
946 ; CHECK-NEXT: $d0 = COPY [[FADDDrr]]
949 %2(s64) = G_FADD %0, %1
956 regBankSelected: true
959 - { id: 0, class: fpr }
960 - { id: 1, class: fpr }
961 - { id: 2, class: fpr }
967 ; CHECK-LABEL: name: fsub_s32_fpr
968 ; CHECK: liveins: $s0, $s1
970 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
971 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
972 ; CHECK-NEXT: [[FSUBSrr:%[0-9]+]]:fpr32 = nofpexcept FSUBSrr [[COPY]], [[COPY1]], implicit $fpcr
973 ; CHECK-NEXT: $s0 = COPY [[FSUBSrr]]
976 %2(s32) = G_FSUB %0, %1
983 regBankSelected: true
986 - { id: 0, class: fpr }
987 - { id: 1, class: fpr }
988 - { id: 2, class: fpr }
994 ; CHECK-LABEL: name: fsub_s64_fpr
995 ; CHECK: liveins: $d0, $d1
997 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
998 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
999 ; CHECK-NEXT: [[FSUBDrr:%[0-9]+]]:fpr64 = nofpexcept FSUBDrr [[COPY]], [[COPY1]], implicit $fpcr
1000 ; CHECK-NEXT: $d0 = COPY [[FSUBDrr]]
1003 %2(s64) = G_FSUB %0, %1
1010 regBankSelected: true
1013 - { id: 0, class: fpr }
1014 - { id: 1, class: fpr }
1015 - { id: 2, class: fpr }
1021 ; CHECK-LABEL: name: fmul_s32_fpr
1022 ; CHECK: liveins: $s0, $s1
1023 ; CHECK-NEXT: {{ $}}
1024 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
1025 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
1026 ; CHECK-NEXT: [[FMULSrr:%[0-9]+]]:fpr32 = nofpexcept FMULSrr [[COPY]], [[COPY1]], implicit $fpcr
1027 ; CHECK-NEXT: $s0 = COPY [[FMULSrr]]
1030 %2(s32) = G_FMUL %0, %1
1037 regBankSelected: true
1040 - { id: 0, class: fpr }
1041 - { id: 1, class: fpr }
1042 - { id: 2, class: fpr }
1048 ; CHECK-LABEL: name: fmul_s64_fpr
1049 ; CHECK: liveins: $d0, $d1
1050 ; CHECK-NEXT: {{ $}}
1051 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1052 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1053 ; CHECK-NEXT: [[FMULDrr:%[0-9]+]]:fpr64 = nofpexcept FMULDrr [[COPY]], [[COPY1]], implicit $fpcr
1054 ; CHECK-NEXT: $d0 = COPY [[FMULDrr]]
1057 %2(s64) = G_FMUL %0, %1
1064 regBankSelected: true
1067 - { id: 0, class: fpr }
1068 - { id: 1, class: fpr }
1069 - { id: 2, class: fpr }
1075 ; CHECK-LABEL: name: fdiv_s32_fpr
1076 ; CHECK: liveins: $s0, $s1
1077 ; CHECK-NEXT: {{ $}}
1078 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
1079 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
1080 ; CHECK-NEXT: [[FDIVSrr:%[0-9]+]]:fpr32 = nofpexcept FDIVSrr [[COPY]], [[COPY1]], implicit $fpcr
1081 ; CHECK-NEXT: $s0 = COPY [[FDIVSrr]]
1084 %2(s32) = G_FDIV %0, %1
1091 regBankSelected: true
1094 - { id: 0, class: fpr }
1095 - { id: 1, class: fpr }
1096 - { id: 2, class: fpr }
1102 ; CHECK-LABEL: name: fdiv_s64_fpr
1103 ; CHECK: liveins: $d0, $d1
1104 ; CHECK-NEXT: {{ $}}
1105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1106 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1107 ; CHECK-NEXT: [[FDIVDrr:%[0-9]+]]:fpr64 = nofpexcept FDIVDrr [[COPY]], [[COPY1]], implicit $fpcr
1108 ; CHECK-NEXT: $d0 = COPY [[FDIVDrr]]
1111 %2(s64) = G_FDIV %0, %1
1118 regBankSelected: true
1119 tracksRegLiveness: true
1121 - { id: 0, class: fpr }
1122 - { id: 1, class: fpr }
1123 - { id: 2, class: fpr }
1124 machineFunctionInfo: {}
1129 ; CHECK-LABEL: name: add_v8i16
1130 ; CHECK: liveins: $q0, $q1
1131 ; CHECK-NEXT: {{ $}}
1132 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
1133 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr128 = COPY $q1
1134 ; CHECK-NEXT: [[ADDv8i16_:%[0-9]+]]:fpr128 = ADDv8i16 [[COPY]], [[COPY1]]
1135 ; CHECK-NEXT: $q0 = COPY [[ADDv8i16_]]
1136 ; CHECK-NEXT: RET_ReallyLR implicit $q0
1137 %0:fpr(<8 x s16>) = COPY $q0
1138 %1:fpr(<8 x s16>) = COPY $q1
1139 %2:fpr(<8 x s16>) = G_ADD %0, %1
1140 $q0 = COPY %2(<8 x s16>)
1141 RET_ReallyLR implicit $q0
1148 regBankSelected: true
1149 tracksRegLiveness: true
1151 - { id: 0, class: fpr }
1152 - { id: 1, class: fpr }
1153 - { id: 2, class: fpr }
1154 machineFunctionInfo: {}
1159 ; CHECK-LABEL: name: add_v16i8
1160 ; CHECK: liveins: $q0, $q1
1161 ; CHECK-NEXT: {{ $}}
1162 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
1163 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr128 = COPY $q1
1164 ; CHECK-NEXT: [[ADDv16i8_:%[0-9]+]]:fpr128 = ADDv16i8 [[COPY]], [[COPY1]]
1165 ; CHECK-NEXT: $q0 = COPY [[ADDv16i8_]]
1166 ; CHECK-NEXT: RET_ReallyLR implicit $q0
1167 %0:fpr(<16 x s8>) = COPY $q0
1168 %1:fpr(<16 x s8>) = COPY $q1
1169 %2:fpr(<16 x s8>) = G_ADD %0, %1
1170 $q0 = COPY %2(<16 x s8>)
1171 RET_ReallyLR implicit $q0
1177 regBankSelected: true
1178 tracksRegLiveness: true
1183 ; CHECK-LABEL: name: add_v4i16
1184 ; CHECK: liveins: $d0, $d1
1185 ; CHECK-NEXT: {{ $}}
1186 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1187 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1188 ; CHECK-NEXT: [[ADDv4i16_:%[0-9]+]]:fpr64 = ADDv4i16 [[COPY]], [[COPY1]]
1189 ; CHECK-NEXT: $d0 = COPY [[ADDv4i16_]]
1190 ; CHECK-NEXT: RET_ReallyLR implicit $d0
1191 %0:fpr(<4 x s16>) = COPY $d0
1192 %1:fpr(<4 x s16>) = COPY $d1
1193 %2:fpr(<4 x s16>) = G_ADD %0, %1
1194 $d0 = COPY %2(<4 x s16>)
1195 RET_ReallyLR implicit $d0
1200 regBankSelected: true
1201 tracksRegLiveness: true
1206 ; CHECK-LABEL: name: or_v4i16
1207 ; CHECK: liveins: $d0, $d1
1208 ; CHECK-NEXT: {{ $}}
1209 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1210 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1211 ; CHECK-NEXT: [[ORRv8i8_:%[0-9]+]]:fpr64 = ORRv8i8 [[COPY]], [[COPY1]]
1212 ; CHECK-NEXT: $d0 = COPY [[ORRv8i8_]]
1213 ; CHECK-NEXT: RET_ReallyLR implicit $d0
1214 %0:fpr(<4 x s16>) = COPY $d0
1215 %1:fpr(<4 x s16>) = COPY $d1
1216 %2:fpr(<4 x s16>) = G_OR %0, %1
1217 $d0 = COPY %2(<4 x s16>)
1218 RET_ReallyLR implicit $d0
1223 regBankSelected: true
1224 tracksRegLiveness: true
1229 ; CHECK-LABEL: name: xor_v4i16
1230 ; CHECK: liveins: $d0, $d1
1231 ; CHECK-NEXT: {{ $}}
1232 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1233 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1234 ; CHECK-NEXT: [[EORv8i8_:%[0-9]+]]:fpr64 = EORv8i8 [[COPY]], [[COPY1]]
1235 ; CHECK-NEXT: $d0 = COPY [[EORv8i8_]]
1236 ; CHECK-NEXT: RET_ReallyLR implicit $d0
1237 %0:fpr(<4 x s16>) = COPY $d0
1238 %1:fpr(<4 x s16>) = COPY $d1
1239 %2:fpr(<4 x s16>) = G_XOR %0, %1
1240 $d0 = COPY %2(<4 x s16>)
1241 RET_ReallyLR implicit $d0
1246 regBankSelected: true
1247 tracksRegLiveness: true
1252 ; CHECK-LABEL: name: mul_v4i16
1253 ; CHECK: liveins: $d0, $d1
1254 ; CHECK-NEXT: {{ $}}
1255 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1256 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1257 ; CHECK-NEXT: [[MULv4i16_:%[0-9]+]]:fpr64 = MULv4i16 [[COPY]], [[COPY1]]
1258 ; CHECK-NEXT: $d0 = COPY [[MULv4i16_]]
1259 ; CHECK-NEXT: RET_ReallyLR implicit $d0
1260 %0:fpr(<4 x s16>) = COPY $d0
1261 %1:fpr(<4 x s16>) = COPY $d1
1262 %2:fpr(<4 x s16>) = G_MUL %0, %1
1263 $d0 = COPY %2(<4 x s16>)
1264 RET_ReallyLR implicit $d0