mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Bitfield mask instructions are unpredictable if the encoded LSB is higher than the encoded MSB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139972 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be290af0d8
commit
cb77551927
@ -1004,12 +1004,15 @@ static DecodeStatus DecodeBitfieldMaskOperand(llvm::MCInst &Inst, unsigned Val,
|
||||
unsigned msb = fieldFromInstruction32(Val, 5, 5);
|
||||
unsigned lsb = fieldFromInstruction32(Val, 0, 5);
|
||||
|
||||
DecodeStatus S = MCDisassembler::Success;
|
||||
if (lsb > msb) Check(S, MCDisassembler::SoftFail);
|
||||
|
||||
uint32_t msb_mask = 0xFFFFFFFF;
|
||||
if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
|
||||
uint32_t lsb_mask = (1U << lsb) - 1;
|
||||
|
||||
Inst.addOperand(MCOperand::CreateImm(~(msb_mask ^ lsb_mask)));
|
||||
return MCDisassembler::Success;
|
||||
return S;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeCopMemInstruction(llvm::MCInst &Inst, unsigned Insn,
|
||||
|
Loading…
Reference in New Issue
Block a user