From 3f6eb7419de437436265831fce92f62498556e08 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Tue, 11 Sep 2007 18:32:33 +0000 Subject: 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 --- lib/CodeGen/MachOWriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/MachOWriter.cpp') 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 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset, break; } case Type::FloatTyID: { - uint64_t val = FloatToBits(cast(PC)-> - getValueAPF().convertToFloat()); + uint32_t val = (uint32_t)*cast(PC)-> + getValueAPF().convertToAPInt().getRawData(); if (TD->isBigEndian()) val = ByteSwap_32(val); ptr[0] = val; @@ -872,8 +872,8 @@ void MachOWriter::InitMem(const Constant *C, void *Addr, intptr_t Offset, break; } case Type::DoubleTyID: { - uint64_t val = DoubleToBits(cast(PC)-> - getValueAPF().convertToDouble()); + uint64_t val = *cast(PC)->getValueAPF().convertToAPInt(). + getRawData(); if (TD->isBigEndian()) val = ByteSwap_64(val); ptr[0] = val; -- cgit v1.1