mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-15 22:25:31 +00:00
[mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR1SP, ADDIUR2 and ADDIUS5
Differential Revision: http://reviews.llvm.org/D6419 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -287,6 +287,26 @@ static DecodeStatus DecodeSpecial3LlSc(MCInst &Inst,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeAddiur2Simm7(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeUImm6Lsl2(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeLiSimm7(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeSimm4(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeSimm16(MCInst &Inst,
|
||||
unsigned Insn,
|
||||
uint64_t Address,
|
||||
@@ -1458,6 +1478,46 @@ static DecodeStatus DecodeJumpTargetMM(MCInst &Inst,
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeAddiur2Simm7(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder) {
|
||||
if (Value == 0)
|
||||
Inst.addOperand(MCOperand::CreateImm(1));
|
||||
else if (Value == 0x7)
|
||||
Inst.addOperand(MCOperand::CreateImm(-1));
|
||||
else
|
||||
Inst.addOperand(MCOperand::CreateImm(Value << 2));
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeUImm6Lsl2(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder) {
|
||||
Inst.addOperand(MCOperand::CreateImm(Value << 2));
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeLiSimm7(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder) {
|
||||
if (Value == 0x7F)
|
||||
Inst.addOperand(MCOperand::CreateImm(-1));
|
||||
else
|
||||
Inst.addOperand(MCOperand::CreateImm(Value));
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeSimm4(MCInst &Inst,
|
||||
unsigned Value,
|
||||
uint64_t Address,
|
||||
const void *Decoder) {
|
||||
Inst.addOperand(MCOperand::CreateImm(SignExtend32<4>(Value)));
|
||||
return MCDisassembler::Success;
|
||||
}
|
||||
|
||||
static DecodeStatus DecodeSimm16(MCInst &Inst,
|
||||
unsigned Insn,
|
||||
uint64_t Address,
|
||||
|
Reference in New Issue
Block a user