LLVM  6.0.0svn
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 readInstruction16 (ArrayRef< uint8_t > Bytes, uint64_t Address, uint64_t &Size, uint32_t &Insn)
 
static MCDisassembler::DecodeStatus DecodeS12Operand (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeS9Operand (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeBranchTargetS9 (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeBranchTargetS21 (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeBranchTargetS25 (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeMEMrs9 (MCInst &, unsigned, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeLdLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeStLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static MCDisassembler::DecodeStatus DecodeLdRLImmInstruction (MCInst &, uint64_t, uint64_t, const void *)
 
static DecodeStatus DecodeGPR32RegisterClass (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 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 288 of file ARCDisassembler.cpp.

References llvm::Target::createMCInstrInfo().

Referenced by LLVMInitializeARCDisassembler().

◆ decodeAField()

static unsigned decodeAField ( unsigned  Insn)
static

Definition at line 134 of file ARCDisassembler.cpp.

Referenced by DecodeLdLImmInstruction(), and DecodeLdRLImmInstruction().

◆ decodeBField()

static unsigned decodeBField ( unsigned  Insn)
static

◆ DecodeBranchTargetS21()

static MCDisassembler::DecodeStatus DecodeBranchTargetS21 ( MCInst Inst,
unsigned  S,
uint64_t  Address,
const void *  Decoder 
)
static

◆ DecodeBranchTargetS25()

static MCDisassembler::DecodeStatus DecodeBranchTargetS25 ( MCInst Inst,
unsigned  S,
uint64_t  Address,
const void *  Decoder 
)
static

◆ DecodeBranchTargetS9()

static MCDisassembler::DecodeStatus DecodeBranchTargetS9 ( MCInst Inst,
unsigned  S,
uint64_t  Address,
const void *  Decoder 
)
static

◆ decodeCField()

static unsigned decodeCField ( unsigned  Insn)
static

Definition at line 125 of file ARCDisassembler.cpp.

Referenced by DecodeLdRLImmInstruction(), and DecodeStLImmInstruction().

◆ DecodeGPR32RegisterClass()

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

◆ DecodeLdLImmInstruction()

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

◆ DecodeLdRLImmInstruction()

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

◆ DecodeMEMrs9()

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

◆ DecodeS12Operand()

static MCDisassembler::DecodeStatus DecodeS12Operand ( MCInst Inst,
unsigned  InsnS12,
uint64_t  Address,
const void *  Decoder 
)
static

◆ DecodeS9Operand()

static MCDisassembler::DecodeStatus DecodeS9Operand ( MCInst Inst,
unsigned  InsnS9,
uint64_t  Address,
const void *  Decoder 
)
static

◆ DecodeStLImmInstruction()

static MCDisassembler::DecodeStatus DecodeStLImmInstruction ( MCInst Inst,
uint64_t  Insn,
uint64_t  Address,
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 DecodeLdRLImmInstruction().

◆ 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 DecodeLdRLImmInstruction().

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 104 of file ARCDisassembler.cpp.

Referenced by DecodeGPR32RegisterClass().