OSDN Git Service

Don't use .quad to output double constants. The assembler must have a bug or
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 29 Sep 2004 19:59:06 +0000 (19:59 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 29 Sep 2004 19:59:06 +0000 (19:59 +0000)
something, because the wrong bit patterns get output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16590 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/SparcV8/SparcV8AsmPrinter.cpp

index c2a5968..56ec97a 100644 (file)
@@ -261,7 +261,8 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
         uint64_t UVal;
       } U;
       U.FVal = Val;
-      O << ".quad\t" << U.UVal << "\t! double " << Val << "\n";
+      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";
       return;
     }
     }
index c2a5968..56ec97a 100644 (file)
@@ -261,7 +261,8 @@ void V8Printer::emitGlobalConstant(const Constant *CV) {
         uint64_t UVal;
       } U;
       U.FVal = Val;
-      O << ".quad\t" << U.UVal << "\t! double " << Val << "\n";
+      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";
       return;
     }
     }