xref: /freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1//===- SPIRVSymbolicOperands.td ----------------------------*- tablegen -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines symbolic/named operands for various SPIR-V instructions.
10//
11//===----------------------------------------------------------------------===//
12
13include "llvm/TableGen/SearchableTable.td"
14
15//===----------------------------------------------------------------------===//
16// Lookup table containing symbolic operands with the following columns:
17// - Category (Extension/Capability/BuiltIn/etc.)
18// - Value (32-bit representation for binary emission)
19// - Mnemonic (String representation for textual emission)
20// - MinVersion
21// - MaxVersion
22//===----------------------------------------------------------------------===//
23
24// Forward-declare classes used in SymbolicOperand
25class OperandCategory;
26
27class SymbolicOperand<OperandCategory category, bits<32> value, string mnemonic, bits<32> minVersion, bits<32> maxVersion> {
28  OperandCategory Category = category;
29  bits<32> Value = value;
30  string Mnemonic = mnemonic;
31  bits<32> MinVersion = minVersion;
32  bits<32> MaxVersion = maxVersion;
33}
34
35def SymbolicOperands : GenericTable {
36  let FilterClass = "SymbolicOperand";
37  let Fields = ["Category", "Value", "Mnemonic", "MinVersion", "MaxVersion"];
38  string TypeOf_Category = "OperandCategory";
39  let PrimaryKey = ["Category", "Value"];
40  // Function for looking up symbolic operands based on category and value.
41  let PrimaryKeyName = "lookupSymbolicOperandByCategoryAndValue";
42}
43
44// Function for looking up symbolic operands based on just category.
45def lookupSymbolicOperandByCategory : SearchIndex {
46  let Table = SymbolicOperands;
47  let Key = ["Category"];
48}
49
50// Function for looking up symbolic operands based on category and mnemonic.
51def lookupSymbolicOperandByCategoryAndMnemonic : SearchIndex {
52  let Table = SymbolicOperands;
53  let Key = ["Category", "Mnemonic"];
54}
55
56//===----------------------------------------------------------------------===//
57// Lookup table for matching symbolic operands (category + 32-bit value) to
58// a SPIR-V extension.
59//===----------------------------------------------------------------------===//
60
61// Forward-declare classes used in ExtensionEntry
62class Extension;
63
64class ExtensionEntry<OperandCategory category, bits<32> value, Extension reqExtension> {
65  OperandCategory Category = category;
66  bits<32> Value = value;
67  Extension ReqExtension = reqExtension;
68}
69
70def ExtensionEntries : GenericTable {
71  let FilterClass = "ExtensionEntry";
72  let Fields = ["Category", "Value", "ReqExtension"];
73  string TypeOf_Category = "OperandCategory";
74  string TypeOf_ReqExtension = "Extension";
75  let PrimaryKey = ["Category", "Value"];
76  // Function for looking up the extension by category + value.
77  let PrimaryKeyName = "lookupExtensionByCategoryAndValue";
78}
79
80//===----------------------------------------------------------------------===//
81// Lookup table for matching symbolic operands (category + 32-bit value) to
82// SPIR-V capabilities. If an operand requires more than one capability, there
83// will be multiple consecutive entries present in the table.
84//===----------------------------------------------------------------------===//
85
86// Forward-declare classes used in ExtensionEntry
87class Capability;
88
89class CapabilityEntry<OperandCategory category, bits<32> value, Capability reqCabaility> {
90  OperandCategory Category = category;
91  bits<32> Value = value;
92  Capability ReqCapability = reqCabaility;
93}
94
95def CapabilityEntries : GenericTable {
96  let FilterClass = "CapabilityEntry";
97  let Fields = ["Category", "Value", "ReqCapability"];
98  string TypeOf_Category = "OperandCategory";
99  string TypeOf_ReqCapability = "Capability";
100  let PrimaryKey = ["Category", "Value"];
101  // Function for looking up a (the first) capability by category + value. Next
102  // capabilities should be consecutive.
103  let PrimaryKeyName = "lookupCapabilityByCategoryAndValue";
104}
105
106//===----------------------------------------------------------------------===//
107// Multiclass used to define a SymbolicOperand and at the same time declare
108// required extension and capabilities.
109//===----------------------------------------------------------------------===//
110
111multiclass SymbolicOperandWithRequirements<OperandCategory category, bits<32> value, string mnemonic, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
112    assert !ge(!size(mnemonic), 1), "No mnemonic/string representation provided for symbolic operand with value " # value;
113    def : SymbolicOperand<category, value, mnemonic, minVersion, maxVersion>;
114
115    assert !le(!size(reqExtensions), 1), "Too many required extensions for a symbolic/named operand: " # mnemonic;
116    if !eq(!size(reqExtensions), 1) then {
117        def : ExtensionEntry<category, value, reqExtensions[0]>;
118    }
119
120    foreach capability = reqCapabilities in {
121        def : CapabilityEntry<category, value, capability>;
122    }
123}
124
125//===----------------------------------------------------------------------===//
126// Enum defining different categories of symbolic/named operands.
127//===----------------------------------------------------------------------===//
128
129def OperandCategory : GenericEnum {
130  let FilterClass = "OperandCategory";
131}
132
133class OperandCategory;
134
135def ExtensionOperand : OperandCategory;
136def CapabilityOperand : OperandCategory;
137def SourceLanguageOperand : OperandCategory;
138def AddressingModelOperand : OperandCategory;
139def ExecutionModelOperand : OperandCategory;
140def MemoryModelOperand : OperandCategory;
141def ExecutionModeOperand : OperandCategory;
142def StorageClassOperand : OperandCategory;
143def DimOperand : OperandCategory;
144def SamplerAddressingModeOperand : OperandCategory;
145def SamplerFilterModeOperand : OperandCategory;
146def ImageFormatOperand : OperandCategory;
147def ImageChannelOrderOperand : OperandCategory;
148def ImageChannelDataTypeOperand : OperandCategory;
149def ImageOperandOperand : OperandCategory;
150def FPFastMathModeOperand : OperandCategory;
151def FPRoundingModeOperand : OperandCategory;
152def LinkageTypeOperand : OperandCategory;
153def AccessQualifierOperand : OperandCategory;
154def FunctionParameterAttributeOperand : OperandCategory;
155def DecorationOperand : OperandCategory;
156def BuiltInOperand : OperandCategory;
157def SelectionControlOperand : OperandCategory;
158def LoopControlOperand : OperandCategory;
159def FunctionControlOperand : OperandCategory;
160def MemorySemanticsOperand : OperandCategory;
161def MemoryOperandOperand : OperandCategory;
162def ScopeOperand : OperandCategory;
163def GroupOperationOperand : OperandCategory;
164def KernelEnqueueFlagsOperand : OperandCategory;
165def KernelProfilingInfoOperand : OperandCategory;
166def OpcodeOperand : OperandCategory;
167
168//===----------------------------------------------------------------------===//
169// Multiclass used to define Extesions enum values and at the same time
170// SymbolicOperand entries.
171//===----------------------------------------------------------------------===//
172
173def Extension : GenericEnum, Operand<i32> {
174  let FilterClass = "Extension";
175  let NameField = "Name";
176  let ValueField = "Value";
177  let PrintMethod = "printExtension";
178}
179
180class Extension<string name, bits<32> value> {
181  string Name = name;
182  bits<32> Value = value;
183}
184
185multiclass ExtensionOperand<bits<32> value> {
186  def NAME : Extension<NAME, value>;
187  defm : SymbolicOperandWithRequirements<ExtensionOperand, value, NAME, 0, 0, [], []>;
188}
189
190defm SPV_AMD_shader_explicit_vertex_parameter : ExtensionOperand<1>;
191defm SPV_AMD_shader_trinary_minmax_extension : ExtensionOperand<2>;
192defm SPV_AMD_gcn_shader : ExtensionOperand<3>;
193defm SPV_KHR_shader_ballot : ExtensionOperand<4>;
194defm SPV_AMD_shader_ballot : ExtensionOperand<5>;
195defm SPV_AMD_gpu_shader_half_float : ExtensionOperand<6>;
196defm SPV_KHR_shader_draw_parameters : ExtensionOperand<7>;
197defm SPV_KHR_subgroup_vote : ExtensionOperand<8>;
198defm SPV_KHR_16bit_storeage : ExtensionOperand<9>;
199defm SPV_KHR_device_group : ExtensionOperand<10>;
200defm SPV_KHR_multiview : ExtensionOperand<11>;
201defm SPV_NVX_multiview_per_view_attributes : ExtensionOperand<12>;
202defm SPV_NV_viewport_array2 : ExtensionOperand<13>;
203defm SPV_NV_stereo_view_rendering : ExtensionOperand<14>;
204defm SPV_NV_sample_mask_override_coverage : ExtensionOperand<15>;
205defm SPV_NV_geometry_shader_passthrough : ExtensionOperand<16>;
206defm SPV_AMD_texture_gather_bias_lod : ExtensionOperand<17>;
207defm SPV_KHR_storage_buffer_storage_class : ExtensionOperand<18>;
208defm SPV_KHR_variable_pointers : ExtensionOperand<19>;
209defm SPV_AMD_gpu_shader_int16 : ExtensionOperand<20>;
210defm SPV_KHR_post_depth_coverage : ExtensionOperand<21>;
211defm SPV_KHR_shader_atomic_counter_ops : ExtensionOperand<22>;
212defm SPV_EXT_shader_stencil_export : ExtensionOperand<23>;
213defm SPV_EXT_shader_viewport_index_layer : ExtensionOperand<24>;
214defm SPV_AMD_shader_image_load_store_lod : ExtensionOperand<25>;
215defm SPV_AMD_shader_fragment_mask : ExtensionOperand<26>;
216defm SPV_EXT_fragment_fully_covered : ExtensionOperand<27>;
217defm SPV_AMD_gpu_shader_half_float_fetch : ExtensionOperand<28>;
218defm SPV_GOOGLE_decorate_string : ExtensionOperand<29>;
219defm SPV_GOOGLE_hlsl_functionality1 : ExtensionOperand<30>;
220defm SPV_NV_shader_subgroup_partitioned : ExtensionOperand<31>;
221defm SPV_EXT_descriptor_indexing : ExtensionOperand<32>;
222defm SPV_KHR_8bit_storage : ExtensionOperand<33>;
223defm SPV_KHR_vulkan_memory_model : ExtensionOperand<34>;
224defm SPV_NV_ray_tracing : ExtensionOperand<35>;
225defm SPV_NV_compute_shader_derivatives : ExtensionOperand<36>;
226defm SPV_NV_fragment_shader_barycentric : ExtensionOperand<37>;
227defm SPV_NV_mesh_shader : ExtensionOperand<38>;
228defm SPV_NV_shader_image_footprint : ExtensionOperand<39>;
229defm SPV_NV_shading_rate : ExtensionOperand<40>;
230defm SPV_INTEL_subgroups : ExtensionOperand<41>;
231defm SPV_INTEL_media_block_io : ExtensionOperand<42>;
232defm SPV_EXT_fragment_invocation_density : ExtensionOperand<44>;
233defm SPV_KHR_no_integer_wrap_decoration : ExtensionOperand<45>;
234defm SPV_KHR_float_controls : ExtensionOperand<46>;
235defm SPV_EXT_physical_storage_buffer : ExtensionOperand<47>;
236defm SPV_INTEL_fpga_memory_attributes : ExtensionOperand<48>;
237defm SPV_NV_cooperative_matrix : ExtensionOperand<49>;
238defm SPV_INTEL_shader_integer_functions2 : ExtensionOperand<50>;
239defm SPV_INTEL_fpga_loop_controls : ExtensionOperand<51>;
240defm SPV_EXT_fragment_shader_interlock : ExtensionOperand<52>;
241defm SPV_NV_shader_sm_builtins : ExtensionOperand<53>;
242defm SPV_KHR_shader_clock : ExtensionOperand<54>;
243defm SPV_INTEL_unstructured_loop_controls : ExtensionOperand<55>;
244defm SPV_EXT_demote_to_helper_invocation : ExtensionOperand<56>;
245defm SPV_INTEL_fpga_reg : ExtensionOperand<57>;
246
247//===----------------------------------------------------------------------===//
248// Multiclass used to define Capabilities enum values and at the same time
249// SymbolicOperand entries with string mnemonics, versioning, extensions, and
250// capabilities.
251//===----------------------------------------------------------------------===//
252
253def Capability : GenericEnum, Operand<i32> {
254  let FilterClass = "Capability";
255  let NameField = "Name";
256  let ValueField = "Value";
257  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
258}
259
260class Capability<string name, bits<32> value> {
261  string Name = name;
262  bits<32> Value = value;
263}
264
265multiclass CapabilityOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
266  def NAME : Capability<NAME, value>;
267  defm : SymbolicOperandWithRequirements<CapabilityOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
268}
269
270defm Matrix : CapabilityOperand<0, 0, 0, [], []>;
271defm Shader : CapabilityOperand<1, 0, 0, [], [Matrix]>;
272defm Geometry : CapabilityOperand<2, 0, 0, [], [Shader]>;
273defm Tessellation : CapabilityOperand<3, 0, 0, [], [Shader]>;
274defm Addresses : CapabilityOperand<4, 0, 0, [], []>;
275defm Linkage : CapabilityOperand<5, 0, 0, [], []>;
276defm Kernel : CapabilityOperand<6, 0, 0, [], []>;
277defm Vector16 : CapabilityOperand<7, 0, 0, [], [Kernel]>;
278defm Float16Buffer : CapabilityOperand<8, 0, 0, [], [Kernel]>;
279defm Float16 : CapabilityOperand<9, 0, 0, [], []>;
280defm Float64 : CapabilityOperand<10, 0, 0, [], []>;
281defm Int64 : CapabilityOperand<11, 0, 0, [], []>;
282defm Int64Atomics : CapabilityOperand<12, 0, 0, [], [Int64]>;
283defm ImageBasic : CapabilityOperand<13, 0, 0, [], [Kernel]>;
284defm ImageReadWrite : CapabilityOperand<14, 0, 0, [], [ImageBasic]>;
285defm ImageMipmap : CapabilityOperand<15, 0, 0, [], [ImageBasic]>;
286defm Pipes : CapabilityOperand<17, 0, 0, [], [Kernel]>;
287defm Groups : CapabilityOperand<18, 0, 0, [], []>;
288defm DeviceEnqueue : CapabilityOperand<19, 0, 0, [], []>;
289defm LiteralSampler : CapabilityOperand<20, 0, 0, [], [Kernel]>;
290defm AtomicStorage : CapabilityOperand<21, 0, 0, [], [Shader]>;
291defm Int16 : CapabilityOperand<22, 0, 0, [], []>;
292defm TessellationPointSize : CapabilityOperand<23, 0, 0, [], [Tessellation]>;
293defm GeometryPointSize : CapabilityOperand<24, 0, 0, [], [Geometry]>;
294defm ImageGatherExtended : CapabilityOperand<25, 0, 0, [], [Shader]>;
295defm StorageImageMultisample : CapabilityOperand<27, 0, 0, [], [Shader]>;
296defm UniformBufferArrayDynamicIndexing : CapabilityOperand<28, 0, 0, [], [Shader]>;
297defm SampledImageArrayDymnamicIndexing : CapabilityOperand<29, 0, 0, [], [Shader]>;
298defm ClipDistance : CapabilityOperand<32, 0, 0, [], [Shader]>;
299defm CullDistance : CapabilityOperand<33, 0, 0, [], [Shader]>;
300defm SampleRateShading : CapabilityOperand<35, 0, 0, [], [Shader]>;
301defm SampledRect : CapabilityOperand<37, 0, 0, [], [Shader]>;
302defm ImageRect : CapabilityOperand<36, 0, 0, [], [SampledRect]>;
303defm GenericPointer : CapabilityOperand<38, 0, 0, [], [Addresses]>;
304defm Int8 : CapabilityOperand<39, 0, 0, [], []>;
305defm InputAttachment : CapabilityOperand<40, 0, 0, [], [Shader]>;
306defm SparseResidency : CapabilityOperand<41, 0, 0, [], [Shader]>;
307defm MinLod : CapabilityOperand<42, 0, 0, [], [Shader]>;
308defm Sampled1D : CapabilityOperand<43, 0, 0, [], []>;
309defm Image1D : CapabilityOperand<44, 0, 0, [], [Sampled1D]>;
310defm SampledCubeArray : CapabilityOperand<45, 0, 0, [], [Shader]>;
311defm ImageCubeArray : CapabilityOperand<34, 0, 0, [], [SampledCubeArray]>;
312defm SampledBuffer : CapabilityOperand<46, 0, 0, [], []>;
313defm ImageBuffer : CapabilityOperand<47, 0, 0, [], [SampledBuffer]>;
314defm ImageMSArray : CapabilityOperand<48, 0, 0, [], [Shader]>;
315defm StorageImageExtendedFormats : CapabilityOperand<49, 0, 0, [], [Shader]>;
316defm ImageQuery : CapabilityOperand<50, 0, 0, [], [Shader]>;
317defm DerivativeControl : CapabilityOperand<51, 0, 0, [], [Shader]>;
318defm InterpolationFunction : CapabilityOperand<52, 0, 0, [], [Shader]>;
319defm TransformFeedback : CapabilityOperand<53, 0, 0, [], [Shader]>;
320defm GeometryStreams : CapabilityOperand<54, 0, 0, [], [Geometry]>;
321defm StorageImageReadWithoutFormat : CapabilityOperand<55, 0, 0, [], [Shader]>;
322defm StorageImageWriteWithoutFormat : CapabilityOperand<56, 0, 0, [], [Shader]>;
323defm MultiViewport : CapabilityOperand<57, 0, 0, [], [Geometry]>;
324defm SubgroupDispatch : CapabilityOperand<58, 0x10100, 0, [], [DeviceEnqueue]>;
325defm NamedBarrier : CapabilityOperand<59, 0x10100, 0, [], [Kernel]>;
326defm PipeStorage : CapabilityOperand<60, 0x10100, 0, [], [Pipes]>;
327defm GroupNonUniform : CapabilityOperand<61, 0x10300, 0, [], []>;
328defm GroupNonUniformVote : CapabilityOperand<62, 0x10300, 0, [], [GroupNonUniform]>;
329defm GroupNonUniformArithmetic : CapabilityOperand<63, 0x10300, 0, [], [GroupNonUniform]>;
330defm GroupNonUniformBallot : CapabilityOperand<64, 0x10300, 0, [], [GroupNonUniform]>;
331defm GroupNonUniformShuffle : CapabilityOperand<65, 0x10300, 0, [], [GroupNonUniform]>;
332defm GroupNonUniformShuffleRelative : CapabilityOperand<66, 0x10300, 0, [], [GroupNonUniform]>;
333defm GroupNonUniformClustered : CapabilityOperand<67, 0x10300, 0, [], [GroupNonUniform]>;
334defm GroupNonUniformQuad : CapabilityOperand<68, 0x10300, 0, [], [GroupNonUniform]>;
335defm SubgroupBallotKHR : CapabilityOperand<4423, 0, 0, [SPV_KHR_shader_ballot], []>;
336defm DrawParameters : CapabilityOperand<4427, 0x10300, 0, [SPV_KHR_shader_draw_parameters], [Shader]>;
337defm SubgroupVoteKHR : CapabilityOperand<4431, 0, 0, [SPV_KHR_subgroup_vote], []>;
338defm StorageBuffer16BitAccess : CapabilityOperand<4433, 0x10300, 0, [SPV_KHR_16bit_storeage], []>;
339defm StorageUniform16 : CapabilityOperand<4434, 0x10300, 0, [SPV_KHR_16bit_storeage], [StorageBuffer16BitAccess]>;
340defm StoragePushConstant16 : CapabilityOperand<4435, 0x10300, 0, [SPV_KHR_16bit_storeage], []>;
341defm StorageInputOutput16 : CapabilityOperand<4436, 0x10300, 0, [SPV_KHR_16bit_storeage], []>;
342defm DeviceGroup : CapabilityOperand<4437, 0x10300, 0, [SPV_KHR_device_group], []>;
343defm MultiView : CapabilityOperand<4439, 0x10300, 0, [SPV_KHR_multiview], [Shader]>;
344defm VariablePointersStorageBuffer : CapabilityOperand<4441, 0x10300, 0, [SPV_KHR_variable_pointers], [Shader]>;
345defm VariablePointers : CapabilityOperand<4442, 0x10300, 0, [SPV_KHR_variable_pointers], [VariablePointersStorageBuffer]>;
346defm AtomicStorageOps : CapabilityOperand<4445, 0, 0, [SPV_KHR_shader_atomic_counter_ops], []>;
347defm SampleMaskPostDepthCoverage : CapabilityOperand<4447, 0, 0, [SPV_KHR_post_depth_coverage], []>;
348defm StorageBuffer8BitAccess : CapabilityOperand<4448, 0, 0, [SPV_KHR_8bit_storage], []>;
349defm UniformAndStorageBuffer8BitAccess : CapabilityOperand<4449, 0, 0, [SPV_KHR_8bit_storage], [StorageBuffer8BitAccess]>;
350defm StoragePushConstant8 : CapabilityOperand<4450, 0, 0, [SPV_KHR_8bit_storage], []>;
351defm DenormPreserve : CapabilityOperand<4464, 0x10400, 0, [SPV_KHR_float_controls], []>;
352defm DenormFlushToZero : CapabilityOperand<4465, 0x10400, 0, [SPV_KHR_float_controls], []>;
353defm SignedZeroInfNanPreserve : CapabilityOperand<4466, 0x10400, 0, [SPV_KHR_float_controls], []>;
354defm RoundingModeRTE : CapabilityOperand<4467, 0x10400, 0, [SPV_KHR_float_controls], []>;
355defm RoundingModeRTZ : CapabilityOperand<4468, 0x10400, 0, [SPV_KHR_float_controls], []>;
356defm Float16ImageAMD : CapabilityOperand<5008, 0, 0, [], [Shader]>;
357defm ImageGatherBiasLodAMD : CapabilityOperand<5009, 0, 0, [], [Shader]>;
358defm FragmentMaskAMD : CapabilityOperand<5010, 0, 0, [], [Shader]>;
359defm StencilExportEXT : CapabilityOperand<5013, 0, 0, [], [Shader]>;
360defm ImageReadWriteLodAMD : CapabilityOperand<5015, 0, 0, [], [Shader]>;
361defm SampleMaskOverrideCoverageNV : CapabilityOperand<5249, 0, 0, [], [SampleRateShading]>;
362defm GeometryShaderPassthroughNV : CapabilityOperand<5251, 0, 0, [], [Geometry]>;
363defm ShaderViewportIndexLayerEXT : CapabilityOperand<5254, 0, 0, [], [MultiViewport]>;
364defm ShaderViewportMaskNV : CapabilityOperand<5255, 0, 0, [], [ShaderViewportIndexLayerEXT]>;
365defm ShaderStereoViewNV : CapabilityOperand<5259, 0, 0, [], [ShaderViewportMaskNV]>;
366defm PerViewAttributesNV : CapabilityOperand<5260, 0, 0, [], [MultiView]>;
367defm FragmentFullyCoveredEXT : CapabilityOperand<5265, 0, 0, [], [Shader]>;
368defm MeshShadingNV : CapabilityOperand<5266, 0, 0, [], [Shader]>;
369defm ShaderNonUniformEXT : CapabilityOperand<5301, 0, 0, [], [Shader]>;
370defm RuntimeDescriptorArrayEXT : CapabilityOperand<5302, 0, 0, [], [Shader]>;
371defm InputAttachmentArrayDynamicIndexingEXT : CapabilityOperand<5303, 0, 0, [], [InputAttachment]>;
372defm UniformTexelBufferArrayDynamicIndexingEXT : CapabilityOperand<5304, 0, 0, [], [SampledBuffer]>;
373defm StorageTexelBufferArrayDynamicIndexingEXT : CapabilityOperand<5305, 0, 0, [], [ImageBuffer]>;
374defm UniformBufferArrayNonUniformIndexingEXT : CapabilityOperand<5306, 0, 0, [], [ShaderNonUniformEXT]>;
375defm SampledImageArrayNonUniformIndexingEXT : CapabilityOperand<5307, 0, 0, [], [ShaderNonUniformEXT]>;
376defm StorageBufferArrayNonUniformIndexingEXT : CapabilityOperand<5308, 0, 0, [], [ShaderNonUniformEXT]>;
377defm StorageImageArrayNonUniformIndexingEXT : CapabilityOperand<5309, 0, 0, [], [ShaderNonUniformEXT]>;
378defm InputAttachmentArrayNonUniformIndexingEXT : CapabilityOperand<5310, 0, 0, [], [InputAttachment, ShaderNonUniformEXT]>;
379defm UniformTexelBufferArrayNonUniformIndexingEXT : CapabilityOperand<5311, 0, 0, [], [SampledBuffer, ShaderNonUniformEXT]>;
380defm StorageTexelBufferArrayNonUniformIndexingEXT : CapabilityOperand<5312, 0, 0, [], [ImageBuffer, ShaderNonUniformEXT]>;
381defm RayTracingNV : CapabilityOperand<5340, 0, 0, [], [Shader]>;
382defm SubgroupShuffleINTEL : CapabilityOperand<5568, 0, 0, [], []>;
383defm SubgroupBufferBlockIOINTEL : CapabilityOperand<5569, 0, 0, [], []>;
384defm SubgroupImageBlockIOINTEL : CapabilityOperand<5570, 0, 0, [], []>;
385defm SubgroupImageMediaBlockIOINTEL : CapabilityOperand<5579, 0, 0, [], []>;
386defm SubgroupAvcMotionEstimationINTEL : CapabilityOperand<5696, 0, 0, [], []>;
387defm SubgroupAvcMotionEstimationIntraINTEL : CapabilityOperand<5697, 0, 0, [], []>;
388defm SubgroupAvcMotionEstimationChromaINTEL : CapabilityOperand<5698, 0, 0, [], []>;
389defm GroupNonUniformPartitionedNV : CapabilityOperand<5297, 0, 0, [], []>;
390defm VulkanMemoryModelKHR : CapabilityOperand<5345, 0, 0, [], []>;
391defm VulkanMemoryModelDeviceScopeKHR : CapabilityOperand<5346, 0, 0, [], []>;
392defm ImageFootprintNV : CapabilityOperand<5282, 0, 0, [], []>;
393defm FragmentBarycentricNV : CapabilityOperand<5284, 0, 0, [], []>;
394defm ComputeDerivativeGroupQuadsNV : CapabilityOperand<5288, 0, 0, [], []>;
395defm ComputeDerivativeGroupLinearNV : CapabilityOperand<5350, 0, 0, [], []>;
396defm FragmentDensityEXT : CapabilityOperand<5291, 0, 0, [], [Shader]>;
397defm PhysicalStorageBufferAddressesEXT : CapabilityOperand<5347, 0, 0, [], [Shader]>;
398defm CooperativeMatrixNV : CapabilityOperand<5357, 0, 0, [], [Shader]>;
399
400//===----------------------------------------------------------------------===//
401// Multiclass used to define SourceLanguage enum values and at the same time
402// SymbolicOperand entries.
403//===----------------------------------------------------------------------===//
404
405def SourceLanguage : GenericEnum, Operand<i32> {
406  let FilterClass = "SourceLanguage";
407  let NameField = "Name";
408  let ValueField = "Value";
409  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
410}
411
412class SourceLanguage<string name, bits<32> value> {
413  string Name = name;
414  bits<32> Value = value;
415}
416
417multiclass SourceLanguageOperand<bits<32> value> {
418  def : SourceLanguage<NAME, value>;
419  defm : SymbolicOperandWithRequirements<SourceLanguageOperand, value, NAME, 0, 0, [], []>;
420}
421
422defm Unknown : SourceLanguageOperand<0>;
423defm ESSL : SourceLanguageOperand<1>;
424defm GLSL : SourceLanguageOperand<2>;
425defm OpenCL_C : SourceLanguageOperand<3>;
426defm OpenCL_CPP : SourceLanguageOperand<4>;
427defm HLSL : SourceLanguageOperand<5>;
428
429//===----------------------------------------------------------------------===//
430// Multiclass used to define AddressingModel enum values and at the same time
431// SymbolicOperand entries with string mnemonics, and capabilities.
432//===----------------------------------------------------------------------===//
433
434def AddressingModel : GenericEnum, Operand<i32> {
435  let FilterClass = "AddressingModel";
436  let NameField = "Name";
437  let ValueField = "Value";
438  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
439}
440
441class AddressingModel<string name, bits<32> value> {
442  string Name = name;
443  bits<32> Value = value;
444}
445
446multiclass AddressingModelOperand<bits<32> value, list<Capability> reqCapabilities> {
447  def : AddressingModel<NAME, value>;
448  defm : SymbolicOperandWithRequirements<AddressingModelOperand, value, NAME, 0, 0, [], reqCapabilities>;
449}
450
451defm Logical : AddressingModelOperand<0, []>;
452defm Physical32 : AddressingModelOperand<1, [Addresses]>;
453defm Physical64 : AddressingModelOperand<2, [Addresses]>;
454defm PhysicalStorageBuffer64EXT : AddressingModelOperand<5348, [PhysicalStorageBufferAddressesEXT]>;
455
456//===----------------------------------------------------------------------===//
457// Multiclass used to define ExecutionModel enum values and at the same time
458// SymbolicOperand entries with string mnemonics and capabilities.
459//===----------------------------------------------------------------------===//
460
461def ExecutionModel : GenericEnum, Operand<i32> {
462  let FilterClass = "ExecutionModel";
463  let NameField = "Name";
464  let ValueField = "Value";
465  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
466}
467
468class ExecutionModel<string name, bits<32> value> {
469  string Name = name;
470  bits<32> Value = value;
471}
472
473multiclass ExecutionModelOperand<bits<32> value, list<Capability> reqCapabilities> {
474  def : ExecutionModel<NAME, value>;
475  defm : SymbolicOperandWithRequirements<ExecutionModelOperand, value, NAME, 0, 0, [], reqCapabilities>;
476}
477
478defm Vertex : ExecutionModelOperand<0, [Shader]>;
479defm TessellationControl: ExecutionModelOperand<1, [Tessellation]>;
480defm TessellationEvaluation: ExecutionModelOperand<2, [Tessellation]>;
481defm Geometry: ExecutionModelOperand<3, [Geometry]>;
482defm Fragment: ExecutionModelOperand<4, [Shader]>;
483defm GLCompute: ExecutionModelOperand<5, [Shader]>;
484defm Kernel: ExecutionModelOperand<6, [Kernel]>;
485defm TaskNV: ExecutionModelOperand<5267, [MeshShadingNV]>;
486defm MeshNV: ExecutionModelOperand<5268, [MeshShadingNV]>;
487defm RayGenerationNV: ExecutionModelOperand<5313, [RayTracingNV]>;
488defm IntersectionNV: ExecutionModelOperand<5314, [RayTracingNV]>;
489defm AnyHitNV: ExecutionModelOperand<5315, [RayTracingNV]>;
490defm ClosestHitNV: ExecutionModelOperand<5316, [RayTracingNV]>;
491defm MissNV: ExecutionModelOperand<5317, [RayTracingNV]>;
492defm CallableNV: ExecutionModelOperand<5318, [RayTracingNV]>;
493
494//===----------------------------------------------------------------------===//
495// Multiclass used to define MemoryModel enum values and at the same time
496// SymbolicOperand entries with string mnemonics and capabilities.
497//===----------------------------------------------------------------------===//
498
499def MemoryModel : GenericEnum, Operand<i32> {
500  let FilterClass = "MemoryModel";
501  let NameField = "Name";
502  let ValueField = "Value";
503  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
504}
505
506class MemoryModel<string name, bits<32> value> {
507  string Name = name;
508  bits<32> Value = value;
509}
510
511multiclass MemoryModelOperand<bits<32> value, list<Capability> reqCapabilities> {
512  def : MemoryModel<NAME, value>;
513  defm : SymbolicOperandWithRequirements<MemoryModelOperand, value, NAME, 0, 0, [], reqCapabilities>;
514}
515
516defm Simple : MemoryModelOperand<0, [Shader]>;
517defm GLSL450 : MemoryModelOperand<1, [Shader]>;
518defm OpenCL : MemoryModelOperand<2, [Kernel]>;
519defm VulkanKHR : MemoryModelOperand<3, [VulkanMemoryModelKHR]>;
520
521//===----------------------------------------------------------------------===//
522// Multiclass used to define ExecutionMode enum values and at the same time
523// SymbolicOperand entries with string mnemonics and capabilities.
524//===----------------------------------------------------------------------===//
525
526def ExecutionMode : GenericEnum, Operand<i32> {
527  let FilterClass = "ExecutionMode";
528  let NameField = "Name";
529  let ValueField = "Value";
530  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
531}
532
533class ExecutionMode<string name, bits<32> value> {
534  string Name = name;
535  bits<32> Value = value;
536}
537
538multiclass ExecutionModeOperand<bits<32> value, list<Capability> reqCapabilities> {
539  def : ExecutionMode<NAME, value>;
540  defm : SymbolicOperandWithRequirements<ExecutionModeOperand, value, NAME, 0, 0, [], reqCapabilities>;
541}
542
543defm Invocations : ExecutionModeOperand<0, [Geometry]>;
544defm SpacingEqual : ExecutionModeOperand<1, [Tessellation]>;
545defm SpacingFractionalEven : ExecutionModeOperand<2, [Tessellation]>;
546defm SpacingFractionalOdd : ExecutionModeOperand<3, [Tessellation]>;
547defm VertexOrderCw : ExecutionModeOperand<4, [Tessellation]>;
548defm VertexOrderCcw : ExecutionModeOperand<5, [Tessellation]>;
549defm PixelCenterInteger : ExecutionModeOperand<6, [Shader]>;
550defm OriginUpperLeft : ExecutionModeOperand<7, [Shader]>;
551defm OriginLowerLeft : ExecutionModeOperand<8, [Shader]>;
552defm EarlyFragmentTests : ExecutionModeOperand<9, [Shader]>;
553defm PointMode : ExecutionModeOperand<10, [Tessellation]>;
554defm Xfb : ExecutionModeOperand<11, [TransformFeedback]>;
555defm DepthReplacing : ExecutionModeOperand<12, [Shader]>;
556defm DepthGreater : ExecutionModeOperand<14, [Shader]>;
557defm DepthLess : ExecutionModeOperand<15, [Shader]>;
558defm DepthUnchanged : ExecutionModeOperand<16, [Shader]>;
559defm LocalSize : ExecutionModeOperand<17, []>;
560defm LocalSizeHint : ExecutionModeOperand<18, [Kernel]>;
561defm InputPoints : ExecutionModeOperand<19, [Geometry]>;
562defm InputLines : ExecutionModeOperand<20, [Geometry]>;
563defm InputLinesAdjacency : ExecutionModeOperand<21, [Geometry]>;
564defm Triangles : ExecutionModeOperand<22, [Geometry]>;
565defm InputTrianglesAdjacency : ExecutionModeOperand<23, [Geometry]>;
566defm Quads : ExecutionModeOperand<24, [Tessellation]>;
567defm Isolines : ExecutionModeOperand<25, [Tessellation]>;
568defm OutputVertices : ExecutionModeOperand<26, [Geometry]>;
569defm OutputPoints : ExecutionModeOperand<27, [Geometry]>;
570defm OutputLineStrip : ExecutionModeOperand<28, [Geometry]>;
571defm OutputTriangleStrip : ExecutionModeOperand<29, [Geometry]>;
572defm VecTypeHint : ExecutionModeOperand<30, [Kernel]>;
573defm ContractionOff : ExecutionModeOperand<31, [Kernel]>;
574defm Initializer : ExecutionModeOperand<33, [Kernel]>;
575defm Finalizer : ExecutionModeOperand<34, [Kernel]>;
576defm SubgroupSize : ExecutionModeOperand<35, [SubgroupDispatch]>;
577defm SubgroupsPerWorkgroup : ExecutionModeOperand<36, [SubgroupDispatch]>;
578defm SubgroupsPerWorkgroupId : ExecutionModeOperand<37, [SubgroupDispatch]>;
579defm LocalSizeId : ExecutionModeOperand<38, []>;
580defm LocalSizeHintId : ExecutionModeOperand<39, [Kernel]>;
581defm PostDepthCoverage : ExecutionModeOperand<4446, [SampleMaskPostDepthCoverage]>;
582defm DenormPreserve : ExecutionModeOperand<4459, [DenormPreserve]>;
583defm DenormFlushToZero : ExecutionModeOperand<4460, [DenormFlushToZero]>;
584defm SignedZeroInfNanPreserve : ExecutionModeOperand<4461, [SignedZeroInfNanPreserve]>;
585defm RoundingModeRTE : ExecutionModeOperand<4462, [RoundingModeRTE]>;
586defm RoundingModeRTZ : ExecutionModeOperand<4463, [RoundingModeRTZ]>;
587defm StencilRefReplacingEXT : ExecutionModeOperand<5027, [StencilExportEXT]>;
588defm OutputLinesNV : ExecutionModeOperand<5269, [MeshShadingNV]>;
589defm DerivativeGroupQuadsNV : ExecutionModeOperand<5289, [ComputeDerivativeGroupQuadsNV]>;
590defm DerivativeGroupLinearNV : ExecutionModeOperand<5290, [ComputeDerivativeGroupLinearNV]>;
591defm OutputTrianglesNV : ExecutionModeOperand<5298, [MeshShadingNV]>;
592
593//===----------------------------------------------------------------------===//
594// Multiclass used to define StorageClass enum values and at the same time
595// SymbolicOperand entries with string mnemonics and capabilities.
596//===----------------------------------------------------------------------===//
597
598def StorageClass : GenericEnum, Operand<i32> {
599  let FilterClass = "StorageClass";
600  let NameField = "Name";
601  let ValueField = "Value";
602  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
603}
604
605class StorageClass<string name, bits<32> value> {
606  string Name = name;
607  bits<32> Value = value;
608}
609
610multiclass StorageClassOperand<bits<32> value, list<Capability> reqCapabilities> {
611  def : StorageClass<NAME, value>;
612  defm : SymbolicOperandWithRequirements<StorageClassOperand, value, NAME, 0, 0, [], reqCapabilities>;
613}
614
615defm UniformConstant : StorageClassOperand<0, []>;
616defm Input : StorageClassOperand<1, []>;
617defm Uniform : StorageClassOperand<2, [Shader]>;
618defm Output : StorageClassOperand<3, [Shader]>;
619defm Workgroup : StorageClassOperand<4, []>;
620defm CrossWorkgroup : StorageClassOperand<5, []>;
621defm Private : StorageClassOperand<6, [Shader]>;
622defm Function : StorageClassOperand<7, []>;
623defm Generic : StorageClassOperand<8, [GenericPointer]>;
624defm PushConstant : StorageClassOperand<9, [Shader]>;
625defm AtomicCounter : StorageClassOperand<10, [AtomicStorage]>;
626defm Image : StorageClassOperand<11, []>;
627defm StorageBuffer : StorageClassOperand<12, [Shader]>;
628defm CallableDataNV : StorageClassOperand<5328, [RayTracingNV]>;
629defm IncomingCallableDataNV : StorageClassOperand<5329, [RayTracingNV]>;
630defm RayPayloadNV : StorageClassOperand<5338, [RayTracingNV]>;
631defm HitAttributeNV : StorageClassOperand<5339, [RayTracingNV]>;
632defm IncomingRayPayloadNV : StorageClassOperand<5342, [RayTracingNV]>;
633defm ShaderRecordBufferNV : StorageClassOperand<5343, [RayTracingNV]>;
634defm PhysicalStorageBufferEXT : StorageClassOperand<5349, [PhysicalStorageBufferAddressesEXT]>;
635
636//===----------------------------------------------------------------------===//
637// Multiclass used to define Dim enum values and at the same time
638// SymbolicOperand entries with string mnemonics and capabilities.
639//===----------------------------------------------------------------------===//
640
641def Dim : GenericEnum, Operand<i32> {
642  let FilterClass = "Dim";
643  let NameField = "Name";
644  let ValueField = "Value";
645  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
646}
647
648class Dim<string name, bits<32> value> {
649  string Name = name;
650  bits<32> Value = value;
651}
652
653multiclass DimOperand<bits<32> value, string mnemonic, list<Capability> reqCapabilities> {
654  def NAME : Dim<NAME, value>;
655  defm : SymbolicOperandWithRequirements<DimOperand, value, mnemonic, 0, 0, [], reqCapabilities>;
656}
657
658defm DIM_1D : DimOperand<0, "1D", [Sampled1D, Image1D]>;
659defm DIM_2D : DimOperand<1, "2D", [Shader, Kernel, ImageMSArray]>;
660defm DIM_3D : DimOperand<2, "3D", []>;
661defm DIM_Cube : DimOperand<3, "Cube", [Shader, ImageCubeArray]>;
662defm DIM_Rect : DimOperand<4, "Rect", [SampledRect, ImageRect]>;
663defm DIM_Buffer : DimOperand<5, "Buffer", [SampledBuffer, ImageBuffer]>;
664defm DIM_SubpassData : DimOperand<6, "SubpassData", [InputAttachment]>;
665
666//===----------------------------------------------------------------------===//
667// Multiclass used to define SamplerAddressingMode enum values and at the same
668// time SymbolicOperand entries with string mnemonics and capabilities.
669//===----------------------------------------------------------------------===//
670
671def SamplerAddressingMode : GenericEnum, Operand<i32> {
672  let FilterClass = "SamplerAddressingMode";
673  let NameField = "Name";
674  let ValueField = "Value";
675  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
676}
677
678class SamplerAddressingMode<string name, bits<32> value> {
679  string Name = name;
680  bits<32> Value = value;
681}
682
683multiclass SamplerAddressingModeOperand<bits<32> value, list<Capability> reqCapabilities> {
684  def : SamplerAddressingMode<NAME, value>;
685  defm : SymbolicOperandWithRequirements<SamplerAddressingModeOperand, value, NAME, 0, 0, [], reqCapabilities>;
686}
687
688defm None : SamplerAddressingModeOperand<0, [Kernel]>;
689defm ClampToEdge : SamplerAddressingModeOperand<1, [Kernel]>;
690defm Clamp : SamplerAddressingModeOperand<2, [Kernel]>;
691defm Repeat : SamplerAddressingModeOperand<3, [Kernel]>;
692defm RepeatMirrored : SamplerAddressingModeOperand<4, [Kernel]>;
693
694//===----------------------------------------------------------------------===//
695// Multiclass used to define SamplerFilterMode enum values and at the same
696// time SymbolicOperand entries with string mnemonics and capabilities.
697//===----------------------------------------------------------------------===//
698
699def SamplerFilterMode : GenericEnum, Operand<i32> {
700  let FilterClass = "SamplerFilterMode";
701  let NameField = "Name";
702  let ValueField = "Value";
703  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
704}
705
706class SamplerFilterMode<string name, bits<32> value> {
707  string Name = name;
708  bits<32> Value = value;
709}
710
711multiclass SamplerFilterModeOperand<bits<32> value, list<Capability> reqCapabilities> {
712  def : SamplerFilterMode<NAME, value>;
713  defm : SymbolicOperandWithRequirements<SamplerFilterModeOperand, value, NAME, 0, 0, [], reqCapabilities>;
714}
715
716defm Nearest : SamplerFilterModeOperand<0, [Kernel]>;
717defm Linear : SamplerFilterModeOperand<1, [Kernel]>;
718
719//===----------------------------------------------------------------------===//
720// Multiclass used to define ImageFormat enum values and at the same time
721// SymbolicOperand entries with string mnemonics and capabilities.
722//===----------------------------------------------------------------------===//
723
724def ImageFormat : GenericEnum, Operand<i32> {
725  let FilterClass = "ImageFormat";
726  let NameField = "Name";
727  let ValueField = "Value";
728  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
729}
730
731class ImageFormat<string name, bits<32> value> {
732  string Name = name;
733  bits<32> Value = value;
734}
735
736multiclass ImageFormatOperand<bits<32> value, list<Capability> reqCapabilities> {
737  def NAME : ImageFormat<NAME, value>;
738  defm : SymbolicOperandWithRequirements<ImageFormatOperand, value, NAME, 0, 0, [], reqCapabilities>;
739}
740
741defm Unknown : ImageFormatOperand<0, []>;
742defm Rgba32f : ImageFormatOperand<1, [Shader]>;
743defm Rgba16f : ImageFormatOperand<2, [Shader]>;
744defm R32f : ImageFormatOperand<3, [Shader]>;
745defm Rgba8 : ImageFormatOperand<4, [Shader]>;
746defm Rgba8Snorm : ImageFormatOperand<5, [Shader]>;
747defm Rg32f : ImageFormatOperand<6, [StorageImageExtendedFormats]>;
748defm Rg16f : ImageFormatOperand<7, [StorageImageExtendedFormats]>;
749defm R11fG11fB10f : ImageFormatOperand<8, [StorageImageExtendedFormats]>;
750defm R16f : ImageFormatOperand<9, [StorageImageExtendedFormats]>;
751defm Rgba16 : ImageFormatOperand<10, [StorageImageExtendedFormats]>;
752defm Rgb10A2 : ImageFormatOperand<11, [StorageImageExtendedFormats]>;
753defm Rg16 : ImageFormatOperand<12, [StorageImageExtendedFormats]>;
754defm Rg8 : ImageFormatOperand<13, [StorageImageExtendedFormats]>;
755defm R16 : ImageFormatOperand<14, [StorageImageExtendedFormats]>;
756defm R8 : ImageFormatOperand<15, [StorageImageExtendedFormats]>;
757defm Rgba16Snorm : ImageFormatOperand<16, [StorageImageExtendedFormats]>;
758defm Rg16Snorm : ImageFormatOperand<17, [StorageImageExtendedFormats]>;
759defm Rg8Snorm : ImageFormatOperand<18, [StorageImageExtendedFormats]>;
760defm R16Snorm : ImageFormatOperand<19, [StorageImageExtendedFormats]>;
761defm R8Snorm : ImageFormatOperand<20, [StorageImageExtendedFormats]>;
762defm Rgba32i : ImageFormatOperand<21, [Shader]>;
763defm Rgba16i : ImageFormatOperand<22, [Shader]>;
764defm Rgba8i : ImageFormatOperand<23, [Shader]>;
765defm R32i : ImageFormatOperand<24, [Shader]>;
766defm Rg32i : ImageFormatOperand<25, [StorageImageExtendedFormats]>;
767defm Rg16i : ImageFormatOperand<26, [StorageImageExtendedFormats]>;
768defm Rg8i : ImageFormatOperand<27, [StorageImageExtendedFormats]>;
769defm R16i : ImageFormatOperand<28, [StorageImageExtendedFormats]>;
770defm R8i : ImageFormatOperand<29, [StorageImageExtendedFormats]>;
771defm Rgba32ui : ImageFormatOperand<30, [Shader]>;
772defm Rgba16ui : ImageFormatOperand<31, [Shader]>;
773defm Rgba8ui : ImageFormatOperand<32, [Shader]>;
774defm R32ui : ImageFormatOperand<33, [Shader]>;
775defm Rgb10a2ui : ImageFormatOperand<34, [StorageImageExtendedFormats]>;
776defm Rg32ui : ImageFormatOperand<35, [StorageImageExtendedFormats]>;
777defm Rg16ui : ImageFormatOperand<36, [StorageImageExtendedFormats]>;
778defm Rg8ui : ImageFormatOperand<37, [StorageImageExtendedFormats]>;
779defm R16ui : ImageFormatOperand<38, [StorageImageExtendedFormats]>;
780defm R8ui : ImageFormatOperand<39, [StorageImageExtendedFormats]>;
781
782//===----------------------------------------------------------------------===//
783// Multiclass used to define ImageChannelOrder enum values and at the same time
784// SymbolicOperand entries with string mnemonics and capabilities.
785//===----------------------------------------------------------------------===//
786
787def ImageChannelOrder : GenericEnum, Operand<i32> {
788  let FilterClass = "ImageChannelOrder";
789  let NameField = "Name";
790  let ValueField = "Value";
791  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
792}
793
794class ImageChannelOrder<string name, bits<32> value> {
795  string Name = name;
796  bits<32> Value = value;
797}
798
799multiclass ImageChannelOrderOperand<bits<32> value, list<Capability> reqCapabilities> {
800  def : ImageChannelOrder<NAME, value>;
801  defm : SymbolicOperandWithRequirements<ImageChannelOrderOperand, value, NAME, 0, 0, [], reqCapabilities>;
802}
803
804defm R : ImageChannelOrderOperand<0, [Kernel]>;
805defm A : ImageChannelOrderOperand<1, [Kernel]>;
806defm RG : ImageChannelOrderOperand<2, [Kernel]>;
807defm RA : ImageChannelOrderOperand<3, [Kernel]>;
808defm RGB : ImageChannelOrderOperand<4, [Kernel]>;
809defm RGBA : ImageChannelOrderOperand<5, [Kernel]>;
810defm BGRA : ImageChannelOrderOperand<6, [Kernel]>;
811defm ARGB : ImageChannelOrderOperand<7, [Kernel]>;
812defm Intensity : ImageChannelOrderOperand<8, [Kernel]>;
813defm Luminance : ImageChannelOrderOperand<9, [Kernel]>;
814defm Rx : ImageChannelOrderOperand<10, [Kernel]>;
815defm RGx : ImageChannelOrderOperand<11, [Kernel]>;
816defm RGBx : ImageChannelOrderOperand<12, [Kernel]>;
817defm Depth : ImageChannelOrderOperand<13, [Kernel]>;
818defm DepthStencil : ImageChannelOrderOperand<14, [Kernel]>;
819defm sRGB : ImageChannelOrderOperand<15, [Kernel]>;
820defm sRGBx : ImageChannelOrderOperand<16, [Kernel]>;
821defm sRGBA : ImageChannelOrderOperand<17, [Kernel]>;
822defm sBGRA : ImageChannelOrderOperand<18, [Kernel]>;
823defm ABGR : ImageChannelOrderOperand<19, [Kernel]>;
824
825//===----------------------------------------------------------------------===//
826// Multiclass used to define ImageChannelDataType enum values and at the same
827// time SymbolicOperand entries with string mnemonics and capabilities.
828//===----------------------------------------------------------------------===//
829
830def ImageChannelDataType : GenericEnum, Operand<i32> {
831  let FilterClass = "ImageChannelDataType";
832  let NameField = "Name";
833  let ValueField = "Value";
834  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
835}
836
837class ImageChannelDataType<string name, bits<32> value> {
838  string Name = name;
839  bits<32> Value = value;
840}
841
842multiclass ImageChannelDataTypeOperand<bits<32> value, list<Capability> reqCapabilities> {
843  def : ImageChannelDataType<NAME, value>;
844  defm : SymbolicOperandWithRequirements<ImageChannelDataTypeOperand, value, NAME, 0, 0, [], reqCapabilities>;
845}
846
847defm SnormInt8 : ImageChannelDataTypeOperand<0, []>;
848defm SnormInt16 : ImageChannelDataTypeOperand<1, []>;
849defm UnormInt8 : ImageChannelDataTypeOperand<2, [Kernel]>;
850defm UnormInt16 : ImageChannelDataTypeOperand<3, [Kernel]>;
851defm UnormShort565 : ImageChannelDataTypeOperand<4, [Kernel]>;
852defm UnormShort555 : ImageChannelDataTypeOperand<5, [Kernel]>;
853defm UnormInt101010 : ImageChannelDataTypeOperand<6, [Kernel]>;
854defm SignedInt8 : ImageChannelDataTypeOperand<7, [Kernel]>;
855defm SignedInt16 : ImageChannelDataTypeOperand<8, [Kernel]>;
856defm SignedInt32 : ImageChannelDataTypeOperand<9, [Kernel]>;
857defm UnsignedInt8 : ImageChannelDataTypeOperand<10, [Kernel]>;
858defm UnsignedInt16 : ImageChannelDataTypeOperand<11, [Kernel]>;
859defm UnsigendInt32 : ImageChannelDataTypeOperand<12, [Kernel]>;
860defm HalfFloat : ImageChannelDataTypeOperand<13, [Kernel]>;
861defm Float : ImageChannelDataTypeOperand<14, [Kernel]>;
862defm UnormInt24 : ImageChannelDataTypeOperand<15, [Kernel]>;
863defm UnormInt101010_2 : ImageChannelDataTypeOperand<16, [Kernel]>;
864
865//===----------------------------------------------------------------------===//
866// Multiclass used to define ImageOperand enum values and at the same time
867// SymbolicOperand entries with string mnemonics and capabilities.
868//===----------------------------------------------------------------------===//
869
870def ImageOperand : GenericEnum, Operand<i32> {
871  let FilterClass = "ImageOperand";
872  let NameField = "Name";
873  let ValueField = "Value";
874  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
875}
876
877class ImageOperand<string name, bits<32> value> {
878  string Name = name;
879  bits<32> Value = value;
880}
881
882multiclass ImageOperandOperand<bits<32> value, list<Capability> reqCapabilities> {
883  def : ImageOperand<NAME, value>;
884  defm : SymbolicOperandWithRequirements<ImageOperandOperand, value, NAME, 0, 0, [], reqCapabilities>;
885}
886
887defm None : ImageOperandOperand<0x0, []>;
888defm Bias : ImageOperandOperand<0x1, [Shader]>;
889defm Lod : ImageOperandOperand<0x2, []>;
890defm Grad : ImageOperandOperand<0x4, []>;
891defm ConstOffset : ImageOperandOperand<0x8, []>;
892defm Offset : ImageOperandOperand<0x10, [ImageGatherExtended]>;
893defm ConstOffsets : ImageOperandOperand<0x20, [ImageGatherExtended]>;
894defm Sample : ImageOperandOperand<0x40, []>;
895defm MinLod : ImageOperandOperand<0x80, [MinLod]>;
896defm MakeTexelAvailableKHR : ImageOperandOperand<0x100, [VulkanMemoryModelKHR]>;
897defm MakeTexelVisibleKHR : ImageOperandOperand<0x200, [VulkanMemoryModelKHR]>;
898defm NonPrivateTexelKHR : ImageOperandOperand<0x400, [VulkanMemoryModelKHR]>;
899defm VolatileTexelKHR : ImageOperandOperand<0x800, [VulkanMemoryModelKHR]>;
900defm SignExtend : ImageOperandOperand<0x1000, []>;
901defm ZeroExtend : ImageOperandOperand<0x2000, []>;
902
903//===----------------------------------------------------------------------===//
904// Multiclass used to define FPFastMathMode enum values and at the same time
905// SymbolicOperand entries with string mnemonics and capabilities.
906//===----------------------------------------------------------------------===//
907
908def FPFastMathMode : GenericEnum, Operand<i32> {
909  let FilterClass = "FPFastMathMode";
910  let NameField = "Name";
911  let ValueField = "Value";
912  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
913}
914
915class FPFastMathMode<string name, bits<32> value> {
916  string Name = name;
917  bits<32> Value = value;
918}
919
920multiclass FPFastMathModeOperand<bits<32> value, list<Capability> reqCapabilities> {
921  def : FPFastMathMode<NAME, value>;
922  defm : SymbolicOperandWithRequirements<FPFastMathModeOperand, value, NAME, 0, 0, [], reqCapabilities>;
923}
924
925defm None : FPFastMathModeOperand<0x0, []>;
926defm NotNaN : FPFastMathModeOperand<0x1, [Kernel]>;
927defm NotInf : FPFastMathModeOperand<0x2, [Kernel]>;
928defm NSZ : FPFastMathModeOperand<0x4, [Kernel]>;
929defm AllowRecip : FPFastMathModeOperand<0x8, [Kernel]>;
930defm Fast : FPFastMathModeOperand<0x10, [Kernel]>;
931
932//===----------------------------------------------------------------------===//
933// Multiclass used to define FPRoundingMode enum values and at the same time
934// SymbolicOperand entries with string mnemonics.
935//===----------------------------------------------------------------------===//
936
937def FPRoundingMode : GenericEnum, Operand<i32> {
938  let FilterClass = "FPRoundingMode";
939  let NameField = "Name";
940  let ValueField = "Value";
941  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
942}
943
944class FPRoundingMode<string name, bits<32> value> {
945  string Name = name;
946  bits<32> Value = value;
947}
948
949multiclass FPRoundingModeOperand<bits<32> value> {
950  def NAME : FPRoundingMode<NAME, value>;
951  defm : SymbolicOperandWithRequirements<FPRoundingModeOperand, value, NAME, 0, 0, [], []>;
952}
953
954defm RTE : FPRoundingModeOperand<0>;
955defm RTZ : FPRoundingModeOperand<1>;
956defm RTP : FPRoundingModeOperand<2>;
957defm RTN : FPRoundingModeOperand<3>;
958
959//===----------------------------------------------------------------------===//
960// Multiclass used to define LinkageType enum values and at the same time
961// SymbolicOperand entries with string mnemonics and capabilities.
962//===----------------------------------------------------------------------===//
963
964def LinkageType : GenericEnum, Operand<i32> {
965  let FilterClass = "LinkageType";
966  let NameField = "Name";
967  let ValueField = "Value";
968  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
969}
970
971class LinkageType<string name, bits<32> value> {
972  string Name = name;
973  bits<32> Value = value;
974}
975
976multiclass LinkageTypeOperand<bits<32> value, list<Capability> reqCapabilities> {
977  def : LinkageType<NAME, value>;
978  defm : SymbolicOperandWithRequirements<LinkageTypeOperand, value, NAME, 0, 0, [], reqCapabilities>;
979}
980
981defm Export : LinkageTypeOperand<0, [Linkage]>;
982defm Import : LinkageTypeOperand<1, [Linkage]>;
983
984//===----------------------------------------------------------------------===//
985// Multiclass used to define AccessQualifier enum values and at the same time
986// SymbolicOperand entries with string mnemonics and capabilities.
987//===----------------------------------------------------------------------===//
988
989def AccessQualifier : GenericEnum, Operand<i32> {
990  let FilterClass = "AccessQualifier";
991  let NameField = "Name";
992  let ValueField = "Value";
993  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
994}
995
996class AccessQualifier<string name, bits<32> value> {
997  string Name = name;
998  bits<32> Value = value;
999}
1000
1001multiclass AccessQualifierOperand<bits<32> value, list<Capability> reqCapabilities> {
1002  def NAME : AccessQualifier<NAME, value>;
1003  defm : SymbolicOperandWithRequirements<AccessQualifierOperand, value, NAME, 0, 0, [], reqCapabilities>;
1004}
1005
1006defm ReadOnly : AccessQualifierOperand<0, [Kernel]>;
1007defm WriteOnly : AccessQualifierOperand<1, [Kernel]>;
1008defm ReadWrite : AccessQualifierOperand<2, [Kernel]>;
1009
1010//===----------------------------------------------------------------------===//
1011// Multiclass used to define FunctionParameterAttribute enum values and at the
1012// same time SymbolicOperand entries with string mnemonics and capabilities.
1013//===----------------------------------------------------------------------===//
1014
1015def FunctionParameterAttribute : GenericEnum, Operand<i32> {
1016  let FilterClass = "FunctionParameterAttribute";
1017  let NameField = "Name";
1018  let ValueField = "Value";
1019  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1020}
1021
1022class FunctionParameterAttribute<string name, bits<32> value> {
1023  string Name = name;
1024  bits<32> Value = value;
1025}
1026
1027multiclass FunctionParameterAttributeOperand<bits<32> value, list<Capability> reqCapabilities> {
1028  def : FunctionParameterAttribute<NAME, value>;
1029  defm : SymbolicOperandWithRequirements<FunctionParameterAttributeOperand, value, NAME, 0, 0, [], reqCapabilities>;
1030}
1031
1032defm Zext : FunctionParameterAttributeOperand<0, [Kernel]>;
1033defm Sext : FunctionParameterAttributeOperand<1, [Kernel]>;
1034defm ByVal : FunctionParameterAttributeOperand<2, [Kernel]>;
1035defm Sret : FunctionParameterAttributeOperand<3, [Kernel]>;
1036defm NoAlias : FunctionParameterAttributeOperand<4, [Kernel]>;
1037defm NoCapture : FunctionParameterAttributeOperand<5, [Kernel]>;
1038defm NoWrite : FunctionParameterAttributeOperand<6, [Kernel]>;
1039defm NoReadWrite : FunctionParameterAttributeOperand<7, [Kernel]>;
1040
1041//===----------------------------------------------------------------------===//
1042// Multiclass used to define Decoration enum values and at the same time
1043// SymbolicOperand entries with string mnemonics, versioning, extensions and
1044// capabilities.
1045//===----------------------------------------------------------------------===//
1046
1047def Decoration : GenericEnum, Operand<i32> {
1048  let FilterClass = "Decoration";
1049  let NameField = "Name";
1050  let ValueField = "Value";
1051  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1052}
1053
1054class Decoration<string name, bits<32> value> {
1055  string Name = name;
1056  bits<32> Value = value;
1057}
1058
1059multiclass DecorationOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1060  def : Decoration<NAME, value>;
1061  defm : SymbolicOperandWithRequirements<DecorationOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1062}
1063
1064defm RelaxedPrecision : DecorationOperand<0, 0, 0, [], [Shader]>;
1065defm SpecId : DecorationOperand<1, 0, 0, [], [Shader, Kernel]>;
1066defm Block : DecorationOperand<2, 0, 0, [], [Shader]>;
1067defm BufferBlock : DecorationOperand<3, 0, 0, [], [Shader]>;
1068defm RowMajor : DecorationOperand<4, 0, 0, [], [Matrix]>;
1069defm ColMajor : DecorationOperand<5, 0, 0, [], [Matrix]>;
1070defm ArrayStride : DecorationOperand<6, 0, 0, [], [Shader]>;
1071defm MatrixStride : DecorationOperand<7, 0, 0, [], [Matrix]>;
1072defm GLSLShared : DecorationOperand<8, 0, 0, [], [Shader]>;
1073defm GLSLPacked : DecorationOperand<9, 0, 0, [], [Shader]>;
1074defm CPacked : DecorationOperand<10, 0, 0, [], [Kernel]>;
1075defm BuiltIn : DecorationOperand<11, 0, 0, [], []>;
1076defm NoPerspective : DecorationOperand<13, 0, 0, [], [Shader]>;
1077defm Flat : DecorationOperand<14, 0, 0, [], [Shader]>;
1078defm Patch : DecorationOperand<15, 0, 0, [], [Tessellation]>;
1079defm Centroid : DecorationOperand<16, 0, 0, [], [Shader]>;
1080defm Sample : DecorationOperand<17, 0, 0, [], [SampleRateShading]>;
1081defm Invariant : DecorationOperand<18, 0, 0, [], [Shader]>;
1082defm Restrict : DecorationOperand<19, 0, 0, [], []>;
1083defm Aliased : DecorationOperand<20, 0, 0, [], []>;
1084defm Volatile : DecorationOperand<21, 0, 0, [], []>;
1085defm Constant : DecorationOperand<22, 0, 0, [], [Kernel]>;
1086defm Coherent : DecorationOperand<23, 0, 0, [], []>;
1087defm NonWritable : DecorationOperand<24, 0, 0, [], []>;
1088defm NonReadable : DecorationOperand<25, 0, 0, [], []>;
1089defm Uniform : DecorationOperand<26, 0, 0, [], [Shader]>;
1090defm UniformId : DecorationOperand<27, 0, 0, [], [Shader]>;
1091defm SaturatedConversion : DecorationOperand<28, 0, 0, [], [Kernel]>;
1092defm Stream : DecorationOperand<29, 0, 0, [], [GeometryStreams]>;
1093defm Location : DecorationOperand<30, 0, 0, [], [Shader]>;
1094defm Component : DecorationOperand<31, 0, 0, [], [Shader]>;
1095defm Index : DecorationOperand<32, 0, 0, [], [Shader]>;
1096defm Binding : DecorationOperand<33, 0, 0, [], [Shader]>;
1097defm DescriptorSet : DecorationOperand<34, 0, 0, [], [Shader]>;
1098defm Offset : DecorationOperand<35, 0, 0, [], [Shader]>;
1099defm XfbBuffer : DecorationOperand<36, 0, 0, [], [TransformFeedback]>;
1100defm XfbStride : DecorationOperand<37, 0, 0, [], [TransformFeedback]>;
1101defm FuncParamAttr : DecorationOperand<38, 0, 0, [], [Kernel]>;
1102defm FPRoundingMode : DecorationOperand<39, 0, 0, [], []>;
1103defm FPFastMathMode : DecorationOperand<40, 0, 0, [], [Kernel]>;
1104defm LinkageAttributes : DecorationOperand<41, 0, 0, [], [Linkage]>;
1105defm NoContraction : DecorationOperand<42, 0, 0, [], [Shader]>;
1106defm InputAttachmentIndex : DecorationOperand<43, 0, 0, [], [InputAttachment]>;
1107defm Alignment : DecorationOperand<44, 0, 0, [], [Kernel]>;
1108defm MaxByteOffset : DecorationOperand<45, 0, 0, [], [Addresses]>;
1109defm AlignmentId : DecorationOperand<46, 0, 0, [], [Kernel]>;
1110defm MaxByteOffsetId : DecorationOperand<47, 0, 0, [], [Addresses]>;
1111defm NoSignedWrap : DecorationOperand<4469, 0x10400, 0, [SPV_KHR_no_integer_wrap_decoration], []>;
1112defm NoUnsignedWrap : DecorationOperand<4470, 0x10400, 0, [SPV_KHR_no_integer_wrap_decoration], []>;
1113defm ExplicitInterpAMD : DecorationOperand<4999, 0, 0, [], []>;
1114defm OverrideCoverageNV : DecorationOperand<5248, 0, 0, [], [SampleMaskOverrideCoverageNV]>;
1115defm PassthroughNV : DecorationOperand<5250, 0, 0, [], [GeometryShaderPassthroughNV]>;
1116defm ViewportRelativeNV : DecorationOperand<5252, 0, 0, [], [ShaderViewportMaskNV]>;
1117defm SecondaryViewportRelativeNV : DecorationOperand<5256, 0, 0, [], [ShaderStereoViewNV]>;
1118defm PerPrimitiveNV : DecorationOperand<5271, 0, 0, [], [MeshShadingNV]>;
1119defm PerViewNV : DecorationOperand<5272, 0, 0, [], [MeshShadingNV]>;
1120defm PerVertexNV : DecorationOperand<5273, 0, 0, [], [FragmentBarycentricNV]>;
1121defm NonUniformEXT : DecorationOperand<5300, 0, 0, [], [ShaderNonUniformEXT]>;
1122defm CountBuffer : DecorationOperand<5634, 0, 0, [], []>;
1123defm UserSemantic : DecorationOperand<5635, 0, 0, [], []>;
1124defm RestrictPointerEXT : DecorationOperand<5355, 0, 0, [], [PhysicalStorageBufferAddressesEXT]>;
1125defm AliasedPointerEXT : DecorationOperand<5356, 0, 0, [], [PhysicalStorageBufferAddressesEXT]>;
1126
1127//===----------------------------------------------------------------------===//
1128// Multiclass used to define BuiltIn enum values and at the same time
1129// SymbolicOperand entries with string mnemonics, versioning, extensions and
1130// capabilities.
1131//===----------------------------------------------------------------------===//
1132
1133def BuiltIn : GenericEnum, Operand<i32> {
1134  let FilterClass = "BuiltIn";
1135  let NameField = "Name";
1136  let ValueField = "Value";
1137  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1138}
1139
1140class BuiltIn<string name, bits<32> value> {
1141  string Name = name;
1142  bits<32> Value = value;
1143}
1144
1145multiclass BuiltInOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1146  def NAME : BuiltIn<NAME, value>;
1147  defm : SymbolicOperandWithRequirements<BuiltInOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1148}
1149
1150defm Position : BuiltInOperand<0, 0, 0, [], [Shader]>;
1151defm PointSize : BuiltInOperand<1, 0, 0, [], [Shader]>;
1152defm ClipDistanceVariable : BuiltInOperand<3, 0, 0, [], [ClipDistance]>;
1153defm CullDistanceVariable : BuiltInOperand<4, 0, 0, [], [CullDistance]>;
1154defm VertexId : BuiltInOperand<5, 0, 0, [], [Shader]>;
1155defm InstanceId : BuiltInOperand<6, 0, 0, [], [Shader]>;
1156defm PrimitiveId : BuiltInOperand<7, 0, 0, [], [Geometry, Tessellation, RayTracingNV]>;
1157defm InvocationId : BuiltInOperand<8, 0, 0, [], [Geometry, Tessellation]>;
1158defm Layer : BuiltInOperand<9, 0, 0, [], [Geometry]>;
1159defm ViewportIndex : BuiltInOperand<10, 0, 0, [], [MultiViewport]>;
1160defm TessLevelOuter : BuiltInOperand<11, 0, 0, [], [Tessellation]>;
1161defm TessLevelInner : BuiltInOperand<12, 0, 0, [], [Tessellation]>;
1162defm TessCoord : BuiltInOperand<13, 0, 0, [], [Tessellation]>;
1163defm PatchVertices : BuiltInOperand<14, 0, 0, [], [Tessellation]>;
1164defm FragCoord : BuiltInOperand<15, 0, 0, [], [Shader]>;
1165defm PointCoord : BuiltInOperand<16, 0, 0, [], [Shader]>;
1166defm FrontFacing : BuiltInOperand<17, 0, 0, [], [Shader]>;
1167defm SampleId : BuiltInOperand<18, 0, 0, [], [SampleRateShading]>;
1168defm SamplePosition : BuiltInOperand<19, 0, 0, [], [SampleRateShading]>;
1169defm SampleMask : BuiltInOperand<20, 0, 0, [], [Shader]>;
1170defm FragDepth : BuiltInOperand<22, 0, 0, [], [Shader]>;
1171defm HelperInvocation : BuiltInOperand<23, 0, 0, [], [Shader]>;
1172defm NumWorkgroups : BuiltInOperand<24, 0, 0, [], []>;
1173defm WorkgroupSize : BuiltInOperand<25, 0, 0, [], []>;
1174defm WorkgroupId : BuiltInOperand<26, 0, 0, [], []>;
1175defm LocalInvocationId : BuiltInOperand<27, 0, 0, [], []>;
1176defm GlobalInvocationId : BuiltInOperand<28, 0, 0, [], []>;
1177defm LocalInvocationIndex : BuiltInOperand<29, 0, 0, [], []>;
1178defm WorkDim : BuiltInOperand<30, 0, 0, [], [Kernel]>;
1179defm GlobalSize : BuiltInOperand<31, 0, 0, [], [Kernel]>;
1180defm EnqueuedWorkgroupSize : BuiltInOperand<32, 0, 0, [], [Kernel]>;
1181defm GlobalOffset : BuiltInOperand<33, 0, 0, [], [Kernel]>;
1182defm GlobalLinearId : BuiltInOperand<34, 0, 0, [], [Kernel]>;
1183defm SubgroupSize : BuiltInOperand<36, 0, 0, [], [Kernel, GroupNonUniform, SubgroupBallotKHR]>;
1184defm SubgroupMaxSize : BuiltInOperand<37, 0, 0, [], [Kernel]>;
1185defm NumSubgroups : BuiltInOperand<38, 0, 0, [], [Kernel, GroupNonUniform]>;
1186defm NumEnqueuedSubgroups : BuiltInOperand<39, 0, 0, [], [Kernel]>;
1187defm SubgroupId : BuiltInOperand<40, 0, 0, [], [Kernel, GroupNonUniform]>;
1188defm SubgroupLocalInvocationId : BuiltInOperand<41, 0, 0, [], [Kernel, GroupNonUniform, SubgroupBallotKHR]>;
1189defm VertexIndex : BuiltInOperand<42, 0, 0, [], [Shader]>;
1190defm InstanceIndex : BuiltInOperand<43, 0, 0, [], [Shader]>;
1191defm SubgroupEqMask : BuiltInOperand<4416, 0, 0, [], [SubgroupBallotKHR, GroupNonUniformBallot]>;
1192defm SubgroupGeMask : BuiltInOperand<4417, 0, 0, [], [SubgroupBallotKHR, GroupNonUniformBallot]>;
1193defm SubgroupGtMask : BuiltInOperand<4418, 0, 0, [], [SubgroupBallotKHR, GroupNonUniformBallot]>;
1194defm SubgroupLeMask : BuiltInOperand<4419, 0, 0, [], [SubgroupBallotKHR, GroupNonUniformBallot]>;
1195defm SubgroupLtMask : BuiltInOperand<4420, 0, 0, [], [SubgroupBallotKHR, GroupNonUniformBallot]>;
1196defm BaseVertex : BuiltInOperand<4424, 0, 0, [], [DrawParameters]>;
1197defm BaseInstance : BuiltInOperand<4425, 0, 0, [], [DrawParameters]>;
1198defm DrawIndex : BuiltInOperand<4426, 0, 0, [], [DrawParameters, MeshShadingNV]>;
1199defm DeviceIndex : BuiltInOperand<4438, 0, 0, [], [DeviceGroup]>;
1200defm ViewIndex : BuiltInOperand<4440, 0, 0, [], [MultiView]>;
1201defm BaryCoordNoPerspAMD : BuiltInOperand<4492, 0, 0, [], []>;
1202defm BaryCoordNoPerspCentroidAMD : BuiltInOperand<4493, 0, 0, [], []>;
1203defm BaryCoordNoPerspSampleAMD : BuiltInOperand<4494, 0, 0, [], []>;
1204defm BaryCoordSmoothAMD : BuiltInOperand<4495, 0, 0, [], []>;
1205defm BaryCoordSmoothCentroid : BuiltInOperand<4496, 0, 0, [], []>;
1206defm BaryCoordSmoothSample : BuiltInOperand<4497, 0, 0, [], []>;
1207defm BaryCoordPullModel : BuiltInOperand<4498, 0, 0, [], []>;
1208defm FragStencilRefEXT : BuiltInOperand<5014, 0, 0, [], [StencilExportEXT]>;
1209defm ViewportMaskNV : BuiltInOperand<5253, 0, 0, [], [ShaderViewportMaskNV, MeshShadingNV]>;
1210defm SecondaryPositionNV : BuiltInOperand<5257, 0, 0, [], [ShaderStereoViewNV]>;
1211defm SecondaryViewportMaskNV : BuiltInOperand<5258, 0, 0, [], [ShaderStereoViewNV]>;
1212defm PositionPerViewNV : BuiltInOperand<5261, 0, 0, [], [PerViewAttributesNV, MeshShadingNV]>;
1213defm ViewportMaskPerViewNV : BuiltInOperand<5262, 0, 0, [], [PerViewAttributesNV, MeshShadingNV]>;
1214defm FullyCoveredEXT : BuiltInOperand<5264, 0, 0, [], [FragmentFullyCoveredEXT]>;
1215defm TaskCountNV : BuiltInOperand<5274, 0, 0, [], [MeshShadingNV]>;
1216defm PrimitiveCountNV : BuiltInOperand<5275, 0, 0, [], [MeshShadingNV]>;
1217defm PrimitiveIndicesNV : BuiltInOperand<5276, 0, 0, [], [MeshShadingNV]>;
1218defm ClipDistancePerViewNV : BuiltInOperand<5277, 0, 0, [], [MeshShadingNV]>;
1219defm CullDistancePerViewNV : BuiltInOperand<5278, 0, 0, [], [MeshShadingNV]>;
1220defm LayerPerViewNV : BuiltInOperand<5279, 0, 0, [], [MeshShadingNV]>;
1221defm MeshViewCountNV : BuiltInOperand<5280, 0, 0, [], [MeshShadingNV]>;
1222defm MeshViewIndices : BuiltInOperand<5281, 0, 0, [], [MeshShadingNV]>;
1223defm BaryCoordNV : BuiltInOperand<5286, 0, 0, [], [FragmentBarycentricNV]>;
1224defm BaryCoordNoPerspNV : BuiltInOperand<5287, 0, 0, [], [FragmentBarycentricNV]>;
1225defm FragSizeEXT : BuiltInOperand<5292, 0, 0, [], [FragmentDensityEXT]>;
1226defm FragInvocationCountEXT : BuiltInOperand<5293, 0, 0, [], [FragmentDensityEXT]>;
1227defm LaunchIdNV : BuiltInOperand<5319, 0, 0, [], [RayTracingNV]>;
1228defm LaunchSizeNV : BuiltInOperand<5320, 0, 0, [], [RayTracingNV]>;
1229defm WorldRayOriginNV : BuiltInOperand<5321, 0, 0, [], [RayTracingNV]>;
1230defm WorldRayDirectionNV : BuiltInOperand<5322, 0, 0, [], [RayTracingNV]>;
1231defm ObjectRayOriginNV : BuiltInOperand<5323, 0, 0, [], [RayTracingNV]>;
1232defm ObjectRayDirectionNV : BuiltInOperand<5324, 0, 0, [], [RayTracingNV]>;
1233defm RayTminNV : BuiltInOperand<5325, 0, 0, [], [RayTracingNV]>;
1234defm RayTmaxNV : BuiltInOperand<5326, 0, 0, [], [RayTracingNV]>;
1235defm InstanceCustomIndexNV : BuiltInOperand<5327, 0, 0, [], [RayTracingNV]>;
1236defm ObjectToWorldNV : BuiltInOperand<5330, 0, 0, [], [RayTracingNV]>;
1237defm WorldToObjectNV : BuiltInOperand<5331, 0, 0, [], [RayTracingNV]>;
1238defm HitTNV : BuiltInOperand<5332, 0, 0, [], [RayTracingNV]>;
1239defm HitKindNV : BuiltInOperand<5333, 0, 0, [], [RayTracingNV]>;
1240defm IncomingRayFlagsNV : BuiltInOperand<5351, 0, 0, [], [RayTracingNV]>;
1241
1242//===----------------------------------------------------------------------===//
1243// Multiclass used to define SelectionControl enum values and at the same time
1244// SymbolicOperand entries with string mnemonics.
1245//===----------------------------------------------------------------------===//
1246
1247def SelectionControl : GenericEnum, Operand<i32> {
1248  let FilterClass = "SelectionControl";
1249  let NameField = "Name";
1250  let ValueField = "Value";
1251  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1252}
1253
1254class SelectionControl<string name, bits<32> value> {
1255  string Name = name;
1256  bits<32> Value = value;
1257}
1258
1259multiclass SelectionControlOperand<bits<32> value> {
1260  def : SelectionControl<NAME, value>;
1261  defm : SymbolicOperandWithRequirements<SelectionControlOperand, value, NAME, 0, 0, [], []>;
1262}
1263
1264defm None : SelectionControlOperand<0x0>;
1265defm Flatten : SelectionControlOperand<0x1>;
1266defm DontFlatten : SelectionControlOperand<0x2>;
1267
1268//===----------------------------------------------------------------------===//
1269// Multiclass used to define LoopControl enum values and at the same time
1270// SymbolicOperand entries with string mnemonics.
1271//===----------------------------------------------------------------------===//
1272
1273def LoopControl : GenericEnum, Operand<i32> {
1274  let FilterClass = "LoopControl";
1275  let NameField = "Name";
1276  let ValueField = "Value";
1277  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1278}
1279
1280class LoopControl<string name, bits<32> value> {
1281  string Name = name;
1282  bits<32> Value = value;
1283}
1284
1285multiclass LoopControlOperand<bits<32> value> {
1286  def : LoopControl<NAME, value>;
1287  defm : SymbolicOperandWithRequirements<LoopControlOperand, value, NAME, 0, 0, [], []>;
1288}
1289
1290defm None : LoopControlOperand<0x0>;
1291defm Unroll : LoopControlOperand<0x1>;
1292defm DontUnroll : LoopControlOperand<0x2>;
1293defm DependencyInfinite : LoopControlOperand<0x4>;
1294defm DependencyLength : LoopControlOperand<0x8>;
1295defm MinIterations : LoopControlOperand<0x10>;
1296defm MaxIterations : LoopControlOperand<0x20>;
1297defm IterationMultiple : LoopControlOperand<0x40>;
1298defm PeelCount : LoopControlOperand<0x80>;
1299defm PartialCount : LoopControlOperand<0x100>;
1300
1301//===----------------------------------------------------------------------===//
1302// Multiclass used to define FunctionControl enum values and at the same time
1303// SymbolicOperand entries with string mnemonics.
1304//===----------------------------------------------------------------------===//
1305
1306def FunctionControl : GenericEnum, Operand<i32> {
1307  let FilterClass = "FunctionControl";
1308  let NameField = "Name";
1309  let ValueField = "Value";
1310  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1311}
1312
1313class FunctionControl<string name, bits<32> value> {
1314  string Name = name;
1315  bits<32> Value = value;
1316}
1317
1318multiclass FunctionControlOperand<bits<32> value> {
1319  def : FunctionControl<NAME, value>;
1320  defm : SymbolicOperandWithRequirements<FunctionControlOperand, value, NAME, 0, 0, [], []>;
1321}
1322
1323defm None : FunctionControlOperand<0x0>;
1324defm Inline : FunctionControlOperand<0x1>;
1325defm DontInline : FunctionControlOperand<0x2>;
1326defm Pure : FunctionControlOperand<0x4>;
1327defm Const : FunctionControlOperand<0x8>;
1328
1329//===----------------------------------------------------------------------===//
1330// Multiclass used to define MemorySemantics enum values and at the same time
1331// SymbolicOperand entries with string mnemonics, versioning, extensions and
1332// capabilities.
1333//===----------------------------------------------------------------------===//
1334
1335def MemorySemantics : GenericEnum, Operand<i32> {
1336  let FilterClass = "MemorySemantics";
1337  let NameField = "Name";
1338  let ValueField = "Value";
1339  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1340}
1341
1342class MemorySemantics<string name, bits<32> value> {
1343  string Name = name;
1344  bits<32> Value = value;
1345}
1346
1347multiclass MemorySemanticsOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1348  def : MemorySemantics<NAME, value>;
1349  defm : SymbolicOperandWithRequirements<MemorySemanticsOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1350}
1351
1352defm None : MemorySemanticsOperand<0x0, 0, 0, [], []>;
1353defm Acquire : MemorySemanticsOperand<0x2, 0, 0, [], []>;
1354defm Release : MemorySemanticsOperand<0x4, 0, 0, [], []>;
1355defm AcquireRelease : MemorySemanticsOperand<0x8, 0, 0, [], []>;
1356defm SequentiallyConsistent : MemorySemanticsOperand<0x10, 0, 0, [], []>;
1357defm UniformMemory : MemorySemanticsOperand<0x40, 0, 0, [], [Shader]>;
1358defm SubgroupMemory : MemorySemanticsOperand<0x80, 0, 0, [], []>;
1359defm WorkgroupMemory : MemorySemanticsOperand<0x100, 0, 0, [], []>;
1360defm CrossWorkgroupMemory : MemorySemanticsOperand<0x200, 0, 0, [], []>;
1361defm AtomicCounterMemory : MemorySemanticsOperand<0x400, 0, 0, [], [AtomicStorage]>;
1362defm ImageMemory : MemorySemanticsOperand<0x800, 0, 0, [], []>;
1363defm OutputMemoryKHR : MemorySemanticsOperand<0x1000, 0, 0, [], [VulkanMemoryModelKHR]>;
1364defm MakeAvailableKHR : MemorySemanticsOperand<0x2000, 0, 0, [], [VulkanMemoryModelKHR]>;
1365defm MakeVisibleKHR : MemorySemanticsOperand<0x4000, 0, 0, [], [VulkanMemoryModelKHR]>;
1366
1367//===----------------------------------------------------------------------===//
1368// Multiclass used to define MemoryOperand enum values and at the same time
1369// SymbolicOperand entries with string mnemonics, versioning, extensions and
1370// capabilities.
1371//===----------------------------------------------------------------------===//
1372
1373def MemoryOperand : GenericEnum, Operand<i32> {
1374  let FilterClass = "MemoryOperand";
1375  let NameField = "Name";
1376  let ValueField = "Value";
1377  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1378}
1379
1380class MemoryOperand<string name, bits<32> value> {
1381  string Name = name;
1382  bits<32> Value = value;
1383}
1384
1385multiclass MemoryOperandOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1386  def : MemoryOperand<NAME, value>;
1387  defm : SymbolicOperandWithRequirements<MemoryOperandOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1388}
1389
1390defm None : MemoryOperandOperand<0x0, 0, 0, [], []>;
1391defm Volatile : MemoryOperandOperand<0x1, 0, 0, [], []>;
1392defm Aligned : MemoryOperandOperand<0x2, 0, 0, [], []>;
1393defm Nontemporal : MemoryOperandOperand<0x4, 0, 0, [], []>;
1394defm MakePointerAvailableKHR : MemoryOperandOperand<0x8, 0, 0, [], [VulkanMemoryModelKHR]>;
1395defm MakePointerVisibleKHR : MemoryOperandOperand<0x10, 0, 0, [], [VulkanMemoryModelKHR]>;
1396defm NonPrivatePointerKHR : MemoryOperandOperand<0x20, 0, 0, [], [VulkanMemoryModelKHR]>;
1397
1398//===----------------------------------------------------------------------===//
1399// Multiclass used to define Scope enum values and at the same time
1400// SymbolicOperand entries with string mnemonics, versioning, extensions and
1401// capabilities.
1402//===----------------------------------------------------------------------===//
1403
1404def Scope : GenericEnum, Operand<i32> {
1405  let FilterClass = "Scope";
1406  let NameField = "Name";
1407  let ValueField = "Value";
1408  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1409}
1410
1411class Scope<string name, bits<32> value> {
1412  string Name = name;
1413  bits<32> Value = value;
1414}
1415
1416multiclass ScopeOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1417  def : Scope<NAME, value>;
1418  defm : SymbolicOperandWithRequirements<ScopeOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1419}
1420
1421defm CrossDevice : ScopeOperand<0, 0, 0, [], []>;
1422defm Device : ScopeOperand<1, 0, 0, [], []>;
1423defm Workgroup : ScopeOperand<2, 0, 0, [], []>;
1424defm Subgroup : ScopeOperand<3, 0, 0, [], []>;
1425defm Invocation : ScopeOperand<4, 0, 0, [], []>;
1426defm QueueFamilyKHR : ScopeOperand<5, 0, 0, [], [VulkanMemoryModelKHR]>;
1427
1428//===----------------------------------------------------------------------===//
1429// Multiclass used to define GroupOperation enum values and at the same time
1430// SymbolicOperand entries with string mnemonics, versioning, extensions and
1431// capabilities.
1432//===----------------------------------------------------------------------===//
1433
1434def GroupOperation : GenericEnum, Operand<i32> {
1435  let FilterClass = "GroupOperation";
1436  let NameField = "Name";
1437  let ValueField = "Value";
1438  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1439}
1440
1441class GroupOperation<string name, bits<32> value> {
1442  string Name = name;
1443  bits<32> Value = value;
1444}
1445
1446multiclass GroupOperationOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1447  def NAME : GroupOperation<NAME, value>;
1448  defm : SymbolicOperandWithRequirements<GroupOperationOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1449}
1450
1451defm Reduce : GroupOperationOperand<0, 0, 0, [], [Kernel, GroupNonUniformArithmetic, GroupNonUniformBallot]>;
1452defm InclusiveScan : GroupOperationOperand<1, 0, 0, [], [Kernel, GroupNonUniformArithmetic, GroupNonUniformBallot]>;
1453defm ExclusiveScan : GroupOperationOperand<2, 0, 0, [], [Kernel, GroupNonUniformArithmetic, GroupNonUniformBallot]>;
1454defm ClusteredReduce : GroupOperationOperand<3, 0, 0, [], [GroupNonUniformClustered]>;
1455defm PartitionedReduceNV : GroupOperationOperand<6, 0, 0, [], [GroupNonUniformPartitionedNV]>;
1456defm PartitionedInclusiveScanNV : GroupOperationOperand<7, 0, 0, [], [GroupNonUniformPartitionedNV]>;
1457defm PartitionedExclusiveScanNV : GroupOperationOperand<8, 0, 0, [], [GroupNonUniformPartitionedNV]>;
1458
1459//===----------------------------------------------------------------------===//
1460// Multiclass used to define KernelEnqueueFlags enum values and at the same time
1461// SymbolicOperand entries with string mnemonics, versioning, extensions and
1462// capabilities.
1463//===----------------------------------------------------------------------===//
1464
1465def KernelEnqueueFlags : GenericEnum, Operand<i32> {
1466  let FilterClass = "KernelEnqueueFlags";
1467  let NameField = "Name";
1468  let ValueField = "Value";
1469  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1470}
1471
1472class KernelEnqueueFlags<string name, bits<32> value> {
1473  string Name = name;
1474  bits<32> Value = value;
1475}
1476
1477multiclass KernelEnqueueFlagsOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1478  def : KernelEnqueueFlags<NAME, value>;
1479  defm : SymbolicOperandWithRequirements<KernelEnqueueFlagsOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1480}
1481
1482defm NoWait : KernelEnqueueFlagsOperand<0, 0, 0, [], [Kernel]>;
1483defm WaitKernel : KernelEnqueueFlagsOperand<1, 0, 0, [], [Kernel]>;
1484defm WaitWorkGroup : KernelEnqueueFlagsOperand<2, 0, 0, [], [Kernel]>;
1485
1486//===----------------------------------------------------------------------===//
1487// Multiclass used to define KernelProfilingInfo enum values and at the same time
1488// SymbolicOperand entries with string mnemonics, versioning, extensions and
1489// capabilities.
1490//===----------------------------------------------------------------------===//
1491
1492def KernelProfilingInfo : GenericEnum, Operand<i32> {
1493  let FilterClass = "KernelProfilingInfo";
1494  let NameField = "Name";
1495  let ValueField = "Value";
1496  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1497}
1498
1499class KernelProfilingInfo<string name, bits<32> value> {
1500  string Name = name;
1501  bits<32> Value = value;
1502}
1503
1504multiclass KernelProfilingInfoOperand<bits<32> value, bits<32> minVersion, bits<32> maxVersion, list<Extension> reqExtensions, list<Capability> reqCapabilities> {
1505  def : KernelProfilingInfo<NAME, value>;
1506  defm : SymbolicOperandWithRequirements<KernelProfilingInfoOperand, value, NAME, minVersion, maxVersion, reqExtensions, reqCapabilities>;
1507}
1508
1509defm None : KernelProfilingInfoOperand<0x0, 0, 0, [], []>;
1510defm CmdExecTime : KernelProfilingInfoOperand<0x1, 0, 0, [], [Kernel]>;
1511
1512//===----------------------------------------------------------------------===//
1513// Multiclass used to define Opcode enum values and at the same time
1514// SymbolicOperand entries with string mnemonics and capabilities.
1515//===----------------------------------------------------------------------===//
1516
1517def Opcode : GenericEnum, Operand<i32> {
1518  let FilterClass = "Opcode";
1519  let NameField = "Name";
1520  let ValueField = "Value";
1521  let PrintMethod = !strconcat("printSymbolicOperand<OperandCategory::", FilterClass, "Operand>");
1522}
1523
1524class Opcode<string name, bits<32> value> {
1525  string Name = name;
1526  bits<32> Value = value;
1527}
1528
1529multiclass OpcodeOperand<bits<32> value> {
1530  def : Opcode<NAME, value>;
1531  defm : SymbolicOperandWithRequirements<OpcodeOperand, value, NAME, 0, 0, [], []>;
1532}
1533// TODO: implement other mnemonics.
1534defm InBoundsPtrAccessChain : OpcodeOperand<70>;
1535defm PtrCastToGeneric : OpcodeOperand<121>;
1536