summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-12-06 04:49:29 +0000
committerJim Grosbach <grosbach@apple.com>2011-12-06 04:49:29 +0000
commit175c7d0da52e8199b56f2c387f911889a7a1e48b (patch)
tree798e3a23832ebe2da702122d92470a8245f98cc4 /llvm
parent5f623229ecb37218f463f43def51e4b0807d6077 (diff)
downloadbcm5719-llvm-175c7d0da52e8199b56f2c387f911889a7a1e48b.tar.gz
bcm5719-llvm-175c7d0da52e8199b56f2c387f911889a7a1e48b.zip
Thumb2 encoding choice correction for PLD.
Using encoding T1 for offset of #0 and encoding T2 for #-0. rdar://10532413 llvm-svn: 145919
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp4
-rw-r--r--llvm/test/MC/ARM/basic-thumb2-instructions.s4
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 07679a60ffd..e4a7094232b 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -916,9 +916,9 @@ public:
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)
diff --git a/llvm/test/MC/ARM/basic-thumb2-instructions.s b/llvm/test/MC/ARM/basic-thumb2-instructions.s
index 205ca35a45d..5de5104ac30 100644
--- a/llvm/test/MC/ARM/basic-thumb2-instructions.s
+++ b/llvm/test/MC/ARM/basic-thumb2-instructions.s
@@ -1371,12 +1371,16 @@ _func:
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]
@------------------------------------------------------------------------------
OpenPOWER on IntegriCloud