summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-04-30 16:13:34 +0000
committerTim Northover <tnorthover@apple.com>2014-04-30 16:13:34 +0000
commitb1c1b8a78dce82d3740316ddf94029696ba68674 (patch)
tree1b831b7fe06a60cc0cb339f88447b561781e5f49 /lib
parent83286f081d7245a35841c9abec3672f467fd662f (diff)
downloadllvm-b1c1b8a78dce82d3740316ddf94029696ba68674.tar.gz
llvm-b1c1b8a78dce82d3740316ddf94029696ba68674.tar.bz2
llvm-b1c1b8a78dce82d3740316ddf94029696ba68674.tar.xz
ARM64: print fp immediates without using scientific notation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp b/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
index 266b5f294b..65d5eae2d2 100644
--- a/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
+++ b/lib/Target/ARM64/InstPrinter/ARM64InstPrinter.cpp
@@ -1221,12 +1221,10 @@ void ARM64InstPrinter::printMemoryRegOffset(const MCInst *MI, unsigned OpNum,
void ARM64InstPrinter::printFPImmOperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
const MCOperand &MO = MI->getOperand(OpNum);
- O << '#';
- if (MO.isFPImm())
- // FIXME: Should this ever happen?
- O << MO.getFPImm();
- else
- O << ARM64_AM::getFPImmFloat(MO.getImm());
+ float FPImm = MO.isFPImm() ? MO.getFPImm() : ARM64_AM::getFPImmFloat(MO.getImm());
+
+ // 8 decimal places are enough to perfectly represent permitted floats.
+ O << format("#%.8f", FPImm);
}
static unsigned getNextVectorRegister(unsigned Reg, unsigned Stride = 1) {