summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/AsmParser
diff options
context:
space:
mode:
authorAmaury de la Vieuville <amaury.dlv@gmail.com>2013-06-18 08:13:05 +0000
committerAmaury de la Vieuville <amaury.dlv@gmail.com>2013-06-18 08:13:05 +0000
commiteac0bad0843b98cd567aae76a41ca50f3d87dd0e (patch)
tree56343b3564ee8546af8466c6c851dab01daa340b /llvm/lib/Target/ARM/AsmParser
parentaa7fdf8741958a35ff06ef993ebb8e4379afe56e (diff)
downloadbcm5719-llvm-eac0bad0843b98cd567aae76a41ca50f3d87dd0e.tar.gz
bcm5719-llvm-eac0bad0843b98cd567aae76a41ca50f3d87dd0e.zip
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. llvm-svn: 184182
Diffstat (limited to 'llvm/lib/Target/ARM/AsmParser')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index e315d165746..170d4347445 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud