LLVM 20.0.0git
|
This file contains definition for AMDGPU ISA disassembler. More...
#include "Disassembler/AMDGPUDisassembler.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/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 "AMDGPUGenDisassemblerTables.inc"
Go to the source code of this file.
Classes | |
struct | VOPModifiers |
Macros | |
#define | DEBUG_TYPE "amdgpu-disassembler" |
#define | SGPR_MAX |
#define | DECODE_OPERAND(StaticDecoderName, DecoderName) |
#define | DECODE_OPERAND_REG_8(RegClass) |
#define | DECODE_SrcOp(Name, EncSize, OpWidth, EncImm, MandatoryLiteral, ImmWidth) |
#define | DECODE_OPERAND_REG_7(RegClass, OpWidth) DECODE_SrcOp(Decode##RegClass##RegisterClass, 7, OpWidth, Imm, false, 0) |
#define | DECODE_SDWA(DecName) DECODE_OPERAND(decodeSDWA##DecName, decodeSDWA##DecName) |
#define | GET_FIELD(MASK) (AMDHSA_BITS_GET(FourByteBuffer, 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) CHECK_RESERVED_BITS_IMPL(MASK, #MASK, "") |
#define | CHECK_RESERVED_BITS_MSG(MASK, MSG) CHECK_RESERVED_BITS_IMPL(MASK, #MASK, ", " MSG) |
#define | CHECK_RESERVED_BITS_DESC(MASK, DESC) CHECK_RESERVED_BITS_IMPL(MASK, DESC, "") |
#define | CHECK_RESERVED_BITS_DESC_MSG(MASK, DESC, MSG) CHECK_RESERVED_BITS_IMPL(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 | ) | CHECK_RESERVED_BITS_IMPL(MASK, #MASK, "") |
Definition at line 1997 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_DESC | ( | MASK, | |
DESC | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, DESC, "") |
Definition at line 2000 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_DESC_MSG | ( | MASK, | |
DESC, | |||
MSG | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, DESC, ", " MSG) |
Definition at line 2002 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_IMPL | ( | MASK, | |
DESC, | |||
MSG | |||
) |
Definition at line 1987 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_MSG | ( | MASK, | |
MSG | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, #MASK, ", " MSG) |
Definition at line 1998 of file AMDGPUDisassembler.cpp.
#define DEBUG_TYPE "amdgpu-disassembler" |
Definition at line 40 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND | ( | StaticDecoderName, | |
DecoderName | |||
) |
Definition at line 134 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND_REG_7 | ( | RegClass, | |
OpWidth | |||
) | DECODE_SrcOp(Decode##RegClass##RegisterClass, 7, OpWidth, Imm, false, 0) |
Definition at line 179 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND_REG_8 | ( | RegClass | ) |
Definition at line 144 of file AMDGPUDisassembler.cpp.
#define DECODE_SDWA | ( | DecName | ) | DECODE_OPERAND(decodeSDWA##DecName, decodeSDWA##DecName) |
Definition at line 461 of file AMDGPUDisassembler.cpp.
#define DECODE_SrcOp | ( | Name, | |
EncSize, | |||
OpWidth, | |||
EncImm, | |||
MandatoryLiteral, | |||
ImmWidth | |||
) |
Definition at line 154 of file AMDGPUDisassembler.cpp.
#define GET_FIELD | ( | MASK | ) | (AMDHSA_BITS_GET(FourByteBuffer, MASK)) |
Definition at line 1976 of file AMDGPUDisassembler.cpp.
#define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 1977 of file AMDGPUDisassembler.cpp.
#define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 1977 of file AMDGPUDisassembler.cpp.
#define PRINT_PSEUDO_DIRECTIVE_COMMENT | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 1981 of file AMDGPUDisassembler.cpp.
#define SGPR_MAX |
Definition at line 42 of file AMDGPUDisassembler.cpp.
Definition at line 46 of file AMDGPUDisassembler.cpp.
|
inlinestatic |
Definition at line 70 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_VGPR_16(), decodeOperand_VSrc_f64(), decodeOperand_VSrcT16(), decodeOperand_VSrcT16_Lo128(), decodeOperand_VSrcT16_Lo128_Deferred(), decodeOperandVOPDDstY(), decodeSMEMOffset(), decodeSOPPBrTarget(), decodeSplitBarrier(), decodeSrcOp(), decodeVersionImm(), DecodeVGPR_16_Lo128RegisterClass(), DecodeVGPR_16RegisterClass(), llvm::LoongArchAsmPrinter::LowerSTATEPOINT(), llvm::VPReplicateRecipe::VPReplicateRecipe(), llvm::VPScalarPHIRecipe::VPScalarPHIRecipe(), llvm::VPWidenEVLRecipe::VPWidenEVLRecipe(), llvm::VPWidenInductionRecipe::VPWidenInductionRecipe(), and llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe().
|
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 858 of file AMDGPUDisassembler.cpp.
References llvm::MCOperand::getReg(), llvm_unreachable, MRI, and llvm::MCOperand::setReg().
Referenced by llvm::AMDGPUDisassembler::convertMAIInst().
|
static |
Definition at line 918 of file AMDGPUDisassembler.cpp.
References llvm::SISrcMods::DST_OP_SEL, llvm::AMDGPU::getNamedOperandIdx(), MI, llvm::SISrcMods::NEG, llvm::SISrcMods::NEG_HI, VOPModifiers::NegHi, VOPModifiers::NegLo, llvm::SISrcMods::OP_SEL_0, llvm::SISrcMods::OP_SEL_1, VOPModifiers::OpSel, and VOPModifiers::OpSelHi.
Referenced by llvm::AMDGPUDisassembler::convertDPP8Inst(), llvm::AMDGPUDisassembler::convertVOP3DPPInst(), and llvm::AMDGPUDisassembler::convertVOP3PDPPInst().
|
static |
Definition at line 2563 of file AMDGPUDisassembler.cpp.
Referenced by LLVMInitializeAMDGPUDisassembler().
|
static |
Definition at line 2554 of file AMDGPUDisassembler.cpp.
Referenced by LLVMInitializeAMDGPUDisassembler().
|
static |
Create an error object to return from onSymbolStart for reserved kernel descriptor bits being set.
Definition at line 2256 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 2265 of file AMDGPUDisassembler.cpp.
References llvm::createStringError().
Referenced by llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective().
|
static |
Definition at line 187 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), llvm::AMDGPU::INT, and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 410 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::SIInstrFlags::DS, llvm::AMDGPU::getNamedOperandIdx(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), IsAGPROperand(), and MRI.
Referenced by decodeAVLdSt().
|
static |
Definition at line 445 of file AMDGPUDisassembler.cpp.
References decodeAVLdSt().
|
static |
Definition at line 115 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 128 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 383 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 370 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 451 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), llvm::AMDGPU::FP64, and llvm::AMDGPUDisassembler::OPW64.
|
static |
Definition at line 354 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 317 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 336 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 390 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 101 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::MCOperand::createImm(), and llvm::Offset.
|
static |
Definition at line 88 of file AMDGPUDisassembler.cpp.
References addOperand(), Addr, llvm::MCOperand::createImm(), llvm::Offset, and llvm::MCDisassembler::Success.
|
static |
Definition at line 121 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 206 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), and llvm::AMDGPU::INT.
|
static |
Definition at line 215 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), and llvm::AMDGPU::INT.
|
static |
Definition at line 165 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
Referenced by decodeAV10(), decodeSrcA9(), decodeSrcAV10(), decodeSrcReg9(), decodeSrcRegOrImm9(), decodeSrcRegOrImmA9(), and decodeSrcRegOrImmDeferred9().
|
static |
Definition at line 195 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), and llvm::AMDGPU::INT.
|
static |
Definition at line 229 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 240 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 249 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 468 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 305 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
static |
Definition at line 292 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
inlinestatic |
Definition at line 489 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::Hi, llvm::Lo, llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
Referenced by llvm::AMDGPUDisassembler::getInstruction().
|
inlinestatic |
Definition at line 500 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::Hi, llvm::Lo, llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
Referenced by llvm::AMDGPUDisassembler::getInstruction().
Definition at line 481 of file AMDGPUDisassembler.cpp.
References assert(), llvm::ArrayRef< T >::data(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::slice().
|
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 1958 of file AMDGPUDisassembler.cpp.
References llvm::countr_zero(), and llvm::popcount().
Referenced by createReservedKDBitsError().
|
static |
Definition at line 1501 of file AMDGPUDisassembler.cpp.
References llvm::AMDGPU::BF16, getInlineImmValBF16(), and getInlineImmValF16().
Referenced by llvm::AMDGPUDisassembler::decodeFPImmed().
|
static |
Definition at line 1401 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Referenced by llvm::AMDGPUDisassembler::decodeFPImmed().
|
static |
Definition at line 1426 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Referenced by llvm::AMDGPUDisassembler::decodeFPImmed().
|
static |
Definition at line 1476 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Referenced by getInlineImmVal16().
|
static |
Definition at line 1451 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Referenced by getInlineImmVal16().
Definition at line 77 of file AMDGPUDisassembler.cpp.
References llvm::AMDGPU::getNamedOperandIdx(), I, and MI.
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::convertVOPCDPPInst(), and llvm::AMDGPUDisassembler::getInstruction().
|
static |
Definition at line 396 of file AMDGPUDisassembler.cpp.
References llvm::MCInst::getOperand(), and MRI.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUDisassembler | ( | ) |
Definition at line 2569 of file AMDGPUDisassembler.cpp.
References createAMDGPUDisassembler(), createAMDGPUSymbolizer(), llvm::getTheGCNTarget(), llvm::TargetRegistry::RegisterMCDisassembler(), and llvm::TargetRegistry::RegisterMCSymbolizer().