Thanks to visit codestin.com
Credit goes to llvm.org

LLVM 22.0.0git
XCoreDisassembler.cpp File Reference

This file is part of the XCore Disassembler. More...

#include "TargetInfo/XCoreTargetInfo.h"
#include "XCore.h"
#include "XCoreRegisterInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDecoder.h"
#include "llvm/MC/MCDecoderOps.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
#include "XCoreGenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "xcore-disassembler"

Functions

static bool readInstruction16 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint16_t &Insn)
static bool readInstruction32 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
static unsigned getReg (const MCDisassembler *D, unsigned RC, unsigned RegNo)
static DecodeStatus DecodeGRRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeBitpOperand (MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeNegImmOperand (MCInst &Inst, unsigned Val, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2OpInstruction (unsigned Insn, unsigned &Op1, unsigned &Op2)
static DecodeStatus Decode3OpInstruction (unsigned Insn, unsigned &Op1, unsigned &Op2, unsigned &Op3)
static DecodeStatus Decode3RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode3RImmInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2RUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2RUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL3RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL3RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL2RUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL2RUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2OpInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2RImmInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeR2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus Decode2RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRUSInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRUSBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeRUSSrcDstBitpInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL2OpInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLR2RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL6RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL5RInstructionFail (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL5RInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL4RSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeL4RSrcDstSrcDstInstruction (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static MCDisassemblercreateXCoreDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXCoreDisassembler ()

Detailed Description

This file is part of the XCore Disassembler.

Definition in file XCoreDisassembler.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "xcore-disassembler"

Definition at line 29 of file XCoreDisassembler.cpp.

Function Documentation

◆ createXCoreDisassembler()

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

Definition at line 651 of file XCoreDisassembler.cpp.

References T.

Referenced by LLVMInitializeXCoreDisassembler().

◆ Decode2OpInstruction()

◆ Decode2OpInstructionFail()

◆ Decode2RImmInstruction()

◆ Decode2RInstruction()

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

◆ Decode2RSrcDstInstruction()

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

◆ Decode2RUSBitpInstruction()

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

◆ Decode2RUSInstruction()

◆ Decode3OpInstruction()

◆ Decode3RImmInstruction()

◆ Decode3RInstruction()

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

◆ DecodeBitpOperand()

◆ DecodeGRRegsRegisterClass()

◆ DecodeL2OpInstructionFail()

◆ DecodeL2RInstruction()

◆ DecodeL2RUSBitpInstruction()

◆ DecodeL2RUSInstruction()

◆ DecodeL3RInstruction()

◆ DecodeL3RSrcDstInstruction()

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

◆ DecodeL4RSrcDstInstruction()

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

◆ DecodeL4RSrcDstSrcDstInstruction()

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

◆ DecodeL5RInstruction()

◆ DecodeL5RInstructionFail()

◆ DecodeL6RInstruction()

◆ DecodeLR2RInstruction()

◆ DecodeNegImmOperand()

DecodeStatus DecodeNegImmOperand ( MCInst & Inst,
unsigned Val,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeR2RInstruction()

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

◆ DecodeRRegsRegisterClass()

DecodeStatus DecodeRRegsRegisterClass ( MCInst & Inst,
unsigned RegNo,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeRUSBitpInstruction()

◆ DecodeRUSInstruction()

◆ DecodeRUSSrcDstBitpInstruction()

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

◆ getReg()

unsigned getReg ( const MCDisassembler * D,
unsigned RC,
unsigned RegNo )
static

Definition at line 72 of file XCoreDisassembler.cpp.

References D().

Referenced by DecodeGRRegsRegisterClass(), and DecodeRRegsRegisterClass().

◆ LLVMInitializeXCoreDisassembler()

◆ readInstruction16()

bool readInstruction16 ( ArrayRef< uint8_t > Bytes,
uint64_t Address,
uint64_t & Size,
uint16_t & Insn )
static

Definition at line 47 of file XCoreDisassembler.cpp.

References Size, and llvm::ArrayRef< T >::size().

◆ readInstruction32()

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

Definition at line 59 of file XCoreDisassembler.cpp.

References Size, and llvm::ArrayRef< T >::size().