summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
committerDale Johannesen <dalej@apple.com>2007-09-11 18:32:33 +0000
commit245dceb06d5d4ef8a4edace1cfddf54cf0122a64 (patch)
tree5eecd813137e3673308a5f0e3ba38adc6f6dede4 /llvm/lib/CodeGen/AsmPrinter.cpp
parent32ef96186f13d5fa1ca9aad369f1198fbba6a56d (diff)
downloadbcm5719-llvm-245dceb06d5d4ef8a4edace1cfddf54cf0122a64.tar.gz
bcm5719-llvm-245dceb06d5d4ef8a4edace1cfddf54cf0122a64.zip
Add APInt interfaces to APFloat (allows directly
access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index e80afd40eed..49bcba78141 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -830,29 +830,31 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
// FP Constants are printed as integer constants to avoid losing
// precision...
if (CFP->getType() == Type::DoubleTy) {
- double Val = CFP->getValueAPF().convertToDouble();
+ double Val = CFP->getValueAPF().convertToDouble(); // for comment only
+ uint64_t i = *CFP->getValueAPF().convertToAPInt().getRawData();
if (TAI->getData64bitsDirective())
- O << TAI->getData64bitsDirective() << DoubleToBits(Val) << "\t"
+ O << TAI->getData64bitsDirective() << i << "\t"
<< TAI->getCommentString() << " double value: " << Val << "\n";
else if (TD->isBigEndian()) {
- O << TAI->getData32bitsDirective() << unsigned(DoubleToBits(Val) >> 32)
+ O << TAI->getData32bitsDirective() << unsigned(i >> 32)
<< "\t" << TAI->getCommentString()
<< " double most significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(DoubleToBits(Val))
+ O << TAI->getData32bitsDirective() << unsigned(i)
<< "\t" << TAI->getCommentString()
<< " double least significant word " << Val << "\n";
} else {
- O << TAI->getData32bitsDirective() << unsigned(DoubleToBits(Val))
+ O << TAI->getData32bitsDirective() << unsigned(i)
<< "\t" << TAI->getCommentString()
<< " double least significant word " << Val << "\n";
- O << TAI->getData32bitsDirective() << unsigned(DoubleToBits(Val) >> 32)
+ O << TAI->getData32bitsDirective() << unsigned(i >> 32)
<< "\t" << TAI->getCommentString()
<< " double most significant word " << Val << "\n";
}
return;
} else {
- float Val = CFP->getValueAPF().convertToFloat();
- O << TAI->getData32bitsDirective() << FloatToBits(Val)
+ float Val = CFP->getValueAPF().convertToFloat(); // for comment only
+ O << TAI->getData32bitsDirective()
+ << (uint32_t)*CFP->getValueAPF().convertToAPInt().getRawData()
<< "\t" << TAI->getCommentString() << " float " << Val << "\n";
return;
}
OpenPOWER on IntegriCloud