aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-06 18:13:44 +0000
committerDale Johannesen <dalej@apple.com>2007-09-06 18:13:44 +0000
commitb9de9f07d611823ea3371b65f87035f482ace2ad (patch)
treeb314e17b0444f33dc3be37eaeaeaa8ea7dd1d17e /lib/CodeGen/AsmPrinter.cpp
parent6d2c506cce46d4edcc314ca363b5e4ec4584cc38 (diff)
downloadexternal_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.tar.gz
external_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.tar.bz2
external_llvm-b9de9f07d611823ea3371b65f87035f482ace2ad.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.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index fa6f5691fc..e80afd40ee 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -829,8 +829,8 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
// FP Constants are printed as integer constants to avoid losing
// precision...
- double Val = CFP->getValue();
if (CFP->getType() == Type::DoubleTy) {
+ double Val = CFP->getValueAPF().convertToDouble();
if (TAI->getData64bitsDirective())
O << TAI->getData64bitsDirective() << DoubleToBits(Val) << "\t"
<< TAI->getCommentString() << " double value: " << Val << "\n";
@@ -851,6 +851,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
}
return;
} else {
+ float Val = CFP->getValueAPF().convertToFloat();
O << TAI->getData32bitsDirective() << FloatToBits(Val)
<< "\t" << TAI->getCommentString() << " float " << Val << "\n";
return;