1 # RUN: llc -mtriple arm-- -run-pass=regbankselect %s -o - | FileCheck %s
2 # RUN: llc -mtriple thumbv7-- -run-pass=regbankselect %s -o - | FileCheck %s
4 define void @test_add_s32() { ret void }
5 define void @test_sub_s32() { ret void }
6 define void @test_mul_s32() { ret void }
8 define void @test_sdiv_s32() #1 { ret void }
9 define void @test_udiv_s32() #1 { ret void }
11 define void @test_and_s32() { ret void}
12 define void @test_or_s32() { ret void}
13 define void @test_xor_s32() { ret void}
15 define void @test_lshr_s32() { ret void }
16 define void @test_ashr_s32() { ret void }
17 define void @test_shl_s32() { ret void }
19 define void @test_loads() #0 { ret void }
20 define void @test_stores() #0 { ret void }
22 define void @test_stack() { ret void }
24 define void @test_gep() { ret void }
26 define void @test_constants() { ret void }
28 define void @test_inttoptr_s32() { ret void }
29 define void @test_ptrtoint_s32() { ret void }
31 define void @test_ctlz_s32() #3 { ret void }
33 @a_global = global float 1.0
34 define void @test_globals() { ret void }
36 define void @test_anyext_s8_32() { ret void }
37 define void @test_anyext_s16_32() { ret void }
39 define void @test_trunc_s32_16() { ret void }
40 define void @test_trunc_s64_32() #0 { ret void }
42 define void @test_icmp_eq_s32() { ret void }
43 define void @test_fcmp_one_s32() #0 { ret void }
44 define void @test_fcmp_ugt_s64() #0 { ret void }
46 define void @test_select_s32() { ret void }
48 define void @test_br() { ret void }
50 define void @test_phi_s32() { ret void }
51 define void @test_phi_s64() #0 { ret void }
53 define void @test_fadd_s32() #0 { ret void }
54 define void @test_fadd_s64() #0 { ret void }
56 define void @test_fsub_s32() #0 { ret void }
57 define void @test_fsub_s64() #0 { ret void }
59 define void @test_fmul_s32() #0 { ret void }
60 define void @test_fmul_s64() #0 { ret void }
62 define void @test_fdiv_s32() #0 { ret void }
63 define void @test_fdiv_s64() #0 { ret void }
65 define void @test_fneg_s32() #0 { ret void }
66 define void @test_fneg_s64() #0 { ret void }
68 define void @test_fma_s32() #2 { ret void }
69 define void @test_fma_s64() #2 { ret void }
71 define void @test_fpext_s32_to_s64() #0 { ret void }
72 define void @test_fptrunc_s64_to_s32() #0 { ret void }
74 define void @test_fpconst_s32() #0 { ret void }
75 define void @test_fpconst_s64() #0 { ret void }
77 define void @test_fptosi_s32() #0 { ret void }
78 define void @test_fptosi_s64() #0 { ret void }
79 define void @test_fptoui_s32() #0 { ret void }
80 define void @test_fptoui_s64() #0 { ret void }
82 define void @test_sitofp_s32() #0 { ret void }
83 define void @test_sitofp_s64() #0 { ret void }
84 define void @test_uitofp_s32() #0 { ret void }
85 define void @test_uitofp_s64() #0 { ret void }
87 define void @test_soft_fp_s64() #0 { ret void }
89 define void @test_dbg_value() #0 { ret void }
91 attributes #0 = { "target-features"="+vfp2"}
92 attributes #1 = { "target-features"="+hwdiv-arm,+hwdiv" }
93 attributes #2 = { "target-features"="+vfp4"}
94 attributes #3 = { "target-features"="+v5t"}
96 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "llvm", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
97 !1 = !DIFile(filename: "dbg.ll", directory: "/tmp")
99 !5 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
100 !6 = !DISubroutineType(types: !2)
101 !7 = !DILocalVariable(name: "x", arg: 1, scope: !5, file: !1, line: 1, type: !8)
102 !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
103 !9 = !DILocation(line: 1, column: 1, scope: !5)
107 # CHECK-LABEL: name: test_add_s32
109 regBankSelected: false
112 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
113 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
114 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
117 - { id: 0, class: _ }
118 - { id: 1, class: _ }
119 - { id: 2, class: _ }
126 %2(s32) = G_ADD %0, %1
128 BX_RET 14, $noreg, implicit $r0
133 # CHECK-LABEL: name: test_sub_s32
135 regBankSelected: false
138 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
139 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
140 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
143 - { id: 0, class: _ }
144 - { id: 1, class: _ }
145 - { id: 2, class: _ }
152 %2(s32) = G_SUB %0, %1
154 BX_RET 14, $noreg, implicit $r0
159 # CHECK-LABEL: name: test_mul_s32
161 regBankSelected: false
164 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
165 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
166 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
169 - { id: 0, class: _ }
170 - { id: 1, class: _ }
171 - { id: 2, class: _ }
178 %2(s32) = G_MUL %0, %1
180 BX_RET 14, $noreg, implicit $r0
185 # CHECK-LABEL: name: test_sdiv_s32
187 regBankSelected: false
190 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
191 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
192 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
195 - { id: 0, class: _ }
196 - { id: 1, class: _ }
197 - { id: 2, class: _ }
204 %2(s32) = G_SDIV %0, %1
206 BX_RET 14, $noreg, implicit $r0
211 # CHECK-LABEL: name: test_udiv_s32
213 regBankSelected: false
216 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
217 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
218 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
221 - { id: 0, class: _ }
222 - { id: 1, class: _ }
223 - { id: 2, class: _ }
230 %2(s32) = G_UDIV %0, %1
232 BX_RET 14, $noreg, implicit $r0
237 # CHECK-LABEL: name: test_and_s32
239 regBankSelected: false
242 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
243 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
244 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
247 - { id: 0, class: _ }
248 - { id: 1, class: _ }
249 - { id: 2, class: _ }
256 %2(s32) = G_AND %0, %1
258 BX_RET 14, $noreg, implicit $r0
263 # CHECK-LABEL: name: test_or_s32
265 regBankSelected: false
268 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
269 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
270 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
273 - { id: 0, class: _ }
274 - { id: 1, class: _ }
275 - { id: 2, class: _ }
282 %2(s32) = G_OR %0, %1
284 BX_RET 14, $noreg, implicit $r0
289 # CHECK-LABEL: name: test_xor_s32
291 regBankSelected: false
294 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
295 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
296 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
299 - { id: 0, class: _ }
300 - { id: 1, class: _ }
301 - { id: 2, class: _ }
308 %2(s32) = G_XOR %0, %1
310 BX_RET 14, $noreg, implicit $r0
315 # CHECK-LABEL: name: test_lshr_s32
317 regBankSelected: false
320 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
321 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
322 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
325 - { id: 0, class: _ }
326 - { id: 1, class: _ }
327 - { id: 2, class: _ }
334 %2(s32) = G_LSHR %0, %1
336 BX_RET 14, $noreg, implicit $r0
341 # CHECK-LABEL: name: test_ashr_s32
343 regBankSelected: false
346 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
347 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
348 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
351 - { id: 0, class: _ }
352 - { id: 1, class: _ }
353 - { id: 2, class: _ }
360 %2(s32) = G_ASHR %0, %1
362 BX_RET 14, $noreg, implicit $r0
367 # CHECK-LABEL: name: test_shl_s32
369 regBankSelected: false
372 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
373 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
374 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
377 - { id: 0, class: _ }
378 - { id: 1, class: _ }
379 - { id: 2, class: _ }
386 %2(s32) = G_SHL %0, %1
388 BX_RET 14, $noreg, implicit $r0
393 # CHECK-LABEL: name: test_loads
395 regBankSelected: false
398 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
399 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
400 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
401 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
402 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
403 # CHECK: - { id: 5, class: gprb, preferred-register: '' }
404 # CHECK: - { id: 6, class: fprb, preferred-register: '' }
407 - { id: 0, class: _ }
408 - { id: 1, class: _ }
409 - { id: 2, class: _ }
410 - { id: 3, class: _ }
411 - { id: 4, class: _ }
412 - { id: 5, class: _ }
413 - { id: 6, class: _ }
418 %6(s64) = G_LOAD %0 :: (load 8)
419 %1(s32) = G_LOAD %0 :: (load 4)
420 %2(s16) = G_LOAD %0 :: (load 2)
421 %3(s8) = G_LOAD %0 :: (load 1)
422 %4(s1) = G_LOAD %0 :: (load 1)
423 %5(p0) = G_LOAD %0 :: (load 4)
424 BX_RET 14, $noreg, implicit $r0
429 # CHECK-LABEL: name: test_stores
431 regBankSelected: false
434 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
435 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
436 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
437 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
438 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
439 # CHECK: - { id: 5, class: gprb, preferred-register: '' }
440 # CHECK: - { id: 6, class: fprb, preferred-register: '' }
443 - { id: 0, class: _ }
444 - { id: 1, class: _ }
445 - { id: 2, class: _ }
446 - { id: 3, class: _ }
447 - { id: 4, class: _ }
448 - { id: 5, class: _ }
449 - { id: 6, class: _ }
452 liveins: $r0, $r1, $r5, $d6
455 G_STORE %1(s32), %0 :: (store 4)
456 %2(s16) = G_TRUNC %1(s32)
457 G_STORE %2(s16), %0 :: (store 2)
458 %3(s8) = G_TRUNC %1(s32)
459 G_STORE %3(s8), %0 :: (store 1)
460 %4(s1) = G_TRUNC %1(s32)
461 G_STORE %4(s1), %0 :: (store 1)
463 G_STORE %5(p0), %0 :: (store 4)
465 G_STORE %6(s64), %0 :: (store 8)
466 BX_RET 14, $noreg, implicit $r0
471 # CHECK-LABEL: name: test_stack
473 regBankSelected: false
476 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
477 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
478 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
479 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
480 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
482 - { id: 0, class: _ }
483 - { id: 1, class: _ }
484 - { id: 2, class: _ }
485 - { id: 3, class: _ }
486 - { id: 4, class: _ }
488 - { id: 0, offset: 0, size: 4, alignment: 4, isImmutable: true, isAliased: false }
491 %0(p0) = G_FRAME_INDEX %fixed-stack.0
492 %1(s32) = G_LOAD %0(p0) :: (load 4 from %fixed-stack.0, align 4)
495 %3(s32) = G_CONSTANT i32 8
496 %4(p0) = G_GEP %2, %3(s32)
497 G_STORE %1(s32), %4(p0) :: (store 4)
504 # CHECK-LABEL: name: test_gep
506 regBankSelected: false
509 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
510 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
511 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
514 - { id: 0, class: _ }
515 - { id: 1, class: _ }
516 - { id: 2, class: _ }
523 %2(p0) = G_GEP %0, %1(s32)
525 BX_RET 14, $noreg, implicit $r0
529 # CHECK-LABEL: name: test_constants
531 regBankSelected: false
534 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
536 - { id: 0, class: _ }
539 %0(s32) = G_CONSTANT i32 42
541 BX_RET 14, $noreg, implicit $r0
544 name: test_inttoptr_s32
545 # CHECK-LABEL: name: test_inttoptr_s32
547 regBankSelected: false
550 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
551 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
553 - { id: 0, class: _ }
554 - { id: 1, class: _ }
558 %1(p0) = G_INTTOPTR %0(s32)
560 BX_RET 14, $noreg, implicit $r0
563 name: test_ptrtoint_s32
564 # CHECK-LABEL: name: test_ptrtoint_s32
566 regBankSelected: false
569 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
570 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
572 - { id: 0, class: _ }
573 - { id: 1, class: _ }
577 %1(s32) = G_PTRTOINT %0(p0)
579 BX_RET 14, $noreg, implicit $r0
583 # CHECK-LABEL: name: test_ctlz_s32
585 regBankSelected: false
588 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
589 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
591 - { id: 0, class: _ }
592 - { id: 1, class: _ }
596 %1(s32) = G_CTLZ %0(s32)
598 BX_RET 14, $noreg, implicit $r0
602 # CHECK-LABEL: name: test_globals
604 regBankSelected: false
607 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
609 - { id: 0, class: _ }
612 %0(p0) = G_GLOBAL_VALUE @a_global
614 BX_RET 14, $noreg, implicit $r0
617 name: test_anyext_s8_32
618 # CHECK-LABEL: name: test_anyext_s8_32
620 regBankSelected: false
623 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
624 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
625 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
627 - { id: 0, class: _ }
628 - { id: 1, class: _ }
629 - { id: 2, class: _ }
635 %1(s8) = G_TRUNC %0(s32)
636 %2(s32) = G_ANYEXT %1(s8)
638 BX_RET 14, $noreg, implicit $r0
641 name: test_anyext_s16_32
642 # CHECK-LABEL: name: test_anyext_s16_32
644 regBankSelected: false
647 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
648 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
649 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
651 - { id: 0, class: _ }
652 - { id: 1, class: _ }
653 - { id: 2, class: _ }
659 %1(s16) = G_TRUNC %0(s32)
660 %2(s32) = G_ANYEXT %1(s16)
662 BX_RET 14, $noreg, implicit $r0
665 name: test_trunc_s32_16
666 # CHECK-LABEL: name: test_trunc_s32_16
668 regBankSelected: false
671 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
672 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
673 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
675 - { id: 0, class: _ }
676 - { id: 1, class: _ }
677 - { id: 2, class: _ }
684 %1(s16) = G_TRUNC %0(s32)
685 G_STORE %1(s16), %2 :: (store 2)
689 name: test_trunc_s64_32
690 # CHECK-LABEL: name: test_trunc_s64_32
692 regBankSelected: false
695 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
696 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
697 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
699 - { id: 0, class: _ }
700 - { id: 1, class: _ }
701 - { id: 2, class: _ }
708 %1(s32) = G_TRUNC %0(s64)
709 G_STORE %1(s32), %2 :: (store 4)
713 name: test_icmp_eq_s32
714 # CHECK-LABEL: name: test_icmp_eq_s32
716 regBankSelected: false
719 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
720 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
721 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
722 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
725 - { id: 0, class: _ }
726 - { id: 1, class: _ }
727 - { id: 2, class: _ }
728 - { id: 3, class: _ }
735 %2(s1) = G_ICMP intpred(eq), %0(s32), %1
736 %3(s32) = G_ZEXT %2(s1)
738 BX_RET 14, $noreg, implicit $r0
742 name: test_fcmp_one_s32
743 # CHECK-LABEL: name: test_fcmp_one_s32
745 regBankSelected: false
748 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
749 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
750 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
751 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
754 - { id: 0, class: _ }
755 - { id: 1, class: _ }
756 - { id: 2, class: _ }
757 - { id: 3, class: _ }
764 %2(s1) = G_FCMP floatpred(one), %0(s32), %1
765 %3(s32) = G_ZEXT %2(s1)
767 BX_RET 14, $noreg, implicit $r0
771 name: test_fcmp_ugt_s64
772 # CHECK-LABEL: name: test_fcmp_ugt_s64
774 regBankSelected: false
777 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
778 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
779 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
780 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
783 - { id: 0, class: _ }
784 - { id: 1, class: _ }
785 - { id: 2, class: _ }
786 - { id: 3, class: _ }
793 %2(s1) = G_FCMP floatpred(ugt), %0(s64), %1
794 %3(s32) = G_ZEXT %2(s1)
796 BX_RET 14, $noreg, implicit $r0
800 name: test_select_s32
801 # CHECK-LABEL: name: test_select_s32
803 regBankSelected: false
806 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
807 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
808 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
809 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
810 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
813 - { id: 0, class: _ }
814 - { id: 1, class: _ }
815 - { id: 2, class: _ }
816 - { id: 3, class: _ }
817 - { id: 4, class: _ }
820 liveins: $r0, $r1, $r2
825 %3(s1) = G_TRUNC %2(s32)
826 %4(s32) = G_SELECT %3(s1), %0, %1
828 BX_RET 14, $noreg, implicit $r0
833 # CHECK-LABEL: name: test_br
835 regBankSelected: false
836 # CHECK: regBankSelected: true
839 - { id: 0, class: _ }
840 - { id: 1, class: _ }
841 # CHECK: { id: 0, class: gprb, preferred-register: '' }
842 # CHECK: { id: 1, class: gprb, preferred-register: '' }
843 # Check that we map the condition of the G_BRCOND into the GPR.
844 # For the G_BR, there are no registers to map, but make sure we don't crash.
847 successors: %bb.1(0x40000000), %bb.2(0x40000000)
851 %1(s1) = G_TRUNC %0(s32)
852 G_BRCOND %1(s1), %bb.1
864 # CHECK-LABEL: name: test_phi_s32
866 regBankSelected: false
867 # CHECK: regBankSelected: true
869 tracksRegLiveness: true
871 - { id: 0, class: _ }
872 - { id: 1, class: _ }
873 - { id: 2, class: _ }
874 - { id: 3, class: _ }
875 - { id: 4, class: _ }
876 # CHECK: { id: 0, class: gprb, preferred-register: '' }
877 # CHECK: { id: 1, class: gprb, preferred-register: '' }
878 # CHECK: { id: 2, class: gprb, preferred-register: '' }
879 # CHECK: { id: 3, class: gprb, preferred-register: '' }
880 # CHECK: { id: 4, class: gprb, preferred-register: '' }
883 successors: %bb.1(0x40000000), %bb.2(0x40000000)
884 liveins: $r0, $r1, $r2
887 %1(s1) = G_TRUNC %0(s32)
892 G_BRCOND %1(s1), %bb.1
896 successors: %bb.2(0x80000000)
899 %4(s32) = G_PHI %2(s32), %bb.0, %3(s32), %bb.1
901 BX_RET 14, $noreg, implicit $r0
905 # CHECK-LABEL: name: test_phi_s64
907 regBankSelected: false
908 # CHECK: regBankSelected: true
910 tracksRegLiveness: true
912 - { id: 0, class: _ }
913 - { id: 1, class: _ }
914 - { id: 2, class: _ }
915 - { id: 3, class: _ }
916 - { id: 4, class: _ }
917 # CHECK: { id: 0, class: gprb, preferred-register: '' }
918 # CHECK: { id: 1, class: gprb, preferred-register: '' }
919 # CHECK: { id: 2, class: fprb, preferred-register: '' }
920 # CHECK: { id: 3, class: fprb, preferred-register: '' }
921 # CHECK: { id: 4, class: fprb, preferred-register: '' }
924 successors: %bb.1(0x40000000), %bb.2(0x40000000)
925 liveins: $r0, $d0, $d1
928 %1(s1) = G_TRUNC %0(s32)
933 G_BRCOND %1(s1), %bb.1
937 successors: %bb.2(0x80000000)
940 %4(s64) = G_PHI %2(s64), %bb.0, %3(s64), %bb.1
942 BX_RET 14, $noreg, implicit $d0
946 # CHECK-LABEL: name: test_fadd_s32
948 regBankSelected: false
951 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
952 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
953 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
956 - { id: 0, class: _ }
957 - { id: 1, class: _ }
958 - { id: 2, class: _ }
965 %2(s32) = G_FADD %0, %1
967 BX_RET 14, $noreg, implicit $s0
972 # CHECK-LABEL: name: test_fadd_s64
974 regBankSelected: false
977 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
978 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
979 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
982 - { id: 0, class: _ }
983 - { id: 1, class: _ }
984 - { id: 2, class: _ }
991 %2(s64) = G_FADD %0, %1
993 BX_RET 14, $noreg, implicit $d0
998 # CHECK-LABEL: name: test_fsub_s32
1000 regBankSelected: false
1003 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1004 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1005 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1008 - { id: 0, class: _ }
1009 - { id: 1, class: _ }
1010 - { id: 2, class: _ }
1017 %2(s32) = G_FSUB %0, %1
1019 BX_RET 14, $noreg, implicit $s0
1024 # CHECK-LABEL: name: test_fsub_s64
1026 regBankSelected: false
1029 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1030 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1031 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1034 - { id: 0, class: _ }
1035 - { id: 1, class: _ }
1036 - { id: 2, class: _ }
1043 %2(s64) = G_FSUB %0, %1
1045 BX_RET 14, $noreg, implicit $d0
1050 # CHECK-LABEL: name: test_fmul_s32
1052 regBankSelected: false
1055 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1056 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1057 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1060 - { id: 0, class: _ }
1061 - { id: 1, class: _ }
1062 - { id: 2, class: _ }
1069 %2(s32) = G_FMUL %0, %1
1071 BX_RET 14, $noreg, implicit $s0
1076 # CHECK-LABEL: name: test_fmul_s64
1078 regBankSelected: false
1081 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1082 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1083 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1086 - { id: 0, class: _ }
1087 - { id: 1, class: _ }
1088 - { id: 2, class: _ }
1095 %2(s64) = G_FMUL %0, %1
1097 BX_RET 14, $noreg, implicit $d0
1102 # CHECK-LABEL: name: test_fdiv_s32
1104 regBankSelected: false
1107 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1108 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1109 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1112 - { id: 0, class: _ }
1113 - { id: 1, class: _ }
1114 - { id: 2, class: _ }
1121 %2(s32) = G_FDIV %0, %1
1123 BX_RET 14, $noreg, implicit $s0
1128 # CHECK-LABEL: name: test_fdiv_s64
1130 regBankSelected: false
1133 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1134 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1135 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1138 - { id: 0, class: _ }
1139 - { id: 1, class: _ }
1140 - { id: 2, class: _ }
1147 %2(s64) = G_FDIV %0, %1
1149 BX_RET 14, $noreg, implicit $d0
1154 # CHECK-LABEL: name: test_fneg_s32
1156 regBankSelected: false
1159 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1160 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1162 - { id: 0, class: _ }
1163 - { id: 1, class: _ }
1171 BX_RET 14, $noreg, implicit $s0
1176 # CHECK-LABEL: name: test_fneg_s64
1178 regBankSelected: false
1181 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1182 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1184 - { id: 0, class: _ }
1185 - { id: 1, class: _ }
1193 BX_RET 14, $noreg, implicit $d0
1198 # CHECK-LABEL: name: test_fma_s32
1200 regBankSelected: false
1203 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1204 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1205 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1206 # CHECK: - { id: 3, class: fprb, preferred-register: '' }
1208 - { id: 0, class: _ }
1209 - { id: 1, class: _ }
1210 - { id: 2, class: _ }
1211 - { id: 3, class: _ }
1214 liveins: $s0, $s1, $s2
1219 %3(s32) = G_FMA %0, %1, %2
1221 BX_RET 14, $noreg, implicit $s0
1225 # CHECK-LABEL: name: test_fma_s64
1227 regBankSelected: false
1230 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1231 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1232 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1233 # CHECK: - { id: 3, class: fprb, preferred-register: '' }
1235 - { id: 0, class: _ }
1236 - { id: 1, class: _ }
1237 - { id: 2, class: _ }
1238 - { id: 3, class: _ }
1241 liveins: $d0, $d1, $d2
1246 %3(s64) = G_FMA %0, %1, %2
1248 BX_RET 14, $noreg, implicit $d0
1251 name: test_fpext_s32_to_s64
1252 # CHECK-LABEL: name: test_fpext_s32_to_s64
1254 regBankSelected: false
1257 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1258 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1260 - { id: 0, class: _ }
1261 - { id: 1, class: _ }
1267 %1(s64) = G_FPEXT %0
1269 BX_RET 14, $noreg, implicit $d0
1272 name: test_fptrunc_s64_to_s32
1273 # CHECK-LABEL: name: test_fptrunc_s64_to_s32
1275 regBankSelected: false
1278 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1279 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1281 - { id: 0, class: _ }
1282 - { id: 1, class: _ }
1288 %1(s32) = G_FPTRUNC %0
1290 BX_RET 14, $noreg, implicit $s0
1293 name: test_fpconst_s32
1294 # CHECK-LABEL: name: test_fpconst_s32
1296 regBankSelected: false
1299 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1301 - { id: 0, class: _ }
1306 %0(s32) = G_FCONSTANT float -1.25
1308 BX_RET 14, $noreg, implicit $s0
1311 name: test_fpconst_s64
1312 # CHECK-LABEL: name: test_fpconst_s64
1314 regBankSelected: false
1317 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1319 - { id: 0, class: _ }
1324 %0(s64) = G_FCONSTANT double -2.4
1326 BX_RET 14, $noreg, implicit $d0
1329 name: test_fptosi_s32
1330 # CHECK-LABEL: name: test_fptosi_s32
1332 regBankSelected: false
1335 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1336 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1338 - { id: 0, class: _ }
1339 - { id: 1, class: _ }
1345 %1(s32) = G_FPTOSI %0
1347 BX_RET 14, $noreg, implicit $r0
1351 name: test_fptosi_s64
1352 # CHECK-LABEL: name: test_fptosi_s64
1354 regBankSelected: false
1357 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1358 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1360 - { id: 0, class: _ }
1361 - { id: 1, class: _ }
1367 %1(s32) = G_FPTOSI %0
1369 BX_RET 14, $noreg, implicit $r0
1372 name: test_fptoui_s32
1373 # CHECK-LABEL: name: test_fptoui_s32
1375 regBankSelected: false
1378 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1379 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1381 - { id: 0, class: _ }
1382 - { id: 1, class: _ }
1388 %1(s32) = G_FPTOUI %0
1390 BX_RET 14, $noreg, implicit $r0
1394 name: test_fptoui_s64
1395 # CHECK-LABEL: name: test_fptoui_s64
1397 regBankSelected: false
1400 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1401 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1403 - { id: 0, class: _ }
1404 - { id: 1, class: _ }
1410 %1(s32) = G_FPTOUI %0
1412 BX_RET 14, $noreg, implicit $r0
1415 name: test_sitofp_s32
1416 # CHECK-LABEL: name: test_sitofp_s32
1418 regBankSelected: false
1421 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1422 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1424 - { id: 0, class: _ }
1425 - { id: 1, class: _ }
1431 %1(s32) = G_SITOFP %0
1433 BX_RET 14, $noreg, implicit $s0
1437 name: test_sitofp_s64
1438 # CHECK-LABEL: name: test_sitofp_s64
1440 regBankSelected: false
1443 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1444 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1446 - { id: 0, class: _ }
1447 - { id: 1, class: _ }
1453 %1(s64) = G_SITOFP %0
1455 BX_RET 14, $noreg, implicit $d0
1458 name: test_uitofp_s32
1459 # CHECK-LABEL: name: test_uitofp_s32
1461 regBankSelected: false
1464 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1465 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1467 - { id: 0, class: _ }
1468 - { id: 1, class: _ }
1474 %1(s32) = G_UITOFP %0
1476 BX_RET 14, $noreg, implicit $s0
1480 name: test_uitofp_s64
1481 # CHECK-LABEL: name: test_uitofp_s64
1483 regBankSelected: false
1486 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1487 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1489 - { id: 0, class: _ }
1490 - { id: 1, class: _ }
1496 %1(s64) = G_UITOFP %0
1498 BX_RET 14, $noreg, implicit $d0
1501 name: test_soft_fp_s64
1502 # CHECK-LABEL: name: test_soft_fp_s64
1504 regBankSelected: false
1507 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1508 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1509 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1510 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
1511 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
1514 - { id: 0, class: _ }
1515 - { id: 1, class: _ }
1516 - { id: 2, class: _ }
1517 - { id: 3, class: _ }
1518 - { id: 4, class: _ }
1525 %2(s64) = G_MERGE_VALUES %0(s32), %1(s32)
1526 %3(s32), %4(s32) = G_UNMERGE_VALUES %2(s64)
1529 BX_RET 14, $noreg, implicit $r0, implicit $r1
1533 name: test_dbg_value
1534 # CHECK-LABEL: name: test_dbg_value
1536 regBankSelected: false
1540 - { id: 0, class: _ }
1541 - { id: 1, class: _ }
1542 - { id: 2, class: _ }
1543 - { id: 3, class: _ }
1544 - { id: 4, class: _ }
1545 - { id: 5, class: _ }
1548 liveins: $r0, $s1, $d2
1552 ; CHECK: {{%[0-9]+}}:gprb(s32) = G_ADD
1553 %1(s32) = G_ADD %0, %0
1555 ; CHECK: DBG_VALUE {{%[0-9]+}}(s32), $noreg
1556 DBG_VALUE %1(s32), $noreg, !7, !DIExpression(), debug-location !9
1562 ; CHECK: {{%[0-9]+}}:fprb(s32) = G_FADD
1563 %3(s32) = G_FADD %2, %2
1565 ; CHECK: DBG_VALUE {{%[0-9]+}}(s32), $noreg
1566 DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !9
1572 ; CHECK: {{%[0-9]+}}:fprb(s64) = G_FADD
1573 %5(s64) = G_FADD %4, %4
1575 ; CHECK: DBG_VALUE {{%[0-9]+}}(s64), $noreg
1576 DBG_VALUE %5(s64), $noreg, !7, !DIExpression(), debug-location !9
1580 ; CHECK: DBG_VALUE i32 42, 0
1581 DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
1583 ; CHECK: DBG_VALUE float 1.000000e+00, 0
1584 DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
1586 ; CHECK: DBG_VALUE $noreg, 0
1587 DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
1590 BX_RET 14, $noreg, implicit $r0, implicit $s1, implicit $d2