diff options
author | Silviu Baranga <silviu.baranga@arm.com> | 2012-05-11 09:10:54 +0000 |
---|---|---|
committer | Silviu Baranga <silviu.baranga@arm.com> | 2012-05-11 09:10:54 +0000 |
commit | ca3cd419a52c1dedee133d79772ef97f30e5d20b (patch) | |
tree | 4c4b36e645914c8879faea595cf651787328520d /lib/Target/ARM/InstPrinter | |
parent | 383fd7afd9cd2431fdb0b32130fc8125903a7fa8 (diff) | |
download | external_llvm-ca3cd419a52c1dedee133d79772ef97f30e5d20b.zip external_llvm-ca3cd419a52c1dedee133d79772ef97f30e5d20b.tar.gz external_llvm-ca3cd419a52c1dedee133d79772ef97f30e5d20b.tar.bz2 |
Fixed the LLVM ARM v7 assembler and instruction printer for 8-bit immediate offset addressing. The assembler and instruction printer were not properly handeling the #-0 immediate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/InstPrinter')
-rw-r--r-- | lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp index 34a76b2..be7e098 100644 --- a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp +++ b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp @@ -426,9 +426,13 @@ void ARMInstPrinter::printAM3PreOrOffsetIndexOp(const MCInst *MI, unsigned Op, return; } - if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm())) + //If the op is sub we have to print the immediate even if it is 0 + unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm()); + ARM_AM::AddrOpc op = ARM_AM::getAM3Op(MO3.getImm()); + + if (ImmOffs || (op == ARM_AM::sub)) O << ", #" - << ARM_AM::getAddrOpcStr(ARM_AM::getAM3Op(MO3.getImm())) + << ARM_AM::getAddrOpcStr(op) << ImmOffs; O << ']'; } |