diff options
Diffstat (limited to 'llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp')
| -rw-r--r-- | llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp b/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp index c8852cca990..4e908a1b95d 100644 --- a/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp +++ b/llvm/lib/Target/SparcV8/SparcV8AsmPrinter.cpp @@ -247,22 +247,12 @@ void V8Printer::emitGlobalConstant(const Constant *CV) { switch (CFP->getType()->getTypeID()) { default: assert(0 && "Unknown floating point type!"); case Type::FloatTyID: { - union FU { // Abide by C TBAA rules - float FVal; - unsigned UVal; - } U; - U.FVal = Val; - O << ".long\t" << U.UVal << "\t! float " << Val << "\n"; + O << ".long\t" << FloatToBits(Val) << "\t! float " << Val << "\n"; return; } case Type::DoubleTyID: { - union DU { // Abide by C TBAA rules - double FVal; - uint64_t UVal; - } U; - U.FVal = Val; - O << ".word\t0x" << std::hex << (U.UVal >> 32) << std::dec << "\t! double " << Val << "\n"; - O << ".word\t0x" << std::hex << (U.UVal & 0xffffffffUL) << std::dec << "\t! double " << Val << "\n"; + O << ".word\t0x" << std::hex << (DoubleToBits(Val) >> 32) << std::dec << "\t! double " << Val << "\n"; + O << ".word\t0x" << std::hex << (DoubleToBits(Val) & 0xffffffffUL) << std::dec << "\t! double " << Val << "\n"; return; } } |

