LLVM 20.0.0git
Macros | Typedefs | Functions | Variables
ARCDisassembler.cpp File Reference

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

#include "ARC.h"
#include "ARCRegisterInfo.h"
#include "MCTargetDesc/ARCMCTargetDesc.h"
#include "TargetInfo/ARCTargetInfo.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/MCSubtargetInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include "ARCGenDisassemblerTables.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "arc-disassembler"
 

Typedefs

using DecodeStatus = MCDisassembler::DecodeStatus
 

Functions

static bool readInstruction32 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
 
static bool readInstruction64 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint64_t &Insn)
 
static bool readInstruction48 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint64_t &Insn)
 
static bool readInstruction16 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
 
template<unsigned B>
static DecodeStatus DecodeSignedOperand (MCInst &Inst, unsigned InsnS, uint64_t Address=0, const MCDisassembler *Decoder=nullptr)
 
template<unsigned B>
static DecodeStatus DecodeFromCyclicRange (MCInst &Inst, unsigned InsnS, uint64_t Address=0, const MCDisassembler *Decoder=nullptr)
 
template<unsigned B>
static DecodeStatus DecodeBranchTargetS (MCInst &Inst, unsigned InsnS, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeMEMrs9 (MCInst &, unsigned, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeLdLImmInstruction (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeStLImmInstruction (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeLdRLImmInstruction (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeSOPwithRS12 (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeSOPwithRU6 (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeCCRU6Instruction (MCInst &, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeMoveHRegInstruction (MCInst &Inst, uint64_t, uint64_t, const MCDisassembler *)
 
static DecodeStatus DecodeGPR32RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static DecodeStatus DecodeGBR32ShortRegister (MCInst &Inst, unsigned RegNo, uint64_t Address, const MCDisassembler *Decoder)
 
static unsigned decodeCField (unsigned Insn)
 
static unsigned decodeBField (unsigned Insn)
 
static unsigned decodeAField (unsigned Insn)
 
static bool DecodeSymbolicOperand (MCInst &Inst, uint64_t Address, uint64_t Value, const MCDisassembler *Decoder)
 
static void DecodeSymbolicOperandOff (MCInst &Inst, uint64_t Address, uint64_t Offset, const MCDisassembler *Decoder)
 
static MCDisassemblercreateARCDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
 
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCDisassembler ()
 

Variables

static const uint16_t GPR32DecoderTable []
 

Detailed Description

This file is part of the ARC Disassembler.

Definition in file ARCDisassembler.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "arc-disassembler"

Definition at line 28 of file ARCDisassembler.cpp.

Typedef Documentation

◆ DecodeStatus

Definition at line 30 of file ARCDisassembler.cpp.

Function Documentation

◆ createARCDisassembler()

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

Definition at line 411 of file ARCDisassembler.cpp.

Referenced by LLVMInitializeARCDisassembler().

◆ decodeAField()

static unsigned decodeAField ( unsigned  Insn)
static

Definition at line 165 of file ARCDisassembler.cpp.

References Insn.

Referenced by DecodeLdLImmInstruction(), and DecodeLdRLImmInstruction().

◆ decodeBField()

static unsigned decodeBField ( unsigned  Insn)
static

◆ DecodeBranchTargetS()

template<unsigned B>
static DecodeStatus DecodeBranchTargetS ( MCInst Inst,
unsigned  InsnS,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

Definition at line 197 of file ARCDisassembler.cpp.

References B, DecodeSymbolicOperandOff(), and llvm::MCDisassembler::Success.

◆ DecodeCCRU6Instruction()

static DecodeStatus DecodeCCRU6Instruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ decodeCField()

static unsigned decodeCField ( unsigned  Insn)
static

Definition at line 156 of file ARCDisassembler.cpp.

References Insn.

Referenced by DecodeLdRLImmInstruction(), and DecodeStLImmInstruction().

◆ DecodeFromCyclicRange()

template<unsigned B>
static DecodeStatus DecodeFromCyclicRange ( MCInst Inst,
unsigned  InsnS,
uint64_t  Address = 0,
const MCDisassembler Decoder = nullptr 
)
static

◆ DecodeGBR32ShortRegister()

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

Definition at line 144 of file ARCDisassembler.cpp.

References DecodeGPR32RegisterClass().

◆ DecodeGPR32RegisterClass()

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

◆ DecodeLdLImmInstruction()

static DecodeStatus DecodeLdLImmInstruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeLdRLImmInstruction()

static DecodeStatus DecodeLdRLImmInstruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeMEMrs9()

static DecodeStatus DecodeMEMrs9 ( MCInst Inst,
unsigned  Insn,
uint64_t  Address,
const MCDisassembler Dec 
)
static

◆ DecodeMoveHRegInstruction()

static DecodeStatus DecodeMoveHRegInstruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeSignedOperand()

template<unsigned B>
static DecodeStatus DecodeSignedOperand ( MCInst Inst,
unsigned  InsnS,
uint64_t  Address = 0,
const MCDisassembler Decoder = nullptr 
)
static

◆ DecodeSOPwithRS12()

static DecodeStatus DecodeSOPwithRS12 ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeSOPwithRU6()

static DecodeStatus DecodeSOPwithRU6 ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeStLImmInstruction()

static DecodeStatus DecodeStLImmInstruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
const MCDisassembler Decoder 
)
static

◆ DecodeSymbolicOperand()

static bool DecodeSymbolicOperand ( MCInst Inst,
uint64_t  Address,
uint64_t  Value,
const MCDisassembler Decoder 
)
static

◆ DecodeSymbolicOperandOff()

static void DecodeSymbolicOperandOff ( MCInst Inst,
uint64_t  Address,
uint64_t  Offset,
const MCDisassembler Decoder 
)
static

◆ LLVMInitializeARCDisassembler()

LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARCDisassembler ( )

◆ readInstruction16()

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

Definition at line 78 of file ARCDisassembler.cpp.

References Insn, and Size.

◆ readInstruction32()

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

Definition at line 50 of file ARCDisassembler.cpp.

References Insn, and Size.

Referenced by llvm::LanaiDisassembler::getInstruction().

◆ readInstruction48()

static bool readInstruction48 ( ArrayRef< uint8_t >  Bytes,
uint64_t  Address,
uint64_t Size,
uint64_t Insn 
)
static

Definition at line 69 of file ARCDisassembler.cpp.

References Insn, and Size.

◆ readInstruction64()

static bool readInstruction64 ( ArrayRef< uint8_t >  Bytes,
uint64_t  Address,
uint64_t Size,
uint64_t Insn 
)
static

Definition at line 59 of file ARCDisassembler.cpp.

References Insn, and Size.

Variable Documentation

◆ GPR32DecoderTable

const uint16_t GPR32DecoderTable[]
static
Initial value:
= {
ARC::R0, ARC::R1, ARC::R2, ARC::R3, ARC::R4, ARC::R5, ARC::R6,
ARC::R7, ARC::R8, ARC::R9, ARC::R10, ARC::R11, ARC::R12, ARC::R13,
ARC::R14, ARC::R15, ARC::R16, ARC::R17, ARC::R18, ARC::R19, ARC::R20,
ARC::R21, ARC::R22, ARC::R23, ARC::R24, ARC::R25, ARC::GP, ARC::FP,
ARC::SP, ARC::ILINK, ARC::R30, ARC::BLINK}

Definition at line 124 of file ARCDisassembler.cpp.

Referenced by DecodeGPR32RegisterClass().