summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sehr <sehr@google.com>2012-12-05 21:01:27 +0000
committerDavid Sehr <sehr@google.com>2012-12-05 21:01:27 +0000
commit05176cad2145d7f8ff751303389883fd21295152 (patch)
tree8855b3d3087c3baa713a175f01f29eccbbaf3edb
parenta5b779a87c2e1e2ec2630e1523e410e39a1320fc (diff)
downloadbcm5719-llvm-05176cad2145d7f8ff751303389883fd21295152.tar.gz
bcm5719-llvm-05176cad2145d7f8ff751303389883fd21295152.zip
Correct ARM NOP encoding
The encoding of NOP in ARMAsmBackend.cpp is missing a trailing zero, which causes the emission of a coprocessor instruction rather than "mov r0, r0" as indicated in the comment. The test also checks for the wrong encoding. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/157919.html llvm-svn: 169420
-rw-r--r--llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp2
-rw-r--r--llvm/test/MC/MachO/ARM/nop-armv4-padding.s2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 3fe23bb54ef..6aab0a0bc5a 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -220,7 +220,7 @@ void ARMAsmBackend::relaxInstruction(const MCInst &Inst, MCInst &Res) const {
bool ARMAsmBackend::writeNopData(uint64_t Count, MCObjectWriter *OW) const {
const uint16_t Thumb1_16bitNopEncoding = 0x46c0; // using MOV r8,r8
const uint16_t Thumb2_16bitNopEncoding = 0xbf00; // NOP
- const uint32_t ARMv4_NopEncoding = 0xe1a0000; // using MOV r0,r0
+ const uint32_t ARMv4_NopEncoding = 0xe1a00000; // using MOV r0,r0
const uint32_t ARMv6T2_NopEncoding = 0xe320f000; // NOP
if (isThumb()) {
const uint16_t nopEncoding = hasNOP() ? Thumb2_16bitNopEncoding
diff --git a/llvm/test/MC/MachO/ARM/nop-armv4-padding.s b/llvm/test/MC/MachO/ARM/nop-armv4-padding.s
index dd0f77c266d..8e03d17a70c 100644
--- a/llvm/test/MC/MachO/ARM/nop-armv4-padding.s
+++ b/llvm/test/MC/MachO/ARM/nop-armv4-padding.s
@@ -7,4 +7,4 @@ x:
.align 4
add r0, r1, r2
-@ CHECK: ('_section_data', '020081e0 00001a0e 00001a0e 00001a0e 020081e0')
+@ CHECK: ('_section_data', '020081e0 0000a0e1 0000a0e1 0000a0e1 020081e0')
OpenPOWER on IntegriCloud