LLVM  9.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::AMDGPUDisassembler Class Reference

#include "Target/AMDGPU/Disassembler/AMDGPUDisassembler.h"

Inheritance diagram for llvm::AMDGPUDisassembler:
Inheritance graph
[legend]
Collaboration diagram for llvm::AMDGPUDisassembler:
Collaboration graph
[legend]

Public Types

enum  OpWidthTy {
  OPW32, OPW64, OPW128, OPW256,
  OPW512, OPW16, OPWV216, OPW_LAST_,
  OPW_FIRST_ = OPW32
}
 
- Public Types inherited from llvm::MCDisassembler
enum  DecodeStatus { Fail = 0, SoftFail = 1, Success = 3 }
 Ternary decode status. More...
 

Public Member Functions

 AMDGPUDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx, MCInstrInfo const *MCII)
 
 ~AMDGPUDisassembler () override=default
 
DecodeStatus getInstruction (MCInst &MI, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &WS, raw_ostream &CS) const override
 Returns the disassembly of a single instruction. More...
 
const chargetRegClassName (unsigned RegClassID) const
 
MCOperand createRegOperand (unsigned int RegId) const
 
MCOperand createRegOperand (unsigned RegClassID, unsigned Val) const
 
MCOperand createSRegOperand (unsigned SRegClassID, unsigned Val) const
 
MCOperand errOperand (unsigned V, const Twine &ErrMsg) const
 
DecodeStatus tryDecodeInst (const uint8_t *Table, MCInst &MI, uint64_t Inst, uint64_t Address) const
 
DecodeStatus convertSDWAInst (MCInst &MI) const
 
DecodeStatus convertDPP8Inst (MCInst &MI) const
 
DecodeStatus convertMIMGInst (MCInst &MI) const
 
MCOperand decodeOperand_VGPR_32 (unsigned Val) const
 
MCOperand decodeOperand_VRegOrLds_32 (unsigned Val) const
 
MCOperand decodeOperand_VS_32 (unsigned Val) const
 
MCOperand decodeOperand_VS_64 (unsigned Val) const
 
MCOperand decodeOperand_VS_128 (unsigned Val) const
 
MCOperand decodeOperand_VSrc16 (unsigned Val) const
 
MCOperand decodeOperand_VSrcV216 (unsigned Val) const
 
MCOperand decodeOperand_VReg_64 (unsigned Val) const
 
MCOperand decodeOperand_VReg_96 (unsigned Val) const
 
MCOperand decodeOperand_VReg_128 (unsigned Val) const
 
MCOperand decodeOperand_SReg_32 (unsigned Val) const
 
MCOperand decodeOperand_SReg_32_XM0_XEXEC (unsigned Val) const
 
MCOperand decodeOperand_SReg_32_XEXEC_HI (unsigned Val) const
 
MCOperand decodeOperand_SRegOrLds_32 (unsigned Val) const
 
MCOperand decodeOperand_SReg_64 (unsigned Val) const
 
MCOperand decodeOperand_SReg_64_XEXEC (unsigned Val) const
 
MCOperand decodeOperand_SReg_128 (unsigned Val) const
 
MCOperand decodeOperand_SReg_256 (unsigned Val) const
 
MCOperand decodeOperand_SReg_512 (unsigned Val) const
 
unsigned getVgprClassId (const OpWidthTy Width) const
 
unsigned getSgprClassId (const OpWidthTy Width) const
 
unsigned getTtmpClassId (const OpWidthTy Width) const
 
MCOperand decodeLiteralConstant () const
 
MCOperand decodeSrcOp (const OpWidthTy Width, unsigned Val) const
 
MCOperand decodeDstOp (const OpWidthTy Width, unsigned Val) const
 
MCOperand decodeSpecialReg32 (unsigned Val) const
 
MCOperand decodeSpecialReg64 (unsigned Val) const
 
MCOperand decodeSDWASrc (const OpWidthTy Width, unsigned Val) const
 
MCOperand decodeSDWASrc16 (unsigned Val) const
 
MCOperand decodeSDWASrc32 (unsigned Val) const
 
MCOperand decodeSDWAVopcDst (unsigned Val) const
 
int getTTmpIdx (unsigned Val) const
 
bool isVI () const
 
bool isGFX9 () const
 
bool isGFX10 () const
 
- Public Member Functions inherited from llvm::MCDisassembler
 MCDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx)
 
virtual ~MCDisassembler ()
 
virtual DecodeStatus onSymbolStart (StringRef Name, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &VStream, raw_ostream &CStream) const
 May parse any prelude that precedes instructions after the start of a symbol. More...
 
bool tryAddingSymbolicOperand (MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) const
 
void tryAddingPcLoadReferenceComment (int64_t Value, uint64_t Address) const
 
void setSymbolizer (std::unique_ptr< MCSymbolizer > Symzer)
 Set Symzer as the current symbolizer. More...
 
MCContextgetContext () const
 
const MCSubtargetInfogetSubtargetInfo () const
 

Static Public Member Functions

static MCOperand decodeIntImmed (unsigned Imm)
 
static MCOperand decodeFPImmed (OpWidthTy Width, unsigned Imm)
 

Additional Inherited Members

- Public Attributes inherited from llvm::MCDisassembler
raw_ostreamCommentStream = nullptr
 
- Protected Attributes inherited from llvm::MCDisassembler
const MCSubtargetInfoSTI
 
std::unique_ptr< MCSymbolizerSymbolizer
 

Detailed Description

Definition at line 40 of file AMDGPUDisassembler.h.

Member Enumeration Documentation

◆ OpWidthTy

Enumerator
OPW32 
OPW64 
OPW128 
OPW256 
OPW512 
OPW16 
OPWV216 
OPW_LAST_ 
OPW_FIRST_ 

Definition at line 96 of file AMDGPUDisassembler.h.

Constructor & Destructor Documentation

◆ AMDGPUDisassembler()

AMDGPUDisassembler::AMDGPUDisassembler ( const MCSubtargetInfo STI,
MCContext Ctx,
MCInstrInfo const MCII 
)

◆ ~AMDGPUDisassembler()

llvm::AMDGPUDisassembler::~AMDGPUDisassembler ( )
overridedefault

Member Function Documentation

◆ convertDPP8Inst()

DecodeStatus AMDGPUDisassembler::convertDPP8Inst ( MCInst MI) const

◆ convertMIMGInst()

DecodeStatus AMDGPUDisassembler::convertMIMGInst ( MCInst MI) const

◆ convertSDWAInst()

DecodeStatus AMDGPUDisassembler::convertSDWAInst ( MCInst MI) const

◆ createRegOperand() [1/2]

MCOperand AMDGPUDisassembler::createRegOperand ( unsigned int  RegId) const
inline

◆ createRegOperand() [2/2]

MCOperand AMDGPUDisassembler::createRegOperand ( unsigned  RegClassID,
unsigned  Val 
) const
inline

Definition at line 555 of file AMDGPUDisassembler.cpp.

References createRegOperand(), errOperand(), and getRegClassName().

◆ createSRegOperand()

MCOperand AMDGPUDisassembler::createSRegOperand ( unsigned  SRegClassID,
unsigned  Val 
) const
inline

◆ decodeDstOp()

MCOperand AMDGPUDisassembler::decodeDstOp ( const OpWidthTy  Width,
unsigned  Val 
) const

◆ decodeFPImmed()

MCOperand AMDGPUDisassembler::decodeFPImmed ( OpWidthTy  Width,
unsigned  Imm 
)
static

◆ decodeIntImmed()

MCOperand AMDGPUDisassembler::decodeIntImmed ( unsigned  Imm)
static

◆ decodeLiteralConstant()

MCOperand AMDGPUDisassembler::decodeLiteralConstant ( ) const

Definition at line 695 of file AMDGPUDisassembler.cpp.

References llvm::MCOperand::createImm(), errOperand(), and llvm::Literal.

Referenced by decodeSrcOp().

◆ decodeOperand_SReg_128()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_128 ( unsigned  Val) const

Definition at line 683 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW128.

◆ decodeOperand_SReg_256()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_256 ( unsigned  Val) const

Definition at line 687 of file AMDGPUDisassembler.cpp.

References decodeDstOp(), and OPW256.

◆ decodeOperand_SReg_32()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32 ( unsigned  Val) const

Definition at line 649 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW32.

Referenced by decodeOperand_SReg_32_XEXEC_HI(), and decodeOperand_SReg_32_XM0_XEXEC().

◆ decodeOperand_SReg_32_XEXEC_HI()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32_XEXEC_HI ( unsigned  Val) const

Definition at line 662 of file AMDGPUDisassembler.cpp.

References decodeOperand_SReg_32().

◆ decodeOperand_SReg_32_XM0_XEXEC()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32_XM0_XEXEC ( unsigned  Val) const

Definition at line 656 of file AMDGPUDisassembler.cpp.

References decodeOperand_SReg_32().

◆ decodeOperand_SReg_512()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_512 ( unsigned  Val) const

Definition at line 691 of file AMDGPUDisassembler.cpp.

References decodeDstOp(), and OPW512.

◆ decodeOperand_SReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_64 ( unsigned  Val) const

Definition at line 675 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

◆ decodeOperand_SReg_64_XEXEC()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_64_XEXEC ( unsigned  Val) const

Definition at line 679 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

◆ decodeOperand_SRegOrLds_32()

MCOperand AMDGPUDisassembler::decodeOperand_SRegOrLds_32 ( unsigned  Val) const

Definition at line 668 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW32.

◆ decodeOperand_VGPR_32()

MCOperand AMDGPUDisassembler::decodeOperand_VGPR_32 ( unsigned  Val) const

Definition at line 624 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by getInstruction().

◆ decodeOperand_VReg_128()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_128 ( unsigned  Val) const

Definition at line 645 of file AMDGPUDisassembler.cpp.

References createRegOperand().

◆ decodeOperand_VReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_64 ( unsigned  Val) const

Definition at line 637 of file AMDGPUDisassembler.cpp.

References createRegOperand().

◆ decodeOperand_VReg_96()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_96 ( unsigned  Val) const

Definition at line 641 of file AMDGPUDisassembler.cpp.

References createRegOperand().

◆ decodeOperand_VRegOrLds_32()

MCOperand AMDGPUDisassembler::decodeOperand_VRegOrLds_32 ( unsigned  Val) const

Definition at line 633 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW32.

◆ decodeOperand_VS_128()

MCOperand AMDGPUDisassembler::decodeOperand_VS_128 ( unsigned  Val) const

Definition at line 612 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW128.

◆ decodeOperand_VS_32()

MCOperand AMDGPUDisassembler::decodeOperand_VS_32 ( unsigned  Val) const

Definition at line 604 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW32.

◆ decodeOperand_VS_64()

MCOperand AMDGPUDisassembler::decodeOperand_VS_64 ( unsigned  Val) const

Definition at line 608 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

◆ decodeOperand_VSrc16()

MCOperand AMDGPUDisassembler::decodeOperand_VSrc16 ( unsigned  Val) const

Definition at line 616 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW16.

◆ decodeOperand_VSrcV216()

MCOperand AMDGPUDisassembler::decodeOperand_VSrcV216 ( unsigned  Val) const

Definition at line 620 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPWV216.

◆ decodeSDWASrc()

MCOperand AMDGPUDisassembler::decodeSDWASrc ( const OpWidthTy  Width,
unsigned  Val 
) const

◆ decodeSDWASrc16()

MCOperand AMDGPUDisassembler::decodeSDWASrc16 ( unsigned  Val) const

Definition at line 1027 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc(), and OPW16.

◆ decodeSDWASrc32()

MCOperand AMDGPUDisassembler::decodeSDWASrc32 ( unsigned  Val) const

Definition at line 1031 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc(), and OPW32.

◆ decodeSDWAVopcDst()

MCOperand AMDGPUDisassembler::decodeSDWAVopcDst ( unsigned  Val) const

◆ decodeSpecialReg32()

MCOperand AMDGPUDisassembler::decodeSpecialReg32 ( unsigned  Val) const

Definition at line 931 of file AMDGPUDisassembler.cpp.

References createRegOperand(), and errOperand().

Referenced by decodeSDWASrc(), and decodeSrcOp().

◆ decodeSpecialReg64()

MCOperand AMDGPUDisassembler::decodeSpecialReg64 ( unsigned  Val) const

Definition at line 963 of file AMDGPUDisassembler.cpp.

References createRegOperand(), and errOperand().

Referenced by decodeSDWAVopcDst(), and decodeSrcOp().

◆ decodeSrcOp()

MCOperand AMDGPUDisassembler::decodeSrcOp ( const OpWidthTy  Width,
unsigned  Val 
) const

◆ errOperand()

MCOperand AMDGPUDisassembler::errOperand ( unsigned  V,
const Twine ErrMsg 
) const
inline

◆ getInstruction()

DecodeStatus AMDGPUDisassembler::getInstruction ( MCInst Instr,
uint64_t &  Size,
ArrayRef< uint8_t >  Bytes,
uint64_t  Address,
raw_ostream VStream,
raw_ostream CStream 
) const
overridevirtual

Returns the disassembly of a single instruction.

Parameters
Instr- An MCInst to populate with the contents of the instruction.
Size- A value to populate with the size of the instruction, or the number of bytes consumed while attempting to decode an invalid instruction.
Address- The address, in the memory space of region, of the first byte of the instruction.
Bytes- A reference to the actual bytes of the instruction.
VStream- The stream to print warnings and diagnostic messages on.
CStream- The stream to print comments and annotations on.
Returns
- MCDisassembler::Success if the instruction is valid, MCDisassembler::SoftFail if the instruction was disassemblable but invalid, MCDisassembler::Fail if the instruction was invalid.

Implements llvm::MCDisassembler.

Definition at line 199 of file AMDGPUDisassembler.cpp.

References llvm::MCInst::begin(), llvm::MCDisassembler::CommentStream, convertDPP8Inst(), convertMIMGInst(), convertSDWAInst(), llvm::MCOperand::createImm(), llvm::MCOperand::createReg(), decodeOperand_VGPR_32(), llvm::MCInst::erase(), llvm::MCDisassembler::Fail, llvm::MCSubtargetInfo::getFeatureBits(), llvm::AMDGPU::getNamedOperandIdx(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::MCOperand::getReg(), llvm::MCInst::insert(), insertNamedMCOperand(), llvm::MCOperand::isReg(), llvm::SIInstrFlags::MIMG, llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), llvm::MCDisassembler::STI, llvm::MCDisassembler::Success, llvm::MCOI::TIED_TO, tryDecodeInst(), and llvm::SIInstrFlags::VOP3.

◆ getRegClassName()

const char * AMDGPUDisassembler::getRegClassName ( unsigned  RegClassID) const

◆ getSgprClassId()

unsigned AMDGPUDisassembler::getSgprClassId ( const OpWidthTy  Width) const

◆ getTtmpClassId()

unsigned AMDGPUDisassembler::getTtmpClassId ( const OpWidthTy  Width) const

◆ getTTmpIdx()

int AMDGPUDisassembler::getTTmpIdx ( unsigned  Val) const

◆ getVgprClassId()

unsigned AMDGPUDisassembler::getVgprClassId ( const OpWidthTy  Width) const

Definition at line 813 of file AMDGPUDisassembler.cpp.

References assert(), OPW128, OPW16, OPW32, OPW64, OPW_FIRST_, OPW_LAST_, and OPWV216.

Referenced by decodeSDWASrc(), and decodeSrcOp().

◆ isGFX10()

bool AMDGPUDisassembler::isGFX10 ( ) const

◆ isGFX9()

bool AMDGPUDisassembler::isGFX9 ( ) const

◆ isVI()

bool AMDGPUDisassembler::isVI ( ) const

◆ tryDecodeInst()

DecodeStatus AMDGPUDisassembler::tryDecodeInst ( const uint8_t *  Table,
MCInst MI,
uint64_t  Inst,
uint64_t  Address 
) const

The documentation for this class was generated from the following files: