1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Fix issue with disassembler decoding CBZ/CBNZ immediates as negatives when the upper bit is set.

They should always be zero-extended, not sign extended.  Added test case.

llvm-svn: 178275
This commit is contained in:
Gordon Keiser 2013-03-28 19:22:28 +00:00
parent 0c0f300008
commit 862f5debbb
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -254,9 +254,12 @@
#------------------------------------------------------------------------------
# CHECK: cbnz r7, #6
# CHECK: cbnz r7, #12
# CHECK: cbz r4, #64
0x1f 0xb9
0x37 0xb9
0x04 0xb3
#------------------------------------------------------------------------------
# CDP/CDP2