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