1 # RUN: llc -debugify-and-strip-all-safe=0 -mtriple arm-- -run-pass=regbankselect %s -o - | FileCheck %s
2 # RUN: llc -debugify-and-strip-all-safe=0 -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: fprb, preferred-register: '' }
406 - { id: 0, class: _ }
407 - { id: 1, class: _ }
408 - { id: 2, class: _ }
409 - { id: 3, class: _ }
410 - { id: 4, class: _ }
411 - { id: 5, class: _ }
412 - { id: 6, class: _ }
417 %5(s64) = G_LOAD %0 :: (load (s64))
418 %1(s32) = G_LOAD %0 :: (load (s32))
419 %2(s16) = G_LOAD %0 :: (load (s16))
420 %3(s8) = G_LOAD %0 :: (load (s8))
421 %4(p0) = G_LOAD %0 :: (load (p0))
422 BX_RET 14, $noreg, implicit $r0
427 # CHECK-LABEL: name: test_stores
429 regBankSelected: false
432 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
433 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
434 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
435 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
436 # CHECK: - { id: 4, class: fprb, preferred-register: '' }
438 - { id: 0, class: _ }
439 - { id: 1, class: _ }
440 - { id: 2, class: _ }
441 - { id: 3, class: _ }
442 - { id: 4, class: _ }
443 - { id: 5, class: _ }
444 - { id: 6, class: _ }
447 liveins: $r0, $r1, $r5, $d6
450 G_STORE %1(s32), %0 :: (store (s32))
451 %2(s16) = G_TRUNC %1(s32)
452 G_STORE %2(s16), %0 :: (store (s16))
453 %3(s8) = G_TRUNC %1(s32)
454 G_STORE %3(s8), %0 :: (store (s8))
456 G_STORE %4(s64), %0 :: (store (s64))
457 BX_RET 14, $noreg, implicit $r0
462 # CHECK-LABEL: name: test_stack
464 regBankSelected: false
467 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
468 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
469 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
470 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
471 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
473 - { id: 0, class: _ }
474 - { id: 1, class: _ }
475 - { id: 2, class: _ }
476 - { id: 3, class: _ }
477 - { id: 4, class: _ }
479 - { id: 0, offset: 0, size: 4, alignment: 4, isImmutable: true, isAliased: false }
482 %0(p0) = G_FRAME_INDEX %fixed-stack.0
483 %1(s32) = G_LOAD %0(p0) :: (load (s32) from %fixed-stack.0, align 4)
486 %3(s32) = G_CONSTANT i32 8
487 %4(p0) = G_PTR_ADD %2, %3(s32)
488 G_STORE %1(s32), %4(p0) :: (store (s32))
495 # CHECK-LABEL: name: test_gep
497 regBankSelected: false
500 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
501 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
502 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
505 - { id: 0, class: _ }
506 - { id: 1, class: _ }
507 - { id: 2, class: _ }
514 %2(p0) = G_PTR_ADD %0, %1(s32)
516 BX_RET 14, $noreg, implicit $r0
520 # CHECK-LABEL: name: test_constants
522 regBankSelected: false
525 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
527 - { id: 0, class: _ }
530 %0(s32) = G_CONSTANT i32 42
532 BX_RET 14, $noreg, implicit $r0
535 name: test_inttoptr_s32
536 # CHECK-LABEL: name: test_inttoptr_s32
538 regBankSelected: false
541 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
542 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
544 - { id: 0, class: _ }
545 - { id: 1, class: _ }
549 %1(p0) = G_INTTOPTR %0(s32)
551 BX_RET 14, $noreg, implicit $r0
554 name: test_ptrtoint_s32
555 # CHECK-LABEL: name: test_ptrtoint_s32
557 regBankSelected: false
560 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
561 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
563 - { id: 0, class: _ }
564 - { id: 1, class: _ }
568 %1(s32) = G_PTRTOINT %0(p0)
570 BX_RET 14, $noreg, implicit $r0
574 # CHECK-LABEL: name: test_ctlz_s32
576 regBankSelected: false
579 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
580 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
582 - { id: 0, class: _ }
583 - { id: 1, class: _ }
587 %1(s32) = G_CTLZ %0(s32)
589 BX_RET 14, $noreg, implicit $r0
593 # CHECK-LABEL: name: test_globals
595 regBankSelected: false
598 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
600 - { id: 0, class: _ }
603 %0(p0) = G_GLOBAL_VALUE @a_global
605 BX_RET 14, $noreg, implicit $r0
608 name: test_anyext_s8_32
609 # CHECK-LABEL: name: test_anyext_s8_32
611 regBankSelected: false
614 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
615 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
616 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
618 - { id: 0, class: _ }
619 - { id: 1, class: _ }
620 - { id: 2, class: _ }
626 %1(s8) = G_TRUNC %0(s32)
627 %2(s32) = G_ANYEXT %1(s8)
629 BX_RET 14, $noreg, implicit $r0
632 name: test_anyext_s16_32
633 # CHECK-LABEL: name: test_anyext_s16_32
635 regBankSelected: false
638 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
639 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
640 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
642 - { id: 0, class: _ }
643 - { id: 1, class: _ }
644 - { id: 2, class: _ }
650 %1(s16) = G_TRUNC %0(s32)
651 %2(s32) = G_ANYEXT %1(s16)
653 BX_RET 14, $noreg, implicit $r0
656 name: test_trunc_s32_16
657 # CHECK-LABEL: name: test_trunc_s32_16
659 regBankSelected: false
662 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
663 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
664 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
666 - { id: 0, class: _ }
667 - { id: 1, class: _ }
668 - { id: 2, class: _ }
675 %1(s16) = G_TRUNC %0(s32)
676 G_STORE %1(s16), %2 :: (store (s16))
680 name: test_trunc_s64_32
681 # CHECK-LABEL: name: test_trunc_s64_32
683 regBankSelected: false
686 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
687 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
688 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
690 - { id: 0, class: _ }
691 - { id: 1, class: _ }
692 - { id: 2, class: _ }
699 %1(s32) = G_TRUNC %0(s64)
700 G_STORE %1(s32), %2 :: (store (s32))
704 name: test_icmp_eq_s32
705 # CHECK-LABEL: name: test_icmp_eq_s32
707 regBankSelected: false
710 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
711 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
712 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
713 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
716 - { id: 0, class: _ }
717 - { id: 1, class: _ }
718 - { id: 2, class: _ }
719 - { id: 3, class: _ }
726 %2(s1) = G_ICMP intpred(eq), %0(s32), %1
727 %3(s32) = G_ZEXT %2(s1)
729 BX_RET 14, $noreg, implicit $r0
733 name: test_fcmp_one_s32
734 # CHECK-LABEL: name: test_fcmp_one_s32
736 regBankSelected: false
739 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
740 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
741 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
742 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
745 - { id: 0, class: _ }
746 - { id: 1, class: _ }
747 - { id: 2, class: _ }
748 - { id: 3, class: _ }
755 %2(s1) = G_FCMP floatpred(one), %0(s32), %1
756 %3(s32) = G_ZEXT %2(s1)
758 BX_RET 14, $noreg, implicit $r0
762 name: test_fcmp_ugt_s64
763 # CHECK-LABEL: name: test_fcmp_ugt_s64
765 regBankSelected: false
768 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
769 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
770 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
771 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
774 - { id: 0, class: _ }
775 - { id: 1, class: _ }
776 - { id: 2, class: _ }
777 - { id: 3, class: _ }
784 %2(s1) = G_FCMP floatpred(ugt), %0(s64), %1
785 %3(s32) = G_ZEXT %2(s1)
787 BX_RET 14, $noreg, implicit $r0
791 name: test_select_s32
792 # CHECK-LABEL: name: test_select_s32
794 regBankSelected: false
797 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
798 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
799 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
800 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
801 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
804 - { id: 0, class: _ }
805 - { id: 1, class: _ }
806 - { id: 2, class: _ }
807 - { id: 3, class: _ }
808 - { id: 4, class: _ }
811 liveins: $r0, $r1, $r2
816 %3(s1) = G_TRUNC %2(s32)
817 %4(s32) = G_SELECT %3(s1), %0, %1
819 BX_RET 14, $noreg, implicit $r0
824 # CHECK-LABEL: name: test_br
826 regBankSelected: false
827 # CHECK: regBankSelected: true
830 - { id: 0, class: _ }
831 - { id: 1, class: _ }
832 # CHECK: { id: 0, class: gprb, preferred-register: '' }
833 # CHECK: { id: 1, class: gprb, preferred-register: '' }
834 # Check that we map the condition of the G_BRCOND into the GPR.
835 # For the G_BR, there are no registers to map, but make sure we don't crash.
838 successors: %bb.1(0x40000000), %bb.2(0x40000000)
842 %1(s1) = G_TRUNC %0(s32)
843 G_BRCOND %1(s1), %bb.1
855 # CHECK-LABEL: name: test_phi_s32
857 regBankSelected: false
858 # CHECK: regBankSelected: true
860 tracksRegLiveness: true
862 - { id: 0, class: _ }
863 - { id: 1, class: _ }
864 - { id: 2, class: _ }
865 - { id: 3, class: _ }
866 - { id: 4, class: _ }
867 # CHECK: { id: 0, class: gprb, preferred-register: '' }
868 # CHECK: { id: 1, class: gprb, preferred-register: '' }
869 # CHECK: { id: 2, class: gprb, preferred-register: '' }
870 # CHECK: { id: 3, class: gprb, preferred-register: '' }
871 # CHECK: { id: 4, class: gprb, preferred-register: '' }
874 successors: %bb.1(0x40000000), %bb.2(0x40000000)
875 liveins: $r0, $r1, $r2
878 %1(s1) = G_TRUNC %0(s32)
883 G_BRCOND %1(s1), %bb.1
887 successors: %bb.2(0x80000000)
890 %4(s32) = G_PHI %2(s32), %bb.0, %3(s32), %bb.1
892 BX_RET 14, $noreg, implicit $r0
896 # CHECK-LABEL: name: test_phi_s64
898 regBankSelected: false
899 # CHECK: regBankSelected: true
901 tracksRegLiveness: true
903 - { id: 0, class: _ }
904 - { id: 1, class: _ }
905 - { id: 2, class: _ }
906 - { id: 3, class: _ }
907 - { id: 4, class: _ }
908 # CHECK: { id: 0, class: gprb, preferred-register: '' }
909 # CHECK: { id: 1, class: gprb, preferred-register: '' }
910 # CHECK: { id: 2, class: fprb, preferred-register: '' }
911 # CHECK: { id: 3, class: fprb, preferred-register: '' }
912 # CHECK: { id: 4, class: fprb, preferred-register: '' }
915 successors: %bb.1(0x40000000), %bb.2(0x40000000)
916 liveins: $r0, $d0, $d1
919 %1(s1) = G_TRUNC %0(s32)
924 G_BRCOND %1(s1), %bb.1
928 successors: %bb.2(0x80000000)
931 %4(s64) = G_PHI %2(s64), %bb.0, %3(s64), %bb.1
933 BX_RET 14, $noreg, implicit $d0
937 # CHECK-LABEL: name: test_fadd_s32
939 regBankSelected: false
942 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
943 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
944 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
947 - { id: 0, class: _ }
948 - { id: 1, class: _ }
949 - { id: 2, class: _ }
956 %2(s32) = G_FADD %0, %1
958 BX_RET 14, $noreg, implicit $s0
963 # CHECK-LABEL: name: test_fadd_s64
965 regBankSelected: false
968 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
969 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
970 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
973 - { id: 0, class: _ }
974 - { id: 1, class: _ }
975 - { id: 2, class: _ }
982 %2(s64) = G_FADD %0, %1
984 BX_RET 14, $noreg, implicit $d0
989 # CHECK-LABEL: name: test_fsub_s32
991 regBankSelected: false
994 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
995 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
996 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
999 - { id: 0, class: _ }
1000 - { id: 1, class: _ }
1001 - { id: 2, class: _ }
1008 %2(s32) = G_FSUB %0, %1
1010 BX_RET 14, $noreg, implicit $s0
1015 # CHECK-LABEL: name: test_fsub_s64
1017 regBankSelected: false
1020 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1021 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1022 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1025 - { id: 0, class: _ }
1026 - { id: 1, class: _ }
1027 - { id: 2, class: _ }
1034 %2(s64) = G_FSUB %0, %1
1036 BX_RET 14, $noreg, implicit $d0
1041 # CHECK-LABEL: name: test_fmul_s32
1043 regBankSelected: false
1046 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1047 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1048 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1051 - { id: 0, class: _ }
1052 - { id: 1, class: _ }
1053 - { id: 2, class: _ }
1060 %2(s32) = G_FMUL %0, %1
1062 BX_RET 14, $noreg, implicit $s0
1067 # CHECK-LABEL: name: test_fmul_s64
1069 regBankSelected: false
1072 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1073 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1074 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1077 - { id: 0, class: _ }
1078 - { id: 1, class: _ }
1079 - { id: 2, class: _ }
1086 %2(s64) = G_FMUL %0, %1
1088 BX_RET 14, $noreg, implicit $d0
1093 # CHECK-LABEL: name: test_fdiv_s32
1095 regBankSelected: false
1098 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1099 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1100 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1103 - { id: 0, class: _ }
1104 - { id: 1, class: _ }
1105 - { id: 2, class: _ }
1112 %2(s32) = G_FDIV %0, %1
1114 BX_RET 14, $noreg, implicit $s0
1119 # CHECK-LABEL: name: test_fdiv_s64
1121 regBankSelected: false
1124 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1125 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1126 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1129 - { id: 0, class: _ }
1130 - { id: 1, class: _ }
1131 - { id: 2, class: _ }
1138 %2(s64) = G_FDIV %0, %1
1140 BX_RET 14, $noreg, implicit $d0
1145 # CHECK-LABEL: name: test_fneg_s32
1147 regBankSelected: false
1150 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1151 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1153 - { id: 0, class: _ }
1154 - { id: 1, class: _ }
1162 BX_RET 14, $noreg, implicit $s0
1167 # CHECK-LABEL: name: test_fneg_s64
1169 regBankSelected: false
1172 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1173 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1175 - { id: 0, class: _ }
1176 - { id: 1, class: _ }
1184 BX_RET 14, $noreg, implicit $d0
1189 # CHECK-LABEL: name: test_fma_s32
1191 regBankSelected: false
1194 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1195 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1196 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1197 # CHECK: - { id: 3, class: fprb, preferred-register: '' }
1199 - { id: 0, class: _ }
1200 - { id: 1, class: _ }
1201 - { id: 2, class: _ }
1202 - { id: 3, class: _ }
1205 liveins: $s0, $s1, $s2
1210 %3(s32) = G_FMA %0, %1, %2
1212 BX_RET 14, $noreg, implicit $s0
1216 # CHECK-LABEL: name: test_fma_s64
1218 regBankSelected: false
1221 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1222 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1223 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1224 # CHECK: - { id: 3, class: fprb, preferred-register: '' }
1226 - { id: 0, class: _ }
1227 - { id: 1, class: _ }
1228 - { id: 2, class: _ }
1229 - { id: 3, class: _ }
1232 liveins: $d0, $d1, $d2
1237 %3(s64) = G_FMA %0, %1, %2
1239 BX_RET 14, $noreg, implicit $d0
1242 name: test_fpext_s32_to_s64
1243 # CHECK-LABEL: name: test_fpext_s32_to_s64
1245 regBankSelected: false
1248 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1249 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1251 - { id: 0, class: _ }
1252 - { id: 1, class: _ }
1258 %1(s64) = G_FPEXT %0
1260 BX_RET 14, $noreg, implicit $d0
1263 name: test_fptrunc_s64_to_s32
1264 # CHECK-LABEL: name: test_fptrunc_s64_to_s32
1266 regBankSelected: false
1269 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1270 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1272 - { id: 0, class: _ }
1273 - { id: 1, class: _ }
1279 %1(s32) = G_FPTRUNC %0
1281 BX_RET 14, $noreg, implicit $s0
1284 name: test_fpconst_s32
1285 # CHECK-LABEL: name: test_fpconst_s32
1287 regBankSelected: false
1290 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1292 - { id: 0, class: _ }
1297 %0(s32) = G_FCONSTANT float -1.25
1299 BX_RET 14, $noreg, implicit $s0
1302 name: test_fpconst_s64
1303 # CHECK-LABEL: name: test_fpconst_s64
1305 regBankSelected: false
1308 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1310 - { id: 0, class: _ }
1315 %0(s64) = G_FCONSTANT double -2.4
1317 BX_RET 14, $noreg, implicit $d0
1320 name: test_fptosi_s32
1321 # CHECK-LABEL: name: test_fptosi_s32
1323 regBankSelected: false
1326 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1327 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1329 - { id: 0, class: _ }
1330 - { id: 1, class: _ }
1336 %1(s32) = G_FPTOSI %0
1338 BX_RET 14, $noreg, implicit $r0
1342 name: test_fptosi_s64
1343 # CHECK-LABEL: name: test_fptosi_s64
1345 regBankSelected: false
1348 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1349 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1351 - { id: 0, class: _ }
1352 - { id: 1, class: _ }
1358 %1(s32) = G_FPTOSI %0
1360 BX_RET 14, $noreg, implicit $r0
1363 name: test_fptoui_s32
1364 # CHECK-LABEL: name: test_fptoui_s32
1366 regBankSelected: false
1369 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1370 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1372 - { id: 0, class: _ }
1373 - { id: 1, class: _ }
1379 %1(s32) = G_FPTOUI %0
1381 BX_RET 14, $noreg, implicit $r0
1385 name: test_fptoui_s64
1386 # CHECK-LABEL: name: test_fptoui_s64
1388 regBankSelected: false
1391 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
1392 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1394 - { id: 0, class: _ }
1395 - { id: 1, class: _ }
1401 %1(s32) = G_FPTOUI %0
1403 BX_RET 14, $noreg, implicit $r0
1406 name: test_sitofp_s32
1407 # CHECK-LABEL: name: test_sitofp_s32
1409 regBankSelected: false
1412 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1413 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1415 - { id: 0, class: _ }
1416 - { id: 1, class: _ }
1422 %1(s32) = G_SITOFP %0
1424 BX_RET 14, $noreg, implicit $s0
1428 name: test_sitofp_s64
1429 # CHECK-LABEL: name: test_sitofp_s64
1431 regBankSelected: false
1434 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1435 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1437 - { id: 0, class: _ }
1438 - { id: 1, class: _ }
1444 %1(s64) = G_SITOFP %0
1446 BX_RET 14, $noreg, implicit $d0
1449 name: test_uitofp_s32
1450 # CHECK-LABEL: name: test_uitofp_s32
1452 regBankSelected: false
1455 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1456 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1458 - { id: 0, class: _ }
1459 - { id: 1, class: _ }
1465 %1(s32) = G_UITOFP %0
1467 BX_RET 14, $noreg, implicit $s0
1471 name: test_uitofp_s64
1472 # CHECK-LABEL: name: test_uitofp_s64
1474 regBankSelected: false
1477 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1478 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
1480 - { id: 0, class: _ }
1481 - { id: 1, class: _ }
1487 %1(s64) = G_UITOFP %0
1489 BX_RET 14, $noreg, implicit $d0
1492 name: test_soft_fp_s64
1493 # CHECK-LABEL: name: test_soft_fp_s64
1495 regBankSelected: false
1498 # CHECK: - { id: 0, class: gprb, preferred-register: '' }
1499 # CHECK: - { id: 1, class: gprb, preferred-register: '' }
1500 # CHECK: - { id: 2, class: fprb, preferred-register: '' }
1501 # CHECK: - { id: 3, class: gprb, preferred-register: '' }
1502 # CHECK: - { id: 4, class: gprb, preferred-register: '' }
1505 - { id: 0, class: _ }
1506 - { id: 1, class: _ }
1507 - { id: 2, class: _ }
1508 - { id: 3, class: _ }
1509 - { id: 4, class: _ }
1516 %2(s64) = G_MERGE_VALUES %0(s32), %1(s32)
1517 %3(s32), %4(s32) = G_UNMERGE_VALUES %2(s64)
1520 BX_RET 14, $noreg, implicit $r0, implicit $r1
1524 name: test_dbg_value
1525 # CHECK-LABEL: name: test_dbg_value
1527 regBankSelected: false
1531 - { id: 0, class: _ }
1532 - { id: 1, class: _ }
1533 - { id: 2, class: _ }
1534 - { id: 3, class: _ }
1535 - { id: 4, class: _ }
1536 - { id: 5, class: _ }
1539 liveins: $r0, $s1, $d2
1543 ; CHECK: {{%[0-9]+}}:gprb(s32) = G_ADD
1544 %1(s32) = G_ADD %0, %0
1546 ; CHECK: DBG_VALUE {{%[0-9]+}}(s32), $noreg
1547 DBG_VALUE %1(s32), $noreg, !7, !DIExpression(), debug-location !9
1553 ; CHECK: {{%[0-9]+}}:fprb(s32) = G_FADD
1554 %3(s32) = G_FADD %2, %2
1556 ; CHECK: DBG_VALUE {{%[0-9]+}}(s32), $noreg
1557 DBG_VALUE %3(s32), $noreg, !7, !DIExpression(), debug-location !9
1563 ; CHECK: {{%[0-9]+}}:fprb(s64) = G_FADD
1564 %5(s64) = G_FADD %4, %4
1566 ; CHECK: DBG_VALUE {{%[0-9]+}}(s64), $noreg
1567 DBG_VALUE %5(s64), $noreg, !7, !DIExpression(), debug-location !9
1571 ; CHECK: DBG_VALUE i32 42, 0
1572 DBG_VALUE i32 42, 0, !7, !DIExpression(), debug-location !9
1574 ; CHECK: DBG_VALUE float 1.000000e+00, 0
1575 DBG_VALUE float 1.000000e+00, 0, !7, !DIExpression(), debug-location !9
1577 ; CHECK: DBG_VALUE $noreg, 0
1578 DBG_VALUE $noreg, 0, !7, !DIExpression(), debug-location !9
1581 BX_RET 14, $noreg, implicit $r0, implicit $s1, implicit $d2