diff options
author | Amaury de la Vieuville <amaury.dlv@gmail.com> | 2013-06-18 08:13:05 +0000 |
---|---|---|
committer | Amaury de la Vieuville <amaury.dlv@gmail.com> | 2013-06-18 08:13:05 +0000 |
commit | beb920fce6ccc89b4735f280f94cb8c227f4ef5e (patch) | |
tree | b05f8b29168dcdff8045ea3d5b0f859beab8b8a0 /lib/Target/ARM/AsmParser | |
parent | f8b60d6f30a8f25c84a71d36ff3a86fe1f52f671 (diff) | |
download | external_llvm-beb920fce6ccc89b4735f280f94cb8c227f4ef5e.zip external_llvm-beb920fce6ccc89b4735f280f94cb8c227f4ef5e.tar.gz external_llvm-beb920fce6ccc89b4735f280f94cb8c227f4ef5e.tar.bz2 |
ARM: fix literal load with positive offset encoding
When using a positive offset, literal loads where encoded
as if it was negative, because:
- The sign bit was not assigned to an operand
- The addrmode_imm12 operand was not encoding the sign bit correctly
This patch also makes the assembler look at the .w/.n specifier for
loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index e315d16..170d434 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -5862,7 +5862,9 @@ processInstruction(MCInst &Inst, case ARM::t2LDRpcrel: // Select the narrow version if the immediate will fit. if (Inst.getOperand(1).getImm() > 0 && - Inst.getOperand(1).getImm() <= 0xff) + Inst.getOperand(1).getImm() <= 0xff && + !(static_cast<ARMOperand*>(Operands[2])->isToken() && + static_cast<ARMOperand*>(Operands[2])->getToken() == ".w")) Inst.setOpcode(ARM::tLDRpci); else Inst.setOpcode(ARM::t2LDRpci); |