56 if (region.
readBytes(address, 2, Bytes) == -1) {
61 insn = (Bytes[0] << 0) | (Bytes[1] << 8);
72 if (region.
readBytes(address, 4, Bytes) == -1) {
77 insn = (Bytes[0] << 0) | (Bytes[1] << 8) | (Bytes[2] << 16) |
82 static unsigned getReg(
const void *D,
unsigned RC,
unsigned RegNo) {
83 const XCoreDisassembler *Dis =
static_cast<const XCoreDisassembler*
>(D);
84 return *(Dis->getRegInfo()->getRegClass(RC).begin() + RegNo);
98 uint64_t Address,
const void *Decoder);
101 uint64_t Address,
const void *Decoder);
106 const void *Decoder);
111 const void *Decoder);
116 const void *Decoder);
121 const void *Decoder);
126 const void *Decoder);
131 const void *Decoder);
136 const void *Decoder);
141 const void *Decoder);
146 const void *Decoder);
151 const void *Decoder);
156 const void *Decoder);
161 const void *Decoder);
166 const void *Decoder);
171 const void *Decoder);
176 const void *Decoder);
181 const void *Decoder);
186 const void *Decoder);
191 const void *Decoder);
196 const void *Decoder);
201 const void *Decoder);
206 const void *Decoder);
208 #include "XCoreGenDisassemblerTables.inc"
217 unsigned Reg =
getReg(Decoder, XCore::GRRegsRegClassID, RegNo);
229 unsigned Reg =
getReg(Decoder, XCore::RRegsRegClassID, RegNo);
235 uint64_t Address,
const void *Decoder) {
238 static unsigned Values[] = {
239 32 , 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32
246 uint64_t Address,
const void *Decoder) {
253 unsigned Combined = fieldFromInstruction(Insn, 6, 5);
256 if (fieldFromInstruction(Insn, 5, 1)) {
262 unsigned Op1High = Combined % 3;
263 unsigned Op2High = Combined / 3;
264 Op1 = (Op1High << 2) | fieldFromInstruction(Insn, 2, 2);
265 Op2 = (Op2High << 2) | fieldFromInstruction(Insn, 0, 2);
272 unsigned Combined = fieldFromInstruction(Insn, 6, 5);
276 unsigned Op1High = Combined % 3;
277 unsigned Op2High = (Combined / 3) % 3;
278 unsigned Op3High = Combined / 9;
279 Op1 = (Op1High << 2) | fieldFromInstruction(Insn, 4, 2);
280 Op2 = (Op2High << 2) | fieldFromInstruction(Insn, 2, 2);
281 Op3 = (Op3High << 2) | fieldFromInstruction(Insn, 0, 2);
287 const void *Decoder) {
289 unsigned Opcode = fieldFromInstruction(Insn, 11, 5);
357 const void *Decoder) {
370 const void *Decoder) {
383 const void *Decoder) {
396 const void *Decoder) {
410 const void *Decoder) {
423 const void *Decoder) {
436 const void *Decoder) {
450 const void *Decoder) {
452 unsigned Opcode = fieldFromInstruction(Insn, 16, 4) |
453 fieldFromInstruction(Insn, 27, 5) << 4;
521 const void *Decoder) {
535 const void *Decoder) {
549 const void *Decoder) {
550 unsigned Op1, Op2, Op3;
562 const void *Decoder) {
563 unsigned Op1, Op2, Op3;
575 const void *Decoder) {
576 unsigned Op1, Op2, Op3;
588 const void *Decoder) {
589 unsigned Op1, Op2, Op3;
601 const void *Decoder) {
602 unsigned Op1, Op2, Op3;
615 const void *Decoder) {
616 unsigned Op1, Op2, Op3;
630 const void *Decoder) {
631 unsigned Op1, Op2, Op3;
644 const void *Decoder) {
645 unsigned Op1, Op2, Op3;
658 const void *Decoder) {
659 unsigned Op1, Op2, Op3, Op4, Op5, Op6;
678 const void *Decoder) {
681 unsigned Opcode = fieldFromInstruction(Insn, 27, 5);
692 const void *Decoder) {
693 unsigned Op1, Op2, Op3, Op4, Op5;
712 const void *Decoder) {
713 unsigned Op1, Op2, Op3;
714 unsigned Op4 = fieldFromInstruction(Insn, 16, 4);
731 const void *Decoder) {
732 unsigned Op1, Op2, Op3;
733 unsigned Op4 = fieldFromInstruction(Insn, 16, 4);
750 XCoreDisassembler::getInstruction(
MCInst &instr,
765 if (Result != Fail) {
778 if (Result != Fail) {
const MCRegisterDesc & get(unsigned RegNo) const
Provide a get method, equivalent to [], but more useful with a pointer to this object.
static bool readInstruction16(const MemoryObject ®ion, uint64_t address, uint64_t &size, uint16_t &insn)
static DecodeStatus DecodeRRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL6RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static MCOperand CreateReg(unsigned Reg)
static DecodeStatus DecodeL2RUSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL4RSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeRUSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
static DecodeStatus DecodeL3RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeGRRegsRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
virtual int readBytes(uint64_t address, uint64_t size, uint8_t *buf) const
static DecodeStatus DecodeL3RSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode3OpInstruction(unsigned Insn, unsigned &Op1, unsigned &Op2, unsigned &Op3)
static DecodeStatus DecodeNegImmOperand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeBitpOperand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder)
static DecodeStatus Decode3RImmInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2RUSInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static bool readInstruction32(const MemoryObject ®ion, uint64_t address, uint64_t &size, uint32_t &insn)
A single entry single exit Region.
static DecodeStatus DecodeL2RUSBitpInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeRUSBitpInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL2OpInstructionFail(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2RSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2RImmInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL5RInstructionFail(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
void setOpcode(unsigned Op)
static DecodeStatus Decode2OpInstructionFail(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2OpInstruction(unsigned Insn, unsigned &Op1, unsigned &Op2)
static DecodeStatus DecodeL4RSrcDstSrcDstInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL5RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeRUSSrcDstBitpInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus Decode2RUSBitpInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static MCOperand CreateImm(int64_t Val)
MCRegisterInfo * createMCRegInfo(StringRef Triple) const
static DecodeStatus DecodeR2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeLR2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static MCDisassembler * createXCoreDisassembler(const Target &T, const MCSubtargetInfo &STI)
MCDisassembler::DecodeStatus DecodeStatus
static DecodeStatus Decode3RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static DecodeStatus DecodeL2RInstruction(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
void LLVMInitializeXCoreDisassembler()
void addOperand(const MCOperand &Op)
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
int decodeInstruction(struct InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode)