Fix an incorrect shift when decoding SP-relative stores in Thumb1-mode. Add more...
authorOwen Anderson <resistor@mac.com>
Mon, 22 Aug 2011 17:56:58 +0000 (17:56 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 22 Aug 2011 17:56:58 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138246 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Disassembler/ARMDisassembler.cpp
test/MC/Disassembler/ARM/thumb1.txt

index a57102c6e1464bcd74024977c6f5376cc10863c9..ebcb798969cbc84ecb8f6ce8a9a8aadd03d75eaf 100644 (file)
@@ -2322,7 +2322,7 @@ static DecodeStatus DecodeThumbAddrModePC(llvm::MCInst &Inst, unsigned Val,
 static DecodeStatus DecodeThumbAddrModeSP(llvm::MCInst &Inst, unsigned Val,
                                   uint64_t Address, const void *Decoder) {
   Inst.addOperand(MCOperand::CreateReg(ARM::SP));
-  Inst.addOperand(MCOperand::CreateImm(Val << 2));
+  Inst.addOperand(MCOperand::CreateImm(Val));
 
   return Success;
 }
index 24917735b8abf0021efade3754e6084c679d2aab..5b02a58f0c8f63b13255223bb2468edb07aa5de2 100644 (file)
 
 0x6c 0x40
 
+#------------------------------------------------------------------------------
+# LDM
+#------------------------------------------------------------------------------
+# CHECK: ldm r3, {r0, r1, r2, r3, r4, r5, r6, r7}
+# CHECK: ldm r2!, {r1, r3, r4, r5, r7}
+# CHECK: ldm r1, {r1}
+
+0xff 0xcb
+0xba 0xca
+0x02 0xc9
+
+
+#------------------------------------------------------------------------------
+# LDR (immediate)
+#------------------------------------------------------------------------------
+# CHECK: ldr r1, [r5]
+# CHECK: ldr r2, [r6, #32]
+# CHECK: ldr r3, [r7, #124]
+# CHECK: ldr r1, [sp]
+# CHECK: ldr r2, [sp, #24]
+# CHECK: ldr r3, [sp, #1020]
+
+
+0x29 0x68
+0x32 0x6a
+0xfb 0x6f
+0x00 0x99
+0x06 0x9a
+0xff 0x9b
+