LLVM 22.0.0git
LanaiDisassembler.cpp File Reference
#include "LanaiDisassembler.h"
#include "LanaiAluCode.h"
#include "LanaiCondCode.h"
#include "LanaiInstrInfo.h"
#include "TargetInfo/LanaiTargetInfo.h"
#include "llvm/MC/MCDecoder.h"
#include "llvm/MC/MCDecoderOps.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "LanaiGenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lanai-disassembler"

Functions

static MCDisassemblercreateLanaiDisassembler (const Target &, const MCSubtargetInfo &STI, MCContext &Ctx)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeLanaiDisassembler ()
DecodeStatus DecodeGPRRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t, const MCDisassembler *)
static DecodeStatus decodeRiMemoryValue (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeRrMemoryValue (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeSplsValue (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static bool tryAddingSymbolicOperand (int64_t Value, bool IsBranch, uint64_t Address, uint64_t Offset, uint64_t Width, MCInst &MI, const MCDisassembler *Decoder)
static DecodeStatus decodeBranch (MCInst &MI, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeShiftImm (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodePredicateOperand (MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus readInstruction32 (ArrayRef< uint8_t > Bytes, uint64_t &Size, uint32_t &Insn)
static void PostOperandDecodeAdjust (MCInst &Instr, uint32_t Insn)

Variables

static const unsigned GPRDecoderTable []

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lanai-disassembler"

Definition at line 28 of file LanaiDisassembler.cpp.

Function Documentation

◆ createLanaiDisassembler()

MCDisassembler * createLanaiDisassembler ( const Target & ,
const MCSubtargetInfo & STI,
MCContext & Ctx )
static

Definition at line 35 of file LanaiDisassembler.cpp.

Referenced by LLVMInitializeLanaiDisassembler().

◆ decodeBranch()

DecodeStatus decodeBranch ( MCInst & MI,
unsigned Insn,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeGPRRegisterClass()

◆ decodePredicateOperand()

◆ decodeRiMemoryValue()

◆ decodeRrMemoryValue()

DecodeStatus decodeRrMemoryValue ( MCInst & Inst,
unsigned Insn,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ decodeShiftImm()

◆ decodeSplsValue()

◆ LLVMInitializeLanaiDisassembler()

◆ PostOperandDecodeAdjust()

◆ readInstruction32()

DecodeStatus readInstruction32 ( ArrayRef< uint8_t > Bytes,
uint64_t & Size,
uint32_t & Insn )
static

◆ tryAddingSymbolicOperand()

bool tryAddingSymbolicOperand ( int64_t Value,
bool IsBranch,
uint64_t Address,
uint64_t Offset,
uint64_t Width,
MCInst & MI,
const MCDisassembler * Decoder )
static

Variable Documentation

◆ GPRDecoderTable

const unsigned GPRDecoderTable[]
static
Initial value:
= {
Lanai::R0, Lanai::R1, Lanai::PC, Lanai::R3, Lanai::SP, Lanai::FP,
Lanai::R6, Lanai::R7, Lanai::RV, Lanai::R9, Lanai::RR1, Lanai::RR2,
Lanai::R12, Lanai::R13, Lanai::R14, Lanai::RCA, Lanai::R16, Lanai::R17,
Lanai::R18, Lanai::R19, Lanai::R20, Lanai::R21, Lanai::R22, Lanai::R23,
Lanai::R24, Lanai::R25, Lanai::R26, Lanai::R27, Lanai::R28, Lanai::R29,
Lanai::R30, Lanai::R31
}

Definition at line 52 of file LanaiDisassembler.cpp.