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
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @add_s32_gpr() { ret void }
8 define void @add_s64_gpr() { ret void }
10 define void @add_imm_s32_gpr() { ret void }
11 define void @add_imm_s64_gpr() { ret void }
13 define void @add_neg_s32_gpr() { ret void }
14 define void @add_neg_s64_gpr() { ret void }
15 define void @add_neg_invalid_immed_s32() { ret void }
16 define void @add_neg_invalid_immed_s64() { ret void }
17 define void @add_imm_0_s32() { ret void }
18 define void @add_imm_0_s64() { ret void }
20 define void @add_imm_s32_gpr_bb() { ret void }
22 define void @sub_s32_gpr() { ret void }
23 define void @sub_s64_gpr() { ret void }
25 define void @or_s32_gpr() { ret void }
26 define void @or_s64_gpr() { ret void }
27 define void @or_v2s32_fpr() { ret void }
29 define void @and_s32_gpr() { ret void }
30 define void @and_s64_gpr() { ret void }
32 define void @shl_s32_gpr() { ret void }
33 define void @shl_s64_gpr() { ret void }
35 define void @lshr_s32_gpr() { ret void }
36 define void @lshr_s64_gpr() { ret void }
38 define void @ashr_s32_gpr() { ret void }
39 define void @ashr_s64_gpr() { ret void }
41 define void @mul_s32_gpr() { ret void }
42 define void @mul_s64_gpr() { ret void }
44 define void @mulh_s64_gpr() { ret void }
46 define void @sdiv_s32_gpr() { ret void }
47 define void @sdiv_s64_gpr() { ret void }
49 define void @udiv_s32_gpr() { ret void }
50 define void @udiv_s64_gpr() { ret void }
52 define void @fadd_s32_fpr() { ret void }
53 define void @fadd_s64_fpr() { ret void }
55 define void @fsub_s32_fpr() { ret void }
56 define void @fsub_s64_fpr() { ret void }
58 define void @fmul_s32_fpr() { ret void }
59 define void @fmul_s64_fpr() { ret void }
61 define void @fdiv_s32_fpr() { ret void }
62 define void @fdiv_s64_fpr() { ret void }
64 define void @add_v8i16() { ret void }
65 define void @add_v16i8() { ret void }
70 # Check that we select a 32-bit GPR G_ADD into ADDWrr on GPR32.
71 # Also check that we constrain the register class of the COPY to GPR32.
77 - { id: 0, class: gpr }
78 - { id: 1, class: gpr }
79 - { id: 2, class: gpr }
85 ; CHECK-LABEL: name: add_s32_gpr
86 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
87 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
88 ; CHECK: [[ADDWrr:%[0-9]+]]:gpr32 = ADDWrr [[COPY]], [[COPY1]]
89 ; CHECK: $w0 = COPY [[ADDWrr]]
92 %2(s32) = G_ADD %0, %1
97 # Same as add_s32_gpr, for 64-bit operations.
100 regBankSelected: true
103 - { id: 0, class: gpr }
104 - { id: 1, class: gpr }
105 - { id: 2, class: gpr }
111 ; CHECK-LABEL: name: add_s64_gpr
112 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
113 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
114 ; CHECK: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[COPY1]]
115 ; CHECK: $x0 = COPY [[ADDXrr]]
118 %2(s64) = G_ADD %0, %1
123 name: add_imm_s32_gpr
125 regBankSelected: true
128 - { id: 0, class: gpr }
129 - { id: 1, class: gpr }
130 - { id: 2, class: gpr }
136 ; CHECK-LABEL: name: add_imm_s32_gpr
137 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
138 ; CHECK: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[COPY]], 1, 0
139 ; CHECK: $w0 = COPY [[ADDWri]]
141 %1(s32) = G_CONSTANT i32 1
142 %2(s32) = G_ADD %0, %1
147 name: add_imm_s64_gpr
149 regBankSelected: true
152 - { id: 0, class: gpr }
153 - { id: 1, class: gpr }
154 - { id: 2, class: gpr }
160 ; CHECK-LABEL: name: add_imm_s64_gpr
161 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
162 ; CHECK: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 1, 0
163 ; CHECK: $x0 = COPY [[ADDXri]]
165 %1(s64) = G_CONSTANT i64 1
166 %2(s64) = G_ADD %0, %1
171 name: add_neg_s32_gpr
173 regBankSelected: true
176 - { id: 0, class: gpr }
177 - { id: 1, class: gpr }
178 - { id: 2, class: gpr }
183 ; We should be able to turn the ADD into a SUB.
184 ; CHECK-LABEL: name: add_neg_s32_gpr
185 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w1
186 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
187 ; CHECK: $w2 = COPY [[SUBSWri]]
189 %1(s32) = G_CONSTANT i32 -1
190 %2(s32) = G_ADD %0, %1
195 name: add_neg_s64_gpr
197 regBankSelected: true
200 - { id: 0, class: gpr }
201 - { id: 1, class: gpr }
202 - { id: 2, class: gpr }
207 ; We should be able to turn the ADD into a SUB.
208 ; CHECK-LABEL: name: add_neg_s64_gpr
209 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
210 ; CHECK: [[SUBSXri:%[0-9]+]]:gpr64 = SUBSXri [[COPY]], 1, 0, implicit-def $nzcv
211 ; CHECK: $x0 = COPY [[SUBSXri]]
213 %1(s64) = G_CONSTANT i64 -1
214 %2(s64) = G_ADD %0, %1
219 name: add_neg_invalid_immed_s32
221 regBankSelected: true
224 - { id: 0, class: gpr }
225 - { id: 1, class: gpr }
226 - { id: 2, class: gpr }
231 ; We can't select this if the value is out of range.
232 ; CHECK-LABEL: name: add_neg_invalid_immed_s32
233 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
234 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -5000
235 ; CHECK: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[MOVi64imm]]
236 ; CHECK: $x0 = COPY [[ADDXrr]]
238 %1(s64) = G_CONSTANT i64 -5000
239 %2(s64) = G_ADD %0, %1
244 name: add_neg_invalid_immed_s64
246 regBankSelected: true
249 - { id: 0, class: gpr }
250 - { id: 1, class: gpr }
251 - { id: 2, class: gpr }
256 ; We can't select this if the value is out of range.
257 ; CHECK-LABEL: name: add_neg_invalid_immed_s64
258 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
259 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm -5000
260 ; CHECK: [[ADDXrr:%[0-9]+]]:gpr64 = ADDXrr [[COPY]], [[MOVi64imm]]
261 ; CHECK: $x0 = COPY [[ADDXrr]]
263 %1(s64) = G_CONSTANT i64 -5000
264 %2(s64) = G_ADD %0, %1
271 regBankSelected: true
274 - { id: 0, class: gpr }
275 - { id: 1, class: gpr }
276 - { id: 2, class: gpr }
281 ; We shouldn't get a SUB here, because "cmp wN, $0" and "cmp wN, #0" have
282 ; opposite effects on the C flag.
283 ; CHECK-LABEL: name: add_imm_0_s32
284 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
285 ; CHECK: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 0, 0
286 ; CHECK: $x0 = COPY [[ADDXri]]
288 %1(s64) = G_CONSTANT i64 0
289 %2(s64) = G_ADD %0, %1
296 regBankSelected: true
299 - { id: 0, class: gpr }
300 - { id: 1, class: gpr }
301 - { id: 2, class: gpr }
306 ; We shouldn't get a SUB here, because "cmp xN, $0" and "cmp xN, #0" have
307 ; opposite effects on the C flag.
308 ; CHECK-LABEL: name: add_imm_0_s64
309 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
310 ; CHECK: [[ADDXri:%[0-9]+]]:gpr64sp = ADDXri [[COPY]], 0, 0
311 ; CHECK: $x0 = COPY [[ADDXri]]
313 %1(s64) = G_CONSTANT i64 0
314 %2(s64) = G_ADD %0, %1
319 name: add_imm_s32_gpr_bb
321 regBankSelected: true
324 - { id: 0, class: gpr }
325 - { id: 1, class: gpr }
326 - { id: 2, class: gpr }
329 ; CHECK-LABEL: name: add_imm_s32_gpr_bb
331 ; CHECK: successors: %bb.1(0x80000000)
332 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
335 ; CHECK: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[COPY]], 1, 0
336 ; CHECK: $w0 = COPY [[ADDWri]]
342 %1(s32) = G_CONSTANT i32 1
346 %2(s32) = G_ADD %0, %1
351 # Same as add_s32_gpr, for G_SUB operations.
354 regBankSelected: true
357 - { id: 0, class: gpr }
358 - { id: 1, class: gpr }
359 - { id: 2, class: gpr }
365 ; CHECK-LABEL: name: sub_s32_gpr
366 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
367 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
368 ; CHECK: [[SUBSWrr:%[0-9]+]]:gpr32 = SUBSWrr [[COPY]], [[COPY1]], implicit-def $nzcv
369 ; CHECK: $w0 = COPY [[SUBSWrr]]
372 %2(s32) = G_SUB %0, %1
377 # Same as add_s64_gpr, for G_SUB operations.
380 regBankSelected: true
383 - { id: 0, class: gpr }
384 - { id: 1, class: gpr }
385 - { id: 2, class: gpr }
391 ; CHECK-LABEL: name: sub_s64_gpr
392 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
393 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
394 ; CHECK: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr [[COPY]], [[COPY1]], implicit-def $nzcv
395 ; CHECK: $x0 = COPY [[SUBSXrr]]
398 %2(s64) = G_SUB %0, %1
403 # Same as add_s32_gpr, for G_OR operations.
406 regBankSelected: true
409 - { id: 0, class: gpr }
410 - { id: 1, class: gpr }
411 - { id: 2, class: gpr }
417 ; CHECK-LABEL: name: or_s32_gpr
418 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
419 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
420 ; CHECK: [[ORRWrr:%[0-9]+]]:gpr32 = ORRWrr [[COPY]], [[COPY1]]
421 ; CHECK: $w0 = COPY [[ORRWrr]]
424 %2(s32) = G_OR %0, %1
429 # Same as add_s64_gpr, for G_OR operations.
432 regBankSelected: true
435 - { id: 0, class: gpr }
436 - { id: 1, class: gpr }
437 - { id: 2, class: gpr }
443 ; CHECK-LABEL: name: or_s64_gpr
444 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
445 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
446 ; CHECK: [[ORRXrr:%[0-9]+]]:gpr64 = ORRXrr [[COPY]], [[COPY1]]
447 ; CHECK: $x0 = COPY [[ORRXrr]]
450 %2(s64) = G_OR %0, %1
455 # 64-bit G_OR on vector registers.
458 regBankSelected: true
461 - { id: 0, class: fpr }
462 - { id: 1, class: fpr }
463 - { id: 2, class: fpr }
465 # The actual OR does not matter as long as it is operating
466 # on 64-bit width vector.
471 ; CHECK-LABEL: name: or_v2s32_fpr
472 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
473 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
474 ; CHECK: [[ORRv8i8_:%[0-9]+]]:fpr64 = ORRv8i8 [[COPY]], [[COPY1]]
475 ; CHECK: $d0 = COPY [[ORRv8i8_]]
476 %0(<2 x s32>) = COPY $d0
477 %1(<2 x s32>) = COPY $d1
478 %2(<2 x s32>) = G_OR %0, %1
479 $d0 = COPY %2(<2 x s32>)
483 # Same as add_s32_gpr, for G_AND operations.
486 regBankSelected: true
489 - { id: 0, class: gpr }
490 - { id: 1, class: gpr }
491 - { id: 2, class: gpr }
497 ; CHECK-LABEL: name: and_s32_gpr
498 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
499 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
500 ; CHECK: [[ANDWrr:%[0-9]+]]:gpr32 = ANDWrr [[COPY]], [[COPY1]]
501 ; CHECK: $w0 = COPY [[ANDWrr]]
504 %2(s32) = G_AND %0, %1
509 # Same as add_s64_gpr, for G_AND operations.
512 regBankSelected: true
515 - { id: 0, class: gpr }
516 - { id: 1, class: gpr }
517 - { id: 2, class: gpr }
523 ; CHECK-LABEL: name: and_s64_gpr
524 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
525 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
526 ; CHECK: [[ANDXrr:%[0-9]+]]:gpr64 = ANDXrr [[COPY]], [[COPY1]]
527 ; CHECK: $x0 = COPY [[ANDXrr]]
530 %2(s64) = G_AND %0, %1
535 # Same as add_s32_gpr, for G_SHL operations.
538 regBankSelected: true
541 - { id: 0, class: gpr }
542 - { id: 1, class: gpr }
543 - { id: 2, class: gpr }
549 ; CHECK-LABEL: name: shl_s32_gpr
550 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
551 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
552 ; CHECK: [[LSLVWr:%[0-9]+]]:gpr32 = LSLVWr [[COPY]], [[COPY1]]
553 ; CHECK: $w0 = COPY [[LSLVWr]]
556 %2(s32) = G_SHL %0, %1
561 # Same as add_s64_gpr, for G_SHL operations.
564 regBankSelected: true
567 - { id: 0, class: gpr }
568 - { id: 1, class: gpr }
569 - { id: 2, class: gpr }
575 ; CHECK-LABEL: name: shl_s64_gpr
576 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
577 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
578 ; CHECK: [[LSLVXr:%[0-9]+]]:gpr64 = LSLVXr [[COPY]], [[COPY1]]
579 ; CHECK: $x0 = COPY [[LSLVXr]]
582 %2(s64) = G_SHL %0, %1
587 # Same as add_s32_gpr, for G_LSHR operations.
590 regBankSelected: true
593 - { id: 0, class: gpr }
594 - { id: 1, class: gpr }
595 - { id: 2, class: gpr }
601 ; CHECK-LABEL: name: lshr_s32_gpr
602 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
603 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
604 ; CHECK: [[LSRVWr:%[0-9]+]]:gpr32 = LSRVWr [[COPY]], [[COPY1]]
605 ; CHECK: $w0 = COPY [[LSRVWr]]
608 %2(s32) = G_LSHR %0, %1
613 # Same as add_s64_gpr, for G_LSHR operations.
616 regBankSelected: true
619 - { id: 0, class: gpr }
620 - { id: 1, class: gpr }
621 - { id: 2, class: gpr }
627 ; CHECK-LABEL: name: lshr_s64_gpr
628 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
629 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
630 ; CHECK: [[LSRVXr:%[0-9]+]]:gpr64 = LSRVXr [[COPY]], [[COPY1]]
631 ; CHECK: $x0 = COPY [[LSRVXr]]
634 %2(s64) = G_LSHR %0, %1
639 # Same as add_s32_gpr, for G_ASHR operations.
642 regBankSelected: true
645 - { id: 0, class: gpr }
646 - { id: 1, class: gpr }
647 - { id: 2, class: gpr }
653 ; CHECK-LABEL: name: ashr_s32_gpr
654 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
655 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
656 ; CHECK: [[ASRVWr:%[0-9]+]]:gpr32 = ASRVWr [[COPY]], [[COPY1]]
657 ; CHECK: $w0 = COPY [[ASRVWr]]
660 %2(s32) = G_ASHR %0, %1
665 # Same as add_s64_gpr, for G_ASHR operations.
668 regBankSelected: true
671 - { id: 0, class: gpr }
672 - { id: 1, class: gpr }
673 - { id: 2, class: gpr }
679 ; CHECK-LABEL: name: ashr_s64_gpr
680 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
681 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
682 ; CHECK: [[ASRVXr:%[0-9]+]]:gpr64 = ASRVXr [[COPY]], [[COPY1]]
683 ; CHECK: $x0 = COPY [[ASRVXr]]
686 %2(s64) = G_ASHR %0, %1
691 # Check that we select s32 GPR G_MUL. This is trickier than other binops because
692 # there is only MADDWrrr, and we have to use the WZR physreg.
695 regBankSelected: true
698 - { id: 0, class: gpr }
699 - { id: 1, class: gpr }
700 - { id: 2, class: gpr }
706 ; CHECK-LABEL: name: mul_s32_gpr
707 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
708 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
709 ; CHECK: [[MADDWrrr:%[0-9]+]]:gpr32 = MADDWrrr [[COPY]], [[COPY1]], $wzr
710 ; CHECK: $w0 = COPY [[MADDWrrr]]
713 %2(s32) = G_MUL %0, %1
718 # Same as mul_s32_gpr for the s64 type.
721 regBankSelected: true
724 - { id: 0, class: gpr }
725 - { id: 1, class: gpr }
726 - { id: 2, class: gpr }
732 ; CHECK-LABEL: name: mul_s64_gpr
733 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
734 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
735 ; CHECK: [[MADDXrrr:%[0-9]+]]:gpr64 = MADDXrrr [[COPY]], [[COPY1]], $xzr
736 ; CHECK: $x0 = COPY [[MADDXrrr]]
739 %2(s64) = G_MUL %0, %1
744 # Same as mul_s32_gpr for the s64 type.
747 regBankSelected: true
754 ; CHECK-LABEL: name: mulh_s64_gpr
755 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
756 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
757 ; CHECK: [[SMULHrr:%[0-9]+]]:gpr64 = SMULHrr [[COPY]], [[COPY1]]
758 ; CHECK: [[UMULHrr:%[0-9]+]]:gpr64 = UMULHrr [[COPY]], [[COPY1]]
759 ; CHECK: $x0 = COPY [[SMULHrr]]
760 ; CHECK: $x0 = COPY [[UMULHrr]]
761 %0:gpr(s64) = COPY $x0
762 %1:gpr(s64) = COPY $x1
763 %2:gpr(s64) = G_SMULH %0, %1
764 %3:gpr(s64) = G_UMULH %0, %1
770 # Same as add_s32_gpr, for G_SDIV operations.
773 regBankSelected: true
776 - { id: 0, class: gpr }
777 - { id: 1, class: gpr }
778 - { id: 2, class: gpr }
784 ; CHECK-LABEL: name: sdiv_s32_gpr
785 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
786 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
787 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[COPY]], [[COPY1]]
788 ; CHECK: $w0 = COPY [[SDIVWr]]
791 %2(s32) = G_SDIV %0, %1
796 # Same as add_s64_gpr, for G_SDIV operations.
799 regBankSelected: true
802 - { id: 0, class: gpr }
803 - { id: 1, class: gpr }
804 - { id: 2, class: gpr }
810 ; CHECK-LABEL: name: sdiv_s64_gpr
811 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
812 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
813 ; CHECK: [[SDIVXr:%[0-9]+]]:gpr64 = SDIVXr [[COPY]], [[COPY1]]
814 ; CHECK: $x0 = COPY [[SDIVXr]]
817 %2(s64) = G_SDIV %0, %1
822 # Same as add_s32_gpr, for G_UDIV operations.
825 regBankSelected: true
828 - { id: 0, class: gpr }
829 - { id: 1, class: gpr }
830 - { id: 2, class: gpr }
836 ; CHECK-LABEL: name: udiv_s32_gpr
837 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
838 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
839 ; CHECK: [[UDIVWr:%[0-9]+]]:gpr32 = UDIVWr [[COPY]], [[COPY1]]
840 ; CHECK: $w0 = COPY [[UDIVWr]]
843 %2(s32) = G_UDIV %0, %1
848 # Same as add_s64_gpr, for G_UDIV operations.
851 regBankSelected: true
854 - { id: 0, class: gpr }
855 - { id: 1, class: gpr }
856 - { id: 2, class: gpr }
862 ; CHECK-LABEL: name: udiv_s64_gpr
863 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
864 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
865 ; CHECK: [[UDIVXr:%[0-9]+]]:gpr64 = UDIVXr [[COPY]], [[COPY1]]
866 ; CHECK: $x0 = COPY [[UDIVXr]]
869 %2(s64) = G_UDIV %0, %1
874 # Check that we select a s32 FPR G_FADD into FADDSrr.
877 regBankSelected: true
880 - { id: 0, class: fpr }
881 - { id: 1, class: fpr }
882 - { id: 2, class: fpr }
888 ; CHECK-LABEL: name: fadd_s32_fpr
889 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
890 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
891 ; CHECK: [[FADDSrr:%[0-9]+]]:fpr32 = FADDSrr [[COPY]], [[COPY1]]
892 ; CHECK: $s0 = COPY [[FADDSrr]]
895 %2(s32) = G_FADD %0, %1
902 regBankSelected: true
905 - { id: 0, class: fpr }
906 - { id: 1, class: fpr }
907 - { id: 2, class: fpr }
913 ; CHECK-LABEL: name: fadd_s64_fpr
914 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
915 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
916 ; CHECK: [[FADDDrr:%[0-9]+]]:fpr64 = FADDDrr [[COPY]], [[COPY1]]
917 ; CHECK: $d0 = COPY [[FADDDrr]]
920 %2(s64) = G_FADD %0, %1
927 regBankSelected: true
930 - { id: 0, class: fpr }
931 - { id: 1, class: fpr }
932 - { id: 2, class: fpr }
938 ; CHECK-LABEL: name: fsub_s32_fpr
939 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
940 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
941 ; CHECK: [[FSUBSrr:%[0-9]+]]:fpr32 = FSUBSrr [[COPY]], [[COPY1]]
942 ; CHECK: $s0 = COPY [[FSUBSrr]]
945 %2(s32) = G_FSUB %0, %1
952 regBankSelected: true
955 - { id: 0, class: fpr }
956 - { id: 1, class: fpr }
957 - { id: 2, class: fpr }
963 ; CHECK-LABEL: name: fsub_s64_fpr
964 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
965 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
966 ; CHECK: [[FSUBDrr:%[0-9]+]]:fpr64 = FSUBDrr [[COPY]], [[COPY1]]
967 ; CHECK: $d0 = COPY [[FSUBDrr]]
970 %2(s64) = G_FSUB %0, %1
977 regBankSelected: true
980 - { id: 0, class: fpr }
981 - { id: 1, class: fpr }
982 - { id: 2, class: fpr }
988 ; CHECK-LABEL: name: fmul_s32_fpr
989 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
990 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
991 ; CHECK: [[FMULSrr:%[0-9]+]]:fpr32 = FMULSrr [[COPY]], [[COPY1]]
992 ; CHECK: $s0 = COPY [[FMULSrr]]
995 %2(s32) = G_FMUL %0, %1
1002 regBankSelected: true
1005 - { id: 0, class: fpr }
1006 - { id: 1, class: fpr }
1007 - { id: 2, class: fpr }
1013 ; CHECK-LABEL: name: fmul_s64_fpr
1014 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1015 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1016 ; CHECK: [[FMULDrr:%[0-9]+]]:fpr64 = FMULDrr [[COPY]], [[COPY1]]
1017 ; CHECK: $d0 = COPY [[FMULDrr]]
1020 %2(s64) = G_FMUL %0, %1
1027 regBankSelected: true
1030 - { id: 0, class: fpr }
1031 - { id: 1, class: fpr }
1032 - { id: 2, class: fpr }
1038 ; CHECK-LABEL: name: fdiv_s32_fpr
1039 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
1040 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
1041 ; CHECK: [[FDIVSrr:%[0-9]+]]:fpr32 = FDIVSrr [[COPY]], [[COPY1]]
1042 ; CHECK: $s0 = COPY [[FDIVSrr]]
1045 %2(s32) = G_FDIV %0, %1
1052 regBankSelected: true
1055 - { id: 0, class: fpr }
1056 - { id: 1, class: fpr }
1057 - { id: 2, class: fpr }
1063 ; CHECK-LABEL: name: fdiv_s64_fpr
1064 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
1065 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
1066 ; CHECK: [[FDIVDrr:%[0-9]+]]:fpr64 = FDIVDrr [[COPY]], [[COPY1]]
1067 ; CHECK: $d0 = COPY [[FDIVDrr]]
1070 %2(s64) = G_FDIV %0, %1
1077 regBankSelected: true
1078 tracksRegLiveness: true
1080 - { id: 0, class: fpr }
1081 - { id: 1, class: fpr }
1082 - { id: 2, class: fpr }
1083 machineFunctionInfo: {}
1088 ; CHECK-LABEL: name: add_v8i16
1089 ; CHECK: liveins: $q0, $q1
1090 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
1091 ; CHECK: [[COPY1:%[0-9]+]]:fpr128 = COPY $q1
1092 ; CHECK: [[ADDv8i16_:%[0-9]+]]:fpr128 = ADDv8i16 [[COPY]], [[COPY1]]
1093 ; CHECK: $q0 = COPY [[ADDv8i16_]]
1094 ; CHECK: RET_ReallyLR implicit $q0
1095 %0:fpr(<8 x s16>) = COPY $q0
1096 %1:fpr(<8 x s16>) = COPY $q1
1097 %2:fpr(<8 x s16>) = G_ADD %0, %1
1098 $q0 = COPY %2(<8 x s16>)
1099 RET_ReallyLR implicit $q0
1106 regBankSelected: true
1107 tracksRegLiveness: true
1109 - { id: 0, class: fpr }
1110 - { id: 1, class: fpr }
1111 - { id: 2, class: fpr }
1112 machineFunctionInfo: {}
1117 ; CHECK-LABEL: name: add_v16i8
1118 ; CHECK: liveins: $q0, $q1
1119 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
1120 ; CHECK: [[COPY1:%[0-9]+]]:fpr128 = COPY $q1
1121 ; CHECK: [[ADDv16i8_:%[0-9]+]]:fpr128 = ADDv16i8 [[COPY]], [[COPY1]]
1122 ; CHECK: $q0 = COPY [[ADDv16i8_]]
1123 ; CHECK: RET_ReallyLR implicit $q0
1124 %0:fpr(<16 x s8>) = COPY $q0
1125 %1:fpr(<16 x s8>) = COPY $q1
1126 %2:fpr(<16 x s8>) = G_ADD %0, %1
1127 $q0 = COPY %2(<16 x s8>)
1128 RET_ReallyLR implicit $q0