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