llvm.org GIT mirror llvm / c8f2fcc
Correct decoder for T1 conditional B encoding git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158055 91177308-0d34-0410-b5e6-96231b3b80d8 Richard Barton 8 years ago
2 changed file(s) with 12 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
34623462 static DecodeStatus
34633463 DecodeThumbBCCTargetOperand(MCInst &Inst, unsigned Val,
34643464 uint64_t Address, const void *Decoder){
3465 if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<8>(Val<<1) + 4,
3465 if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<9>(Val<<1) + 4,
34663466 true, 2, Inst, Decoder))
3467 Inst.addOperand(MCOperand::CreateImm(SignExtend32<8>(Val << 1)));
3467 Inst.addOperand(MCOperand::CreateImm(SignExtend32<9>(Val << 1)));
34683468 return MCDisassembler::Success;
34693469 }
34703470
None # RUN: llvm-mc -triple=thumbv6-apple-darwin -disassemble < %s | FileCheck %s
0 # RUN: llvm-mc -triple=thumbv6-apple-darwin -disassemble -show-encoding < %s | FileCheck %s
11
22 #------------------------------------------------------------------------------
33 # ADC (register)
8080 # CHECK: bics r1, r6
8181
8282 0xb1 0x43
83
84 #------------------------------------------------------------------------------
85 # B
86 #------------------------------------------------------------------------------
87 # CHECK: bls #128 @ encoding: [0x40,0xd9]
88 # CHECK: beq #-256 @ encoding: [0x80,0xd0]
89
90 0x40 0xd9
91 0x80 0xd0
8392
8493 #------------------------------------------------------------------------------
8594 # BKPT