LLVM 22.0.0git
llvm::AMDGPUDisassembler Class Reference

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

Inheritance diagram for llvm::AMDGPUDisassembler:
[legend]

Public Member Functions

 AMDGPUDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx, MCInstrInfo const *MCII)
 ~AMDGPUDisassembler () override=default
void setABIVersion (unsigned Version) override
 ELF-specific, set the ABI version from the object header.
DecodeStatus getInstruction (MCInst &MI, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CS) const override
 Returns the disassembly of a single instruction.
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 createVGPR16Operand (unsigned RegIdx, bool IsHi) const
MCOperand errOperand (unsigned V, const Twine &ErrMsg) const
template<typename InsnType>
DecodeStatus tryDecodeInst (const uint8_t *Table, MCInst &MI, InsnType Inst, uint64_t Address, raw_ostream &Comments) const
template<typename InsnType>
DecodeStatus tryDecodeInst (const uint8_t *Table1, const uint8_t *Table2, MCInst &MI, InsnType Inst, uint64_t Address, raw_ostream &Comments) const
Expected< boolonSymbolStart (SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address) const override
 Used to perform separate target specific disassembly for a particular symbol.
Expected< booldecodeKernelDescriptor (StringRef KdName, ArrayRef< uint8_t > Bytes, uint64_t KdAddress) const
Expected< booldecodeKernelDescriptorDirective (DataExtractor::Cursor &Cursor, ArrayRef< uint8_t > Bytes, raw_string_ostream &KdStream) const
Expected< booldecodeCOMPUTE_PGM_RSRC1 (uint32_t FourByteBuffer, raw_string_ostream &KdStream) const
 Decode as directives that handle COMPUTE_PGM_RSRC1.
Expected< booldecodeCOMPUTE_PGM_RSRC2 (uint32_t FourByteBuffer, raw_string_ostream &KdStream) const
 Decode as directives that handle COMPUTE_PGM_RSRC2.
Expected< booldecodeCOMPUTE_PGM_RSRC3 (uint32_t FourByteBuffer, raw_string_ostream &KdStream) const
 Decode as directives that handle COMPUTE_PGM_RSRC3.
void convertEXPInst (MCInst &MI) const
void convertVINTERPInst (MCInst &MI) const
void convertFMAanyK (MCInst &MI) const
void convertSDWAInst (MCInst &MI) const
void convertMAIInst (MCInst &MI) const
 f8f6f4 instructions have different pseudos depending on the used formats.
void convertWMMAInst (MCInst &MI) const
void convertDPP8Inst (MCInst &MI) const
void convertMIMGInst (MCInst &MI) const
void convertVOP3DPPInst (MCInst &MI) const
void convertVOP3PDPPInst (MCInst &MI) const
void convertVOPCDPPInst (MCInst &MI) const
void convertVOPC64DPPInst (MCInst &MI) const
void convertMacDPPInst (MCInst &MI) const
void convertTrue16OpSel (MCInst &MI) const
unsigned getVgprClassId (unsigned Width) const
unsigned getAgprClassId (unsigned Width) const
unsigned getSgprClassId (unsigned Width) const
unsigned getTtmpClassId (unsigned Width) const
MCOperand decodeMandatoryLiteralConstant (unsigned Imm) const
MCOperand decodeMandatoryLiteral64Constant (uint64_t Imm) const
MCOperand decodeLiteralConstant (bool ExtendFP64) const
MCOperand decodeLiteral64Constant () const
MCOperand decodeSrcOp (unsigned Width, unsigned Val) const
MCOperand decodeNonVGPRSrcOp (unsigned Width, unsigned Val) const
MCOperand decodeVOPDDstYOp (MCInst &Inst, unsigned Val) const
MCOperand decodeSpecialReg32 (unsigned Val) const
MCOperand decodeSpecialReg64 (unsigned Val) const
MCOperand decodeSpecialReg96Plus (unsigned Val) const
MCOperand decodeSDWASrc (unsigned Width, unsigned Val) const
MCOperand decodeSDWASrc16 (unsigned Val) const
MCOperand decodeSDWASrc32 (unsigned Val) const
MCOperand decodeSDWAVopcDst (unsigned Val) const
MCOperand decodeBoolReg (unsigned Val) const
MCOperand decodeSplitBarrier (unsigned Val) const
MCOperand decodeDpp8FI (unsigned Val) const
MCOperand decodeVersionImm (unsigned Imm) const
int getTTmpIdx (unsigned Val) const
const MCInstrInfogetMCII () const
bool isVI () const
bool isGFX9 () const
bool isGFX90A () const
bool isGFX9Plus () const
bool isGFX10 () const
bool isGFX10Plus () const
bool isGFX11 () const
bool isGFX11Plus () const
bool isGFX12 () const
bool isGFX12Plus () const
bool isGFX1250 () const
bool hasArchitectedFlatScratch () const
bool hasKernargPreload () const
bool isMacDPP (MCInst &MI) const
bool isBufferInstruction (const MCInst &MI) const
 Check if the instruction is a buffer operation (MUBUF, MTBUF, or S_BUFFER)
Public Member Functions inherited from llvm::MCDisassembler
 MCDisassembler (const MCSubtargetInfo &STI, MCContext &Ctx)
virtual ~MCDisassembler ()
virtual DecodeStatus getInstructionBundle (MCInst &Instr, uint64_t &Size, ArrayRef< uint8_t > Bytes, uint64_t Address, raw_ostream &CStream) const
 Returns the disassembly of an instruction bundle for VLIW architectures like Hexagon.
virtual uint64_t suggestBytesToSkip (ArrayRef< uint8_t > Bytes, uint64_t Address) const
 Suggest a distance to skip in a buffer of data to find the next place to look for the start of an instruction.
bool tryAddingSymbolicOperand (MCInst &Inst, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t OpSize, 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.
MCContextgetContext () const
const MCSubtargetInfogetSubtargetInfo () const

Static Public Member Functions

static MCOperand decodeIntImmed (unsigned Imm)

Additional Inherited Members

Public Types inherited from llvm::MCDisassembler
enum  DecodeStatus { Fail = 0 , SoftFail = 1 , Success = 3 }
 Ternary decode status. More...
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.

Constructor & Destructor Documentation

◆ AMDGPUDisassembler()

◆ ~AMDGPUDisassembler()

llvm::AMDGPUDisassembler::~AMDGPUDisassembler ( )
overridedefault

References llvm::Address, MI, Size, and llvm::Version.

Member Function Documentation

◆ convertDPP8Inst()

void AMDGPUDisassembler::convertDPP8Inst ( MCInst & MI) const

◆ convertEXPInst()

void AMDGPUDisassembler::convertEXPInst ( MCInst & MI) const

◆ convertFMAanyK()

void AMDGPUDisassembler::convertFMAanyK ( MCInst & MI) const

Definition at line 1432 of file AMDGPUDisassembler.cpp.

References assert(), llvm::MCOperand::createImm(), insertNamedMCOperand(), and MI.

Referenced by getInstruction().

◆ convertMacDPPInst()

void AMDGPUDisassembler::convertMacDPPInst ( MCInst & MI) const

◆ convertMAIInst()

void AMDGPUDisassembler::convertMAIInst ( MCInst & MI) const

f8f6f4 instructions have different pseudos depending on the used formats.

In the disassembler table, we only have the variants with the largest register classes which assume using an fp8/bf8 format for both operands. The actual register class depends on the format in blgp and cbsz operands. Adjust the register classes depending on the used format.

Definition at line 990 of file AMDGPUDisassembler.cpp.

References adjustMFMA_F8F6F4OpRegClass(), llvm::AMDGPU::getMFMA_F8F6F4_WithFormatArgs(), MI, llvm::AMDGPU::MFMA_F8F6F4_Info::NumRegsSrcA, llvm::AMDGPU::MFMA_F8F6F4_Info::NumRegsSrcB, and llvm::AMDGPU::MFMA_F8F6F4_Info::Opcode.

Referenced by getInstruction().

◆ convertMIMGInst()

◆ convertSDWAInst()

void AMDGPUDisassembler::convertSDWAInst ( MCInst & MI) const

◆ convertTrue16OpSel()

◆ convertVINTERPInst()

void AMDGPUDisassembler::convertVINTERPInst ( MCInst & MI) const

◆ convertVOP3DPPInst()

void AMDGPUDisassembler::convertVOP3DPPInst ( MCInst & MI) const

◆ convertVOP3PDPPInst()

void AMDGPUDisassembler::convertVOP3PDPPInst ( MCInst & MI) const

◆ convertVOPC64DPPInst()

void AMDGPUDisassembler::convertVOPC64DPPInst ( MCInst & MI) const

◆ convertVOPCDPPInst()

void AMDGPUDisassembler::convertVOPCDPPInst ( MCInst & MI) const

◆ convertWMMAInst()

◆ createRegOperand() [1/2]

◆ createRegOperand() [2/2]

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

Definition at line 1458 of file AMDGPUDisassembler.cpp.

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

◆ createSRegOperand()

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

◆ createVGPR16Operand()

MCOperand AMDGPUDisassembler::createVGPR16Operand ( unsigned RegIdx,
bool IsHi ) const

Definition at line 1517 of file AMDGPUDisassembler.cpp.

References createRegOperand().

◆ decodeBoolReg()

MCOperand AMDGPUDisassembler::decodeBoolReg ( unsigned Val) const

Definition at line 2056 of file AMDGPUDisassembler.cpp.

References decodeSrcOp(), and llvm::MCDisassembler::STI.

◆ decodeCOMPUTE_PGM_RSRC1()

Expected< bool > AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1 ( uint32_t FourByteBuffer,
raw_string_ostream & KdStream ) const

Decode as directives that handle COMPUTE_PGM_RSRC1.

Parameters
FourByteBuffer- Bytes holding contents of COMPUTE_PGM_RSRC1.
KdStream- Stream to write the disassembled directives to.

Definition at line 2206 of file AMDGPUDisassembler.cpp.

References CHECK_RESERVED_BITS, CHECK_RESERVED_BITS_DESC, CHECK_RESERVED_BITS_DESC_MSG, CHECK_RESERVED_BITS_MSG, GET_FIELD, llvm::AMDGPU::IsaInfo::getSGPREncodingGranule(), llvm::AMDGPU::IsaInfo::getVGPREncodingGranule(), hasArchitectedFlatScratch(), isGFX10Plus(), isGFX1250(), isGFX12Plus(), isGFX9Plus(), PRINT_DIRECTIVE, PRINT_PSEUDO_DIRECTIVE_COMMENT, and llvm::MCDisassembler::STI.

Referenced by decodeKernelDescriptorDirective().

◆ decodeCOMPUTE_PGM_RSRC2()

Expected< bool > AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC2 ( uint32_t FourByteBuffer,
raw_string_ostream & KdStream ) const

Decode as directives that handle COMPUTE_PGM_RSRC2.

Parameters
FourByteBuffer- Bytes holding contents of COMPUTE_PGM_RSRC2.
KdStream- Stream to write the disassembled directives to.

Definition at line 2328 of file AMDGPUDisassembler.cpp.

References CHECK_RESERVED_BITS, CHECK_RESERVED_BITS_DESC, hasArchitectedFlatScratch(), and PRINT_DIRECTIVE.

Referenced by decodeKernelDescriptorDirective().

◆ decodeCOMPUTE_PGM_RSRC3()

Expected< bool > AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC3 ( uint32_t FourByteBuffer,
raw_string_ostream & KdStream ) const

Decode as directives that handle COMPUTE_PGM_RSRC3.

Parameters
FourByteBuffer- Bytes holding contents of COMPUTE_PGM_RSRC3.
KdStream- Stream to write the disassembled directives to.

Definition at line 2376 of file AMDGPUDisassembler.cpp.

References CHECK_RESERVED_BITS_DESC_MSG, llvm::createStringError(), GET_FIELD, isGFX10Plus(), isGFX11(), isGFX11Plus(), isGFX1250(), isGFX12Plus(), isGFX90A(), PRINT_DIRECTIVE, and PRINT_PSEUDO_DIRECTIVE_COMMENT.

Referenced by decodeKernelDescriptorDirective().

◆ decodeDpp8FI()

MCOperand AMDGPUDisassembler::decodeDpp8FI ( unsigned Val) const

◆ decodeIntImmed()

MCOperand AMDGPUDisassembler::decodeIntImmed ( unsigned Imm)
static

Definition at line 1580 of file AMDGPUDisassembler.cpp.

References assert(), and llvm::MCOperand::createImm().

◆ decodeKernelDescriptor()

◆ decodeKernelDescriptorDirective()

◆ decodeLiteral64Constant()

MCOperand AMDGPUDisassembler::decodeLiteral64Constant ( ) const

◆ decodeLiteralConstant()

MCOperand AMDGPUDisassembler::decodeLiteralConstant ( bool ExtendFP64) const

Definition at line 1549 of file AMDGPUDisassembler.cpp.

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

◆ decodeMandatoryLiteral64Constant()

MCOperand AMDGPUDisassembler::decodeMandatoryLiteral64Constant ( uint64_t Imm) const

Definition at line 1539 of file AMDGPUDisassembler.cpp.

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

◆ decodeMandatoryLiteralConstant()

MCOperand AMDGPUDisassembler::decodeMandatoryLiteralConstant ( unsigned Imm) const

◆ decodeNonVGPRSrcOp()

◆ decodeSDWASrc()

◆ decodeSDWASrc16()

MCOperand AMDGPUDisassembler::decodeSDWASrc16 ( unsigned Val) const

Definition at line 2023 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc().

◆ decodeSDWASrc32()

MCOperand AMDGPUDisassembler::decodeSDWASrc32 ( unsigned Val) const

Definition at line 2027 of file AMDGPUDisassembler.cpp.

References decodeSDWASrc().

◆ decodeSDWAVopcDst()

◆ decodeSpecialReg32()

MCOperand AMDGPUDisassembler::decodeSpecialReg32 ( unsigned Val) const

◆ decodeSpecialReg64()

MCOperand AMDGPUDisassembler::decodeSpecialReg64 ( unsigned Val) const

Definition at line 1934 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeNonVGPRSrcOp(), and decodeSDWAVopcDst().

◆ decodeSpecialReg96Plus()

MCOperand AMDGPUDisassembler::decodeSpecialReg96Plus ( unsigned Val) const

Definition at line 1966 of file AMDGPUDisassembler.cpp.

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

Referenced by decodeNonVGPRSrcOp().

◆ decodeSplitBarrier()

MCOperand AMDGPUDisassembler::decodeSplitBarrier ( unsigned Val) const

Definition at line 2061 of file AMDGPUDisassembler.cpp.

References decodeSrcOp().

◆ decodeSrcOp()

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

◆ decodeVersionImm()

◆ decodeVOPDDstYOp()

◆ errOperand()

◆ getAgprClassId()

unsigned AMDGPUDisassembler::getAgprClassId ( unsigned Width) const

Definition at line 1725 of file AMDGPUDisassembler.cpp.

References llvm_unreachable.

Referenced by decodeSrcOp().

◆ getInstruction()

DecodeStatus AMDGPUDisassembler::getInstruction ( MCInst & Instr,
uint64_t & Size,
ArrayRef< uint8_t > Bytes,
uint64_t Address,
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.
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 550 of file AMDGPUDisassembler.cpp.

References llvm::Address, convertDPP8Inst(), convertEXPInst(), convertFMAanyK(), convertMacDPPInst(), convertMAIInst(), convertMIMGInst(), convertSDWAInst(), convertTrue16OpSel(), convertVINTERPInst(), convertVOP3DPPInst(), convertVOP3PDPPInst(), convertVOPC64DPPInst(), convertVOPCDPPInst(), convertWMMAInst(), llvm::MCOperand::createImm(), llvm::MCOperand::createReg(), createRegOperand(), llvm::SIInstrFlags::DPP, llvm::SIInstrFlags::DS, eat12Bytes(), eat16Bytes(), eatBytes(), llvm::SIInstrFlags::EXP, llvm::MCDisassembler::Fail, llvm::SIInstrFlags::FLAT, llvm::AMDGPU::CPol::GLC, llvm::AMDGPU::hasGDS(), llvm::AMDGPU::hasNamedOperand(), insertNamedMCOperand(), llvm::SIInstrFlags::IsAtomicRet, isBufferInstruction(), isGFX10(), isGFX11(), isGFX11Plus(), isGFX12(), isGFX1250(), isGFX12Plus(), isGFX9(), llvm::AMDGPU::isMAC(), isMacDPP(), llvm::SIInstrFlags::IsMAI, isVI(), llvm::AMDGPU::isVOPC64DPP(), llvm::SIInstrFlags::IsWMMA, MI, llvm::SIInstrFlags::MIMG, llvm::SIInstrFlags::MTBUF, llvm::SIInstrFlags::MUBUF, llvm::SIInstrFlags::SDWA, llvm::SignExtend64(), Size, llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), llvm::SIInstrFlags::SMRD, llvm::MCDisassembler::SoftFail, llvm::SIInstrFlags::SOPK, llvm::MCDisassembler::STI, llvm::MCDisassembler::Success, llvm::MCOI::TIED_TO, tryDecodeInst(), llvm::SIInstrFlags::VIMAGE, llvm::SIInstrFlags::VINTERP, llvm::SIInstrFlags::VOP3, llvm::SIInstrFlags::VOP3P, llvm::SIInstrFlags::VOPC, and llvm::SIInstrFlags::VSAMPLE.

◆ getMCII()

const MCInstrInfo * llvm::AMDGPUDisassembler::getMCII ( ) const
inline

Definition at line 170 of file AMDGPUDisassembler.h.

References llvm::MCInstrInfo::get().

◆ getRegClassName()

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

◆ getSgprClassId()

unsigned AMDGPUDisassembler::getSgprClassId ( unsigned Width) const

Definition at line 1758 of file AMDGPUDisassembler.cpp.

References llvm_unreachable.

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

◆ getTtmpClassId()

unsigned AMDGPUDisassembler::getTtmpClassId ( unsigned Width) const

Definition at line 1789 of file AMDGPUDisassembler.cpp.

References llvm_unreachable.

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

◆ getTTmpIdx()

int AMDGPUDisassembler::getTTmpIdx ( unsigned Val) const

Definition at line 1816 of file AMDGPUDisassembler.cpp.

References isGFX9Plus().

Referenced by decodeNonVGPRSrcOp(), and decodeSDWAVopcDst().

◆ getVgprClassId()

unsigned AMDGPUDisassembler::getVgprClassId ( unsigned Width) const

Definition at line 1690 of file AMDGPUDisassembler.cpp.

References llvm_unreachable.

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

◆ hasArchitectedFlatScratch()

bool AMDGPUDisassembler::hasArchitectedFlatScratch ( ) const

◆ hasKernargPreload()

bool AMDGPUDisassembler::hasKernargPreload ( ) const

◆ isBufferInstruction()

bool AMDGPUDisassembler::isBufferInstruction ( const MCInst & MI) const

Check if the instruction is a buffer operation (MUBUF, MTBUF, or S_BUFFER)

Definition at line 2742 of file AMDGPUDisassembler.cpp.

References llvm::AMDGPU::getSMEMIsBuffer(), MI, llvm::SIInstrFlags::MTBUF, llvm::SIInstrFlags::MUBUF, and llvm::SIInstrFlags::SMRD.

Referenced by getInstruction().

◆ isGFX10()

bool AMDGPUDisassembler::isGFX10 ( ) const

Definition at line 2118 of file AMDGPUDisassembler.cpp.

References llvm::AMDGPU::isGFX10(), and llvm::MCDisassembler::STI.

Referenced by getInstruction().

◆ isGFX10Plus()

◆ isGFX11()

bool AMDGPUDisassembler::isGFX11 ( ) const

Definition at line 2124 of file AMDGPUDisassembler.cpp.

References llvm::MCDisassembler::STI.

Referenced by decodeCOMPUTE_PGM_RSRC3(), and getInstruction().

◆ isGFX11Plus()

◆ isGFX12()

bool AMDGPUDisassembler::isGFX12 ( ) const

Definition at line 2132 of file AMDGPUDisassembler.cpp.

References llvm::MCDisassembler::STI.

Referenced by getInstruction().

◆ isGFX1250()

bool AMDGPUDisassembler::isGFX1250 ( ) const

◆ isGFX12Plus()

bool AMDGPUDisassembler::isGFX12Plus ( ) const

◆ isGFX9()

bool AMDGPUDisassembler::isGFX9 ( ) const

◆ isGFX90A()

bool AMDGPUDisassembler::isGFX90A ( ) const

Definition at line 2112 of file AMDGPUDisassembler.cpp.

References llvm::MCDisassembler::STI.

Referenced by decodeCOMPUTE_PGM_RSRC3().

◆ isGFX9Plus()

bool AMDGPUDisassembler::isGFX9Plus ( ) const

◆ isMacDPP()

bool AMDGPUDisassembler::isMacDPP ( MCInst & MI) const

Definition at line 1122 of file AMDGPUDisassembler.cpp.

References assert(), llvm::AMDGPU::hasNamedOperand(), MI, and llvm::MCOI::TIED_TO.

Referenced by getInstruction().

◆ isVI()

bool AMDGPUDisassembler::isVI ( ) const

Definition at line 2106 of file AMDGPUDisassembler.cpp.

References llvm::MCDisassembler::STI.

Referenced by getInstruction().

◆ onSymbolStart()

Expected< bool > AMDGPUDisassembler::onSymbolStart ( SymbolInfoTy & Symbol,
uint64_t & Size,
ArrayRef< uint8_t > Bytes,
uint64_t Address ) const
overridevirtual

Used to perform separate target specific disassembly for a particular symbol.

May parse any prelude that precedes instructions after the start of a symbol, or the entire symbol. This is used for example by WebAssembly to decode preludes.

Base implementation returns false. So all targets by default decline to treat symbols separately.

Parameters
Symbol- The symbol.
Size- The number of bytes consumed.
Address- The address, in the memory space of region, of the first byte of the symbol.
Bytes- A reference to the actual bytes at the symbol location.
Returns
- True if this symbol triggered some target specific disassembly for this symbol. Size must be set with the number of bytes consumed.
  • Error if this symbol triggered some target specific disassembly for this symbol, but an error was found with it. Size must be set with the number of bytes consumed.
  • False if the target doesn't want to handle the symbol separately. The value of Size is ignored in this case, and Err must not be set.

Reimplemented from llvm::MCDisassembler.

Definition at line 2698 of file AMDGPUDisassembler.cpp.

References llvm::Address, llvm::createStringError(), decodeKernelDescriptor(), Size, llvm::ELF::STT_AMDGPU_HSA_KERNEL, and llvm::ELF::STT_OBJECT.

◆ setABIVersion()

void AMDGPUDisassembler::setABIVersion ( unsigned Version)
overridevirtual

ELF-specific, set the ABI version from the object header.

Reimplemented from llvm::MCDisassembler.

Definition at line 73 of file AMDGPUDisassembler.cpp.

References llvm::AMDGPU::getAMDHSACodeObjectVersion(), and llvm::Version.

◆ tryDecodeInst() [1/2]

template<typename InsnType>
DecodeStatus AMDGPUDisassembler::tryDecodeInst ( const uint8_t * Table,
MCInst & MI,
InsnType Inst,
uint64_t Address,
raw_ostream & Comments ) const

◆ tryDecodeInst() [2/2]

template<typename InsnType>
DecodeStatus AMDGPUDisassembler::tryDecodeInst ( const uint8_t * Table1,
const uint8_t * Table2,
MCInst & MI,
InsnType Inst,
uint64_t Address,
raw_ostream & Comments ) const

Definition at line 450 of file AMDGPUDisassembler.cpp.

References llvm::Address, llvm::MCDisassembler::Fail, MI, T, and tryDecodeInst().


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