summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-10-11 23:32:15 +0000
committerDale Johannesen <dalej@apple.com>2007-10-11 23:32:15 +0000
commit6472eb63c200f4fba8866c6965b21c86cbc4cd21 (patch)
treeb367cb39fc2637f53318aabed2d4bd42e5a78c94 /llvm/lib/CodeGen/AsmPrinter.cpp
parent482732af9d8e32ee5e2a29b264f31735603cb290 (diff)
downloadbcm5719-llvm-6472eb63c200f4fba8866c6965b21c86cbc4cd21.tar.gz
bcm5719-llvm-6472eb63c200f4fba8866c6965b21c86cbc4cd21.zip
Implement ppc long double->uint conversion.
Make ppc long double constants print. llvm-svn: 42882
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 5eb85cd21a5..47a53457fc9 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -917,6 +917,39 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
<< " long double most significant halfword\n";
}
return;
+ } else if (CFP->getType() == Type::PPC_FP128Ty) {
+ // all long double variants are printed as hex
+ // api needed to prevent premature destruction
+ APInt api = CFP->getValueAPF().convertToAPInt();
+ const uint64_t *p = api.getRawData();
+ if (TD->isBigEndian()) {
+ O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double most significant word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0])
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1])
+ << "\t" << TAI->getCommentString()
+ << " long double least significant word\n";
+ } else {
+ O << TAI->getData32bitsDirective() << uint32_t(p[1])
+ << "\t" << TAI->getCommentString()
+ << " long double least significant word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[1] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0])
+ << "\t" << TAI->getCommentString()
+ << " long double next word\n";
+ O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32)
+ << "\t" << TAI->getCommentString()
+ << " long double most significant word\n";
+ }
+ return;
} else assert(0 && "Floating point constant type not handled");
} else if (CV->getType() == Type::Int64Ty) {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
OpenPOWER on IntegriCloud