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 | bed9dc423ceadd08500869cf03e4c0819145d48b (patch) | |
| tree | 1f39c25a045eca2e6d11262ae1be517e661d4010 /llvm/lib/Target/MSIL/MSILWriter.cpp | |
| parent | a07765b8f4d9da2836d8f89b26d7f476715dffb4 (diff) | |
| download | bcm5719-llvm-bed9dc423ceadd08500869cf03e4c0819145d48b.tar.gz bcm5719-llvm-bed9dc423ceadd08500869cf03e4c0819145d48b.zip | |
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.)
llvm-svn: 41747
Diffstat (limited to 'llvm/lib/Target/MSIL/MSILWriter.cpp')
| -rw-r--r-- | llvm/lib/Target/MSIL/MSILWriter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/MSIL/MSILWriter.cpp b/llvm/lib/Target/MSIL/MSILWriter.cpp index 5859adf87af..71789703ff3 100644 --- a/llvm/lib/Target/MSIL/MSILWriter.cpp +++ b/llvm/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: |

