mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Add instruction encodings / disassembly support for l4r instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173501 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -180,6 +180,16 @@ static DecodeStatus DecodeL5RInstruction(MCInst &Inst,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeL4RSrcDstInstruction(MCInst &Inst,
|
||||
unsigned Insn,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeL4RSrcDstSrcDstInstruction(MCInst &Inst,
|
||||
unsigned Insn,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
#include "XCoreGenDisassemblerTables.inc"
|
||||
|
||||
static DecodeStatus DecodeGRRegsRegisterClass(MCInst &Inst,
|
||||
@ -636,6 +646,45 @@ DecodeL5RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
|
||||
return S;
|
||||
}
|
||||
|
||||
static DecodeStatus
|
||||
DecodeL4RSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
|
||||
const void *Decoder) {
|
||||
unsigned Op1, Op2, Op3;
|
||||
unsigned Op4 = fieldFromInstruction(Insn, 16, 4);
|
||||
DecodeStatus S =
|
||||
Decode3OpInstruction(fieldFromInstruction(Insn, 0, 16), Op1, Op2, Op3);
|
||||
if (S == MCDisassembler::Success) {
|
||||
DecodeGRRegsRegisterClass(Inst, Op1, Address, Decoder);
|
||||
S = DecodeGRRegsRegisterClass(Inst, Op4, Address, Decoder);
|
||||
}
|
||||
if (S == MCDisassembler::Success) {
|
||||
DecodeGRRegsRegisterClass(Inst, Op4, Address, Decoder);
|
||||
DecodeGRRegsRegisterClass(Inst, Op2, Address, Decoder);
|
||||
DecodeGRRegsRegisterClass(Inst, Op3, Address, Decoder);
|
||||
}
|
||||
return S;
|
||||
}
|
||||
|
||||
static DecodeStatus
|
||||
DecodeL4RSrcDstSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
|
||||
const void *Decoder) {
|
||||
unsigned Op1, Op2, Op3;
|
||||
unsigned Op4 = fieldFromInstruction(Insn, 16, 4);
|
||||
DecodeStatus S =
|
||||
Decode3OpInstruction(fieldFromInstruction(Insn, 0, 16), Op1, Op2, Op3);
|
||||
if (S == MCDisassembler::Success) {
|
||||
DecodeGRRegsRegisterClass(Inst, Op1, Address, Decoder);
|
||||
S = DecodeGRRegsRegisterClass(Inst, Op4, Address, Decoder);
|
||||
}
|
||||
if (S == MCDisassembler::Success) {
|
||||
DecodeGRRegsRegisterClass(Inst, Op1, Address, Decoder);
|
||||
DecodeGRRegsRegisterClass(Inst, Op4, Address, Decoder);
|
||||
DecodeGRRegsRegisterClass(Inst, Op2, Address, Decoder);
|
||||
DecodeGRRegsRegisterClass(Inst, Op3, Address, Decoder);
|
||||
}
|
||||
return S;
|
||||
}
|
||||
|
||||
MCDisassembler::DecodeStatus
|
||||
XCoreDisassembler::getInstruction(MCInst &instr,
|
||||
uint64_t &Size,
|
||||
|
Reference in New Issue
Block a user