[llvm] r183734 - It adds support for negative zero offsets for loads and stores.
Mihai Popa
mihail.popa at gmail.com
Tue Jun 11 02:48:35 PDT 2013
Author: mpopa
Date: Tue Jun 11 04:48:35 2013
New Revision: 183734
URL: http://llvm.org/viewvc/llvm-project?rev=183734&view=rev
Log:
It adds support for negative zero offsets for loads and stores.
Negative zero is returned by the primary expression parser as INT32_MIN, so all that the method needs to do is to accept this value.
Behavior already present for Thumb2.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/arm-memory-instructions.s
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=183734&r1=183733&r2=183734&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Jun 11 04:48:35 2013
@@ -994,7 +994,7 @@ public:
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
if (!CE) return false;
int64_t Val = CE->getValue();
- return Val > -4096 && Val < 4096;
+ return (Val == INT32_MIN) || (Val > -4096 && Val < 4096);
}
bool isAddrMode3() const {
// If we have an immediate that's not a constant, treat it as a label
Modified: llvm/trunk/test/MC/ARM/arm-memory-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/arm-memory-instructions.s?rev=183734&r1=183733&r2=183734&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/arm-memory-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/arm-memory-instructions.s Tue Jun 11 04:48:35 2013
@@ -16,12 +16,14 @@ _func:
ldr r2, [r4, #4095]!
ldr r1, [r2], #30
ldr r3, [r1], #-30
+ ldr r9, [r2], #-0
@ CHECK: ldr r5, [r7] @ encoding: [0x00,0x50,0x97,0xe5]
@ CHECK: ldr r6, [r3, #63] @ encoding: [0x3f,0x60,0x93,0xe5]
@ CHECK: ldr r2, [r4, #4095]! @ encoding: [0xff,0x2f,0xb4,0xe5]
@ CHECK: ldr r1, [r2], #30 @ encoding: [0x1e,0x10,0x92,0xe4]
@ CHECK: ldr r3, [r1], #-30 @ encoding: [0x1e,0x30,0x11,0xe4]
+@ CHECK: ldr r9, [r2], #-0 @ encoding: [0x00,0x90,0x12,0xe4]
@------------------------------------------------------------------------------
@ FIXME: LDR (literal)
@@ -308,13 +310,14 @@ Lbaz: .quad 0
str r3, [r5, #40]!
str r9, [sp], #4095
str r1, [r7], #-128
+ str r1, [r0], #-0
@ CHECK: str r8, [r12] @ encoding: [0x00,0x80,0x8c,0xe5]
@ CHECK: str r7, [r1, #12] @ encoding: [0x0c,0x70,0x81,0xe5]
@ CHECK: str r3, [r5, #40]! @ encoding: [0x28,0x30,0xa5,0xe5]
@ CHECK: str r9, [sp], #4095 @ encoding: [0xff,0x9f,0x8d,0xe4]
@ CHECK: str r1, [r7], #-128 @ encoding: [0x80,0x10,0x07,0xe4]
-
+@ CHECK: str r1, [r0], #-0 @ encoding: [0x00,0x10,0x00,0xe4]
@------------------------------------------------------------------------------
@ FIXME: STR (literal)
More information about the llvm-commits
mailing list