LLVM 22.0.0git
AVRDisassembler.cpp File Reference
#include "MCTargetDesc/AVRMCTargetDesc.h"
#include "TargetInfo/AVRTargetInfo.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCAsmInfo.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/TargetRegistry.h"
#include "llvm/Support/Compiler.h"
#include "AVRGenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "avr-disassembler"

Typedefs

typedef DecodeStatus(* DecodeFunc) (MCInst &MI, unsigned insn, uint64_t Address, const MCDisassembler *Decoder)

Functions

static MCDisassemblercreateAVRDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAVRDisassembler ()
static DecodeStatus DecodeGPR8RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLD8RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeLD8loRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeDREGSRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeIWREGSRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus DecodeZREGRegisterClass (MCInst &Inst, const MCDisassembler *Decoder)
static DecodeStatus decodeCallTarget (MCInst &Inst, unsigned Field, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeRelCondBrTarget7 (MCInst &Inst, unsigned Field, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeRelCondBrTarget13 (MCInst &Inst, unsigned Field, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeMemri (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus decodeLoadStore (MCInst &Inst, unsigned Insn, uint64_t Address, const MCDisassembler *Decoder)
static DecodeStatus readInstruction16 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
static DecodeStatus readInstruction32 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
static const uint8_tgetDecoderTable (uint64_t Size)

Variables

static constexpr MCRegister GPRDecoderTable []
static constexpr MCRegister GPRPairDecoderTable []

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "avr-disassembler"

Definition at line 32 of file AVRDisassembler.cpp.

Typedef Documentation

◆ DecodeFunc

typedef DecodeStatus(* DecodeFunc) (MCInst &MI, unsigned insn, uint64_t Address, const MCDisassembler *Decoder)

Definition at line 374 of file AVRDisassembler.cpp.

Function Documentation

◆ createAVRDisassembler()

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

Definition at line 51 of file AVRDisassembler.cpp.

References T.

Referenced by LLVMInitializeAVRDisassembler().

◆ decodeCallTarget()

DecodeStatus decodeCallTarget ( MCInst & Inst,
unsigned Field,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeDREGSRegisterClass()

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

◆ DecodeGPR8RegisterClass()

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

◆ DecodeIWREGSRegisterClass()

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

◆ DecodeLD8loRegisterClass()

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

◆ DecodeLD8RegisterClass()

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

◆ decodeLoadStore()

◆ decodeMemri()

◆ decodeRelCondBrTarget13()

DecodeStatus decodeRelCondBrTarget13 ( MCInst & Inst,
unsigned Field,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ decodeRelCondBrTarget7()

DecodeStatus decodeRelCondBrTarget7 ( MCInst & Inst,
unsigned Field,
uint64_t Address,
const MCDisassembler * Decoder )
static

◆ DecodeZREGRegisterClass()

DecodeStatus DecodeZREGRegisterClass ( MCInst & Inst,
const MCDisassembler * Decoder )
static

◆ getDecoderTable()

const uint8_t * getDecoderTable ( uint64_t Size)
static

Definition at line 308 of file AVRDisassembler.cpp.

References llvm_unreachable, and Size.

◆ LLVMInitializeAVRDisassembler()

◆ readInstruction16()

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

◆ readInstruction32()

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

Variable Documentation

◆ GPRDecoderTable

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

Definition at line 64 of file AVRDisassembler.cpp.

◆ GPRPairDecoderTable

MCRegister GPRPairDecoderTable[]
staticconstexpr
Initial value:
= {
AVR::R1R0, AVR::R3R2, AVR::R5R4, AVR::R7R6,
AVR::R9R8, AVR::R11R10, AVR::R13R12, AVR::R15R14,
AVR::R17R16, AVR::R19R18, AVR::R21R20, AVR::R23R22,
AVR::R25R24, AVR::R27R26, AVR::R29R28, AVR::R31R30,
}

Definition at line 72 of file AVRDisassembler.cpp.