Disassembly of tBcc was wrongly adding 4 to the SignExtend'ed imm8:'0' immediate...
authorJohnny Chen <johnny.chen@apple.com>
Wed, 18 May 2011 20:32:41 +0000 (20:32 +0000)
committerJohnny Chen <johnny.chen@apple.com>
Wed, 18 May 2011 20:32:41 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131565 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
test/MC/Disassembler/ARM/thumb-tests.txt

index 8d39982f5640d055683527357e96eb34ac5a316a..fbb16b936ad699675334a33abd2a687cdbad8464 100644 (file)
@@ -957,7 +957,7 @@ static bool DisassembleThumb1CondBr(MCInst &MI, unsigned Opcode, uint32_t insn,
 
   unsigned Imm8 = getT1Imm8(insn);
   MI.addOperand(MCOperand::CreateImm(
-                  Opcode == ARM::tBcc ? SignExtend32<9>(Imm8 << 1) + 4
+                  Opcode == ARM::tBcc ? SignExtend32<9>(Imm8 << 1)
                                       : (int)Imm8));
 
   // Predicate operands by ARMBasicMCBuilder::TryPredicateAndSBitModifier().
index 774dbe4b42e57b0848ead4fa82bf5c1a0c451871..895a5bb346ddea8a9fe47ac3e9d3bb07c33dc678 100644 (file)
 
 # CHECK:       nop.w
 0xaf 0xf3 0x00 0x80
+
+# CHECK:       bne     #24
+0x0c 0xd1