LLVM  6.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, 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)
 
 ~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
 
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 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
 
- 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 39 of file AMDGPUDisassembler.h.

Member Enumeration Documentation

◆ OpWidthTy

Enumerator
OPW32 
OPW64 
OPW128 
OPW16 
OPWV216 
OPW_LAST_ 
OPW_FIRST_ 

Definition at line 88 of file AMDGPUDisassembler.h.

Constructor & Destructor Documentation

◆ AMDGPUDisassembler()

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

◆ ~AMDGPUDisassembler()

llvm::AMDGPUDisassembler::~AMDGPUDisassembler ( )
overridedefault

Referenced by AMDGPUDisassembler().

Member Function Documentation

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

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

◆ createSRegOperand()

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

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

References createSRegOperand().

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 382 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 376 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 404 of file AMDGPUDisassembler.cpp.

References createSRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_SReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_SReg_64 ( unsigned  Val) const

Definition at line 388 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 392 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 348 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_128()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_128 ( unsigned  Val) const

Definition at line 365 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_64()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_64 ( unsigned  Val) const

Definition at line 357 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VReg_96()

MCOperand AMDGPUDisassembler::decodeOperand_VReg_96 ( unsigned  Val) const

Definition at line 361 of file AMDGPUDisassembler.cpp.

References createRegOperand().

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VS_128()

MCOperand AMDGPUDisassembler::decodeOperand_VS_128 ( unsigned  Val) const

Definition at line 336 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 328 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 332 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW64.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VSrc16()

MCOperand AMDGPUDisassembler::decodeOperand_VSrc16 ( unsigned  Val) const

Definition at line 340 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and OPW16.

Referenced by AMDGPUDisassembler().

◆ decodeOperand_VSrcV216()

MCOperand AMDGPUDisassembler::decodeOperand_VSrcV216 ( unsigned  Val) const

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

References decodeSDWASrc(), and OPW16.

◆ decodeSDWASrc32()

MCOperand AMDGPUDisassembler::decodeSDWASrc32 ( unsigned  Val) const

Definition at line 684 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc(), and OPW32.

◆ decodeSDWAVopcDst()

MCOperand AMDGPUDisassembler::decodeSDWAVopcDst ( unsigned  Val) const

◆ decodeSpecialReg32()

MCOperand AMDGPUDisassembler::decodeSpecialReg32 ( unsigned  Val) const

◆ decodeSpecialReg64()

MCOperand AMDGPUDisassembler::decodeSpecialReg64 ( unsigned  Val) const

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

References llvm::MCDisassembler::CommentStream, convertSDWAInst(), llvm::MCOperand::createImm(), llvm::MCDisassembler::Fail, llvm::MCSubtargetInfo::getFeatureBits(), llvm::MCInst::getOpcode(), insertNamedMCOperand(), 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

Definition at line 541 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeSDWASrc(), decodeSDWAVopcDst(), and decodeSrcOp().

◆ getTtmpClassId()

unsigned AMDGPUDisassembler::getTtmpClassId ( const OpWidthTy  Width) const

Definition at line 556 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeSrcOp().

◆ getVgprClassId()

unsigned AMDGPUDisassembler::getVgprClassId ( const OpWidthTy  Width) const

Definition at line 526 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeSDWASrc(), and decodeSrcOp().

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