LLVM 20.0.0git
Macros | Typedefs | Functions | Variables
CSKYDisassembler.cpp File Reference
#include "MCTargetDesc/CSKYBaseInfo.h"
#include "MCTargetDesc/CSKYMCTargetDesc.h"
#include "TargetInfo/CSKYTargetInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDecoderOps.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Endian.h"
#include "CSKYGenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "csky-disassembler"
 

Typedefs

typedef MCDisassembler::DecodeStatus DecodeStatus
 

Functions

static MCDisassemblercreateCSKYDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
 
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeCSKYDisassembler ()
 
static DecodeStatus DecodeGPRRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeFPR32RegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodesFPR32RegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodesFPR64RegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodesFPR64_VRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeFPR64RegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static LLVM_ATTRIBUTE_UNUSED DecodeStatus DecodesFPR128RegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodesGPRRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodemGPRRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static LLVM_ATTRIBUTE_UNUSED DecodeStatus DecodeGPRSPRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeGPRPairRegisterClass (MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
template<unsigned N, unsigned S>
static DecodeStatus decodeUImmOperand (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
template<unsigned N>
static DecodeStatus decodeOImmOperand (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus decodeLRW16Imm8 (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus decodeJMPIXImmOperand (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeRegSeqOperand (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeRegSeqOperandF1 (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeRegSeqOperandD1 (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeRegSeqOperandF2 (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeRegSeqOperandD2 (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus decodeImmShiftOpValue (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
template<unsigned N, unsigned S>
static DecodeStatus decodeSImmOperand (MCInst &Inst, uint64_t Imm, int64_t Address, const MCDisassembler *Decoder)
 
static bool decodeFPUV3Instruction (MCInst &MI, uint32_t insn, uint64_t Address, const MCDisassembler *DisAsm, const MCSubtargetInfo &STI)
 

Variables

static const uint16_t GPRDecoderTable []
 
static const uint16_t GPRPairDecoderTable []
 
static const uint16_t FPR32DecoderTable []
 
static const uint16_t FPR64DecoderTable []
 
static const uint16_t FPR128DecoderTable []
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "csky-disassembler"

Definition at line 29 of file CSKYDisassembler.cpp.

Typedef Documentation

◆ DecodeStatus

Definition at line 31 of file CSKYDisassembler.cpp.

Function Documentation

◆ createCSKYDisassembler()

static MCDisassembler * createCSKYDisassembler ( const Target T,
const MCSubtargetInfo STI,
MCContext Ctx 
)
static

Definition at line 54 of file CSKYDisassembler.cpp.

Referenced by LLVMInitializeCSKYDisassembler().

◆ DecodeFPR32RegisterClass()

static DecodeStatus DecodeFPR32RegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeFPR64RegisterClass()

static DecodeStatus DecodeFPR64RegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeFPUV3Instruction()

static bool decodeFPUV3Instruction ( MCInst MI,
uint32_t  insn,
uint64_t  Address,
const MCDisassembler DisAsm,
const MCSubtargetInfo STI 
)
static

◆ DecodeGPRPairRegisterClass()

static DecodeStatus DecodeGPRPairRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeGPRRegisterClass()

static DecodeStatus DecodeGPRRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeGPRSPRegisterClass()

static LLVM_ATTRIBUTE_UNUSED DecodeStatus DecodeGPRSPRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeImmShiftOpValue()

static DecodeStatus decodeImmShiftOpValue ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeJMPIXImmOperand()

static DecodeStatus decodeJMPIXImmOperand ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeLRW16Imm8()

static DecodeStatus decodeLRW16Imm8 ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodemGPRRegisterClass()

static DecodeStatus DecodemGPRRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeOImmOperand()

template<unsigned N>
static DecodeStatus decodeOImmOperand ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeRegSeqOperand()

static DecodeStatus DecodeRegSeqOperand ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeRegSeqOperandD1()

static DecodeStatus DecodeRegSeqOperandD1 ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeRegSeqOperandD2()

static DecodeStatus DecodeRegSeqOperandD2 ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeRegSeqOperandF1()

static DecodeStatus DecodeRegSeqOperandF1 ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeRegSeqOperandF2()

static DecodeStatus DecodeRegSeqOperandF2 ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodesFPR128RegisterClass()

static LLVM_ATTRIBUTE_UNUSED DecodeStatus DecodesFPR128RegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodesFPR32RegisterClass()

static DecodeStatus DecodesFPR32RegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodesFPR64_VRegisterClass()

static DecodeStatus DecodesFPR64_VRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodesFPR64RegisterClass()

static DecodeStatus DecodesFPR64RegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodesGPRRegisterClass()

static DecodeStatus DecodesGPRRegisterClass ( MCInst Inst,
uint64_t  RegNo,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeSImmOperand()

template<unsigned N, unsigned S>
static DecodeStatus decodeSImmOperand ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeUImmOperand()

template<unsigned N, unsigned S>
static DecodeStatus decodeUImmOperand ( MCInst Inst,
uint64_t  Imm,
int64_t  Address,
const MCDisassembler Decoder 
)
static

◆ LLVMInitializeCSKYDisassembler()

LLVM_EXTERNAL_VISIBILITY void LLVMInitializeCSKYDisassembler ( )

Variable Documentation

◆ FPR128DecoderTable

const uint16_t FPR128DecoderTable[]
static
Initial value:
= {
CSKY::F0_128, CSKY::F1_128, CSKY::F2_128, CSKY::F3_128, CSKY::F4_128,
CSKY::F5_128, CSKY::F6_128, CSKY::F7_128, CSKY::F8_128, CSKY::F9_128,
CSKY::F10_128, CSKY::F11_128, CSKY::F12_128, CSKY::F13_128, CSKY::F14_128,
CSKY::F15_128, CSKY::F16_128, CSKY::F17_128, CSKY::F18_128, CSKY::F19_128,
CSKY::F20_128, CSKY::F21_128, CSKY::F22_128, CSKY::F23_128, CSKY::F24_128,
CSKY::F25_128, CSKY::F26_128, CSKY::F27_128, CSKY::F28_128, CSKY::F29_128,
CSKY::F30_128, CSKY::F31_128}

Definition at line 99 of file CSKYDisassembler.cpp.

Referenced by DecodesFPR128RegisterClass().

◆ FPR32DecoderTable

const uint16_t FPR32DecoderTable[]
static
Initial value:
= {
CSKY::F0_32, CSKY::F1_32, CSKY::F2_32, CSKY::F3_32, CSKY::F4_32,
CSKY::F5_32, CSKY::F6_32, CSKY::F7_32, CSKY::F8_32, CSKY::F9_32,
CSKY::F10_32, CSKY::F11_32, CSKY::F12_32, CSKY::F13_32, CSKY::F14_32,
CSKY::F15_32, CSKY::F16_32, CSKY::F17_32, CSKY::F18_32, CSKY::F19_32,
CSKY::F20_32, CSKY::F21_32, CSKY::F22_32, CSKY::F23_32, CSKY::F24_32,
CSKY::F25_32, CSKY::F26_32, CSKY::F27_32, CSKY::F28_32, CSKY::F29_32,
CSKY::F30_32, CSKY::F31_32}

Definition at line 81 of file CSKYDisassembler.cpp.

Referenced by DecodeFPR32RegisterClass(), DecodeRegSeqOperandF1(), DecodeRegSeqOperandF2(), and DecodesFPR32RegisterClass().

◆ FPR64DecoderTable

const uint16_t FPR64DecoderTable[]
static
Initial value:
= {
CSKY::F0_64, CSKY::F1_64, CSKY::F2_64, CSKY::F3_64, CSKY::F4_64,
CSKY::F5_64, CSKY::F6_64, CSKY::F7_64, CSKY::F8_64, CSKY::F9_64,
CSKY::F10_64, CSKY::F11_64, CSKY::F12_64, CSKY::F13_64, CSKY::F14_64,
CSKY::F15_64, CSKY::F16_64, CSKY::F17_64, CSKY::F18_64, CSKY::F19_64,
CSKY::F20_64, CSKY::F21_64, CSKY::F22_64, CSKY::F23_64, CSKY::F24_64,
CSKY::F25_64, CSKY::F26_64, CSKY::F27_64, CSKY::F28_64, CSKY::F29_64,
CSKY::F30_64, CSKY::F31_64}

Definition at line 90 of file CSKYDisassembler.cpp.

Referenced by DecodeFPR64RegisterClass(), DecodeRegSeqOperandD1(), DecodeRegSeqOperandD2(), DecodesFPR64_VRegisterClass(), and DecodesFPR64RegisterClass().

◆ GPRDecoderTable

const uint16_t GPRDecoderTable[]
static
Initial value:
= {
CSKY::R0, CSKY::R1, CSKY::R2, CSKY::R3, CSKY::R4, CSKY::R5, CSKY::R6,
CSKY::R7, CSKY::R8, CSKY::R9, CSKY::R10, CSKY::R11, CSKY::R12, CSKY::R13,
CSKY::R14, CSKY::R15, CSKY::R16, CSKY::R17, CSKY::R18, CSKY::R19, CSKY::R20,
CSKY::R21, CSKY::R22, CSKY::R23, CSKY::R24, CSKY::R25, CSKY::R26, CSKY::R27,
CSKY::R28, CSKY::R29, CSKY::R30, CSKY::R31}

Definition at line 65 of file CSKYDisassembler.cpp.

Referenced by DecodeGPRRegisterClass(), DecodeGPRSPRegisterClass(), DecodemGPRRegisterClass(), DecodeRegSeqOperand(), and DecodesGPRRegisterClass().

◆ GPRPairDecoderTable

const uint16_t GPRPairDecoderTable[]
static
Initial value:
= {
CSKY::R0_R1, CSKY::R1_R2, CSKY::R2_R3, CSKY::R3_R4, CSKY::R4_R5,
CSKY::R5_R6, CSKY::R6_R7, CSKY::R7_R8, CSKY::R8_R9, CSKY::R9_R10,
CSKY::R10_R11, CSKY::R11_R12, CSKY::R12_R13, CSKY::R13_R14, CSKY::R14_R15,
CSKY::R15_R16, CSKY::R16_R17, CSKY::R17_R18, CSKY::R18_R19, CSKY::R19_R20,
CSKY::R20_R21, CSKY::R21_R22, CSKY::R22_R23, CSKY::R23_R24, CSKY::R24_R25,
CSKY::R25_R26, CSKY::R26_R27, CSKY::R27_R28, CSKY::R28_R29, CSKY::R29_R30,
CSKY::R30_R31, CSKY::R31_R32}

Definition at line 72 of file CSKYDisassembler.cpp.

Referenced by DecodeGPRPairRegisterClass().