[llvm-commits] [llvm] r153780 - /llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

Jim Grosbach grosbach at apple.com
Fri Mar 30 14:54:22 PDT 2012


Author: grosbach
Date: Fri Mar 30 16:54:22 2012
New Revision: 153780

URL: http://llvm.org/viewvc/llvm-project?rev=153780&view=rev
Log:
ARM fix encoding fixup resolution for ldrd and friends.

The 8-bit payload is not contiguous in the opcode. Move the upper nibble
over 4 bits into the correct place.

rdar://11158641

Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp

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=153780&r1=153779&r2=153780&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Fri Mar 30 16:54:22 2012
@@ -469,7 +469,9 @@
       Value = -Value;
       isAdd = false;
     }
+    // The value has the low 4 bits encoded in [3:0] and the high 4 in [11:8].
     assert ((Value < 256) && "Out of range pc-relative fixup value!");
+    Value = (Value & 0xf) | ((Value & 0xf0) << 4);
     return Value | (isAdd << 23);
   }
   case ARM::fixup_arm_pcrel_10:





More information about the llvm-commits mailing list