LLVM  8.0.1
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 "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCFixedLenDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/TargetRegistry.h"
#include "ARCGenDisassemblerTables.inc"
Include dependency graph for ARCDisassembler.cpp:

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 void *Decoder=nullptr)
 
template<unsigned B>
static DecodeStatus DecodeFromCyclicRange (MCInst &Inst, unsigned InsnS, uint64_t Address=0, const void *Decoder=nullptr)
 
template<unsigned B>
static DecodeStatus DecodeBranchTargetS (MCInst &Inst, unsigned InsnS, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeMEMrs9 (MCInst &, unsigned, uint64_t, const void *)
 
static DecodeStatus DecodeLdLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static DecodeStatus DecodeStLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static DecodeStatus DecodeLdRLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static DecodeStatus DecodeMoveHRegInstruction (MCInst &Inst, uint64_t, uint64_t, const void *)
 
static DecodeStatus DecodeGPR32RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeGBR32ShortRegister (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *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 void *Decoder)
 
static void DecodeSymbolicOperandOff (MCInst &Inst, uint64_t Address, uint64_t Offset, const void *Decoder)
 
static MCDisassemblercreateARCDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
 
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 362 of file ARCDisassembler.cpp.

References llvm::Target::createMCInstrInfo().

Referenced by LLVMInitializeARCDisassembler().

◆ decodeAField()

static unsigned decodeAField ( unsigned  Insn)
static

Definition at line 155 of file ARCDisassembler.cpp.

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 void *  Decoder 
)
static

Definition at line 188 of file ARCDisassembler.cpp.

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

Referenced by readInstruction16().

◆ decodeCField()

static unsigned decodeCField ( unsigned  Insn)
static

Definition at line 146 of file ARCDisassembler.cpp.

Referenced by DecodeLdRLImmInstruction(), and DecodeStLImmInstruction().

◆ DecodeFromCyclicRange()

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

◆ DecodeGBR32ShortRegister()

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

Definition at line 134 of file ARCDisassembler.cpp.

References DecodeGPR32RegisterClass().

◆ DecodeGPR32RegisterClass()

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

◆ DecodeLdLImmInstruction()

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

◆ DecodeLdRLImmInstruction()

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

◆ DecodeMEMrs9()

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

◆ DecodeMoveHRegInstruction()

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

◆ DecodeSignedOperand()

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

◆ DecodeStLImmInstruction()

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

◆ DecodeSymbolicOperand()

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

Definition at line 169 of file ARCDisassembler.cpp.

Referenced by DecodeSymbolicOperandOff().

◆ DecodeSymbolicOperandOff()

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

◆ LLVMInitializeARCDisassembler()

void LLVMInitializeARCDisassembler ( )

◆ readInstruction16()

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

◆ readInstruction32()

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

Definition at line 51 of file ARCDisassembler.cpp.

Referenced by DecodeMoveHRegInstruction().

◆ readInstruction48()

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

Definition at line 70 of file ARCDisassembler.cpp.

Referenced by DecodeMoveHRegInstruction().

◆ readInstruction64()

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

Definition at line 60 of file ARCDisassembler.cpp.

Referenced by DecodeMoveHRegInstruction().

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}
#define R4(n)
#define R2(n)
#define R6(n)

Definition at line 114 of file ARCDisassembler.cpp.

Referenced by DecodeGPR32RegisterClass().