LLVM: llvm::AMDGPUDisassembler Class Reference (original) (raw)
#include "[Target/AMDGPU/Disassembler/AMDGPUDisassembler.h](AMDGPUDisassembler%5F8h%5Fsource.html)"
| 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_ostream * | CommentStream = nullptr |
| Protected Attributes inherited from llvm::MCDisassembler | |
| const MCSubtargetInfo & | STI |
| std::unique_ptr< MCSymbolizer > | Symbolizer |
Definition at line 39 of file AMDGPUDisassembler.h.
◆ ~AMDGPUDisassembler()
| llvm::AMDGPUDisassembler::~AMDGPUDisassembler ( ) | overridedefault |
|---|
◆ convertDPP8Inst()
| void AMDGPUDisassembler::convertDPP8Inst | ( | MCInst & | MI | ) | const |
|---|
◆ convertEXPInst()
| void AMDGPUDisassembler::convertEXPInst | ( | MCInst & | MI | ) | const |
|---|
◆ convertFMAanyK()
| void AMDGPUDisassembler::convertFMAanyK | ( | MCInst & | MI | ) | const |
|---|
◆ convertMacDPPInst()
| void AMDGPUDisassembler::convertMacDPPInst | ( | MCInst & | MI | ) | const |
|---|
◆ convertMAIInst()
| void AMDGPUDisassembler::convertMAIInst | ( | MCInst & | MI | ) | const |
|---|
◆ convertMIMGInst()
| void AMDGPUDisassembler::convertMIMGInst | ( | MCInst & | MI | ) | const |
|---|
Definition at line 1223 of file AMDGPUDisassembler.cpp.
References llvm::AMDGPU::MIMGBaseOpcodeInfo::A16, addOperand(), assert(), llvm::AMDGPU::MIMGBaseOpcodeInfo::BVH, CheckVGPROverflow(), llvm::MCOperand::createImm(), llvm::MCOperand::createReg(), llvm::SIInstrFlags::Gather4, llvm::AMDGPU::getAddrSizeMIMGOp(), llvm::getImm(), llvm::AMDGPU::getMIMGBaseOpcodeInfo(), llvm::AMDGPU::getMIMGDimInfoByEncoding(), llvm::AMDGPU::getMIMGInfo(), llvm::AMDGPU::getMIMGOpcode(), llvm::AMDGPU::hasG16(), llvm::AMDGPU::hasPackedD16(), isGFX10Plus(), MI, llvm::SIInstrFlags::MIMG, llvm::popcount(), llvm::MCDisassembler::STI, and llvm::SIInstrFlags::VSAMPLE.
Referenced by getInstruction().
◆ convertSDWAInst()
| void AMDGPUDisassembler::convertSDWAInst | ( | MCInst & | MI | ) | const |
|---|
◆ convertTrue16OpSel()
| void AMDGPUDisassembler::convertTrue16OpSel | ( | MCInst & | MI | ) | const |
|---|
Definition at line 1091 of file AMDGPUDisassembler.cpp.
References llvm::MCRegisterClass::contains(), llvm::SISrcMods::DST_OP_SEL, llvm::MCOperand::getImm(), llvm::MCRegisterClass::getRegister(), MI, llvm::SISrcMods::OP_SEL_0, Opc, OpIdx, and llvm::AMDGPU::HWEncoding::REG_IDX_MASK.
Referenced by convertDPP8Inst(), convertVINTERPInst(), convertVOP3DPPInst(), convertVOPC64DPPInst(), and getInstruction().
◆ 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()
| void AMDGPUDisassembler::convertWMMAInst | ( | MCInst & | MI | ) | const |
|---|
◆ createRegOperand() [1/2]
Definition at line 1459 of file AMDGPUDisassembler.cpp.
References llvm::MCOperand::createReg(), llvm::AMDGPU::getMCReg(), and llvm::MCDisassembler::STI.
Referenced by convertSDWAInst(), createRegOperand(), createSRegOperand(), createVGPR16Operand(), decodeSDWASrc(), decodeSDWAVopcDst(), decodeSpecialReg32(), decodeSpecialReg64(), decodeSpecialReg96Plus(), decodeSrcOp(), decodeVOPDDstYOp(), and getInstruction().
◆ createRegOperand() [2/2]
◆ createSRegOperand()
◆ createVGPR16Operand()
◆ decodeBoolReg()
◆ decodeCOMPUTE_PGM_RSRC1()
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 2292 of file AMDGPUDisassembler.cpp.
References assert(), 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()
◆ decodeCOMPUTE_PGM_RSRC3()
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 2465 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()
◆ decodeIntImmed()
◆ decodeKernelDescriptor()
Definition at line 2747 of file AMDGPUDisassembler.cpp.
References AMDHSA_BITS_GET, llvm::CallingConv::C, llvm::cantFail(), llvm::createStringError(), decodeKernelDescriptorDirective(), isGFX10Plus(), llvm::amdhsa::KERNEL_CODE_PROPERTIES_OFFSET, llvm::little, llvm::outs(), llvm::support::endian::read16(), and llvm::raw_string_ostream::str().
Referenced by onSymbolStart().
◆ decodeKernelDescriptorDirective()
Definition at line 2595 of file AMDGPUDisassembler.cpp.
References llvm::AMDGPU::AMDHSA_COV5, assert(), llvm::amdhsa::COMPUTE_PGM_RSRC1_OFFSET, llvm::amdhsa::COMPUTE_PGM_RSRC2_OFFSET, llvm::amdhsa::COMPUTE_PGM_RSRC3_OFFSET, createReservedKDBitsError(), createReservedKDBytesError(), decodeCOMPUTE_PGM_RSRC1(), decodeCOMPUTE_PGM_RSRC2(), decodeCOMPUTE_PGM_RSRC3(), llvm::DataExtractor::getBytes(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::amdhsa::GROUP_SEGMENT_FIXED_SIZE_OFFSET, hasArchitectedFlatScratch(), I, isGFX10Plus(), isGFX9(), llvm::amdhsa::KERNARG_PRELOAD_OFFSET, llvm::amdhsa::KERNARG_SIZE_OFFSET, llvm::amdhsa::KERNEL_CODE_ENTRY_BYTE_OFFSET_OFFSET, llvm::amdhsa::KERNEL_CODE_PROPERTIES_OFFSET, llvm_unreachable, PRINT_DIRECTIVE, llvm::amdhsa::PRIVATE_SEGMENT_FIXED_SIZE_OFFSET, llvm::amdhsa::RESERVED0_OFFSET, llvm::amdhsa::RESERVED1_OFFSET, llvm::amdhsa::RESERVED3_OFFSET, and llvm::DataExtractor::skip().
Referenced by decodeKernelDescriptor().
◆ decodeLiteral64Constant()
| MCOperand AMDGPUDisassembler::decodeLiteral64Constant | ( | ) | const |
|---|
◆ decodeLiteralConstant()
Definition at line 1560 of file AMDGPUDisassembler.cpp.
References llvm::MCOperand::createExpr(), llvm::MCOperand::createImm(), llvm::AMDGPUMCExpr::createLit(), eatBytes(), errOperand(), llvm::MCDisassembler::getContext(), llvm::AMDGPU::isInlinableLiteral32(), llvm::AMDGPU::isInlinableLiteral64(), llvm::AMDGPU::isInlinableLiteralBF16(), llvm::AMDGPU::isInlinableLiteralFP16(), llvm::AMDGPU::isInlinableLiteralI16(), llvm::AMDGPU::isInlinableLiteralV2BF16(), llvm::AMDGPU::isInlinableLiteralV2F16(), llvm::AMDGPU::isInlinableLiteralV2I16(), llvm::Lit, llvm_unreachable, llvm::AMDGPU::OPERAND_KIMM32, llvm::AMDGPU::OPERAND_REG_IMM_BF16, llvm::AMDGPU::OPERAND_REG_IMM_FP16, llvm::AMDGPU::OPERAND_REG_IMM_FP32, llvm::AMDGPU::OPERAND_REG_IMM_FP64, llvm::AMDGPU::OPERAND_REG_IMM_INT16, llvm::AMDGPU::OPERAND_REG_IMM_INT32, llvm::AMDGPU::OPERAND_REG_IMM_INT64, llvm::AMDGPU::OPERAND_REG_IMM_NOINLINE_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2BF16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP16, llvm::AMDGPU::OPERAND_REG_IMM_V2FP32, llvm::AMDGPU::OPERAND_REG_IMM_V2INT16, llvm::AMDGPU::OPERAND_REG_IMM_V2INT32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_AC_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_AC_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_C_BF16, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP16, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP32, llvm::AMDGPU::OPERAND_REG_INLINE_C_FP64, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT16, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT32, llvm::AMDGPU::OPERAND_REG_INLINE_C_INT64, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2BF16, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2FP16, llvm::AMDGPU::OPERAND_REG_INLINE_C_V2INT16, llvm::MCOI::OPERAND_REGISTER, and llvm::MCOperandInfo::OperandType.
◆ decodeMandatoryLiteral64Constant()
◆ decodeMandatoryLiteralConstant()
◆ decodeNonVGPRSrcOp()
Definition at line 1922 of file AMDGPUDisassembler.cpp.
References assert(), llvm::MCOperand::createImm(), createSRegOperand(), decodeLiteral64Constant(), decodeSpecialReg32(), decodeSpecialReg64(), decodeSpecialReg96Plus(), getSgprClassId(), getTtmpClassId(), getTTmpIdx(), llvm_unreachable, SGPR_MAX, and llvm::MCDisassembler::STI.
Referenced by decodeSrcOp().
◆ decodeSDWASrc()
Definition at line 2067 of file AMDGPUDisassembler.cpp.
References llvm::MCOperand::createImm(), createRegOperand(), createSRegOperand(), decodeSpecialReg32(), getSgprClassId(), getTtmpClassId(), getVgprClassId(), isGFX10Plus(), llvm_unreachable, and llvm::MCDisassembler::STI.
Referenced by decodeSDWASrc16(), and decodeSDWASrc32().
◆ decodeSDWASrc16()
◆ decodeSDWASrc32()
◆ decodeSDWAVopcDst()
◆ decodeSpecialReg32()
◆ decodeSpecialReg64()
◆ decodeSpecialReg96Plus()
◆ decodeSplitBarrier()
◆ decodeSrcOp()
◆ decodeVersionImm()
◆ decodeVOPDDstYOp()
◆ errOperand()
◆ getAgprClassId()
◆ getInstruction()
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 552 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()
◆ getRegClassName()
◆ getSgprClassId()
◆ getTtmpClassId()
◆ getTTmpIdx()
| int AMDGPUDisassembler::getTTmpIdx | ( | unsigned | Val | ) | const |
|---|
◆ getVgprClassId()
◆ hasArchitectedFlatScratch()
| bool AMDGPUDisassembler::hasArchitectedFlatScratch | ( | ) | const |
|---|
◆ hasKernargPreload()
| bool AMDGPUDisassembler::hasKernargPreload | ( | ) | const |
|---|
◆ isBufferInstruction()
◆ isGFX10()
| bool AMDGPUDisassembler::isGFX10 | ( | ) | const |
|---|
◆ isGFX10Plus()
| bool AMDGPUDisassembler::isGFX10Plus | ( | ) | const |
|---|
◆ isGFX11()
| bool AMDGPUDisassembler::isGFX11 | ( | ) | const |
|---|
◆ isGFX11Plus()
| bool AMDGPUDisassembler::isGFX11Plus | ( | ) | const |
|---|
◆ isGFX12()
| bool AMDGPUDisassembler::isGFX12 | ( | ) | const |
|---|
◆ isGFX1250()
| bool AMDGPUDisassembler::isGFX1250 | ( | ) | const |
|---|
◆ isGFX12Plus()
| bool AMDGPUDisassembler::isGFX12Plus | ( | ) | const |
|---|
◆ isGFX9()
| bool AMDGPUDisassembler::isGFX9 | ( | ) | const |
|---|
◆ isGFX90A()
| bool AMDGPUDisassembler::isGFX90A | ( | ) | const |
|---|
◆ isGFX9Plus()
| bool AMDGPUDisassembler::isGFX9Plus | ( | ) | const |
|---|
◆ isMacDPP()
| bool AMDGPUDisassembler::isMacDPP | ( | MCInst & | MI | ) | const |
|---|
◆ isVI()
| bool AMDGPUDisassembler::isVI | ( | ) | const |
|---|
◆ onSymbolStart()
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 2787 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 |
|---|
◆ tryDecodeInst() [1/2]
◆ tryDecodeInst() [2/2]
The documentation for this class was generated from the following files:
- lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
- lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp