@@ -1350,8 +1350,10 @@ bool ARMFastISel::ARMEmitCmp(const Value *Src1Value, const Value *Src2Value,
1350
1350
if (!SrcEVT.isSimple ()) return false ;
1351
1351
MVT SrcVT = SrcEVT.getSimpleVT ();
1352
1352
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 ()))
1355
1357
return false ;
1356
1358
1357
1359
// 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) {
1501
1503
1502
1504
bool ARMFastISel::SelectFPExt (const Instruction *I) {
1503
1505
// 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 ;
1505
1507
1506
1508
Value *V = I->getOperand (0 );
1507
1509
if (!I->getType ()->isDoubleTy () ||
@@ -1520,7 +1522,7 @@ bool ARMFastISel::SelectFPExt(const Instruction *I) {
1520
1522
1521
1523
bool ARMFastISel::SelectFPTrunc (const Instruction *I) {
1522
1524
// 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 ;
1524
1526
1525
1527
Value *V = I->getOperand (0 );
1526
1528
if (!(I->getType ()->isFloatTy () &&
@@ -1571,7 +1573,8 @@ bool ARMFastISel::SelectIToFP(const Instruction *I, bool isSigned) {
1571
1573
1572
1574
unsigned Opc;
1573
1575
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;
1575
1578
else return false ;
1576
1579
1577
1580
unsigned ResultReg = createResultReg (TLI.getRegClassFor (DstVT));
@@ -1596,7 +1599,8 @@ bool ARMFastISel::SelectFPToI(const Instruction *I, bool isSigned) {
1596
1599
unsigned Opc;
1597
1600
Type *OpTy = I->getOperand (0 )->getType ();
1598
1601
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;
1600
1604
else return false ;
1601
1605
1602
1606
// 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) {
1800
1804
// if we have them.
1801
1805
// FIXME: It'd be nice to use NEON instructions.
1802
1806
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 ()))
1805
1810
return false ;
1806
1811
1807
1812
unsigned Opc;
0 commit comments