|
LLVM 23.0.0git
|
This file contains definition for AMDGPU ISA disassembler. More...
#include "Disassembler/AMDGPUDisassembler.h"#include "MCTargetDesc/AMDGPUMCExpr.h"#include "MCTargetDesc/AMDGPUMCTargetDesc.h"#include "SIDefines.h"#include "SIRegisterInfo.h"#include "TargetInfo/AMDGPUTargetInfo.h"#include "Utils/AMDGPUAsmUtils.h"#include "Utils/AMDGPUBaseInfo.h"#include "llvm-c/DisassemblerTypes.h"#include "llvm/BinaryFormat/ELF.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCContext.h"#include "llvm/MC/MCDecoder.h"#include "llvm/MC/MCDecoderOps.h"#include "llvm/MC/MCExpr.h"#include "llvm/MC/MCInstrDesc.h"#include "llvm/MC/MCRegisterInfo.h"#include "llvm/MC/MCSubtargetInfo.h"#include "llvm/MC/TargetRegistry.h"#include "llvm/Support/AMDHSAKernelDescriptor.h"#include "llvm/Support/Compiler.h"#include "AMDGPUGenDisassemblerTables.inc"Go to the source code of this file.
Classes | |
| struct | VOPModifiers |
Macros | |
| #define | DEBUG_TYPE "amdgpu-disassembler" |
| #define | SGPR_MAX |
| #define | X(NUM, ENUM, NAME) |
| #define | DECODE_OPERAND(StaticDecoderName, DecoderName) |
| #define | DECODE_OPERAND_REG_8(RegClass) |
| #define | DECODE_SrcOp(Name, EncSize, OpWidth, EncImm) |
| #define | DECODE_OPERAND_SREG_7(RegClass, OpWidth) |
| #define | DECODE_OPERAND_SREG_8(RegClass, OpWidth) |
| #define | DECODE_SDWA(DecName) |
| #define | GET_FIELD(MASK) |
| #define | PRINT_DIRECTIVE(DIRECTIVE, MASK) |
| #define | PRINT_PSEUDO_DIRECTIVE_COMMENT(DIRECTIVE, MASK) |
| #define | CHECK_RESERVED_BITS_IMPL(MASK, DESC, MSG) |
| #define | CHECK_RESERVED_BITS(MASK) |
| #define | CHECK_RESERVED_BITS_MSG(MASK, MSG) |
| #define | CHECK_RESERVED_BITS_DESC(MASK, DESC) |
| #define | CHECK_RESERVED_BITS_DESC_MSG(MASK, DESC, MSG) |
| #define | PRINT_DIRECTIVE(DIRECTIVE, MASK) |
Typedefs | |
| using | DecodeStatus = llvm::MCDisassembler::DecodeStatus |
This file contains definition for AMDGPU ISA disassembler.
Definition in file AMDGPUDisassembler.cpp.
| #define CHECK_RESERVED_BITS | ( | MASK | ) |
Definition at line 2418 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), and llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC2().
| #define CHECK_RESERVED_BITS_DESC | ( | MASK, | |
| DESC ) |
Definition at line 2421 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), and llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC2().
| #define CHECK_RESERVED_BITS_DESC_MSG | ( | MASK, | |
| DESC, | |||
| MSG ) |
Definition at line 2423 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), and llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC3().
| #define CHECK_RESERVED_BITS_IMPL | ( | MASK, | |
| DESC, | |||
| MSG ) |
Definition at line 2408 of file AMDGPUDisassembler.cpp.
| #define CHECK_RESERVED_BITS_MSG | ( | MASK, | |
| MSG ) |
Definition at line 2419 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1().
| #define DEBUG_TYPE "amdgpu-disassembler" |
Definition at line 44 of file AMDGPUDisassembler.cpp.
| #define DECODE_OPERAND | ( | StaticDecoderName, | |
| DecoderName ) |
Definition at line 198 of file AMDGPUDisassembler.cpp.
| #define DECODE_OPERAND_REG_8 | ( | RegClass | ) |
Definition at line 208 of file AMDGPUDisassembler.cpp.
| #define DECODE_OPERAND_SREG_7 | ( | RegClass, | |
| OpWidth ) |
Definition at line 236 of file AMDGPUDisassembler.cpp.
| #define DECODE_OPERAND_SREG_8 | ( | RegClass, | |
| OpWidth ) |
Definition at line 239 of file AMDGPUDisassembler.cpp.
| #define DECODE_SDWA | ( | DecName | ) |
Definition at line 448 of file AMDGPUDisassembler.cpp.
| #define DECODE_SrcOp | ( | Name, | |
| EncSize, | |||
| OpWidth, | |||
| EncImm ) |
Definition at line 218 of file AMDGPUDisassembler.cpp.
| #define GET_FIELD | ( | MASK | ) |
Definition at line 2397 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), and llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC3().
| #define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
| MASK ) |
Definition at line 2398 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC2(), llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC3(), and llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective().
| #define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
| MASK ) |
Definition at line 2398 of file AMDGPUDisassembler.cpp.
| #define PRINT_PSEUDO_DIRECTIVE_COMMENT | ( | DIRECTIVE, | |
| MASK ) |
Definition at line 2402 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(), and llvm::AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC3().
| #define SGPR_MAX |
Definition at line 46 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::decodeNonVGPRSrcOp(), and llvm::AMDGPUDisassembler::decodeSDWAVopcDst().
| #define X | ( | NUM, | |
| ENUM, | |||
| NAME ) |
Definition at line 50 of file AMDGPUDisassembler.cpp.
|
inlinestatic |
Definition at line 134 of file AMDGPUDisassembler.cpp.
References llvm::MCInst::addOperand(), llvm::MCDisassembler::Fail, llvm::MCOperand::isValid(), and llvm::MCDisassembler::Success.
Referenced by llvm::AMDGPUDisassembler::convertMIMGInst(), decodeAVLdSt(), decodeBoolReg(), decodeDpp8FI(), decodeOperand_KImmFP(), decodeOperand_KImmFP64(), decodeOperand_VGPR_16(), decodeOperand_VSrc_f64(), decodeOperand_VSrcT16(), decodeOperand_VSrcT16_Lo128(), decodeOperandVOPDDstY(), decodeSMEMOffset(), decodeSOPPBrTarget(), decodeSplitBarrier(), decodeSrcOp(), decodeVersionImm(), DecodeVGPR_16_Lo128RegisterClass(), DecodeVGPR_16RegisterClass(), llvm::LoongArchAsmPrinter::LowerSTATEPOINT(), llvm::VPScalarIVStepsRecipe::setStartIndex(), llvm::VPFirstOrderRecurrencePHIRecipe::VPFirstOrderRecurrencePHIRecipe(), llvm::VPInterleaveBase::VPInterleaveBase(), llvm::VPReductionPHIRecipe::VPReductionPHIRecipe(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPUser::VPUser(), llvm::VPWidenInductionRecipe::VPWidenInductionRecipe(), llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe(), llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe(), and llvm::VPWidenPointerInductionRecipe::VPWidenPointerInductionRecipe().
|
static |
Adjust the register values used by V_MFMA_F8F6F4_f8_f8 instructions to the appropriate subregister for the used format width.
Definition at line 1069 of file AMDGPUDisassembler.cpp.
References llvm::MCRegisterInfo::getMatchingSuperReg(), llvm::MCOperand::getReg(), llvm::MCRegisterInfo::getRegClass(), llvm::MCRegisterInfo::getSubReg(), llvm_unreachable, and llvm::MCOperand::setReg().
Referenced by llvm::AMDGPUDisassembler::convertMAIInst(), and llvm::AMDGPUDisassembler::convertWMMAInst().
|
static |
Definition at line 1311 of file AMDGPUDisassembler.cpp.
References assert(), llvm::MCRegisterClass::contains(), llvm::MCRegisterInfo::getRegClass(), llvm::MCRegisterClass::getSizeInBits(), llvm::MCRegisterInfo::getSubReg(), and Reg.
Referenced by llvm::AMDGPUDisassembler::convertMIMGInst().
|
static |
Definition at line 1171 of file AMDGPUDisassembler.cpp.
References llvm::SISrcMods::DST_OP_SEL, MI, llvm::SISrcMods::NEG, llvm::SISrcMods::NEG_HI, VOPModifiers::NegHi, VOPModifiers::NegLo, llvm::SISrcMods::OP_SEL_0, llvm::SISrcMods::OP_SEL_1, Opc, OpIdx, VOPModifiers::OpSel, and VOPModifiers::OpSelHi.
Referenced by llvm::AMDGPUDisassembler::convertDPP8Inst(), llvm::AMDGPUDisassembler::convertVOP3DPPInst(), llvm::AMDGPUDisassembler::convertVOP3PDPPInst(), and llvm::AMDGPUDisassembler::convertVOPC64DPPInst().
|
static |
Definition at line 3032 of file AMDGPUDisassembler.cpp.
References T.
Referenced by LLVMInitializeAMDGPUDisassembler().
|
static |
Definition at line 3023 of file AMDGPUDisassembler.cpp.
Referenced by LLVMInitializeAMDGPUDisassembler().
Create an error object to return from onSymbolStart for reserved kernel descriptor bits being set.
Definition at line 2711 of file AMDGPUDisassembler.cpp.
References llvm::c_str(), llvm::createStringError(), and getBitRangeFromMask().
Referenced by llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective().
Create an error object to return from onSymbolStart for reserved kernel descriptor bytes being set.
Definition at line 2720 of file AMDGPUDisassembler.cpp.
References llvm::createStringError().
Referenced by llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective().
|
static |
Definition at line 247 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 434 of file AMDGPUDisassembler.cpp.
References decodeAVLdSt().
|
static |
Definition at line 427 of file AMDGPUDisassembler.cpp.
References addOperand().
Referenced by decodeAVLdSt().
|
static |
Definition at line 179 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 192 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 407 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 414 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 394 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), llvm::AMDGPU::EncValues::IS_VGPR, and llvm::isUInt().
|
static |
Definition at line 440 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
static |
Definition at line 380 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), llvm::AMDGPU::EncValues::IS_VGPR, and llvm::isUInt().
|
static |
Definition at line 365 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), llvm::AMDGPU::EncValues::IS_VGPR, and llvm::isUInt().
|
static |
Definition at line 421 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 165 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::MCOperand::createImm(), llvm::Offset, and llvm::SignExtend64().
|
static |
Definition at line 152 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::MCOperand::createImm(), llvm::Offset, llvm::SignExtend64(), and llvm::MCDisassembler::Success.
|
static |
Definition at line 185 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 265 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 273 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 226 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
Referenced by decodeAV10(), decodeSrcA9(), decodeSrcAV10(), decodeSrcReg9(), decodeSrcRegOrImm9(), and decodeSrcRegOrImmA9().
|
static |
Definition at line 255 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 285 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 294 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 455 of file AMDGPUDisassembler.cpp.
References addOperand(), const, and decodeVersionImm().
Referenced by decodeVersionImm().
|
static |
Definition at line 354 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::isUInt().
|
static |
Definition at line 341 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), const, DecodeVGPR_16RegisterClass(), and llvm::isUInt().
Referenced by DecodeVGPR_16RegisterClass().
Definition at line 524 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::Hi, llvm::Lo, llvm::support::endian::read(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
Referenced by llvm::AMDGPUDisassembler::getInstruction().
Definition at line 534 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::Hi, llvm::Lo, llvm::support::endian::read(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
Referenced by llvm::AMDGPUDisassembler::getInstruction().
Definition at line 516 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::support::endian::read(), llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), and T.
Referenced by llvm::AMDGPUDisassembler::decodeLiteral64Constant(), llvm::AMDGPUDisassembler::decodeLiteralConstant(), and llvm::AMDGPUDisassembler::getInstruction().
|
static |
Print a string describing the reserved bit range specified by Mask with offset BaseBytes for use in error comments.
Mask is a single continuous range of 1s surrounded by zeros. The format here is meant to align with the tables that describe these bits in llvm.org/docs/AMDGPUUsage.html.
Definition at line 2379 of file AMDGPUDisassembler.cpp.
References llvm::countr_zero(), and llvm::popcount().
Referenced by createReservedKDBitsError().
|
static |
Definition at line 1792 of file AMDGPUDisassembler.cpp.
References llvm::bit_cast(), and llvm_unreachable.
|
static |
Definition at line 1817 of file AMDGPUDisassembler.cpp.
References llvm::bit_cast(), and llvm_unreachable.
|
static |
Definition at line 1867 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
|
static |
Definition at line 1842 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Definition at line 141 of file AMDGPUDisassembler.cpp.
Referenced by llvm::AMDGPUDisassembler::convertDPP8Inst(), llvm::AMDGPUDisassembler::convertEXPInst(), llvm::AMDGPUDisassembler::convertFMAanyK(), llvm::AMDGPUDisassembler::convertMacDPPInst(), llvm::AMDGPUDisassembler::convertSDWAInst(), llvm::AMDGPUDisassembler::convertVINTERPInst(), llvm::AMDGPUDisassembler::convertVOP3DPPInst(), llvm::AMDGPUDisassembler::convertVOP3PDPPInst(), llvm::AMDGPUDisassembler::convertVOPC64DPPInst(), llvm::AMDGPUDisassembler::convertVOPCDPPInst(), and llvm::AMDGPUDisassembler::getInstruction().
| LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUDisassembler | ( | ) |
Definition at line 3039 of file AMDGPUDisassembler.cpp.
References createAMDGPUDisassembler(), createAMDGPUSymbolizer(), llvm::getTheGCNTarget(), llvm::TargetRegistry::RegisterMCDisassembler(), and llvm::TargetRegistry::RegisterMCSymbolizer().