diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-06 18:13:44 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-06 18:13:44 +0000 |
commit | 43421b3dd70af5b70e71816521f37502c397cc65 (patch) | |
tree | b314e17b0444f33dc3be37eaeaeaa8ea7dd1d17e /lib/Target/MSIL/MSILWriter.cpp | |
parent | 325be7c608a37d87e4f3d731e11fa3dd34f529b5 (diff) |
Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/MSIL/MSILWriter.cpp')
-rw-r--r-- | lib/Target/MSIL/MSILWriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp index 5859adf87a..71789703ff 100644 --- a/lib/Target/MSIL/MSILWriter.cpp +++ b/lib/Target/MSIL/MSILWriter.cpp @@ -428,10 +428,10 @@ void MSILWriter::printConstLoad(const Constant* C) { uint64_t X; unsigned Size; if (FP->getType()->getTypeID()==Type::FloatTyID) { - X = FloatToBits(FP->getValue()); + X = FloatToBits(FP->getValueAPF().convertToFloat()); Size = 4; } else { - X = DoubleToBits(FP->getValue()); + X = DoubleToBits(FP->getValueAPF().convertToDouble()); Size = 8; } Out << "\tldc.r" << Size << "\t( " << utohexstr(X) << ')'; @@ -1472,9 +1472,11 @@ void MSILWriter::printStaticConstant(const Constant* C, uint64_t& Offset) { TySize = TD->getTypeSize(Ty); const ConstantFP* FP = cast<ConstantFP>(C); if (Ty->getTypeID() == Type::FloatTyID) - Out << "int32 (" << FloatToBits(FP->getValue()) << ')'; + Out << "int32 (" << + FloatToBits(FP->getValueAPF().convertToFloat()) << ')'; else - Out << "int64 (" << DoubleToBits(FP->getValue()) << ')'; + Out << "int64 (" << + DoubleToBits(FP->getValueAPF().convertToDouble()) << ')'; break; } case Type::ArrayTyID: |