54 uint64_t
Address,
const void *Decoder);
57 uint64_t
Address,
const void *Decoder);
60 uint64_t
Address,
const void *Decoder);
70 uint64_t
Address,
const void *Decoder);
72 #include "LanaiGenDisassemblerTables.inc" 77 if (Bytes.
size() < 4) {
84 (Bytes[0] << 24) | (Bytes[1] << 16) | (Bytes[2] << 8) | (Bytes[3] << 0);
100 AluOp = (Insn >> 8) & 0x7;
104 AluOp |= 0x20 | (((Insn >> 3) & 0xf) << 1);
108 unsigned PQ = (Insn >> PqShift) & 0x3;
154 Lanai::R0, Lanai::R1, Lanai::PC, Lanai::R3, Lanai::SP,
Lanai::FP,
155 Lanai::R6, Lanai::R7, Lanai::RV, Lanai::R9, Lanai::RR1, Lanai::RR2,
156 Lanai::R12, Lanai::R13, Lanai::R14, Lanai::RCA, Lanai::R16, Lanai::R17,
157 Lanai::R18, Lanai::R19, Lanai::R20, Lanai::R21, Lanai::R22, Lanai::R23,
158 Lanai::R24, Lanai::R25, Lanai::R26, Lanai::R27, Lanai::R28, Lanai::R29,
159 Lanai::R30, Lanai::R31};
167 unsigned Reg = GPRDecoderTable[RegNo];
173 uint64_t
Address,
const void *Decoder) {
176 unsigned Register = (Insn >> 18) & 0x1f;
178 unsigned Offset = (Insn & 0xffff);
185 uint64_t
Address,
const void *Decoder) {
188 unsigned Register = (Insn >> 15) & 0x1f;
190 Register = (Insn >> 10) & 0x1f;
197 uint64_t
Address,
const void *Decoder) {
200 unsigned Register = (Insn >> 12) & 0x1f;
202 unsigned Offset = (Insn & 0x3ff);
211 const void *Decoder) {
218 const void *Decoder) {
226 uint64_t
Address,
const void *Decoder) {
227 unsigned Offset = (Insn & 0xffff);
235 const void *Decoder) {
static DecodeStatus decodeRiMemoryValue(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
This class represents lattice values for constants.
Target & getTheLanaiTarget()
static bool isRRMOpcode(unsigned Opcode)
DecodeStatus
Ternary decode status.
Superclass for all disassemblers.
bool tryAddingSymbolicOperand(MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) const
static void RegisterMCDisassembler(Target &T, Target::MCDisassemblerCtorTy Fn)
RegisterMCDisassembler - Register a MCDisassembler implementation for the given target.
static DecodeStatus decodeRrMemoryValue(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static unsigned makePostOp(unsigned AluOp)
static MCOperand createReg(unsigned Reg)
Context object for machine code objects.
const MCSubtargetInfo & STI
int decodeInstruction(InternalInstruction *insn, byteReader_t reader, const void *readerArg, dlog_t logger, void *loggerArg, const void *miiArg, uint64_t startLoc, DisassemblerMode mode)
Decode one instruction and store the decoding results in a buffer provided by the consumer...
static DecodeStatus decodeBranch(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
Instances of this class represent a single low-level machine instruction.
MCDisassembler::DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &VStream, raw_ostream &CStream) const override
Returns the disassembly of a single instruction.
static const unsigned GPRDecoderTable[]
static DecodeStatus decodePredicateOperand(MCInst &Inst, unsigned Val, uint64_t Address, const void *Decoder)
static void PostOperandDecodeAdjust(MCInst &Instr, uint32_t Insn)
size_t size() const
size - Get the array size.
static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
static DecodeStatus readInstruction32(ArrayRef< uint8_t > Bytes, uint64_t &Size, uint32_t &Insn)
MCDisassembler::DecodeStatus DecodeStatus
LanaiDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx)
const MCOperand & getOperand(unsigned i) const
Promote Memory to Register
Target - Wrapper for Target specific information.
static unsigned makePreOp(unsigned AluOp)
static bool isRMOpcode(unsigned Opcode)
static DecodeStatus decodeSplsValue(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
Generic base class for all target subtargets.
void setReg(unsigned Reg)
Set the register number.
static MCDisassembler * createLanaiDisassembler(const Target &, const MCSubtargetInfo &STI, MCContext &Ctx)
static DecodeStatus decodeShiftImm(MCInst &Inst, unsigned Insn, uint64_t Address, const void *Decoder)
static bool isSPLSOpcode(unsigned Opcode)
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
void addOperand(const MCOperand &Op)
void LLVMInitializeLanaiDisassembler()
unsigned getOpcode() const
static MCOperand createImm(int64_t Val)