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/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp
index af2555d..1c9b0fe 100644
--- a/lib/CodeGen/MachOWriter.cpp
+++ b/lib/CodeGen/MachOWriter.cpp
@@ -861,8 +861,8 @@
         break;
       }
       case Type::FloatTyID: {
-        uint64_t val = FloatToBits(cast<ConstantFP>(PC)->
-                                   getValueAPF().convertToFloat());
+        uint32_t val = (uint32_t)*cast<ConstantFP>(PC)->
+                                  getValueAPF().convertToAPInt().getRawData();
         if (TD->isBigEndian())
           val = ByteSwap_32(val);
         ptr[0] = val;
@@ -872,8 +872,8 @@
         break;
       }
       case Type::DoubleTyID: {
-        uint64_t val = DoubleToBits(cast<ConstantFP>(PC)->
-                                    getValueAPF().convertToDouble());
+        uint64_t val = *cast<ConstantFP>(PC)->getValueAPF().convertToAPInt().
+                         getRawData();
         if (TD->isBigEndian())
           val = ByteSwap_64(val);
         ptr[0] = val;