aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-16 17:37:30 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-16 17:37:30 +0000
commit1d51c41a457b99d646e3a9b9fae1e913f7a60dc0 (patch)
treebf79fc945eae6f2a11492900d0f6208dafdbb1c1
parent34e3d0cfe525b3067856c8978174fec75223b16a (diff)
Make sure to promote single precision floats to double before extracting them
from the APFloat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114096 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMMCInstLower.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMMCInstLower.cpp b/lib/Target/ARM/ARMMCInstLower.cpp
index 8774010d89..404a73b95c 100644
--- a/lib/Target/ARM/ARMMCInstLower.cpp
+++ b/lib/Target/ARM/ARMMCInstLower.cpp
@@ -157,8 +157,10 @@ void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
MO.getBlockAddress()));
break;
case MachineOperand::MO_FPImmediate:
- MCOp =
- MCOperand::CreateFPImm(MO.getFPImm()->getValueAPF().convertToDouble());
+ APFloat Val = MO.getFPImm()->getValueAPF();
+ bool ignored;
+ Val.convert(APFloat::IEEEdouble, APFloat::rmTowardZero, &ignored);
+ MCOp = MCOperand::CreateFPImm(Val.convertToDouble());
break;
}