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).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index e80afd4..49bcba7 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -830,29 +830,31 @@
     // 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;
     }