@@ -1350,8 +1350,10 @@ bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
13501350 if (!SrcEVT.isSimple ()) return false ;
13511351 MVT SrcVT = SrcEVT.getSimpleVT ();
13521352
1353- bool isFloat = (Ty->isFloatTy () || Ty->isDoubleTy ());
1354- if (isFloat && !Subtarget->hasVFP2 ())
1353+ if (Ty->isFloatTy () && !Subtarget->hasVFP2 ())
1354+ return false ;
1355+
1356+ if (Ty->isDoubleTy () && (!Subtarget->hasVFP2 () || Subtarget->isFPOnlySP ()))
13551357 return false ;
13561358
13571359 // Check to see if the 2nd operand is a constant that we can encode directly
@@ -1501,7 +1503,7 @@ bool ARMFastISel::SelectCmp(const Instruction *I) {
15011503
15021504bool ARMFastISel::SelectFPExt (const Instruction *I) {
15031505 // Make sure we have VFP and that we're extending float to double.
1504- if (!Subtarget->hasVFP2 ()) return false ;
1506+ if (!Subtarget->hasVFP2 () || Subtarget-> isFPOnlySP () ) return false ;
15051507
15061508 Value *V = I->getOperand (0 );
15071509 if (!I->getType ()->isDoubleTy () ||
@@ -1520,7 +1522,7 @@ bool ARMFastISel::SelectFPExt(const Instruction *I) {
15201522
15211523bool ARMFastISel::SelectFPTrunc (const Instruction *I) {
15221524 // Make sure we have VFP and that we're truncating double to float.
1523- if (!Subtarget->hasVFP2 ()) return false ;
1525+ if (!Subtarget->hasVFP2 () || Subtarget-> isFPOnlySP () ) return false ;
15241526
15251527 Value *V = I->getOperand (0 );
15261528 if (!(I->getType ()->isFloatTy () &&
@@ -1571,7 +1573,8 @@ bool ARMFastISel::SelectIToFP(const Instruction *I, bool isSigned) {
15711573
15721574 unsigned Opc;
15731575 if (Ty->isFloatTy ()) Opc = isSigned ? ARM::VSITOS : ARM::VUITOS;
1574- else if (Ty->isDoubleTy ()) Opc = isSigned ? ARM::VSITOD : ARM::VUITOD;
1576+ else if (Ty->isDoubleTy () && !Subtarget->isFPOnlySP ())
1577+ Opc = isSigned ? ARM::VSITOD : ARM::VUITOD;
15751578 else return false ;
15761579
15771580 unsigned ResultReg = createResultReg (TLI.getRegClassFor (DstVT));
@@ -1596,7 +1599,8 @@ bool ARMFastISel::SelectFPToI(const Instruction *I, bool isSigned) {
15961599 unsigned Opc;
15971600 Type *OpTy = I->getOperand (0 )->getType ();
15981601 if (OpTy->isFloatTy ()) Opc = isSigned ? ARM::VTOSIZS : ARM::VTOUIZS;
1599- else if (OpTy->isDoubleTy ()) Opc = isSigned ? ARM::VTOSIZD : ARM::VTOUIZD;
1602+ else if (OpTy->isDoubleTy () && !Subtarget->isFPOnlySP ())
1603+ Opc = isSigned ? ARM::VTOSIZD : ARM::VTOUIZD;
16001604 else return false ;
16011605
16021606 // f64->s32/u32 or f32->s32/u32 both need an intermediate f32 reg.
@@ -1800,8 +1804,9 @@ bool ARMFastISel::SelectBinaryFPOp(const Instruction *I, unsigned ISDOpcode) {
18001804 // if we have them.
18011805 // FIXME: It'd be nice to use NEON instructions.
18021806 Type *Ty = I->getType ();
1803- bool isFloat = (Ty->isDoubleTy () || Ty->isFloatTy ());
1804- if (isFloat && !Subtarget->hasVFP2 ())
1807+ if (Ty->isFloatTy () && !Subtarget->hasVFP2 ())
1808+ return false ;
1809+ if (Ty->isDoubleTy () && (!Subtarget->hasVFP2 () || Subtarget->isFPOnlySP ()))
18051810 return false ;
18061811
18071812 unsigned Opc;
0 commit comments