llvm.org GIT mirror llvm / b728728
[ARM] GlobalISel: Map s32 G_FCMP in reg bank select Map hard G_FCMP operands to FPR and the result to GPR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307245 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 3 years ago
2 changed file(s) with 43 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
276276 &ARM::ValueMappings[ARM::GPR3OpsIdx]});
277277 break;
278278 }
279 case G_FCMP: {
280 LLT Ty1 = MRI.getType(MI.getOperand(2).getReg());
281 (void)Ty1;
282 LLT Ty2 = MRI.getType(MI.getOperand(3).getReg());
283 (void)Ty2;
284 assert(Ty.getSizeInBits() == 1 && "Unsupported size for G_FCMP");
285 assert(Ty1.getSizeInBits() == 32 && "Unsupported size for G_FCMP");
286 assert(Ty2.getSizeInBits() == 32 && "Unsupported size for G_FCMP");
287 OperandsMapping =
288 getOperandsMapping({&ARM::ValueMappings[ARM::GPR3OpsIdx], nullptr,
289 &ARM::ValueMappings[ARM::SPR3OpsIdx],
290 &ARM::ValueMappings[ARM::SPR3OpsIdx]});
291 break;
292 }
279293 case G_MERGE_VALUES: {
280294 // We only support G_MERGE_VALUES for creating a double precision floating
281295 // point value out of two GPRs.
3434 define void @test_trunc_s32_16() { ret void }
3535
3636 define void @test_icmp_eq_s32() { ret void }
37 define void @test_fcmp_one_s32() #0 { ret void }
3738
3839 define void @test_select_s32() { ret void }
3940
742743
743744 ...
744745 ---
746 name: test_fcmp_one_s32
747 # CHECK-LABEL: name: test_fcmp_one_s32
748 legalized: true
749 regBankSelected: false
750 selected: false
751 # CHECK: registers:
752 # CHECK: - { id: 0, class: fprb, preferred-register: '' }
753 # CHECK: - { id: 1, class: fprb, preferred-register: '' }
754 # CHECK: - { id: 2, class: gprb, preferred-register: '' }
755
756 registers:
757 - { id: 0, class: _ }
758 - { id: 1, class: _ }
759 - { id: 2, class: _ }
760 - { id: 3, class: _ }
761 body: |
762 bb.0:
763 liveins: %s0, %s1
764
765 %0(s32) = COPY %s0
766 %1(s32) = COPY %s1
767 %2(s1) = G_FCMP floatpred(one), %0(s32), %1
768 %3(s32) = G_ZEXT %2(s1)
769 %r0 = COPY %3(s32)
770 BX_RET 14, _, implicit %r0
771
772 ...
773 ---
745774 name: test_select_s32
746775 # CHECK-LABEL: name: test_select_s32
747776 legalized: true