The floating point value is encoded in its binary form as an Imm. Convert it
authorBill Wendling <isanbard@gmail.com>
Tue, 25 Jan 2011 21:27:46 +0000 (21:27 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 25 Jan 2011 21:27:46 +0000 (21:27 +0000)
appropriately so that it prints out the decimal representation.

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

lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp

index 820c2e6ca6f919af9e74630d9d6111d24af530e8..46616f8ebc9349fbc419093f5243d96882e5cc89 100644 (file)
@@ -673,12 +673,14 @@ void ARMInstPrinter::printT2AddrModeSoRegOperand(const MCInst *MI,
 
 void ARMInstPrinter::printVFPf32ImmOperand(const MCInst *MI, unsigned OpNum,
                                            raw_ostream &O) {
-  O << '#' << (float)MI->getOperand(OpNum).getFPImm();
+  const MCOperand &MO = MI->getOperand(OpNum);
+  O << '#' << APInt(64, MO.getImm(), true).bitsToDouble();
 }
 
 void ARMInstPrinter::printVFPf64ImmOperand(const MCInst *MI, unsigned OpNum,
                                            raw_ostream &O) {
-  O << '#' << MI->getOperand(OpNum).getFPImm();
+  const MCOperand &MO = MI->getOperand(OpNum);
+  O << '#' << APInt(64, MO.getImm(), true).bitsToDouble();
 }
 
 void ARMInstPrinter::printNEONModImmOperand(const MCInst *MI, unsigned OpNum,