LLVM  8.0.1
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 convertMIMGInst (MCInst &MI) const
 
MCOperand decodeOperand_VGPR_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_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
 
- Public Member Functions inherited from llvm::MCDisassembler
 MCDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx)
 
virtual ~MCDisassembler ()
 
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 41 of file AMDGPUDisassembler.h.

Member Enumeration Documentation

◆ OpWidthTy

Enumerator
OPW32 
OPW64 
OPW128 
OPW256 
OPW512 
OPW16 
OPWV216 
OPW_LAST_ 
OPW_FIRST_ 

Definition at line 94 of file AMDGPUDisassembler.h.

Constructor & Destructor Documentation

◆ AMDGPUDisassembler()

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

◆ ~AMDGPUDisassembler()

llvm::AMDGPUDisassembler::~AMDGPUDisassembler ( )
overridedefault

Referenced by AMDGPUDisassembler().

Member Function Documentation

◆ 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 395 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

◆ decodeOperand_SReg_128()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_128 ( unsigned  Val) const

Definition at line 512 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW128.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_256()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_256 ( unsigned  Val) const

Definition at line 516 of file AMDGPUDisassembler.cpp.

References decodeDstOp(), and OPW256.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_32()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32 ( unsigned  Val) const

◆ decodeOperand_SReg_32_XEXEC_HI()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32_XEXEC_HI ( unsigned  Val) const

Definition at line 498 of file AMDGPUDisassembler.cpp.

References decodeOperand_SReg_32().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_32_XM0_XEXEC()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_32_XM0_XEXEC ( unsigned  Val) const

Definition at line 492 of file AMDGPUDisassembler.cpp.

References decodeOperand_SReg_32().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_512()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_512 ( unsigned  Val) const

Definition at line 520 of file AMDGPUDisassembler.cpp.

References decodeDstOp(), and OPW512.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_64 ( unsigned  Val) const

Definition at line 504 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_64_XEXEC()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_64_XEXEC ( unsigned  Val) const

Definition at line 508 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VGPR_32()

MCOperand AMDGPUDisassembler::decodeOperand_VGPR_32 ( unsigned  Val) const

Definition at line 464 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_128()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_128 ( unsigned  Val) const

Definition at line 481 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_64 ( unsigned  Val) const

Definition at line 473 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_96()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_96 ( unsigned  Val) const

Definition at line 477 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VS_128()

MCOperand AMDGPUDisassembler::decodeOperand_VS_128 ( unsigned  Val) const

Definition at line 452 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW128.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VS_32()

MCOperand AMDGPUDisassembler::decodeOperand_VS_32 ( unsigned  Val) const

Definition at line 444 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW32.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VS_64()

MCOperand AMDGPUDisassembler::decodeOperand_VS_64 ( unsigned  Val) const

Definition at line 448 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VSrc16()

MCOperand AMDGPUDisassembler::decodeOperand_VSrc16 ( unsigned  Val) const

Definition at line 456 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW16.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VSrcV216()

MCOperand AMDGPUDisassembler::decodeOperand_VSrcV216 ( unsigned  Val) const

Definition at line 460 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPWV216.

Referenced by AMDGPUDisassembler().

◆ decodeSDWASrc()

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

◆ decodeSDWASrc16()

MCOperand AMDGPUDisassembler::decodeSDWASrc16 ( unsigned  Val) const

Definition at line 844 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc(), and OPW16.

◆ decodeSDWASrc32()

MCOperand AMDGPUDisassembler::decodeSDWASrc32 ( unsigned  Val) const

Definition at line 848 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 758 of file AMDGPUDisassembler.cpp.

References assert(), createRegOperand(), errOperand(), and isGFX9().

Referenced by decodeSDWASrc(), and decodeSrcOp().

◆ decodeSpecialReg64()

MCOperand AMDGPUDisassembler::decodeSpecialReg64 ( unsigned  Val) const

Definition at line 790 of file AMDGPUDisassembler.cpp.

References assert(), createRegOperand(), errOperand(), and isGFX9().

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 171 of file AMDGPUDisassembler.cpp.

References llvm::MCDisassembler::CommentStream, convertMIMGInst(), convertSDWAInst(), llvm::MCOperand::createImm(), llvm::MCDisassembler::Fail, llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCInst::getOpcode(), insertNamedMCOperand(), llvm::SIInstrFlags::MIMG, llvm::report_fatal_error(), llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), llvm::MCDisassembler::STI, and tryDecodeInst().

Referenced by AMDGPUDisassembler().

◆ 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 642 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeSDWASrc(), and decodeSrcOp().

◆ 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: