aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-16 03:45:21 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-16 03:45:21 +0000
commita8e47b3319db56675f8e80f4bb015c163110b902 (patch)
tree7c7cb8aed315b557095d15dc17c76f6af6fe4529 /lib
parentf969868271f25df126047d0844f45b5e3b844b6d (diff)
store MC FP immediates as a double instead of as an APFloat, thus avoiding an
unnecessary dtor for MCOperand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMMCInstLower.cpp3
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp4
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp5
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMMCInstLower.cpp b/lib/Target/ARM/ARMMCInstLower.cpp
index b26d327e36..8774010d89 100644
--- a/lib/Target/ARM/ARMMCInstLower.cpp
+++ b/lib/Target/ARM/ARMMCInstLower.cpp
@@ -157,7 +157,8 @@ void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
MO.getBlockAddress()));
break;
case MachineOperand::MO_FPImmediate:
- MCOp = MCOperand::CreateFPImm(MO.getFPImm()->getValueAPF());
+ MCOp =
+ MCOperand::CreateFPImm(MO.getFPImm()->getValueAPF().convertToDouble());
break;
}
diff --git a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
index b66c857dc1..f2ba2d0617 100644
--- a/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
@@ -747,12 +747,12 @@ void ARMInstPrinter::printT2AddrModeSoRegOperand(const MCInst *MI,
void ARMInstPrinter::printVFPf32ImmOperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
- O << '#' << MI->getOperand(OpNum).getFPImm().convertToFloat();
+ O << '#' << (float)MI->getOperand(OpNum).getFPImm();
}
void ARMInstPrinter::printVFPf64ImmOperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
- O << '#' << MI->getOperand(OpNum).getFPImm().convertToDouble();
+ O << '#' << MI->getOperand(OpNum).getFPImm();
}
void ARMInstPrinter::printNEONModImmOperand(const MCInst *MI, unsigned OpNum,
diff --git a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
index 4dc16bb72f..971d64279e 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
@@ -1973,7 +1973,10 @@ static bool DisassembleVFPMiscFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
// The asm syntax specifies the floating point value, not the 8-bit literal.
APInt immRaw = VFPExpandImm(slice(insn,19,16) << 4 | slice(insn, 3, 0),
Opcode == ARM::FCONSTD ? 64 : 32);
- MI.addOperand(MCOperand::CreateFPImm(APFloat(immRaw, true)));
+ APFloat immFP = APFloat(immRaw, true);
+ double imm = Opcode == ARM::FCONSTD ? immFP.convertToDouble() :
+ immFP.convertToFloat();
+ MI.addOperand(MCOperand::CreateFPImm(imm));
++OpIdx;
}