1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Correct decoder for T1 conditional B encoding

llvm-svn: 158055
This commit is contained in:
Richard Barton 2012-06-06 09:12:53 +00:00
parent c8f5a6d2ac
commit eedaf01042
2 changed files with 12 additions and 3 deletions

View File

@ -3463,9 +3463,9 @@ static DecodeStatus DecodeT2SOImm(MCInst &Inst, unsigned Val,
static DecodeStatus
DecodeThumbBCCTargetOperand(MCInst &Inst, unsigned Val,
uint64_t Address, const void *Decoder){
if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<8>(Val<<1) + 4,
if (!tryAddingSymbolicOperand(Address, Address + SignExtend32<9>(Val<<1) + 4,
true, 2, Inst, Decoder))
Inst.addOperand(MCOperand::CreateImm(SignExtend32<8>(Val << 1)));
Inst.addOperand(MCOperand::CreateImm(SignExtend32<9>(Val << 1)));
return MCDisassembler::Success;
}

View File

@ -1,4 +1,4 @@
# RUN: llvm-mc -triple=thumbv6-apple-darwin -disassemble < %s | FileCheck %s
# RUN: llvm-mc -triple=thumbv6-apple-darwin -disassemble -show-encoding < %s | FileCheck %s
#------------------------------------------------------------------------------
# ADC (register)
@ -82,6 +82,15 @@
0xb1 0x43
#------------------------------------------------------------------------------
# B
#------------------------------------------------------------------------------
# CHECK: bls #128 @ encoding: [0x40,0xd9]
# CHECK: beq #-256 @ encoding: [0x80,0xd0]
0x40 0xd9
0x80 0xd0
#------------------------------------------------------------------------------
# BKPT
#------------------------------------------------------------------------------