LLVM 22.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/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 | DECODE_OPERAND(StaticDecoderName, DecoderName) |
#define | DECODE_OPERAND_REG_8(RegClass) |
#define | DECODE_SrcOp(Name, EncSize, OpWidth, EncImm) |
#define | DECODE_OPERAND_SREG_7(RegClass, OpWidth) DECODE_SrcOp(Decode##RegClass##RegisterClass, 7, OpWidth, Imm) |
#define | DECODE_OPERAND_SREG_8(RegClass, OpWidth) DECODE_SrcOp(Decode##RegClass##RegisterClass, 8, OpWidth, Imm) |
#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 2198 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_DESC | ( | MASK, | |
DESC | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, DESC, "") |
Definition at line 2201 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_DESC_MSG | ( | MASK, | |
DESC, | |||
MSG | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, DESC, ", " MSG) |
Definition at line 2203 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_IMPL | ( | MASK, | |
DESC, | |||
MSG | |||
) |
Definition at line 2188 of file AMDGPUDisassembler.cpp.
#define CHECK_RESERVED_BITS_MSG | ( | MASK, | |
MSG | |||
) | CHECK_RESERVED_BITS_IMPL(MASK, #MASK, ", " MSG) |
Definition at line 2199 of file AMDGPUDisassembler.cpp.
#define DEBUG_TYPE "amdgpu-disassembler" |
Definition at line 42 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND | ( | StaticDecoderName, | |
DecoderName | |||
) |
Definition at line 141 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND_REG_8 | ( | RegClass | ) |
Definition at line 151 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND_SREG_7 | ( | RegClass, | |
OpWidth | |||
) | DECODE_SrcOp(Decode##RegClass##RegisterClass, 7, OpWidth, Imm) |
Definition at line 179 of file AMDGPUDisassembler.cpp.
#define DECODE_OPERAND_SREG_8 | ( | RegClass, | |
OpWidth | |||
) | DECODE_SrcOp(Decode##RegClass##RegisterClass, 8, OpWidth, Imm) |
Definition at line 182 of file AMDGPUDisassembler.cpp.
#define DECODE_SDWA | ( | DecName | ) | DECODE_OPERAND(decodeSDWA##DecName, decodeSDWA##DecName) |
Definition at line 433 of file AMDGPUDisassembler.cpp.
#define DECODE_SrcOp | ( | Name, | |
EncSize, | |||
OpWidth, | |||
EncImm | |||
) |
Definition at line 161 of file AMDGPUDisassembler.cpp.
#define GET_FIELD | ( | MASK | ) | (AMDHSA_BITS_GET(FourByteBuffer, MASK)) |
Definition at line 2177 of file AMDGPUDisassembler.cpp.
#define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 2178 of file AMDGPUDisassembler.cpp.
#define PRINT_DIRECTIVE | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 2178 of file AMDGPUDisassembler.cpp.
#define PRINT_PSEUDO_DIRECTIVE_COMMENT | ( | DIRECTIVE, | |
MASK | |||
) |
Definition at line 2182 of file AMDGPUDisassembler.cpp.
#define SGPR_MAX |
Definition at line 44 of file AMDGPUDisassembler.cpp.
Definition at line 48 of file AMDGPUDisassembler.cpp.
|
inlinestatic |
Definition at line 77 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::VPWidenMemoryRecipe::setMask(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPWidenInductionRecipe::VPWidenInductionRecipe(), llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe(), llvm::VPWidenPHIRecipe::VPWidenPHIRecipe(), 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 979 of file AMDGPUDisassembler.cpp.
References llvm::MCOperand::getReg(), llvm_unreachable, MRI, and llvm::MCOperand::setReg().
Referenced by llvm::AMDGPUDisassembler::convertMAIInst(), and llvm::AMDGPUDisassembler::convertWMMAInst().
|
static |
Definition at line 1081 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 2798 of file AMDGPUDisassembler.cpp.
Referenced by LLVMInitializeAMDGPUDisassembler().
|
static |
Definition at line 2789 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 2488 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 2497 of file AMDGPUDisassembler.cpp.
References llvm::createStringError().
Referenced by llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective().
|
static |
Definition at line 190 of file AMDGPUDisassembler.cpp.
References decodeSrcOp(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 419 of file AMDGPUDisassembler.cpp.
References decodeAVLdSt().
|
static |
Definition at line 384 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::SIInstrFlags::DS, llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), IsAGPROperand(), MRI, and Opc.
Referenced by decodeAVLdSt().
|
static |
Definition at line 122 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 135 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 350 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 357 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 337 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 425 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
static |
Definition at line 323 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 308 of file AMDGPUDisassembler.cpp.
References addOperand(), assert(), and llvm::AMDGPU::EncValues::IS_VGPR.
|
static |
Definition at line 364 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 108 of file AMDGPUDisassembler.cpp.
References addOperand(), llvm::MCOperand::createImm(), and llvm::Offset.
|
static |
Definition at line 95 of file AMDGPUDisassembler.cpp.
References addOperand(), Addr, llvm::MCOperand::createImm(), llvm::Offset, and llvm::MCDisassembler::Success.
|
static |
Definition at line 128 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 208 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 216 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 169 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
Referenced by decodeAV10(), decodeSrcA9(), decodeSrcAV10(), decodeSrcReg9(), decodeSrcRegOrImm9(), and decodeSrcRegOrImmA9().
|
static |
Definition at line 198 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 228 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 237 of file AMDGPUDisassembler.cpp.
References decodeSrcOp().
|
static |
Definition at line 440 of file AMDGPUDisassembler.cpp.
References addOperand().
|
static |
Definition at line 297 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
static |
Definition at line 284 of file AMDGPUDisassembler.cpp.
References addOperand(), and assert().
|
inlinestatic |
Definition at line 501 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 512 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 493 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 2159 of file AMDGPUDisassembler.cpp.
References llvm::countr_zero(), and llvm::popcount().
Referenced by createReservedKDBitsError().
|
static |
Definition at line 1591 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
|
static |
Definition at line 1616 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
|
static |
Definition at line 1666 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
|
static |
Definition at line 1641 of file AMDGPUDisassembler.cpp.
References llvm_unreachable.
Definition at line 84 of file AMDGPUDisassembler.cpp.
References I, MI, Name, and OpIdx.
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().
|
static |
Definition at line 370 of file AMDGPUDisassembler.cpp.
References llvm::MCInst::getOperand(), MRI, OpIdx, and llvm::Sub.
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUDisassembler | ( | ) |
Definition at line 2805 of file AMDGPUDisassembler.cpp.
References createAMDGPUDisassembler(), createAMDGPUSymbolizer(), llvm::getTheGCNTarget(), llvm::TargetRegistry::RegisterMCDisassembler(), and llvm::TargetRegistry::RegisterMCSymbolizer().