mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Added support for unpredictable mcrr/mcrr2/mrrc/mrrc2 ARM instruction in the disassembler. Since the upredicability conditions are complex, C++ code was added to handle them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155001 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -326,6 +326,8 @@ static DecodeStatus DecodeT2ShifterImmOperand(MCInst &Inst, unsigned Val,
|
||||
|
||||
static DecodeStatus DecodeLDR(MCInst &Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder);
|
||||
static DecodeStatus DecodeMRRC2(llvm::MCInst &Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder);
|
||||
#include "ARMGenDisassemblerTables.inc"
|
||||
#include "ARMGenInstrInfo.inc"
|
||||
#include "ARMGenEDInfo.inc"
|
||||
@@ -4403,3 +4405,31 @@ static DecodeStatus DecodeLDR(MCInst &Inst, unsigned Val,
|
||||
return S;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeMRRC2(llvm::MCInst &Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder) {
|
||||
|
||||
DecodeStatus S = MCDisassembler::Success;
|
||||
|
||||
unsigned CRm = fieldFromInstruction32(Val, 0, 4);
|
||||
unsigned opc1 = fieldFromInstruction32(Val, 4, 4);
|
||||
unsigned cop = fieldFromInstruction32(Val, 8, 4);
|
||||
unsigned Rt = fieldFromInstruction32(Val, 12, 4);
|
||||
unsigned Rt2 = fieldFromInstruction32(Val, 16, 4);
|
||||
|
||||
if ((cop & ~0x1) == 0xa)
|
||||
return MCDisassembler::Fail;
|
||||
|
||||
if (Rt == Rt2)
|
||||
S = MCDisassembler::SoftFail;
|
||||
|
||||
Inst.addOperand(MCOperand::CreateImm(cop));
|
||||
Inst.addOperand(MCOperand::CreateImm(opc1));
|
||||
if (!Check(S, DecodeGPRnopcRegisterClass(Inst, Rt, Address, Decoder)))
|
||||
return MCDisassembler::Fail;
|
||||
if (!Check(S, DecodeGPRnopcRegisterClass(Inst, Rt2, Address, Decoder)))
|
||||
return MCDisassembler::Fail;
|
||||
Inst.addOperand(MCOperand::CreateImm(CRm));
|
||||
|
||||
return S;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user