[llvm-commits] [llvm] r121524 - /llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp

Jim Grosbach grosbach at apple.com
Fri Dec 10 13:05:07 PST 2010


Author: grosbach
Date: Fri Dec 10 15:05:07 2010
New Revision: 121524

URL: http://llvm.org/viewvc/llvm-project?rev=121524&view=rev
Log:
Fix encoding of 'U' bit for Thumb2 STRD/LDRD instructions. rdar://8755726

Modified:
    llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp?rev=121524&r1=121523&r2=121524&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp Fri Dec 10 15:05:07 2010
@@ -552,9 +552,9 @@
 uint32_t ARMMCCodeEmitter::
 getT2AddrModeImm8s4OpValue(const MCInst &MI, unsigned OpIdx,
                         SmallVectorImpl<MCFixup> &Fixups) const {
-  // {17-13} = reg
-  // {12}    = (U)nsigned (add == '1', sub == '0')
-  // {11-0}  = imm8
+  // {12-9} = reg
+  // {8}    = (U)nsigned (add == '1', sub == '0')
+  // {7-0}  = imm8
   unsigned Reg, Imm8;
   bool isAdd = true;
   // If The first operand isn't a register, we have a label reference.
@@ -576,7 +576,7 @@
   uint32_t Binary = (Imm8 >> 2) & 0xff;
   // Immediate is always encoded as positive. The 'U' bit controls add vs sub.
   if (isAdd)
-    Binary |= (1 << 9);
+    Binary |= (1 << 8);
   Binary |= (Reg << 9);
   return Binary;
 }





More information about the llvm-commits mailing list