LLVM 23.0.0git
AMDGPUAsmParser.cpp File Reference

Go to the source code of this file.

Classes

struct  RegInfo

Macros

#define GET_REGISTER_MATCHER
#define PARSE_BITS_ENTRY(FIELD, ENTRY, VALUE, RANGE)
#define EXPR_RESOLVE_OR_ERROR(RESOLVED)
#define GET_MATCHER_IMPLEMENTATION
#define GET_MNEMONIC_SPELL_CHECKER
#define GET_MNEMONIC_CHECKER
Auto-generated Match Functions

{

#define GET_ASSEMBLER_HEADER

Typedefs

using OperandIndices = SmallVector<int16_t, MAX_SRC_OPERANDS_NUM>

Functions

static const fltSemanticsgetFltSemantics (unsigned Size)
static const fltSemanticsgetFltSemantics (MVT VT)
static const fltSemanticsgetOpFltSemantics (uint8_t OperandType)
static bool canLosslesslyConvertToFPType (APFloat &FPLiteral, MVT VT)
static bool isSafeTruncation (int64_t Val, unsigned Size)
static bool isInlineableLiteralOp16 (int64_t Val, MVT VT, bool HasInv2Pi)
static int getRegClass (RegisterKind Is, unsigned RegWidth)
static MCRegister getSpecialRegForName (StringRef RegName)
static bool isRegularReg (RegisterKind Kind)
static const RegInfogetRegularRegInfo (StringRef Str)
static bool getRegNum (StringRef Str, unsigned &Num)
static ArrayRef< unsignedgetAllVariants ()
static OperandIndices getSrcOperandIndices (unsigned Opcode, bool AddMandatoryLiterals=false)
static bool checkWriteLane (const MCInst &Inst)
static bool IsMovrelsSDWAOpcode (const unsigned Opcode)
static bool IsRevOpcode (const unsigned Opcode)
static int IsAGPROperand (const MCInst &Inst, AMDGPU::OpName Name, const MCRegisterInfo *MRI)
static std::string AMDGPUMnemonicSpellCheck (StringRef S, const FeatureBitset &FBS, unsigned VariantID=0)
static bool AMDGPUCheckMnemonic (StringRef Mnemonic, const FeatureBitset &AvailableFeatures, unsigned VariantID)
static bool isInvalidVOPDY (const OperandVector &Operands, uint64_t InvalidOprIdx)
static void applyMnemonicAliases (StringRef &Mnemonic, const FeatureBitset &Features, unsigned VariantID)
static void addOptionalImmOperand (MCInst &Inst, const OperandVector &Operands, AMDGPUAsmParser::OptionalImmIndexMap &OptionalIdx, AMDGPUOperand::ImmTy ImmT, int64_t Default=0, std::optional< unsigned > InsertAt=std::nullopt)
static bool encodeCnt (const AMDGPU::IsaVersion ISA, int64_t &IntVal, int64_t CntVal, bool Saturate, unsigned(*encode)(const IsaVersion &Version, unsigned, unsigned), unsigned(*decode)(const IsaVersion &Version, unsigned))
static LLVM_READNONE unsigned encodeBitmaskPerm (const unsigned AndMask, const unsigned OrMask, const unsigned XorMask)
static bool ConvertOmodMul (int64_t &Mul)
static bool ConvertOmodDiv (int64_t &Div)
static void cvtVOP3DstOpSelOnly (MCInst &Inst, const MCRegisterInfo &MRI)
static bool isRegOrImmWithInputMods (const MCInstrDesc &Desc, unsigned OpNum)
static void addSrcModifiersAndSrc (MCInst &Inst, const OperandVector &Operands, unsigned i, unsigned Opc, AMDGPU::OpName OpName)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmParser ()
 Force static initialization.

Variables

static constexpr RegInfo RegularRegisters []
constexpr unsigned MAX_SRC_OPERANDS_NUM = 6
constexpr uint64_t MIMGFlags

Macro Definition Documentation

◆ EXPR_RESOLVE_OR_ERROR

#define EXPR_RESOLVE_OR_ERROR ( RESOLVED)
Value:
if (!(RESOLVED)) \
return Error(IDRange.Start, "directive should have resolvable expression", \
IDRange);

◆ GET_ASSEMBLER_HEADER

#define GET_ASSEMBLER_HEADER

Definition at line 1379 of file AMDGPUAsmParser.cpp.

◆ GET_MATCHER_IMPLEMENTATION

#define GET_MATCHER_IMPLEMENTATION

Definition at line 10620 of file AMDGPUAsmParser.cpp.

◆ GET_MNEMONIC_CHECKER

#define GET_MNEMONIC_CHECKER

Definition at line 10622 of file AMDGPUAsmParser.cpp.

◆ GET_MNEMONIC_SPELL_CHECKER

#define GET_MNEMONIC_SPELL_CHECKER

Definition at line 10621 of file AMDGPUAsmParser.cpp.

◆ GET_REGISTER_MATCHER

#define GET_REGISTER_MATCHER

Definition at line 1274 of file AMDGPUAsmParser.cpp.

◆ PARSE_BITS_ENTRY

#define PARSE_BITS_ENTRY ( FIELD,
ENTRY,
VALUE,
RANGE )
Value:
if (!isUInt<ENTRY##_WIDTH>(Val)) \
return OutOfRangeError(RANGE); \
AMDGPU::MCKernelDescriptor::bits_set(FIELD, VALUE, ENTRY##_SHIFT, ENTRY, \
getContext());
#define FIELD(name)
#define ENTRY(ASMNAME, ENUM)
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
Definition MathExtras.h:189

Typedef Documentation

◆ OperandIndices

Definition at line 3819 of file AMDGPUAsmParser.cpp.

Function Documentation

◆ addOptionalImmOperand()

void addOptionalImmOperand ( MCInst & Inst,
const OperandVector & Operands,
AMDGPUAsmParser::OptionalImmIndexMap & OptionalIdx,
AMDGPUOperand::ImmTy ImmT,
int64_t Default = 0,
std::optional< unsigned > InsertAt = std::nullopt )
static

◆ addSrcModifiersAndSrc()

void addSrcModifiersAndSrc ( MCInst & Inst,
const OperandVector & Operands,
unsigned i,
unsigned Opc,
AMDGPU::OpName OpName )
static

Definition at line 9884 of file AMDGPUAsmParser.cpp.

References Opc, and llvm::AMDGPU::Hwreg::Operands.

◆ AMDGPUCheckMnemonic()

bool AMDGPUCheckMnemonic ( StringRef Mnemonic,
const FeatureBitset & AvailableFeatures,
unsigned VariantID )
static

◆ AMDGPUMnemonicSpellCheck()

std::string AMDGPUMnemonicSpellCheck ( StringRef S,
const FeatureBitset & FBS,
unsigned VariantID = 0 )
static

◆ applyMnemonicAliases()

void applyMnemonicAliases ( StringRef & Mnemonic,
const FeatureBitset & Features,
unsigned VariantID )
static

◆ canLosslesslyConvertToFPType()

◆ checkWriteLane()

◆ ConvertOmodDiv()

bool ConvertOmodDiv ( int64_t & Div)
static

Definition at line 9289 of file AMDGPUAsmParser.cpp.

◆ ConvertOmodMul()

bool ConvertOmodMul ( int64_t & Mul)
static

Definition at line 9281 of file AMDGPUAsmParser.cpp.

References Mul.

◆ cvtVOP3DstOpSelOnly()

◆ encodeBitmaskPerm()

◆ encodeCnt()

bool encodeCnt ( const AMDGPU::IsaVersion ISA,
int64_t & IntVal,
int64_t CntVal,
bool Saturate,
unsigned(* encode )(const IsaVersion &Version, unsigned, unsigned),
unsigned(* decode )(const IsaVersion &Version, unsigned) )
static

Definition at line 7933 of file AMDGPUAsmParser.cpp.

References decode(), llvm::encode(), and llvm::Failed().

◆ getAllVariants()

◆ getFltSemantics() [1/2]

const fltSemantics * getFltSemantics ( MVT VT)
static

Definition at line 2047 of file AMDGPUAsmParser.cpp.

References getFltSemantics(), and llvm::MVT::getSizeInBits().

◆ getFltSemantics() [2/2]

◆ getOpFltSemantics()

const fltSemantics * getOpFltSemantics ( uint8_t OperandType)
static

◆ getRegClass()

int getRegClass ( RegisterKind Is,
unsigned RegWidth )
static

Definition at line 2624 of file AMDGPUAsmParser.cpp.

◆ getRegNum()

bool getRegNum ( StringRef Str,
unsigned & Num )
static

Definition at line 2890 of file AMDGPUAsmParser.cpp.

◆ getRegularRegInfo()

const RegInfo * getRegularRegInfo ( StringRef Str)
static

Definition at line 2883 of file AMDGPUAsmParser.cpp.

References Reg, and RegularRegisters.

◆ getSpecialRegForName()

MCRegister getSpecialRegForName ( StringRef RegName)
static

◆ getSrcOperandIndices()

OperandIndices getSrcOperandIndices ( unsigned Opcode,
bool AddMandatoryLiterals = false )
static

Definition at line 3823 of file AMDGPUAsmParser.cpp.

References llvm::AMDGPU::isVOPD().

◆ IsAGPROperand()

◆ isInlineableLiteralOp16()

bool isInlineableLiteralOp16 ( int64_t Val,
MVT VT,
bool HasInv2Pi )
static

◆ isInvalidVOPDY()

bool isInvalidVOPDY ( const OperandVector & Operands,
uint64_t InvalidOprIdx )
static

◆ IsMovrelsSDWAOpcode()

bool IsMovrelsSDWAOpcode ( const unsigned Opcode)
static

Definition at line 4350 of file AMDGPUAsmParser.cpp.

◆ isRegOrImmWithInputMods()

bool isRegOrImmWithInputMods ( const MCInstrDesc & Desc,
unsigned OpNum )
static

Definition at line 9448 of file AMDGPUAsmParser.cpp.

References llvm::AMDGPU::OPERAND_INPUT_MODS, and llvm::MCOI::TIED_TO.

◆ isRegularReg()

bool isRegularReg ( RegisterKind Kind)
static

Definition at line 2876 of file AMDGPUAsmParser.cpp.

◆ IsRevOpcode()

bool IsRevOpcode ( const unsigned Opcode)
static

Definition at line 4559 of file AMDGPUAsmParser.cpp.

◆ isSafeTruncation()

bool isSafeTruncation ( int64_t Val,
unsigned Size )
static

Definition at line 2117 of file AMDGPUAsmParser.cpp.

References llvm::isIntN(), llvm::isUIntN(), and Size.

◆ LLVMInitializeAMDGPUAsmParser()

LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmParser ( )

Force static initialization.

Definition at line 10615 of file AMDGPUAsmParser.cpp.

References A(), B(), llvm::getTheGCNTarget(), and llvm::getTheR600Target().

Variable Documentation

◆ MAX_SRC_OPERANDS_NUM

unsigned MAX_SRC_OPERANDS_NUM = 6
constexpr

Definition at line 3818 of file AMDGPUAsmParser.cpp.

◆ MIMGFlags

◆ RegularRegisters

RegInfo RegularRegisters[]
staticconstexpr
Initial value:
= {
{{"v"}, IS_VGPR},
{{"s"}, IS_SGPR},
{{"ttmp"}, IS_TTMP},
{{"acc"}, IS_AGPR},
{{"a"}, IS_AGPR},
}

Definition at line 2868 of file AMDGPUAsmParser.cpp.

Referenced by getRegularRegInfo().