[llvm-commits] [llvm] r145919 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp test/MC/ARM/basic-thumb2-instructions.s
Jim Grosbach
grosbach at apple.com
Mon Dec 5 20:49:29 PST 2011
Author: grosbach
Date: Mon Dec 5 22:49:29 2011
New Revision: 145919
URL: http://llvm.org/viewvc/llvm-project?rev=145919&view=rev
Log:
Thumb2 encoding choice correction for PLD.
Using encoding T1 for offset of #0 and encoding T2 for #-0.
rdar://10532413
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/basic-thumb2-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=145919&r1=145918&r2=145919&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Dec 5 22:49:29 2011
@@ -916,9 +916,9 @@
if (!isMemory() || Memory.OffsetRegNum != 0 || Memory.Alignment != 0)
return false;
// Immediate offset in range [-255, -1].
- if (!Memory.OffsetImm) return true;
+ if (!Memory.OffsetImm) return false;
int64_t Val = Memory.OffsetImm->getValue();
- return Val > -256 && Val < 0;
+ return (Val == INT32_MIN) || (Val > -256 && Val < 0);
}
bool isMemUImm12Offset() const {
if (!isMemory() || Memory.OffsetRegNum != 0 || Memory.Alignment != 0)
Modified: llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s?rev=145919&r1=145918&r2=145919&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-thumb2-instructions.s Mon Dec 5 22:49:29 2011
@@ -1371,12 +1371,16 @@
pld [r6, #33]
pld [r6, #257]
pld [r7, #257]
+ pld [r1, #0]
+ pld [r1, #-0]
@ CHECK: pld [r5, #-4] @ encoding: [0x15,0xf8,0x04,0xfc]
@ CHECK: pld [r6, #32] @ encoding: [0x96,0xf8,0x20,0xf0]
@ CHECK: pld [r6, #33] @ encoding: [0x96,0xf8,0x21,0xf0]
@ CHECK: pld [r6, #257] @ encoding: [0x96,0xf8,0x01,0xf1]
@ CHECK: pld [r7, #257] @ encoding: [0x97,0xf8,0x01,0xf1]
+@ CHECK: pld [r1] @ encoding: [0x91,0xf8,0x00,0xf0]
+@ CHECK: pld [r1, #-0] @ encoding: [0x11,0xf8,0x00,0xfc]
@------------------------------------------------------------------------------
More information about the llvm-commits
mailing list