[llvm-commits] [llvm] r169420 - in /llvm/trunk: lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp test/MC/MachO/ARM/nop-armv4-padding.s
David Sehr
sehr at google.com
Wed Dec 5 13:01:27 PST 2012
Author: sehr
Date: Wed Dec 5 15:01:27 2012
New Revision: 169420
URL: http://llvm.org/viewvc/llvm-project?rev=169420&view=rev
Log:
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
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
llvm/trunk/test/MC/MachO/ARM/nop-armv4-padding.s
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp?rev=169420&r1=169419&r2=169420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Wed Dec 5 15:01:27 2012
@@ -220,7 +220,7 @@
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
Modified: llvm/trunk/test/MC/MachO/ARM/nop-armv4-padding.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/MachO/ARM/nop-armv4-padding.s?rev=169420&r1=169419&r2=169420&view=diff
==============================================================================
--- llvm/trunk/test/MC/MachO/ARM/nop-armv4-padding.s (original)
+++ llvm/trunk/test/MC/MachO/ARM/nop-armv4-padding.s Wed Dec 5 15:01:27 2012
@@ -7,4 +7,4 @@
.align 4
add r0, r1, r2
-@ CHECK: ('_section_data', '020081e0 00001a0e 00001a0e 00001a0e 020081e0')
+@ CHECK: ('_section_data', '020081e0 0000a0e1 0000a0e1 0000a0e1 020081e0')
More information about the llvm-commits
mailing list