aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-09-23 22:25:02 +0000
committerOwen Anderson <resistor@mac.com>2011-09-23 22:25:02 +0000
commit4d2a00147d19b17d382644de0d6a1f0d3230e0e4 (patch)
tree99156167178d2273c8c5c040040fc343050642aa
parent11ebe3d7c11521b2f092165ac712c9ea0f4c462f (diff)
Teach the Thumb2 AsmParser to accept pre-indexed loads/stores with an offset of #-0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140426 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp2
-rw-r--r--test/MC/ARM/basic-thumb2-instructions.s2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 137e570721..e62899e7b0 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -780,7 +780,7 @@ public:
// Immediate offset in range [-255, 255].
if (!Mem.OffsetImm) return true;
int64_t Val = Mem.OffsetImm->getValue();
- return Val > -256 && Val < 256;
+ return (Val == INT32_MIN) || (Val > -256 && Val < 256);
}
bool isMemPosImm8Offset() const {
if (Kind != Memory || Mem.OffsetRegNum != 0)
diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s
index 184bcdc1af..4caa0cd000 100644
--- a/test/MC/ARM/basic-thumb2-instructions.s
+++ b/test/MC/ARM/basic-thumb2-instructions.s
@@ -2236,6 +2236,7 @@ _func:
strb lr, [r3], #255
strb r9, [r2], #4
strb r3, [sp], #-4
+ strb r4, [r8, #-0]!
@ CHECK: strb r5, [r5, #-4] @ encoding: [0x05,0xf8,0x04,0x5c]
@ CHECK: strb.w r5, [r6, #32] @ encoding: [0x86,0xf8,0x20,0x50]
@@ -2248,6 +2249,7 @@ _func:
@ CHECK: strb lr, [r3], #255 @ encoding: [0x03,0xf8,0xff,0xeb]
@ CHECK: strb r9, [r2], #4 @ encoding: [0x02,0xf8,0x04,0x9b]
@ CHECK: strb r3, [sp], #-4 @ encoding: [0x0d,0xf8,0x04,0x39]
+@ CHECK: strb r4, [r8, #-0]! @ encoding: [0x08,0xf8,0x00,0x4d]
@------------------------------------------------------------------------------