diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-04-01 18:26:38 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-04-01 18:26:38 +0000 |
commit | 5307da994aee85c22af26437d45254228898db2d (patch) | |
tree | 7d53082b9c4bc2c7750fcb036daeceb97a1324ce /lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp | |
parent | c9d2f0cad3194778b2c298912e9ad88f2caef1fa (diff) |
Fix LDRi12 immediate operand, which was changed to be the second operand in $addrmode_imm12 => (ops GPR:$base, i32imm:$offsimm).
rdar://problem/9219356
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp')
-rw-r--r-- | lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp index d3caca624d..c28f7e12ef 100644 --- a/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp +++ b/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp @@ -1098,10 +1098,11 @@ static bool DisassembleLdStFrm(MCInst &MI, unsigned Opcode, uint32_t insn, OpIdx += 1; } - // Disassemble the 12-bit immediate offset. + // Disassemble the 12-bit immediate offset, which is the second operand in + // $addrmode_imm12 => (ops GPR:$base, i32imm:$offsimm). + // unsigned Imm12 = slice(insn, 11, 0); - unsigned Offset = ARM_AM::getAM2Opc(AddrOpcode, Imm12, ARM_AM::no_shift, - IndexMode); + int Offset = AddrOpcode == ARM_AM::add ? 1 * Imm12 : -1 * Imm12; MI.addOperand(MCOperand::CreateImm(Offset)); OpIdx += 1; } else { |