41using namespace OperandCategory;
43using namespace Capability;
44using namespace InstructionSet;
45#define GET_SymbolicOperands_DECL
46#define GET_SymbolicOperands_IMPL
47#define GET_ExtensionEntries_DECL
48#define GET_ExtensionEntries_IMPL
49#define GET_CapabilityEntries_DECL
50#define GET_CapabilityEntries_IMPL
51#define GET_ExtendedBuiltins_DECL
52#define GET_ExtendedBuiltins_IMPL
53#include "SPIRVGenTables.inc"
60 SPIRV::lookupSymbolicOperandByCategoryAndValue(Category,
Value);
63 return Lookup->Mnemonic.str();
64 if (Category != SPIRV::OperandCategory::ImageOperandOperand &&
65 Category != SPIRV::OperandCategory::FPFastMathModeOperand &&
66 Category != SPIRV::OperandCategory::SelectionControlOperand &&
67 Category != SPIRV::OperandCategory::LoopControlOperand &&
68 Category != SPIRV::OperandCategory::FunctionControlOperand &&
69 Category != SPIRV::OperandCategory::MemorySemanticsOperand &&
70 Category != SPIRV::OperandCategory::MemoryOperandOperand &&
71 Category != SPIRV::OperandCategory::KernelProfilingInfoOperand)
75 std::string Separator;
77 SPIRV::lookupSymbolicOperandByCategory(Category);
79 while (EnumValueInCategory && EnumValueInCategory->
Category == Category) {
80 if ((EnumValueInCategory->
Value != 0) &&
85 ++EnumValueInCategory;
95 SPIRV::lookupSymbolicOperandByCategoryAndValue(Category,
Value);
107 SPIRV::lookupSymbolicOperandByCategoryAndValue(Category,
Value);
119 SPIRV::lookupCapabilityByCategoryAndValue(Category,
Value);
122 while (Capability && Capability->
Category == Category &&
125 static_cast<SPIRV::Capability::Capability
>(Capability->
ReqCapability));
135 SPIRV::lookupSymbolicOperandsEnabledByExtension(
136 Extension, SPIRV::OperandCategory::CapabilityOperand);
140 Entry->Category == SPIRV::OperandCategory::CapabilityOperand &&
143 static_cast<SPIRV::Capability::Capability
>(Entry->Value));
154 SPIRV::lookupExtensionByCategoryAndValue(Category,
Value);
160 static_cast<SPIRV::Extension::Extension
>(
Extension->ReqExtension));
169 SPIRV::lookupSymbolicOperandByCategoryAndValue(
170 SPIRV::OperandCategory::BuiltInOperand, BuiltInValue);
173 return "__spirv_BuiltIn" +
Lookup->Mnemonic.str();
174 return "UNKNOWN_BUILTIN";
178 SPIRV::BuiltIn::BuiltIn &BI) {
179 const std::string Prefix =
"__spirv_BuiltIn";
180 if (!
Name.starts_with(Prefix))
184 SPIRV::lookupSymbolicOperandByCategoryAndMnemonic(
185 SPIRV::OperandCategory::BuiltInOperand,
186 Name.drop_front(Prefix.length()));
191 BI =
static_cast<SPIRV::BuiltIn::BuiltIn
>(
Lookup->Value);
197 case SPIRV::InstructionSet::OpenCL_std:
199 case SPIRV::InstructionSet::GLSL_std_450:
200 return "GLSL.std.450";
201 case SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_100:
202 return "NonSemantic.Shader.DebugInfo.100";
203 case SPIRV::InstructionSet::SPV_AMD_shader_trinary_minmax:
204 return "SPV_AMD_shader_trinary_minmax";
206 return "UNKNOWN_EXT_INST_SET";
209SPIRV::InstructionSet::InstructionSet
212 {SPIRV::InstructionSet::GLSL_std_450, SPIRV::InstructionSet::OpenCL_std,
213 SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_100}) {
223 SPIRV::lookupExtendedBuiltinBySetAndNumber(Set, InstructionNumber);
226 return "UNKNOWN_EXT_INST";
228 return Lookup->Name.str();
static cl::opt< std::set< SPIRV::Extension::Extension >, false, SPIRVExtensionsParser > Extensions("spirv-ext", cl::desc("Specify list of enabled SPIR-V extensions"))
static int Lookup(ArrayRef< TableEntry > Table, unsigned Opcode)
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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)
CapabilityList getCapabilitiesEnabledByExtension(SPIRV::Extension::Extension Extension)
SPIRV::InstructionSet::InstructionSet getExtInstSetFromString(std::string SetName)
std::string getSymbolicOperandMnemonic(SPIRV::OperandCategory::OperandCategory Category, int32_t Value)
SmallVector< SPIRV::Extension::Extension, 8 > ExtensionList
VersionTuple getSymbolicOperandMinVersion(SPIRV::OperandCategory::OperandCategory Category, uint32_t Value)
SmallVector< SPIRV::Capability::Capability, 8 > CapabilityList
std::string getLinkStringForBuiltIn(SPIRV::BuiltIn::BuiltIn BuiltInValue)
Capability::Capability ReqCapability
OperandCategory::OperandCategory Category
Extension::Extension ReqExtension
OperandCategory::OperandCategory Category
OperandCategory::OperandCategory Category