diff options
author | Dale Johannesen <dalej@apple.com> | 2007-10-11 23:32:15 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-10-11 23:32:15 +0000 |
commit | fcf4d24ffbba0935de3e8371cfd52fc3d6980789 (patch) | |
tree | b6338752e0f5af8f6362e84b819d98e715ef367d /lib/CodeGen/AsmPrinter.cpp | |
parent | f96e4de403453e57aea75bcac1ed99af686d33c4 (diff) |
Implement ppc long double->uint conversion.
Make ppc long double constants print.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 5eb85cd21a..47a53457fc 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/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)) { |