15#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVSYMBOLICOPERANDS_H
16#define LLVM_LIB_TARGET_SPIRV_SPIRVSYMBOLICOPERANDS_H
25namespace OperandCategory {
26#define GET_OperandCategory_DECL
27#include "SPIRVGenTables.inc"
31#define GET_Extension_DECL
32#include "SPIRVGenTables.inc"
36#define GET_Capability_DECL
37#include "SPIRVGenTables.inc"
40namespace Environment {
41#define GET_Environment_DECL
42#include "SPIRVGenTables.inc"
46#define GET_SourceLanguage_DECL
47#include "SPIRVGenTables.inc"
50namespace AddressingModel {
51#define GET_AddressingModel_DECL
52#include "SPIRVGenTables.inc"
55namespace ExecutionModel {
56#define GET_ExecutionModel_DECL
57#include "SPIRVGenTables.inc"
60namespace MemoryModel {
61#define GET_MemoryModel_DECL
62#include "SPIRVGenTables.inc"
65namespace MatrixMultiplyAccumulateOperands {
66#define GET_MatrixMultiplyAccumulateOperands_DECL
67#include "SPIRVGenTables.inc"
70namespace ExecutionMode {
71#define GET_ExecutionMode_DECL
72#include "SPIRVGenTables.inc"
76#define GET_StorageClass_DECL
77#include "SPIRVGenTables.inc"
82#include "SPIRVGenTables.inc"
85namespace SamplerAddressingMode {
86#define GET_SamplerAddressingMode_DECL
87#include "SPIRVGenTables.inc"
90namespace SamplerFilterMode {
91#define GET_SamplerFilterMode_DECL
92#include "SPIRVGenTables.inc"
95namespace ImageFormat {
96#define GET_ImageFormat_DECL
97#include "SPIRVGenTables.inc"
100namespace ImageChannelOrder {
101#define GET_ImageChannelOrder_DECL
102#include "SPIRVGenTables.inc"
105namespace ImageChannelDataType {
106#define GET_ImageChannelDataType_DECL
107#include "SPIRVGenTables.inc"
110namespace ImageOperand {
111#define GET_ImageOperand_DECL
112#include "SPIRVGenTables.inc"
115namespace FPFastMathMode {
116#define GET_FPFastMathMode_DECL
117#include "SPIRVGenTables.inc"
120namespace FPRoundingMode {
121#define GET_FPRoundingMode_DECL
122#include "SPIRVGenTables.inc"
125namespace LinkageType {
126#define GET_LinkageType_DECL
127#include "SPIRVGenTables.inc"
130namespace AccessQualifier {
131#define GET_AccessQualifier_DECL
132#include "SPIRVGenTables.inc"
135namespace FunctionParameterAttribute {
136#define GET_FunctionParameterAttribute_DECL
137#include "SPIRVGenTables.inc"
140namespace Decoration {
141#define GET_Decoration_DECL
142#include "SPIRVGenTables.inc"
146#define GET_BuiltIn_DECL
147#include "SPIRVGenTables.inc"
150namespace SelectionControl {
151#define GET_SelectionControl_DECL
152#include "SPIRVGenTables.inc"
155namespace LoopControl {
156#define GET_LoopControl_DECL
157#include "SPIRVGenTables.inc"
160namespace FunctionControl {
161#define GET_FunctionControl_DECL
162#include "SPIRVGenTables.inc"
165namespace MemorySemantics {
166#define GET_MemorySemantics_DECL
167#include "SPIRVGenTables.inc"
170namespace MemoryOperand {
171#define GET_MemoryOperand_DECL
172#include "SPIRVGenTables.inc"
176#define GET_Scope_DECL
177#include "SPIRVGenTables.inc"
180namespace GroupOperation {
181#define GET_GroupOperation_DECL
182#include "SPIRVGenTables.inc"
185namespace KernelEnqueueFlags {
186#define GET_KernelEnqueueFlags_DECL
187#include "SPIRVGenTables.inc"
190namespace KernelProfilingInfo {
191#define GET_KernelProfilingInfo_DECL
192#include "SPIRVGenTables.inc"
195namespace InstructionSet {
196#define GET_InstructionSet_DECL
197#include "SPIRVGenTables.inc"
200namespace OpenCLExtInst {
201#define GET_OpenCLExtInst_DECL
202#include "SPIRVGenTables.inc"
205namespace GLSLExtInst {
206#define GET_GLSLExtInst_DECL
207#include "SPIRVGenTables.inc"
210namespace NonSemanticExtInst {
211#define GET_NonSemanticExtInst_DECL
212#include "SPIRVGenTables.inc"
216#define GET_Opcode_DECL
217#include "SPIRVGenTables.inc"
220namespace CooperativeMatrixLayout {
221#define GET_CooperativeMatrixLayout_DECL
222#include "SPIRVGenTables.inc"
225namespace CooperativeMatrixOperands {
226#define GET_CooperativeMatrixOperands_DECL
227#include "SPIRVGenTables.inc"
230namespace SpecConstantOpOperands {
231#define GET_SpecConstantOpOperands_DECL
232#include "SPIRVGenTables.inc"
237 InstructionSet::InstructionSet
Set;
264 SPIRV::OperandCategory::OperandCategory Category,
uint32_t Value);
275SPIRV::InstructionSet::InstructionSet
277std::string
getExtInstName(SPIRV::InstructionSet::InstructionSet Set,
282template <
class InstType>
286 const unsigned NumOps =
MI.getNumOperands();
287 bool IsFinished =
false;
288 for (
unsigned i = StartIndex; i < NumOps && !IsFinished; ++i) {
289 const auto &
Op =
MI.getOperand(i);
292 assert((
Op.getImm() >> 32) == 0 &&
"Imm operand should be i32 word");
294 for (
unsigned ShiftAmount = 0; ShiftAmount < 32; ShiftAmount += 8) {
295 char c = (Imm >> ShiftAmount) & 0xff;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
Defines the llvm::VersionTuple class, which represents a version in the form major[....
This class represents an Operation in the Expression.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
This is an optimization pass for GlobalISel generic memory operations.
ExtensionList getSymbolicOperandExtensions(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
std::string getExtInstName(SPIRV::InstructionSet::InstructionSet Set, uint32_t InstructionNumber)
CapabilityList getSymbolicOperandCapabilities(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
std::string getExtInstSetName(SPIRV::InstructionSet::InstructionSet Set)
bool getSpirvBuiltInIdByName(llvm::StringRef Name, SPIRV::BuiltIn::BuiltIn &BI)
VersionTuple getSymbolicOperandMaxVersion(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
EnvironmentList getSymbolicOperandAllowedEnvironments(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
std::string getSPIRVStringOperand(const InstType &MI, unsigned StartIndex)
CapabilityList getCapabilitiesEnabledByExtension(SPIRV::Extension::Extension Extension)
SPIRV::InstructionSet::InstructionSet getExtInstSetFromString(std::string SetName)
std::string getSymbolicOperandMnemonic(SPIRV::OperandCategory::OperandCategory Category, int32_t Value)
VersionTuple getSymbolicOperandMinVersion(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
std::string getLinkStringForBuiltIn(SPIRV::BuiltIn::BuiltIn BuiltInValue)
InstructionSet::InstructionSet Set