LLVM  6.0.0svn
Macros | Typedefs | Functions
HexagonDisassembler.cpp File Reference
#include "Hexagon.h"
#include "MCTargetDesc/HexagonBaseInfo.h"
#include "MCTargetDesc/HexagonMCChecker.h"
#include "MCTargetDesc/HexagonMCInstrInfo.h"
#include "MCTargetDesc/HexagonMCTargetDesc.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixedLenDisassembler.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
#include "HexagonDepDecoders.h"
#include "HexagonGenDisassemblerTables.inc"
Include dependency graph for HexagonDisassembler.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "hexagon-disassembler"
 

Typedefs

using DecodeStatus = MCDisassembler::DecodeStatus
 

Functions

static uint32_t fullValue (MCInstrInfo const &MCII, MCInst &MCB, MCInst &MI, int64_t Value)
 
static HexagonDisassembler constdisassembler (void const *Decoder)
 
template<size_t T>
static void signedDecoder (MCInst &MI, unsigned tmp, const void *Decoder)
 
static DecodeStatus DecodeIntRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeGeneralSubRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeIntRegsLow8RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeHvxVRRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeDoubleRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeGeneralDoubleLow8RegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeHvxWRRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodePredRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeHvxQRRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeCtrRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeModRegsRegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus DecodeCtrRegs64RegisterClass (MCInst &Inst, unsigned RegNo, uint64_t Address, const void *Decoder)
 
static DecodeStatus unsignedImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s32_0ImmDecoder (MCInst &MI, unsigned tmp, uint64_t, const void *Decoder)
 
static DecodeStatus s8_0ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s6_0ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s4_0ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s4_1ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s4_2ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s4_3ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus s3_0ImmDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static DecodeStatus brtargetDecoder (MCInst &MI, unsigned tmp, uint64_t Address, const void *Decoder)
 
static MCDisassemblercreateHexagonDisassembler (const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx)
 
void LLVMInitializeHexagonDisassembler ()
 
static void adjustDuplex (MCInst &MI, MCContext &Context)
 
static DecodeStatus DecodeRegisterClass (MCInst &Inst, unsigned RegNo, ArrayRef< MCPhysReg > Table)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "hexagon-disassembler"

Definition at line 10 of file HexagonDisassembler.cpp.

Typedef Documentation

◆ DecodeStatus

Definition at line 39 of file HexagonDisassembler.cpp.

Function Documentation

◆ adjustDuplex()

static void adjustDuplex ( MCInst MI,
MCContext Context 
)
static

Definition at line 203 of file HexagonDisassembler.cpp.

References llvm::MCInst::addOperand(), llvm::dwarf::syntax::Address, assert(), llvm::MCInst::begin(), llvm::HexagonMCInstrInfo::bundleInstructions(), llvm::HexagonMCInstrInfo::bundleSize(), llvm::MCConstantExpr::create(), llvm::MCOperand::createExpr(), llvm::MCOperand::createInst(), llvm::ArrayRef< T >::data(), llvm::X86Disassembler::decodeInstruction(), llvm::HexagonMCInstrInfo::extenderForIndex(), llvm::MCDisassembler::Fail, Fail, llvm::MCOperand::getInst(), llvm::HexagonMCInstrInfo::getNewValueOp(), llvm::HexagonMCInstrInfo::getNewValueOperand(), llvm::HexagonMCInstrInfo::getNewValueOperand2(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm::HexagonMCInstrInfo::hasNewValue(), llvm::HexagonMCInstrInfo::hasNewValue2(), HEXAGON_INSTR_SIZE, llvm::MCInst::insert(), llvm::HexagonII::INST_PARSE_DUPLEX, llvm::HexagonII::INST_PARSE_LOOP_END, llvm::HexagonII::INST_PARSE_MASK, llvm::HexagonII::INST_PARSE_PACKET_END, llvm::HexagonMCInstrInfo::isDuplex(), llvm::HexagonMCInstrInfo::isExtendable(), llvm::HexagonMCInstrInfo::isExtended(), llvm::HexagonMCInstrInfo::isImmext(), llvm::HexagonMCInstrInfo::isNewValue(), llvm::MCOperand::isReg(), llvm::HexagonMCInstrInfo::isVector(), MI, llvm::support::endian::read32le(), Register, llvm::HexagonMCInstrInfo::setInnerLoop(), llvm::MCInst::setOpcode(), llvm::HexagonMCInstrInfo::setOuterLoop(), llvm::MCOperand::setReg(), llvm::ArrayRef< T >::size(), llvm::MCDisassembler::Success, and Success.

◆ brtargetDecoder()

static DecodeStatus brtargetDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

◆ createHexagonDisassembler()

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

◆ DecodeCtrRegs64RegisterClass()

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

◆ DecodeCtrRegsRegisterClass()

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

◆ DecodeDoubleRegsRegisterClass()

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

Definition at line 499 of file HexagonDisassembler.cpp.

References DecodeRegisterClass().

Referenced by signedDecoder().

◆ DecodeGeneralDoubleLow8RegsRegisterClass()

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

Definition at line 511 of file HexagonDisassembler.cpp.

References DecodeRegisterClass().

Referenced by signedDecoder().

◆ DecodeGeneralSubRegsRegisterClass()

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

Definition at line 470 of file HexagonDisassembler.cpp.

References DecodeRegisterClass(), R2, R4, and R6.

Referenced by signedDecoder().

◆ DecodeHvxQRRegisterClass()

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

Definition at line 541 of file HexagonDisassembler.cpp.

References DecodeRegisterClass().

Referenced by signedDecoder().

◆ DecodeHvxVRRegisterClass()

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

◆ DecodeHvxWRRegisterClass()

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

Definition at line 520 of file HexagonDisassembler.cpp.

References DecodeRegisterClass().

Referenced by signedDecoder().

◆ DecodeIntRegsLow8RegisterClass()

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

Definition at line 449 of file HexagonDisassembler.cpp.

References DecodeIntRegsRegisterClass().

Referenced by signedDecoder().

◆ DecodeIntRegsRegisterClass()

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

◆ DecodeModRegsRegisterClass()

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

◆ DecodePredRegsRegisterClass()

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

Definition at line 532 of file HexagonDisassembler.cpp.

References DecodeRegisterClass().

Referenced by signedDecoder().

◆ DecodeRegisterClass()

static DecodeStatus DecodeRegisterClass ( MCInst Inst,
unsigned  RegNo,
ArrayRef< MCPhysReg Table 
)
static

◆ disassembler()

static HexagonDisassembler const& disassembler ( void const Decoder)
static

◆ fullValue()

static uint32_t fullValue ( MCInstrInfo const MCII,
MCInst MCB,
MCInst MI,
int64_t  Value 
)
static

◆ LLVMInitializeHexagonDisassembler()

void LLVMInitializeHexagonDisassembler ( )

◆ s32_0ImmDecoder()

static DecodeStatus s32_0ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  ,
const void *  Decoder 
)
static

◆ s3_0ImmDecoder()

static DecodeStatus s3_0ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s4_0ImmDecoder()

static DecodeStatus s4_0ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s4_1ImmDecoder()

static DecodeStatus s4_1ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s4_2ImmDecoder()

static DecodeStatus s4_2ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s4_3ImmDecoder()

static DecodeStatus s4_3ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s6_0ImmDecoder()

static DecodeStatus s6_0ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ s8_0ImmDecoder()

static DecodeStatus s8_0ImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static

Referenced by signedDecoder().

◆ signedDecoder()

template<size_t T>
static void signedDecoder ( MCInst MI,
unsigned  tmp,
const void *  Decoder 
)
static

◆ unsignedImmDecoder()

static DecodeStatus unsignedImmDecoder ( MCInst MI,
unsigned  tmp,
uint64_t  Address,
const void *  Decoder 
)
static