authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-19 09:41:34+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-19 09:41:34+02:00
log3f6a02acdda41190eab7d57a9f037df9d4853631
treea23464f1b20e6c8cac0a2182a2f53584a53476c2
parent806624169a70301f37b6fe4dbdc5b6827cfd1ab1
parentec82de3637c3727bfbf2f8f6b014d144256daa95

Merge pull request 'spirv: linker enhancements and other bug fixes' (#36828) from alichraghi/zig:sr into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36828 Reviewed-by: Andrew Kelley <andrew@ziglang.org>

63 files changed, 4024 insertions(+), 18400 deletions(-)

lib/std/Target.zig+1
...@@ -2392,6 +2392,7 @@ pub fn supportsAddressSpace(...@@ -2392,6 +2392,7 @@ pub fn supportsAddressSpace(
2392 .lut => arch == .propeller and std.Target.propeller.featureSetHas(target.cpu.features, .p2),2392 .lut => arch == .propeller and std.Target.propeller.featureSetHas(target.cpu.features, .p2),
23932393
2394 .global, .local, .shared => is_gpu,2394 .global, .local, .shared => is_gpu,
2395 .private => is_spirv,
2395 .constant => (is_gpu and (context == null or context == .constant)) or2396 .constant => (is_gpu and (context == null or context == .constant)) or
2396 (is_spirv and (context == null or context == .constant or context == .pointer)),2397 (is_spirv and (context == null or context == .constant or context == .pointer)),
2397 .param => is_nvptx,2398 .param => is_nvptx,
lib/std/lang.zig+1
...@@ -591,6 +591,7 @@ pub const AddressSpace = enum(u5) {...@@ -591,6 +591,7 @@ pub const AddressSpace = enum(u5) {
591 param,591 param,
592 shared,592 shared,
593 local,593 local,
594 private,
594 input,595 input,
595 output,596 output,
596 uniform,597 uniform,
src/Sema.zig+36-30
...@@ -20914,13 +20914,8 @@ fn zirReifySpirvType(...@@ -20914,13 +20914,8 @@ fn zirReifySpirvType(
20914 const depth = try sema.interpretStdLangType(block, operand_src, depth_val, std.lang.Type.Spirv.Image.Depth);20914 const depth = try sema.interpretStdLangType(block, operand_src, depth_val, std.lang.Type.Spirv.Image.Depth);
20915 const access = try sema.interpretStdLangType(block, operand_src, access_val, std.lang.Type.Spirv.Image.Access);20915 const access = try sema.interpretStdLangType(block, operand_src, access_val, std.lang.Type.Spirv.Image.Access);
2091620916
20917 switch (target.os.tag) {20917 if (target.os.tag == .opencl and access == .unknown) {
20918 .opencl => if (access == .unknown) {20918 return sema.fail(block, operand_src, "'access' field must be specified under the 'opencl' OS", .{});
20919 return sema.fail(block, operand_src, "'access' field must be specified under the 'opencl' os", .{});
20920 },
20921 else => if (access != .unknown) {
20922 return sema.fail(block, operand_src, "access qualifier '.{t}' is only valid under the 'opencl' os", .{access});
20923 },
20924 }20919 }
2092520920
20926 const arrayed = try sema.interpretStdLangType(block, operand_src, arrayed_val, bool);20921 const arrayed = try sema.interpretStdLangType(block, operand_src, arrayed_val, bool);
...@@ -20930,31 +20925,24 @@ fn zirReifySpirvType(...@@ -20930,31 +20925,24 @@ fn zirReifySpirvType(
20930 const usage_tag = try sema.interpretStdLangType(block, operand_src, usage_tag_val, @typeInfo(std.lang.Type.Spirv.Image.Usage).@"union".tag_type.?);20925 const usage_tag = try sema.interpretStdLangType(block, operand_src, usage_tag_val, @typeInfo(std.lang.Type.Spirv.Image.Usage).@"union".tag_type.?);
2093120926
20932 switch (target.os.tag) {20927 switch (target.os.tag) {
20933 .vulkan => {20928 .vulkan => if (usage_tag == .unknown) {
20934 if (usage_tag == .unknown) {20929 return sema.fail(block, operand_src, "'usage' must be '.sampled' or '.storage' under the 'vulkan' OS", .{});
20935 return sema.fail(
20936 block,
20937 operand_src,
20938 "'usage' must be '.sampled' or '.storage' under the 'vulkan' os (Sampled == 0 is forbidden)",
20939 .{},
20940 );
20941 }
20942 },20930 },
20943 .opencl => {20931 .opencl => {
20944 if (usage_tag != .unknown) {20932 if (usage_tag != .unknown) {
20945 return sema.fail(block, operand_src, "'usage' must be '.unknown' under the 'opencl' os", .{});20933 return sema.fail(block, operand_src, "'usage' must be '.unknown' under the 'opencl' OS", .{});
20946 }20934 }
20947 if (multisampled) {20935 if (multisampled) {
20948 return sema.fail(block, operand_src, "'multisampled' must be 'false' under the 'opencl' os", .{});20936 return sema.fail(block, operand_src, "'multisampled' must be 'false' under the 'opencl' OS", .{});
20949 }20937 }
20950 if (format != .unknown) {20938 if (format != .unknown) {
20951 return sema.fail(block, operand_src, "'format' must be '.unknown' under the 'opencl' os", .{});20939 return sema.fail(block, operand_src, "'format' must be '.unknown' under the 'opencl' OS", .{});
20952 }20940 }
20953 if (dim == .cube) {20941 if (dim == .cube) {
20954 return sema.fail(block, operand_src, "'dim' '.cube' is not allowed under the 'opencl' os", .{});20942 return sema.fail(block, operand_src, "'dim' '.cube' is not allowed under the 'opencl' OS", .{});
20955 }20943 }
20956 if (arrayed and dim != .@"1d" and dim != .@"2d") {20944 if (arrayed and dim != .@"1d" and dim != .@"2d") {
20957 return sema.fail(block, operand_src, "'arrayed' may only be 'true' when 'dim' is '.1d' or '.2d' under the 'opencl' os", .{});20945 return sema.fail(block, operand_src, "'arrayed' may only be 'true' when 'dim' is '.1d' or '.2d' under the 'opencl' OS", .{});
20958 }20946 }
20959 },20947 },
20960 else => {},20948 else => {},
...@@ -20965,10 +20953,10 @@ fn zirReifySpirvType(...@@ -20965,10 +20953,10 @@ fn zirReifySpirvType(
20965 const sampled_type = usage_val.unionPayload(zcu).toType();20953 const sampled_type = usage_val.unionPayload(zcu).toType();
2096620954
20967 if (target.os.tag != .opencl and sampled_type.toIntern() == .void_type) {20955 if (target.os.tag != .opencl and sampled_type.toIntern() == .void_type) {
20968 return sema.fail(block, operand_src, "'void' type for '{t}' field is only valid under the 'opencl' os", .{usage_tag});20956 return sema.fail(block, operand_src, "'void' type for '{t}' field is only valid under the 'opencl' OS", .{usage_tag});
20969 }20957 }
20970 if (target.os.tag == .opencl and sampled_type.toIntern() != .void_type) {20958 if (target.os.tag == .opencl and sampled_type.toIntern() != .void_type) {
20971 return sema.fail(block, operand_src, "'{t}' field type must be 'void' under the 'opencl' os", .{usage_tag});20959 return sema.fail(block, operand_src, "'{t}' field type must be 'void' under the 'opencl' OS", .{usage_tag});
20972 }20960 }
2097320961
20974 if (sampled_type.toIntern() != .void_type and20962 if (sampled_type.toIntern() != .void_type and
...@@ -20984,7 +20972,7 @@ fn zirReifySpirvType(...@@ -20984,7 +20972,7 @@ fn zirReifySpirvType(
20984 return sema.fail(20972 return sema.fail(
20985 block,20973 block,
20986 operand_src,20974 operand_src,
20987 "'{t}' field value must be a 32-bit int, 64-bit int or 32-bit float under the 'vulkan' os",20975 "'{t}' field value must be a 32-bit int, 64-bit int or 32-bit float under the 'vulkan' OS",
20988 .{usage_tag},20976 .{usage_tag},
20989 );20977 );
20990 }20978 }
...@@ -21005,7 +20993,7 @@ fn zirReifySpirvType(...@@ -21005,7 +20993,7 @@ fn zirReifySpirvType(
21005 return sema.fail(20993 return sema.fail(
21006 block,20994 block,
21007 operand_src,20995 operand_src,
21008 "image 'format' '.{t}' does not match '{t}' type '{f}' under the 'vulkan' os",20996 "image 'format' '.{t}' does not match '{t}' type '{f}' under the 'vulkan' OS",
21009 .{ format, usage_tag, sampled_type.fmt(pt) },20997 .{ format, usage_tag, sampled_type.fmt(pt) },
21010 );20998 );
21011 }20999 }
...@@ -21058,7 +21046,7 @@ fn zirReifySpirvType(...@@ -21058,7 +21046,7 @@ fn zirReifySpirvType(
21058 elem_ty.zigTypeTag(zcu) == .spirv and21046 elem_ty.zigTypeTag(zcu) == .spirv and
21059 ip.loadSpirvType(elem_ty.toIntern()).flags.tag == .runtime_array)21047 ip.loadSpirvType(elem_ty.toIntern()).flags.tag == .runtime_array)
21060 {21048 {
21061 return sema.fail(block, operand_src, "'runtime_array' of 'runtime_array' is not allowed under the 'vulkan' os", .{});21049 return sema.fail(block, operand_src, "'runtime_array' of 'runtime_array' is not allowed under the 'vulkan' OS", .{});
21062 }21050 }
21063 break :blk .{21051 break :blk .{
21064 .ty = union_val.val,21052 .ty = union_val.val,
...@@ -25315,11 +25303,14 @@ fn zirBuiltinExtern(...@@ -25315,11 +25303,14 @@ fn zirBuiltinExtern(
25315 }25303 }
2531625304
25317 if (options.decoration) |decoration| switch (decoration) {25305 if (options.decoration) |decoration| switch (decoration) {
25318 .flat => switch (ptr_info.flags.address_space) {25306 .location, .flat => switch (ptr_info.flags.address_space) {
25319 .input, .output => {},25307 .input, .output => {},
25320 else => return sema.fail(block, options_src, "\"flat\" decoration requires \"input\" or \"output\" address space", .{}),25308 else => return sema.fail(block, options_src, "'{t}' decoration requires 'input' or 'output' address space", .{decoration}),
25309 },
25310 .descriptor => switch (ptr_info.flags.address_space) {
25311 .global, .storage_buffer, .uniform, .constant => {},
25312 else => return sema.fail(block, options_src, "'descriptor' decoration requires 'storage_buffer', 'uniform', 'constant' or 'global' address space", .{}),
25321 },25313 },
25322 .location, .descriptor => {},
25323 };25314 };
2532425315
25325 const target = zcu.getTarget();25316 const target = zcu.getTarget();
...@@ -34913,6 +34904,7 @@ pub fn resolveNavPtrModifiers(...@@ -34913,6 +34904,7 @@ pub fn resolveNavPtrModifiers(
34913 const gpa = comp.gpa;34904 const gpa = comp.gpa;
34914 const io = comp.io;34905 const io = comp.io;
34915 const ip = &zcu.intern_pool;34906 const ip = &zcu.intern_pool;
34907 const target = zcu.getTarget();
3491634908
34917 const align_src = block.src(.{ .node_offset_var_decl_align = .zero });34909 const align_src = block.src(.{ .node_offset_var_decl_align = .zero });
34918 const section_src = block.src(.{ .node_offset_var_decl_section = .zero });34910 const section_src = block.src(.{ .node_offset_var_decl_section = .zero });
...@@ -34944,7 +34936,6 @@ pub fn resolveNavPtrModifiers(...@@ -34944,7 +34936,6 @@ pub fn resolveNavPtrModifiers(
34944 else => .constant,34936 else => .constant,
34945 },34937 },
34946 };34938 };
34947 const target = zcu.getTarget();
34948 const addrspace_body = zir_decl.addrspace_body orelse {34939 const addrspace_body = zir_decl.addrspace_body orelse {
34949 if (zir_decl.linkage == .@"extern" and34940 if (zir_decl.linkage == .@"extern" and
34950 target.cpu.arch.isSpirV() and34941 target.cpu.arch.isSpirV() and
...@@ -34968,6 +34959,21 @@ pub fn resolveNavPtrModifiers(...@@ -34968,6 +34959,21 @@ pub fn resolveNavPtrModifiers(
34968 break :as try sema.analyzeAsAddressSpace(block, addrspace_src, addrspace_ref, addrspace_ctx);34959 break :as try sema.analyzeAsAddressSpace(block, addrspace_src, addrspace_ref, addrspace_ctx);
34969 };34960 };
3497034961
34962 if (target.cpu.arch.isSpirV()) {
34963 if (zir_decl.kind == .@"var" and zir_decl.linkage != .@"extern" and !zir_decl.is_threadlocal) {
34964 return sema.failWithOwnedErrorMsg(block, msg: {
34965 const decl_src = block.nodeOffset(.zero);
34966 const msg = try sema.errMsg(decl_src, "SPIR-V target does not support global variables", .{});
34967 errdefer msg.destroy(gpa);
34968 try sema.errNote(decl_src, msg, "consider using 'threadlocal'", .{});
34969 break :msg msg;
34970 });
34971 }
34972 if (zir_decl.is_threadlocal and @"addrspace" != .private and target.os.tag == .vulkan) {
34973 return sema.fail(block, addrspace_src, "threadlocal variables with address space '{t}' are not supported on {t}", .{ @"addrspace", target.os.tag });
34974 }
34975 }
34976
34971 return .{34977 return .{
34972 .@"align" = @"align",34978 .@"align" = @"align",
34973 .@"linksection" = @"linksection",34979 .@"linksection" = @"linksection",
src/codegen/spirv/Assembler.zig+68-158
...@@ -1,16 +1,11 @@...@@ -1,16 +1,11 @@
1const std = @import("std");1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const assert = std.debug.assert;2const assert = std.debug.assert;
4
5const CodeGen = @import("CodeGen.zig");3const CodeGen = @import("CodeGen.zig");
6const Decl = @import("CodeGen.zig").Decl;
7
8const spec = @import("spec.zig");4const spec = @import("spec.zig");
9const Opcode = spec.Opcode;5const Opcode = spec.Opcode;
10const Word = spec.Word;6const Word = spec.Word;
11const Id = spec.Id;7const Id = spec.Id;
12const StorageClass = spec.StorageClass;8const StorageClass = spec.StorageClass;
13
14const Assembler = @This();9const Assembler = @This();
1510
16cg: *CodeGen,11cg: *CodeGen,
...@@ -20,7 +15,10 @@ src: []const u8 = undefined,...@@ -20,7 +15,10 @@ src: []const u8 = undefined,
20tokens: std.ArrayList(Token) = .empty,15tokens: std.ArrayList(Token) = .empty,
21current_token: u32 = 0,16current_token: u32 = 0,
22/// The instruction that is currently being parsed or has just been parsed.17/// The instruction that is currently being parsed or has just been parsed.
23inst: struct {18inst: Instruction = .{},
19value_map: std.array_hash_map.String(AsmValue) = .empty,
20
21const Instruction = struct {
24 opcode: Opcode = undefined,22 opcode: Opcode = undefined,
25 operands: std.ArrayList(Operand) = .empty,23 operands: std.ArrayList(Operand) = .empty,
26 string_bytes: std.ArrayList(u8) = .empty,24 string_bytes: std.ArrayList(u8) = .empty,
...@@ -35,9 +33,7 @@ inst: struct {...@@ -35,9 +33,7 @@ inst: struct {
35 }33 }
36 return null;34 return null;
37 }35 }
38} = .{},36};
39value_map: std.array_hash_map.String(AsmValue) = .empty,
40inst_map: std.array_hash_map.String(void) = .empty,
4137
42const Operand = union(enum) {38const Operand = union(enum) {
43 /// Any 'simple' 32-bit value. This could be a mask or39 /// Any 'simple' 32-bit value. This could be a mask or
...@@ -68,27 +64,14 @@ pub fn deinit(ass: *Assembler) void {...@@ -68,27 +64,14 @@ pub fn deinit(ass: *Assembler) void {
68 ass.inst.operands.deinit(gpa);64 ass.inst.operands.deinit(gpa);
69 ass.inst.string_bytes.deinit(gpa);65 ass.inst.string_bytes.deinit(gpa);
70 ass.value_map.deinit(gpa);66 ass.value_map.deinit(gpa);
71 ass.inst_map.deinit(gpa);
72}67}
7368
74const Error = error{ AssembleFail, OutOfMemory };69const Error = error{ AssembleFail, OutOfMemory };
7570
76pub fn assemble(ass: *Assembler, src: []const u8) Error!void {71pub fn assemble(ass: *Assembler, src: []const u8) Error!void {
77 const gpa = ass.cg.gpa;
78
79 ass.src = src;72 ass.src = src;
80 ass.errors.clearRetainingCapacity();73 ass.errors.clearRetainingCapacity();
8174
82 // Populate the opcode map if it isn't already
83 if (ass.inst_map.count() == 0) {
84 const instructions = spec.InstructionSet.core.instructions();
85 try ass.inst_map.ensureUnusedCapacity(gpa, @intCast(instructions.len));
86 for (instructions, 0..) |inst, i| {
87 const entry = try ass.inst_map.getOrPut(gpa, inst.name);
88 assert(entry.index == i);
89 }
90 }
91
92 try ass.tokenize();75 try ass.tokenize();
93 while (!ass.testToken(.eof)) {76 while (!ass.testToken(.eof)) {
94 try ass.parseInstruction();77 try ass.parseInstruction();
...@@ -144,18 +127,20 @@ const AsmValue = union(enum) {...@@ -144,18 +127,20 @@ const AsmValue = union(enum) {
144 /// zero-extended from the float's width to 64 bits.127 /// zero-extended from the float's width to 64 bits.
145 constant: u64,128 constant: u64,
146 /// A vector "c" input expanded by `processSpecConstVector`.129 /// A vector "c" input expanded by `processSpecConstVector`.
147 constant_composite: struct {130 constant_composite: ConstantComposite,
131 string: []const u8,
132
133 const ConstantComposite = struct {
148 child: Id,134 child: Id,
149 child_kind: std.lang.TypeId,135 child_kind: std.lang.TypeId,
150 child_bit_width: u16,136 child_bit_width: u16,
151 values: []u64,137 values: []u64,
152 },138 };
153 string: []const u8,
154139
155 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue140 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue
156 /// is of a variant that allows the result to be obtained (not an unresolved141 /// is of a variant that allows the result to be obtained (not an unresolved
157 /// forward declaration, not in the process of being declared, etc).142 /// forward declaration, not in the process of being declared, etc).
158 pub fn resultId(value: AsmValue) Id {143 fn resultId(value: AsmValue) Id {
159 return switch (value) {144 return switch (value) {
160 .just_declared,145 .just_declared,
161 .unresolved_forward_reference,146 .unresolved_forward_reference,
...@@ -221,7 +206,7 @@ fn processTypeInstruction(ass: *Assembler) !AsmValue {...@@ -221,7 +206,7 @@ fn processTypeInstruction(ass: *Assembler) !AsmValue {
221 const cg = ass.cg;206 const cg = ass.cg;
222 const gpa = cg.gpa;207 const gpa = cg.gpa;
223 const operands = ass.inst.operands.items;208 const operands = ass.inst.operands.items;
224 const section = &cg.sections.globals;209 const section = &cg.module;
225 const id = switch (ass.inst.opcode) {210 const id = switch (ass.inst.opcode) {
226 .OpTypeVoid => try cg.voidType(),211 .OpTypeVoid => try cg.voidType(),
227 .OpTypeBool => try cg.boolType(),212 .OpTypeBool => try cg.boolType(),
...@@ -339,26 +324,16 @@ fn processTypeInstruction(ass: *Assembler) !AsmValue {...@@ -339,26 +324,16 @@ fn processTypeInstruction(ass: *Assembler) !AsmValue {
339/// - Target section is determined from instruction type.324/// - Target section is determined from instruction type.
340fn processGenericInstruction(ass: *Assembler) !?AsmValue {325fn processGenericInstruction(ass: *Assembler) !?AsmValue {
341 const cg = ass.cg;326 const cg = ass.cg;
342 const target = cg.zcu.getTarget();
343 const operands = ass.inst.operands.items;327 const operands = ass.inst.operands.items;
344 var maybe_spv_decl_index: ?Decl.Index = null;
345 const section = switch (ass.inst.opcode.class()) {328 const section = switch (ass.inst.opcode.class()) {
346 .constant_creation => &cg.sections.globals,329 .constant_creation => &cg.module,
347 .annotation => &cg.sections.annotations,330 .annotation => &cg.module,
348 .type_declaration => unreachable, // Handled elsewhere.331 .type_declaration => unreachable, // Handled elsewhere.
349 else => switch (ass.inst.opcode) {332 else => switch (ass.inst.opcode) {
350 .OpEntryPoint => unreachable,
351 .OpExecutionMode, .OpExecutionModeId => &cg.sections.execution_modes,
352 .OpVariable => section: {333 .OpVariable => section: {
353 const storage_class: spec.StorageClass = @fromBackingInt(@intCast(operands[2].value));334 const storage_class: spec.StorageClass = @fromBackingInt(@intCast(operands[2].value));
354 if (storage_class == .function) break :section &ass.cg.prologue;335 if (storage_class == .function) break :section &ass.cg.prologue;
355 maybe_spv_decl_index = try cg.allocDecl(.global);336 break :section &cg.module;
356 if (!target.cpu.has(.spirv, .v1_4) and storage_class != .input and storage_class != .output) {
357 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
358 break :section &cg.sections.globals;
359 }
360 try ass.cg.decl_deps.append(cg.gpa, maybe_spv_decl_index.?);
361 break :section &cg.sections.globals;
362 },337 },
363 else => &ass.cg.body,338 else => &ass.cg.body,
364 },339 },
...@@ -388,10 +363,7 @@ fn processGenericInstruction(ass: *Assembler) !?AsmValue {...@@ -388,10 +363,7 @@ fn processGenericInstruction(ass: *Assembler) !?AsmValue {
388 .value, .literal32 => |word| section.writeWord(word),363 .value, .literal32 => |word| section.writeWord(word),
389 .literal64 => |dword| section.writeDoubleWord(dword),364 .literal64 => |dword| section.writeDoubleWord(dword),
390 .result_id => {365 .result_id => {
391 maybe_result_id = if (maybe_spv_decl_index) |spv_decl_index|366 maybe_result_id = cg.allocId();
392 cg.declPtr(spv_decl_index).result_id
393 else
394 cg.allocId();
395 section.writeOperand(Id, maybe_result_id.?);367 section.writeOperand(Id, maybe_result_id.?);
396 },368 },
397 .ref_id => |index| {369 .ref_id => |index| {
...@@ -406,7 +378,8 @@ fn processGenericInstruction(ass: *Assembler) !?AsmValue {...@@ -406,7 +378,8 @@ fn processGenericInstruction(ass: *Assembler) !?AsmValue {
406 }378 }
407379
408 const actual_word_count = section.instructions.items.len - first_word;380 const actual_word_count = section.instructions.items.len - first_word;
409 section.instructions.items[first_word] |= @as(u32, @as(u16, @intCast(actual_word_count))) << 16 | @backingInt(ass.inst.opcode);381 const header: spec.InstructionHeader = .{ .opcode = ass.inst.opcode, .word_count = @intCast(actual_word_count) };
382 section.instructions.items[first_word] = @bitCast(header);
410383
411 switch (ass.inst.opcode) {384 switch (ass.inst.opcode) {
412 .OpKill,385 .OpKill,
...@@ -454,8 +427,8 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {...@@ -454,8 +427,8 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {
454 else => return ass.fail(ass.inst.inst_offset, "%ty must be a type", .{}),427 else => return ass.fail(ass.inst.inst_offset, "%ty must be a type", .{}),
455 };428 };
456429
457 const globals = &cg.sections.globals;430 const globals = &cg.module;
458 const annotations = &cg.sections.annotations;431 const annotations = &cg.module;
459 const literal_words: usize = if (cc.child_bit_width <= @bitSizeOf(Word)) 1 else 2;432 const literal_words: usize = if (cc.child_bit_width <= @bitSizeOf(Word)) 1 else 2;
460433
461 const elem_ids = try gpa.alloc(Id, cc.values.len);434 const elem_ids = try gpa.alloc(Id, cc.values.len);
...@@ -465,11 +438,10 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {...@@ -465,11 +438,10 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {
465 elem_id_out.* = elem_id;438 elem_id_out.* = elem_id;
466439
467 switch (cc.child_kind) {440 switch (cc.child_kind) {
468 .bool => {441 .bool => if (value & 1 != 0) {
469 const opcode: Opcode = if (value & 1 != 0) .OpSpecConstantTrue else .OpSpecConstantFalse;442 try globals.emit(gpa, .OpSpecConstantTrue, .{ .id_result_type = cc.child, .id_result = elem_id });
470 try globals.emitRaw(gpa, opcode, 2);443 } else {
471 globals.writeOperand(Id, cc.child);444 try globals.emit(gpa, .OpSpecConstantFalse, .{ .id_result_type = cc.child, .id_result = elem_id });
472 globals.writeOperand(Id, elem_id);
473 },445 },
474 .int, .float => {446 .int, .float => {
475 try globals.emitRaw(gpa, .OpSpecConstant, 2 + literal_words);447 try globals.emitRaw(gpa, .OpSpecConstant, 2 + literal_words);
...@@ -487,10 +459,10 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {...@@ -487,10 +459,10 @@ fn processSpecConstVector(ass: *Assembler) !?AsmValue {
487 const spec_id_word = std.math.cast(u32, spec_id_base + i) orelse {459 const spec_id_word = std.math.cast(u32, spec_id_base + i) orelse {
488 return ass.fail(ass.inst.inst_offset, "SpecId {} does not fit in 32 bits", .{spec_id_base + i});460 return ass.fail(ass.inst.inst_offset, "SpecId {} does not fit in 32 bits", .{spec_id_base + i});
489 };461 };
490 try annotations.emitRaw(gpa, .OpDecorate, 3);462 try annotations.emit(gpa, .OpDecorate, .{
491 annotations.writeOperand(Id, elem_id);463 .target = elem_id,
492 annotations.writeWord(@backingInt(spec.Decoration.spec_id));464 .decoration = .{ .spec_id = .{ .specialization_constant_id = spec_id_word } },
493 annotations.writeWord(spec_id_word);465 });
494 }466 }
495467
496 const result_id = cg.allocId();468 const result_id = cg.allocId();
...@@ -557,14 +529,13 @@ fn parseInstruction(ass: *Assembler) !void {...@@ -557,14 +529,13 @@ fn parseInstruction(ass: *Assembler) !void {
557 }529 }
558530
559 const opcode_text = ass.tokenText(opcode_tok);531 const opcode_text = ass.tokenText(opcode_tok);
560 const index = ass.inst_map.getIndex(opcode_text) orelse {532 const opcode = std.meta.stringToEnum(spec.Opcode, opcode_text) orelse {
561 return ass.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});533 return ass.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
562 };534 };
563535
564 const inst = spec.InstructionSet.core.instructions()[index];536 ass.inst.opcode = opcode;
565 ass.inst.opcode = @fromBackingInt(@intCast(inst.opcode));
566537
567 const expected_operands = inst.operands;538 const expected_operands = opcode.operands();
568 // This is a loop because the result-id is not always the first operand.539 // This is a loop because the result-id is not always the first operand.
569 const requires_lhs_result = for (expected_operands) |op| {540 const requires_lhs_result = for (expected_operands) |op| {
570 if (op.kind == .id_result) break true;541 if (op.kind == .id_result) break true;
...@@ -614,8 +585,8 @@ fn parseOperand(ass: *Assembler, kind: spec.OperandKind) Error!void {...@@ -614,8 +585,8 @@ fn parseOperand(ass: *Assembler, kind: spec.OperandKind) Error!void {
614 else => switch (kind) {585 else => switch (kind) {
615 .literal_integer => try ass.parseLiteralInteger(),586 .literal_integer => try ass.parseLiteralInteger(),
616 .literal_string => try ass.parseString(),587 .literal_string => try ass.parseString(),
617 .literal_context_dependent_number => try ass.parseContextDependentNumber(),588 .literal_context_dependent_number => try ass.parseNumber(),
618 .literal_ext_inst_integer => try ass.parseLiteralExtInstInteger(),589 .literal_ext_inst_integer => try ass.parseLiteralInteger(),
619 .pair_id_ref_id_ref => try ass.parsePhiSource(),590 .pair_id_ref_id_ref => try ass.parsePhiSource(),
620 else => return ass.todo("parse operand of type {s}", .{@tagName(kind)}),591 else => return ass.todo("parse operand of type {s}", .{@tagName(kind)}),
621 },592 },
...@@ -661,12 +632,12 @@ fn parseBitEnum(ass: *Assembler, kind: spec.OperandKind) !void {...@@ -661,12 +632,12 @@ fn parseBitEnum(ass: *Assembler, kind: spec.OperandKind) !void {
661 if ((mask & enumerant.value) == 0)632 if ((mask & enumerant.value) == 0)
662 continue;633 continue;
663634
664 for (enumerant.parameters) |param_kind| {635 for (enumerant.parameters) |param| {
665 if (ass.isAtInstructionBoundary()) {636 if (ass.isAtInstructionBoundary()) {
666 return ass.fail(ass.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});637 return ass.fail(ass.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
667 }638 }
668639
669 try ass.parseOperand(param_kind);640 try ass.parseOperand(param.kind);
670 }641 }
671 }642 }
672}643}
...@@ -721,12 +692,12 @@ fn parseValueEnum(ass: *Assembler, kind: spec.OperandKind) !void {...@@ -721,12 +692,12 @@ fn parseValueEnum(ass: *Assembler, kind: spec.OperandKind) !void {
721692
722 try ass.inst.operands.append(gpa, .{ .value = enumerant.value });693 try ass.inst.operands.append(gpa, .{ .value = enumerant.value });
723694
724 for (enumerant.parameters) |param_kind| {695 for (enumerant.parameters) |param| {
725 if (ass.isAtInstructionBoundary()) {696 if (ass.isAtInstructionBoundary()) {
726 return ass.fail(ass.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});697 return ass.fail(ass.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
727 }698 }
728699
729 try ass.parseOperand(param_kind);700 try ass.parseOperand(param.kind);
730 }701 }
731}702}
732703
...@@ -746,30 +717,26 @@ fn parseRefId(ass: *Assembler) !void {...@@ -746,30 +717,26 @@ fn parseRefId(ass: *Assembler) !void {
746 try ass.inst.operands.append(gpa, .{ .ref_id = index });717 try ass.inst.operands.append(gpa, .{ .ref_id = index });
747}718}
748719
720fn eatPlaceholderConstant(ass: *Assembler) !?u64 {
721 const tok = ass.currentToken();
722 if (!ass.eatToken(.placeholder)) return null;
723 const name = ass.tokenText(tok)[1..];
724 const value = ass.value_map.get(name) orelse
725 return ass.fail(tok.start, "invalid placeholder '${s}'", .{name});
726 return switch (value) {
727 .constant => |literal| literal,
728 else => ass.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name}),
729 };
730}
731
749fn parseLiteralInteger(ass: *Assembler) !void {732fn parseLiteralInteger(ass: *Assembler) !void {
750 const gpa = ass.cg.gpa;733 const gpa = ass.cg.gpa;
751734
752 const tok = ass.currentToken();735 const tok = ass.currentToken();
753 if (ass.eatToken(.placeholder)) {736 if (try ass.eatPlaceholderConstant()) |literal| {
754 const name = ass.tokenText(tok)[1..];737 const literal32 = std.math.cast(u32, literal) orelse
755 const value = ass.value_map.get(name) orelse {738 return ass.fail(tok.start, "placeholder value {} does not fit in 32 bits", .{literal});
756 return ass.fail(tok.start, "invalid placeholder '${s}'", .{name});739 try ass.inst.operands.append(gpa, .{ .literal32 = literal32 });
757 };
758 switch (value) {
759 .constant => |literal| {
760 const literal32 = std.math.cast(u32, literal) orelse {
761 return ass.fail(
762 tok.start,
763 "placeholder value {} does not fit in 32 bits",
764 .{literal},
765 );
766 };
767 try ass.inst.operands.append(gpa, .{ .literal32 = literal32 });
768 },
769 else => {
770 return ass.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
771 },
772 }
773 return;740 return;
774 }741 }
775742
...@@ -786,41 +753,6 @@ fn parseLiteralInteger(ass: *Assembler) !void {...@@ -786,41 +753,6 @@ fn parseLiteralInteger(ass: *Assembler) !void {
786 try ass.inst.operands.append(gpa, .{ .literal32 = value });753 try ass.inst.operands.append(gpa, .{ .literal32 = value });
787}754}
788755
789fn parseLiteralExtInstInteger(ass: *Assembler) !void {
790 const gpa = ass.cg.gpa;
791
792 const tok = ass.currentToken();
793 if (ass.eatToken(.placeholder)) {
794 const name = ass.tokenText(tok)[1..];
795 const value = ass.value_map.get(name) orelse {
796 return ass.fail(tok.start, "invalid placeholder '${s}'", .{name});
797 };
798 switch (value) {
799 .constant => |literal| {
800 const literal32 = std.math.cast(u32, literal) orelse {
801 return ass.fail(
802 tok.start,
803 "placeholder value {} does not fit in 32 bits",
804 .{literal},
805 );
806 };
807 try ass.inst.operands.append(gpa, .{ .literal32 = literal32 });
808 },
809 else => {
810 return ass.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
811 },
812 }
813 return;
814 }
815
816 try ass.expectToken(.value);
817 const text = ass.tokenText(tok);
818 const value = std.fmt.parseInt(u32, text, 0) catch {
819 return ass.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
820 };
821 try ass.inst.operands.append(gpa, .{ .literal32 = value });
822}
823
824fn parseString(ass: *Assembler) !void {756fn parseString(ass: *Assembler) !void {
825 const gpa = ass.cg.gpa;757 const gpa = ass.cg.gpa;
826758
...@@ -844,7 +776,7 @@ fn parseString(ass: *Assembler) !void {...@@ -844,7 +776,7 @@ fn parseString(ass: *Assembler) !void {
844 try ass.inst.operands.append(gpa, .{ .string = string_offset });776 try ass.inst.operands.append(gpa, .{ .string = string_offset });
845}777}
846778
847fn parseContextDependentNumber(ass: *Assembler) !void {779fn parseNumber(ass: *Assembler) !void {
848 const cg = ass.cg;780 const cg = ass.cg;
849 assert(ass.inst.opcode == .OpConstant or ass.inst.opcode == .OpSpecConstant);781 assert(ass.inst.opcode == .OpConstant or ass.inst.opcode == .OpSpecConstant);
850782
...@@ -852,14 +784,14 @@ fn parseContextDependentNumber(ass: *Assembler) !void {...@@ -852,14 +784,14 @@ fn parseContextDependentNumber(ass: *Assembler) !void {
852 const result = try ass.resolveRef(ass.inst.operands.items[0].ref_id);784 const result = try ass.resolveRef(ass.inst.operands.items[0].ref_id);
853 const result_id = result.resultId();785 const result_id = result.resultId();
854786
855 const words = cg.sections.globals.instructions.items;787 const words = cg.module.instructions.items;
856 var offset: usize = 0;788 var offset: usize = 0;
857 while (offset < words.len) {789 while (offset < words.len) {
858 const word_count = words[offset] >> 16;790 const header: spec.InstructionHeader = @bitCast(words[offset]);
859 const opcode: Opcode = @fromBackingInt(@intCast(words[offset] & 0xFFFF));791 const word_count = header.word_count;
860 defer offset += word_count;792 defer offset += word_count;
861 if (word_count == 0) break;793 if (word_count == 0) break;
862 switch (opcode) {794 switch (header.opcode) {
863 .OpTypeInt => if (word_count >= 4 and @as(Id, @fromBackingInt(@intCast(words[offset + 1]))) == result_id) {795 .OpTypeInt => if (word_count >= 4 and @as(Id, @fromBackingInt(@intCast(words[offset + 1]))) == result_id) {
864 const width: u16 = @intCast(words[offset + 2]);796 const width: u16 = @intCast(words[offset + 2]);
865 const signedness: std.lang.Signedness = if (words[offset + 3] == 0) .unsigned else .signed;797 const signedness: std.lang.Signedness = if (words[offset + 3] == 0) .unsigned else .signed;
...@@ -885,22 +817,11 @@ fn parseContextDependentInt(ass: *Assembler, signedness: std.lang.Signedness, wi...@@ -885,22 +817,11 @@ fn parseContextDependentInt(ass: *Assembler, signedness: std.lang.Signedness, wi
885 const gpa = ass.cg.gpa;817 const gpa = ass.cg.gpa;
886818
887 const tok = ass.currentToken();819 const tok = ass.currentToken();
888 if (ass.eatToken(.placeholder)) {820 if (try ass.eatPlaceholderConstant()) |literal| {
889 const name = ass.tokenText(tok)[1..];821 if (width <= @bitSizeOf(spec.Word)) {
890 const value = ass.value_map.get(name) orelse {822 try ass.inst.operands.append(gpa, .{ .literal32 = @truncate(literal) });
891 return ass.fail(tok.start, "invalid placeholder '${s}'", .{name});823 } else {
892 };824 try ass.inst.operands.append(gpa, .{ .literal64 = literal });
893 switch (value) {
894 .constant => |literal| {
895 if (width <= @bitSizeOf(spec.Word)) {
896 try ass.inst.operands.append(gpa, .{ .literal32 = @truncate(literal) });
897 } else {
898 try ass.inst.operands.append(gpa, .{ .literal64 = literal });
899 }
900 },
901 else => {
902 return ass.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
903 },
904 }825 }
905 return;826 return;
906 }827 }
...@@ -943,22 +864,11 @@ fn parseContextDependentFloat(ass: *Assembler, comptime width: u16) !void {...@@ -943,22 +864,11 @@ fn parseContextDependentFloat(ass: *Assembler, comptime width: u16) !void {
943 const Int = @Int(.unsigned, width);864 const Int = @Int(.unsigned, width);
944865
945 const tok = ass.currentToken();866 const tok = ass.currentToken();
946 if (ass.eatToken(.placeholder)) {867 if (try ass.eatPlaceholderConstant()) |literal| {
947 const name = ass.tokenText(tok)[1..];868 if (width <= @bitSizeOf(spec.Word)) {
948 const value = ass.value_map.get(name) orelse {869 try ass.inst.operands.append(gpa, .{ .literal32 = @truncate(literal) });
949 return ass.fail(tok.start, "invalid placeholder '${s}'", .{name});870 } else {
950 };871 try ass.inst.operands.append(gpa, .{ .literal64 = literal });
951 switch (value) {
952 .constant => |literal| {
953 if (width <= @bitSizeOf(spec.Word)) {
954 try ass.inst.operands.append(gpa, .{ .literal32 = @truncate(literal) });
955 } else {
956 try ass.inst.operands.append(gpa, .{ .literal64 = literal });
957 }
958 },
959 else => {
960 return ass.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
961 },
962 }872 }
963 return;873 return;
964 }874 }
src/codegen/spirv/CodeGen.zig+793-1040
...@@ -10,32 +10,20 @@ base_line: u32,...@@ -10,32 +10,20 @@ base_line: u32,
1010
11// Module-level output (accumulated across the nav's codegen)11// Module-level output (accumulated across the nav's codegen)
12next_result_id: Word = 1,12next_result_id: Word = 1,
13decls: std.ArrayList(Decl) = .empty,13navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id) = .empty,
14decl_deps: std.ArrayList(Decl.Index) = .empty,14externs: std.array_hash_map.Auto(InternPool.Nav.Index, Mir.Extern) = .empty,
15nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,15entry_points: std.ArrayList(Mir.EntryPoint) = .empty,
16uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,16error_buffer: ?Id = null,
17entry_points: std.array_hash_map.Auto(Id, EntryPoint) = .empty,
18error_buffer: ?Decl.Index = null,
19struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty,17struct_types: std.array_hash_map.Custom(StructType, Id, StructType.HashContext, true) = .empty,
20/// SPIR-V ids of OpVariables whose pointee is a Block struct18/// SPIR-V ids of OpVariables whose pointee is a Block struct
21block_var_ids: std.AutoHashMapUnmanaged(Id, void) = .empty,19block_var_ids: std.AutoHashMapUnmanaged(Id, void) = .empty,
22builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Decl.Index) = .empty,20builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Id) = .empty,
23sections: struct {21module: Section = .empty,
24 // Module layout, according to SPIR-V Spec section 2.4, "Logical Layout of a Module".22
25 extended_instruction_set: Section = .{},23// Per-function state
26 memory_model: Section = .{},24prologue: Section = .empty,
27 execution_modes: Section = .{},25body: Section = .empty,
28 debug_strings: Section = .{},26args: std.MultiArrayList(struct { id: Id, ty: Id }) = .empty,
29 debug_names: Section = .{},
30 annotations: Section = .{},
31 globals: Section = .{},
32 functions: Section = .{},
33} = .{},
34
35// Per-function state (reset between top-level genNav calls)
36prologue: Section = .{},
37body: Section = .{},
38args: std.ArrayList(Id) = .empty,
39next_arg_index: u32 = 0,27next_arg_index: u32 = 0,
40/// Caches the limb extractions for composite integer values so repeated28/// Caches the limb extractions for composite integer values so repeated
41/// arithmetic on the same operand doesn't re-emit `OpCompositeExtract` per29/// arithmetic on the same operand doesn't re-emit `OpCompositeExtract` per
...@@ -79,28 +67,6 @@ pub const Repr = enum {...@@ -79,28 +67,6 @@ pub const Repr = enum {
79 indirect,67 indirect,
80};68};
8169
82/// A function or global, tracked here so the linker can order globals and build
83/// per-entry-point interface lists.
84pub const Decl = struct {
85 pub const Index = enum(u32) { _ };
86 pub const Kind = enum { func, global, invocation_global };
87
88 kind: Kind,
89 /// Result-id of the associated OpFunction / OpVariable / InvocationGlobal.
90 result_id: Id,
91 /// Range into `decl_deps` for this decl's dependencies.
92 begin_dep: usize = 0,
93 end_dep: usize = 0,
94 /// Whether an extern-function stub has been emitted.
95 has_extern_stub: bool = false,
96};
97
98pub const EntryPoint = struct {
99 decl_index: Decl.Index,
100 name: []const u8,
101 cc: std.builtin.CallingConvention,
102};
103
104const StructType = struct {70const StructType = struct {
105 fields: []const Id,71 fields: []const Id,
106 ip_index: InternPool.Index,72 ip_index: InternPool.Index,
...@@ -193,24 +159,16 @@ pub fn deinit(cg: *CodeGen) void {...@@ -193,24 +159,16 @@ pub fn deinit(cg: *CodeGen) void {
193 cg.prologue.deinit(gpa);159 cg.prologue.deinit(gpa);
194 cg.body.deinit(gpa);160 cg.body.deinit(gpa);
195161
196 cg.nav_link.deinit(gpa);162 cg.navs.deinit(gpa);
197 cg.uav_link.deinit(gpa);163 cg.externs.deinit(gpa);
198164
199 cg.sections.extended_instruction_set.deinit(gpa);165 cg.module.deinit(gpa);
200 cg.sections.memory_model.deinit(gpa);
201 cg.sections.execution_modes.deinit(gpa);
202 cg.sections.debug_strings.deinit(gpa);
203 cg.sections.debug_names.deinit(gpa);
204 cg.sections.annotations.deinit(gpa);
205 cg.sections.globals.deinit(gpa);
206 cg.sections.functions.deinit(gpa);
207166
208 cg.struct_types.deinit(gpa);167 cg.struct_types.deinit(gpa);
209 cg.block_var_ids.deinit(gpa);168 cg.block_var_ids.deinit(gpa);
210 cg.builtins.deinit(gpa);169 cg.builtins.deinit(gpa);
211170
212 cg.decls.deinit(gpa);171 for (cg.entry_points.items) |ep| gpa.free(ep.name);
213 cg.decl_deps.deinit(gpa);
214 cg.entry_points.deinit(gpa);172 cg.entry_points.deinit(gpa);
215}173}
216174
...@@ -223,7 +181,10 @@ pub fn generate(...@@ -223,7 +181,10 @@ pub fn generate(
223) codegen.Error!Mir {181) codegen.Error!Mir {
224 const zcu = pt.zcu;182 const zcu = pt.zcu;
225 const gpa = zcu.gpa;183 const gpa = zcu.gpa;
226 const nav = zcu.funcInfo(func_index).owner_nav;184 const ip = &zcu.intern_pool;
185 const nav_index = zcu.funcInfo(func_index).owner_nav;
186 const nav = ip.getNav(nav_index);
187 const fn_info = zcu.typeToFunc(.fromInterned(nav.resolved.?.type)).?;
227188
228 var arena = std.heap.ArenaAllocator.init(gpa);189 var arena = std.heap.ArenaAllocator.init(gpa);
229 defer arena.deinit();190 defer arena.deinit();
...@@ -235,22 +196,60 @@ pub fn generate(...@@ -235,22 +196,60 @@ pub fn generate(
235 .zcu = zcu,196 .zcu = zcu,
236 .air = air.*,197 .air = air.*,
237 .liveness = liveness.*.?,198 .liveness = liveness.*.?,
238 .owner_nav = nav,199 .owner_nav = nav_index,
239 .base_line = zcu.navSrcLine(nav),200 .base_line = zcu.navSrcLine(nav_index),
240 };201 };
241 defer cg.deinit();202 defer cg.deinit();
242203
243 try cg.genNav(true);204 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
205 const is_test = zcu.test_functions.contains(nav_index);
206 const nav_id = try cg.resolveNav(nav_index);
207 const function_id = if (is_test) cg.allocId() else nav_id;
208
209 try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len);
210 for (fn_info.param_types.get(ip)) |param_ty_index| {
211 const param_ty: Type = .fromInterned(param_ty_index);
212 if (!param_ty.hasRuntimeBits(zcu)) continue;
213 const param_ty_id = try cg.resolveType(param_ty, .direct);
214 cg.args.appendAssumeCapacity(.{ .id = cg.allocId(), .ty = param_ty_id });
215 }
216
217 const root_block_id = cg.allocId();
218 try cg.prologue.emit(gpa, .OpLabel, .{ .id_result = root_block_id });
219 cg.block_label = root_block_id;
220 _ = try cg.genStructuredBody(.selection, cg.air.getMainBody());
221 try cg.body.emit(gpa, .OpUnreachable, {});
222 try cg.body.emit(gpa, .OpFunctionEnd, {});
223
224 const fn_ty_id = try cg.functionType(return_ty_id, cg.args.items(.ty));
225 try cg.module.emit(gpa, .OpFunction, .{
226 .id_result_type = return_ty_id,
227 .id_result = function_id,
228 .function_control = .{},
229 .function_type = fn_ty_id,
230 });
231 for (cg.args.items(.id), cg.args.items(.ty)) |arg_id, arg_ty_id| {
232 try cg.module.emit(gpa, .OpFunctionParameter, .{
233 .id_result_type = arg_ty_id,
234 .id_result = arg_id,
235 });
236 }
237 try cg.module.append(gpa, cg.prologue);
238 try cg.module.append(gpa, cg.body);
239 if (is_test) try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), nav_id, function_id);
240 try cg.debugName(function_id, nav.fqn.toSlice(ip));
244241
245 return cg.serializeToMir(gpa);242 return cg.toOwnedMir();
246}243}
247244
248pub fn generateNav(245pub fn generateNav(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) codegen.Error!Mir {
249 pt: Zcu.PerThread,
250 nav_index: InternPool.Nav.Index,
251) codegen.Error!Mir {
252 const zcu = pt.zcu;246 const zcu = pt.zcu;
253 const gpa = zcu.gpa;247 const gpa = zcu.gpa;
248 const ip = &zcu.intern_pool;
249 const target = zcu.getTarget();
250 const nav = ip.getNav(nav_index);
251 const val = zcu.navValue(nav_index);
252 const ty = val.typeOf(zcu);
254253
255 var arena = std.heap.ArenaAllocator.init(gpa);254 var arena = std.heap.ArenaAllocator.init(gpa);
256 defer arena.deinit();255 defer arena.deinit();
...@@ -267,116 +266,133 @@ pub fn generateNav(...@@ -267,116 +266,133 @@ pub fn generateNav(
267 };266 };
268 defer cg.deinit();267 defer cg.deinit();
269268
270 try cg.genNav(false);269 const resolved = nav.resolved.?;
271270 if (nav.getExtern(ip)) |ext| {
272 return cg.serializeToMir(gpa);271 if (!ty.hasRuntimeBits(zcu)) {
273}272 const child_ty = if (ty.zigTypeTag(zcu) == .pointer) ty.childType(zcu) else ty;
273 if (child_ty.zigTypeTag(zcu) != .spirv) return cg.toOwnedMir();
274 }
274275
275fn serializeToMir(cg: *CodeGen, gpa: Allocator) codegen.Error!Mir {276 const as = resolved.@"addrspace";
276 const owner_entry = cg.nav_link.get(cg.owner_nav);277 const storage_class = cg.storageClass(as);
277 const owner_decl_index = owner_entry orelse return .{278 const result_id = try cg.resolveNav(nav_index);
278 .id_bound = cg.next_result_id,279 const ty_id = try cg.pointeeType(as, ty, true);
279 .owner_nav = cg.owner_nav,280 const ptr_ty_id = try cg.ptrType(ty_id, storage_class);
280 .kind = .func,
281 .decl_result_id = .none,
282 .extended_instruction_set = &.{},
283 .globals = &.{},
284 .functions = &.{},
285 .annotations = &.{},
286 .debug_names = &.{},
287 .debug_strings = &.{},
288 .execution_modes = &.{},
289 .nav_refs = &.{},
290 .uav_refs = &.{},
291 .decl_deps = &.{},
292 .internal_globals = &.{},
293 .entry_points = &.{},
294 };
295281
296 const owner_decl = cg.declPtr(owner_decl_index);282 try cg.module.emit(gpa, .OpVariable, .{
297283 .id_result_type = ptr_ty_id,
298 var nav_refs: std.ArrayList(Mir.NavRef) = .empty;284 .id_result = result_id,
299 defer nav_refs.deinit(gpa);285 .storage_class = storage_class,
300 var nav_it = cg.nav_link.iterator();
301 while (nav_it.next()) |entry| {
302 if (entry.key_ptr.* == cg.owner_nav) continue;
303 const decl = cg.declPtr(entry.value_ptr.*);
304 try nav_refs.append(gpa, .{
305 .local_id = decl.result_id,
306 .nav = entry.key_ptr.*,
307 .kind = decl.kind,
308 });286 });
309 }
310287
311 var uav_refs: std.ArrayList(Mir.UavRef) = .empty;288 switch (target.os.tag) {
312 defer uav_refs.deinit(gpa);289 .vulkan, .opengl => {
313 var uav_it = cg.uav_link.iterator();290 switch (storage_class) {
314 while (uav_it.next()) |entry| {291 .uniform,
315 const decl = cg.declPtr(entry.value_ptr.*);292 .push_constant,
316 try uav_refs.append(gpa, .{293 .storage_buffer,
317 .local_id = decl.result_id,294 .physical_storage_buffer,
318 .val = entry.key_ptr.*[0],295 => {
319 .storage_class = entry.key_ptr.*[1],296 if (ty.hasRuntimeBits(zcu)) {
320 .kind = decl.kind,297 if (!ty.isSpirvRuntimeArray(zcu)) {
321 });298 try cg.decorate(ptr_ty_id, .{ .array_stride = .{
322 }299 .array_stride = @intCast(ty.abiSize(zcu)),
300 } });
301 }
302 if (!cg.needsLayout(as, ty)) try cg.decorateLayout(ty, ty_id);
303 }
304 if (ext.is_const and storage_class == .storage_buffer) {
305 try cg.decorate(result_id, .non_writable);
306 }
307 },
308 else => {},
309 }
323310
324 var decl_deps: std.ArrayList(Mir.DeclDep) = .empty;311 const image_ty = blk: {
325 defer decl_deps.deinit(gpa);312 if (ty.zigTypeTag(zcu) == .array or ty.isSpirvRuntimeArray(zcu)) {
326 var internal_globals: std.ArrayList(Id) = .empty;313 break :blk ty.childType(zcu);
327 defer internal_globals.deinit(gpa);314 }
328315 break :blk ty;
329 const deps = cg.decl_deps.items[owner_decl.begin_dep..owner_decl.end_dep];316 };
330 for (deps) |dep_index| {317 if (image_ty.zigTypeTag(zcu) == .spirv) {
331 const dep_decl = cg.declPtr(dep_index);318 const spirv_type = ip.loadSpirvType(image_ty.toIntern());
332 var found = false;319 if (spirv_type.flags.tag == .image) switch (spirv_type.flags.access) {
333 nav_it.index = 0;320 .read_only => try cg.decorate(result_id, .non_writable),
334 while (nav_it.next()) |entry| {321 .write_only => try cg.decorate(result_id, .non_readable),
335 if (entry.value_ptr.* == dep_index) {322 .read_write, .unknown => {},
336 try decl_deps.append(gpa, .{323 };
337 .kind = dep_decl.kind,324 }
338 .nav = entry.key_ptr.*,325
339 });326 if (ext.decoration) |decoration| switch (decoration) {
340 found = true;327 .location => |location| {
341 break;328 try cg.decorate(result_id, .{
342 }329 .location = .{ .location = location },
330 });
331 },
332 .flat => |location| {
333 try cg.decorate(result_id, .{ .location = .{ .location = location } });
334 try cg.decorate(result_id, .flat);
335 },
336 .descriptor => |descriptor| {
337 try cg.decorate(result_id, .{ .binding = .{
338 .binding_point = descriptor.binding,
339 } });
340 try cg.decorate(result_id, .{ .descriptor_set = .{
341 .descriptor_set = descriptor.set,
342 } });
343 },
344 };
345 },
346 else => {},
343 }347 }
344 if (!found and dep_decl.kind == .global) {348
345 try internal_globals.append(gpa, dep_decl.result_id);349 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |built_in| {
350 try cg.decorate(result_id, .{ .built_in = .{ .built_in = built_in } });
346 }351 }
347 }
348352
349 var ep_list: std.ArrayList(Mir.EntryPoint) = .empty;353 try cg.debugName(result_id, nav.fqn.toSlice(ip));
350 defer ep_list.deinit(gpa);354 } else if (resolved.@"threadlocal" and ty.hasRuntimeBits(zcu)) {
351 var ep_it = cg.entry_points.iterator();355 if (target.os.tag == .opencl) return cg.todo("threadlocal variables on OpenCL", .{});
352 while (ep_it.next()) |entry| {356
353 const ep = entry.value_ptr;357 const ty_id = try cg.resolveType(ty, .indirect);
354 const ep_decl = cg.declPtr(ep.decl_index);358 const ptr_ty_id = try cg.ptrType(ty_id, .private);
355 try ep_list.append(gpa, .{359 const init_id = try cg.constant(ty, val, .indirect);
356 .local_id = ep_decl.result_id,360
357 .name = try gpa.dupe(u8, ep.name),361 const result_id = try cg.resolveNav(nav_index);
358 .cc = ep.cc,362 try cg.module.emit(gpa, .OpVariable, .{
363 .id_result_type = ptr_ty_id,
364 .id_result = result_id,
365 .storage_class = .private,
366 .initializer = init_id,
359 });367 });
368 try cg.debugName(result_id, nav.fqn.toSlice(ip));
360 }369 }
370 return cg.toOwnedMir();
371}
361372
362 return .{373fn toOwnedMir(cg: *CodeGen) Allocator.Error!Mir {
374 const gpa = cg.gpa;
375
376 const nav_refs = try gpa.alloc(Mir.NavRef, cg.navs.count());
377 errdefer gpa.free(nav_refs);
378 for (nav_refs, cg.navs.keys(), cg.navs.values()) |*ref, ref_nav, id| {
379 ref.* = .{ .id = id, .nav = ref_nav };
380 }
381
382 const externs = try gpa.dupe(Mir.Extern, cg.externs.values());
383 errdefer gpa.free(externs);
384
385 const entry_points = try cg.entry_points.toOwnedSlice(gpa);
386 const mir: Mir = .{
363 .id_bound = cg.next_result_id,387 .id_bound = cg.next_result_id,
364 .owner_nav = cg.owner_nav,388 .module = cg.module,
365 .kind = owner_decl.kind,389 .nav_refs = nav_refs,
366 .decl_result_id = owner_decl.result_id,390 .externs = externs,
367 .extended_instruction_set = try cg.sections.extended_instruction_set.instructions.toOwnedSlice(gpa),391 .entry_points = entry_points,
368 .globals = try cg.sections.globals.instructions.toOwnedSlice(gpa),
369 .functions = try cg.sections.functions.instructions.toOwnedSlice(gpa),
370 .annotations = try cg.sections.annotations.instructions.toOwnedSlice(gpa),
371 .debug_names = try cg.sections.debug_names.instructions.toOwnedSlice(gpa),
372 .debug_strings = try cg.sections.debug_strings.instructions.toOwnedSlice(gpa),
373 .execution_modes = try cg.sections.execution_modes.instructions.toOwnedSlice(gpa),
374 .nav_refs = try nav_refs.toOwnedSlice(gpa),
375 .uav_refs = try uav_refs.toOwnedSlice(gpa),
376 .decl_deps = try decl_deps.toOwnedSlice(gpa),
377 .internal_globals = try internal_globals.toOwnedSlice(gpa),
378 .entry_points = try ep_list.toOwnedSlice(gpa),
379 };392 };
393 cg.module = .empty;
394
395 return mir;
380}396}
381397
382fn typeOf(cg: *CodeGen, inst: Air.Inst.Ref) Type {398fn typeOf(cg: *CodeGen, inst: Air.Inst.Ref) Type {
...@@ -389,22 +405,50 @@ fn typeOfIndex(cg: *CodeGen, inst: Air.Inst.Index) Type {...@@ -389,22 +405,50 @@ fn typeOfIndex(cg: *CodeGen, inst: Air.Inst.Index) Type {
389 return cg.air.typeOfIndex(inst, &zcu.intern_pool);405 return cg.air.typeOfIndex(inst, &zcu.intern_pool);
390}406}
391407
392/// Does not generate the nav.408pub fn resolveNav(cg: *CodeGen, nav_index: InternPool.Nav.Index) !Id {
393pub fn resolveNav(cg: *CodeGen, ip: *InternPool, nav_index: InternPool.Nav.Index) !Decl.Index {409 const gop = try cg.navs.getOrPut(cg.gpa, nav_index);
394 const entry = try cg.nav_link.getOrPut(cg.gpa, nav_index);410 if (!gop.found_existing) gop.value_ptr.* = cg.allocId();
395 if (!entry.found_existing) {411 return gop.value_ptr.*;
396 const nav = ip.getNav(nav_index);412}
397 // TODO: Extern fn?413
398 const kind: Decl.Kind = if (ip.isFunctionType(nav.resolved.?.type))414fn resolveExternFn(cg: *CodeGen, nav_index: InternPool.Nav.Index) !Id {
399 .func415 const gpa = cg.gpa;
400 else switch (nav.resolved.?.@"addrspace") {416 const zcu = cg.zcu;
401 .generic => .invocation_global,417 const ip = &zcu.intern_pool;
402 else => .global,418 if (cg.externs.get(nav_index)) |ext| return ext.id;
403 };419
404 entry.value_ptr.* = try cg.allocDecl(kind);420 const nav = ip.getNav(nav_index);
421 const fn_ty: Type = .fromInterned(nav.resolved.?.type);
422 const fn_info = zcu.typeToFunc(fn_ty).?;
423 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
424 const fn_ty_id = try cg.resolveType(fn_ty, .direct);
425 const scratch_top = cg.id_scratch.items.len;
426 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
427 for (fn_info.param_types.get(ip)) |param_ty_index| {
428 const param_ty: Type = .fromInterned(param_ty_index);
429 if (!param_ty.hasRuntimeBits(zcu)) continue;
430 try cg.id_scratch.append(gpa, try cg.resolveType(param_ty, .direct));
405 }431 }
406432
407 return entry.value_ptr.*;433 const id = cg.allocId();
434 try cg.externs.putNoClobber(gpa, nav_index, .{
435 .id = id,
436 .name = nav.getExtern(ip).?.name.toSlice(ip),
437 });
438 try cg.module.emit(gpa, .OpFunction, .{
439 .id_result_type = return_ty_id,
440 .id_result = id,
441 .function_control = .{},
442 .function_type = fn_ty_id,
443 });
444 for (cg.id_scratch.items[scratch_top..]) |param_ty_id| {
445 try cg.module.emit(gpa, .OpFunctionParameter, .{
446 .id_result_type = param_ty_id,
447 .id_result = cg.allocId(),
448 });
449 }
450 try cg.module.emit(gpa, .OpFunctionEnd, {});
451 return id;
408}452}
409453
410pub fn allocIds(cg: *CodeGen, n: u32) spec.IdRange {454pub fn allocIds(cg: *CodeGen, n: u32) spec.IdRange {
...@@ -420,34 +464,10 @@ pub fn idBound(cg: *const CodeGen) Word {...@@ -420,34 +464,10 @@ pub fn idBound(cg: *const CodeGen) Word {
420 return cg.next_result_id;464 return cg.next_result_id;
421}465}
422466
423pub fn addEntryPointDeps(
424 cg: *CodeGen,
425 decl_index: Decl.Index,
426 seen: *std.bit_set.Dynamic,
427 interface: *std.ArrayList(Id),
428) !void {
429 const decl = cg.declPtr(decl_index);
430 const deps = cg.decl_deps.items[decl.begin_dep..decl.end_dep];
431
432 if (seen.isSet(@backingInt(decl_index))) {
433 return;
434 }
435
436 seen.set(@backingInt(decl_index));
437
438 if (decl.kind == .global) {
439 try interface.append(cg.gpa, decl.result_id);
440 }
441
442 for (deps) |dep| {
443 try cg.addEntryPointDeps(dep, seen, interface);
444 }
445}
446
447pub fn importInstructionSet(cg: *CodeGen, set: spec.InstructionSet) !Id {467pub fn importInstructionSet(cg: *CodeGen, set: spec.InstructionSet) !Id {
448 assert(set != .core);468 assert(set != .core);
449 const result_id = cg.allocId();469 const result_id = cg.allocId();
450 try cg.sections.extended_instruction_set.emit(cg.gpa, .OpExtInstImport, .{470 try cg.module.emit(cg.gpa, .OpExtInstImport, .{
451 .id_result = result_id,471 .id_result = result_id,
452 .name = @tagName(set),472 .name = @tagName(set),
453 });473 });
...@@ -456,7 +476,7 @@ pub fn importInstructionSet(cg: *CodeGen, set: spec.InstructionSet) !Id {...@@ -456,7 +476,7 @@ pub fn importInstructionSet(cg: *CodeGen, set: spec.InstructionSet) !Id {
456476
457pub fn boolType(cg: *CodeGen) !Id {477pub fn boolType(cg: *CodeGen) !Id {
458 const result_id = cg.allocId();478 const result_id = cg.allocId();
459 try cg.sections.globals.emit(cg.gpa, .OpTypeBool, .{479 try cg.module.emit(cg.gpa, .OpTypeBool, .{
460 .id_result = result_id,480 .id_result = result_id,
461 });481 });
462 return result_id;482 return result_id;
...@@ -464,20 +484,17 @@ pub fn boolType(cg: *CodeGen) !Id {...@@ -464,20 +484,17 @@ pub fn boolType(cg: *CodeGen) !Id {
464484
465pub fn voidType(cg: *CodeGen) !Id {485pub fn voidType(cg: *CodeGen) !Id {
466 const result_id = cg.allocId();486 const result_id = cg.allocId();
467 try cg.sections.globals.emit(cg.gpa, .OpTypeVoid, .{487 try cg.module.emit(cg.gpa, .OpTypeVoid, .{
468 .id_result = result_id,488 .id_result = result_id,
469 });489 });
470 try cg.debugName(result_id, "void");490 try cg.debugName(result_id, "void");
471 return result_id;491 return result_id;
472}492}
473493
474pub fn opaqueType(cg: *CodeGen, name: []const u8) !Id {494pub fn opaqueType(cg: *CodeGen, comptime fmt: []const u8, args: anytype) !Id {
475 const result_id = cg.allocId();495 const result_id = cg.allocId();
476 try cg.sections.globals.emit(cg.gpa, .OpTypeOpaque, .{496 try cg.module.emitFormatted(cg.gpa, .OpTypeOpaque, &.{result_id}, fmt, args);
477 .id_result = result_id,497 try cg.debugNameFmt(result_id, fmt, args);
478 .literal_string = name,
479 });
480 try cg.debugName(result_id, name);
481 return result_id;498 return result_id;
482}499}
483500
...@@ -513,7 +530,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {...@@ -513,7 +530,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {
513 const limb_ty = try cg.intType(.unsigned, limb_bits);530 const limb_ty = try cg.intType(.unsigned, limb_bits);
514 const len_ty = try cg.intType(.unsigned, 32);531 const len_ty = try cg.intType(.unsigned, 32);
515 const len_id = cg.allocId();532 const len_id = cg.allocId();
516 try cg.sections.globals.emit(cg.gpa, .OpConstant, .{533 try cg.module.emit(cg.gpa, .OpConstant, .{
517 .id_result_type = len_ty,534 .id_result_type = len_ty,
518 .id_result = len_id,535 .id_result = len_id,
519 .value = .{ .uint32 = backing_bits / limb_bits },536 .value = .{ .uint32 = backing_bits / limb_bits },
...@@ -522,7 +539,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {...@@ -522,7 +539,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {
522 }539 }
523540
524 const result_id = cg.allocId();541 const result_id = cg.allocId();
525 try cg.sections.globals.emit(cg.gpa, .OpTypeInt, .{542 try cg.module.emit(cg.gpa, .OpTypeInt, .{
526 .id_result = result_id,543 .id_result = result_id,
527 .width = backing_bits,544 .width = backing_bits,
528 .signedness = switch (actual_signedness) {545 .signedness = switch (actual_signedness) {
...@@ -540,7 +557,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {...@@ -540,7 +557,7 @@ pub fn intType(cg: *CodeGen, signedness: std.lang.Signedness, bits: u16) !Id {
540pub fn floatType(cg: *CodeGen, bits: u16) !Id {557pub fn floatType(cg: *CodeGen, bits: u16) !Id {
541 assert(bits > 0);558 assert(bits > 0);
542 const result_id = cg.allocId();559 const result_id = cg.allocId();
543 try cg.sections.globals.emit(cg.gpa, .OpTypeFloat, .{560 try cg.module.emit(cg.gpa, .OpTypeFloat, .{
544 .id_result = result_id,561 .id_result = result_id,
545 .width = bits,562 .width = bits,
546 });563 });
...@@ -550,7 +567,7 @@ pub fn floatType(cg: *CodeGen, bits: u16) !Id {...@@ -550,7 +567,7 @@ pub fn floatType(cg: *CodeGen, bits: u16) !Id {
550567
551pub fn vectorType(cg: *CodeGen, len: u32, child_ty_id: Id) !Id {568pub fn vectorType(cg: *CodeGen, len: u32, child_ty_id: Id) !Id {
552 const result_id = cg.allocId();569 const result_id = cg.allocId();
553 try cg.sections.globals.emit(cg.gpa, .OpTypeVector, .{570 try cg.module.emit(cg.gpa, .OpTypeVector, .{
554 .id_result = result_id,571 .id_result = result_id,
555 .component_type = child_ty_id,572 .component_type = child_ty_id,
556 .component_count = len,573 .component_count = len,
...@@ -560,7 +577,7 @@ pub fn vectorType(cg: *CodeGen, len: u32, child_ty_id: Id) !Id {...@@ -560,7 +577,7 @@ pub fn vectorType(cg: *CodeGen, len: u32, child_ty_id: Id) !Id {
560577
561pub fn arrayType(cg: *CodeGen, len_id: Id, child_ty_id: Id) !Id {578pub fn arrayType(cg: *CodeGen, len_id: Id, child_ty_id: Id) !Id {
562 const result_id = cg.allocId();579 const result_id = cg.allocId();
563 try cg.sections.globals.emit(cg.gpa, .OpTypeArray, .{580 try cg.module.emit(cg.gpa, .OpTypeArray, .{
564 .id_result = result_id,581 .id_result = result_id,
565 .element_type = child_ty_id,582 .element_type = child_ty_id,
566 .length = len_id,583 .length = len_id,
...@@ -570,7 +587,7 @@ pub fn arrayType(cg: *CodeGen, len_id: Id, child_ty_id: Id) !Id {...@@ -570,7 +587,7 @@ pub fn arrayType(cg: *CodeGen, len_id: Id, child_ty_id: Id) !Id {
570587
571pub fn ptrType(cg: *CodeGen, child_ty_id: Id, storage_class: spec.StorageClass) !Id {588pub fn ptrType(cg: *CodeGen, child_ty_id: Id, storage_class: spec.StorageClass) !Id {
572 const result_id = cg.allocId();589 const result_id = cg.allocId();
573 try cg.sections.globals.emit(cg.gpa, .OpTypePointer, .{590 try cg.module.emit(cg.gpa, .OpTypePointer, .{
574 .id_result = result_id,591 .id_result = result_id,
575 .storage_class = storage_class,592 .storage_class = storage_class,
576 .type = child_ty_id,593 .type = child_ty_id,
...@@ -589,7 +606,7 @@ pub fn structType(...@@ -589,7 +606,7 @@ pub fn structType(
589 if (cg.struct_types.get(.{ .fields = types, .ip_index = actual_ip_index })) |id| return id;606 if (cg.struct_types.get(.{ .fields = types, .ip_index = actual_ip_index })) |id| return id;
590 const result_id = cg.allocId();607 const result_id = cg.allocId();
591 const types_dup = try cg.arena.dupe(Id, types);608 const types_dup = try cg.arena.dupe(Id, types);
592 try cg.sections.globals.emit(cg.gpa, .OpTypeStruct, .{609 try cg.module.emit(cg.gpa, .OpTypeStruct, .{
593 .id_result = result_id,610 .id_result = result_id,
594 .id_ref = types_dup,611 .id_ref = types_dup,
595 });612 });
...@@ -639,7 +656,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {...@@ -639,7 +656,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {
639 } });656 } });
640 try member_types.append(gpa, try cg.layoutType(field_ty, false));657 try member_types.append(gpa, try cg.layoutType(field_ty, false));
641 }658 }
642 try cg.sections.globals.emit(gpa, .OpTypeStruct, .{659 try cg.module.emit(gpa, .OpTypeStruct, .{
643 .id_result = id,660 .id_result = id,
644 .id_ref = member_types.items,661 .id_ref = member_types.items,
645 });662 });
...@@ -682,7 +699,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {...@@ -682,7 +699,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {
682 try cg.decorate(arr_id, .{ .array_stride = .{ .array_stride = 1 } });699 try cg.decorate(arr_id, .{ .array_stride = .{ .array_stride = 1 } });
683 member_types[layout.padding_index] = arr_id;700 member_types[layout.padding_index] = arr_id;
684 }701 }
685 try cg.sections.globals.emit(gpa, .OpTypeStruct, .{702 try cg.module.emit(gpa, .OpTypeStruct, .{
686 .id_result = id,703 .id_result = id,
687 .id_ref = member_types[0..layout.total_fields],704 .id_ref = member_types[0..layout.total_fields],
688 });705 });
...@@ -705,7 +722,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {...@@ -705,7 +722,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {
705 const elem_ty = ty.childType(zcu);722 const elem_ty = ty.childType(zcu);
706 const elem_ty_id = try cg.layoutType(elem_ty, is_block_root);723 const elem_ty_id = try cg.layoutType(elem_ty, is_block_root);
707 const id = cg.allocId();724 const id = cg.allocId();
708 try cg.sections.globals.emit(gpa, .OpTypeRuntimeArray, .{725 try cg.module.emit(gpa, .OpTypeRuntimeArray, .{
709 .id_result = id,726 .id_result = id,
710 .element_type = elem_ty_id,727 .element_type = elem_ty_id,
711 });728 });
...@@ -724,7 +741,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {...@@ -724,7 +741,7 @@ pub fn layoutType(cg: *CodeGen, ty: Type, is_block_root: bool) Error!Id {
724741
725pub fn functionType(cg: *CodeGen, return_ty_id: Id, param_type_ids: []const Id) !Id {742pub fn functionType(cg: *CodeGen, return_ty_id: Id, param_type_ids: []const Id) !Id {
726 const result_id = cg.allocId();743 const result_id = cg.allocId();
727 try cg.sections.globals.emit(cg.gpa, .OpTypeFunction, .{744 try cg.module.emit(cg.gpa, .OpTypeFunction, .{
728 .id_result = result_id,745 .id_result = result_id,
729 .return_type = return_ty_id,746 .return_type = return_ty_id,
730 .id_ref_2 = param_type_ids,747 .id_ref_2 = param_type_ids,
...@@ -734,7 +751,7 @@ pub fn functionType(cg: *CodeGen, return_ty_id: Id, param_type_ids: []const Id)...@@ -734,7 +751,7 @@ pub fn functionType(cg: *CodeGen, return_ty_id: Id, param_type_ids: []const Id)
734751
735pub fn constUndef(cg: *CodeGen, ty_id: Id) !Id {752pub fn constUndef(cg: *CodeGen, ty_id: Id) !Id {
736 const result_id = cg.allocId();753 const result_id = cg.allocId();
737 try cg.sections.globals.emit(cg.gpa, .OpUndef, .{754 try cg.module.emit(cg.gpa, .OpUndef, .{
738 .id_result_type = ty_id,755 .id_result_type = ty_id,
739 .id_result = result_id,756 .id_result = result_id,
740 });757 });
...@@ -743,7 +760,7 @@ pub fn constUndef(cg: *CodeGen, ty_id: Id) !Id {...@@ -743,7 +760,7 @@ pub fn constUndef(cg: *CodeGen, ty_id: Id) !Id {
743760
744pub fn constNull(cg: *CodeGen, ty_id: Id) !Id {761pub fn constNull(cg: *CodeGen, ty_id: Id) !Id {
745 const result_id = cg.allocId();762 const result_id = cg.allocId();
746 try cg.sections.globals.emit(cg.gpa, .OpConstantNull, .{763 try cg.module.emit(cg.gpa, .OpConstantNull, .{
747 .id_result_type = ty_id,764 .id_result_type = ty_id,
748 .id_result = result_id,765 .id_result = result_id,
749 });766 });
...@@ -755,7 +772,7 @@ pub fn decorate(...@@ -755,7 +772,7 @@ pub fn decorate(
755 target: Id,772 target: Id,
756 decoration: spec.Decoration.Extended,773 decoration: spec.Decoration.Extended,
757) !void {774) !void {
758 try cg.sections.annotations.emit(cg.gpa, .OpDecorate, .{775 try cg.module.emit(cg.gpa, .OpDecorate, .{
759 .target = target,776 .target = target,
760 .decoration = decoration,777 .decoration = decoration,
761 });778 });
...@@ -767,29 +784,16 @@ pub fn decorateMember(...@@ -767,29 +784,16 @@ pub fn decorateMember(
767 member: u32,784 member: u32,
768 decoration: spec.Decoration.Extended,785 decoration: spec.Decoration.Extended,
769) !void {786) !void {
770 try cg.sections.annotations.emit(cg.gpa, .OpMemberDecorate, .{787 try cg.module.emit(cg.gpa, .OpMemberDecorate, .{
771 .structure_type = structure_type,788 .structure_type = structure_type,
772 .member = member,789 .member = member,
773 .decoration = decoration,790 .decoration = decoration,
774 });791 });
775}792}
776793
777pub fn allocDecl(cg: *CodeGen, kind: Decl.Kind) !Decl.Index {
778 try cg.decls.append(cg.gpa, .{
779 .kind = kind,
780 .result_id = cg.allocId(),
781 });
782
783 return @as(Decl.Index, @fromBackingInt(@intCast(@as(u32, @intCast(cg.decls.items.len - 1)))));
784}
785
786pub fn declPtr(cg: *CodeGen, index: Decl.Index) *Decl {
787 return &cg.decls.items[@backingInt(index)];
788}
789
790pub fn debugName(cg: *CodeGen, target: Id, name: []const u8) !void {794pub fn debugName(cg: *CodeGen, target: Id, name: []const u8) !void {
791 if (cg.zcu.comp.config.root_strip) return;795 if (cg.zcu.comp.config.root_strip) return;
792 try cg.sections.debug_names.emit(cg.gpa, .OpName, .{796 try cg.module.emit(cg.gpa, .OpName, .{
793 .target = target,797 .target = target,
794 .name = name,798 .name = name,
795 });799 });
...@@ -797,14 +801,12 @@ pub fn debugName(cg: *CodeGen, target: Id, name: []const u8) !void {...@@ -797,14 +801,12 @@ pub fn debugName(cg: *CodeGen, target: Id, name: []const u8) !void {
797801
798pub fn debugNameFmt(cg: *CodeGen, target: Id, comptime fmt: []const u8, args: anytype) !void {802pub fn debugNameFmt(cg: *CodeGen, target: Id, comptime fmt: []const u8, args: anytype) !void {
799 if (cg.zcu.comp.config.root_strip) return;803 if (cg.zcu.comp.config.root_strip) return;
800 const name = try std.fmt.allocPrint(cg.gpa, fmt, args);804 try cg.module.emitFormatted(cg.gpa, .OpName, &.{target}, fmt, args);
801 defer cg.gpa.free(name);
802 try cg.debugName(target, name);
803}805}
804806
805pub fn memberDebugName(cg: *CodeGen, target: Id, member: u32, name: []const u8) !void {807pub fn memberDebugName(cg: *CodeGen, target: Id, member: u32, name: []const u8) !void {
806 if (cg.zcu.comp.config.root_strip) return;808 if (cg.zcu.comp.config.root_strip) return;
807 try cg.sections.debug_names.emit(cg.gpa, .OpMemberName, .{809 try cg.module.emit(cg.gpa, .OpMemberName, .{
808 .type = target,810 .type = target,
809 .member = member,811 .member = member,
810 .name = name,812 .name = name,
...@@ -827,6 +829,7 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC...@@ -827,6 +829,7 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC
827 .constant => .uniform_constant,829 .constant => .uniform_constant,
828 .shared => .workgroup,830 .shared => .workgroup,
829 .local => .function,831 .local => .function,
832 .private => .private,
830 .input => .input,833 .input => .input,
831 .gs,834 .gs,
832 .fs,835 .fs,
...@@ -850,228 +853,6 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC...@@ -850,228 +853,6 @@ pub fn storageClass(cg: *const CodeGen, as: std.lang.AddressSpace) spec.StorageC
850853
851const Error = codegen.Error;854const Error = codegen.Error;
852855
853pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void {
854 const gpa = cg.gpa;
855 const zcu = cg.zcu;
856 const ip = &zcu.intern_pool;
857 const target = zcu.getTarget();
858
859 const nav = ip.getNav(cg.owner_nav);
860 const val = zcu.navValue(cg.owner_nav);
861 const ty = val.typeOf(zcu);
862
863 if (!do_codegen and !ty.hasRuntimeBits(zcu)) {
864 const child_ty = if (ty.zigTypeTag(zcu) == .pointer) ty.childType(zcu) else ty;
865 if (child_ty.zigTypeTag(zcu) != .spirv) return;
866 }
867
868 const spv_decl_index = try cg.resolveNav(ip, cg.owner_nav);
869 const decl = cg.declPtr(spv_decl_index);
870 const result_id = decl.result_id;
871 decl.begin_dep = cg.decl_deps.items.len;
872
873 switch (decl.kind) {
874 .func => {
875 if (nav.resolved.?.is_extern_decl) {
876 _ = try cg.resolveType(ty, .direct);
877 try emitExternFnStub(cg, nav, decl, ty);
878 decl.end_dep = cg.decl_deps.items.len;
879 return;
880 }
881
882 const fn_info = zcu.typeToFunc(ty).?;
883 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
884 const is_test = zcu.test_functions.contains(cg.owner_nav);
885
886 const func_result_id = if (is_test) cg.allocId() else result_id;
887 const prototype_ty_id = try cg.resolveType(ty, .direct);
888 try cg.prologue.emit(gpa, .OpFunction, .{
889 .id_result_type = return_ty_id,
890 .id_result = func_result_id,
891 .function_type = prototype_ty_id,
892 // Note: the backend will never be asked to generate an inline function
893 // (this is handled in sema), so we don't need to set function_control here.
894 .function_control = .{},
895 });
896
897 try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len);
898 for (fn_info.param_types.get(ip)) |param_ty_index| {
899 const param_ty: Type = .fromInterned(param_ty_index);
900 if (!param_ty.hasRuntimeBits(zcu)) continue;
901
902 const param_type_id = try cg.resolveType(param_ty, .direct);
903 const arg_result_id = cg.allocId();
904 try cg.prologue.emit(gpa, .OpFunctionParameter, .{
905 .id_result_type = param_type_id,
906 .id_result = arg_result_id,
907 });
908 cg.args.appendAssumeCapacity(arg_result_id);
909 }
910
911 // TODO: This could probably be done in a better way...
912 const root_block_id = cg.allocId();
913
914 // The root block of a function declaration should appear before OpVariable instructions,
915 // so it is generated into the function's prologue.
916 try cg.prologue.emit(gpa, .OpLabel, .{
917 .id_result = root_block_id,
918 });
919 cg.block_label = root_block_id;
920
921 const main_body = cg.air.getMainBody();
922 _ = try cg.genStructuredBody(.selection, main_body);
923 // We always expect paths to here to end, but we still need the block
924 // to act as a dummy merge block.
925 try cg.body.emit(gpa, .OpUnreachable, {});
926 try cg.body.emit(gpa, .OpFunctionEnd, {});
927 // Append the actual code into the functions section.
928 try cg.sections.functions.append(gpa, cg.prologue);
929 try cg.sections.functions.append(gpa, cg.body);
930
931 // Temporarily generate a test kernel declaration if this is a test function.
932 if (is_test) {
933 try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), spv_decl_index, func_result_id);
934 }
935
936 try cg.debugName(func_result_id, nav.fqn.toSlice(ip));
937 },
938 .global => {
939 const key = ip.indexToKey(val.toIntern()).@"extern";
940
941 const storage_class = cg.storageClass(nav.resolved.?.@"addrspace");
942 assert(storage_class != .generic); // These should be instance globals
943
944 const as = nav.resolved.?.@"addrspace";
945 const ty_id = try cg.pointeeType(as, ty, true);
946 const ptr_ty_id = try cg.ptrType(ty_id, storage_class);
947
948 try cg.sections.globals.emit(gpa, .OpVariable, .{
949 .id_result_type = ptr_ty_id,
950 .id_result = result_id,
951 .storage_class = storage_class,
952 });
953
954 switch (target.os.tag) {
955 .vulkan, .opengl => {
956 switch (storage_class) {
957 .uniform,
958 .push_constant,
959 .storage_buffer,
960 .physical_storage_buffer,
961 => {
962 if (ty.hasRuntimeBits(zcu)) {
963 if (!ty.isSpirvRuntimeArray(zcu)) {
964 try cg.decorate(
965 ptr_ty_id,
966 .{ .array_stride = .{ .array_stride = @intCast(ty.abiSize(zcu)) } },
967 );
968 }
969 if (!cg.needsLayout(as, ty)) try cg.decorateLayout(ty, ty_id);
970 }
971 if (key.is_const and storage_class == .storage_buffer) {
972 try cg.decorate(result_id, .non_writable);
973 }
974 },
975 else => {},
976 }
977
978 if (key.decoration) |decoration| switch (decoration) {
979 .location => |location| {
980 if (storage_class != .output and storage_class != .input and storage_class != .uniform_constant) {
981 return cg.fail("storage class must be one of (output, input, uniform_constant) but is {s}", .{@tagName(storage_class)});
982 }
983 try cg.decorate(result_id, .{
984 .location = .{ .location = location },
985 });
986 },
987 .flat => |location| {
988 try cg.decorate(result_id, .{ .location = .{ .location = location } });
989 try cg.decorate(result_id, .flat);
990 },
991 .descriptor => |descriptor| {
992 if (storage_class != .storage_buffer and storage_class != .uniform and storage_class != .uniform_constant) {
993 return cg.fail("storage class must be one of (storage_buffer, uniform, uniform_constant) but is {s}", .{@tagName(storage_class)});
994 }
995 try cg.decorate(result_id, .{
996 .binding = .{ .binding_point = descriptor.binding },
997 });
998
999 try cg.decorate(result_id, .{
1000 .descriptor_set = .{ .descriptor_set = descriptor.set },
1001 });
1002 },
1003 };
1004 },
1005 else => {},
1006 }
1007
1008 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |built_in| {
1009 try cg.decorate(result_id, .{ .built_in = .{ .built_in = built_in } });
1010 }
1011
1012 try cg.debugName(result_id, nav.fqn.toSlice(ip));
1013 },
1014 .invocation_global => {
1015 // `@extern()` produces an invocation_global whose value is a
1016 // comptime-known pointer to an underlying extern symbol's Nav.
1017 // The pointer is inlined at use sites so we don't need a Function-scope wrapper here.
1018 if (ip.indexToKey(val.toIntern()) == .ptr) alias: {
1019 const ptr_key = ip.indexToKey(val.toIntern()).ptr;
1020 if (ptr_key.base_addr != .nav or ptr_key.byte_offset != 0) break :alias;
1021 const underlying_nav = ip.getNav(ptr_key.base_addr.nav);
1022 if (!underlying_nav.resolved.?.is_extern_decl) break :alias;
1023 cg.declPtr(spv_decl_index).end_dep = cg.decl_deps.items.len;
1024 return;
1025 }
1026
1027 const ty_id = try cg.resolveType(ty, .indirect);
1028 const ptr_ty_id = try cg.ptrType(ty_id, .function);
1029
1030 // TODO: Combine with resolveAnonDecl?
1031 const void_ty_id = try cg.resolveType(.void, .direct);
1032 const initializer_proto_ty_id = try cg.functionType(void_ty_id, &.{});
1033
1034 const initializer_id = cg.allocId();
1035 try cg.prologue.emit(gpa, .OpFunction, .{
1036 .id_result_type = try cg.resolveType(.void, .direct),
1037 .id_result = initializer_id,
1038 .function_control = .{},
1039 .function_type = initializer_proto_ty_id,
1040 });
1041
1042 const root_block_id = cg.allocId();
1043 try cg.prologue.emit(gpa, .OpLabel, .{
1044 .id_result = root_block_id,
1045 });
1046 cg.block_label = root_block_id;
1047
1048 const val_id = try cg.constant(ty, val, .indirect);
1049 try cg.body.emit(gpa, .OpStore, .{
1050 .pointer = result_id,
1051 .object = val_id,
1052 });
1053
1054 try cg.body.emit(gpa, .OpReturn, {});
1055 try cg.body.emit(gpa, .OpFunctionEnd, {});
1056 try cg.sections.functions.append(gpa, cg.prologue);
1057 try cg.sections.functions.append(gpa, cg.body);
1058
1059 try cg.debugNameFmt(initializer_id, "initializer of {f}", .{nav.fqn.fmt(ip)});
1060 try cg.debugName(result_id, nav.fqn.toSlice(ip));
1061
1062 try cg.sections.globals.emit(gpa, .OpExtInst, .{
1063 .id_result_type = ptr_ty_id,
1064 .id_result = result_id,
1065 .set = try cg.importInstructionSet(.zig),
1066 .instruction = .{ .inst = @backingInt(spec.Zig.InvocationGlobal) },
1067 .id_ref_4 = &.{initializer_id},
1068 });
1069 },
1070 }
1071
1072 cg.declPtr(spv_decl_index).end_dep = cg.decl_deps.items.len;
1073}
1074
1075fn decorateLayout(cg: *CodeGen, ty: Type, ty_id: spec.Id) Error!void {856fn decorateLayout(cg: *CodeGen, ty: Type, ty_id: spec.Id) Error!void {
1076 const zcu = cg.zcu;857 const zcu = cg.zcu;
1077 const ip = &zcu.intern_pool;858 const ip = &zcu.intern_pool;
...@@ -1174,123 +955,49 @@ fn importExtendedSet(cg: *CodeGen) !Id {...@@ -1174,123 +955,49 @@ fn importExtendedSet(cg: *CodeGen) !Id {
1174/// Fetch the result-id for a previously generated instruction or constant.955/// Fetch the result-id for a previously generated instruction or constant.
1175fn resolve(cg: *CodeGen, inst: Air.Inst.Ref) !Id {956fn resolve(cg: *CodeGen, inst: Air.Inst.Ref) !Id {
1176 const zcu = cg.zcu;957 const zcu = cg.zcu;
1177 const ip = &zcu.intern_pool;
1178 if (inst.toInterned()) |val_ip_index| {958 if (inst.toInterned()) |val_ip_index| {
1179 const ty = cg.typeOf(inst);959 const ty = cg.typeOf(inst);
1180 if (ty.zigTypeTag(zcu) == .@"fn") {960 if (ty.zigTypeTag(zcu) == .@"fn") {
1181 const val_key = zcu.intern_pool.indexToKey(val_ip_index);961 const val_key = zcu.intern_pool.indexToKey(val_ip_index);
1182 const fn_nav = switch (val_key) {962 return switch (val_key) {
1183 .@"extern" => |@"extern"| @"extern".owner_nav,963 .@"extern" => |@"extern"| try cg.resolveExternFn(@"extern".owner_nav),
1184 .func => |func| func.owner_nav,964 .func => |func| try cg.resolveNav(func.owner_nav),
1185 else => unreachable,965 else => unreachable,
1186 };966 };
1187 const spv_decl_index = try cg.resolveNav(ip, fn_nav);
1188 try cg.decl_deps.append(cg.gpa, spv_decl_index);
1189 const decl = cg.declPtr(spv_decl_index);
1190 if (val_key == .@"extern") {
1191 const nav = ip.getNav(fn_nav);
1192 const nav_ty: Type = .fromInterned(nav.resolved.?.type);
1193 try emitExternFnStub(cg, nav, decl, nav_ty);
1194 }
1195 return decl.result_id;
1196 }967 }
1197968
1198 return try cg.constant(ty, .fromInterned(val_ip_index), .direct);969 const val: Value = .fromInterned(val_ip_index);
1199 }970 if (ty.isPtrAtRuntime(zcu)) {
1200 const index = inst.toIndex().?;971 if (val.isUndef(zcu)) return try cg.constUndef(try cg.resolveType(ty, .direct));
1201 return cg.inst_results.get(index).?; // Assertion means instruction does not dominate usage.972 if (ty.zigTypeTag(zcu) == .optional) {
1202}973 const payload = val.optionalValue(zcu) orelse return try cg.constNull(try cg.resolveType(ty, .direct));
1203974 return try cg.constantPtr(payload);
1204fn resolveUav(cg: *CodeGen, val: InternPool.Index) !Id {975 }
1205 const gpa = cg.gpa;976 return try cg.constantPtr(val);
1206
1207 // TODO: This cannot be a function at this point, but it should probably be handled anyway.
1208
1209 const zcu = cg.zcu;
1210 const ty: Type = .fromInterned(zcu.intern_pool.typeOf(val));
1211 const ty_id = try cg.resolveType(ty, .indirect);
1212
1213 const spv_decl_index = blk: {
1214 const entry = try cg.uav_link.getOrPut(gpa, .{ val, .function });
1215 if (entry.found_existing) {
1216 try cg.addFunctionDep(entry.value_ptr.*, .function);
1217 return cg.declPtr(entry.value_ptr.*).result_id;
1218 }
1219
1220 const spv_decl_index = try cg.allocDecl(.invocation_global);
1221 try cg.addFunctionDep(spv_decl_index, .function);
1222 entry.value_ptr.* = spv_decl_index;
1223 break :blk spv_decl_index;
1224 };
1225
1226 // TODO: At some point we will be able to generate this all constant here, but then all of
1227 // constant() will need to be implemented such that it doesn't generate any at-runtime code.
1228 // NOTE: Because this is a global, we really only want to initialize it once. Therefore the
1229 // constant lowering of this value will need to be deferred to an initializer similar to
1230 // other globals.
1231
1232 const result_id = cg.declPtr(spv_decl_index).result_id;
1233
1234 {
1235 // Save the current state so that we can temporarily generate into a different function.
1236 // TODO: This should probably be made a little more robust.
1237 const func_prologue = cg.prologue;
1238 const func_body = cg.body;
1239 const block_label = cg.block_label;
1240 defer {
1241 cg.prologue = func_prologue;
1242 cg.body = func_body;
1243 cg.block_label = block_label;
1244 }977 }
1245978 switch (zcu.intern_pool.indexToKey(val_ip_index)) {
1246 cg.prologue = .{};979 .ptr => unreachable,
1247 cg.body = .{};980 .slice => |slice| {
1248 defer {981 const ptr_id = try cg.constantPtr(.fromInterned(slice.ptr));
1249 cg.prologue.deinit(gpa);982 const len_id = try cg.constant(.usize, .fromInterned(slice.len), .indirect);
1250 cg.body.deinit(gpa);983 return try cg.constructComposite(try cg.resolveType(ty, .direct), &.{ ptr_id, len_id });
984 },
985 .opt => {
986 const payload_ty = ty.optionalChild(zcu);
987 if (!payload_ty.isPtrAtRuntime(zcu)) return try cg.constant(ty, val, .direct);
988 const payload_val = val.optionalValue(zcu);
989 const ptr_id = if (payload_val) |payload|
990 try cg.constantPtr(payload)
991 else
992 try cg.constUndef(try cg.resolveType(payload_ty, .direct));
993 const valid_id = try cg.constBool(payload_val != null, .indirect);
994 return try cg.constructComposite(try cg.resolveType(ty, .direct), &.{ ptr_id, valid_id });
995 },
996 else => return try cg.constant(ty, val, .direct),
1251 }997 }
1252
1253 const void_ty_id = try cg.resolveType(.void, .direct);
1254 const initializer_proto_ty_id = try cg.functionType(void_ty_id, &.{});
1255
1256 const initializer_id = cg.allocId();
1257 try cg.prologue.emit(gpa, .OpFunction, .{
1258 .id_result_type = try cg.resolveType(.void, .direct),
1259 .id_result = initializer_id,
1260 .function_control = .{},
1261 .function_type = initializer_proto_ty_id,
1262 });
1263 const root_block_id = cg.allocId();
1264 try cg.prologue.emit(gpa, .OpLabel, .{
1265 .id_result = root_block_id,
1266 });
1267 cg.block_label = root_block_id;
1268
1269 const val_id = try cg.constant(ty, .fromInterned(val), .indirect);
1270 try cg.body.emit(gpa, .OpStore, .{
1271 .pointer = result_id,
1272 .object = val_id,
1273 });
1274
1275 try cg.body.emit(gpa, .OpReturn, {});
1276 try cg.body.emit(gpa, .OpFunctionEnd, {});
1277
1278 try cg.sections.functions.append(gpa, cg.prologue);
1279 try cg.sections.functions.append(gpa, cg.body);
1280
1281 try cg.debugNameFmt(initializer_id, "initializer of __anon_{d}", .{@backingInt(val)});
1282
1283 const fn_decl_ptr_ty_id = try cg.ptrType(ty_id, .function);
1284 try cg.sections.globals.emit(gpa, .OpExtInst, .{
1285 .id_result_type = fn_decl_ptr_ty_id,
1286 .id_result = result_id,
1287 .set = try cg.importInstructionSet(.zig),
1288 .instruction = .{ .inst = @backingInt(spec.Zig.InvocationGlobal) },
1289 .id_ref_4 = &.{initializer_id},
1290 });
1291 }998 }
1292999 const index = inst.toIndex().?;
1293 return result_id;1000 return cg.inst_results.get(index).?; // Assertion means instruction does not dominate usage.
1294}1001}
12951002
1296fn resolvePtr(cg: *CodeGen, ref: Air.Inst.Ref) !Ptr {1003fn resolvePtr(cg: *CodeGen, ref: Air.Inst.Ref) !Ptr {
...@@ -1299,19 +1006,6 @@ fn resolvePtr(cg: *CodeGen, ref: Air.Inst.Ref) !Ptr {...@@ -1299,19 +1006,6 @@ fn resolvePtr(cg: *CodeGen, ref: Air.Inst.Ref) !Ptr {
1299 return .{ .id = id };1006 return .{ .id = id };
1300}1007}
13011008
1302fn addFunctionDep(cg: *CodeGen, decl_index: Decl.Index, storage_class: StorageClass) !void {
1303 const gpa = cg.gpa;
1304 const target = cg.zcu.getTarget();
1305 if (target.cpu.has(.spirv, .v1_4)) {
1306 try cg.decl_deps.append(gpa, decl_index);
1307 } else {
1308 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
1309 if (storage_class == .input or storage_class == .output) {
1310 try cg.decl_deps.append(gpa, decl_index);
1311 }
1312 }
1313}
1314
1315/// Start a new SPIR-V block, Emits the label of the new block, and stores which1009/// Start a new SPIR-V block, Emits the label of the new block, and stores which
1316/// block we are currently generating.1010/// block we are currently generating.
1317/// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to1011/// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
...@@ -1439,7 +1133,7 @@ fn constBool(cg: *CodeGen, value: bool, repr: Repr) !Id {...@@ -1439,7 +1133,7 @@ fn constBool(cg: *CodeGen, value: bool, repr: Repr) !Id {
1439 const result_ty_id = try cg.boolType();1133 const result_ty_id = try cg.boolType();
1440 const result_id = cg.allocId();1134 const result_id = cg.allocId();
1441 switch (value) {1135 switch (value) {
1442 inline else => |value_ct| try cg.sections.globals.emit(1136 inline else => |value_ct| try cg.module.emit(
1443 cg.gpa,1137 cg.gpa,
1444 if (value_ct) .OpConstantTrue else .OpConstantFalse,1138 if (value_ct) .OpConstantTrue else .OpConstantFalse,
1445 .{ .id_result_type = result_ty_id, .id_result = result_id },1139 .{ .id_result_type = result_ty_id, .id_result = result_id },
...@@ -1485,7 +1179,7 @@ fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {...@@ -1485,7 +1179,7 @@ fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {
1485 if (i < 2) @as(u32, @truncate(value64 >> @intCast(i * 32))) else fill,1179 if (i < 2) @as(u32, @truncate(value64 >> @intCast(i * 32))) else fill,
1486 );1180 );
1487 }1181 }
1488 return cg.constructComposite(result_ty_id, constituents);1182 return cg.constantComposite(result_ty_id, constituents);
1489 }1183 }
14901184
1491 const final_value: spec.LiteralContextDependentNumber = switch (target.os.tag) {1185 const final_value: spec.LiteralContextDependentNumber = switch (target.os.tag) {
...@@ -1515,14 +1209,29 @@ fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {...@@ -1515,14 +1209,29 @@ fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {
1515 };1209 };
15161210
1517 const result_id = cg.allocId();1211 const result_id = cg.allocId();
1518 try cg.sections.globals.emit(cg.gpa, .OpConstant, .{1212 try cg.module.emit(cg.gpa, .OpConstant, .{
1519 .id_result_type = result_ty_id,1213 .id_result_type = result_ty_id,
1520 .id_result = result_id,1214 .id_result = result_id,
1521 .value = final_value,1215 .value = final_value,
1522 });1216 });
15231217
1524 if (!ty.isVector(zcu)) return result_id;1218 if (!ty.isVector(zcu)) return result_id;
1525 return cg.constructCompositeSplat(ty, result_id);1219
1220 const vector_ty_id = try cg.resolveType(ty, .direct);
1221 const constituents = try gpa.alloc(Id, @intCast(ty.arrayLen(zcu)));
1222 defer gpa.free(constituents);
1223 @memset(constituents, result_id);
1224 return cg.constantComposite(vector_ty_id, constituents);
1225}
1226
1227fn constantComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const Id) !Id {
1228 const result_id = cg.allocId();
1229 try cg.module.emit(cg.gpa, .OpConstantComposite, .{
1230 .id_result_type = result_ty_id,
1231 .id_result = result_id,
1232 .constituents = constituents,
1233 });
1234 return result_id;
1526}1235}
15271236
1528/// Construct a composite value from its constituents.1237/// Construct a composite value from its constituents.
...@@ -1541,7 +1250,7 @@ pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const...@@ -1541,7 +1250,7 @@ pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const
1541 for (fields, constituents, 0..) |field_ty_id, constituent, i| {1250 for (fields, constituents, 0..) |field_ty_id, constituent, i| {
1542 const field_ptr_ty_id = try cg.ptrType(field_ty_id, .function);1251 const field_ptr_ty_id = try cg.ptrType(field_ty_id, .function);
1543 const index_id = cg.allocId();1252 const index_id = cg.allocId();
1544 try cg.sections.globals.emit(gpa, .OpConstant, .{1253 try cg.module.emit(gpa, .OpConstant, .{
1545 .id_result_type = u32_ty_id,1254 .id_result_type = u32_ty_id,
1546 .id_result = index_id,1255 .id_result = index_id,
1547 .value = .{ .uint32 = @intCast(i) },1256 .value = .{ .uint32 = @intCast(i) },
...@@ -1566,27 +1275,12 @@ pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const...@@ -1566,27 +1275,12 @@ pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const
1566 .id_result_type = result_ty_id,1275 .id_result_type = result_ty_id,
1567 .id_result = result_id,1276 .id_result = result_id,
1568 .constituents = constituents,1277 .constituents = constituents,
1569 });1278 });
1570 return result_id;1279 return result_id;
1571}
1572
1573/// Construct a composite at runtime with all lanes set to the same value.
1574/// ty must be an aggregate type.
1575fn constructCompositeSplat(cg: *CodeGen, ty: Type, constituent: Id) !Id {
1576 const gpa = cg.gpa;
1577 const zcu = cg.zcu;
1578 const n: usize = @intCast(ty.arrayLen(zcu));
1579
1580 const scratch_top = cg.id_scratch.items.len;
1581 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
1582
1583 const constituents = try cg.id_scratch.addManyAsSlice(gpa, n);
1584 @memset(constituents, constituent);
1585
1586 const result_ty_id = try cg.resolveType(ty, .direct);
1587 return cg.constructComposite(result_ty_id, constituents);
1588}1280}
15891281
1282/// Construct a composite at runtime with all lanes set to the same value.
1283/// ty must be an aggregate type.
1590/// This function generates a load for a constant in direct (ie, non-memory) representation.1284/// This function generates a load for a constant in direct (ie, non-memory) representation.
1591/// When the constant is simple, it can be generated directly using OpConstant instructions.1285/// When the constant is simple, it can be generated directly using OpConstant instructions.
1592/// When the constant is more complicated however, it needs to be constructed using multiple values. This1286/// When the constant is more complicated however, it needs to be constructed using multiple values. This
...@@ -1602,288 +1296,345 @@ fn constant(cg: *CodeGen, ty: Type, val: Value, repr: Repr) Error!Id {...@@ -1602,288 +1296,345 @@ fn constant(cg: *CodeGen, ty: Type, val: Value, repr: Repr) Error!Id {
1602 const result_ty_id = try cg.resolveType(ty, repr);1296 const result_ty_id = try cg.resolveType(ty, repr);
1603 const ip = &zcu.intern_pool;1297 const ip = &zcu.intern_pool;
16041298
1605 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{ ty.fmt(pt), val.fmtValue(pt), @tagName(ip.indexToKey(val.toIntern())) });1299 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{
1300 ty.fmt(pt),
1301 val.fmtValue(pt),
1302 @tagName(ip.indexToKey(val.toIntern())),
1303 });
1304 assert(!ty.isPtrAtRuntime(zcu));
1305
1606 if (val.isUndef(zcu)) {1306 if (val.isUndef(zcu)) {
1607 return cg.constUndef(result_ty_id);1307 return cg.constUndef(result_ty_id);
1608 }1308 }
16091309
1610 const cacheable_id = cache: {1310 const cacheable_id = cache: switch (ip.indexToKey(val.toIntern())) {
1611 switch (ip.indexToKey(val.toIntern())) {1311 .int_type,
1612 .int_type,1312 .ptr_type,
1613 .ptr_type,1313 .array_type,
1614 .array_type,1314 .vector_type,
1615 .vector_type,1315 .opt_type,
1616 .opt_type,1316 .anyframe_type,
1617 .anyframe_type,1317 .error_union_type,
1618 .error_union_type,1318 .simple_type,
1619 .simple_type,1319 .struct_type,
1620 .struct_type,1320 .tuple_type,
1621 .tuple_type,1321 .union_type,
1622 .union_type,1322 .opaque_type,
1623 .opaque_type,1323 .spirv_type,
1624 .spirv_type,1324 .enum_type,
1625 .enum_type,1325 .func_type,
1626 .func_type,1326 .error_set_type,
1627 .error_set_type,1327 .inferred_error_set_type,
1628 .inferred_error_set_type,1328 => unreachable, // types, not values
1629 => unreachable, // types, not values1329
16301330 .undef => unreachable, // handled above
1631 .undef => unreachable, // handled above1331
16321332 .@"extern",
1633 .@"extern",1333 .func,
1634 .func,1334 .enum_literal,
1635 .enum_literal,1335 => unreachable, // non-runtime values
1636 => unreachable, // non-runtime values
16371336
1638 .simple_value => |simple_value| switch (simple_value) {1337 .simple_value => |simple_value| switch (simple_value) {
1639 .void,1338 .void,
1640 .null,1339 .null,
1641 .@"unreachable",1340 .@"unreachable",
1642 => unreachable, // non-runtime values1341 => unreachable, // non-runtime values
16431342
1644 .false, .true => break :cache try cg.constBool(val.toBool(), repr),1343 .false, .true => break :cache try cg.constBool(val.toBool(), repr),
1645 },1344 },
1646 .int => {1345 .int => {
1647 const int_info = ty.intInfo(zcu);1346 const int_info = ty.intInfo(zcu);
1648 const backing_bits, const is_big_int = cg.backingIntBits(int_info.bits);1347 const backing_bits, const is_big_int = cg.backingIntBits(int_info.bits);
1649 if (is_big_int) {1348 if (is_big_int) {
1650 const limb_bits = cg.bigIntBits();1349 const limb_bits = cg.bigIntBits();
1651 const n_limbs = backing_bits / limb_bits;1350 const n_limbs = backing_bits / limb_bits;
1652 const big_result_ty_id = try cg.resolveType(ty, .indirect);1351 const big_result_ty_id = try cg.resolveType(ty, .indirect);
1653 var bigint_space: Value.BigIntSpace = undefined;1352 var bigint_space: Value.BigIntSpace = undefined;
1654 const bigint = val.toBigInt(&bigint_space, zcu);1353 const bigint = val.toBigInt(&bigint_space, zcu);
1655 const limb_bytes = try gpa.alloc(u8, backing_bits / 8);1354 const limb_bytes = try gpa.alloc(u8, backing_bits / 8);
1656 defer gpa.free(limb_bytes);1355 defer gpa.free(limb_bytes);
1657 bigint.writeTwosComplement(limb_bytes, .little);1356 bigint.writeTwosComplement(limb_bytes, .little);
1658 const scratch_top = cg.id_scratch.items.len;1357 const scratch_top = cg.id_scratch.items.len;
1659 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);1358 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
1660 const constituents = try cg.id_scratch.addManyAsSlice(gpa, n_limbs);1359 const constituents = try cg.id_scratch.addManyAsSlice(gpa, n_limbs);
1661 switch (limb_bits) {1360 switch (limb_bits) {
1662 32 => {1361 32 => {
1663 const limbs_u32: []u32 = @ptrCast(@alignCast(limb_bytes));1362 const limbs_u32: []u32 = @ptrCast(@alignCast(limb_bytes));
1664 for (constituents, limbs_u32) |*c, v| {1363 for (constituents, limbs_u32) |*c, v| {
1665 const host_v = if (builtin.cpu.arch.endian() == .big) @byteSwap(v) else v;1364 const host_v = if (builtin.cpu.arch.endian() == .big) @byteSwap(v) else v;
1666 c.* = try cg.constInt(.u32, host_v);1365 c.* = try cg.constInt(.u32, host_v);
1667 }1366 }
1668 },1367 },
1669 64 => {1368 64 => {
1670 const limbs_u64: []u64 = @ptrCast(@alignCast(limb_bytes));1369 const limbs_u64: []u64 = @ptrCast(@alignCast(limb_bytes));
1671 for (constituents, limbs_u64) |*c, v| {1370 for (constituents, limbs_u64) |*c, v| {
1672 const host_v = if (builtin.cpu.arch.endian() == .big) @byteSwap(v) else v;1371 const host_v = if (builtin.cpu.arch.endian() == .big) @byteSwap(v) else v;
1673 c.* = try cg.constInt(.u64, host_v);1372 c.* = try cg.constInt(.u64, host_v);
1674 }1373 }
1675 },1374 },
1676 else => unreachable,1375 else => unreachable,
1677 }
1678 break :cache try cg.constructComposite(big_result_ty_id, constituents);
1679 }1376 }
1680 if (ty.isSignedInt(zcu)) {1377 break :cache try cg.constantComposite(big_result_ty_id, constituents);
1681 break :cache try cg.constInt(ty, val.toSignedInt(zcu));1378 }
1379 if (ty.isSignedInt(zcu)) {
1380 break :cache try cg.constInt(ty, val.toSignedInt(zcu));
1381 } else {
1382 break :cache try cg.constInt(ty, val.toUnsignedInt(zcu));
1383 }
1384 },
1385 .float => {
1386 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
1387 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
1388 32 => .{ .float32 = val.toFloat(f32, zcu) },
1389 64 => .{ .float64 = val.toFloat(f64, zcu) },
1390 80, 128 => unreachable, // TODO
1391 else => unreachable,
1392 };
1393 const lit_id = cg.allocId();
1394 try cg.module.emit(gpa, .OpConstant, .{
1395 .id_result_type = result_ty_id,
1396 .id_result = lit_id,
1397 .value = lit,
1398 });
1399 break :cache lit_id;
1400 },
1401 .err => |err| {
1402 const value = try pt.getErrorValue(err.name);
1403 break :cache try cg.constInt(ty, value);
1404 },
1405 .error_union => |error_union| {
1406 // TODO: Error unions may be constructed with constant instructions if the payload type
1407 // allows it. For now, just generate it here regardless.
1408 const err_ty = ty.errorUnionSet(zcu);
1409 const payload_ty = ty.errorUnionPayload(zcu);
1410 const err_val_id = switch (error_union.val) {
1411 .err_name => |err_name| try cg.constInt(
1412 err_ty,
1413 try pt.getErrorValue(err_name),
1414 ),
1415 .payload => try cg.constInt(err_ty, 0),
1416 };
1417 const eu_layout = cg.errorUnionLayout(payload_ty);
1418 if (!eu_layout.payload_has_bits) {
1419 // We use the error type directly as the type.
1420 break :cache err_val_id;
1421 }
1422
1423 const payload_val_id = switch (error_union.val) {
1424 .err_name => try cg.constant(payload_ty, .undef, .indirect),
1425 .payload => |p| try cg.constant(payload_ty, .fromInterned(p), .indirect),
1426 };
1427
1428 var constituents: [2]Id = undefined;
1429 var types: [2]Type = undefined;
1430 if (eu_layout.error_first) {
1431 constituents[0] = err_val_id;
1432 constituents[1] = payload_val_id;
1433 types = .{ err_ty, payload_ty };
1434 } else {
1435 constituents[0] = payload_val_id;
1436 constituents[1] = err_val_id;
1437 types = .{ payload_ty, err_ty };
1438 }
1439
1440 const comp_ty_id = try cg.resolveType(ty, .direct);
1441 return try cg.constantComposite(comp_ty_id, &constituents);
1442 },
1443 .enum_tag => {
1444 const int_val = val.backingInt(zcu);
1445 const int_ty = ty.backingIntType(zcu);
1446 break :cache try cg.constant(int_ty, int_val, repr);
1447 },
1448 .ptr, .slice => unreachable,
1449 .opt => {
1450 const payload_ty = ty.optionalChild(zcu);
1451 const maybe_payload_val = val.optionalValue(zcu);
1452
1453 if (!payload_ty.hasRuntimeBits(zcu)) {
1454 break :cache try cg.constBool(maybe_payload_val != null, .indirect);
1455 } else if (ty.optionalReprIsPayload(zcu)) {
1456 // Optional representation is a nullable pointer or slice.
1457 if (maybe_payload_val) |payload_val| {
1458 return try cg.constant(payload_ty, payload_val, .indirect);
1682 } else {1459 } else {
1683 break :cache try cg.constInt(ty, val.toUnsignedInt(zcu));1460 break :cache try cg.constNull(result_ty_id);
1684 }
1685 },
1686 .float => {
1687 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
1688 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
1689 32 => .{ .float32 = val.toFloat(f32, zcu) },
1690 64 => .{ .float64 = val.toFloat(f64, zcu) },
1691 80, 128 => unreachable, // TODO
1692 else => unreachable,
1693 };
1694 const lit_id = cg.allocId();
1695 try cg.sections.globals.emit(gpa, .OpConstant, .{
1696 .id_result_type = result_ty_id,
1697 .id_result = lit_id,
1698 .value = lit,
1699 });
1700 break :cache lit_id;
1701 },
1702 .err => |err| {
1703 const value = try pt.getErrorValue(err.name);
1704 break :cache try cg.constInt(ty, value);
1705 },
1706 .error_union => |error_union| {
1707 // TODO: Error unions may be constructed with constant instructions if the payload type
1708 // allows it. For now, just generate it here regardless.
1709 const err_ty = ty.errorUnionSet(zcu);
1710 const payload_ty = ty.errorUnionPayload(zcu);
1711 const err_val_id = switch (error_union.val) {
1712 .err_name => |err_name| try cg.constInt(
1713 err_ty,
1714 try pt.getErrorValue(err_name),
1715 ),
1716 .payload => try cg.constInt(err_ty, 0),
1717 };
1718 const eu_layout = cg.errorUnionLayout(payload_ty);
1719 if (!eu_layout.payload_has_bits) {
1720 // We use the error type directly as the type.
1721 break :cache err_val_id;
1722 }1461 }
1462 }
1463
1464 // Optional representation is a structure.
1465 // { Payload, Bool }
1466
1467 const has_pl_id = try cg.constBool(maybe_payload_val != null, .indirect);
1468 const payload_id = if (maybe_payload_val) |payload_val|
1469 try cg.constant(payload_ty, payload_val, .indirect)
1470 else
1471 try cg.constUndef(try cg.resolveType(payload_ty, .indirect));
1472
1473 const comp_ty_id = try cg.resolveType(ty, .direct);
1474 return try cg.constantComposite(comp_ty_id, &.{ payload_id, has_pl_id });
1475 },
1476 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {
1477 inline .array_type, .vector_type => |array_type, tag| {
1478 const elem_ty: Type = .fromInterned(array_type.child);
1479
1480 const scratch_top = cg.id_scratch.items.len;
1481 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
1482 const constituents = try cg.id_scratch.addManyAsSlice(gpa, @intCast(ty.arrayLenIncludingSentinel(zcu)));
17231483
1724 const payload_val_id = switch (error_union.val) {1484 const child_repr: Repr = switch (tag) {
1725 .err_name => try cg.constant(payload_ty, .undef, .indirect),1485 .array_type => .indirect,
1726 .payload => |p| try cg.constant(payload_ty, .fromInterned(p), .indirect),1486 .vector_type => .direct,
1487 else => unreachable,
1727 };1488 };
17281489
1729 var constituents: [2]Id = undefined;1490 switch (aggregate.storage) {
1730 var types: [2]Type = undefined;1491 .bytes => |bytes| {
1731 if (eu_layout.error_first) {1492 // TODO: This is really space inefficient, perhaps there is a better
1732 constituents[0] = err_val_id;1493 // way to do it?
1733 constituents[1] = payload_val_id;1494 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
1734 types = .{ err_ty, payload_ty };1495 constituent.* = try cg.constInt(elem_ty, byte);
1735 } else {1496 }
1736 constituents[0] = payload_val_id;1497 },
1737 constituents[1] = err_val_id;1498 .elems => |elems| {
1738 types = .{ payload_ty, err_ty };1499 for (constituents, elems) |*constituent, elem| {
1500 constituent.* = try cg.constant(elem_ty, .fromInterned(elem), child_repr);
1501 }
1502 },
1503 .repeated_elem => |elem| {
1504 @memset(constituents, try cg.constant(elem_ty, .fromInterned(elem), child_repr));
1505 },
1739 }1506 }
17401507
1741 const comp_ty_id = try cg.resolveType(ty, .direct);1508 const comp_ty_id = try cg.resolveType(ty, .direct);
1742 return try cg.constructComposite(comp_ty_id, &constituents);1509 return cg.constantComposite(comp_ty_id, constituents);
1743 },
1744 .enum_tag => {
1745 const int_val = val.backingInt(zcu);
1746 const int_ty = ty.backingIntType(zcu);
1747 break :cache try cg.constant(int_ty, int_val, repr);
1748 },
1749 .ptr => return cg.constantPtr(val),
1750 .slice => |slice| {
1751 const ptr_id = try cg.constantPtr(.fromInterned(slice.ptr));
1752 const len_id = try cg.constant(.usize, .fromInterned(slice.len), .indirect);
1753 const comp_ty_id = try cg.resolveType(ty, .direct);
1754 return try cg.constructComposite(comp_ty_id, &.{ ptr_id, len_id });
1755 },1510 },
1756 .opt => {1511 .struct_type => {
1757 const payload_ty = ty.optionalChild(zcu);1512 const struct_type = zcu.typeToStruct(ty).?;
1758 const maybe_payload_val = val.optionalValue(zcu);1513 assert(struct_type.layout != .@"packed"); // packed structs use `bitpack`
17591514
1760 if (!payload_ty.hasRuntimeBits(zcu)) {1515 var types: std.ArrayList(Type) = .empty;
1761 break :cache try cg.constBool(maybe_payload_val != null, .indirect);1516 defer types.deinit(gpa);
1762 } else if (ty.optionalReprIsPayload(zcu)) {1517
1763 // Optional representation is a nullable pointer or slice.1518 var constituents: std.ArrayList(Id) = .empty;
1764 if (maybe_payload_val) |payload_val| {1519 defer constituents.deinit(gpa);
1765 return try cg.constant(payload_ty, payload_val, .indirect);1520
1766 } else {1521 var it = struct_type.iterateRuntimeOrder(ip);
1767 break :cache try cg.constNull(result_ty_id);1522 while (it.next()) |field_index| {
1523 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
1524 if (!field_ty.hasRuntimeBits(zcu)) {
1525 // This is a zero-bit field - we only needed it for the alignment.
1526 continue;
1768 }1527 }
1769 }
17701528
1771 // Optional representation is a structure.1529 // TODO: Padding?
1772 // { Payload, Bool }1530 const field_val = try val.fieldValue(pt, field_index);
1531 const field_id = try cg.constant(field_ty, field_val, .indirect);
17731532
1774 const has_pl_id = try cg.constBool(maybe_payload_val != null, .indirect);1533 try types.append(gpa, field_ty);
1775 const payload_id = if (maybe_payload_val) |payload_val|1534 try constituents.append(gpa, field_id);
1776 try cg.constant(payload_ty, payload_val, .indirect)1535 }
1777 else
1778 try cg.constUndef(try cg.resolveType(payload_ty, .indirect));
17791536
1780 const comp_ty_id = try cg.resolveType(ty, .direct);1537 const comp_ty_id = try cg.resolveType(ty, .direct);
1781 return try cg.constructComposite(comp_ty_id, &.{ payload_id, has_pl_id });1538 return cg.constantComposite(comp_ty_id, constituents.items);
1782 },1539 },
1783 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {1540 .tuple_type => |tuple| {
1784 inline .array_type, .vector_type => |array_type, tag| {1541 var constituents: std.ArrayList(Id) = .empty;
1785 const elem_ty: Type = .fromInterned(array_type.child);1542 defer constituents.deinit(gpa);
1786
1787 const scratch_top = cg.id_scratch.items.len;
1788 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
1789 const constituents = try cg.id_scratch.addManyAsSlice(gpa, @intCast(ty.arrayLenIncludingSentinel(zcu)));
17901543
1791 const child_repr: Repr = switch (tag) {1544 for (tuple.types.get(ip), tuple.values.get(ip), 0..) |field_ty, field_val, i| {
1792 .array_type => .indirect,1545 if (field_val != .none) continue;
1793 .vector_type => .direct,1546 const ft: Type = .fromInterned(field_ty);
1794 else => unreachable,1547 if (!ft.hasRuntimeBits(zcu)) continue;
1795 };
17961548
1797 switch (aggregate.storage) {1549 const fv = try val.fieldValue(pt, i);
1798 .bytes => |bytes| {1550 const field_id = try cg.constant(ft, fv, .indirect);
1799 // TODO: This is really space inefficient, perhaps there is a better1551 try constituents.append(gpa, field_id);
1800 // way to do it?1552 }
1801 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
1802 constituent.* = try cg.constInt(elem_ty, byte);
1803 }
1804 },
1805 .elems => |elems| {
1806 for (constituents, elems) |*constituent, elem| {
1807 constituent.* = try cg.constant(elem_ty, .fromInterned(elem), child_repr);
1808 }
1809 },
1810 .repeated_elem => |elem| {
1811 @memset(constituents, try cg.constant(elem_ty, .fromInterned(elem), child_repr));
1812 },
1813 }
18141553
1815 const comp_ty_id = try cg.resolveType(ty, .direct);1554 const comp_ty_id = try cg.resolveType(ty, .direct);
1816 return cg.constructComposite(comp_ty_id, constituents);1555 return cg.constantComposite(comp_ty_id, constituents.items);
1817 },1556 },
1818 .struct_type => {1557 else => unreachable,
1819 const struct_type = zcu.typeToStruct(ty).?;1558 },
1820 assert(struct_type.layout != .@"packed"); // packed structs use `bitpack`1559 .un => |un| {
1560 assert(ty.containerLayout(zcu) != .@"packed");
1561 if (un.tag == .none) return cg.todo("constant of untagged union", .{});
18211562
1822 var types: std.ArrayList(Type) = .empty;1563 const active_field = ty.unionTagFieldIndex(.fromInterned(un.tag), zcu).?;
1823 defer types.deinit(gpa);1564 const union_obj = zcu.typeToUnion(ty).?;
1565 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[active_field]);
1566 if (union_obj.layout == .auto) {
1567 if (ty.unionHasAllZeroBitFieldTypes(zcu)) {
1568 const tag_ty = ty.unionTagTypeRuntime(zcu).?;
1569 break :cache try cg.constant(tag_ty, .fromInterned(un.tag), .indirect);
1570 }
18241571
1825 var constituents: std.ArrayList(Id) = .empty;1572 const constituents = try gpa.alloc(Id, union_obj.field_types.len + 1);
1826 defer constituents.deinit(gpa);1573 defer gpa.free(constituents);
1574 for (
1575 constituents[0..union_obj.field_types.len],
1576 union_obj.field_types.get(ip),
1577 0..,
1578 ) |*constituent, member_ty_index, member| {
1579 const member_ty: Type = .fromInterned(member_ty_index);
1580 assert(!member_ty.isPtrAtRuntime(zcu));
1581
1582 const member_ty_id = if (member_ty.hasRuntimeBits(zcu))
1583 try cg.resolveType(member_ty, .indirect)
1584 else
1585 try cg.structType(&.{}, null, .none);
1586 constituent.* = if (member == active_field and member_ty.hasRuntimeBits(zcu))
1587 try cg.constant(member_ty, .fromInterned(un.val), .indirect)
1588 else
1589 try cg.constUndef(member_ty_id);
1590 }
18271591
1828 var it = struct_type.iterateRuntimeOrder(ip);1592 var len = union_obj.field_types.len;
1829 while (it.next()) |field_index| {1593 if (ty.unionTagTypeRuntime(zcu)) |tag_ty| {
1830 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);1594 constituents[len] = try cg.constant(tag_ty, .fromInterned(un.tag), .indirect);
1831 if (!field_ty.hasRuntimeBits(zcu)) {1595 len += 1;
1832 // This is a zero-bit field - we only needed it for the alignment.1596 }
1833 continue;
1834 }
18351597
1836 // TODO: Padding?1598 return cg.constantComposite(result_ty_id, constituents[0..len]);
1837 const field_val = try val.fieldValue(pt, field_index);1599 }
1838 const field_id = try cg.constant(field_ty, field_val, .indirect);
18391600
1840 try types.append(gpa, field_ty);1601 const layout = cg.unionLayout(ty);
1841 try constituents.append(gpa, field_id);1602 if (field_ty.hasRuntimeBits(zcu) and layout.payload_ty.eql(field_ty)) {
1842 }1603 const constituents = try gpa.alloc(Id, layout.total_fields);
1604 defer gpa.free(constituents);
1605 constituents[layout.payload_index] = try cg.constant(
1606 field_ty,
1607 .fromInterned(un.val),
1608 .indirect,
1609 );
18431610
1844 const comp_ty_id = try cg.resolveType(ty, .direct);1611 if (layout.payload_padding_size != 0) {
1845 return try cg.constructComposite(comp_ty_id, constituents.items);1612 const u8_ty_id = try cg.resolveType(.u8, .indirect);
1846 },1613 const len_id = try cg.constInt(.u32, layout.payload_padding_size);
1847 .tuple_type => |tuple| {1614 constituents[layout.payload_padding_index] = try cg.constUndef(try cg.arrayType(len_id, u8_ty_id));
1848 var constituents: std.ArrayList(Id) = .empty;1615 }
1849 defer constituents.deinit(gpa);
18501616
1851 for (tuple.types.get(ip), tuple.values.get(ip), 0..) |field_ty, field_val, i| {1617 if (layout.padding_size != 0) {
1852 if (field_val != .none) continue;1618 const u8_ty_id = try cg.resolveType(.u8, .indirect);
1853 const ft: Type = .fromInterned(field_ty);1619 const len_id = try cg.constInt(.u32, layout.padding_size);
1854 if (!ft.hasRuntimeBits(zcu)) continue;1620 constituents[layout.padding_index] = try cg.constUndef(try cg.arrayType(len_id, u8_ty_id));
1621 }
18551622
1856 const fv = try val.fieldValue(pt, i);1623 return cg.constantComposite(result_ty_id, constituents);
1857 const field_id = try cg.constant(ft, fv, .indirect);1624 }
1858 try constituents.append(gpa, field_id);
1859 }
18601625
1861 const comp_ty_id = try cg.resolveType(ty, .direct);1626 const payload: ?Id = if (field_ty.hasRuntimeBits(zcu))
1862 return try cg.constructComposite(comp_ty_id, constituents.items);1627 try cg.constant(field_ty, .fromInterned(un.val), .direct)
1863 },1628 else
1864 else => unreachable,1629 null;
1865 },1630 return try cg.unionInit(ty, active_field, payload);
1866 .un => |un| {1631 },
1867 assert(ty.containerLayout(zcu) != .@"packed"); // packed unions use `bitpack`1632 .bitpack => |bitpack| {
1868 if (un.tag == .none) {1633 const int_val: Value = .fromInterned(bitpack.backing_int_val);
1869 @panic("TODO");1634 break :cache try cg.constant(int_val.typeOf(zcu), int_val, repr);
1870 }1635 },
1871 const active_field = ty.unionTagFieldIndex(.fromInterned(un.tag), zcu).?;
1872 const union_obj = zcu.typeToUnion(ty).?;
1873 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[active_field]);
1874 const payload = if (field_ty.hasRuntimeBits(zcu))
1875 try cg.constant(field_ty, .fromInterned(un.val), .direct)
1876 else
1877 null;
1878 return try cg.unionInit(ty, active_field, payload);
1879 },
1880 .bitpack => |bitpack| {
1881 const int_val: Value = .fromInterned(bitpack.backing_int_val);
1882 break :cache try cg.constant(int_val.typeOf(zcu), int_val, repr);
1883 },
18841636
1885 .memoized_call => unreachable,1637 .memoized_call => unreachable,
1886 }
1887 };1638 };
1888 return cacheable_id;1639 return cacheable_id;
1889}1640}
...@@ -1942,46 +1693,42 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {...@@ -1942,46 +1693,42 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
1942 const nav = ip.getNav(nav_index);1693 const nav = ip.getNav(nav_index);
1943 const nav_ty: Type = .fromInterned(nav.resolved.?.type);1694 const nav_ty: Type = .fromInterned(nav.resolved.?.type);
19441695
1945 switch (nav.resolved.?.value) {1696 const is_extern = nav.getExtern(ip) != null;
1946 .none => {},1697 assert(nav.resolved.?.@"const" or is_extern);
1947 else => |value| switch (ip.indexToKey(value)) {
1948 // TODO: Properly lower function pointers; for now substitute undef.
1949 .func => return try cg.constUndef(ty_id),
1950 .@"extern" => if (ip.isFunctionType(nav_ty.toIntern())) {
1951 const spv_decl_index = try cg.resolveNav(ip, nav_index);
1952 const decl = cg.declPtr(spv_decl_index);
1953 try emitExternFnStub(cg, nav, decl, nav_ty);
1954 return decl.result_id;
1955 },
1956 else => {},
1957 },
1958 }
19591698
1699 if (ip.isFunctionType(nav_ty.toIntern())) {
1700 if (is_extern) return try cg.resolveExternFn(nav_index);
1701 return try cg.constUndef(ty_id);
1702 }
1960 if (!nav_ty.hasRuntimeBits(zcu) and nav_ty.zigTypeTag(zcu) != .spirv) {1703 if (!nav_ty.hasRuntimeBits(zcu) and nav_ty.zigTypeTag(zcu) != .spirv) {
1961 return cg.constUndef(ty_id);1704 return cg.constUndef(ty_id);
1962 }1705 }
1706 if (!is_extern) {
1707 return cg.todo("pointer to constant '{f}'", .{nav.fqn.fmt(ip)});
1708 }
19631709
1964 const spv_decl_index = try cg.resolveNav(ip, nav_index);1710 const as = nav.resolved.?.@"addrspace";
1965 const spv_decl = cg.declPtr(spv_decl_index);1711 assert(as != .generic);
1966 assert(spv_decl.kind != .func);
1967 const storage_class = cg.storageClass(nav.resolved.?.@"addrspace");
1968 try cg.addFunctionDep(spv_decl_index, storage_class);
19691712
1713 const storage_class = cg.storageClass(as);
1714 const var_id = try cg.resolveNav(nav_index);
1970 const nav_ty_id = try cg.resolveType(nav_ty, .indirect);1715 const nav_ty_id = try cg.resolveType(nav_ty, .indirect);
1971 const decl_ptr_ty_id = try cg.ptrType(nav_ty_id, storage_class);1716 const decl_ptr_ty_id = try cg.ptrType(nav_ty_id, storage_class);
1972 if (cg.needsLayout(nav.resolved.?.@"addrspace", nav_ty)) {1717 if (cg.needsLayout(as, nav_ty)) {
1973 try cg.block_var_ids.put(gpa, spv_decl.result_id, {});1718 try cg.block_var_ids.put(gpa, var_id, {});
1974 }1719 }
1975 if (decl_ptr_ty_id == ty_id) return spv_decl.result_id;1720
1721 if (decl_ptr_ty_id == ty_id) return var_id;
1976 switch (target.os.tag) {1722 switch (target.os.tag) {
1977 .vulkan, .opengl => return spv_decl.result_id,1723 .vulkan, .opengl => return var_id,
1978 else => {},1724 else => {},
1979 }1725 }
1726
1980 const casted_ptr_id = cg.allocId();1727 const casted_ptr_id = cg.allocId();
1981 try cg.body.emit(gpa, .OpBitcast, .{1728 try cg.body.emit(gpa, .OpBitcast, .{
1982 .id_result_type = ty_id,1729 .id_result_type = ty_id,
1983 .id_result = casted_ptr_id,1730 .id_result = casted_ptr_id,
1984 .operand = spv_decl.result_id,1731 .operand = var_id,
1985 });1732 });
1986 return casted_ptr_id;1733 return casted_ptr_id;
1987 },1734 },
...@@ -2001,24 +1748,15 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {...@@ -2001,24 +1748,15 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
2001 return cg.constUndef(ty_id);1748 return cg.constUndef(ty_id);
2002 }1749 }
20031750
2004 // Uav refs are always generic.1751 if (cg.storageClass(result_ptr_ty.ptrAddressSpace(zcu)) != .function) {
2005 assert(result_ptr_ty.ptrAddressSpace(zcu) == .generic);1752 return cg.todo("pointer to an anonymous constant of type '{f}'", .{uav_ty.fmt(pt)});
2006 const uav_ty_id = try cg.resolveType(uav_ty, .indirect);
2007 const decl_ptr_ty_id = try cg.ptrType(uav_ty_id, .function);
2008 const ptr_id = try cg.resolveUav(uav.val);
2009
2010 if (decl_ptr_ty_id == ty_id) return ptr_id;
2011 switch (target.os.tag) {
2012 .vulkan, .opengl => return ptr_id,
2013 else => {},
2014 }1753 }
2015 const casted_ptr_id = cg.allocId();1754
2016 try cg.body.emit(gpa, .OpBitcast, .{1755 const uav_ty_id = try cg.resolveType(uav_ty, .indirect);
2017 .id_result_type = ty_id,1756 const ptr_id = try cg.alloc(uav_ty_id, null);
2018 .id_result = casted_ptr_id,1757 const val_id = try cg.constant(uav_ty, .fromInterned(uav.val), .indirect);
2019 .operand = ptr_id,1758 try cg.body.emit(gpa, .OpStore, .{ .pointer = ptr_id, .object = val_id });
2020 });1759 return ptr_id;
2021 return casted_ptr_id;
2022 },1760 },
2023 .eu_payload_ptr => @panic("TODO"),1761 .eu_payload_ptr => @panic("TODO"),
2024 .opt_payload_ptr => @panic("TODO"),1762 .opt_payload_ptr => @panic("TODO"),
...@@ -2102,61 +1840,6 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {...@@ -2102,61 +1840,6 @@ fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
2102 }1840 }
2103}1841}
21041842
2105/// Emit a stub OpFunction/OpFunctionEnd + Import linkage decoration for an
2106/// extern function so the module is structurally valid. The stub will be
2107/// replaced by the real definition at link time.
2108fn emitExternFnStub(cg: *CodeGen, nav: InternPool.Nav, decl: *Decl, fn_ty: Type) !void {
2109 if (decl.has_extern_stub) return;
2110 decl.has_extern_stub = true;
2111
2112 const gpa = cg.gpa;
2113 const zcu = cg.zcu;
2114 const ip = &zcu.intern_pool;
2115 const fn_info = zcu.typeToFunc(fn_ty).?;
2116 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
2117 const prototype_ty_id = try cg.resolveType(fn_ty, .direct);
2118
2119 var stub: Section = .{};
2120 defer stub.deinit(gpa);
2121 try stub.emit(gpa, .OpFunction, .{
2122 .id_result_type = return_ty_id,
2123 .id_result = decl.result_id,
2124 .function_type = prototype_ty_id,
2125 .function_control = .{},
2126 });
2127 for (fn_info.param_types.get(ip)) |param_ty_index| {
2128 const param_ty: Type = .fromInterned(param_ty_index);
2129 if (!param_ty.hasRuntimeBits(zcu)) continue;
2130 const param_type_id = try cg.resolveType(param_ty, .direct);
2131 try stub.emit(gpa, .OpFunctionParameter, .{
2132 .id_result_type = param_type_id,
2133 .id_result = cg.allocId(),
2134 });
2135 }
2136 try stub.emit(gpa, .OpFunctionEnd, {});
2137 try cg.sections.functions.append(gpa, stub);
2138
2139 const extern_name = nav.getExtern(ip).?.name.toSlice(ip);
2140 try cg.sections.annotations.emit(gpa, .OpDecorate, .{
2141 .target = decl.result_id,
2142 .decoration = .{ .linkage_attributes = .{
2143 .name = extern_name,
2144 .linkage_type = .import,
2145 } },
2146 });
2147 try cg.debugName(decl.result_id, extern_name);
2148}
2149
2150fn resolveTypeName(cg: *CodeGen, ty: Type) ![]const u8 {
2151 const gpa = cg.gpa;
2152 var aw: std.Io.Writer.Allocating = .init(gpa);
2153 defer aw.deinit();
2154 ty.print(&aw.writer, cg.pt, null) catch |err| switch (err) {
2155 error.WriteFailed => return error.OutOfMemory,
2156 };
2157 return try aw.toOwnedSlice();
2158}
2159
2160/// Generate a union type. Union types are always generated with the1843/// Generate a union type. Union types are always generated with the
2161/// most aligned field active. If the tag alignment is greater1844/// most aligned field active. If the tag alignment is greater
2162/// than that of the payload, a regular union (non-packed, with both tag and1845/// than that of the payload, a regular union (non-packed, with both tag and
...@@ -2209,7 +1892,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2209,7 +1892,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2209 .direct => return try cg.voidType(),1892 .direct => return try cg.voidType(),
2210 .indirect => {1893 .indirect => {
2211 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});1894 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});
2212 return try cg.opaqueType("void");1895 return try cg.opaqueType("void", .{});
2213 },1896 },
2214 },1897 },
2215 .bool => switch (repr) {1898 .bool => switch (repr) {
...@@ -2220,7 +1903,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2220,7 +1903,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2220 if (ty.toIntern() == .u0_type) {1903 if (ty.toIntern() == .u0_type) {
2221 assert(repr == .indirect);1904 assert(repr == .indirect);
2222 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});1905 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});
2223 return try cg.opaqueType("u0");1906 return try cg.opaqueType("u0", .{});
2224 }1907 }
2225 const int_info = ty.intInfo(zcu);1908 const int_info = ty.intInfo(zcu);
2226 return try cg.intType(int_info.signedness, int_info.bits);1909 return try cg.intType(int_info.signedness, int_info.bits);
...@@ -2250,7 +1933,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2250,7 +1933,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2250 if (!elem_ty.hasRuntimeBits(zcu)) {1933 if (!elem_ty.hasRuntimeBits(zcu)) {
2251 assert(repr == .indirect);1934 assert(repr == .indirect);
2252 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});1935 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});
2253 return try cg.opaqueType("zero-sized-array");1936 return try cg.opaqueType("zero-sized-array", .{});
2254 } else if (total_len == 0) {1937 } else if (total_len == 0) {
2255 // The size of the array would be 0, but that is not allowed in SPIR-V.1938 // The size of the array would be 0, but that is not allowed in SPIR-V.
2256 // This path can be reached for example when there is a slicing of a pointer1939 // This path can be reached for example when there is a slicing of a pointer
...@@ -2364,9 +2047,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2364,9 +2047,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2364 null,2047 null,
2365 .none,2048 .none,
2366 );2049 );
2367 const type_name = try cg.resolveTypeName(ty);2050 try cg.debugNameFmt(result_id, "{f}", .{ty.fmt(cg.pt)});
2368 defer gpa.free(type_name);
2369 try cg.debugName(result_id, type_name);
2370 return result_id;2051 return result_id;
2371 },2052 },
2372 .struct_type => ip.loadStructType(ty.toIntern()),2053 .struct_type => ip.loadStructType(ty.toIntern()),
...@@ -2399,9 +2080,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2399,9 +2080,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2399 ty.toIntern(),2080 ty.toIntern(),
2400 );2081 );
24012082
2402 const type_name = try cg.resolveTypeName(ty);2083 try cg.debugNameFmt(result_id, "{f}", .{ty.fmt(cg.pt)});
2403 defer gpa.free(type_name);
2404 try cg.debugName(result_id, type_name);
24052084
2406 return result_id;2085 return result_id;
2407 },2086 },
...@@ -2430,9 +2109,36 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2430,9 +2109,36 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2430 },2109 },
2431 .@"union" => {2110 .@"union" => {
2432 const union_obj = zcu.typeToUnion(ty).?;2111 const union_obj = zcu.typeToUnion(ty).?;
2433 if (union_obj.layout == .@"packed") {2112 switch (union_obj.layout) {
2434 return try cg.intType(.unsigned, @intCast(ty.bitSize(zcu)));2113 .@"extern" => {},
2114 .@"packed" => return try cg.intType(.unsigned, @intCast(ty.bitSize(zcu))),
2115 .auto => {
2116 if (ty.unionHasAllZeroBitFieldTypes(zcu)) {
2117 return try cg.resolveType(ty.unionTagTypeRuntime(zcu).?, .indirect);
2118 }
2119
2120 const member_types = try gpa.alloc(Id, union_obj.field_types.len + 1);
2121 defer gpa.free(member_types);
2122 for (member_types[0..union_obj.field_types.len], union_obj.field_types.get(ip)) |*member_ty_id, field_ty_index| {
2123 const field_ty: Type = .fromInterned(field_ty_index);
2124 member_ty_id.* = if (field_ty.hasRuntimeBits(zcu))
2125 try cg.resolveType(field_ty, .indirect)
2126 else
2127 try cg.structType(&.{}, null, .none);
2128 }
2129
2130 var len = union_obj.field_types.len;
2131 if (ty.unionTagTypeRuntime(zcu)) |tag_ty| {
2132 member_types[len] = try cg.resolveType(tag_ty, .indirect);
2133 len += 1;
2134 }
2135
2136 const result_id = try cg.structType(member_types[0..len], null, .none);
2137 try cg.debugNameFmt(result_id, "{f}", .{ty.fmt(cg.pt)});
2138 return result_id;
2139 },
2435 }2140 }
2141
2436 const layout = cg.unionLayout(ty);2142 const layout = cg.unionLayout(ty);
2437 if (!layout.has_payload) {2143 if (!layout.has_payload) {
2438 return try cg.resolveType(.fromInterned(union_obj.enum_tag_type), .indirect);2144 return try cg.resolveType(.fromInterned(union_obj.enum_tag_type), .indirect);
...@@ -2463,9 +2169,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2463,9 +2169,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2463 member_names[0..layout.total_fields],2169 member_names[0..layout.total_fields],
2464 .none,2170 .none,
2465 );2171 );
2466 const type_name = try cg.resolveTypeName(ty);2172 try cg.debugNameFmt(result_id, "{f}", .{ty.fmt(cg.pt)});
2467 defer gpa.free(type_name);
2468 try cg.debugName(result_id, type_name);
2469 return result_id;2173 return result_id;
2470 },2174 },
2471 .error_set => {2175 .error_set => {
...@@ -2502,18 +2206,16 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2502,18 +2206,16 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2502 },2206 },
2503 .@"opaque" => {2207 .@"opaque" => {
2504 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});2208 if (target.os.tag != .opencl) return cg.fail("cannot generate opaque type", .{});
2505 const type_name = try cg.resolveTypeName(ty);2209 return try cg.opaqueType("{f}", .{ty.fmt(cg.pt)});
2506 defer gpa.free(type_name);
2507 return try cg.opaqueType(type_name);
2508 },2210 },
2509 .spirv => {2211 .spirv => {
2510 const spirv_type = ip.loadSpirvType(ty.toIntern());2212 const spirv_type = ip.loadSpirvType(ty.toIntern());
2511 const result_id = cg.allocId();2213 const result_id = cg.allocId();
2512 switch (spirv_type.flags.tag) {2214 switch (spirv_type.flags.tag) {
2513 .sampler => try cg.sections.globals.emit(gpa, .OpTypeSampler, .{ .id_result = result_id }),2215 .sampler => try cg.module.emit(gpa, .OpTypeSampler, .{ .id_result = result_id }),
2514 .image => {2216 .image => {
2515 const sampled_type_id = try cg.resolveType(.fromInterned(spirv_type.ty), .direct);2217 const sampled_type_id = try cg.resolveType(.fromInterned(spirv_type.ty), .direct);
2516 try cg.sections.globals.emit(gpa, .OpTypeImage, .{2218 try cg.module.emit(gpa, .OpTypeImage, .{
2517 .id_result = result_id,2219 .id_result = result_id,
2518 .sampled_type = sampled_type_id,2220 .sampled_type = sampled_type_id,
2519 .dim = switch (spirv_type.flags.dim) {2221 .dim = switch (spirv_type.flags.dim) {
...@@ -2550,17 +2252,22 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2550,17 +2252,22 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2550 .r32i => .r32i,2252 .r32i => .r32i,
2551 .r32u => .r32ui,2253 .r32u => .r32ui,
2552 },2254 },
2553 .access_qualifier = switch (spirv_type.flags.access) {2255 .access_qualifier = blk: {
2554 .unknown => null,2256 if (target.os.tag == .opencl) {
2555 .read_only => .read_only,2257 break :blk switch (spirv_type.flags.access) {
2556 .write_only => .write_only,2258 .unknown => null,
2557 .read_write => .read_write,2259 .read_only => .read_only,
2260 .write_only => .write_only,
2261 .read_write => .read_write,
2262 };
2263 }
2264 break :blk null;
2558 },2265 },
2559 });2266 });
2560 },2267 },
2561 .sampled_image => {2268 .sampled_image => {
2562 const image_ty_id = try cg.resolveType(.fromInterned(spirv_type.ty), .indirect);2269 const image_ty_id = try cg.resolveType(.fromInterned(spirv_type.ty), .indirect);
2563 try cg.sections.globals.emit(gpa, .OpTypeSampledImage, .{2270 try cg.module.emit(gpa, .OpTypeSampledImage, .{
2564 .id_result = result_id,2271 .id_result = result_id,
2565 .image_type = image_ty_id,2272 .image_type = image_ty_id,
2566 });2273 });
...@@ -2568,7 +2275,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {...@@ -2568,7 +2275,7 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
2568 .runtime_array => {2275 .runtime_array => {
2569 const elem_ty: Type = .fromInterned(spirv_type.ty);2276 const elem_ty: Type = .fromInterned(spirv_type.ty);
2570 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);2277 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
2571 try cg.sections.globals.emit(gpa, .OpTypeRuntimeArray, .{2278 try cg.module.emit(gpa, .OpTypeRuntimeArray, .{
2572 .id_result = result_id,2279 .id_result = result_id,
2573 .element_type = elem_ty_id,2280 .element_type = elem_ty_id,
2574 });2281 });
...@@ -4061,7 +3768,7 @@ fn buildWideMul(...@@ -4061,7 +3768,7 @@ fn buildWideMul(
4061fn generateTestEntryPoint(3768fn generateTestEntryPoint(
4062 cg: *CodeGen,3769 cg: *CodeGen,
4063 name: []const u8,3770 name: []const u8,
4064 spv_decl_index: Decl.Index,3771 kernel_id: Id,
4065 test_id: Id,3772 test_id: Id,
4066) !void {3773) !void {
4067 const gpa = cg.gpa;3774 const gpa = cg.gpa;
...@@ -4075,9 +3782,8 @@ fn generateTestEntryPoint(...@@ -4075,9 +3782,8 @@ fn generateTestEntryPoint(
4075 });3782 });
4076 const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct);3783 const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct);
40773784
4078 const kernel_id = cg.declPtr(spv_decl_index).result_id;3785 var section: Section = .empty;
40793786 defer section.deinit(gpa);
4080 const section = &cg.sections.functions;
40813787
4082 const p_error_id = cg.allocId();3788 const p_error_id = cg.allocId();
4083 switch (target.os.tag) {3789 switch (target.os.tag) {
...@@ -4103,11 +3809,8 @@ fn generateTestEntryPoint(...@@ -4103,11 +3809,8 @@ fn generateTestEntryPoint(
4103 },3809 },
4104 .vulkan, .opengl => {3810 .vulkan, .opengl => {
4105 if (cg.error_buffer == null) {3811 if (cg.error_buffer == null) {
4106 const spv_err_decl_index = try cg.allocDecl(.global);
4107 const err_buf_result_id = cg.declPtr(spv_err_decl_index).result_id;
4108
4109 const buffer_struct_ty_id = cg.allocId();3812 const buffer_struct_ty_id = cg.allocId();
4110 try cg.sections.globals.emit(gpa, .OpTypeStruct, .{3813 try cg.module.emit(gpa, .OpTypeStruct, .{
4111 .id_result = buffer_struct_ty_id,3814 .id_result = buffer_struct_ty_id,
4112 .id_ref = &.{anyerror_ty_id},3815 .id_ref = &.{anyerror_ty_id},
4113 });3816 });
...@@ -4116,21 +3819,21 @@ fn generateTestEntryPoint(...@@ -4116,21 +3819,21 @@ fn generateTestEntryPoint(
4116 try cg.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });3819 try cg.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });
41173820
4118 const ptr_buffer_struct_ty_id = cg.allocId();3821 const ptr_buffer_struct_ty_id = cg.allocId();
4119 try cg.sections.globals.emit(gpa, .OpTypePointer, .{3822 try cg.module.emit(gpa, .OpTypePointer, .{
4120 .id_result = ptr_buffer_struct_ty_id,3823 .id_result = ptr_buffer_struct_ty_id,
4121 .storage_class = cg.storageClass(.global),3824 .storage_class = cg.storageClass(.global),
4122 .type = buffer_struct_ty_id,3825 .type = buffer_struct_ty_id,
4123 });3826 });
41243827
4125 try cg.sections.globals.emit(gpa, .OpVariable, .{3828 const error_buffer_id = cg.allocId();
3829 cg.error_buffer = error_buffer_id;
3830 try cg.module.emit(gpa, .OpVariable, .{
4126 .id_result_type = ptr_buffer_struct_ty_id,3831 .id_result_type = ptr_buffer_struct_ty_id,
4127 .id_result = err_buf_result_id,3832 .id_result = error_buffer_id,
4128 .storage_class = cg.storageClass(.global),3833 .storage_class = cg.storageClass(.global),
4129 });3834 });
4130 try cg.decorate(err_buf_result_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });3835 try cg.decorate(error_buffer_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });
4131 try cg.decorate(err_buf_result_id, .{ .binding = .{ .binding_point = 0 } });3836 try cg.decorate(error_buffer_id, .{ .binding = .{ .binding_point = 0 } });
4132
4133 cg.error_buffer = spv_err_decl_index;
4134 }3837 }
41353838
4136 const void_ty_id = try cg.resolveType(.void, .direct);3839 const void_ty_id = try cg.resolveType(.void, .direct);
...@@ -4145,10 +3848,7 @@ fn generateTestEntryPoint(...@@ -4145,10 +3848,7 @@ fn generateTestEntryPoint(
4145 .id_result = cg.allocId(),3848 .id_result = cg.allocId(),
4146 });3849 });
41473850
4148 const spv_err_decl_index = cg.error_buffer.?;3851 const buffer_id = cg.error_buffer.?;
4149 const buffer_id = cg.declPtr(spv_err_decl_index).result_id;
4150 try cg.decl_deps.append(gpa, spv_err_decl_index);
4151
4152 const zero_id = try cg.constInt(.u32, 0);3852 const zero_id = try cg.constInt(.u32, 0);
4153 try section.emit(gpa, .OpInBoundsAccessChain, .{3853 try section.emit(gpa, .OpInBoundsAccessChain, .{
4154 .id_result_type = ptr_anyerror_ty_id,3854 .id_result_type = ptr_anyerror_ty_id,
...@@ -4176,17 +3876,17 @@ fn generateTestEntryPoint(...@@ -4176,17 +3876,17 @@ fn generateTestEntryPoint(
4176 });3876 });
4177 try section.emit(gpa, .OpReturn, {});3877 try section.emit(gpa, .OpReturn, {});
4178 try section.emit(gpa, .OpFunctionEnd, {});3878 try section.emit(gpa, .OpFunctionEnd, {});
3879 try cg.module.append(gpa, section);
41793880
4180 // Just generate a quick other name because the intel runtime crashes when the entry-3881 // Just generate a quick other name because the intel runtime crashes when the entry-
4181 // point name is the same as a different OpName.3882 // point name is the same as a different OpName.
4182 const test_name = try std.fmt.allocPrint(cg.arena, "test {s}", .{name});3883 const test_name = try std.fmt.allocPrint(gpa, "test {s}", .{name});
41833884 errdefer gpa.free(test_name);
4184 const ep_gop = try cg.entry_points.getOrPut(cg.gpa, cg.declPtr(spv_decl_index).result_id);3885 try cg.entry_points.append(gpa, .{
4185 ep_gop.value_ptr.* = .{3886 .id = kernel_id,
4186 .decl_index = spv_decl_index,
4187 .name = test_name,3887 .name = test_name,
4188 .cc = .{ .spirv_kernel = .{ .x = 1, .y = 1, .z = 1 } },3888 .cc = .{ .spirv_kernel = .{ .x = 1, .y = 1, .z = 1 } },
4189 };3889 });
4190}3890}
41913891
4192fn intFromBool(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary {3892fn intFromBool(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary {
...@@ -4456,6 +4156,7 @@ fn genInst(cg: *CodeGen, inst: Air.Inst.Index) Error!void {...@@ -4456,6 +4156,7 @@ fn genInst(cg: *CodeGen, inst: Air.Inst.Index) Error!void {
4456 .ptr_elem_ptr => try cg.airPtrElemPtr(inst),4156 .ptr_elem_ptr => try cg.airPtrElemPtr(inst),
4457 .ptr_elem_val => try cg.airPtrElemVal(inst),4157 .ptr_elem_val => try cg.airPtrElemVal(inst),
4458 .array_elem_val => try cg.airArrayElemVal(inst),4158 .array_elem_val => try cg.airArrayElemVal(inst),
4159 .runtime_nav_ptr => try cg.airRuntimeNavPtr(inst),
44594160
4460 .set_union_tag => return cg.airSetUnionTag(inst),4161 .set_union_tag => return cg.airSetUnionTag(inst),
4461 .get_union_tag => try cg.airGetUnionTag(inst),4162 .get_union_tag => try cg.airGetUnionTag(inst),
...@@ -5549,12 +5250,17 @@ fn airSelect(cg: *CodeGen, inst: Air.Inst.Index) !?Id {...@@ -5549,12 +5250,17 @@ fn airSelect(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5549}5250}
55505251
5551fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {5252fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5253 const gpa = cg.gpa;
5254 const zcu = cg.zcu;
5552 const ty_op = cg.air.instructions.items(.data)[@backingInt(inst)].ty_op;5255 const ty_op = cg.air.instructions.items(.data)[@backingInt(inst)].ty_op;
5553
5554 const operand_id = try cg.resolve(ty_op.operand);5256 const operand_id = try cg.resolve(ty_op.operand);
5555 const result_ty = cg.typeOfIndex(inst);5257 const result_ty = cg.typeOfIndex(inst);
55565258
5557 return try cg.constructCompositeSplat(result_ty, operand_id);5259 const scratch_top = cg.id_scratch.items.len;
5260 defer cg.id_scratch.shrinkRetainingCapacity(scratch_top);
5261 const constituents = try cg.id_scratch.addManyAsSlice(gpa, @intCast(result_ty.arrayLen(zcu)));
5262 @memset(constituents, operand_id);
5263 return try cg.constructComposite(try cg.resolveType(result_ty, .direct), constituents);
5558}5264}
55595265
5560fn airReduce(cg: *CodeGen, inst: Air.Inst.Index) !?Id {5266fn airReduce(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
...@@ -6767,6 +6473,11 @@ fn ptrElemPtr(cg: *CodeGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {...@@ -6767,6 +6473,11 @@ fn ptrElemPtr(cg: *CodeGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {
6767 }6473 }
6768}6474}
67696475
6476fn airRuntimeNavPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6477 const ty_nav = cg.air.instructions.items(.data)[@backingInt(inst)].ty_nav;
6478 return try cg.resolveNav(ty_nav.nav);
6479}
6480
6770fn airPtrElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {6481fn airPtrElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6771 const zcu = cg.zcu;6482 const zcu = cg.zcu;
6772 const ty_pl = cg.air.instructions.items(.data)[@backingInt(inst)].ty_pl;6483 const ty_pl = cg.air.instructions.items(.data)[@backingInt(inst)].ty_pl;
...@@ -6849,38 +6560,27 @@ fn airSetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !void {...@@ -6849,38 +6560,27 @@ fn airSetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !void {
6849 const bin_op = cg.air.instructions.items(.data)[@backingInt(inst)].bin_op;6560 const bin_op = cg.air.instructions.items(.data)[@backingInt(inst)].bin_op;
6850 const un_ptr_ty = cg.typeOf(bin_op.lhs);6561 const un_ptr_ty = cg.typeOf(bin_op.lhs);
6851 const un_ty = un_ptr_ty.childType(zcu);6562 const un_ty = un_ptr_ty.childType(zcu);
6852 const layout = cg.unionLayout(un_ty);6563 const tag_ty = un_ty.unionTagTypeRuntime(zcu) orelse return;
6853
6854 if (layout.tag_size == 0) return;
6855
6856 const tag_ty = un_ty.unionTagTypeRuntime(zcu).?;
6857 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);6564 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);
6858 const tag_ptr_ty_id = try cg.ptrType(tag_ty_id, cg.storageClass(un_ptr_ty.ptrAddressSpace(zcu)));6565 const tag_ptr_ty_id = try cg.ptrType(tag_ty_id, cg.storageClass(un_ptr_ty.ptrAddressSpace(zcu)));
6859
6860 const union_ptr_id = try cg.resolve(bin_op.lhs);6566 const union_ptr_id = try cg.resolve(bin_op.lhs);
6861 const new_tag_id = try cg.resolve(bin_op.rhs);6567 const new_tag_id = try cg.resolve(bin_op.rhs);
68626568 const ptr_id = if (un_ty.unionHasAllZeroBitFieldTypes(zcu))
6863 if (!layout.has_payload) {6569 union_ptr_id
6864 try cg.store(tag_ty, union_ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });6570 else
6865 } else {6571 try cg.accessChain(tag_ptr_ty_id, union_ptr_id, &.{zcu.typeToUnion(un_ty).?.field_types.len});
6866 const ptr_id = try cg.accessChain(tag_ptr_ty_id, union_ptr_id, &.{layout.tag_index});6572 try cg.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
6867 try cg.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
6868 }
6869}6573}
68706574
6871fn airGetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !?Id {6575fn airGetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6576 const zcu = cg.zcu;
6872 const ty_op = cg.air.instructions.items(.data)[@backingInt(inst)].ty_op;6577 const ty_op = cg.air.instructions.items(.data)[@backingInt(inst)].ty_op;
6873 const un_ty = cg.typeOf(ty_op.operand);6578 const un_ty = cg.typeOf(ty_op.operand);
68746579 const tag_ty = un_ty.unionTagTypeRuntime(zcu) orelse return null;
6875 const zcu = cg.zcu;
6876 const layout = cg.unionLayout(un_ty);
6877 if (layout.tag_size == 0) return null;
6878
6879 const union_handle = try cg.resolve(ty_op.operand);6580 const union_handle = try cg.resolve(ty_op.operand);
6880 if (!layout.has_payload) return union_handle;6581 if (un_ty.unionHasAllZeroBitFieldTypes(zcu)) return union_handle;
68816582 const tag_member = zcu.typeToUnion(un_ty).?.field_types.len;
6882 const tag_ty = un_ty.unionTagTypeRuntime(zcu).?;6583 return try cg.extractField(tag_ty, union_handle, tag_member);
6883 return try cg.extractField(tag_ty, union_handle, layout.tag_index);
6884}6584}
68856585
6886fn unionInit(6586fn unionInit(
...@@ -6905,6 +6605,29 @@ fn unionInit(...@@ -6905,6 +6605,29 @@ fn unionInit(
6905 const payload_ty: Type = .fromInterned(union_ty.field_types.get(ip)[active_field]);6605 const payload_ty: Type = .fromInterned(union_ty.field_types.get(ip)[active_field]);
69066606
6907 assert(union_ty.layout != .@"packed");6607 assert(union_ty.layout != .@"packed");
6608 if (union_ty.layout == .auto) {
6609 if (ty.unionHasAllZeroBitFieldTypes(zcu)) {
6610 const runtime_tag_ty = ty.unionTagTypeRuntime(zcu).?;
6611 const tag_val = try pt.enumValueFieldIndex(runtime_tag_ty, active_field);
6612 return try cg.constant(runtime_tag_ty, tag_val, .indirect);
6613 }
6614 const ty_id = try cg.resolveType(ty, .indirect);
6615 const tmp_id = try cg.alloc(ty_id, null);
6616 if (payload) |payload_id| {
6617 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
6618 const ptr_ty_id = try cg.ptrType(payload_ty_id, .function);
6619 const payload_ptr_id = try cg.accessChain(ptr_ty_id, tmp_id, &.{active_field});
6620 try cg.store(payload_ty, payload_ptr_id, payload_id, .{});
6621 }
6622 if (ty.unionTagTypeRuntime(zcu)) |runtime_tag_ty| {
6623 const tag_val = try pt.enumValueFieldIndex(runtime_tag_ty, active_field);
6624 const tag_id = try cg.constant(runtime_tag_ty, tag_val, .indirect);
6625 const tag_ptr_ty_id = try cg.ptrType(try cg.resolveType(runtime_tag_ty, .indirect), .function);
6626 const tag_ptr_id = try cg.accessChain(tag_ptr_ty_id, tmp_id, &.{union_ty.field_types.len});
6627 try cg.store(runtime_tag_ty, tag_ptr_id, tag_id, .{});
6628 }
6629 return try cg.load(ty, tmp_id, .{});
6630 }
69086631
6909 const tag_int = if (layout.tag_size != 0) blk: {6632 const tag_int = if (layout.tag_size != 0) blk: {
6910 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);6633 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);
...@@ -7009,7 +6732,7 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {...@@ -7009,7 +6732,7 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
7009 if (field_ty.isInt(zcu)) return result_id;6732 if (field_ty.isInt(zcu)) return result_id;
7010 return try cg.bitCast(field_ty, field_int_ty, result_id);6733 return try cg.bitCast(field_ty, field_int_ty, result_id);
7011 },6734 },
7012 else => return try cg.extractField(field_ty, object_id, field_index),6735 else => return try cg.extractField(field_ty, object_id, cg.memberIndex(object_ty, field_index)),
7013 },6736 },
7014 .@"union" => switch (object_ty.containerLayout(zcu)) {6737 .@"union" => switch (object_ty.containerLayout(zcu)) {
7015 .@"packed" => {6738 .@"packed" => {
...@@ -7033,7 +6756,8 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {...@@ -7033,7 +6756,8 @@ fn airAggFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
7033 if (field_ty.isInt(zcu)) return result_id;6756 if (field_ty.isInt(zcu)) return result_id;
7034 return try cg.bitCast(field_ty, int_ty, result_id);6757 return try cg.bitCast(field_ty, int_ty, result_id);
7035 },6758 },
7036 else => {6759 .auto => return try cg.extractField(field_ty, object_id, field_index),
6760 .@"extern" => {
7037 // Store, ptr-elem-ptr, pointer-cast, load6761 // Store, ptr-elem-ptr, pointer-cast, load
7038 const layout = cg.unionLayout(object_ty);6762 const layout = cg.unionLayout(object_ty);
7039 assert(layout.has_payload);6763 assert(layout.has_payload);
...@@ -7158,12 +6882,17 @@ fn structFieldPtr(...@@ -7158,12 +6882,17 @@ fn structFieldPtr(
7158 return result_id;6882 return result_id;
7159 },6883 },
7160 .auto, .@"extern" => {6884 .auto, .@"extern" => {
7161 return try cg.accessChain(result_ty_id, object_ptr, &.{field_index});6885 const member_index = cg.memberIndex(object_ty, field_index);
6886 return try cg.accessChain(result_ty_id, object_ptr, &.{member_index});
7162 },6887 },
7163 },6888 },
7164 .@"union" => switch (object_ty.containerLayout(zcu)) {6889 .@"union" => switch (object_ty.containerLayout(zcu)) {
7165 .@"packed" => return cg.todo("implement field access for packed unions", .{}),6890 .@"packed" => return cg.todo("implement field access for packed unions", .{}),
7166 .auto, .@"extern" => {6891 .auto => {
6892 if (!result_ptr_ty.childType(zcu).hasRuntimeBits(zcu)) return try cg.constUndef(result_ty_id);
6893 return try cg.accessChain(result_ty_id, object_ptr, &.{field_index});
6894 },
6895 .@"extern" => {
7167 const layout = cg.unionLayout(object_ty);6896 const layout = cg.unionLayout(object_ty);
7168 if (!layout.has_payload) {6897 if (!layout.has_payload) {
7169 // Asked to get a pointer to a zero-sized field. Just lower this6898 // Asked to get a pointer to a zero-sized field. Just lower this
...@@ -7209,6 +6938,33 @@ fn structFieldPtr(...@@ -7209,6 +6938,33 @@ fn structFieldPtr(
7209 }6938 }
7210}6939}
72116940
6941fn memberIndex(cg: *CodeGen, struct_ty: Type, field_index: u32) u32 {
6942 const zcu = cg.zcu;
6943 const ip = &zcu.intern_pool;
6944 var index: u32 = 0;
6945 switch (ip.indexToKey(struct_ty.toIntern())) {
6946 .tuple_type => |tuple| {
6947 const types = tuple.types.get(ip)[0..field_index];
6948 for (types, tuple.values.get(ip)[0..field_index]) |field_ty_index, field_val| {
6949 const field_ty: Type = .fromInterned(field_ty_index);
6950 if (field_val != .none or !field_ty.hasRuntimeBits(zcu)) continue;
6951 index += 1;
6952 }
6953 },
6954 .struct_type => {
6955 const struct_type = ip.loadStructType(struct_ty.toIntern());
6956 var it = struct_type.iterateRuntimeOrder(ip);
6957 while (it.next()) |i| {
6958 if (i == field_index) break;
6959 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[i]);
6960 if (field_ty.hasRuntimeBits(zcu)) index += 1;
6961 }
6962 },
6963 else => unreachable,
6964 }
6965 return index;
6966}
6967
7212fn airStructFieldPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {6968fn airStructFieldPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
7213 const ty_pl = cg.air.instructions.items(.data)[@backingInt(inst)].ty_pl;6969 const ty_pl = cg.air.instructions.items(.data)[@backingInt(inst)].ty_pl;
7214 const struct_field = cg.air.extraData(Air.StructField, ty_pl.payload).data;6970 const struct_field = cg.air.extraData(Air.StructField, ty_pl.payload).data;
...@@ -7272,7 +7028,7 @@ fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {...@@ -7272,7 +7028,7 @@ fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
72727028
7273fn airArg(cg: *CodeGen) Id {7029fn airArg(cg: *CodeGen) Id {
7274 defer cg.next_arg_index += 1;7030 defer cg.next_arg_index += 1;
7275 return cg.args.items[cg.next_arg_index];7031 return cg.args.items(.id)[cg.next_arg_index];
7276}7032}
72777033
7278/// Given a slice of incoming block connections, returns the block-id of the next7034/// Given a slice of incoming block connections, returns the block-id of the next
...@@ -8669,7 +8425,7 @@ fn airDbgStmt(cg: *CodeGen, inst: Air.Inst.Index) !void {...@@ -8669,7 +8425,7 @@ fn airDbgStmt(cg: *CodeGen, inst: Air.Inst.Index) !void {
8669 if (zcu.comp.config.root_strip) return;8425 if (zcu.comp.config.root_strip) return;
86708426
8671 const path_id = cg.allocId();8427 const path_id = cg.allocId();
8672 try cg.sections.debug_strings.emit(cg.gpa, .OpString, .{8428 try cg.module.emit(cg.gpa, .OpString, .{
8673 .id_result = path_id,8429 .id_result = path_id,
8674 .string = path,8430 .string = path,
8675 });8431 });
...@@ -8942,18 +8698,15 @@ fn builtin3D(...@@ -8942,18 +8698,15 @@ fn builtin3D(
8942 const ptr_ty_id = try cg.ptrType(vec_ty_id, .input);8698 const ptr_ty_id = try cg.ptrType(vec_ty_id, .input);
8943 const builtins_gop = try cg.builtins.getOrPut(gpa, .{ built_in, .input });8699 const builtins_gop = try cg.builtins.getOrPut(gpa, .{ built_in, .input });
8944 if (!builtins_gop.found_existing) {8700 if (!builtins_gop.found_existing) {
8945 builtins_gop.value_ptr.* = try cg.allocDecl(.global);8701 builtins_gop.value_ptr.* = cg.allocId();
8946 const decl = cg.declPtr(builtins_gop.value_ptr.*);8702 try cg.module.emit(gpa, .OpVariable, .{
8947 try cg.sections.globals.emit(gpa, .OpVariable, .{
8948 .id_result_type = ptr_ty_id,8703 .id_result_type = ptr_ty_id,
8949 .id_result = decl.result_id,8704 .id_result = builtins_gop.value_ptr.*,
8950 .storage_class = .input,8705 .storage_class = .input,
8951 });8706 });
8952 try cg.decorate(decl.result_id, .{ .built_in = .{ .built_in = built_in } });8707 try cg.decorate(builtins_gop.value_ptr.*, .{ .built_in = .{ .built_in = built_in } });
8953 }8708 }
8954 const spv_decl_index = builtins_gop.value_ptr.*;8709 const ptr_id = builtins_gop.value_ptr.*;
8955 try cg.decl_deps.append(gpa, spv_decl_index);
8956 const ptr_id = cg.declPtr(spv_decl_index).result_id;
8957 const vec_id = cg.allocId();8710 const vec_id = cg.allocId();
8958 try cg.body.emit(gpa, .OpLoad, .{8711 try cg.body.emit(gpa, .OpLoad, .{
8959 .id_result_type = vec_ty_id,8712 .id_result_type = vec_ty_id,
src/codegen/spirv/Mir.zig+11-43
...@@ -1,71 +1,39 @@...@@ -1,71 +1,39 @@
1const std = @import("std");1const std = @import("std");
2const Allocator = std.mem.Allocator;2const Allocator = std.mem.Allocator;
3
4const spec = @import("spec.zig");3const spec = @import("spec.zig");
5const Word = spec.Word;4const Word = spec.Word;
6const Id = spec.Id;5const Id = spec.Id;
76const Section = @import("Section.zig");
8const InternPool = @import("../../InternPool.zig");7const InternPool = @import("../../InternPool.zig");
9const CodeGen = @import("CodeGen.zig");
10
11const Mir = @This();8const Mir = @This();
129
13id_bound: Word,10id_bound: Word,
14owner_nav: InternPool.Nav.Index,11module: Section,
15kind: CodeGen.Decl.Kind,
16decl_result_id: Id,
17extended_instruction_set: []const Word,
18globals: []const Word,
19functions: []const Word,
20annotations: []const Word,
21debug_names: []const Word,
22debug_strings: []const Word,
23execution_modes: []const Word,
24nav_refs: []const NavRef,12nav_refs: []const NavRef,
25uav_refs: []const UavRef,13externs: []const Extern,
26decl_deps: []const DeclDep,
27internal_globals: []const Id,
28entry_points: []const EntryPoint,14entry_points: []const EntryPoint,
2915
30pub const NavRef = struct {16pub const NavRef = struct {
31 local_id: Id,17 id: Id,
32 nav: InternPool.Nav.Index,18 nav: InternPool.Nav.Index,
33 kind: CodeGen.Decl.Kind,
34};19};
3520
36pub const UavRef = struct {21pub const Extern = struct {
37 local_id: Id,22 id: Id,
38 val: InternPool.Index,23 name: []const u8,
39 storage_class: spec.StorageClass,
40 kind: CodeGen.Decl.Kind,
41};
42
43pub const DeclDep = struct {
44 kind: CodeGen.Decl.Kind,
45 nav: InternPool.Nav.Index,
46};24};
4725
48pub const EntryPoint = struct {26pub const EntryPoint = struct {
49 local_id: Id,27 id: Id,
50 name: []const u8,28 name: []const u8,
51 cc: std.builtin.CallingConvention,29 cc: std.builtin.CallingConvention,
52};30};
5331
54pub fn deinit(mir: *Mir, gpa: Allocator) void {32pub fn deinit(mir: *Mir, gpa: Allocator) void {
55 gpa.free(mir.extended_instruction_set);33 mir.module.deinit(gpa);
56 gpa.free(mir.globals);
57 gpa.free(mir.functions);
58 gpa.free(mir.annotations);
59 gpa.free(mir.debug_names);
60 gpa.free(mir.debug_strings);
61 gpa.free(mir.execution_modes);
62 gpa.free(mir.nav_refs);34 gpa.free(mir.nav_refs);
63 gpa.free(mir.uav_refs);35 gpa.free(mir.externs);
64 gpa.free(mir.decl_deps);36 for (mir.entry_points) |ep| gpa.free(ep.name);
65 gpa.free(mir.internal_globals);
66 for (mir.entry_points) |ep| {
67 gpa.free(ep.name);
68 }
69 gpa.free(mir.entry_points);37 gpa.free(mir.entry_points);
70 mir.* = undefined;38 mir.* = undefined;
71}39}
src/codegen/spirv/Section.zig+278-136
...@@ -1,91 +1,273 @@...@@ -1,91 +1,273 @@
1//! Represents a section or subsection of instructions in a SPIR-V binary. Instructions can be append1//! Represents a section or subsection of instructions in a SPIR-V binary. Instructions can be append
2//! to separate sections, which can then later be merged into the final binary.2//! to separate sections, which can then later be merged into the final binary.
3const Section = @This();
4
5const std = @import("std");3const std = @import("std");
6const Allocator = std.mem.Allocator;4const Allocator = std.mem.Allocator;
7const testing = std.testing;
8
9const spec = @import("spec.zig");5const spec = @import("spec.zig");
6const Opcode = spec.Opcode;
7const InstructionHeader = spec.InstructionHeader;
10const Word = spec.Word;8const Word = spec.Word;
11const DoubleWord = @Int(.unsigned, @bitSizeOf(Word) * 2);9const Id = spec.Id;
12const Log2Word = std.math.Log2Int(Word);10const Section = @This();
1311
14const Opcode = spec.Opcode;12instructions: std.ArrayList(Word),
13ids: std.bit_set.Dynamic,
14
15pub const empty: Section = .{ .instructions = .empty, .ids = .{} };
16
17pub const Error = error{
18 OutOfMemory,
19 UnknownOpcode,
20 InvalidInstruction,
21 InvalidInstructionLength,
22 NestedFunction,
23 UnterminatedFunction,
24 UndefinedId,
25};
26
27pub fn fromWords(gpa: Allocator, words: []const Word, id_bound: Word) Error!Section {
28 var section: Section = .empty;
29 errdefer section.deinit(gpa);
30 try section.writeWords(gpa, words);
31 const type_widths = try gpa.alloc(u16, id_bound);
32 defer gpa.free(type_widths);
33 @memset(type_widths, 0);
34 var instruction_sets: std.array_hash_map.Auto(Word, spec.InstructionSet) = .empty;
35 defer instruction_sets.deinit(gpa);
36 var results: std.bit_set.Dynamic = try .initEmpty(gpa, id_bound);
37 defer results.deinit(gpa);
38
39 var in_function = false;
40 var offset: usize = 0;
41 while (offset < words.len) {
42 const header: InstructionHeader = @bitCast(words[offset]);
43 const len = header.word_count;
44 if (len == 0 or offset + len > words.len) return error.InvalidInstructionLength;
45
46 const inst = words[offset..][0..len];
47 const op = std.enums.fromInt(Opcode, @as(u16, @truncate(inst[0]))) orelse
48 return error.UnknownOpcode;
49 const end = offset + len;
50 var index = offset + 1;
51 const list: []const spec.Operand = switch (op) {
52 .OpFunction => list: {
53 if (in_function) return error.NestedFunction;
54 in_function = true;
55 break :list op.operands();
56 },
57 .OpFunctionEnd => list: {
58 if (!in_function) return error.InvalidInstruction;
59 in_function = false;
60 break :list op.operands();
61 },
62 .OpSpecConstantOp => list: {
63 const prefix = op.operands()[0..2];
64 index = try section.parseOperands(type_widths, offset, end, prefix, index);
65 if (index >= end) return error.InvalidInstruction;
66 const inner = std.enums.fromInt(Opcode, words[index]) orelse
67 return error.InvalidInstruction;
68 index += 1;
69 break :list inner.operands()[2..];
70 },
71 .OpExtInst => list: {
72 if (len < 5) return error.InvalidInstruction;
73 const set = instruction_sets.get(inst[3]) orelse return error.InvalidInstruction;
74 const prefix = op.operands()[0..4];
75 index = try section.parseOperands(type_widths, offset, end, prefix, index);
76 break :list set.operands(inst[4]) orelse return error.InvalidInstruction;
77 },
78 else => op.operands(),
79 };
80 const operands_end = try section.parseOperands(type_widths, offset, end, list, index);
81 if (operands_end != end) return error.InvalidInstruction;
82 if (op.resultIndex()) |result_index| {
83 if (results.isSet(inst[result_index])) return error.InvalidInstruction;
84 results.set(inst[result_index]);
85 }
86
87 switch (op) {
88 .OpTypeInt, .OpTypeFloat => {
89 type_widths[inst[1]] = std.math.cast(u16, inst[2]) orelse
90 return error.InvalidInstruction;
91 },
92 .OpExtInstImport => {
93 const set_name = std.mem.sliceTo(std.mem.sliceAsBytes(inst[2..]), 0);
94 if (std.meta.stringToEnum(spec.InstructionSet, set_name)) |set| {
95 if (set != .core) try instruction_sets.put(gpa, inst[1], set);
96 }
97 },
98 else => if (op.resultIndex() == 2) {
99 type_widths[inst[2]] = type_widths[inst[1]];
100 },
101 }
102 offset = end;
103 }
104 if (in_function) return error.UnterminatedFunction;
105 var it = section.ids.iterator(.{});
106 while (it.next()) |index| {
107 if (!results.isSet(section.instructions.items[index])) return error.UndefinedId;
108 }
15109
16instructions: std.ArrayList(Word) = .empty,110 return section;
111}
17112
18pub fn deinit(section: *Section, allocator: Allocator) void {113pub fn deinit(section: *Section, gpa: Allocator) void {
19 section.instructions.deinit(allocator);114 section.instructions.deinit(gpa);
115 section.ids.deinit(gpa);
20 section.* = undefined;116 section.* = undefined;
21}117}
22118
23pub fn reset(section: *Section) void {119pub fn reset(section: *Section) void {
24 section.instructions.clearRetainingCapacity();120 section.instructions.clearRetainingCapacity();
121 section.ids.unsetAll();
25}122}
26123
27pub fn toWords(section: Section) []Word {124pub fn append(section: *Section, gpa: Allocator, other: Section) error{OutOfMemory}!void {
28 return section.instructions.items;125 const offset = section.instructions.items.len;
126 try section.writeWords(gpa, other.instructions.items);
127 var it = other.ids.iterator(.{});
128 while (it.next()) |index| section.ids.set(offset + index);
29}129}
30130
31/// Append the instructions from another section into this section.131pub fn ensureUnusedCapacity(section: *Section, gpa: Allocator, words: usize) !void {
32pub fn append(section: *Section, allocator: Allocator, other_section: Section) !void {132 try section.instructions.ensureUnusedCapacity(gpa, words);
33 try section.instructions.appendSlice(allocator, other_section.instructions.items);133 try section.ids.resize(gpa, section.instructions.capacity, false);
34}134}
35135
36pub fn ensureUnusedCapacity(136fn parseOperands(
37 section: *Section,137 section: *Section,
38 allocator: Allocator,138 type_widths: []const u16,
39 words: usize,139 inst_start: usize,
40) !void {140 inst_end: usize,
41 try section.instructions.ensureUnusedCapacity(allocator, words);141 operands: []const spec.Operand,
142 index: usize,
143) Error!usize {
144 const words = section.instructions.items;
145 var next = index;
146 var lists: [16][]const spec.Operand = undefined;
147 lists[0] = operands;
148 var depth: usize = 1;
149 while (depth > 0) {
150 const list = &lists[depth - 1];
151 if (list.len == 0) {
152 depth -= 1;
153 continue;
154 }
155 const entry = list.*[0];
156 if (next >= inst_end) {
157 if (entry.quantifier == .required) return error.InvalidInstruction;
158 list.* = &.{};
159 continue;
160 }
161 if (entry.quantifier != .variadic) list.* = list.*[1..];
162 const single = [_]spec.OperandKind{entry.kind};
163 const kinds: []const spec.OperandKind = switch (entry.kind.category()) {
164 .composite => entry.kind.bases(),
165 else => &single,
166 };
167 for (kinds) |base| {
168 if (next >= inst_end) return error.InvalidInstruction;
169 const is_pair_literal = entry.kind == .pair_literal_integer_id_ref;
170 const kind: spec.OperandKind = if (is_pair_literal and base == .literal_integer)
171 .literal_context_dependent_number
172 else
173 base;
174 switch (kind.category()) {
175 .id => {
176 if (words[next] == 0 or words[next] >= type_widths.len) {
177 return error.InvalidInstruction;
178 }
179 section.ids.set(next);
180 next += 1;
181 },
182 .literal => switch (kind) {
183 .literal_string => {
184 next = for (words[next..inst_end], next + 1..) |word, after| {
185 const bytes: [4]u8 = @bitCast(word);
186 if (std.mem.findScalar(u8, &bytes, 0) != null) break after;
187 } else return error.InvalidInstruction;
188 },
189 .literal_context_dependent_number => {
190 next += switch (type_widths[words[inst_start + 1]]) {
191 1...32 => 1,
192 33...64 => 2,
193 else => return error.InvalidInstruction,
194 };
195 if (next > inst_end) return error.InvalidInstruction;
196 },
197 .literal_spec_constant_op_integer => unreachable,
198 else => next += 1,
199 },
200 .value_enum => {
201 const enumerant = for (kind.enumerants()) |enumerant| {
202 if (enumerant.value == words[next]) break enumerant;
203 } else return error.InvalidInstruction;
204 next += 1;
205 if (enumerant.parameters.len != 0) {
206 if (depth == lists.len) return error.InvalidInstruction;
207 lists[depth] = enumerant.parameters;
208 depth += 1;
209 }
210 },
211 .bit_enum => {
212 const mask = words[next];
213 next += 1;
214 const enumerants = kind.enumerants();
215 var i = enumerants.len;
216 while (i > 0) {
217 i -= 1;
218 const enumerant = enumerants[i];
219 if (mask & enumerant.value == 0) continue;
220 if (enumerant.parameters.len == 0) continue;
221 if (depth == lists.len) return error.InvalidInstruction;
222 lists[depth] = enumerant.parameters;
223 depth += 1;
224 }
225 },
226 .composite => unreachable,
227 }
228 }
229 }
230 return next;
42}231}
43232
44/// Write an instruction and size, operands are to be inserted manually.
45pub fn emitRaw(233pub fn emitRaw(
46 section: *Section,234 section: *Section,
47 allocator: Allocator,235 gpa: Allocator,
48 opcode: Opcode,236 opcode: Opcode,
49 operand_words: usize,237 operand_words: usize,
50) !void {238) !void {
51 const word_count = 1 + operand_words;239 const word_count = 1 + operand_words;
52 if (word_count > std.math.maxInt(u16)) return error.OutOfMemory;240 if (word_count > std.math.maxInt(u16)) return error.OutOfMemory;
53 try section.instructions.ensureUnusedCapacity(allocator, word_count);241 try section.ensureUnusedCapacity(gpa, word_count);
54 section.writeWord((@as(Word, @intCast(word_count)) << 16) | @backingInt(opcode));242 const header: InstructionHeader = .{ .opcode = opcode, .word_count = @intCast(word_count) };
55}243 section.writeWord(@bitCast(header));
56
57/// Write an entire instruction, including all operands
58pub fn emitRawInstruction(
59 section: *Section,
60 allocator: Allocator,
61 opcode: Opcode,
62 operands: []const Word,
63) !void {
64 try section.emitRaw(allocator, opcode, operands.len);
65 section.writeWords(operands);
66}244}
67245
68pub fn emitAssumeCapacity(246pub fn emitFormatted(
69 section: *Section,247 section: *Section,
70 comptime opcode: spec.Opcode,248 gpa: Allocator,
71 operands: opcode.Operands(),249 comptime opcode: Opcode,
250 ids: []const Id,
251 comptime fmt: []const u8,
252 args: anytype,
72) !void {253) !void {
73 const word_count = instructionSize(opcode, operands);254 const len = std.fmt.count(fmt, args);
74 if (word_count > std.math.maxInt(u16)) return error.OutOfMemory;255 const string_words = len / @sizeOf(Word) + 1;
75 section.writeWord((@as(Word, @intCast(word_count)) << 16) | @backingInt(opcode));256 try section.emitRaw(gpa, opcode, ids.len + string_words);
76 section.writeOperands(opcode.Operands(), operands);257 for (ids) |id| section.writeId(id);
258 const words = section.instructions.addManyAsSliceAssumeCapacity(string_words);
259 @memset(words, 0);
260 _ = std.fmt.bufPrint(std.mem.sliceAsBytes(words), fmt, args) catch unreachable;
261 for (words) |*word| word.* = std.mem.littleToNative(Word, word.*);
77}262}
78263
79pub fn emit(264pub fn emit(
80 section: *Section,265 section: *Section,
81 allocator: Allocator,266 gpa: Allocator,
82 comptime opcode: spec.Opcode,267 comptime opcode: spec.Opcode,
83 operands: opcode.Operands(),268 operands: opcode.Operands(),
84) !void {269) !void {
85 const word_count = instructionSize(opcode, operands);270 try section.emitRaw(gpa, opcode, opcode.instructionSize(operands) - 1);
86 if (word_count > std.math.maxInt(u16)) return error.OutOfMemory;
87 try section.instructions.ensureUnusedCapacity(allocator, word_count);
88 section.writeWord((@as(Word, @intCast(word_count)) << 16) | @backingInt(opcode));
89 section.writeOperands(opcode.Operands(), operands);271 section.writeOperands(opcode.Operands(), operands);
90}272}
91273
...@@ -93,18 +275,26 @@ pub fn writeWord(section: *Section, word: Word) void {...@@ -93,18 +275,26 @@ pub fn writeWord(section: *Section, word: Word) void {
93 section.instructions.appendAssumeCapacity(word);275 section.instructions.appendAssumeCapacity(word);
94}276}
95277
96pub fn writeWords(section: *Section, words: []const Word) void {278pub fn writeWords(section: *Section, gpa: Allocator, words: []const Word) error{OutOfMemory}!void {
279 try section.ensureUnusedCapacity(gpa, words.len);
97 section.instructions.appendSliceAssumeCapacity(words);280 section.instructions.appendSliceAssumeCapacity(words);
98}281}
99282
283pub const DoubleWord = @Int(.unsigned, @bitSizeOf(Word) * 2);
284
100pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {285pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {
101 section.writeWords(&.{286 section.instructions.appendSliceAssumeCapacity(&.{
102 @truncate(dword),287 @truncate(dword),
103 @truncate(dword >> @bitSizeOf(Word)),288 @truncate(dword >> @bitSizeOf(Word)),
104 });289 });
105}290}
106291
107fn writeOperands(section: *Section, comptime Operands: type, operands: Operands) void {292pub fn writeId(section: *Section, id: Id) void {
293 section.ids.set(section.instructions.items.len);
294 section.instructions.appendAssumeCapacity(@backingInt(id));
295}
296
297pub fn writeOperands(section: *Section, comptime Operands: type, operands: Operands) void {
108 const info = switch (@typeInfo(Operands)) {298 const info = switch (@typeInfo(Operands)) {
109 .@"struct" => |info| info,299 .@"struct" => |info| info,
110 .void => return,300 .void => return,
...@@ -118,19 +308,28 @@ fn writeOperands(section: *Section, comptime Operands: type, operands: Operands)...@@ -118,19 +308,28 @@ fn writeOperands(section: *Section, comptime Operands: type, operands: Operands)
118pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand) void {308pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand) void {
119 switch (Operand) {309 switch (Operand) {
120 spec.LiteralSpecConstantOpInteger => unreachable,310 spec.LiteralSpecConstantOpInteger => unreachable,
121 spec.Id => section.writeWord(@backingInt(operand)),311 spec.Id => section.writeId(operand),
122 spec.LiteralInteger => section.writeWord(operand),312 spec.LiteralInteger => section.writeWord(operand),
123 spec.LiteralString => section.writeString(operand),313 spec.LiteralString => section.writeString(operand),
124 spec.LiteralContextDependentNumber => section.writeContextDependentNumber(operand),314 spec.LiteralContextDependentNumber => section.writeNumber(operand),
125 spec.LiteralExtInstInteger => section.writeWord(operand.inst),315 spec.LiteralExtInstInteger => section.writeWord(operand.inst),
126 spec.PairLiteralIntegerIdRef => section.writeWords(&.{ operand.value, @fromBackingInt(@intCast(operand.label)) }),316 spec.PairLiteralIntegerIdRef => {
127 spec.PairIdRefLiteralInteger => section.writeWords(&.{ @backingInt(operand.target), operand.member }),317 section.writeWord(operand.value);
128 spec.PairIdRefIdRef => section.writeWords(&.{ @backingInt(operand[0]), @backingInt(operand[1]) }),318 section.writeId(operand.label);
319 },
320 spec.PairIdRefLiteralInteger => {
321 section.writeId(operand.target);
322 section.writeWord(operand.member);
323 },
324 spec.PairIdRefIdRef => {
325 section.writeId(operand[0]);
326 section.writeId(operand[1]);
327 },
129 else => switch (@typeInfo(Operand)) {328 else => switch (@typeInfo(Operand)) {
130 .@"enum" => section.writeWord(@backingInt(operand)),329 .@"enum" => section.writeWord(@backingInt(operand)),
131 .optional => |info| if (operand) |child| section.writeOperand(info.child, child),330 .optional => |info| if (operand) |child| section.writeOperand(info.child, child),
132 .pointer => |info| {331 .pointer => |info| {
133 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.332 std.debug.assert(info.size == .slice);
134 for (operand) |item| {333 for (operand) |item| {
135 section.writeOperand(info.child, item);334 section.writeOperand(info.child, item);
136 }335 }
...@@ -148,20 +347,21 @@ pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand)...@@ -148,20 +347,21 @@ pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand)
148 }347 }
149}348}
150349
151fn writeString(section: *Section, str: []const u8) void {350pub fn writeString(section: *Section, str: []const u8) void {
152 const zero_terminated_len = str.len + 1;351 const zero_terminated_len = str.len + 1;
153 var i: usize = 0;352 var i: usize = 0;
154 while (i < zero_terminated_len) : (i += @sizeOf(Word)) {353 while (i < zero_terminated_len) : (i += @sizeOf(Word)) {
155 var word: Word = 0;354 var word: Word = 0;
156 var j: usize = 0;355 var j: usize = 0;
157 while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) {356 while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) {
158 word |= @as(Word, str[i + j]) << @as(Log2Word, @intCast(j * @bitSizeOf(u8)));357 const shift: std.math.Log2Int(Word) = @intCast(j * @bitSizeOf(u8));
358 word |= @as(Word, str[i + j]) << shift;
159 }359 }
160 section.instructions.appendAssumeCapacity(word);360 section.instructions.appendAssumeCapacity(word);
161 }361 }
162}362}
163363
164fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDependentNumber) void {364pub fn writeNumber(section: *Section, operand: spec.LiteralContextDependentNumber) void {
165 switch (operand) {365 switch (operand) {
166 .int32 => |int| section.writeWord(@bitCast(int)),366 .int32 => |int| section.writeWord(@bitCast(int)),
167 .uint32 => |int| section.writeWord(@bitCast(int)),367 .uint32 => |int| section.writeWord(@bitCast(int)),
...@@ -172,17 +372,23 @@ fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDe...@@ -172,17 +372,23 @@ fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDe
172 }372 }
173}373}
174374
175fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {375pub fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {
176 var mask: Word = 0;376 var mask: Word = 0;
177 const info = @typeInfo(Operand).@"struct";377 const info = @typeInfo(Operand).@"struct";
178 inline for (info.field_names, info.field_types, 0..) |field_name, field_type, bit| {378 comptime var bit: usize = 0;
379 inline for (info.field_names, info.field_types) |field_name, field_type| {
179 switch (@typeInfo(field_type)) {380 switch (@typeInfo(field_type)) {
180 .optional => if (@field(operand, field_name) != null) {381 .optional => {
181 mask |= 1 << @as(u5, @intCast(bit));382 if (@field(operand, field_name) != null) {
383 mask |= @as(Word, 1) << @intCast(bit);
384 }
385 bit += 1;
182 },386 },
183 .bool => if (@field(operand, field_name)) {387 .bool => {
184 mask |= 1 << @as(u5, @intCast(bit));388 if (@field(operand, field_name)) mask |= @as(Word, 1) << @intCast(bit);
389 bit += 1;
185 },390 },
391 .int => bit += @bitSizeOf(field_type),
186 else => unreachable,392 else => unreachable,
187 }393 }
188 }394 }
...@@ -191,86 +397,22 @@ fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand...@@ -191,86 +397,22 @@ fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand
191397
192 inline for (info.field_names, info.field_types) |field_name, field_type| {398 inline for (info.field_names, info.field_types) |field_name, field_type| {
193 switch (@typeInfo(field_type)) {399 switch (@typeInfo(field_type)) {
194 .optional => |opt_info| if (@field(operand, field_name)) |child| {400 .optional => |opt_info| {
195 section.writeOperands(opt_info.child, child);401 if (@field(operand, field_name)) |child| {
402 section.writeOperands(opt_info.child, child);
403 }
196 },404 },
197 .bool => {},405 .bool, .int => {},
198 else => unreachable,406 else => unreachable,
199 }407 }
200 }408 }
201}409}
202410
203fn writeExtendedUnion(section: *Section, comptime Operand: type, operand: Operand) void {411pub fn writeExtendedUnion(section: *Section, comptime Operand: type, operand: Operand) void {
204 return switch (operand) {412 return switch (operand) {
205 inline else => |op, tag| {413 inline else => |op, tag| {
206 section.writeWord(@backingInt(tag));414 section.writeWord(@backingInt(tag));
207 section.writeOperands(415 section.writeOperands(@FieldType(Operand, @tagName(tag)), op);
208 @FieldType(Operand, @tagName(tag)),
209 op,
210 );
211 },
212 };
213}
214
215fn instructionSize(comptime opcode: spec.Opcode, operands: opcode.Operands()) usize {
216 return operandsSize(opcode.Operands(), operands) + 1;
217}
218
219fn operandsSize(comptime Operands: type, operands: Operands) usize {
220 const info = switch (@typeInfo(Operands)) {
221 .@"struct" => |info| info,
222 .void => return 0,
223 else => unreachable,
224 };
225
226 var total: usize = 0;
227 inline for (info.field_names, info.field_types) |field_name, field_type| {
228 total += operandSize(field_type, @field(operands, field_name));
229 }
230
231 return total;
232}
233
234fn operandSize(comptime Operand: type, operand: Operand) usize {
235 return switch (Operand) {
236 spec.LiteralSpecConstantOpInteger => unreachable,
237 spec.Id, spec.LiteralInteger, spec.LiteralExtInstInteger => 1,
238 spec.LiteralString => @divCeil(operand.len + 1, @sizeOf(Word)),
239 spec.LiteralContextDependentNumber => switch (operand) {
240 .int32, .uint32, .float32 => 1,
241 .int64, .uint64, .float64 => 2,
242 },
243 spec.PairLiteralIntegerIdRef, spec.PairIdRefLiteralInteger, spec.PairIdRefIdRef => 2,
244 else => switch (@typeInfo(Operand)) {
245 .@"enum" => 1,
246 .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
247 .pointer => |info| blk: {
248 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
249 var total: usize = 0;
250 for (operand) |item| {
251 total += operandSize(info.child, item);
252 }
253 break :blk total;
254 },
255 .@"struct" => |struct_info| {
256 if (struct_info.layout == .@"packed") return 1;
257
258 var total: usize = 0;
259 inline for (struct_info.field_names, struct_info.field_types) |field_name, field_type| {
260 switch (@typeInfo(field_type)) {
261 .optional => |info| if (@field(operand, field_name)) |child| {
262 total += operandsSize(info.child, child);
263 },
264 .bool => {},
265 else => unreachable,
266 }
267 }
268 return total + 1; // Add one for the mask itself.
269 },
270 .@"union" => switch (operand) {
271 inline else => |op, tag| operandsSize(@FieldType(Operand, @tagName(tag)), op) + 1,
272 },
273 else => unreachable,
274 },416 },
275 };417 };
276}418}
src/codegen/spirv/extinst.zig.grammar.json deleted-11
...@@ -1,11 +0,0 @@
1{
2 "version": 0,
3 "revision": 0,
4 "instructions": [
5 {
6 "opname": "InvocationGlobal",
7 "opcode": 0,
8 "operands": [{ "kind": "IdRef", "name": "initializer function" }]
9 }
10 ]
11}
src/codegen/spirv/spec.zig+1233-13802
...@@ -1,31 +1,39 @@...@@ -1,31 +1,39 @@
1//! This file is auto-generated by tools/gen_spirv_spec.zig.1//! This file is auto-generated by tools/gen_spirv_spec.zig.
2
3const std = @import("std");2const std = @import("std");
43
4pub const Word = u32;
5pub const Version = packed struct(Word) {5pub const Version = packed struct(Word) {
6 padding: u8 = 0,6 padding: u8 = 0,
7 minor: u8,7 minor: u8,
8 major: u8,8 major: u8,
9 padding0: u8 = 0,9 padding0: u8 = 0,
10
11 pub fn toWord(self: @This()) Word {
12 return @bitCast(self);
13 }
14};10};
1511pub const Generator = packed struct(Word) {
16pub const Word = u32;12 version: u16,
13 tool: u16,
14};
15pub const Header = extern struct {
16 magic: Word,
17 version: Version,
18 generator: Generator,
19 id_bound: Word,
20 schema: Word,
21};
22pub const InstructionHeader = packed struct(Word) {
23 opcode: Opcode,
24 word_count: u16,
25};
17pub const Id = enum(Word) {26pub const Id = enum(Word) {
18 none,27 none,
19 _,28 _,
2029
21 pub fn format(self: Id, writer: *std.Io.Writer) std.Io.Writer.Error!void {30 pub fn format(id: Id, writer: *std.Io.Writer) std.Io.Writer.Error!void {
22 switch (self) {31 switch (id) {
23 .none => try writer.writeAll("(none)"),32 .none => try writer.writeAll("(none)"),
24 else => try writer.print("%{d}", .{@backingInt(self)}),33 else => try writer.print("%{d}", .{@backingInt(id)}),
25 }34 }
26 }35 }
27};36};
28
29pub const IdRange = struct {37pub const IdRange = struct {
30 base: u32,38 base: u32,
31 len: u32,39 len: u32,
...@@ -37,7 +45,6 @@ pub const IdRange = struct {...@@ -37,7 +45,6 @@ pub const IdRange = struct {
37};45};
3846
39pub const LiteralInteger = Word;47pub const LiteralInteger = Word;
40pub const LiteralFloat = Word;
41pub const LiteralString = []const u8;48pub const LiteralString = []const u8;
42pub const LiteralContextDependentNumber = union(enum) {49pub const LiteralContextDependentNumber = union(enum) {
43 int32: i32,50 int32: i32,
...@@ -61,7 +68,7 @@ pub const Quantifier = enum {...@@ -61,7 +68,7 @@ pub const Quantifier = enum {
6168
62pub const Operand = struct {69pub const Operand = struct {
63 kind: OperandKind,70 kind: OperandKind,
64 quantifier: Quantifier,71 quantifier: Quantifier = .required,
65};72};
6673
67pub const OperandCategory = enum {74pub const OperandCategory = enum {
...@@ -75,16 +82,10 @@ pub const OperandCategory = enum {...@@ -75,16 +82,10 @@ pub const OperandCategory = enum {
75pub const Enumerant = struct {82pub const Enumerant = struct {
76 name: []const u8,83 name: []const u8,
77 value: Word,84 value: Word,
78 parameters: []const OperandKind,85 parameters: []const Operand,
79};
80
81pub const Instruction = struct {
82 name: []const u8,
83 opcode: Word,
84 operands: []const Operand,
85};86};
8687
87pub const zig_generator_id: Word = 41;88pub const zig_generator_id: u16 = 41;
88pub const version: Version = .{ .major = 1, .minor = 6, .patch = 4 };89pub const version: Version = .{ .major = 1, .minor = 6, .patch = 4 };
89pub const magic_number: Word = 0x07230203;90pub const magic_number: Word = 0x07230203;
9091
...@@ -113,8 +114,6 @@ pub const Class = enum {...@@ -113,8 +114,6 @@ pub const Class = enum {
113 pipe,114 pipe,
114 device_side_enqueue,115 device_side_enqueue,
115 non_uniform,116 non_uniform,
116 tensor,
117 graph,
118 reserved,117 reserved,
119};118};
120119
...@@ -192,8 +191,8 @@ pub const OperandKind = enum {...@@ -192,8 +191,8 @@ pub const OperandKind = enum {
192 pair_id_ref_id_ref,191 pair_id_ref_id_ref,
193 tensor_operands,192 tensor_operands,
194193
195 pub fn category(self: OperandKind) OperandCategory {194 pub fn category(operand_kind: OperandKind) OperandCategory {
196 return switch (self) {195 return switch (operand_kind) {
197 .opcode => .literal,196 .opcode => .literal,
198 .image_operands => .bit_enum,197 .image_operands => .bit_enum,
199 .fp_fast_math_mode => .bit_enum,198 .fp_fast_math_mode => .bit_enum,
...@@ -268,26 +267,26 @@ pub const OperandKind = enum {...@@ -268,26 +267,26 @@ pub const OperandKind = enum {
268 .tensor_operands => .bit_enum,267 .tensor_operands => .bit_enum,
269 };268 };
270 }269 }
271 pub fn enumerants(self: OperandKind) []const Enumerant {270 pub fn enumerants(operand_kind: OperandKind) []const Enumerant {
272 return switch (self) {271 return switch (operand_kind) {
273 .opcode => unreachable,272 .opcode => unreachable,
274 .image_operands => &.{273 .image_operands => &.{
275 .{ .name = "Bias", .value = 0x0001, .parameters = &.{.id_ref} },274 .{ .name = "Bias", .value = 0x0001, .parameters = &.{.{ .kind = .id_ref }} },
276 .{ .name = "Lod", .value = 0x0002, .parameters = &.{.id_ref} },275 .{ .name = "Lod", .value = 0x0002, .parameters = &.{.{ .kind = .id_ref }} },
277 .{ .name = "Grad", .value = 0x0004, .parameters = &.{ .id_ref, .id_ref } },276 .{ .name = "Grad", .value = 0x0004, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } } },
278 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &.{.id_ref} },277 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &.{.{ .kind = .id_ref }} },
279 .{ .name = "Offset", .value = 0x0010, .parameters = &.{.id_ref} },278 .{ .name = "Offset", .value = 0x0010, .parameters = &.{.{ .kind = .id_ref }} },
280 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &.{.id_ref} },279 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &.{.{ .kind = .id_ref }} },
281 .{ .name = "Sample", .value = 0x0040, .parameters = &.{.id_ref} },280 .{ .name = "Sample", .value = 0x0040, .parameters = &.{.{ .kind = .id_ref }} },
282 .{ .name = "MinLod", .value = 0x0080, .parameters = &.{.id_ref} },281 .{ .name = "MinLod", .value = 0x0080, .parameters = &.{.{ .kind = .id_ref }} },
283 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &.{.id_scope} },282 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &.{.{ .kind = .id_scope }} },
284 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &.{.id_scope} },283 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &.{.{ .kind = .id_scope }} },
285 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &.{} },284 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &.{} },
286 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &.{} },285 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &.{} },
287 .{ .name = "SignExtend", .value = 0x1000, .parameters = &.{} },286 .{ .name = "SignExtend", .value = 0x1000, .parameters = &.{} },
288 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &.{} },287 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &.{} },
289 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &.{} },288 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &.{} },
290 .{ .name = "Offsets", .value = 0x10000, .parameters = &.{.id_ref} },289 .{ .name = "Offsets", .value = 0x10000, .parameters = &.{.{ .kind = .id_ref }} },
291 },290 },
292 .fp_fast_math_mode => &.{291 .fp_fast_math_mode => &.{
293 .{ .name = "NotNaN", .value = 0x0001, .parameters = &.{} },292 .{ .name = "NotNaN", .value = 0x0001, .parameters = &.{} },
...@@ -307,22 +306,12 @@ pub const OperandKind = enum {...@@ -307,22 +306,12 @@ pub const OperandKind = enum {
307 .{ .name = "Unroll", .value = 0x0001, .parameters = &.{} },306 .{ .name = "Unroll", .value = 0x0001, .parameters = &.{} },
308 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &.{} },307 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &.{} },
309 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &.{} },308 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &.{} },
310 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &.{.literal_integer} },309 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &.{.{ .kind = .literal_integer }} },
311 .{ .name = "MinIterations", .value = 0x0010, .parameters = &.{.literal_integer} },310 .{ .name = "MinIterations", .value = 0x0010, .parameters = &.{.{ .kind = .literal_integer }} },
312 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &.{.literal_integer} },311 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &.{.{ .kind = .literal_integer }} },
313 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &.{.literal_integer} },312 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &.{.{ .kind = .literal_integer }} },
314 .{ .name = "PeelCount", .value = 0x0080, .parameters = &.{.literal_integer} },313 .{ .name = "PeelCount", .value = 0x0080, .parameters = &.{.{ .kind = .literal_integer }} },
315 .{ .name = "PartialCount", .value = 0x0100, .parameters = &.{.literal_integer} },314 .{ .name = "PartialCount", .value = 0x0100, .parameters = &.{.{ .kind = .literal_integer }} },
316 .{ .name = "InitiationIntervalALTERA", .value = 0x10000, .parameters = &.{.literal_integer} },
317 .{ .name = "MaxConcurrencyALTERA", .value = 0x20000, .parameters = &.{.literal_integer} },
318 .{ .name = "DependencyArrayALTERA", .value = 0x40000, .parameters = &.{.literal_integer} },
319 .{ .name = "PipelineEnableALTERA", .value = 0x80000, .parameters = &.{.literal_integer} },
320 .{ .name = "LoopCoalesceALTERA", .value = 0x100000, .parameters = &.{.literal_integer} },
321 .{ .name = "MaxInterleavingALTERA", .value = 0x200000, .parameters = &.{.literal_integer} },
322 .{ .name = "SpeculatedIterationsALTERA", .value = 0x400000, .parameters = &.{.literal_integer} },
323 .{ .name = "NoFusionALTERA", .value = 0x800000, .parameters = &.{} },
324 .{ .name = "LoopCountALTERA", .value = 0x1000000, .parameters = &.{.literal_integer} },
325 .{ .name = "MaxReinvocationDelayALTERA", .value = 0x2000000, .parameters = &.{.literal_integer} },
326 },315 },
327 .function_control => &.{316 .function_control => &.{
328 .{ .name = "Inline", .value = 0x0001, .parameters = &.{} },317 .{ .name = "Inline", .value = 0x0001, .parameters = &.{} },
...@@ -350,13 +339,11 @@ pub const OperandKind = enum {...@@ -350,13 +339,11 @@ pub const OperandKind = enum {
350 },339 },
351 .memory_access => &.{340 .memory_access => &.{
352 .{ .name = "Volatile", .value = 0x0001, .parameters = &.{} },341 .{ .name = "Volatile", .value = 0x0001, .parameters = &.{} },
353 .{ .name = "Aligned", .value = 0x0002, .parameters = &.{.literal_integer} },342 .{ .name = "Aligned", .value = 0x0002, .parameters = &.{.{ .kind = .literal_integer }} },
354 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &.{} },343 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &.{} },
355 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &.{.id_scope} },344 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &.{.{ .kind = .id_scope }} },
356 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &.{.id_scope} },345 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &.{.{ .kind = .id_scope }} },
357 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &.{} },346 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &.{} },
358 .{ .name = "AliasScopeINTELMask", .value = 0x10000, .parameters = &.{.id_ref} },
359 .{ .name = "NoAliasINTELMask", .value = 0x20000, .parameters = &.{.id_ref} },
360 },347 },
361 .kernel_profiling_info => &.{348 .kernel_profiling_info => &.{
362 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &.{} },349 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &.{} },
...@@ -381,10 +368,7 @@ pub const OperandKind = enum {...@@ -381,10 +368,7 @@ pub const OperandKind = enum {
381 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &.{} },368 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &.{} },
382 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &.{} },369 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &.{} },
383 },370 },
384 .raw_access_chain_operands => &.{371 .raw_access_chain_operands => &.{},
385 .{ .name = "RobustnessPerComponentNV", .value = 0x0001, .parameters = &.{} },
386 .{ .name = "RobustnessPerElementNV", .value = 0x0002, .parameters = &.{} },
387 },
388 .source_language => &.{372 .source_language => &.{
389 .{ .name = "Unknown", .value = 0, .parameters = &.{} },373 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
390 .{ .name = "ESSL", .value = 1, .parameters = &.{} },374 .{ .name = "ESSL", .value = 1, .parameters = &.{} },
...@@ -409,8 +393,6 @@ pub const OperandKind = enum {...@@ -409,8 +393,6 @@ pub const OperandKind = enum {
409 .{ .name = "Fragment", .value = 4, .parameters = &.{} },393 .{ .name = "Fragment", .value = 4, .parameters = &.{} },
410 .{ .name = "GLCompute", .value = 5, .parameters = &.{} },394 .{ .name = "GLCompute", .value = 5, .parameters = &.{} },
411 .{ .name = "Kernel", .value = 6, .parameters = &.{} },395 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
412 .{ .name = "TaskNV", .value = 5267, .parameters = &.{} },
413 .{ .name = "MeshNV", .value = 5268, .parameters = &.{} },
414 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &.{} },396 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &.{} },
415 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &.{} },397 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &.{} },
416 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &.{} },398 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &.{} },
...@@ -433,7 +415,7 @@ pub const OperandKind = enum {...@@ -433,7 +415,7 @@ pub const OperandKind = enum {
433 .{ .name = "Vulkan", .value = 3, .parameters = &.{} },415 .{ .name = "Vulkan", .value = 3, .parameters = &.{} },
434 },416 },
435 .execution_mode => &.{417 .execution_mode => &.{
436 .{ .name = "Invocations", .value = 0, .parameters = &.{.literal_integer} },418 .{ .name = "Invocations", .value = 0, .parameters = &.{.{ .kind = .literal_integer }} },
437 .{ .name = "SpacingEqual", .value = 1, .parameters = &.{} },419 .{ .name = "SpacingEqual", .value = 1, .parameters = &.{} },
438 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &.{} },420 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &.{} },
439 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &.{} },421 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &.{} },
...@@ -449,8 +431,8 @@ pub const OperandKind = enum {...@@ -449,8 +431,8 @@ pub const OperandKind = enum {
449 .{ .name = "DepthGreater", .value = 14, .parameters = &.{} },431 .{ .name = "DepthGreater", .value = 14, .parameters = &.{} },
450 .{ .name = "DepthLess", .value = 15, .parameters = &.{} },432 .{ .name = "DepthLess", .value = 15, .parameters = &.{} },
451 .{ .name = "DepthUnchanged", .value = 16, .parameters = &.{} },433 .{ .name = "DepthUnchanged", .value = 16, .parameters = &.{} },
452 .{ .name = "LocalSize", .value = 17, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },434 .{ .name = "LocalSize", .value = 17, .parameters = &.{ .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer } } },
453 .{ .name = "LocalSizeHint", .value = 18, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },435 .{ .name = "LocalSizeHint", .value = 18, .parameters = &.{ .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer } } },
454 .{ .name = "InputPoints", .value = 19, .parameters = &.{} },436 .{ .name = "InputPoints", .value = 19, .parameters = &.{} },
455 .{ .name = "InputLines", .value = 20, .parameters = &.{} },437 .{ .name = "InputLines", .value = 20, .parameters = &.{} },
456 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &.{} },438 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &.{} },
...@@ -458,39 +440,30 @@ pub const OperandKind = enum {...@@ -458,39 +440,30 @@ pub const OperandKind = enum {
458 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &.{} },440 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &.{} },
459 .{ .name = "Quads", .value = 24, .parameters = &.{} },441 .{ .name = "Quads", .value = 24, .parameters = &.{} },
460 .{ .name = "Isolines", .value = 25, .parameters = &.{} },442 .{ .name = "Isolines", .value = 25, .parameters = &.{} },
461 .{ .name = "OutputVertices", .value = 26, .parameters = &.{.literal_integer} },443 .{ .name = "OutputVertices", .value = 26, .parameters = &.{.{ .kind = .literal_integer }} },
462 .{ .name = "OutputPoints", .value = 27, .parameters = &.{} },444 .{ .name = "OutputPoints", .value = 27, .parameters = &.{} },
463 .{ .name = "OutputLineStrip", .value = 28, .parameters = &.{} },445 .{ .name = "OutputLineStrip", .value = 28, .parameters = &.{} },
464 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &.{} },446 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &.{} },
465 .{ .name = "VecTypeHint", .value = 30, .parameters = &.{.literal_integer} },447 .{ .name = "VecTypeHint", .value = 30, .parameters = &.{.{ .kind = .literal_integer }} },
466 .{ .name = "ContractionOff", .value = 31, .parameters = &.{} },448 .{ .name = "ContractionOff", .value = 31, .parameters = &.{} },
467 .{ .name = "Initializer", .value = 33, .parameters = &.{} },449 .{ .name = "Initializer", .value = 33, .parameters = &.{} },
468 .{ .name = "Finalizer", .value = 34, .parameters = &.{} },450 .{ .name = "Finalizer", .value = 34, .parameters = &.{} },
469 .{ .name = "SubgroupSize", .value = 35, .parameters = &.{.literal_integer} },451 .{ .name = "SubgroupSize", .value = 35, .parameters = &.{.{ .kind = .literal_integer }} },
470 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &.{.literal_integer} },452 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &.{.{ .kind = .literal_integer }} },
471 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &.{.id_ref} },453 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &.{.{ .kind = .id_ref }} },
472 .{ .name = "LocalSizeId", .value = 38, .parameters = &.{ .id_ref, .id_ref, .id_ref } },454 .{ .name = "LocalSizeId", .value = 38, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } } },
473 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &.{ .id_ref, .id_ref, .id_ref } },455 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } } },
474 .{ .name = "NonCoherentColorAttachmentReadEXT", .value = 4169, .parameters = &.{} },456 .{ .name = "NonCoherentColorAttachmentReadEXT", .value = 4169, .parameters = &.{} },
475 .{ .name = "NonCoherentDepthAttachmentReadEXT", .value = 4170, .parameters = &.{} },457 .{ .name = "NonCoherentDepthAttachmentReadEXT", .value = 4170, .parameters = &.{} },
476 .{ .name = "NonCoherentStencilAttachmentReadEXT", .value = 4171, .parameters = &.{} },458 .{ .name = "NonCoherentStencilAttachmentReadEXT", .value = 4171, .parameters = &.{} },
477 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &.{} },459 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &.{} },
478 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &.{} },460 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &.{} },
479 .{ .name = "DenormPreserve", .value = 4459, .parameters = &.{.literal_integer} },461 .{ .name = "DenormPreserve", .value = 4459, .parameters = &.{.{ .kind = .literal_integer }} },
480 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &.{.literal_integer} },462 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &.{.{ .kind = .literal_integer }} },
481 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &.{.literal_integer} },463 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &.{.{ .kind = .literal_integer }} },
482 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &.{.literal_integer} },464 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &.{.{ .kind = .literal_integer }} },
483 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &.{.literal_integer} },465 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &.{.{ .kind = .literal_integer }} },
484 .{ .name = "NonCoherentTileAttachmentReadQCOM", .value = 4489, .parameters = &.{} },
485 .{ .name = "TileShadingRateQCOM", .value = 4490, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
486 .{ .name = "EarlyAndLateFragmentTestsAMD", .value = 5017, .parameters = &.{} },
487 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &.{} },466 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &.{} },
488 .{ .name = "CoalescingAMDX", .value = 5069, .parameters = &.{} },
489 .{ .name = "IsApiEntryAMDX", .value = 5070, .parameters = &.{.id_ref} },
490 .{ .name = "MaxNodeRecursionAMDX", .value = 5071, .parameters = &.{.id_ref} },
491 .{ .name = "StaticNumWorkgroupsAMDX", .value = 5072, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
492 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{.id_ref} },
493 .{ .name = "MaxNumWorkgroupsAMDX", .value = 5077, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
494 .{ .name = "StencilRefUnchangedFrontAMD", .value = 5079, .parameters = &.{} },467 .{ .name = "StencilRefUnchangedFrontAMD", .value = 5079, .parameters = &.{} },
495 .{ .name = "StencilRefGreaterFrontAMD", .value = 5080, .parameters = &.{} },468 .{ .name = "StencilRefGreaterFrontAMD", .value = 5080, .parameters = &.{} },
496 .{ .name = "StencilRefLessFrontAMD", .value = 5081, .parameters = &.{} },469 .{ .name = "StencilRefLessFrontAMD", .value = 5081, .parameters = &.{} },
...@@ -499,10 +472,9 @@ pub const OperandKind = enum {...@@ -499,10 +472,9 @@ pub const OperandKind = enum {
499 .{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },472 .{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },
500 .{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },473 .{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },
501 .{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },474 .{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },
502 .{ .name = "SharesInputWithAMDX", .value = 5102, .parameters = &.{ .id_ref, .id_ref } },
503 .{ .name = "ArithmeticPoisonKHR", .value = 5157, .parameters = &.{} },475 .{ .name = "ArithmeticPoisonKHR", .value = 5157, .parameters = &.{} },
504 .{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },476 .{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },
505 .{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.literal_integer} },477 .{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.{ .kind = .literal_integer }} },
506 .{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },478 .{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },
507 .{ .name = "DerivativeGroupLinearKHR", .value = 5290, .parameters = &.{} },479 .{ .name = "DerivativeGroupLinearKHR", .value = 5290, .parameters = &.{} },
508 .{ .name = "OutputTrianglesEXT", .value = 5298, .parameters = &.{} },480 .{ .name = "OutputTrianglesEXT", .value = 5298, .parameters = &.{} },
...@@ -513,24 +485,8 @@ pub const OperandKind = enum {...@@ -513,24 +485,8 @@ pub const OperandKind = enum {
513 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &.{} },485 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &.{} },
514 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &.{} },486 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &.{} },
515 .{ .name = "Shader64BitIndexingEXT", .value = 5427, .parameters = &.{} },487 .{ .name = "Shader64BitIndexingEXT", .value = 5427, .parameters = &.{} },
516 .{ .name = "SharedLocalMemorySizeINTEL", .value = 5618, .parameters = &.{.literal_integer} },
517 .{ .name = "RoundingModeRTPINTEL", .value = 5620, .parameters = &.{.literal_integer} },
518 .{ .name = "RoundingModeRTNINTEL", .value = 5621, .parameters = &.{.literal_integer} },
519 .{ .name = "FloatingPointModeALTINTEL", .value = 5622, .parameters = &.{.literal_integer} },
520 .{ .name = "FloatingPointModeIEEEINTEL", .value = 5623, .parameters = &.{.literal_integer} },
521 .{ .name = "MaxWorkgroupSizeINTEL", .value = 5893, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
522 .{ .name = "MaxWorkDimINTEL", .value = 5894, .parameters = &.{.literal_integer} },
523 .{ .name = "NoGlobalOffsetINTEL", .value = 5895, .parameters = &.{} },
524 .{ .name = "NumSIMDWorkitemsINTEL", .value = 5896, .parameters = &.{.literal_integer} },
525 .{ .name = "SchedulerTargetFmaxMhzINTEL", .value = 5903, .parameters = &.{.literal_integer} },
526 .{ .name = "MaximallyReconvergesKHR", .value = 6023, .parameters = &.{} },488 .{ .name = "MaximallyReconvergesKHR", .value = 6023, .parameters = &.{} },
527 .{ .name = "FPFastMathDefault", .value = 6028, .parameters = &.{ .id_ref, .id_ref } },489 .{ .name = "FPFastMathDefault", .value = 6028, .parameters = &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } } },
528 .{ .name = "StreamingInterfaceINTEL", .value = 6154, .parameters = &.{.literal_integer} },
529 .{ .name = "RegisterMapInterfaceINTEL", .value = 6160, .parameters = &.{.literal_integer} },
530 .{ .name = "NamedBarrierCountINTEL", .value = 6417, .parameters = &.{.literal_integer} },
531 .{ .name = "MaximumRegistersINTEL", .value = 6461, .parameters = &.{.literal_integer} },
532 .{ .name = "MaximumRegistersIdINTEL", .value = 6462, .parameters = &.{.id_ref} },
533 .{ .name = "NamedMaximumRegistersINTEL", .value = 6463, .parameters = &.{.named_maximum_number_of_registers} },
534 },490 },
535 .storage_class => &.{491 .storage_class => &.{
536 .{ .name = "UniformConstant", .value = 0, .parameters = &.{} },492 .{ .name = "UniformConstant", .value = 0, .parameters = &.{} },
...@@ -547,8 +503,6 @@ pub const OperandKind = enum {...@@ -547,8 +503,6 @@ pub const OperandKind = enum {
547 .{ .name = "Image", .value = 11, .parameters = &.{} },503 .{ .name = "Image", .value = 11, .parameters = &.{} },
548 .{ .name = "StorageBuffer", .value = 12, .parameters = &.{} },504 .{ .name = "StorageBuffer", .value = 12, .parameters = &.{} },
549 .{ .name = "TileImageEXT", .value = 4172, .parameters = &.{} },505 .{ .name = "TileImageEXT", .value = 4172, .parameters = &.{} },
550 .{ .name = "TileAttachmentQCOM", .value = 4491, .parameters = &.{} },
551 .{ .name = "NodePayloadAMDX", .value = 5068, .parameters = &.{} },
552 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &.{} },506 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &.{} },
553 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &.{} },507 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &.{} },
554 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &.{} },508 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &.{} },
...@@ -556,12 +510,8 @@ pub const OperandKind = enum {...@@ -556,12 +510,8 @@ pub const OperandKind = enum {
556 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &.{} },510 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &.{} },
557 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &.{} },511 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &.{} },
558 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &.{} },512 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &.{} },
559 .{ .name = "HitObjectAttributeNV", .value = 5385, .parameters = &.{} },
560 .{ .name = "TaskPayloadWorkgroupEXT", .value = 5402, .parameters = &.{} },513 .{ .name = "TaskPayloadWorkgroupEXT", .value = 5402, .parameters = &.{} },
561 .{ .name = "HitObjectAttributeEXT", .value = 5411, .parameters = &.{} },514 .{ .name = "HitObjectAttributeEXT", .value = 5411, .parameters = &.{} },
562 .{ .name = "CodeSectionINTEL", .value = 5605, .parameters = &.{} },
563 .{ .name = "DeviceOnlyALTERA", .value = 5936, .parameters = &.{} },
564 .{ .name = "HostOnlyALTERA", .value = 5937, .parameters = &.{} },
565 },515 },
566 .dim => &.{516 .dim => &.{
567 .{ .name = "1D", .value = 0, .parameters = &.{} },517 .{ .name = "1D", .value = 0, .parameters = &.{} },
...@@ -684,30 +634,10 @@ pub const OperandKind = enum {...@@ -684,30 +634,10 @@ pub const OperandKind = enum {
684 .{ .name = "RTP", .value = 2, .parameters = &.{} },634 .{ .name = "RTP", .value = 2, .parameters = &.{} },
685 .{ .name = "RTN", .value = 3, .parameters = &.{} },635 .{ .name = "RTN", .value = 3, .parameters = &.{} },
686 },636 },
687 .fp_denorm_mode => &.{637 .fp_denorm_mode => &.{},
688 .{ .name = "Preserve", .value = 0, .parameters = &.{} },638 .quantization_modes => &.{},
689 .{ .name = "FlushToZero", .value = 1, .parameters = &.{} },639 .fp_operation_mode => &.{},
690 },640 .overflow_modes => &.{},
691 .quantization_modes => &.{
692 .{ .name = "TRN", .value = 0, .parameters = &.{} },
693 .{ .name = "TRN_ZERO", .value = 1, .parameters = &.{} },
694 .{ .name = "RND", .value = 2, .parameters = &.{} },
695 .{ .name = "RND_ZERO", .value = 3, .parameters = &.{} },
696 .{ .name = "RND_INF", .value = 4, .parameters = &.{} },
697 .{ .name = "RND_MIN_INF", .value = 5, .parameters = &.{} },
698 .{ .name = "RND_CONV", .value = 6, .parameters = &.{} },
699 .{ .name = "RND_CONV_ODD", .value = 7, .parameters = &.{} },
700 },
701 .fp_operation_mode => &.{
702 .{ .name = "IEEE", .value = 0, .parameters = &.{} },
703 .{ .name = "ALT", .value = 1, .parameters = &.{} },
704 },
705 .overflow_modes => &.{
706 .{ .name = "WRAP", .value = 0, .parameters = &.{} },
707 .{ .name = "SAT", .value = 1, .parameters = &.{} },
708 .{ .name = "SAT_ZERO", .value = 2, .parameters = &.{} },
709 .{ .name = "SAT_SYM", .value = 3, .parameters = &.{} },
710 },
711 .linkage_type => &.{641 .linkage_type => &.{
712 .{ .name = "Export", .value = 0, .parameters = &.{} },642 .{ .name = "Export", .value = 0, .parameters = &.{} },
713 .{ .name = "Import", .value = 1, .parameters = &.{} },643 .{ .name = "Import", .value = 1, .parameters = &.{} },
...@@ -718,12 +648,7 @@ pub const OperandKind = enum {...@@ -718,12 +648,7 @@ pub const OperandKind = enum {
718 .{ .name = "WriteOnly", .value = 1, .parameters = &.{} },648 .{ .name = "WriteOnly", .value = 1, .parameters = &.{} },
719 .{ .name = "ReadWrite", .value = 2, .parameters = &.{} },649 .{ .name = "ReadWrite", .value = 2, .parameters = &.{} },
720 },650 },
721 .host_access_qualifier => &.{651 .host_access_qualifier => &.{},
722 .{ .name = "NoneINTEL", .value = 0, .parameters = &.{} },
723 .{ .name = "ReadINTEL", .value = 1, .parameters = &.{} },
724 .{ .name = "WriteINTEL", .value = 2, .parameters = &.{} },
725 .{ .name = "ReadWriteINTEL", .value = 3, .parameters = &.{} },
726 },
727 .function_parameter_attribute => &.{652 .function_parameter_attribute => &.{
728 .{ .name = "Zext", .value = 0, .parameters = &.{} },653 .{ .name = "Zext", .value = 0, .parameters = &.{} },
729 .{ .name = "Sext", .value = 1, .parameters = &.{} },654 .{ .name = "Sext", .value = 1, .parameters = &.{} },
...@@ -737,17 +662,17 @@ pub const OperandKind = enum {...@@ -737,17 +662,17 @@ pub const OperandKind = enum {
737 },662 },
738 .decoration => &.{663 .decoration => &.{
739 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &.{} },664 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &.{} },
740 .{ .name = "SpecId", .value = 1, .parameters = &.{.literal_integer} },665 .{ .name = "SpecId", .value = 1, .parameters = &.{.{ .kind = .literal_integer }} },
741 .{ .name = "Block", .value = 2, .parameters = &.{} },666 .{ .name = "Block", .value = 2, .parameters = &.{} },
742 .{ .name = "BufferBlock", .value = 3, .parameters = &.{} },667 .{ .name = "BufferBlock", .value = 3, .parameters = &.{} },
743 .{ .name = "RowMajor", .value = 4, .parameters = &.{} },668 .{ .name = "RowMajor", .value = 4, .parameters = &.{} },
744 .{ .name = "ColMajor", .value = 5, .parameters = &.{} },669 .{ .name = "ColMajor", .value = 5, .parameters = &.{} },
745 .{ .name = "ArrayStride", .value = 6, .parameters = &.{.literal_integer} },670 .{ .name = "ArrayStride", .value = 6, .parameters = &.{.{ .kind = .literal_integer }} },
746 .{ .name = "MatrixStride", .value = 7, .parameters = &.{.literal_integer} },671 .{ .name = "MatrixStride", .value = 7, .parameters = &.{.{ .kind = .literal_integer }} },
747 .{ .name = "GLSLShared", .value = 8, .parameters = &.{} },672 .{ .name = "GLSLShared", .value = 8, .parameters = &.{} },
748 .{ .name = "GLSLPacked", .value = 9, .parameters = &.{} },673 .{ .name = "GLSLPacked", .value = 9, .parameters = &.{} },
749 .{ .name = "CPacked", .value = 10, .parameters = &.{} },674 .{ .name = "CPacked", .value = 10, .parameters = &.{} },
750 .{ .name = "BuiltIn", .value = 11, .parameters = &.{.built_in} },675 .{ .name = "BuiltIn", .value = 11, .parameters = &.{.{ .kind = .built_in }} },
751 .{ .name = "NoPerspective", .value = 13, .parameters = &.{} },676 .{ .name = "NoPerspective", .value = 13, .parameters = &.{} },
752 .{ .name = "Flat", .value = 14, .parameters = &.{} },677 .{ .name = "Flat", .value = 14, .parameters = &.{} },
753 .{ .name = "Patch", .value = 15, .parameters = &.{} },678 .{ .name = "Patch", .value = 15, .parameters = &.{} },
...@@ -762,130 +687,41 @@ pub const OperandKind = enum {...@@ -762,130 +687,41 @@ pub const OperandKind = enum {
762 .{ .name = "NonWritable", .value = 24, .parameters = &.{} },687 .{ .name = "NonWritable", .value = 24, .parameters = &.{} },
763 .{ .name = "NonReadable", .value = 25, .parameters = &.{} },688 .{ .name = "NonReadable", .value = 25, .parameters = &.{} },
764 .{ .name = "Uniform", .value = 26, .parameters = &.{} },689 .{ .name = "Uniform", .value = 26, .parameters = &.{} },
765 .{ .name = "UniformId", .value = 27, .parameters = &.{.id_scope} },690 .{ .name = "UniformId", .value = 27, .parameters = &.{.{ .kind = .id_scope }} },
766 .{ .name = "SaturatedConversion", .value = 28, .parameters = &.{} },691 .{ .name = "SaturatedConversion", .value = 28, .parameters = &.{} },
767 .{ .name = "Stream", .value = 29, .parameters = &.{.literal_integer} },692 .{ .name = "Stream", .value = 29, .parameters = &.{.{ .kind = .literal_integer }} },
768 .{ .name = "Location", .value = 30, .parameters = &.{.literal_integer} },693 .{ .name = "Location", .value = 30, .parameters = &.{.{ .kind = .literal_integer }} },
769 .{ .name = "Component", .value = 31, .parameters = &.{.literal_integer} },694 .{ .name = "Component", .value = 31, .parameters = &.{.{ .kind = .literal_integer }} },
770 .{ .name = "Index", .value = 32, .parameters = &.{.literal_integer} },695 .{ .name = "Index", .value = 32, .parameters = &.{.{ .kind = .literal_integer }} },
771 .{ .name = "Binding", .value = 33, .parameters = &.{.literal_integer} },696 .{ .name = "Binding", .value = 33, .parameters = &.{.{ .kind = .literal_integer }} },
772 .{ .name = "DescriptorSet", .value = 34, .parameters = &.{.literal_integer} },697 .{ .name = "DescriptorSet", .value = 34, .parameters = &.{.{ .kind = .literal_integer }} },
773 .{ .name = "Offset", .value = 35, .parameters = &.{.literal_integer} },698 .{ .name = "Offset", .value = 35, .parameters = &.{.{ .kind = .literal_integer }} },
774 .{ .name = "XfbBuffer", .value = 36, .parameters = &.{.literal_integer} },699 .{ .name = "XfbBuffer", .value = 36, .parameters = &.{.{ .kind = .literal_integer }} },
775 .{ .name = "XfbStride", .value = 37, .parameters = &.{.literal_integer} },700 .{ .name = "XfbStride", .value = 37, .parameters = &.{.{ .kind = .literal_integer }} },
776 .{ .name = "FuncParamAttr", .value = 38, .parameters = &.{.function_parameter_attribute} },701 .{ .name = "FuncParamAttr", .value = 38, .parameters = &.{.{ .kind = .function_parameter_attribute }} },
777 .{ .name = "FPRoundingMode", .value = 39, .parameters = &.{.fp_rounding_mode} },702 .{ .name = "FPRoundingMode", .value = 39, .parameters = &.{.{ .kind = .fp_rounding_mode }} },
778 .{ .name = "FPFastMathMode", .value = 40, .parameters = &.{.fp_fast_math_mode} },703 .{ .name = "FPFastMathMode", .value = 40, .parameters = &.{.{ .kind = .fp_fast_math_mode }} },
779 .{ .name = "LinkageAttributes", .value = 41, .parameters = &.{ .literal_string, .linkage_type } },704 .{ .name = "LinkageAttributes", .value = 41, .parameters = &.{ .{ .kind = .literal_string }, .{ .kind = .linkage_type } } },
780 .{ .name = "NoContraction", .value = 42, .parameters = &.{} },705 .{ .name = "NoContraction", .value = 42, .parameters = &.{} },
781 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &.{.literal_integer} },706 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &.{.{ .kind = .literal_integer }} },
782 .{ .name = "Alignment", .value = 44, .parameters = &.{.literal_integer} },707 .{ .name = "Alignment", .value = 44, .parameters = &.{.{ .kind = .literal_integer }} },
783 .{ .name = "MaxByteOffset", .value = 45, .parameters = &.{.literal_integer} },708 .{ .name = "MaxByteOffset", .value = 45, .parameters = &.{.{ .kind = .literal_integer }} },
784 .{ .name = "AlignmentId", .value = 46, .parameters = &.{.id_ref} },709 .{ .name = "AlignmentId", .value = 46, .parameters = &.{.{ .kind = .id_ref }} },
785 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &.{.id_ref} },710 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &.{.{ .kind = .id_ref }} },
786 .{ .name = "SaturatedToLargestFloat8NormalConversionEXT", .value = 4216, .parameters = &.{} },711 .{ .name = "SaturatedToLargestFloat8NormalConversionEXT", .value = 4216, .parameters = &.{} },
787 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &.{} },712 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &.{} },
788 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &.{} },713 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &.{} },
789 .{ .name = "WeightTextureQCOM", .value = 4487, .parameters = &.{} },714 .{ .name = "ArrayStrideIdEXT", .value = 5124, .parameters = &.{.{ .kind = .id_ref }} },
790 .{ .name = "BlockMatchTextureQCOM", .value = 4488, .parameters = &.{} },715 .{ .name = "OffsetIdEXT", .value = 5125, .parameters = &.{.{ .kind = .id_ref }} },
791 .{ .name = "BlockMatchSamplerQCOM", .value = 4499, .parameters = &.{} },
792 .{ .name = "ExplicitInterpAMD", .value = 4999, .parameters = &.{} },
793 .{ .name = "NodeSharesPayloadLimitsWithAMDX", .value = 5019, .parameters = &.{.id_ref} },
794 .{ .name = "NodeMaxPayloadsAMDX", .value = 5020, .parameters = &.{.id_ref} },
795 .{ .name = "TrackFinishWritingAMDX", .value = 5078, .parameters = &.{} },
796 .{ .name = "PayloadNodeNameAMDX", .value = 5091, .parameters = &.{.id_ref} },
797 .{ .name = "PayloadNodeBaseIndexAMDX", .value = 5098, .parameters = &.{.id_ref} },
798 .{ .name = "PayloadNodeSparseArrayAMDX", .value = 5099, .parameters = &.{} },
799 .{ .name = "PayloadNodeArraySizeAMDX", .value = 5100, .parameters = &.{.id_ref} },
800 .{ .name = "PayloadDispatchIndirectAMDX", .value = 5105, .parameters = &.{} },
801 .{ .name = "ArrayStrideIdEXT", .value = 5124, .parameters = &.{.id_ref} },
802 .{ .name = "OffsetIdEXT", .value = 5125, .parameters = &.{.id_ref} },
803 .{ .name = "UTFEncodedKHR", .value = 5145, .parameters = &.{} },716 .{ .name = "UTFEncodedKHR", .value = 5145, .parameters = &.{} },
804 .{ .name = "OverrideCoverageNV", .value = 5248, .parameters = &.{} },
805 .{ .name = "PassthroughNV", .value = 5250, .parameters = &.{} },
806 .{ .name = "ViewportRelativeNV", .value = 5252, .parameters = &.{} },
807 .{ .name = "SecondaryViewportRelativeNV", .value = 5256, .parameters = &.{.literal_integer} },
808 .{ .name = "PerPrimitiveEXT", .value = 5271, .parameters = &.{} },717 .{ .name = "PerPrimitiveEXT", .value = 5271, .parameters = &.{} },
809 .{ .name = "PerViewNV", .value = 5272, .parameters = &.{} },
810 .{ .name = "PerTaskNV", .value = 5273, .parameters = &.{} },
811 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &.{} },718 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &.{} },
812 .{ .name = "NonUniform", .value = 5300, .parameters = &.{} },719 .{ .name = "NonUniform", .value = 5300, .parameters = &.{} },
813 .{ .name = "RestrictPointer", .value = 5355, .parameters = &.{} },720 .{ .name = "RestrictPointer", .value = 5355, .parameters = &.{} },
814 .{ .name = "AliasedPointer", .value = 5356, .parameters = &.{} },721 .{ .name = "AliasedPointer", .value = 5356, .parameters = &.{} },
815 .{ .name = "MemberOffsetNV", .value = 5358, .parameters = &.{.literal_integer} },
816 .{ .name = "HitObjectShaderRecordBufferNV", .value = 5386, .parameters = &.{} },
817 .{ .name = "HitObjectShaderRecordBufferEXT", .value = 5389, .parameters = &.{} },722 .{ .name = "HitObjectShaderRecordBufferEXT", .value = 5389, .parameters = &.{} },
818 .{ .name = "BankNV", .value = 5397, .parameters = &.{.literal_integer} },723 .{ .name = "CounterBuffer", .value = 5634, .parameters = &.{.{ .kind = .id_ref }} },
819 .{ .name = "BindlessSamplerNV", .value = 5398, .parameters = &.{} },724 .{ .name = "UserSemantic", .value = 5635, .parameters = &.{.{ .kind = .literal_string }} },
820 .{ .name = "BindlessImageNV", .value = 5399, .parameters = &.{} },
821 .{ .name = "BoundSamplerNV", .value = 5400, .parameters = &.{} },
822 .{ .name = "BoundImageNV", .value = 5401, .parameters = &.{} },
823 .{ .name = "SIMTCallINTEL", .value = 5599, .parameters = &.{.literal_integer} },
824 .{ .name = "ReferencedIndirectlyINTEL", .value = 5602, .parameters = &.{} },
825 .{ .name = "ClobberINTEL", .value = 5607, .parameters = &.{.literal_string} },
826 .{ .name = "SideEffectsINTEL", .value = 5608, .parameters = &.{} },
827 .{ .name = "VectorComputeVariableINTEL", .value = 5624, .parameters = &.{} },
828 .{ .name = "FuncParamIOKindINTEL", .value = 5625, .parameters = &.{.literal_integer} },
829 .{ .name = "VectorComputeFunctionINTEL", .value = 5626, .parameters = &.{} },
830 .{ .name = "StackCallINTEL", .value = 5627, .parameters = &.{} },
831 .{ .name = "GlobalVariableOffsetINTEL", .value = 5628, .parameters = &.{.literal_integer} },
832 .{ .name = "CounterBuffer", .value = 5634, .parameters = &.{.id_ref} },
833 .{ .name = "UserSemantic", .value = 5635, .parameters = &.{.literal_string} },
834 .{ .name = "UserTypeGOOGLE", .value = 5636, .parameters = &.{.literal_string} },
835 .{ .name = "FunctionRoundingModeINTEL", .value = 5822, .parameters = &.{ .literal_integer, .fp_rounding_mode } },
836 .{ .name = "FunctionDenormModeINTEL", .value = 5823, .parameters = &.{ .literal_integer, .fp_denorm_mode } },
837 .{ .name = "RegisterALTERA", .value = 5825, .parameters = &.{} },
838 .{ .name = "MemoryALTERA", .value = 5826, .parameters = &.{.literal_string} },
839 .{ .name = "NumbanksALTERA", .value = 5827, .parameters = &.{.literal_integer} },
840 .{ .name = "BankwidthALTERA", .value = 5828, .parameters = &.{.literal_integer} },
841 .{ .name = "MaxPrivateCopiesALTERA", .value = 5829, .parameters = &.{.literal_integer} },
842 .{ .name = "SinglepumpALTERA", .value = 5830, .parameters = &.{} },
843 .{ .name = "DoublepumpALTERA", .value = 5831, .parameters = &.{} },
844 .{ .name = "MaxReplicatesALTERA", .value = 5832, .parameters = &.{.literal_integer} },
845 .{ .name = "SimpleDualPortALTERA", .value = 5833, .parameters = &.{} },
846 .{ .name = "MergeALTERA", .value = 5834, .parameters = &.{ .literal_string, .literal_string } },
847 .{ .name = "BankBitsALTERA", .value = 5835, .parameters = &.{.literal_integer} },
848 .{ .name = "ForcePow2DepthALTERA", .value = 5836, .parameters = &.{.literal_integer} },
849 .{ .name = "StridesizeALTERA", .value = 5883, .parameters = &.{.literal_integer} },
850 .{ .name = "WordsizeALTERA", .value = 5884, .parameters = &.{.literal_integer} },
851 .{ .name = "TrueDualPortALTERA", .value = 5885, .parameters = &.{} },
852 .{ .name = "BurstCoalesceALTERA", .value = 5899, .parameters = &.{} },
853 .{ .name = "CacheSizeALTERA", .value = 5900, .parameters = &.{.literal_integer} },
854 .{ .name = "DontStaticallyCoalesceALTERA", .value = 5901, .parameters = &.{} },
855 .{ .name = "PrefetchALTERA", .value = 5902, .parameters = &.{.literal_integer} },
856 .{ .name = "StallEnableALTERA", .value = 5905, .parameters = &.{} },
857 .{ .name = "FuseLoopsInFunctionALTERA", .value = 5907, .parameters = &.{} },
858 .{ .name = "MathOpDSPModeALTERA", .value = 5909, .parameters = &.{ .literal_integer, .literal_integer } },
859 .{ .name = "AliasScopeINTEL", .value = 5914, .parameters = &.{.id_ref} },
860 .{ .name = "NoAliasINTEL", .value = 5915, .parameters = &.{.id_ref} },
861 .{ .name = "InitiationIntervalALTERA", .value = 5917, .parameters = &.{.literal_integer} },
862 .{ .name = "MaxConcurrencyALTERA", .value = 5918, .parameters = &.{.literal_integer} },
863 .{ .name = "PipelineEnableALTERA", .value = 5919, .parameters = &.{.literal_integer} },
864 .{ .name = "BufferLocationALTERA", .value = 5921, .parameters = &.{.literal_integer} },
865 .{ .name = "IOPipeStorageALTERA", .value = 5944, .parameters = &.{.literal_integer} },
866 .{ .name = "FunctionFloatingPointModeINTEL", .value = 6080, .parameters = &.{ .literal_integer, .fp_operation_mode } },
867 .{ .name = "SingleElementVectorINTEL", .value = 6085, .parameters = &.{} },
868 .{ .name = "VectorComputeCallableFunctionINTEL", .value = 6087, .parameters = &.{} },
869 .{ .name = "MediaBlockIOINTEL", .value = 6140, .parameters = &.{} },
870 .{ .name = "StallFreeALTERA", .value = 6151, .parameters = &.{} },
871 .{ .name = "FPMaxErrorDecorationINTEL", .value = 6170, .parameters = &.{.literal_float} },
872 .{ .name = "LatencyControlLabelALTERA", .value = 6172, .parameters = &.{.literal_integer} },
873 .{ .name = "LatencyControlConstraintALTERA", .value = 6173, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
874 .{ .name = "ConduitKernelArgumentALTERA", .value = 6175, .parameters = &.{} },
875 .{ .name = "RegisterMapKernelArgumentALTERA", .value = 6176, .parameters = &.{} },
876 .{ .name = "MMHostInterfaceAddressWidthALTERA", .value = 6177, .parameters = &.{.literal_integer} },
877 .{ .name = "MMHostInterfaceDataWidthALTERA", .value = 6178, .parameters = &.{.literal_integer} },
878 .{ .name = "MMHostInterfaceLatencyALTERA", .value = 6179, .parameters = &.{.literal_integer} },
879 .{ .name = "MMHostInterfaceReadWriteModeALTERA", .value = 6180, .parameters = &.{.access_qualifier} },
880 .{ .name = "MMHostInterfaceMaxBurstALTERA", .value = 6181, .parameters = &.{.literal_integer} },
881 .{ .name = "MMHostInterfaceWaitRequestALTERA", .value = 6182, .parameters = &.{.literal_integer} },
882 .{ .name = "StableKernelArgumentALTERA", .value = 6183, .parameters = &.{} },
883 .{ .name = "HostAccessINTEL", .value = 6188, .parameters = &.{ .host_access_qualifier, .literal_string } },
884 .{ .name = "InitModeALTERA", .value = 6190, .parameters = &.{.initialization_mode_qualifier} },
885 .{ .name = "ImplementInRegisterMapALTERA", .value = 6191, .parameters = &.{.literal_integer} },
886 .{ .name = "ConditionalINTEL", .value = 6247, .parameters = &.{.id_ref} },
887 .{ .name = "CacheControlLoadINTEL", .value = 6442, .parameters = &.{ .literal_integer, .load_cache_control } },
888 .{ .name = "CacheControlStoreINTEL", .value = 6443, .parameters = &.{ .literal_integer, .store_cache_control } },
889 },725 },
890 .built_in => &.{726 .built_in => &.{
891 .{ .name = "Position", .value = 0, .parameters = &.{} },727 .{ .name = "Position", .value = 0, .parameters = &.{} },
...@@ -946,35 +782,10 @@ pub const OperandKind = enum {...@@ -946,35 +782,10 @@ pub const OperandKind = enum {
946 .{ .name = "DeviceIndex", .value = 4438, .parameters = &.{} },782 .{ .name = "DeviceIndex", .value = 4438, .parameters = &.{} },
947 .{ .name = "ViewIndex", .value = 4440, .parameters = &.{} },783 .{ .name = "ViewIndex", .value = 4440, .parameters = &.{} },
948 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &.{} },784 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &.{} },
949 .{ .name = "TileOffsetQCOM", .value = 4492, .parameters = &.{} },
950 .{ .name = "TileDimensionQCOM", .value = 4493, .parameters = &.{} },
951 .{ .name = "TileApronSizeQCOM", .value = 4494, .parameters = &.{} },
952 .{ .name = "BaryCoordNoPerspAMD", .value = 4992, .parameters = &.{} },
953 .{ .name = "BaryCoordNoPerspCentroidAMD", .value = 4993, .parameters = &.{} },
954 .{ .name = "BaryCoordNoPerspSampleAMD", .value = 4994, .parameters = &.{} },
955 .{ .name = "BaryCoordSmoothAMD", .value = 4995, .parameters = &.{} },
956 .{ .name = "BaryCoordSmoothCentroidAMD", .value = 4996, .parameters = &.{} },
957 .{ .name = "BaryCoordSmoothSampleAMD", .value = 4997, .parameters = &.{} },
958 .{ .name = "BaryCoordPullModelAMD", .value = 4998, .parameters = &.{} },
959 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &.{} },785 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &.{} },
960 .{ .name = "RemainingRecursionLevelsAMDX", .value = 5021, .parameters = &.{} },
961 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{} },
962 .{ .name = "SamplerHeapEXT", .value = 5122, .parameters = &.{} },786 .{ .name = "SamplerHeapEXT", .value = 5122, .parameters = &.{} },
963 .{ .name = "ResourceHeapEXT", .value = 5123, .parameters = &.{} },787 .{ .name = "ResourceHeapEXT", .value = 5123, .parameters = &.{} },
964 .{ .name = "ViewportMaskNV", .value = 5253, .parameters = &.{} },
965 .{ .name = "SecondaryPositionNV", .value = 5257, .parameters = &.{} },
966 .{ .name = "SecondaryViewportMaskNV", .value = 5258, .parameters = &.{} },
967 .{ .name = "PositionPerViewNV", .value = 5261, .parameters = &.{} },
968 .{ .name = "ViewportMaskPerViewNV", .value = 5262, .parameters = &.{} },
969 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &.{} },788 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &.{} },
970 .{ .name = "TaskCountNV", .value = 5274, .parameters = &.{} },
971 .{ .name = "PrimitiveCountNV", .value = 5275, .parameters = &.{} },
972 .{ .name = "PrimitiveIndicesNV", .value = 5276, .parameters = &.{} },
973 .{ .name = "ClipDistancePerViewNV", .value = 5277, .parameters = &.{} },
974 .{ .name = "CullDistancePerViewNV", .value = 5278, .parameters = &.{} },
975 .{ .name = "LayerPerViewNV", .value = 5279, .parameters = &.{} },
976 .{ .name = "MeshViewCountNV", .value = 5280, .parameters = &.{} },
977 .{ .name = "MeshViewIndicesNV", .value = 5281, .parameters = &.{} },
978 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &.{} },789 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &.{} },
979 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &.{} },790 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &.{} },
980 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &.{} },791 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &.{} },
...@@ -994,27 +805,10 @@ pub const OperandKind = enum {...@@ -994,27 +805,10 @@ pub const OperandKind = enum {
994 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &.{} },805 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &.{} },
995 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &.{} },806 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &.{} },
996 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &.{} },807 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &.{} },
997 .{ .name = "HitTNV", .value = 5332, .parameters = &.{} },
998 .{ .name = "HitKindKHR", .value = 5333, .parameters = &.{} },808 .{ .name = "HitKindKHR", .value = 5333, .parameters = &.{} },
999 .{ .name = "CurrentRayTimeNV", .value = 5334, .parameters = &.{} },
1000 .{ .name = "HitTriangleVertexPositionsKHR", .value = 5335, .parameters = &.{} },809 .{ .name = "HitTriangleVertexPositionsKHR", .value = 5335, .parameters = &.{} },
1001 .{ .name = "HitMicroTriangleVertexPositionsNV", .value = 5337, .parameters = &.{} },
1002 .{ .name = "HitMicroTriangleVertexBarycentricsNV", .value = 5344, .parameters = &.{} },
1003 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &.{} },810 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &.{} },
1004 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &.{} },811 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &.{} },
1005 .{ .name = "HitIsSphereNV", .value = 5359, .parameters = &.{} },
1006 .{ .name = "HitIsLSSNV", .value = 5360, .parameters = &.{} },
1007 .{ .name = "HitSpherePositionNV", .value = 5361, .parameters = &.{} },
1008 .{ .name = "WarpsPerSMNV", .value = 5374, .parameters = &.{} },
1009 .{ .name = "SMCountNV", .value = 5375, .parameters = &.{} },
1010 .{ .name = "WarpIDNV", .value = 5376, .parameters = &.{} },
1011 .{ .name = "SMIDNV", .value = 5377, .parameters = &.{} },
1012 .{ .name = "HitLSSPositionsNV", .value = 5396, .parameters = &.{} },
1013 .{ .name = "HitKindFrontFacingMicroTriangleNV", .value = 5405, .parameters = &.{} },
1014 .{ .name = "HitKindBackFacingMicroTriangleNV", .value = 5406, .parameters = &.{} },
1015 .{ .name = "HitSphereRadiusNV", .value = 5420, .parameters = &.{} },
1016 .{ .name = "HitLSSRadiiNV", .value = 5421, .parameters = &.{} },
1017 .{ .name = "ClusterIDNV", .value = 5436, .parameters = &.{} },
1018 .{ .name = "CullMaskKHR", .value = 6021, .parameters = &.{} },812 .{ .name = "CullMaskKHR", .value = 6021, .parameters = &.{} },
1019 },813 },
1020 .scope => &.{814 .scope => &.{
...@@ -1082,8 +876,6 @@ pub const OperandKind = enum {...@@ -1082,8 +876,6 @@ pub const OperandKind = enum {
1082 .{ .name = "InputAttachment", .value = 40, .parameters = &.{} },876 .{ .name = "InputAttachment", .value = 40, .parameters = &.{} },
1083 .{ .name = "SparseResidency", .value = 41, .parameters = &.{} },877 .{ .name = "SparseResidency", .value = 41, .parameters = &.{} },
1084 .{ .name = "MinLod", .value = 42, .parameters = &.{} },878 .{ .name = "MinLod", .value = 42, .parameters = &.{} },
1085 .{ .name = "Sampled1D", .value = 43, .parameters = &.{} },
1086 .{ .name = "Image1D", .value = 44, .parameters = &.{} },
1087 .{ .name = "SampledCubeArray", .value = 45, .parameters = &.{} },879 .{ .name = "SampledCubeArray", .value = 45, .parameters = &.{} },
1088 .{ .name = "SampledBuffer", .value = 46, .parameters = &.{} },880 .{ .name = "SampledBuffer", .value = 46, .parameters = &.{} },
1089 .{ .name = "ImageBuffer", .value = 47, .parameters = &.{} },881 .{ .name = "ImageBuffer", .value = 47, .parameters = &.{} },
...@@ -1111,15 +903,9 @@ pub const OperandKind = enum {...@@ -1111,15 +903,9 @@ pub const OperandKind = enum {
1111 .{ .name = "ShaderLayer", .value = 69, .parameters = &.{} },903 .{ .name = "ShaderLayer", .value = 69, .parameters = &.{} },
1112 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &.{} },904 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &.{} },
1113 .{ .name = "UniformDecoration", .value = 71, .parameters = &.{} },905 .{ .name = "UniformDecoration", .value = 71, .parameters = &.{} },
1114 .{ .name = "CoreBuiltinsARM", .value = 4165, .parameters = &.{} },
1115 .{ .name = "TileImageColorReadAccessEXT", .value = 4166, .parameters = &.{} },906 .{ .name = "TileImageColorReadAccessEXT", .value = 4166, .parameters = &.{} },
1116 .{ .name = "TileImageDepthReadAccessEXT", .value = 4167, .parameters = &.{} },907 .{ .name = "TileImageDepthReadAccessEXT", .value = 4167, .parameters = &.{} },
1117 .{ .name = "TileImageStencilReadAccessEXT", .value = 4168, .parameters = &.{} },908 .{ .name = "TileImageStencilReadAccessEXT", .value = 4168, .parameters = &.{} },
1118 .{ .name = "TensorsARM", .value = 4174, .parameters = &.{} },
1119 .{ .name = "StorageTensorArrayDynamicIndexingARM", .value = 4175, .parameters = &.{} },
1120 .{ .name = "StorageTensorArrayNonUniformIndexingARM", .value = 4176, .parameters = &.{} },
1121 .{ .name = "GraphARM", .value = 4191, .parameters = &.{} },
1122 .{ .name = "CooperativeMatrixLayoutsARM", .value = 4201, .parameters = &.{} },
1123 .{ .name = "Float8EXT", .value = 4212, .parameters = &.{} },909 .{ .name = "Float8EXT", .value = 4212, .parameters = &.{} },
1124 .{ .name = "Float8CooperativeMatrixEXT", .value = 4213, .parameters = &.{} },910 .{ .name = "Float8CooperativeMatrixEXT", .value = 4213, .parameters = &.{} },
1125 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &.{} },911 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &.{} },
...@@ -1145,30 +931,15 @@ pub const OperandKind = enum {...@@ -1145,30 +931,15 @@ pub const OperandKind = enum {
1145 .{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },931 .{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },
1146 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },932 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },
1147 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },933 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },
1148 .{ .name = "RoundingModeRTE", .value = 4467, .parameters = &.{} },
1149 .{ .name = "RoundingModeRTZ", .value = 4468, .parameters = &.{} },
1150 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },934 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },
1151 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },935 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },
1152 .{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },936 .{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },
1153 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },937 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },
1154 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &.{} },938 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &.{} },
1155 .{ .name = "TextureSampleWeightedQCOM", .value = 4484, .parameters = &.{} },
1156 .{ .name = "TextureBoxFilterQCOM", .value = 4485, .parameters = &.{} },
1157 .{ .name = "TextureBlockMatchQCOM", .value = 4486, .parameters = &.{} },
1158 .{ .name = "TileShadingQCOM", .value = 4495, .parameters = &.{} },
1159 .{ .name = "CooperativeMatrixConversionQCOM", .value = 4496, .parameters = &.{} },
1160 .{ .name = "TextureBlockMatch2QCOM", .value = 4498, .parameters = &.{} },
1161 .{ .name = "Float16ImageAMD", .value = 5008, .parameters = &.{} },
1162 .{ .name = "ImageGatherBiasLodAMD", .value = 5009, .parameters = &.{} },
1163 .{ .name = "FragmentMaskAMD", .value = 5010, .parameters = &.{} },
1164 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &.{} },939 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &.{} },
1165 .{ .name = "ImageReadWriteLodAMD", .value = 5015, .parameters = &.{} },
1166 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &.{} },940 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &.{} },
1167 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &.{} },941 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &.{} },
1168 .{ .name = "ShaderEnqueueAMDX", .value = 5067, .parameters = &.{} },
1169 .{ .name = "QuadControlKHR", .value = 5087, .parameters = &.{} },942 .{ .name = "QuadControlKHR", .value = 5087, .parameters = &.{} },
1170 .{ .name = "Int4TypeINTEL", .value = 5112, .parameters = &.{} },
1171 .{ .name = "Int4CooperativeMatrixINTEL", .value = 5114, .parameters = &.{} },
1172 .{ .name = "BFloat16TypeKHR", .value = 5116, .parameters = &.{} },943 .{ .name = "BFloat16TypeKHR", .value = 5116, .parameters = &.{} },
1173 .{ .name = "BFloat16DotProductKHR", .value = 5117, .parameters = &.{} },944 .{ .name = "BFloat16DotProductKHR", .value = 5117, .parameters = &.{} },
1174 .{ .name = "BFloat16CooperativeMatrixKHR", .value = 5118, .parameters = &.{} },945 .{ .name = "BFloat16CooperativeMatrixKHR", .value = 5118, .parameters = &.{} },
...@@ -1176,15 +947,8 @@ pub const OperandKind = enum {...@@ -1176,15 +947,8 @@ pub const OperandKind = enum {
1176 .{ .name = "DescriptorHeapEXT", .value = 5128, .parameters = &.{} },947 .{ .name = "DescriptorHeapEXT", .value = 5128, .parameters = &.{} },
1177 .{ .name = "ConstantDataKHR", .value = 5146, .parameters = &.{} },948 .{ .name = "ConstantDataKHR", .value = 5146, .parameters = &.{} },
1178 .{ .name = "PoisonFreezeKHR", .value = 5156, .parameters = &.{} },949 .{ .name = "PoisonFreezeKHR", .value = 5156, .parameters = &.{} },
1179 .{ .name = "SampleMaskOverrideCoverageNV", .value = 5249, .parameters = &.{} },
1180 .{ .name = "GeometryShaderPassthroughNV", .value = 5251, .parameters = &.{} },
1181 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },950 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },
1182 .{ .name = "ShaderViewportMaskNV", .value = 5255, .parameters = &.{} },
1183 .{ .name = "ShaderStereoViewNV", .value = 5259, .parameters = &.{} },
1184 .{ .name = "PerViewAttributesNV", .value = 5260, .parameters = &.{} },
1185 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },951 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },
1186 .{ .name = "MeshShadingNV", .value = 5266, .parameters = &.{} },
1187 .{ .name = "ImageFootprintNV", .value = 5282, .parameters = &.{} },
1188 .{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },952 .{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },
1189 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &.{} },953 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &.{} },
1190 .{ .name = "ComputeDerivativeGroupQuadsKHR", .value = 5288, .parameters = &.{} },954 .{ .name = "ComputeDerivativeGroupQuadsKHR", .value = 5288, .parameters = &.{} },
...@@ -1203,84 +967,24 @@ pub const OperandKind = enum {...@@ -1203,84 +967,24 @@ pub const OperandKind = enum {
1203 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &.{} },967 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &.{} },
1204 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &.{} },968 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &.{} },
1205 .{ .name = "RayTracingPositionFetchKHR", .value = 5336, .parameters = &.{} },969 .{ .name = "RayTracingPositionFetchKHR", .value = 5336, .parameters = &.{} },
1206 .{ .name = "RayTracingNV", .value = 5340, .parameters = &.{} },
1207 .{ .name = "RayTracingMotionBlurNV", .value = 5341, .parameters = &.{} },
1208 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &.{} },970 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &.{} },
1209 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },971 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },
1210 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },972 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },
1211 .{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },973 .{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },
1212 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },974 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },
1213 .{ .name = "CooperativeMatrixNV", .value = 5357, .parameters = &.{} },
1214 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },975 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },
1215 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },976 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },
1216 .{ .name = "ShaderSMBuiltinsNV", .value = 5373, .parameters = &.{} },
1217 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },977 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },
1218 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &.{} },978 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &.{} },
1219 .{ .name = "DisplacementMicromapNV", .value = 5380, .parameters = &.{} },
1220 .{ .name = "RayTracingOpacityMicromapEXT", .value = 5381, .parameters = &.{} },979 .{ .name = "RayTracingOpacityMicromapEXT", .value = 5381, .parameters = &.{} },
1221 .{ .name = "ShaderInvocationReorderNV", .value = 5383, .parameters = &.{} },
1222 .{ .name = "ShaderInvocationReorderEXT", .value = 5388, .parameters = &.{} },980 .{ .name = "ShaderInvocationReorderEXT", .value = 5388, .parameters = &.{} },
1223 .{ .name = "BindlessTextureNV", .value = 5390, .parameters = &.{} },
1224 .{ .name = "RayQueryPositionFetchKHR", .value = 5391, .parameters = &.{} },981 .{ .name = "RayQueryPositionFetchKHR", .value = 5391, .parameters = &.{} },
1225 .{ .name = "CooperativeVectorNV", .value = 5394, .parameters = &.{} },
1226 .{ .name = "AtomicFloat16VectorNV", .value = 5404, .parameters = &.{} },
1227 .{ .name = "RayTracingDisplacementMicromapNV", .value = 5409, .parameters = &.{} },
1228 .{ .name = "RawAccessChainsNV", .value = 5414, .parameters = &.{} },
1229 .{ .name = "RayTracingSpheresGeometryNV", .value = 5418, .parameters = &.{} },
1230 .{ .name = "RayTracingLinearSweptSpheresGeometryNV", .value = 5419, .parameters = &.{} },
1231 .{ .name = "PushConstantBanksNV", .value = 5423, .parameters = &.{} },
1232 .{ .name = "LongVectorEXT", .value = 5425, .parameters = &.{} },982 .{ .name = "LongVectorEXT", .value = 5425, .parameters = &.{} },
1233 .{ .name = "Shader64BitIndexingEXT", .value = 5426, .parameters = &.{} },983 .{ .name = "Shader64BitIndexingEXT", .value = 5426, .parameters = &.{} },
1234 .{ .name = "CooperativeMatrixReductionsNV", .value = 5430, .parameters = &.{} },
1235 .{ .name = "CooperativeMatrixConversionsNV", .value = 5431, .parameters = &.{} },
1236 .{ .name = "CooperativeMatrixPerElementOperationsNV", .value = 5432, .parameters = &.{} },
1237 .{ .name = "CooperativeMatrixTensorAddressingNV", .value = 5433, .parameters = &.{} },
1238 .{ .name = "CooperativeMatrixBlockLoadsNV", .value = 5434, .parameters = &.{} },
1239 .{ .name = "CooperativeVectorTrainingNV", .value = 5435, .parameters = &.{} },
1240 .{ .name = "RayTracingClusterAccelerationStructureNV", .value = 5437, .parameters = &.{} },
1241 .{ .name = "TensorAddressingNV", .value = 5439, .parameters = &.{} },
1242 .{ .name = "SubgroupShuffleINTEL", .value = 5568, .parameters = &.{} },
1243 .{ .name = "SubgroupBufferBlockIOINTEL", .value = 5569, .parameters = &.{} },
1244 .{ .name = "SubgroupImageBlockIOINTEL", .value = 5570, .parameters = &.{} },
1245 .{ .name = "SubgroupImageMediaBlockIOINTEL", .value = 5579, .parameters = &.{} },
1246 .{ .name = "RoundToInfinityINTEL", .value = 5582, .parameters = &.{} },
1247 .{ .name = "FloatingPointModeINTEL", .value = 5583, .parameters = &.{} },
1248 .{ .name = "IntegerFunctions2INTEL", .value = 5584, .parameters = &.{} },
1249 .{ .name = "FunctionPointersINTEL", .value = 5603, .parameters = &.{} },
1250 .{ .name = "IndirectReferencesINTEL", .value = 5604, .parameters = &.{} },
1251 .{ .name = "AsmINTEL", .value = 5606, .parameters = &.{} },
1252 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &.{} },984 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &.{} },
1253 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &.{} },985 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &.{} },
1254 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &.{} },986 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &.{} },
1255 .{ .name = "VectorComputeINTEL", .value = 5617, .parameters = &.{} },
1256 .{ .name = "VectorAnyINTEL", .value = 5619, .parameters = &.{} },
1257 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &.{} },987 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &.{} },
1258 .{ .name = "SubgroupAvcMotionEstimationINTEL", .value = 5696, .parameters = &.{} },
1259 .{ .name = "SubgroupAvcMotionEstimationIntraINTEL", .value = 5697, .parameters = &.{} },
1260 .{ .name = "SubgroupAvcMotionEstimationChromaINTEL", .value = 5698, .parameters = &.{} },
1261 .{ .name = "VariableLengthArrayINTEL", .value = 5817, .parameters = &.{} },
1262 .{ .name = "FunctionFloatControlINTEL", .value = 5821, .parameters = &.{} },
1263 .{ .name = "FPGAMemoryAttributesALTERA", .value = 5824, .parameters = &.{} },
1264 .{ .name = "FPFastMathModeINTEL", .value = 5837, .parameters = &.{} },
1265 .{ .name = "ArbitraryPrecisionIntegersALTERA", .value = 5844, .parameters = &.{} },
1266 .{ .name = "ArbitraryPrecisionFloatingPointALTERA", .value = 5845, .parameters = &.{} },
1267 .{ .name = "UnstructuredLoopControlsINTEL", .value = 5886, .parameters = &.{} },
1268 .{ .name = "FPGALoopControlsALTERA", .value = 5888, .parameters = &.{} },
1269 .{ .name = "KernelAttributesINTEL", .value = 5892, .parameters = &.{} },
1270 .{ .name = "FPGAKernelAttributesINTEL", .value = 5897, .parameters = &.{} },
1271 .{ .name = "FPGAMemoryAccessesALTERA", .value = 5898, .parameters = &.{} },
1272 .{ .name = "FPGAClusterAttributesALTERA", .value = 5904, .parameters = &.{} },
1273 .{ .name = "LoopFuseALTERA", .value = 5906, .parameters = &.{} },
1274 .{ .name = "FPGADSPControlALTERA", .value = 5908, .parameters = &.{} },
1275 .{ .name = "MemoryAccessAliasingINTEL", .value = 5910, .parameters = &.{} },
1276 .{ .name = "FPGAInvocationPipeliningAttributesALTERA", .value = 5916, .parameters = &.{} },
1277 .{ .name = "FPGABufferLocationALTERA", .value = 5920, .parameters = &.{} },
1278 .{ .name = "ArbitraryPrecisionFixedPointALTERA", .value = 5922, .parameters = &.{} },
1279 .{ .name = "USMStorageClassesALTERA", .value = 5935, .parameters = &.{} },
1280 .{ .name = "RuntimeAlignedAttributeALTERA", .value = 5939, .parameters = &.{} },
1281 .{ .name = "IOPipesALTERA", .value = 5943, .parameters = &.{} },
1282 .{ .name = "BlockingPipesALTERA", .value = 5945, .parameters = &.{} },
1283 .{ .name = "FPGARegALTERA", .value = 5948, .parameters = &.{} },
1284 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &.{} },988 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &.{} },
1285 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &.{} },989 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &.{} },
1286 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &.{} },990 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &.{} },
...@@ -1294,40 +998,10 @@ pub const OperandKind = enum {...@@ -1294,40 +998,10 @@ pub const OperandKind = enum {
1294 .{ .name = "FMAKHR", .value = 6030, .parameters = &.{} },998 .{ .name = "FMAKHR", .value = 6030, .parameters = &.{} },
1295 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &.{} },999 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &.{} },
1296 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &.{} },1000 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &.{} },
1297 .{ .name = "LongCompositesINTEL", .value = 6089, .parameters = &.{} },
1298 .{ .name = "OptNoneEXT", .value = 6094, .parameters = &.{} },1001 .{ .name = "OptNoneEXT", .value = 6094, .parameters = &.{} },
1299 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &.{} },1002 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &.{} },
1300 .{ .name = "DebugInfoModuleINTEL", .value = 6114, .parameters = &.{} },
1301 .{ .name = "BFloat16ConversionINTEL", .value = 6115, .parameters = &.{} },
1302 .{ .name = "SplitBarrierINTEL", .value = 6141, .parameters = &.{} },
1303 .{ .name = "ArithmeticFenceEXT", .value = 6144, .parameters = &.{} },1003 .{ .name = "ArithmeticFenceEXT", .value = 6144, .parameters = &.{} },
1304 .{ .name = "FPGAClusterAttributesV2ALTERA", .value = 6150, .parameters = &.{} },
1305 .{ .name = "FPGAKernelAttributesv2INTEL", .value = 6161, .parameters = &.{} },
1306 .{ .name = "TaskSequenceALTERA", .value = 6162, .parameters = &.{} },
1307 .{ .name = "FPMaxErrorINTEL", .value = 6169, .parameters = &.{} },
1308 .{ .name = "FPGALatencyControlALTERA", .value = 6171, .parameters = &.{} },
1309 .{ .name = "FPGAArgumentInterfacesALTERA", .value = 6174, .parameters = &.{} },
1310 .{ .name = "GlobalVariableHostAccessINTEL", .value = 6187, .parameters = &.{} },
1311 .{ .name = "GlobalVariableFPGADecorationsALTERA", .value = 6189, .parameters = &.{} },
1312 .{ .name = "SubgroupBufferPrefetchINTEL", .value = 6220, .parameters = &.{} },
1313 .{ .name = "Subgroup2DBlockIOINTEL", .value = 6228, .parameters = &.{} },
1314 .{ .name = "Subgroup2DBlockTransformINTEL", .value = 6229, .parameters = &.{} },
1315 .{ .name = "Subgroup2DBlockTransposeINTEL", .value = 6230, .parameters = &.{} },
1316 .{ .name = "SubgroupMatrixMultiplyAccumulateINTEL", .value = 6236, .parameters = &.{} },
1317 .{ .name = "TernaryBitwiseFunctionINTEL", .value = 6241, .parameters = &.{} },
1318 .{ .name = "UntypedVariableLengthArrayINTEL", .value = 6243, .parameters = &.{} },
1319 .{ .name = "SpecConditionalINTEL", .value = 6245, .parameters = &.{} },
1320 .{ .name = "FunctionVariantsINTEL", .value = 6246, .parameters = &.{} },
1321 .{ .name = "GroupUniformArithmeticKHR", .value = 6400, .parameters = &.{} },1004 .{ .name = "GroupUniformArithmeticKHR", .value = 6400, .parameters = &.{} },
1322 .{ .name = "TensorFloat32RoundingINTEL", .value = 6425, .parameters = &.{} },
1323 .{ .name = "MaskedGatherScatterINTEL", .value = 6427, .parameters = &.{} },
1324 .{ .name = "CacheControlsINTEL", .value = 6441, .parameters = &.{} },
1325 .{ .name = "RegisterLimitsINTEL", .value = 6460, .parameters = &.{} },
1326 .{ .name = "BindlessImagesINTEL", .value = 6528, .parameters = &.{} },
1327 .{ .name = "DotProductFloat16AccFloat32VALVE", .value = 6912, .parameters = &.{} },
1328 .{ .name = "DotProductFloat16AccFloat16VALVE", .value = 6913, .parameters = &.{} },
1329 .{ .name = "DotProductBFloat16AccVALVE", .value = 6914, .parameters = &.{} },
1330 .{ .name = "DotProductFloat8AccFloat32VALVE", .value = 6915, .parameters = &.{} },
1331 },1005 },
1332 .ray_query_intersection => &.{1006 .ray_query_intersection => &.{
1333 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &.{} },1007 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &.{} },
...@@ -1356,8 +1030,6 @@ pub const OperandKind = enum {...@@ -1356,8 +1030,6 @@ pub const OperandKind = enum {
1356 .cooperative_matrix_layout => &.{1030 .cooperative_matrix_layout => &.{
1357 .{ .name = "RowMajorKHR", .value = 0, .parameters = &.{} },1031 .{ .name = "RowMajorKHR", .value = 0, .parameters = &.{} },
1358 .{ .name = "ColumnMajorKHR", .value = 1, .parameters = &.{} },1032 .{ .name = "ColumnMajorKHR", .value = 1, .parameters = &.{} },
1359 .{ .name = "RowBlockedInterleavedARM", .value = 4202, .parameters = &.{} },
1360 .{ .name = "ColumnBlockedInterleavedARM", .value = 4203, .parameters = &.{} },
1361 },1033 },
1362 .cooperative_matrix_use => &.{1034 .cooperative_matrix_use => &.{
1363 .{ .name = "MatrixAKHR", .value = 0, .parameters = &.{} },1035 .{ .name = "MatrixAKHR", .value = 0, .parameters = &.{} },
...@@ -1376,30 +1048,11 @@ pub const OperandKind = enum {...@@ -1376,30 +1048,11 @@ pub const OperandKind = enum {
1376 .{ .name = "Repeat", .value = 3, .parameters = &.{} },1048 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
1377 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },1049 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
1378 },1050 },
1379 .tensor_addressing_operands => &.{1051 .tensor_addressing_operands => &.{},
1380 .{ .name = "TensorView", .value = 0x0001, .parameters = &.{.id_ref} },1052 .initialization_mode_qualifier => &.{},
1381 .{ .name = "DecodeFunc", .value = 0x0002, .parameters = &.{.id_ref} },1053 .load_cache_control => &.{},
1382 },1054 .store_cache_control => &.{},
1383 .initialization_mode_qualifier => &.{1055 .named_maximum_number_of_registers => &.{},
1384 .{ .name = "InitOnDeviceReprogramALTERA", .value = 0, .parameters = &.{} },
1385 .{ .name = "InitOnDeviceResetALTERA", .value = 1, .parameters = &.{} },
1386 },
1387 .load_cache_control => &.{
1388 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1389 .{ .name = "CachedINTEL", .value = 1, .parameters = &.{} },
1390 .{ .name = "StreamingINTEL", .value = 2, .parameters = &.{} },
1391 .{ .name = "InvalidateAfterReadINTEL", .value = 3, .parameters = &.{} },
1392 .{ .name = "ConstCachedINTEL", .value = 4, .parameters = &.{} },
1393 },
1394 .store_cache_control => &.{
1395 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1396 .{ .name = "WriteThroughINTEL", .value = 1, .parameters = &.{} },
1397 .{ .name = "WriteBackINTEL", .value = 2, .parameters = &.{} },
1398 .{ .name = "StreamingINTEL", .value = 3, .parameters = &.{} },
1399 },
1400 .named_maximum_number_of_registers => &.{
1401 .{ .name = "AutoINTEL", .value = 0, .parameters = &.{} },
1402 },
1403 .matrix_multiply_accumulate_operands => &.{1056 .matrix_multiply_accumulate_operands => &.{
1404 .{ .name = "MatrixASignedComponentsINTEL", .value = 0x1, .parameters = &.{} },1057 .{ .name = "MatrixASignedComponentsINTEL", .value = 0x1, .parameters = &.{} },
1405 .{ .name = "MatrixBSignedComponentsINTEL", .value = 0x2, .parameters = &.{} },1058 .{ .name = "MatrixBSignedComponentsINTEL", .value = 0x2, .parameters = &.{} },
...@@ -1458,14 +1111,16 @@ pub const OperandKind = enum {...@@ -1458,14 +1111,16 @@ pub const OperandKind = enum {
1458 .pair_literal_integer_id_ref => unreachable,1111 .pair_literal_integer_id_ref => unreachable,
1459 .pair_id_ref_literal_integer => unreachable,1112 .pair_id_ref_literal_integer => unreachable,
1460 .pair_id_ref_id_ref => unreachable,1113 .pair_id_ref_id_ref => unreachable,
1461 .tensor_operands => &.{1114 .tensor_operands => &.{},
1462 .{ .name = "NoneARM", .value = 0x0000, .parameters = &.{} },1115 };
1463 .{ .name = "NontemporalARM", .value = 0x0001, .parameters = &.{} },1116 }
1464 .{ .name = "OutOfBoundsValueARM", .value = 0x0002, .parameters = &.{.id_ref} },1117
1465 .{ .name = "MakeElementAvailableARM", .value = 0x0004, .parameters = &.{.id_ref} },1118 pub fn bases(operand_kind: OperandKind) []const OperandKind {
1466 .{ .name = "MakeElementVisibleARM", .value = 0x0008, .parameters = &.{.id_ref} },1119 return switch (operand_kind) {
1467 .{ .name = "NonPrivateElementARM", .value = 0x0010, .parameters = &.{} },1120 .pair_literal_integer_id_ref => &.{ .literal_integer, .id_ref },
1468 },1121 .pair_id_ref_literal_integer => &.{ .id_ref, .literal_integer },
1122 .pair_id_ref_id_ref => &.{ .id_ref, .id_ref },
1123 else => unreachable,
1469 };1124 };
1470 }1125 }
1471};1126};
...@@ -1818,17 +1473,6 @@ pub const Opcode = enum(u16) {...@@ -1818,17 +1473,6 @@ pub const Opcode = enum(u16) {
1818 OpColorAttachmentReadEXT = 4160,1473 OpColorAttachmentReadEXT = 4160,
1819 OpDepthAttachmentReadEXT = 4161,1474 OpDepthAttachmentReadEXT = 4161,
1820 OpStencilAttachmentReadEXT = 4162,1475 OpStencilAttachmentReadEXT = 4162,
1821 OpTypeTensorARM = 4163,
1822 OpTensorReadARM = 4164,
1823 OpTensorWriteARM = 4165,
1824 OpTensorQuerySizeARM = 4166,
1825 OpGraphConstantARM = 4181,
1826 OpGraphEntryPointARM = 4182,
1827 OpGraphARM = 4183,
1828 OpGraphInputARM = 4184,
1829 OpGraphSetOutputARM = 4185,
1830 OpGraphEndARM = 4186,
1831 OpTypeGraphARM = 4190,
1832 OpTerminateInvocation = 4416,1476 OpTerminateInvocation = 4416,
1833 OpTypeUntypedPointerKHR = 4417,1477 OpTypeUntypedPointerKHR = 4417,
1834 OpUntypedVariableKHR = 4418,1478 OpUntypedVariableKHR = 4418,
...@@ -1874,37 +1518,7 @@ pub const Opcode = enum(u16) {...@@ -1874,37 +1518,7 @@ pub const Opcode = enum(u16) {
1874 OpRayQueryConfirmIntersectionKHR = 4476,1518 OpRayQueryConfirmIntersectionKHR = 4476,
1875 OpRayQueryProceedKHR = 4477,1519 OpRayQueryProceedKHR = 4477,
1876 OpRayQueryGetIntersectionTypeKHR = 4479,1520 OpRayQueryGetIntersectionTypeKHR = 4479,
1877 OpImageSampleWeightedQCOM = 4480,
1878 OpImageBoxFilterQCOM = 4481,
1879 OpImageBlockMatchSSDQCOM = 4482,
1880 OpImageBlockMatchSADQCOM = 4483,
1881 OpBitCastArrayQCOM = 4497,
1882 OpImageBlockMatchWindowSSDQCOM = 4500,
1883 OpImageBlockMatchWindowSADQCOM = 4501,
1884 OpImageBlockMatchGatherSSDQCOM = 4502,
1885 OpImageBlockMatchGatherSADQCOM = 4503,
1886 OpCompositeConstructCoopMatQCOM = 4540,
1887 OpCompositeExtractCoopMatQCOM = 4541,
1888 OpExtractSubArrayQCOM = 4542,
1889 OpGroupIAddNonUniformAMD = 5000,
1890 OpGroupFAddNonUniformAMD = 5001,
1891 OpGroupFMinNonUniformAMD = 5002,
1892 OpGroupUMinNonUniformAMD = 5003,
1893 OpGroupSMinNonUniformAMD = 5004,
1894 OpGroupFMaxNonUniformAMD = 5005,
1895 OpGroupUMaxNonUniformAMD = 5006,
1896 OpGroupSMaxNonUniformAMD = 5007,
1897 OpFragmentMaskFetchAMD = 5011,
1898 OpFragmentFetchAMD = 5012,
1899 OpReadClockKHR = 5056,1521 OpReadClockKHR = 5056,
1900 OpAllocateNodePayloadsAMDX = 5074,
1901 OpEnqueueNodePayloadsAMDX = 5075,
1902 OpTypeNodePayloadArrayAMDX = 5076,
1903 OpFinishWritingNodePayloadAMDX = 5078,
1904 OpNodePayloadArrayLengthAMDX = 5090,
1905 OpIsNodePayloadValidAMDX = 5101,
1906 OpConstantStringAMDX = 5103,
1907 OpSpecConstantStringAMDX = 5104,
1908 OpGroupNonUniformQuadAllKHR = 5110,1522 OpGroupNonUniformQuadAllKHR = 5110,
1909 OpGroupNonUniformQuadAnyKHR = 5111,1523 OpGroupNonUniformQuadAnyKHR = 5111,
1910 OpTypeBufferEXT = 5115,1524 OpTypeBufferEXT = 5115,
...@@ -1917,54 +1531,10 @@ pub const Opcode = enum(u16) {...@@ -1917,54 +1531,10 @@ pub const Opcode = enum(u16) {
1917 OpSpecConstantDataKHR = 5148,1531 OpSpecConstantDataKHR = 5148,
1918 OpPoisonKHR = 5158,1532 OpPoisonKHR = 5158,
1919 OpFreezeKHR = 5159,1533 OpFreezeKHR = 5159,
1920 OpHitObjectRecordHitMotionNV = 5249,
1921 OpHitObjectRecordHitWithIndexMotionNV = 5250,
1922 OpHitObjectRecordMissMotionNV = 5251,
1923 OpHitObjectGetWorldToObjectNV = 5252,
1924 OpHitObjectGetObjectToWorldNV = 5253,
1925 OpHitObjectGetObjectRayDirectionNV = 5254,
1926 OpHitObjectGetObjectRayOriginNV = 5255,
1927 OpHitObjectTraceRayMotionNV = 5256,
1928 OpHitObjectGetShaderRecordBufferHandleNV = 5257,
1929 OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
1930 OpHitObjectRecordEmptyNV = 5259,
1931 OpHitObjectTraceRayNV = 5260,
1932 OpHitObjectRecordHitNV = 5261,
1933 OpHitObjectRecordHitWithIndexNV = 5262,
1934 OpHitObjectRecordMissNV = 5263,
1935 OpHitObjectExecuteShaderNV = 5264,
1936 OpHitObjectGetCurrentTimeNV = 5265,
1937 OpHitObjectGetAttributesNV = 5266,
1938 OpHitObjectGetHitKindNV = 5267,
1939 OpHitObjectGetPrimitiveIndexNV = 5268,
1940 OpHitObjectGetGeometryIndexNV = 5269,
1941 OpHitObjectGetInstanceIdNV = 5270,
1942 OpHitObjectGetInstanceCustomIndexNV = 5271,
1943 OpHitObjectGetWorldRayDirectionNV = 5272,
1944 OpHitObjectGetWorldRayOriginNV = 5273,
1945 OpHitObjectGetRayTMaxNV = 5274,
1946 OpHitObjectGetRayTMinNV = 5275,
1947 OpHitObjectIsEmptyNV = 5276,
1948 OpHitObjectIsHitNV = 5277,
1949 OpHitObjectIsMissNV = 5278,
1950 OpReorderThreadWithHitObjectNV = 5279,
1951 OpReorderThreadWithHintNV = 5280,
1952 OpTypeHitObjectNV = 5281,
1953 OpImageSampleFootprintNV = 5283,
1954 OpTypeVectorIdEXT = 5288,1534 OpTypeVectorIdEXT = 5288,
1955 OpCooperativeVectorMatrixMulNV = 5289,
1956 OpCooperativeVectorOuterProductAccumulateNV = 5290,
1957 OpCooperativeVectorReduceSumAccumulateNV = 5291,
1958 OpCooperativeVectorMatrixMulAddNV = 5292,
1959 OpCooperativeMatrixConvertNV = 5293,
1960 OpEmitMeshTasksEXT = 5294,1535 OpEmitMeshTasksEXT = 5294,
1961 OpSetMeshOutputsEXT = 5295,1536 OpSetMeshOutputsEXT = 5295,
1962 OpGroupNonUniformPartitionEXT = 5296,1537 OpGroupNonUniformPartitionEXT = 5296,
1963 OpWritePackedPrimitiveIndices4x8NV = 5299,
1964 OpFetchMicroTriangleVertexPositionNV = 5300,
1965 OpFetchMicroTriangleVertexBarycentricNV = 5301,
1966 OpCooperativeVectorLoadNV = 5302,
1967 OpCooperativeVectorStoreNV = 5303,
1968 OpHitObjectRecordFromQueryEXT = 5304,1538 OpHitObjectRecordFromQueryEXT = 5304,
1969 OpHitObjectRecordMissEXT = 5305,1539 OpHitObjectRecordMissEXT = 5305,
1970 OpHitObjectRecordMissMotionEXT = 5306,1540 OpHitObjectRecordMissMotionEXT = 5306,
...@@ -1996,103 +1566,24 @@ pub const Opcode = enum(u16) {...@@ -1996,103 +1566,24 @@ pub const Opcode = enum(u16) {
1996 OpHitObjectGetWorldToObjectEXT = 5332,1566 OpHitObjectGetWorldToObjectEXT = 5332,
1997 OpHitObjectGetRayTMaxEXT = 5333,1567 OpHitObjectGetRayTMaxEXT = 5333,
1998 OpReportIntersectionKHR = 5334,1568 OpReportIntersectionKHR = 5334,
1999 OpIgnoreIntersectionNV = 5335,
2000 OpTerminateRayNV = 5336,
2001 OpTraceNV = 5337,
2002 OpTraceMotionNV = 5338,
2003 OpTraceRayMotionNV = 5339,
2004 OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,1569 OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,
2005 OpTypeAccelerationStructureKHR = 5341,1570 OpTypeAccelerationStructureKHR = 5341,
2006 OpExecuteCallableNV = 5344,
2007 OpRayQueryGetIntersectionClusterIdNV = 5345,
2008 OpHitObjectGetClusterIdNV = 5346,
2009 OpHitObjectGetRayTMinEXT = 5347,1571 OpHitObjectGetRayTMinEXT = 5347,
2010 OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348,1572 OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348,
2011 OpHitObjectGetShaderRecordBufferHandleEXT = 5349,1573 OpHitObjectGetShaderRecordBufferHandleEXT = 5349,
2012 OpHitObjectIsEmptyEXT = 5350,1574 OpHitObjectIsEmptyEXT = 5350,
2013 OpHitObjectIsHitEXT = 5351,1575 OpHitObjectIsHitEXT = 5351,
2014 OpHitObjectIsMissEXT = 5352,1576 OpHitObjectIsMissEXT = 5352,
2015 OpTypeCooperativeMatrixNV = 5358,
2016 OpCooperativeMatrixLoadNV = 5359,
2017 OpCooperativeMatrixStoreNV = 5360,
2018 OpCooperativeMatrixMulAddNV = 5361,
2019 OpCooperativeMatrixLengthNV = 5362,
2020 OpBeginInvocationInterlockEXT = 5364,1577 OpBeginInvocationInterlockEXT = 5364,
2021 OpEndInvocationInterlockEXT = 5365,1578 OpEndInvocationInterlockEXT = 5365,
2022 OpCooperativeMatrixReduceNV = 5366,
2023 OpCooperativeMatrixLoadTensorNV = 5367,
2024 OpCooperativeMatrixStoreTensorNV = 5368,
2025 OpCooperativeMatrixPerElementOpNV = 5369,
2026 OpTypeTensorLayoutNV = 5370,
2027 OpTypeTensorViewNV = 5371,
2028 OpCreateTensorLayoutNV = 5372,
2029 OpTensorLayoutSetDimensionNV = 5373,
2030 OpTensorLayoutSetStrideNV = 5374,
2031 OpTensorLayoutSliceNV = 5375,
2032 OpTensorLayoutSetClampValueNV = 5376,
2033 OpCreateTensorViewNV = 5377,
2034 OpTensorViewSetDimensionNV = 5378,
2035 OpTensorViewSetStrideNV = 5379,
2036 OpDemoteToHelperInvocation = 5380,1579 OpDemoteToHelperInvocation = 5380,
2037 OpIsHelperInvocationEXT = 5381,1580 OpIsHelperInvocationEXT = 5381,
2038 OpTensorViewSetClipNV = 5382,
2039 OpTensorLayoutSetBlockSizeNV = 5384,
2040 OpCooperativeMatrixTransposeNV = 5390,
2041 OpConvertUToImageNV = 5391,
2042 OpConvertUToSamplerNV = 5392,
2043 OpConvertImageToUNV = 5393,
2044 OpConvertSamplerToUNV = 5394,
2045 OpConvertUToSampledImageNV = 5395,
2046 OpConvertSampledImageToUNV = 5396,
2047 OpSamplerImageAddressingModeNV = 5397,
2048 OpRawAccessChainNV = 5398,
2049 OpRayQueryGetIntersectionSpherePositionNV = 5427,
2050 OpRayQueryGetIntersectionSphereRadiusNV = 5428,
2051 OpRayQueryGetIntersectionLSSPositionsNV = 5429,
2052 OpRayQueryGetIntersectionLSSRadiiNV = 5430,
2053 OpRayQueryGetIntersectionLSSHitValueNV = 5431,
2054 OpHitObjectGetSpherePositionNV = 5432,
2055 OpHitObjectGetSphereRadiusNV = 5433,
2056 OpHitObjectGetLSSPositionsNV = 5434,
2057 OpHitObjectGetLSSRadiiNV = 5435,
2058 OpHitObjectIsSphereHitNV = 5436,
2059 OpHitObjectIsLSSHitNV = 5437,
2060 OpRayQueryIsSphereHitNV = 5438,
2061 OpRayQueryIsLSSHitNV = 5439,
2062 OpSubgroupShuffleINTEL = 5571,
2063 OpSubgroupShuffleDownINTEL = 5572,
2064 OpSubgroupShuffleUpINTEL = 5573,
2065 OpSubgroupShuffleXorINTEL = 5574,
2066 OpSubgroupBlockReadINTEL = 5575,
2067 OpSubgroupBlockWriteINTEL = 5576,
2068 OpSubgroupImageBlockReadINTEL = 5577,
2069 OpSubgroupImageBlockWriteINTEL = 5578,
2070 OpSubgroupImageMediaBlockReadINTEL = 5580,
2071 OpSubgroupImageMediaBlockWriteINTEL = 5581,
2072 OpUCountLeadingZerosINTEL = 5585,
2073 OpUCountTrailingZerosINTEL = 5586,
2074 OpAbsISubINTEL = 5587,
2075 OpAbsUSubINTEL = 5588,
2076 OpIAddSatINTEL = 5589,
2077 OpUAddSatINTEL = 5590,
2078 OpIAverageINTEL = 5591,
2079 OpUAverageINTEL = 5592,
2080 OpIAverageRoundedINTEL = 5593,
2081 OpUAverageRoundedINTEL = 5594,
2082 OpISubSatINTEL = 5595,
2083 OpUSubSatINTEL = 5596,
2084 OpIMul32x16INTEL = 5597,
2085 OpUMul32x16INTEL = 5598,
2086 OpAtomicFMinEXT = 5614,1581 OpAtomicFMinEXT = 5614,
2087 OpAtomicFMaxEXT = 5615,1582 OpAtomicFMaxEXT = 5615,
2088 OpAssumeTrueKHR = 5630,1583 OpAssumeTrueKHR = 5630,
2089 OpExpectKHR = 5631,1584 OpExpectKHR = 5631,
2090 OpDecorateString = 5632,1585 OpDecorateString = 5632,
2091 OpMemberDecorateString = 5633,1586 OpMemberDecorateString = 5633,
2092 OpVariableLengthArrayINTEL = 5818,
2093 OpSaveMemoryINTEL = 5819,
2094 OpRestoreMemoryINTEL = 5820,
2095 OpLoopControlINTEL = 5887,
2096 OpRayQueryGetRayTMinKHR = 6016,1587 OpRayQueryGetRayTMinKHR = 6016,
2097 OpRayQueryGetRayFlagsKHR = 6017,1588 OpRayQueryGetRayFlagsKHR = 6017,
2098 OpRayQueryGetIntersectionTKHR = 6018,1589 OpRayQueryGetIntersectionTKHR = 6018,
...@@ -2111,32 +1602,7 @@ pub const Opcode = enum(u16) {...@@ -2111,32 +1602,7 @@ pub const Opcode = enum(u16) {
2111 OpRayQueryGetIntersectionObjectToWorldKHR = 6031,1602 OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
2112 OpRayQueryGetIntersectionWorldToObjectKHR = 6032,1603 OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
2113 OpAtomicFAddEXT = 6035,1604 OpAtomicFAddEXT = 6035,
2114 OpTypeBufferSurfaceINTEL = 6086,
2115 OpTypeStructContinuedINTEL = 6090,
2116 OpConstantCompositeContinuedINTEL = 6091,
2117 OpSpecConstantCompositeContinuedINTEL = 6092,
2118 OpCompositeConstructContinuedINTEL = 6096,
2119 OpConvertFToBF16INTEL = 6116,
2120 OpConvertBF16ToFINTEL = 6117,
2121 OpControlBarrierArriveINTEL = 6142,
2122 OpControlBarrierWaitINTEL = 6143,
2123 OpArithmeticFenceEXT = 6145,1605 OpArithmeticFenceEXT = 6145,
2124 OpSubgroupBlockPrefetchINTEL = 6221,
2125 OpSubgroup2DBlockLoadINTEL = 6231,
2126 OpSubgroup2DBlockLoadTransformINTEL = 6232,
2127 OpSubgroup2DBlockLoadTransposeINTEL = 6233,
2128 OpSubgroup2DBlockPrefetchINTEL = 6234,
2129 OpSubgroup2DBlockStoreINTEL = 6235,
2130 OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
2131 OpBitwiseFunctionINTEL = 6242,
2132 OpUntypedVariableLengthArrayINTEL = 6244,
2133 OpConditionalExtensionINTEL = 6248,
2134 OpConditionalEntryPointINTEL = 6249,
2135 OpConditionalCapabilityINTEL = 6250,
2136 OpSpecConstantTargetINTEL = 6251,
2137 OpSpecConstantArchitectureINTEL = 6252,
2138 OpSpecConstantCapabilitiesINTEL = 6253,
2139 OpConditionalCopyObjectINTEL = 6254,
2140 OpGroupIMulKHR = 6401,1606 OpGroupIMulKHR = 6401,
2141 OpGroupFMulKHR = 6402,1607 OpGroupFMulKHR = 6402,
2142 OpGroupBitwiseAndKHR = 6403,1608 OpGroupBitwiseAndKHR = 6403,
...@@ -2145,18 +1611,499 @@ pub const Opcode = enum(u16) {...@@ -2145,18 +1611,499 @@ pub const Opcode = enum(u16) {
2145 OpGroupLogicalAndKHR = 6406,1611 OpGroupLogicalAndKHR = 6406,
2146 OpGroupLogicalOrKHR = 6407,1612 OpGroupLogicalOrKHR = 6407,
2147 OpGroupLogicalXorKHR = 6408,1613 OpGroupLogicalXorKHR = 6408,
2148 OpRoundFToTF32INTEL = 6426,
2149 OpMaskedGatherINTEL = 6428,
2150 OpMaskedScatterINTEL = 6429,
2151 OpConvertHandleToImageINTEL = 6529,
2152 OpConvertHandleToSamplerINTEL = 6530,
2153 OpConvertHandleToSampledImageINTEL = 6531,
2154 OpFDot2MixAcc32VALVE = 6916,
2155 OpFDot2MixAcc16VALVE = 6917,
2156 OpFDot4MixAcc32VALVE = 6918,
21571614
2158 pub fn Operands(comptime self: Opcode) type {1615 pub fn operands(opcode: Opcode) []const Operand {
2159 return switch (self) {1616 return switch (opcode) {
1617 .OpNop => &.{},
1618 .OpUndef => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1619 .OpSourceContinued => &.{.{ .kind = .literal_string }},
1620 .OpSource => &.{ .{ .kind = .source_language }, .{ .kind = .literal_integer }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .literal_string, .quantifier = .optional } },
1621 .OpSourceExtension => &.{.{ .kind = .literal_string }},
1622 .OpName => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_string } },
1623 .OpMemberName => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer }, .{ .kind = .literal_string } },
1624 .OpString => &.{ .{ .kind = .id_result }, .{ .kind = .literal_string } },
1625 .OpLine => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer } },
1626 .OpExtension => &.{.{ .kind = .literal_string }},
1627 .OpExtInstImport => &.{ .{ .kind = .id_result }, .{ .kind = .literal_string } },
1628 .OpExtInst => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_ext_inst_integer }, .{ .kind = .id_ref, .quantifier = .variadic } },
1629 .OpMemoryModel => &.{ .{ .kind = .addressing_model }, .{ .kind = .memory_model } },
1630 .OpEntryPoint => &.{ .{ .kind = .execution_model }, .{ .kind = .id_ref }, .{ .kind = .literal_string }, .{ .kind = .id_ref, .quantifier = .variadic } },
1631 .OpExecutionMode => &.{ .{ .kind = .id_ref }, .{ .kind = .execution_mode } },
1632 .OpCapability => &.{.{ .kind = .capability }},
1633 .OpTypeVoid => &.{.{ .kind = .id_result }},
1634 .OpTypeBool => &.{.{ .kind = .id_result }},
1635 .OpTypeInt => &.{ .{ .kind = .id_result }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer } },
1636 .OpTypeFloat => &.{ .{ .kind = .id_result }, .{ .kind = .literal_integer }, .{ .kind = .fp_encoding, .quantifier = .optional } },
1637 .OpTypeVector => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1638 .OpTypeMatrix => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1639 .OpTypeImage => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .dim }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .image_format }, .{ .kind = .access_qualifier, .quantifier = .optional } },
1640 .OpTypeSampler => &.{.{ .kind = .id_result }},
1641 .OpTypeSampledImage => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref } },
1642 .OpTypeArray => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1643 .OpTypeRuntimeArray => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref } },
1644 .OpTypeStruct => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .variadic } },
1645 .OpTypeOpaque => &.{ .{ .kind = .id_result }, .{ .kind = .literal_string } },
1646 .OpTypePointer => &.{ .{ .kind = .id_result }, .{ .kind = .storage_class }, .{ .kind = .id_ref } },
1647 .OpTypeFunction => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1648 .OpTypeEvent => &.{.{ .kind = .id_result }},
1649 .OpTypeDeviceEvent => &.{.{ .kind = .id_result }},
1650 .OpTypeReserveId => &.{.{ .kind = .id_result }},
1651 .OpTypeQueue => &.{.{ .kind = .id_result }},
1652 .OpTypePipe => &.{ .{ .kind = .id_result }, .{ .kind = .access_qualifier } },
1653 .OpTypeForwardPointer => &.{ .{ .kind = .id_ref }, .{ .kind = .storage_class } },
1654 .OpConstantTrue => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1655 .OpConstantFalse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1656 .OpConstant => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_context_dependent_number } },
1657 .OpConstantComposite => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .variadic } },
1658 .OpConstantSampler => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .sampler_addressing_mode }, .{ .kind = .literal_integer }, .{ .kind = .sampler_filter_mode } },
1659 .OpConstantNull => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1660 .OpSpecConstantTrue => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1661 .OpSpecConstantFalse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1662 .OpSpecConstant => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_context_dependent_number } },
1663 .OpSpecConstantComposite => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .variadic } },
1664 .OpSpecConstantOp => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_spec_constant_op_integer } },
1665 .OpFunction => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .function_control }, .{ .kind = .id_ref } },
1666 .OpFunctionParameter => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1667 .OpFunctionEnd => &.{},
1668 .OpFunctionCall => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1669 .OpVariable => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .storage_class }, .{ .kind = .id_ref, .quantifier = .optional } },
1670 .OpImageTexelPointer => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1671 .OpLoad => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .memory_access, .quantifier = .optional } },
1672 .OpStore => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .memory_access, .quantifier = .optional } },
1673 .OpCopyMemory => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .memory_access, .quantifier = .optional }, .{ .kind = .memory_access, .quantifier = .optional } },
1674 .OpCopyMemorySized => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .memory_access, .quantifier = .optional }, .{ .kind = .memory_access, .quantifier = .optional } },
1675 .OpAccessChain => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1676 .OpInBoundsAccessChain => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1677 .OpPtrAccessChain => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1678 .OpArrayLength => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1679 .OpGenericPtrMemSemantics => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1680 .OpInBoundsPtrAccessChain => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1681 .OpDecorate => &.{ .{ .kind = .id_ref }, .{ .kind = .decoration } },
1682 .OpMemberDecorate => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer }, .{ .kind = .decoration } },
1683 .OpDecorationGroup => &.{.{ .kind = .id_result }},
1684 .OpGroupDecorate => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1685 .OpGroupMemberDecorate => &.{ .{ .kind = .id_ref }, .{ .kind = .pair_id_ref_literal_integer, .quantifier = .variadic } },
1686 .OpVectorExtractDynamic => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1687 .OpVectorInsertDynamic => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1688 .OpVectorShuffle => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer, .quantifier = .variadic } },
1689 .OpCompositeConstruct => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .variadic } },
1690 .OpCompositeExtract => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_integer, .quantifier = .variadic } },
1691 .OpCompositeInsert => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer, .quantifier = .variadic } },
1692 .OpCopyObject => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1693 .OpTranspose => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1694 .OpSampledImage => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1695 .OpImageSampleImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1696 .OpImageSampleExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1697 .OpImageSampleDrefImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1698 .OpImageSampleDrefExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1699 .OpImageSampleProjImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1700 .OpImageSampleProjExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1701 .OpImageSampleProjDrefImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1702 .OpImageSampleProjDrefExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1703 .OpImageFetch => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1704 .OpImageGather => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1705 .OpImageDrefGather => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1706 .OpImageRead => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1707 .OpImageWrite => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1708 .OpImage => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1709 .OpImageQueryFormat => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1710 .OpImageQueryOrder => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1711 .OpImageQuerySizeLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1712 .OpImageQuerySize => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1713 .OpImageQueryLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1714 .OpImageQueryLevels => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1715 .OpImageQuerySamples => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1716 .OpConvertFToU => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1717 .OpConvertFToS => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1718 .OpConvertSToF => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1719 .OpConvertUToF => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1720 .OpUConvert => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1721 .OpSConvert => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1722 .OpFConvert => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1723 .OpQuantizeToF16 => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1724 .OpConvertPtrToU => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1725 .OpSatConvertSToU => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1726 .OpSatConvertUToS => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1727 .OpConvertUToPtr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1728 .OpPtrCastToGeneric => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1729 .OpGenericCastToPtr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1730 .OpGenericCastToPtrExplicit => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .storage_class } },
1731 .OpBitcast => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1732 .OpSNegate => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1733 .OpFNegate => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1734 .OpIAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1735 .OpFAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1736 .OpISub => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1737 .OpFSub => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1738 .OpIMul => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1739 .OpFMul => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1740 .OpUDiv => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1741 .OpSDiv => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1742 .OpFDiv => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1743 .OpUMod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1744 .OpSRem => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1745 .OpSMod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1746 .OpFRem => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1747 .OpFMod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1748 .OpVectorTimesScalar => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1749 .OpMatrixTimesScalar => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1750 .OpVectorTimesMatrix => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1751 .OpMatrixTimesVector => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1752 .OpMatrixTimesMatrix => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1753 .OpOuterProduct => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1754 .OpDot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1755 .OpIAddCarry => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1756 .OpISubBorrow => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1757 .OpUMulExtended => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1758 .OpSMulExtended => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1759 .OpAny => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1760 .OpAll => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1761 .OpIsNan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1762 .OpIsInf => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1763 .OpIsFinite => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1764 .OpIsNormal => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1765 .OpSignBitSet => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1766 .OpLessOrGreater => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1767 .OpOrdered => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1768 .OpUnordered => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1769 .OpLogicalEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1770 .OpLogicalNotEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1771 .OpLogicalOr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1772 .OpLogicalAnd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1773 .OpLogicalNot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1774 .OpSelect => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1775 .OpIEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1776 .OpINotEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1777 .OpUGreaterThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1778 .OpSGreaterThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1779 .OpUGreaterThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1780 .OpSGreaterThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1781 .OpULessThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1782 .OpSLessThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1783 .OpULessThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1784 .OpSLessThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1785 .OpFOrdEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1786 .OpFUnordEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1787 .OpFOrdNotEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1788 .OpFUnordNotEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1789 .OpFOrdLessThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1790 .OpFUnordLessThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1791 .OpFOrdGreaterThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1792 .OpFUnordGreaterThan => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1793 .OpFOrdLessThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1794 .OpFUnordLessThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1795 .OpFOrdGreaterThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1796 .OpFUnordGreaterThanEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1797 .OpShiftRightLogical => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1798 .OpShiftRightArithmetic => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1799 .OpShiftLeftLogical => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1800 .OpBitwiseOr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1801 .OpBitwiseXor => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1802 .OpBitwiseAnd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1803 .OpNot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1804 .OpBitFieldInsert => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1805 .OpBitFieldSExtract => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1806 .OpBitFieldUExtract => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1807 .OpBitReverse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1808 .OpBitCount => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1809 .OpDPdx => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1810 .OpDPdy => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1811 .OpFwidth => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1812 .OpDPdxFine => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1813 .OpDPdyFine => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1814 .OpFwidthFine => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1815 .OpDPdxCoarse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1816 .OpDPdyCoarse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1817 .OpFwidthCoarse => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1818 .OpEmitVertex => &.{},
1819 .OpEndPrimitive => &.{},
1820 .OpEmitStreamVertex => &.{.{ .kind = .id_ref }},
1821 .OpEndStreamPrimitive => &.{.{ .kind = .id_ref }},
1822 .OpControlBarrier => &.{ .{ .kind = .id_scope }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1823 .OpMemoryBarrier => &.{ .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1824 .OpAtomicLoad => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1825 .OpAtomicStore => &.{ .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1826 .OpAtomicExchange => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1827 .OpAtomicCompareExchange => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1828 .OpAtomicCompareExchangeWeak => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1829 .OpAtomicIIncrement => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1830 .OpAtomicIDecrement => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1831 .OpAtomicIAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1832 .OpAtomicISub => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1833 .OpAtomicSMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1834 .OpAtomicUMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1835 .OpAtomicSMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1836 .OpAtomicUMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1837 .OpAtomicAnd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1838 .OpAtomicOr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1839 .OpAtomicXor => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
1840 .OpPhi => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic } },
1841 .OpLoopMerge => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .loop_control } },
1842 .OpSelectionMerge => &.{ .{ .kind = .id_ref }, .{ .kind = .selection_control } },
1843 .OpLabel => &.{.{ .kind = .id_result }},
1844 .OpBranch => &.{.{ .kind = .id_ref }},
1845 .OpBranchConditional => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer, .quantifier = .variadic } },
1846 .OpSwitch => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .pair_literal_integer_id_ref, .quantifier = .variadic } },
1847 .OpKill => &.{},
1848 .OpReturn => &.{},
1849 .OpReturnValue => &.{.{ .kind = .id_ref }},
1850 .OpUnreachable => &.{},
1851 .OpLifetimeStart => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1852 .OpLifetimeStop => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1853 .OpGroupAsyncCopy => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1854 .OpGroupWaitEvents => &.{ .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1855 .OpGroupAll => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1856 .OpGroupAny => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1857 .OpGroupBroadcast => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1858 .OpGroupIAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1859 .OpGroupFAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1860 .OpGroupFMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1861 .OpGroupUMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1862 .OpGroupSMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1863 .OpGroupFMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1864 .OpGroupUMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1865 .OpGroupSMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1866 .OpReadPipe => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1867 .OpWritePipe => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1868 .OpReservedReadPipe => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1869 .OpReservedWritePipe => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1870 .OpReserveReadPipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1871 .OpReserveWritePipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1872 .OpCommitReadPipe => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1873 .OpCommitWritePipe => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1874 .OpIsValidReserveId => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1875 .OpGetNumPipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1876 .OpGetMaxPipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1877 .OpGroupReserveReadPipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1878 .OpGroupReserveWritePipePackets => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1879 .OpGroupCommitReadPipe => &.{ .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1880 .OpGroupCommitWritePipe => &.{ .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1881 .OpEnqueueMarker => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1882 .OpEnqueueKernel => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1883 .OpGetKernelNDrangeSubGroupCount => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1884 .OpGetKernelNDrangeMaxSubGroupSize => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1885 .OpGetKernelWorkGroupSize => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1886 .OpGetKernelPreferredWorkGroupSizeMultiple => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1887 .OpRetainEvent => &.{.{ .kind = .id_ref }},
1888 .OpReleaseEvent => &.{.{ .kind = .id_ref }},
1889 .OpCreateUserEvent => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1890 .OpIsValidEvent => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1891 .OpSetUserEventStatus => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1892 .OpCaptureEventProfilingInfo => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1893 .OpGetDefaultQueue => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
1894 .OpBuildNDRange => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1895 .OpImageSparseSampleImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1896 .OpImageSparseSampleExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1897 .OpImageSparseSampleDrefImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1898 .OpImageSparseSampleDrefExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1899 .OpImageSparseSampleProjImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1900 .OpImageSparseSampleProjExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1901 .OpImageSparseSampleProjDrefImplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1902 .OpImageSparseSampleProjDrefExplicitLod => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands } },
1903 .OpImageSparseFetch => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1904 .OpImageSparseGather => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1905 .OpImageSparseDrefGather => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1906 .OpImageSparseTexelsResident => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1907 .OpNoLine => &.{},
1908 .OpAtomicFlagTestAndSet => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1909 .OpAtomicFlagClear => &.{ .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1910 .OpImageSparseRead => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .image_operands, .quantifier = .optional } },
1911 .OpSizeOf => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1912 .OpTypePipeStorage => &.{.{ .kind = .id_result }},
1913 .OpConstantPipeStorage => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer }, .{ .kind = .literal_integer } },
1914 .OpCreatePipeFromPipeStorage => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1915 .OpGetKernelLocalSizeForSubgroupCount => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1916 .OpGetKernelMaxNumSubgroups => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1917 .OpTypeNamedBarrier => &.{.{ .kind = .id_result }},
1918 .OpNamedBarrierInitialize => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1919 .OpMemoryNamedBarrier => &.{ .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics } },
1920 .OpModuleProcessed => &.{.{ .kind = .literal_string }},
1921 .OpExecutionModeId => &.{ .{ .kind = .id_ref }, .{ .kind = .execution_mode } },
1922 .OpDecorateId => &.{ .{ .kind = .id_ref }, .{ .kind = .decoration } },
1923 .OpGroupNonUniformElect => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope } },
1924 .OpGroupNonUniformAll => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1925 .OpGroupNonUniformAny => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1926 .OpGroupNonUniformAllEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1927 .OpGroupNonUniformBroadcast => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1928 .OpGroupNonUniformBroadcastFirst => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1929 .OpGroupNonUniformBallot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1930 .OpGroupNonUniformInverseBallot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1931 .OpGroupNonUniformBallotBitExtract => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1932 .OpGroupNonUniformBallotBitCount => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
1933 .OpGroupNonUniformBallotFindLSB => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1934 .OpGroupNonUniformBallotFindMSB => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref } },
1935 .OpGroupNonUniformShuffle => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1936 .OpGroupNonUniformShuffleXor => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1937 .OpGroupNonUniformShuffleUp => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1938 .OpGroupNonUniformShuffleDown => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1939 .OpGroupNonUniformIAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1940 .OpGroupNonUniformFAdd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1941 .OpGroupNonUniformIMul => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1942 .OpGroupNonUniformFMul => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1943 .OpGroupNonUniformSMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1944 .OpGroupNonUniformUMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1945 .OpGroupNonUniformFMin => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1946 .OpGroupNonUniformSMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1947 .OpGroupNonUniformUMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1948 .OpGroupNonUniformFMax => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1949 .OpGroupNonUniformBitwiseAnd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1950 .OpGroupNonUniformBitwiseOr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1951 .OpGroupNonUniformBitwiseXor => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1952 .OpGroupNonUniformLogicalAnd => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1953 .OpGroupNonUniformLogicalOr => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1954 .OpGroupNonUniformLogicalXor => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1955 .OpGroupNonUniformQuadBroadcast => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1956 .OpGroupNonUniformQuadSwap => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1957 .OpCopyLogical => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1958 .OpPtrEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1959 .OpPtrNotEqual => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1960 .OpPtrDiff => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1961 .OpColorAttachmentReadEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1962 .OpDepthAttachmentReadEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .optional } },
1963 .OpStencilAttachmentReadEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref, .quantifier = .optional } },
1964 .OpTerminateInvocation => &.{},
1965 .OpTypeUntypedPointerKHR => &.{ .{ .kind = .id_result }, .{ .kind = .storage_class } },
1966 .OpUntypedVariableKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .storage_class }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
1967 .OpUntypedAccessChainKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1968 .OpUntypedInBoundsAccessChainKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1969 .OpSubgroupBallotKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1970 .OpSubgroupFirstInvocationKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1971 .OpUntypedPtrAccessChainKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1972 .OpUntypedInBoundsPtrAccessChainKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
1973 .OpUntypedArrayLengthKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
1974 .OpUntypedPrefetchKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
1975 .OpFmaKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1976 .OpSubgroupAllKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1977 .OpSubgroupAnyKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1978 .OpSubgroupAllEqualKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1979 .OpGroupNonUniformRotateKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
1980 .OpSubgroupReadInvocationKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1981 .OpExtInstWithForwardRefsKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .literal_ext_inst_integer }, .{ .kind = .id_ref, .quantifier = .variadic } },
1982 .OpUntypedGroupAsyncCopyKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .memory_access, .quantifier = .optional }, .{ .kind = .memory_access, .quantifier = .optional } },
1983 .OpTraceRayKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1984 .OpExecuteCallableKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1985 .OpConvertUToAccelerationStructureKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1986 .OpIgnoreIntersectionKHR => &.{},
1987 .OpTerminateRayKHR => &.{},
1988 .OpSDot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1989 .OpUDot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1990 .OpSUDot => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1991 .OpSDotAccSat => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1992 .OpUDotAccSat => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1993 .OpSUDotAccSat => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .packed_vector_format, .quantifier = .optional } },
1994 .OpTypeCooperativeMatrixKHR => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
1995 .OpCooperativeMatrixLoadKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .memory_access, .quantifier = .optional } },
1996 .OpCooperativeMatrixStoreKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .memory_access, .quantifier = .optional } },
1997 .OpCooperativeMatrixMulAddKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .cooperative_matrix_operands, .quantifier = .optional } },
1998 .OpCooperativeMatrixLengthKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
1999 .OpConstantCompositeReplicateEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2000 .OpSpecConstantCompositeReplicateEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2001 .OpCompositeConstructReplicateEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2002 .OpTypeRayQueryKHR => &.{.{ .kind = .id_result }},
2003 .OpRayQueryInitializeKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2004 .OpRayQueryTerminateKHR => &.{.{ .kind = .id_ref }},
2005 .OpRayQueryGenerateIntersectionKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2006 .OpRayQueryConfirmIntersectionKHR => &.{.{ .kind = .id_ref }},
2007 .OpRayQueryProceedKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2008 .OpRayQueryGetIntersectionTypeKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2009 .OpReadClockKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope } },
2010 .OpGroupNonUniformQuadAllKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2011 .OpGroupNonUniformQuadAnyKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2012 .OpTypeBufferEXT => &.{ .{ .kind = .id_result }, .{ .kind = .storage_class } },
2013 .OpBufferPointerEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2014 .OpAbortKHR => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2015 .OpUntypedImageTexelPointerEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2016 .OpMemberDecorateIdEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer }, .{ .kind = .decoration } },
2017 .OpConstantSizeOfEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2018 .OpConstantDataKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_integer, .quantifier = .variadic } },
2019 .OpSpecConstantDataKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_integer, .quantifier = .variadic } },
2020 .OpPoisonKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
2021 .OpFreezeKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2022 .OpTypeVectorIdEXT => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2023 .OpEmitMeshTasksEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
2024 .OpSetMeshOutputsEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2025 .OpGroupNonUniformPartitionEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2026 .OpHitObjectRecordFromQueryEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2027 .OpHitObjectRecordMissEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2028 .OpHitObjectRecordMissMotionEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2029 .OpHitObjectGetIntersectionTriangleVertexPositionsEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2030 .OpHitObjectGetRayFlagsEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2031 .OpHitObjectSetShaderBindingTableRecordIndexEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2032 .OpHitObjectReorderExecuteShaderEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
2033 .OpHitObjectTraceReorderExecuteEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
2034 .OpHitObjectTraceMotionReorderExecuteEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
2035 .OpTypeHitObjectEXT => &.{.{ .kind = .id_result }},
2036 .OpReorderThreadWithHintEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2037 .OpReorderThreadWithHitObjectEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional }, .{ .kind = .id_ref, .quantifier = .optional } },
2038 .OpHitObjectTraceRayEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2039 .OpHitObjectTraceRayMotionEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2040 .OpHitObjectRecordEmptyEXT => &.{.{ .kind = .id_ref }},
2041 .OpHitObjectExecuteShaderEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2042 .OpHitObjectGetCurrentTimeEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2043 .OpHitObjectGetAttributesEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2044 .OpHitObjectGetHitKindEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2045 .OpHitObjectGetPrimitiveIndexEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2046 .OpHitObjectGetGeometryIndexEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2047 .OpHitObjectGetInstanceIdEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2048 .OpHitObjectGetInstanceCustomIndexEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2049 .OpHitObjectGetObjectRayOriginEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2050 .OpHitObjectGetObjectRayDirectionEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2051 .OpHitObjectGetWorldRayDirectionEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2052 .OpHitObjectGetWorldRayOriginEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2053 .OpHitObjectGetObjectToWorldEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2054 .OpHitObjectGetWorldToObjectEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2055 .OpHitObjectGetRayTMaxEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2056 .OpReportIntersectionKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2057 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2058 .OpTypeAccelerationStructureKHR => &.{.{ .kind = .id_result }},
2059 .OpHitObjectGetRayTMinEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2060 .OpHitObjectGetShaderBindingTableRecordIndexEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2061 .OpHitObjectGetShaderRecordBufferHandleEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2062 .OpHitObjectIsEmptyEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2063 .OpHitObjectIsHitEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2064 .OpHitObjectIsMissEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2065 .OpBeginInvocationInterlockEXT => &.{},
2066 .OpEndInvocationInterlockEXT => &.{},
2067 .OpDemoteToHelperInvocation => &.{},
2068 .OpIsHelperInvocationEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
2069 .OpAtomicFMinEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
2070 .OpAtomicFMaxEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
2071 .OpAssumeTrueKHR => &.{.{ .kind = .id_ref }},
2072 .OpExpectKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2073 .OpDecorateString => &.{ .{ .kind = .id_ref }, .{ .kind = .decoration } },
2074 .OpMemberDecorateString => &.{ .{ .kind = .id_ref }, .{ .kind = .literal_integer }, .{ .kind = .decoration } },
2075 .OpRayQueryGetRayTMinKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2076 .OpRayQueryGetRayFlagsKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2077 .OpRayQueryGetIntersectionTKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2078 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2079 .OpRayQueryGetIntersectionInstanceIdKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2080 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2081 .OpRayQueryGetIntersectionGeometryIndexKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2082 .OpRayQueryGetIntersectionPrimitiveIndexKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2083 .OpRayQueryGetIntersectionBarycentricsKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2084 .OpRayQueryGetIntersectionFrontFaceKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2085 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2086 .OpRayQueryGetIntersectionObjectRayDirectionKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2087 .OpRayQueryGetIntersectionObjectRayOriginKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2088 .OpRayQueryGetWorldRayDirectionKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2089 .OpRayQueryGetWorldRayOriginKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2090 .OpRayQueryGetIntersectionObjectToWorldKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2091 .OpRayQueryGetIntersectionWorldToObjectKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2092 .OpAtomicFAddEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_scope }, .{ .kind = .id_memory_semantics }, .{ .kind = .id_ref } },
2093 .OpArithmeticFenceEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
2094 .OpGroupIMulKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2095 .OpGroupFMulKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2096 .OpGroupBitwiseAndKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2097 .OpGroupBitwiseOrKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2098 .OpGroupBitwiseXorKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2099 .OpGroupLogicalAndKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2100 .OpGroupLogicalOrKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2101 .OpGroupLogicalXorKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_scope }, .{ .kind = .group_operation }, .{ .kind = .id_ref } },
2102 };
2103 }
2104
2105 pub fn Operands(comptime opcode: Opcode) type {
2106 return switch (opcode) {
2160 .OpNop => void,2107 .OpNop => void,
2161 .OpUndef => struct { id_result_type: Id, id_result: Id },2108 .OpUndef => struct { id_result_type: Id, id_result: Id },
2162 .OpSourceContinued => struct { continued_source: LiteralString },2109 .OpSourceContinued => struct { continued_source: LiteralString },
...@@ -2504,17 +2451,6 @@ pub const Opcode = enum(u16) {...@@ -2504,17 +2451,6 @@ pub const Opcode = enum(u16) {
2504 .OpColorAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, attachment: Id, sample: ?Id = null },2451 .OpColorAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, attachment: Id, sample: ?Id = null },
2505 .OpDepthAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },2452 .OpDepthAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2506 .OpStencilAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },2453 .OpStencilAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2507 .OpTypeTensorARM => struct { id_result: Id, element_type: Id, rank: ?Id = null, shape: ?Id = null },
2508 .OpTensorReadARM => struct { id_result_type: Id, id_result: Id, tensor: Id, coordinates: Id, tensor_operands: ?TensorOperands.Extended = null },
2509 .OpTensorWriteARM => struct { tensor: Id, coordinates: Id, object: Id, tensor_operands: ?TensorOperands.Extended = null },
2510 .OpTensorQuerySizeARM => struct { id_result_type: Id, id_result: Id, tensor: Id, dimension: Id },
2511 .OpGraphConstantARM => struct { id_result_type: Id, id_result: Id, graph_constant_id: LiteralInteger },
2512 .OpGraphEntryPointARM => struct { graph: Id, name: LiteralString, interface: []const Id = &.{} },
2513 .OpGraphARM => struct { id_result_type: Id, id_result: Id },
2514 .OpGraphInputARM => struct { id_result_type: Id, id_result: Id, input_index: Id, element_index: []const Id = &.{} },
2515 .OpGraphSetOutputARM => struct { value: Id, output_index: Id, element_index: []const Id = &.{} },
2516 .OpGraphEndARM => void,
2517 .OpTypeGraphARM => struct { id_result: Id, num_inputs: LiteralInteger, in_out_types: []const Id = &.{} },
2518 .OpTerminateInvocation => void,2454 .OpTerminateInvocation => void,
2519 .OpTypeUntypedPointerKHR => struct { id_result: Id, storage_class: StorageClass },2455 .OpTypeUntypedPointerKHR => struct { id_result: Id, storage_class: StorageClass },
2520 .OpUntypedVariableKHR => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, data_type: ?Id = null, initializer: ?Id = null },2456 .OpUntypedVariableKHR => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, data_type: ?Id = null, initializer: ?Id = null },
...@@ -2560,37 +2496,7 @@ pub const Opcode = enum(u16) {...@@ -2560,37 +2496,7 @@ pub const Opcode = enum(u16) {
2560 .OpRayQueryConfirmIntersectionKHR => struct { ray_query: Id },2496 .OpRayQueryConfirmIntersectionKHR => struct { ray_query: Id },
2561 .OpRayQueryProceedKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },2497 .OpRayQueryProceedKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2562 .OpRayQueryGetIntersectionTypeKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },2498 .OpRayQueryGetIntersectionTypeKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2563 .OpImageSampleWeightedQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, weights: Id },
2564 .OpImageBoxFilterQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, box_size: Id },
2565 .OpImageBlockMatchSSDQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2566 .OpImageBlockMatchSADQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2567 .OpBitCastArrayQCOM => struct { id_result_type: Id, id_result: Id, source_array: Id },
2568 .OpImageBlockMatchWindowSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2569 .OpImageBlockMatchWindowSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2570 .OpImageBlockMatchGatherSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2571 .OpImageBlockMatchGatherSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2572 .OpCompositeConstructCoopMatQCOM => struct { id_result_type: Id, id_result: Id, source_array: Id },
2573 .OpCompositeExtractCoopMatQCOM => struct { id_result_type: Id, id_result: Id, source_cooperative_matrix: Id },
2574 .OpExtractSubArrayQCOM => struct { id_result_type: Id, id_result: Id, source_array: Id, index: Id },
2575 .OpGroupIAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2576 .OpGroupFAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2577 .OpGroupFMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2578 .OpGroupUMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2579 .OpGroupSMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2580 .OpGroupFMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2581 .OpGroupUMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2582 .OpGroupSMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2583 .OpFragmentMaskFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2584 .OpFragmentFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, fragment_index: Id },
2585 .OpReadClockKHR => struct { id_result_type: Id, id_result: Id, scope: Id },2499 .OpReadClockKHR => struct { id_result_type: Id, id_result: Id, scope: Id },
2586 .OpAllocateNodePayloadsAMDX => struct { id_result_type: Id, id_result: Id, visibility: Id, payload_count: Id, node_index: Id },
2587 .OpEnqueueNodePayloadsAMDX => struct { payload_array: Id },
2588 .OpTypeNodePayloadArrayAMDX => struct { id_result: Id, payload_type: Id },
2589 .OpFinishWritingNodePayloadAMDX => struct { id_result_type: Id, id_result: Id, payload: Id },
2590 .OpNodePayloadArrayLengthAMDX => struct { id_result_type: Id, id_result: Id, payload_array: Id },
2591 .OpIsNodePayloadValidAMDX => struct { id_result_type: Id, id_result: Id, payload_type: Id, node_index: Id },
2592 .OpConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2593 .OpSpecConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2594 .OpGroupNonUniformQuadAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },2500 .OpGroupNonUniformQuadAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2595 .OpGroupNonUniformQuadAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },2501 .OpGroupNonUniformQuadAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2596 .OpTypeBufferEXT => struct { id_result: Id, storage_class: StorageClass },2502 .OpTypeBufferEXT => struct { id_result: Id, storage_class: StorageClass },
...@@ -2603,54 +2509,10 @@ pub const Opcode = enum(u16) {...@@ -2603,54 +2509,10 @@ pub const Opcode = enum(u16) {
2603 .OpSpecConstantDataKHR => struct { id_result_type: Id, id_result: Id, data: []const LiteralInteger = &.{} },2509 .OpSpecConstantDataKHR => struct { id_result_type: Id, id_result: Id, data: []const LiteralInteger = &.{} },
2604 .OpPoisonKHR => struct { id_result_type: Id, id_result: Id },2510 .OpPoisonKHR => struct { id_result_type: Id, id_result: Id },
2605 .OpFreezeKHR => struct { id_result_type: Id, id_result: Id, value: Id },2511 .OpFreezeKHR => struct { id_result_type: Id, id_result: Id, value: Id },
2606 .OpHitObjectRecordHitMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2607 .OpHitObjectRecordHitWithIndexMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2608 .OpHitObjectRecordMissMotionNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id },
2609 .OpHitObjectGetWorldToObjectNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2610 .OpHitObjectGetObjectToWorldNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2611 .OpHitObjectGetObjectRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2612 .OpHitObjectGetObjectRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2613 .OpHitObjectTraceRayMotionNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, time: Id, payload: Id },
2614 .OpHitObjectGetShaderRecordBufferHandleNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2615 .OpHitObjectGetShaderBindingTableRecordIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2616 .OpHitObjectRecordEmptyNV => struct { hit_object: Id },
2617 .OpHitObjectTraceRayNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, payload: Id },
2618 .OpHitObjectRecordHitNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2619 .OpHitObjectRecordHitWithIndexNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2620 .OpHitObjectRecordMissNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id },
2621 .OpHitObjectExecuteShaderNV => struct { hit_object: Id, payload: Id },
2622 .OpHitObjectGetCurrentTimeNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2623 .OpHitObjectGetAttributesNV => struct { hit_object: Id, hit_object_attribute: Id },
2624 .OpHitObjectGetHitKindNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2625 .OpHitObjectGetPrimitiveIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2626 .OpHitObjectGetGeometryIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2627 .OpHitObjectGetInstanceIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2628 .OpHitObjectGetInstanceCustomIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2629 .OpHitObjectGetWorldRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2630 .OpHitObjectGetWorldRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2631 .OpHitObjectGetRayTMaxNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2632 .OpHitObjectGetRayTMinNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2633 .OpHitObjectIsEmptyNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2634 .OpHitObjectIsHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2635 .OpHitObjectIsMissNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2636 .OpReorderThreadWithHitObjectNV => struct { hit_object: Id, hint: ?Id = null, bits: ?Id = null },
2637 .OpReorderThreadWithHintNV => struct { hint: Id, bits: Id },
2638 .OpTypeHitObjectNV => struct { id_result: Id },
2639 .OpImageSampleFootprintNV => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, granularity: Id, coarse: Id, image_operands: ?ImageOperands.Extended = null },
2640 .OpTypeVectorIdEXT => struct { id_result: Id, component_type: Id, component_count: Id },2512 .OpTypeVectorIdEXT => struct { id_result: Id, component_type: Id, component_count: Id },
2641 .OpCooperativeVectorMatrixMulNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2642 .OpCooperativeVectorOuterProductAccumulateNV => struct { pointer: Id, offset: Id, a: Id, b: Id, memory_layout: Id, matrix_interpretation: Id, matrix_stride: ?Id = null },
2643 .OpCooperativeVectorReduceSumAccumulateNV => struct { pointer: Id, offset: Id, v: Id },
2644 .OpCooperativeVectorMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, bias: Id, bias_offset: Id, bias_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2645 .OpCooperativeMatrixConvertNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2646 .OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },2513 .OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },
2647 .OpSetMeshOutputsEXT => struct { vertex_count: Id, primitive_count: Id },2514 .OpSetMeshOutputsEXT => struct { vertex_count: Id, primitive_count: Id },
2648 .OpGroupNonUniformPartitionEXT => struct { id_result_type: Id, id_result: Id, value: Id },2515 .OpGroupNonUniformPartitionEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2649 .OpWritePackedPrimitiveIndices4x8NV => struct { index_offset: Id, packed_indices: Id },
2650 .OpFetchMicroTriangleVertexPositionNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2651 .OpFetchMicroTriangleVertexBarycentricNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2652 .OpCooperativeVectorLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, offset: Id, memory_access: ?MemoryAccess.Extended = null },
2653 .OpCooperativeVectorStoreNV => struct { pointer: Id, offset: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2654 .OpHitObjectRecordFromQueryEXT => struct { hit_object: Id, ray_query: Id, sbt_record_index: Id, hit_object_attributes: Id },2516 .OpHitObjectRecordFromQueryEXT => struct { hit_object: Id, ray_query: Id, sbt_record_index: Id, hit_object_attributes: Id },
2655 .OpHitObjectRecordMissEXT => struct { hit_object: Id, ray_flags: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id },2517 .OpHitObjectRecordMissEXT => struct { hit_object: Id, ray_flags: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id },
2656 .OpHitObjectRecordMissMotionEXT => struct { hit_object: Id, ray_flags: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, current_time: Id },2518 .OpHitObjectRecordMissMotionEXT => struct { hit_object: Id, ray_flags: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, current_time: Id },
...@@ -2682,103 +2544,24 @@ pub const Opcode = enum(u16) {...@@ -2682,103 +2544,24 @@ pub const Opcode = enum(u16) {
2682 .OpHitObjectGetWorldToObjectEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2544 .OpHitObjectGetWorldToObjectEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2683 .OpHitObjectGetRayTMaxEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2545 .OpHitObjectGetRayTMaxEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2684 .OpReportIntersectionKHR => struct { id_result_type: Id, id_result: Id, hit: Id, hit_kind: Id },2546 .OpReportIntersectionKHR => struct { id_result_type: Id, id_result: Id, hit: Id, hit_kind: Id },
2685 .OpIgnoreIntersectionNV => void,
2686 .OpTerminateRayNV => void,
2687 .OpTraceNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, payload_id: Id },
2688 .OpTraceMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload_id: Id },
2689 .OpTraceRayMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload: Id },
2690 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },2547 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2691 .OpTypeAccelerationStructureKHR => struct { id_result: Id },2548 .OpTypeAccelerationStructureKHR => struct { id_result: Id },
2692 .OpExecuteCallableNV => struct { sbt_index: Id, callable_data_id: Id },
2693 .OpRayQueryGetIntersectionClusterIdNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2694 .OpHitObjectGetClusterIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2695 .OpHitObjectGetRayTMinEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2549 .OpHitObjectGetRayTMinEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2696 .OpHitObjectGetShaderBindingTableRecordIndexEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2550 .OpHitObjectGetShaderBindingTableRecordIndexEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2697 .OpHitObjectGetShaderRecordBufferHandleEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2551 .OpHitObjectGetShaderRecordBufferHandleEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2698 .OpHitObjectIsEmptyEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2552 .OpHitObjectIsEmptyEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2699 .OpHitObjectIsHitEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2553 .OpHitObjectIsHitEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2700 .OpHitObjectIsMissEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },2554 .OpHitObjectIsMissEXT => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2701 .OpTypeCooperativeMatrixNV => struct { id_result: Id, component_type: Id, execution: Id, rows: Id, columns: Id },
2702 .OpCooperativeMatrixLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2703 .OpCooperativeMatrixStoreNV => struct { pointer: Id, object: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2704 .OpCooperativeMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id },
2705 .OpCooperativeMatrixLengthNV => struct { id_result_type: Id, id_result: Id, type: Id },
2706 .OpBeginInvocationInterlockEXT => void,2555 .OpBeginInvocationInterlockEXT => void,
2707 .OpEndInvocationInterlockEXT => void,2556 .OpEndInvocationInterlockEXT => void,
2708 .OpCooperativeMatrixReduceNV => struct { id_result_type: Id, id_result: Id, matrix: Id, reduce: CooperativeMatrixReduce, combine_func: Id },
2709 .OpCooperativeMatrixLoadTensorNV => struct { id_result_type: Id, id_result: Id, pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2710 .OpCooperativeMatrixStoreTensorNV => struct { pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2711 .OpCooperativeMatrixPerElementOpNV => struct { id_result_type: Id, id_result: Id, matrix: Id, func: Id, operands: []const Id = &.{} },
2712 .OpTypeTensorLayoutNV => struct { id_result: Id, dim: Id, clamp_mode: Id },
2713 .OpTypeTensorViewNV => struct { id_result: Id, dim: Id, has_dimensions: Id, p: []const Id = &.{} },
2714 .OpCreateTensorLayoutNV => struct { id_result_type: Id, id_result: Id },
2715 .OpTensorLayoutSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, dim: []const Id = &.{} },
2716 .OpTensorLayoutSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, stride: []const Id = &.{} },
2717 .OpTensorLayoutSliceNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, operands: []const Id = &.{} },
2718 .OpTensorLayoutSetClampValueNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, value: Id },
2719 .OpCreateTensorViewNV => struct { id_result_type: Id, id_result: Id },
2720 .OpTensorViewSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, dim: []const Id = &.{} },
2721 .OpTensorViewSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, stride: []const Id = &.{} },
2722 .OpDemoteToHelperInvocation => void,2557 .OpDemoteToHelperInvocation => void,
2723 .OpIsHelperInvocationEXT => struct { id_result_type: Id, id_result: Id },2558 .OpIsHelperInvocationEXT => struct { id_result_type: Id, id_result: Id },
2724 .OpTensorViewSetClipNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, clip_row_offset: Id, clip_row_span: Id, clip_col_offset: Id, clip_col_span: Id },
2725 .OpTensorLayoutSetBlockSizeNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, block_size: []const Id = &.{} },
2726 .OpCooperativeMatrixTransposeNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2727 .OpConvertUToImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2728 .OpConvertUToSamplerNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2729 .OpConvertImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2730 .OpConvertSamplerToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2731 .OpConvertUToSampledImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2732 .OpConvertSampledImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2733 .OpSamplerImageAddressingModeNV => struct { bit_width: LiteralInteger },
2734 .OpRawAccessChainNV => struct { id_result_type: Id, id_result: Id, base: Id, byte_stride: Id, element_index: Id, byte_offset: Id, raw_access_chain_operands: ?RawAccessChainOperands = null },
2735 .OpRayQueryGetIntersectionSpherePositionNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2736 .OpRayQueryGetIntersectionSphereRadiusNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2737 .OpRayQueryGetIntersectionLSSPositionsNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2738 .OpRayQueryGetIntersectionLSSRadiiNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2739 .OpRayQueryGetIntersectionLSSHitValueNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2740 .OpHitObjectGetSpherePositionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2741 .OpHitObjectGetSphereRadiusNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2742 .OpHitObjectGetLSSPositionsNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2743 .OpHitObjectGetLSSRadiiNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2744 .OpHitObjectIsSphereHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2745 .OpHitObjectIsLSSHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2746 .OpRayQueryIsSphereHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2747 .OpRayQueryIsLSSHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2748 .OpSubgroupShuffleINTEL => struct { id_result_type: Id, id_result: Id, data: Id, invocation_id: Id },
2749 .OpSubgroupShuffleDownINTEL => struct { id_result_type: Id, id_result: Id, current: Id, next: Id, delta: Id },
2750 .OpSubgroupShuffleUpINTEL => struct { id_result_type: Id, id_result: Id, previous: Id, current: Id, delta: Id },
2751 .OpSubgroupShuffleXorINTEL => struct { id_result_type: Id, id_result: Id, data: Id, value: Id },
2752 .OpSubgroupBlockReadINTEL => struct { id_result_type: Id, id_result: Id, ptr: Id },
2753 .OpSubgroupBlockWriteINTEL => struct { ptr: Id, data: Id },
2754 .OpSubgroupImageBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2755 .OpSubgroupImageBlockWriteINTEL => struct { image: Id, coordinate: Id, data: Id },
2756 .OpSubgroupImageMediaBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, width: Id, height: Id },
2757 .OpSubgroupImageMediaBlockWriteINTEL => struct { image: Id, coordinate: Id, width: Id, height: Id, data: Id },
2758 .OpUCountLeadingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2759 .OpUCountTrailingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2760 .OpAbsISubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2761 .OpAbsUSubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2762 .OpIAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2763 .OpUAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2764 .OpIAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2765 .OpUAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2766 .OpIAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2767 .OpUAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2768 .OpISubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2769 .OpUSubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2770 .OpIMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2771 .OpUMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2772 .OpAtomicFMinEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },2559 .OpAtomicFMinEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2773 .OpAtomicFMaxEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },2560 .OpAtomicFMaxEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2774 .OpAssumeTrueKHR => struct { condition: Id },2561 .OpAssumeTrueKHR => struct { condition: Id },
2775 .OpExpectKHR => struct { id_result_type: Id, id_result: Id, value: Id, expected_value: Id },2562 .OpExpectKHR => struct { id_result_type: Id, id_result: Id, value: Id, expected_value: Id },
2776 .OpDecorateString => struct { target: Id, decoration: Decoration.Extended },2563 .OpDecorateString => struct { target: Id, decoration: Decoration.Extended },
2777 .OpMemberDecorateString => struct { struct_type: Id, member: LiteralInteger, decoration: Decoration.Extended },2564 .OpMemberDecorateString => struct { struct_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2778 .OpVariableLengthArrayINTEL => struct { id_result_type: Id, id_result: Id, length: Id },
2779 .OpSaveMemoryINTEL => struct { id_result_type: Id, id_result: Id },
2780 .OpRestoreMemoryINTEL => struct { ptr: Id },
2781 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },
2782 .OpRayQueryGetRayTMinKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },2565 .OpRayQueryGetRayTMinKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2783 .OpRayQueryGetRayFlagsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },2566 .OpRayQueryGetRayFlagsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2784 .OpRayQueryGetIntersectionTKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },2567 .OpRayQueryGetIntersectionTKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
...@@ -2797,32 +2580,7 @@ pub const Opcode = enum(u16) {...@@ -2797,32 +2580,7 @@ pub const Opcode = enum(u16) {
2797 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },2580 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2798 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },2581 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2799 .OpAtomicFAddEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },2582 .OpAtomicFAddEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2800 .OpTypeBufferSurfaceINTEL => struct { id_result: Id, access_qualifier: AccessQualifier },
2801 .OpTypeStructContinuedINTEL => struct { id_ref: []const Id = &.{} },
2802 .OpConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2803 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2804 .OpCompositeConstructContinuedINTEL => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2805 .OpConvertFToBF16INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2806 .OpConvertBF16ToFINTEL => struct { id_result_type: Id, id_result: Id, b_float16_value: Id },
2807 .OpControlBarrierArriveINTEL => struct { execution: Id, memory: Id, semantics: Id },
2808 .OpControlBarrierWaitINTEL => struct { execution: Id, memory: Id, semantics: Id },
2809 .OpArithmeticFenceEXT => struct { id_result_type: Id, id_result: Id, target: Id },2583 .OpArithmeticFenceEXT => struct { id_result_type: Id, id_result: Id, target: Id },
2810 .OpSubgroupBlockPrefetchINTEL => struct { ptr: Id, num_bytes: Id, memory_access: ?MemoryAccess.Extended = null },
2811 .OpSubgroup2DBlockLoadINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2812 .OpSubgroup2DBlockLoadTransformINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2813 .OpSubgroup2DBlockLoadTransposeINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2814 .OpSubgroup2DBlockPrefetchINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2815 .OpSubgroup2DBlockStoreINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_pointer: Id, dst_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2816 .OpSubgroupMatrixMultiplyAccumulateINTEL => struct { id_result_type: Id, id_result: Id, k_dim: Id, matrix_a: Id, matrix_b: Id, matrix_c: Id, matrix_multiply_accumulate_operands: ?MatrixMultiplyAccumulateOperands = null },
2817 .OpBitwiseFunctionINTEL => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, lut_index: Id },
2818 .OpUntypedVariableLengthArrayINTEL => struct { id_result_type: Id, id_result: Id, element_type: Id, length: Id },
2819 .OpConditionalExtensionINTEL => struct { condition: Id, name: LiteralString },
2820 .OpConditionalEntryPointINTEL => struct { condition: Id, execution_model: ExecutionModel, entry_point: Id, name: LiteralString, interface: []const Id = &.{} },
2821 .OpConditionalCapabilityINTEL => struct { condition: Id, capability: Capability },
2822 .OpSpecConstantTargetINTEL => struct { id_result_type: Id, id_result: Id, target: LiteralInteger, features: []const LiteralInteger = &.{} },
2823 .OpSpecConstantArchitectureINTEL => struct { id_result_type: Id, id_result: Id, category: LiteralInteger, family: LiteralInteger, opcode: LiteralInteger, architecture: LiteralInteger },
2824 .OpSpecConstantCapabilitiesINTEL => struct { id_result_type: Id, id_result: Id, capabilities: []const Capability = &.{} },
2825 .OpConditionalCopyObjectINTEL => struct { id_result_type: Id, id_result: Id, id_ref: []const Id = &.{} },
2826 .OpGroupIMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2584 .OpGroupIMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2827 .OpGroupFMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2585 .OpGroupFMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2828 .OpGroupBitwiseAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2586 .OpGroupBitwiseAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
...@@ -2831,702 +2589,168 @@ pub const Opcode = enum(u16) {...@@ -2831,702 +2589,168 @@ pub const Opcode = enum(u16) {
2831 .OpGroupLogicalAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2589 .OpGroupLogicalAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2832 .OpGroupLogicalOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2590 .OpGroupLogicalOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2833 .OpGroupLogicalXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },2591 .OpGroupLogicalXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2834 .OpRoundFToTF32INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2835 .OpMaskedGatherINTEL => struct { id_result_type: Id, id_result: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id, fill_empty: Id },
2836 .OpMaskedScatterINTEL => struct { input_vector: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id },
2837 .OpConvertHandleToImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2838 .OpConvertHandleToSamplerINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2839 .OpConvertHandleToSampledImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2840 .OpFDot2MixAcc32VALVE => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id },
2841 .OpFDot2MixAcc16VALVE => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id },
2842 .OpFDot4MixAcc32VALVE => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id },
2843 };2592 };
2844 }2593 }
2845 pub fn class(self: Opcode) Class {2594
2846 return switch (self) {2595 pub fn class(opcode: Opcode) Class {
2847 .OpNop => .miscellaneous,2596 return switch (@backingInt(opcode)) {
2848 .OpUndef => .miscellaneous,2597 0...1 => .miscellaneous,
2849 .OpSourceContinued => .debug,2598 2...8 => .debug,
2850 .OpSource => .debug,2599 10...12 => .extension,
2851 .OpSourceExtension => .debug,2600 14...17 => .mode_setting,
2852 .OpName => .debug,2601 19...39 => .type_declaration,
2853 .OpMemberName => .debug,2602 41...52 => .constant_creation,
2854 .OpString => .debug,2603 54...57 => .function,
2855 .OpLine => .debug,2604 59...70 => .memory,
2856 .OpExtension => .extension,2605 71...75 => .annotation,
2857 .OpExtInstImport => .extension,2606 77...84 => .composite,
2858 .OpExtInst => .extension,2607 86...107 => .image,
2859 .OpMemoryModel => .mode_setting,2608 109...124 => .conversion,
2860 .OpEntryPoint => .mode_setting,2609 126...152 => .arithmetic,
2861 .OpExecutionMode => .mode_setting,2610 154...191 => .relational_and_logical,
2862 .OpCapability => .mode_setting,2611 194...205 => .bit,
2863 .OpTypeVoid => .type_declaration,2612 207...215 => .derivative,
2864 .OpTypeBool => .type_declaration,2613 218...221 => .primitive,
2865 .OpTypeInt => .type_declaration,2614 224...225 => .barrier,
2866 .OpTypeFloat => .type_declaration,2615 227...242 => .atomic,
2867 .OpTypeVector => .type_declaration,2616 245...257 => .control_flow,
2868 .OpTypeMatrix => .type_declaration,2617 259...271 => .group,
2869 .OpTypeImage => .type_declaration,2618 274...288 => .pipe,
2870 .OpTypeSampler => .type_declaration,2619 291...304 => .device_side_enqueue,
2871 .OpTypeSampledImage => .type_declaration,2620 305...316 => .image,
2872 .OpTypeArray => .type_declaration,2621 317 => .debug,
2873 .OpTypeRuntimeArray => .type_declaration,2622 318...319 => .atomic,
2874 .OpTypeStruct => .type_declaration,2623 320 => .image,
2875 .OpTypeOpaque => .type_declaration,2624 321 => .miscellaneous,
2876 .OpTypePointer => .type_declaration,2625 322 => .type_declaration,
2877 .OpTypeFunction => .type_declaration,2626 323...324 => .pipe,
2878 .OpTypeEvent => .type_declaration,2627 325...326 => .device_side_enqueue,
2879 .OpTypeDeviceEvent => .type_declaration,2628 327 => .type_declaration,
2880 .OpTypeReserveId => .type_declaration,2629 328...329 => .barrier,
2881 .OpTypeQueue => .type_declaration,2630 330 => .debug,
2882 .OpTypePipe => .type_declaration,2631 331 => .mode_setting,
2883 .OpTypeForwardPointer => .type_declaration,2632 332 => .annotation,
2884 .OpConstantTrue => .constant_creation,2633 333...366 => .non_uniform,
2885 .OpConstantFalse => .constant_creation,2634 400 => .composite,
2886 .OpConstant => .constant_creation,2635 401...403 => .memory,
2887 .OpConstantComposite => .constant_creation,2636 4160...4162 => .image,
2888 .OpConstantSampler => .constant_creation,2637 4416 => .control_flow,
2889 .OpConstantNull => .constant_creation,2638 4417 => .type_declaration,
2890 .OpSpecConstantTrue => .constant_creation,2639 4418...4420 => .memory,
2891 .OpSpecConstantFalse => .constant_creation,2640 4421...4422 => .group,
2892 .OpSpecConstant => .constant_creation,2641 4423...4426 => .memory,
2893 .OpSpecConstantComposite => .constant_creation,2642 4427 => .arithmetic,
2894 .OpSpecConstantOp => .constant_creation,2643 4428...4432 => .group,
2895 .OpFunction => .function,2644 4433 => .extension,
2896 .OpFunctionParameter => .function,2645 4434 => .group,
2897 .OpFunctionEnd => .function,2646 4445...4449 => .reserved,
2898 .OpFunctionCall => .function,2647 4450...4455 => .arithmetic,
2899 .OpVariable => .memory,2648 4456 => .type_declaration,
2900 .OpImageTexelPointer => .memory,2649 4457...4458 => .memory,
2901 .OpLoad => .memory,2650 4459 => .arithmetic,
2902 .OpStore => .memory,2651 4460 => .miscellaneous,
2903 .OpCopyMemory => .memory,2652 4461...4462 => .constant_creation,
2904 .OpCopyMemorySized => .memory,2653 4463 => .composite,
2905 .OpAccessChain => .memory,2654 4472 => .type_declaration,
2906 .OpInBoundsAccessChain => .memory,2655 4473...5056 => .reserved,
2907 .OpPtrAccessChain => .memory,2656 5110...5111 => .non_uniform,
2908 .OpArrayLength => .memory,2657 5115 => .type_declaration,
2909 .OpGenericPtrMemSemantics => .memory,2658 5119 => .memory,
2910 .OpInBoundsPtrAccessChain => .memory,2659 5121 => .control_flow,
2911 .OpDecorate => .annotation,2660 5126 => .memory,
2912 .OpMemberDecorate => .annotation,2661 5127 => .annotation,
2913 .OpDecorationGroup => .annotation,2662 5129...5148 => .constant_creation,
2914 .OpGroupDecorate => .annotation,2663 5158...5159 => .miscellaneous,
2915 .OpGroupMemberDecorate => .annotation,2664 5288 => .type_declaration,
2916 .OpVectorExtractDynamic => .composite,2665 5294...5295 => .reserved,
2917 .OpVectorInsertDynamic => .composite,2666 5296 => .non_uniform,
2918 .OpVectorShuffle => .composite,2667 5304...5312 => .reserved,
2919 .OpCompositeConstruct => .composite,2668 5313 => .type_declaration,
2920 .OpCompositeExtract => .composite,2669 5314...5340 => .reserved,
2921 .OpCompositeInsert => .composite,2670 5341 => .type_declaration,
2922 .OpCopyObject => .composite,2671 5347...5365 => .reserved,
2923 .OpTranspose => .composite,2672 5380 => .control_flow,
2924 .OpSampledImage => .image,2673 5381 => .reserved,
2925 .OpImageSampleImplicitLod => .image,2674 5614...5615 => .atomic,
2926 .OpImageSampleExplicitLod => .image,2675 5630...5631 => .miscellaneous,
2927 .OpImageSampleDrefImplicitLod => .image,2676 5632...5633 => .annotation,
2928 .OpImageSampleDrefExplicitLod => .image,2677 6016...6032 => .reserved,
2929 .OpImageSampleProjImplicitLod => .image,2678 6035 => .atomic,
2930 .OpImageSampleProjExplicitLod => .image,2679 6145 => .miscellaneous,
2931 .OpImageSampleProjDrefImplicitLod => .image,2680 6401...6408 => .group,
2932 .OpImageSampleProjDrefExplicitLod => .image,2681 else => unreachable,
2933 .OpImageFetch => .image,2682 };
2934 .OpImageGather => .image,2683 }
2935 .OpImageDrefGather => .image,2684
2936 .OpImageRead => .image,2685 pub fn resultIndex(opcode: Opcode) ?u8 {
2937 .OpImageWrite => .image,2686 const list = opcode.operands();
2938 .OpImage => .image,2687 if (list.len == 0) return null;
2939 .OpImageQueryFormat => .image,2688 return switch (list[0].kind) {
2940 .OpImageQueryOrder => .image,2689 .id_result => 1,
2941 .OpImageQuerySizeLod => .image,2690 .id_result_type => 2,
2942 .OpImageQuerySize => .image,2691 else => null,
2943 .OpImageQueryLod => .image,2692 };
2944 .OpImageQueryLevels => .image,2693 }
2945 .OpImageQuerySamples => .image,2694
2946 .OpConvertFToU => .conversion,2695 pub fn instructionSize(comptime opcode: Opcode, ops: opcode.Operands()) usize {
2947 .OpConvertFToS => .conversion,2696 return operandsSize(opcode.Operands(), ops) + 1;
2948 .OpConvertSToF => .conversion,2697 }
2949 .OpConvertUToF => .conversion,2698
2950 .OpUConvert => .conversion,2699 fn operandsSize(comptime T: type, ops: T) usize {
2951 .OpSConvert => .conversion,2700 const info = switch (@typeInfo(T)) {
2952 .OpFConvert => .conversion,2701 .@"struct" => |info| info,
2953 .OpQuantizeToF16 => .conversion,2702 .void => return 0,
2954 .OpConvertPtrToU => .conversion,2703 else => unreachable,
2955 .OpSatConvertSToU => .conversion,2704 };
2956 .OpSatConvertUToS => .conversion,2705
2957 .OpConvertUToPtr => .conversion,2706 var total: usize = 0;
2958 .OpPtrCastToGeneric => .conversion,2707 inline for (info.field_names, info.field_types) |field_name, field_type| {
2959 .OpGenericCastToPtr => .conversion,2708 total += operandSize(field_type, @field(ops, field_name));
2960 .OpGenericCastToPtrExplicit => .conversion,2709 }
2961 .OpBitcast => .conversion,2710
2962 .OpSNegate => .arithmetic,2711 return total;
2963 .OpFNegate => .arithmetic,2712 }
2964 .OpIAdd => .arithmetic,2713
2965 .OpFAdd => .arithmetic,2714 fn operandSize(comptime T: type, operand: T) usize {
2966 .OpISub => .arithmetic,2715 return switch (T) {
2967 .OpFSub => .arithmetic,2716 LiteralSpecConstantOpInteger => unreachable,
2968 .OpIMul => .arithmetic,2717 Id, LiteralInteger, LiteralExtInstInteger => 1,
2969 .OpFMul => .arithmetic,2718 LiteralString => @divCeil(operand.len + 1, @sizeOf(Word)),
2970 .OpUDiv => .arithmetic,2719 LiteralContextDependentNumber => switch (operand) {
2971 .OpSDiv => .arithmetic,2720 .int32, .uint32, .float32 => 1,
2972 .OpFDiv => .arithmetic,2721 .int64, .uint64, .float64 => 2,
2973 .OpUMod => .arithmetic,2722 },
2974 .OpSRem => .arithmetic,2723 PairLiteralIntegerIdRef, PairIdRefLiteralInteger, PairIdRefIdRef => 2,
2975 .OpSMod => .arithmetic,2724 else => switch (@typeInfo(T)) {
2976 .OpFRem => .arithmetic,2725 .@"enum" => 1,
2977 .OpFMod => .arithmetic,2726 .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
2978 .OpVectorTimesScalar => .arithmetic,2727 .pointer => |info| blk: {
2979 .OpMatrixTimesScalar => .arithmetic,2728 std.debug.assert(info.size == .slice);
2980 .OpVectorTimesMatrix => .arithmetic,2729 var total: usize = 0;
2981 .OpMatrixTimesVector => .arithmetic,2730 for (operand) |item| {
2982 .OpMatrixTimesMatrix => .arithmetic,2731 total += operandSize(info.child, item);
2983 .OpOuterProduct => .arithmetic,2732 }
2984 .OpDot => .arithmetic,2733 break :blk total;
2985 .OpIAddCarry => .arithmetic,2734 },
2986 .OpISubBorrow => .arithmetic,2735 .@"struct" => |struct_info| {
2987 .OpUMulExtended => .arithmetic,2736 if (struct_info.layout == .@"packed") return 1;
2988 .OpSMulExtended => .arithmetic,2737 var total: usize = 0;
2989 .OpAny => .relational_and_logical,2738 inline for (struct_info.field_names, struct_info.field_types) |field_name, field_type| {
2990 .OpAll => .relational_and_logical,2739 switch (@typeInfo(field_type)) {
2991 .OpIsNan => .relational_and_logical,2740 .optional => |info| if (@field(operand, field_name)) |child| {
2992 .OpIsInf => .relational_and_logical,2741 total += operandsSize(info.child, child);
2993 .OpIsFinite => .relational_and_logical,2742 },
2994 .OpIsNormal => .relational_and_logical,2743 .bool, .int => {},
2995 .OpSignBitSet => .relational_and_logical,2744 else => unreachable,
2996 .OpLessOrGreater => .relational_and_logical,2745 }
2997 .OpOrdered => .relational_and_logical,2746 }
2998 .OpUnordered => .relational_and_logical,2747 return total + 1;
2999 .OpLogicalEqual => .relational_and_logical,2748 },
3000 .OpLogicalNotEqual => .relational_and_logical,2749 .@"union" => switch (operand) {
3001 .OpLogicalOr => .relational_and_logical,2750 inline else => |op, tag| operandsSize(@FieldType(T, @tagName(tag)), op) + 1,
3002 .OpLogicalAnd => .relational_and_logical,2751 },
3003 .OpLogicalNot => .relational_and_logical,2752 else => unreachable,
3004 .OpSelect => .relational_and_logical,2753 },
3005 .OpIEqual => .relational_and_logical,
3006 .OpINotEqual => .relational_and_logical,
3007 .OpUGreaterThan => .relational_and_logical,
3008 .OpSGreaterThan => .relational_and_logical,
3009 .OpUGreaterThanEqual => .relational_and_logical,
3010 .OpSGreaterThanEqual => .relational_and_logical,
3011 .OpULessThan => .relational_and_logical,
3012 .OpSLessThan => .relational_and_logical,
3013 .OpULessThanEqual => .relational_and_logical,
3014 .OpSLessThanEqual => .relational_and_logical,
3015 .OpFOrdEqual => .relational_and_logical,
3016 .OpFUnordEqual => .relational_and_logical,
3017 .OpFOrdNotEqual => .relational_and_logical,
3018 .OpFUnordNotEqual => .relational_and_logical,
3019 .OpFOrdLessThan => .relational_and_logical,
3020 .OpFUnordLessThan => .relational_and_logical,
3021 .OpFOrdGreaterThan => .relational_and_logical,
3022 .OpFUnordGreaterThan => .relational_and_logical,
3023 .OpFOrdLessThanEqual => .relational_and_logical,
3024 .OpFUnordLessThanEqual => .relational_and_logical,
3025 .OpFOrdGreaterThanEqual => .relational_and_logical,
3026 .OpFUnordGreaterThanEqual => .relational_and_logical,
3027 .OpShiftRightLogical => .bit,
3028 .OpShiftRightArithmetic => .bit,
3029 .OpShiftLeftLogical => .bit,
3030 .OpBitwiseOr => .bit,
3031 .OpBitwiseXor => .bit,
3032 .OpBitwiseAnd => .bit,
3033 .OpNot => .bit,
3034 .OpBitFieldInsert => .bit,
3035 .OpBitFieldSExtract => .bit,
3036 .OpBitFieldUExtract => .bit,
3037 .OpBitReverse => .bit,
3038 .OpBitCount => .bit,
3039 .OpDPdx => .derivative,
3040 .OpDPdy => .derivative,
3041 .OpFwidth => .derivative,
3042 .OpDPdxFine => .derivative,
3043 .OpDPdyFine => .derivative,
3044 .OpFwidthFine => .derivative,
3045 .OpDPdxCoarse => .derivative,
3046 .OpDPdyCoarse => .derivative,
3047 .OpFwidthCoarse => .derivative,
3048 .OpEmitVertex => .primitive,
3049 .OpEndPrimitive => .primitive,
3050 .OpEmitStreamVertex => .primitive,
3051 .OpEndStreamPrimitive => .primitive,
3052 .OpControlBarrier => .barrier,
3053 .OpMemoryBarrier => .barrier,
3054 .OpAtomicLoad => .atomic,
3055 .OpAtomicStore => .atomic,
3056 .OpAtomicExchange => .atomic,
3057 .OpAtomicCompareExchange => .atomic,
3058 .OpAtomicCompareExchangeWeak => .atomic,
3059 .OpAtomicIIncrement => .atomic,
3060 .OpAtomicIDecrement => .atomic,
3061 .OpAtomicIAdd => .atomic,
3062 .OpAtomicISub => .atomic,
3063 .OpAtomicSMin => .atomic,
3064 .OpAtomicUMin => .atomic,
3065 .OpAtomicSMax => .atomic,
3066 .OpAtomicUMax => .atomic,
3067 .OpAtomicAnd => .atomic,
3068 .OpAtomicOr => .atomic,
3069 .OpAtomicXor => .atomic,
3070 .OpPhi => .control_flow,
3071 .OpLoopMerge => .control_flow,
3072 .OpSelectionMerge => .control_flow,
3073 .OpLabel => .control_flow,
3074 .OpBranch => .control_flow,
3075 .OpBranchConditional => .control_flow,
3076 .OpSwitch => .control_flow,
3077 .OpKill => .control_flow,
3078 .OpReturn => .control_flow,
3079 .OpReturnValue => .control_flow,
3080 .OpUnreachable => .control_flow,
3081 .OpLifetimeStart => .control_flow,
3082 .OpLifetimeStop => .control_flow,
3083 .OpGroupAsyncCopy => .group,
3084 .OpGroupWaitEvents => .group,
3085 .OpGroupAll => .group,
3086 .OpGroupAny => .group,
3087 .OpGroupBroadcast => .group,
3088 .OpGroupIAdd => .group,
3089 .OpGroupFAdd => .group,
3090 .OpGroupFMin => .group,
3091 .OpGroupUMin => .group,
3092 .OpGroupSMin => .group,
3093 .OpGroupFMax => .group,
3094 .OpGroupUMax => .group,
3095 .OpGroupSMax => .group,
3096 .OpReadPipe => .pipe,
3097 .OpWritePipe => .pipe,
3098 .OpReservedReadPipe => .pipe,
3099 .OpReservedWritePipe => .pipe,
3100 .OpReserveReadPipePackets => .pipe,
3101 .OpReserveWritePipePackets => .pipe,
3102 .OpCommitReadPipe => .pipe,
3103 .OpCommitWritePipe => .pipe,
3104 .OpIsValidReserveId => .pipe,
3105 .OpGetNumPipePackets => .pipe,
3106 .OpGetMaxPipePackets => .pipe,
3107 .OpGroupReserveReadPipePackets => .pipe,
3108 .OpGroupReserveWritePipePackets => .pipe,
3109 .OpGroupCommitReadPipe => .pipe,
3110 .OpGroupCommitWritePipe => .pipe,
3111 .OpEnqueueMarker => .device_side_enqueue,
3112 .OpEnqueueKernel => .device_side_enqueue,
3113 .OpGetKernelNDrangeSubGroupCount => .device_side_enqueue,
3114 .OpGetKernelNDrangeMaxSubGroupSize => .device_side_enqueue,
3115 .OpGetKernelWorkGroupSize => .device_side_enqueue,
3116 .OpGetKernelPreferredWorkGroupSizeMultiple => .device_side_enqueue,
3117 .OpRetainEvent => .device_side_enqueue,
3118 .OpReleaseEvent => .device_side_enqueue,
3119 .OpCreateUserEvent => .device_side_enqueue,
3120 .OpIsValidEvent => .device_side_enqueue,
3121 .OpSetUserEventStatus => .device_side_enqueue,
3122 .OpCaptureEventProfilingInfo => .device_side_enqueue,
3123 .OpGetDefaultQueue => .device_side_enqueue,
3124 .OpBuildNDRange => .device_side_enqueue,
3125 .OpImageSparseSampleImplicitLod => .image,
3126 .OpImageSparseSampleExplicitLod => .image,
3127 .OpImageSparseSampleDrefImplicitLod => .image,
3128 .OpImageSparseSampleDrefExplicitLod => .image,
3129 .OpImageSparseSampleProjImplicitLod => .image,
3130 .OpImageSparseSampleProjExplicitLod => .image,
3131 .OpImageSparseSampleProjDrefImplicitLod => .image,
3132 .OpImageSparseSampleProjDrefExplicitLod => .image,
3133 .OpImageSparseFetch => .image,
3134 .OpImageSparseGather => .image,
3135 .OpImageSparseDrefGather => .image,
3136 .OpImageSparseTexelsResident => .image,
3137 .OpNoLine => .debug,
3138 .OpAtomicFlagTestAndSet => .atomic,
3139 .OpAtomicFlagClear => .atomic,
3140 .OpImageSparseRead => .image,
3141 .OpSizeOf => .miscellaneous,
3142 .OpTypePipeStorage => .type_declaration,
3143 .OpConstantPipeStorage => .pipe,
3144 .OpCreatePipeFromPipeStorage => .pipe,
3145 .OpGetKernelLocalSizeForSubgroupCount => .device_side_enqueue,
3146 .OpGetKernelMaxNumSubgroups => .device_side_enqueue,
3147 .OpTypeNamedBarrier => .type_declaration,
3148 .OpNamedBarrierInitialize => .barrier,
3149 .OpMemoryNamedBarrier => .barrier,
3150 .OpModuleProcessed => .debug,
3151 .OpExecutionModeId => .mode_setting,
3152 .OpDecorateId => .annotation,
3153 .OpGroupNonUniformElect => .non_uniform,
3154 .OpGroupNonUniformAll => .non_uniform,
3155 .OpGroupNonUniformAny => .non_uniform,
3156 .OpGroupNonUniformAllEqual => .non_uniform,
3157 .OpGroupNonUniformBroadcast => .non_uniform,
3158 .OpGroupNonUniformBroadcastFirst => .non_uniform,
3159 .OpGroupNonUniformBallot => .non_uniform,
3160 .OpGroupNonUniformInverseBallot => .non_uniform,
3161 .OpGroupNonUniformBallotBitExtract => .non_uniform,
3162 .OpGroupNonUniformBallotBitCount => .non_uniform,
3163 .OpGroupNonUniformBallotFindLSB => .non_uniform,
3164 .OpGroupNonUniformBallotFindMSB => .non_uniform,
3165 .OpGroupNonUniformShuffle => .non_uniform,
3166 .OpGroupNonUniformShuffleXor => .non_uniform,
3167 .OpGroupNonUniformShuffleUp => .non_uniform,
3168 .OpGroupNonUniformShuffleDown => .non_uniform,
3169 .OpGroupNonUniformIAdd => .non_uniform,
3170 .OpGroupNonUniformFAdd => .non_uniform,
3171 .OpGroupNonUniformIMul => .non_uniform,
3172 .OpGroupNonUniformFMul => .non_uniform,
3173 .OpGroupNonUniformSMin => .non_uniform,
3174 .OpGroupNonUniformUMin => .non_uniform,
3175 .OpGroupNonUniformFMin => .non_uniform,
3176 .OpGroupNonUniformSMax => .non_uniform,
3177 .OpGroupNonUniformUMax => .non_uniform,
3178 .OpGroupNonUniformFMax => .non_uniform,
3179 .OpGroupNonUniformBitwiseAnd => .non_uniform,
3180 .OpGroupNonUniformBitwiseOr => .non_uniform,
3181 .OpGroupNonUniformBitwiseXor => .non_uniform,
3182 .OpGroupNonUniformLogicalAnd => .non_uniform,
3183 .OpGroupNonUniformLogicalOr => .non_uniform,
3184 .OpGroupNonUniformLogicalXor => .non_uniform,
3185 .OpGroupNonUniformQuadBroadcast => .non_uniform,
3186 .OpGroupNonUniformQuadSwap => .non_uniform,
3187 .OpCopyLogical => .composite,
3188 .OpPtrEqual => .memory,
3189 .OpPtrNotEqual => .memory,
3190 .OpPtrDiff => .memory,
3191 .OpColorAttachmentReadEXT => .image,
3192 .OpDepthAttachmentReadEXT => .image,
3193 .OpStencilAttachmentReadEXT => .image,
3194 .OpTypeTensorARM => .type_declaration,
3195 .OpTensorReadARM => .tensor,
3196 .OpTensorWriteARM => .tensor,
3197 .OpTensorQuerySizeARM => .tensor,
3198 .OpGraphConstantARM => .graph,
3199 .OpGraphEntryPointARM => .graph,
3200 .OpGraphARM => .graph,
3201 .OpGraphInputARM => .graph,
3202 .OpGraphSetOutputARM => .graph,
3203 .OpGraphEndARM => .graph,
3204 .OpTypeGraphARM => .type_declaration,
3205 .OpTerminateInvocation => .control_flow,
3206 .OpTypeUntypedPointerKHR => .type_declaration,
3207 .OpUntypedVariableKHR => .memory,
3208 .OpUntypedAccessChainKHR => .memory,
3209 .OpUntypedInBoundsAccessChainKHR => .memory,
3210 .OpSubgroupBallotKHR => .group,
3211 .OpSubgroupFirstInvocationKHR => .group,
3212 .OpUntypedPtrAccessChainKHR => .memory,
3213 .OpUntypedInBoundsPtrAccessChainKHR => .memory,
3214 .OpUntypedArrayLengthKHR => .memory,
3215 .OpUntypedPrefetchKHR => .memory,
3216 .OpFmaKHR => .arithmetic,
3217 .OpSubgroupAllKHR => .group,
3218 .OpSubgroupAnyKHR => .group,
3219 .OpSubgroupAllEqualKHR => .group,
3220 .OpGroupNonUniformRotateKHR => .group,
3221 .OpSubgroupReadInvocationKHR => .group,
3222 .OpExtInstWithForwardRefsKHR => .extension,
3223 .OpUntypedGroupAsyncCopyKHR => .group,
3224 .OpTraceRayKHR => .reserved,
3225 .OpExecuteCallableKHR => .reserved,
3226 .OpConvertUToAccelerationStructureKHR => .reserved,
3227 .OpIgnoreIntersectionKHR => .reserved,
3228 .OpTerminateRayKHR => .reserved,
3229 .OpSDot => .arithmetic,
3230 .OpUDot => .arithmetic,
3231 .OpSUDot => .arithmetic,
3232 .OpSDotAccSat => .arithmetic,
3233 .OpUDotAccSat => .arithmetic,
3234 .OpSUDotAccSat => .arithmetic,
3235 .OpTypeCooperativeMatrixKHR => .type_declaration,
3236 .OpCooperativeMatrixLoadKHR => .memory,
3237 .OpCooperativeMatrixStoreKHR => .memory,
3238 .OpCooperativeMatrixMulAddKHR => .arithmetic,
3239 .OpCooperativeMatrixLengthKHR => .miscellaneous,
3240 .OpConstantCompositeReplicateEXT => .constant_creation,
3241 .OpSpecConstantCompositeReplicateEXT => .constant_creation,
3242 .OpCompositeConstructReplicateEXT => .composite,
3243 .OpTypeRayQueryKHR => .type_declaration,
3244 .OpRayQueryInitializeKHR => .reserved,
3245 .OpRayQueryTerminateKHR => .reserved,
3246 .OpRayQueryGenerateIntersectionKHR => .reserved,
3247 .OpRayQueryConfirmIntersectionKHR => .reserved,
3248 .OpRayQueryProceedKHR => .reserved,
3249 .OpRayQueryGetIntersectionTypeKHR => .reserved,
3250 .OpImageSampleWeightedQCOM => .image,
3251 .OpImageBoxFilterQCOM => .image,
3252 .OpImageBlockMatchSSDQCOM => .image,
3253 .OpImageBlockMatchSADQCOM => .image,
3254 .OpBitCastArrayQCOM => .conversion,
3255 .OpImageBlockMatchWindowSSDQCOM => .image,
3256 .OpImageBlockMatchWindowSADQCOM => .image,
3257 .OpImageBlockMatchGatherSSDQCOM => .image,
3258 .OpImageBlockMatchGatherSADQCOM => .image,
3259 .OpCompositeConstructCoopMatQCOM => .composite,
3260 .OpCompositeExtractCoopMatQCOM => .composite,
3261 .OpExtractSubArrayQCOM => .composite,
3262 .OpGroupIAddNonUniformAMD => .group,
3263 .OpGroupFAddNonUniformAMD => .group,
3264 .OpGroupFMinNonUniformAMD => .group,
3265 .OpGroupUMinNonUniformAMD => .group,
3266 .OpGroupSMinNonUniformAMD => .group,
3267 .OpGroupFMaxNonUniformAMD => .group,
3268 .OpGroupUMaxNonUniformAMD => .group,
3269 .OpGroupSMaxNonUniformAMD => .group,
3270 .OpFragmentMaskFetchAMD => .reserved,
3271 .OpFragmentFetchAMD => .reserved,
3272 .OpReadClockKHR => .reserved,
3273 .OpAllocateNodePayloadsAMDX => .reserved,
3274 .OpEnqueueNodePayloadsAMDX => .reserved,
3275 .OpTypeNodePayloadArrayAMDX => .reserved,
3276 .OpFinishWritingNodePayloadAMDX => .reserved,
3277 .OpNodePayloadArrayLengthAMDX => .reserved,
3278 .OpIsNodePayloadValidAMDX => .reserved,
3279 .OpConstantStringAMDX => .reserved,
3280 .OpSpecConstantStringAMDX => .reserved,
3281 .OpGroupNonUniformQuadAllKHR => .non_uniform,
3282 .OpGroupNonUniformQuadAnyKHR => .non_uniform,
3283 .OpTypeBufferEXT => .type_declaration,
3284 .OpBufferPointerEXT => .memory,
3285 .OpAbortKHR => .control_flow,
3286 .OpUntypedImageTexelPointerEXT => .memory,
3287 .OpMemberDecorateIdEXT => .annotation,
3288 .OpConstantSizeOfEXT => .constant_creation,
3289 .OpConstantDataKHR => .constant_creation,
3290 .OpSpecConstantDataKHR => .constant_creation,
3291 .OpPoisonKHR => .miscellaneous,
3292 .OpFreezeKHR => .miscellaneous,
3293 .OpHitObjectRecordHitMotionNV => .reserved,
3294 .OpHitObjectRecordHitWithIndexMotionNV => .reserved,
3295 .OpHitObjectRecordMissMotionNV => .reserved,
3296 .OpHitObjectGetWorldToObjectNV => .reserved,
3297 .OpHitObjectGetObjectToWorldNV => .reserved,
3298 .OpHitObjectGetObjectRayDirectionNV => .reserved,
3299 .OpHitObjectGetObjectRayOriginNV => .reserved,
3300 .OpHitObjectTraceRayMotionNV => .reserved,
3301 .OpHitObjectGetShaderRecordBufferHandleNV => .reserved,
3302 .OpHitObjectGetShaderBindingTableRecordIndexNV => .reserved,
3303 .OpHitObjectRecordEmptyNV => .reserved,
3304 .OpHitObjectTraceRayNV => .reserved,
3305 .OpHitObjectRecordHitNV => .reserved,
3306 .OpHitObjectRecordHitWithIndexNV => .reserved,
3307 .OpHitObjectRecordMissNV => .reserved,
3308 .OpHitObjectExecuteShaderNV => .reserved,
3309 .OpHitObjectGetCurrentTimeNV => .reserved,
3310 .OpHitObjectGetAttributesNV => .reserved,
3311 .OpHitObjectGetHitKindNV => .reserved,
3312 .OpHitObjectGetPrimitiveIndexNV => .reserved,
3313 .OpHitObjectGetGeometryIndexNV => .reserved,
3314 .OpHitObjectGetInstanceIdNV => .reserved,
3315 .OpHitObjectGetInstanceCustomIndexNV => .reserved,
3316 .OpHitObjectGetWorldRayDirectionNV => .reserved,
3317 .OpHitObjectGetWorldRayOriginNV => .reserved,
3318 .OpHitObjectGetRayTMaxNV => .reserved,
3319 .OpHitObjectGetRayTMinNV => .reserved,
3320 .OpHitObjectIsEmptyNV => .reserved,
3321 .OpHitObjectIsHitNV => .reserved,
3322 .OpHitObjectIsMissNV => .reserved,
3323 .OpReorderThreadWithHitObjectNV => .reserved,
3324 .OpReorderThreadWithHintNV => .reserved,
3325 .OpTypeHitObjectNV => .type_declaration,
3326 .OpImageSampleFootprintNV => .image,
3327 .OpTypeVectorIdEXT => .type_declaration,
3328 .OpCooperativeVectorMatrixMulNV => .reserved,
3329 .OpCooperativeVectorOuterProductAccumulateNV => .reserved,
3330 .OpCooperativeVectorReduceSumAccumulateNV => .reserved,
3331 .OpCooperativeVectorMatrixMulAddNV => .reserved,
3332 .OpCooperativeMatrixConvertNV => .conversion,
3333 .OpEmitMeshTasksEXT => .reserved,
3334 .OpSetMeshOutputsEXT => .reserved,
3335 .OpGroupNonUniformPartitionEXT => .non_uniform,
3336 .OpWritePackedPrimitiveIndices4x8NV => .reserved,
3337 .OpFetchMicroTriangleVertexPositionNV => .reserved,
3338 .OpFetchMicroTriangleVertexBarycentricNV => .reserved,
3339 .OpCooperativeVectorLoadNV => .memory,
3340 .OpCooperativeVectorStoreNV => .memory,
3341 .OpHitObjectRecordFromQueryEXT => .reserved,
3342 .OpHitObjectRecordMissEXT => .reserved,
3343 .OpHitObjectRecordMissMotionEXT => .reserved,
3344 .OpHitObjectGetIntersectionTriangleVertexPositionsEXT => .reserved,
3345 .OpHitObjectGetRayFlagsEXT => .reserved,
3346 .OpHitObjectSetShaderBindingTableRecordIndexEXT => .reserved,
3347 .OpHitObjectReorderExecuteShaderEXT => .reserved,
3348 .OpHitObjectTraceReorderExecuteEXT => .reserved,
3349 .OpHitObjectTraceMotionReorderExecuteEXT => .reserved,
3350 .OpTypeHitObjectEXT => .type_declaration,
3351 .OpReorderThreadWithHintEXT => .reserved,
3352 .OpReorderThreadWithHitObjectEXT => .reserved,
3353 .OpHitObjectTraceRayEXT => .reserved,
3354 .OpHitObjectTraceRayMotionEXT => .reserved,
3355 .OpHitObjectRecordEmptyEXT => .reserved,
3356 .OpHitObjectExecuteShaderEXT => .reserved,
3357 .OpHitObjectGetCurrentTimeEXT => .reserved,
3358 .OpHitObjectGetAttributesEXT => .reserved,
3359 .OpHitObjectGetHitKindEXT => .reserved,
3360 .OpHitObjectGetPrimitiveIndexEXT => .reserved,
3361 .OpHitObjectGetGeometryIndexEXT => .reserved,
3362 .OpHitObjectGetInstanceIdEXT => .reserved,
3363 .OpHitObjectGetInstanceCustomIndexEXT => .reserved,
3364 .OpHitObjectGetObjectRayOriginEXT => .reserved,
3365 .OpHitObjectGetObjectRayDirectionEXT => .reserved,
3366 .OpHitObjectGetWorldRayDirectionEXT => .reserved,
3367 .OpHitObjectGetWorldRayOriginEXT => .reserved,
3368 .OpHitObjectGetObjectToWorldEXT => .reserved,
3369 .OpHitObjectGetWorldToObjectEXT => .reserved,
3370 .OpHitObjectGetRayTMaxEXT => .reserved,
3371 .OpReportIntersectionKHR => .reserved,
3372 .OpIgnoreIntersectionNV => .reserved,
3373 .OpTerminateRayNV => .reserved,
3374 .OpTraceNV => .reserved,
3375 .OpTraceMotionNV => .reserved,
3376 .OpTraceRayMotionNV => .reserved,
3377 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => .reserved,
3378 .OpTypeAccelerationStructureKHR => .type_declaration,
3379 .OpExecuteCallableNV => .reserved,
3380 .OpRayQueryGetIntersectionClusterIdNV => .reserved,
3381 .OpHitObjectGetClusterIdNV => .reserved,
3382 .OpHitObjectGetRayTMinEXT => .reserved,
3383 .OpHitObjectGetShaderBindingTableRecordIndexEXT => .reserved,
3384 .OpHitObjectGetShaderRecordBufferHandleEXT => .reserved,
3385 .OpHitObjectIsEmptyEXT => .reserved,
3386 .OpHitObjectIsHitEXT => .reserved,
3387 .OpHitObjectIsMissEXT => .reserved,
3388 .OpTypeCooperativeMatrixNV => .type_declaration,
3389 .OpCooperativeMatrixLoadNV => .reserved,
3390 .OpCooperativeMatrixStoreNV => .reserved,
3391 .OpCooperativeMatrixMulAddNV => .reserved,
3392 .OpCooperativeMatrixLengthNV => .reserved,
3393 .OpBeginInvocationInterlockEXT => .reserved,
3394 .OpEndInvocationInterlockEXT => .reserved,
3395 .OpCooperativeMatrixReduceNV => .arithmetic,
3396 .OpCooperativeMatrixLoadTensorNV => .memory,
3397 .OpCooperativeMatrixStoreTensorNV => .memory,
3398 .OpCooperativeMatrixPerElementOpNV => .function,
3399 .OpTypeTensorLayoutNV => .type_declaration,
3400 .OpTypeTensorViewNV => .type_declaration,
3401 .OpCreateTensorLayoutNV => .reserved,
3402 .OpTensorLayoutSetDimensionNV => .reserved,
3403 .OpTensorLayoutSetStrideNV => .reserved,
3404 .OpTensorLayoutSliceNV => .reserved,
3405 .OpTensorLayoutSetClampValueNV => .reserved,
3406 .OpCreateTensorViewNV => .reserved,
3407 .OpTensorViewSetDimensionNV => .reserved,
3408 .OpTensorViewSetStrideNV => .reserved,
3409 .OpDemoteToHelperInvocation => .control_flow,
3410 .OpIsHelperInvocationEXT => .reserved,
3411 .OpTensorViewSetClipNV => .reserved,
3412 .OpTensorLayoutSetBlockSizeNV => .reserved,
3413 .OpCooperativeMatrixTransposeNV => .conversion,
3414 .OpConvertUToImageNV => .reserved,
3415 .OpConvertUToSamplerNV => .reserved,
3416 .OpConvertImageToUNV => .reserved,
3417 .OpConvertSamplerToUNV => .reserved,
3418 .OpConvertUToSampledImageNV => .reserved,
3419 .OpConvertSampledImageToUNV => .reserved,
3420 .OpSamplerImageAddressingModeNV => .reserved,
3421 .OpRawAccessChainNV => .memory,
3422 .OpRayQueryGetIntersectionSpherePositionNV => .reserved,
3423 .OpRayQueryGetIntersectionSphereRadiusNV => .reserved,
3424 .OpRayQueryGetIntersectionLSSPositionsNV => .reserved,
3425 .OpRayQueryGetIntersectionLSSRadiiNV => .reserved,
3426 .OpRayQueryGetIntersectionLSSHitValueNV => .reserved,
3427 .OpHitObjectGetSpherePositionNV => .reserved,
3428 .OpHitObjectGetSphereRadiusNV => .reserved,
3429 .OpHitObjectGetLSSPositionsNV => .reserved,
3430 .OpHitObjectGetLSSRadiiNV => .reserved,
3431 .OpHitObjectIsSphereHitNV => .reserved,
3432 .OpHitObjectIsLSSHitNV => .reserved,
3433 .OpRayQueryIsSphereHitNV => .reserved,
3434 .OpRayQueryIsLSSHitNV => .reserved,
3435 .OpSubgroupShuffleINTEL => .group,
3436 .OpSubgroupShuffleDownINTEL => .group,
3437 .OpSubgroupShuffleUpINTEL => .group,
3438 .OpSubgroupShuffleXorINTEL => .group,
3439 .OpSubgroupBlockReadINTEL => .group,
3440 .OpSubgroupBlockWriteINTEL => .group,
3441 .OpSubgroupImageBlockReadINTEL => .group,
3442 .OpSubgroupImageBlockWriteINTEL => .group,
3443 .OpSubgroupImageMediaBlockReadINTEL => .group,
3444 .OpSubgroupImageMediaBlockWriteINTEL => .group,
3445 .OpUCountLeadingZerosINTEL => .reserved,
3446 .OpUCountTrailingZerosINTEL => .reserved,
3447 .OpAbsISubINTEL => .reserved,
3448 .OpAbsUSubINTEL => .reserved,
3449 .OpIAddSatINTEL => .reserved,
3450 .OpUAddSatINTEL => .reserved,
3451 .OpIAverageINTEL => .reserved,
3452 .OpUAverageINTEL => .reserved,
3453 .OpIAverageRoundedINTEL => .reserved,
3454 .OpUAverageRoundedINTEL => .reserved,
3455 .OpISubSatINTEL => .reserved,
3456 .OpUSubSatINTEL => .reserved,
3457 .OpIMul32x16INTEL => .reserved,
3458 .OpUMul32x16INTEL => .reserved,
3459 .OpAtomicFMinEXT => .atomic,
3460 .OpAtomicFMaxEXT => .atomic,
3461 .OpAssumeTrueKHR => .miscellaneous,
3462 .OpExpectKHR => .miscellaneous,
3463 .OpDecorateString => .annotation,
3464 .OpMemberDecorateString => .annotation,
3465 .OpVariableLengthArrayINTEL => .memory,
3466 .OpSaveMemoryINTEL => .memory,
3467 .OpRestoreMemoryINTEL => .memory,
3468 .OpLoopControlINTEL => .reserved,
3469 .OpRayQueryGetRayTMinKHR => .reserved,
3470 .OpRayQueryGetRayFlagsKHR => .reserved,
3471 .OpRayQueryGetIntersectionTKHR => .reserved,
3472 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => .reserved,
3473 .OpRayQueryGetIntersectionInstanceIdKHR => .reserved,
3474 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => .reserved,
3475 .OpRayQueryGetIntersectionGeometryIndexKHR => .reserved,
3476 .OpRayQueryGetIntersectionPrimitiveIndexKHR => .reserved,
3477 .OpRayQueryGetIntersectionBarycentricsKHR => .reserved,
3478 .OpRayQueryGetIntersectionFrontFaceKHR => .reserved,
3479 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => .reserved,
3480 .OpRayQueryGetIntersectionObjectRayDirectionKHR => .reserved,
3481 .OpRayQueryGetIntersectionObjectRayOriginKHR => .reserved,
3482 .OpRayQueryGetWorldRayDirectionKHR => .reserved,
3483 .OpRayQueryGetWorldRayOriginKHR => .reserved,
3484 .OpRayQueryGetIntersectionObjectToWorldKHR => .reserved,
3485 .OpRayQueryGetIntersectionWorldToObjectKHR => .reserved,
3486 .OpAtomicFAddEXT => .atomic,
3487 .OpTypeBufferSurfaceINTEL => .type_declaration,
3488 .OpTypeStructContinuedINTEL => .type_declaration,
3489 .OpConstantCompositeContinuedINTEL => .constant_creation,
3490 .OpSpecConstantCompositeContinuedINTEL => .constant_creation,
3491 .OpCompositeConstructContinuedINTEL => .composite,
3492 .OpConvertFToBF16INTEL => .conversion,
3493 .OpConvertBF16ToFINTEL => .conversion,
3494 .OpControlBarrierArriveINTEL => .barrier,
3495 .OpControlBarrierWaitINTEL => .barrier,
3496 .OpArithmeticFenceEXT => .miscellaneous,
3497 .OpSubgroupBlockPrefetchINTEL => .group,
3498 .OpSubgroup2DBlockLoadINTEL => .group,
3499 .OpSubgroup2DBlockLoadTransformINTEL => .group,
3500 .OpSubgroup2DBlockLoadTransposeINTEL => .group,
3501 .OpSubgroup2DBlockPrefetchINTEL => .group,
3502 .OpSubgroup2DBlockStoreINTEL => .group,
3503 .OpSubgroupMatrixMultiplyAccumulateINTEL => .group,
3504 .OpBitwiseFunctionINTEL => .bit,
3505 .OpUntypedVariableLengthArrayINTEL => .memory,
3506 .OpConditionalExtensionINTEL => .extension,
3507 .OpConditionalEntryPointINTEL => .mode_setting,
3508 .OpConditionalCapabilityINTEL => .mode_setting,
3509 .OpSpecConstantTargetINTEL => .constant_creation,
3510 .OpSpecConstantArchitectureINTEL => .constant_creation,
3511 .OpSpecConstantCapabilitiesINTEL => .constant_creation,
3512 .OpConditionalCopyObjectINTEL => .composite,
3513 .OpGroupIMulKHR => .group,
3514 .OpGroupFMulKHR => .group,
3515 .OpGroupBitwiseAndKHR => .group,
3516 .OpGroupBitwiseOrKHR => .group,
3517 .OpGroupBitwiseXorKHR => .group,
3518 .OpGroupLogicalAndKHR => .group,
3519 .OpGroupLogicalOrKHR => .group,
3520 .OpGroupLogicalXorKHR => .group,
3521 .OpRoundFToTF32INTEL => .conversion,
3522 .OpMaskedGatherINTEL => .memory,
3523 .OpMaskedScatterINTEL => .memory,
3524 .OpConvertHandleToImageINTEL => .image,
3525 .OpConvertHandleToSamplerINTEL => .image,
3526 .OpConvertHandleToSampledImageINTEL => .image,
3527 .OpFDot2MixAcc32VALVE => .reserved,
3528 .OpFDot2MixAcc16VALVE => .reserved,
3529 .OpFDot4MixAcc32VALVE => .reserved,
3530 };2754 };
3531 }2755 }
3532};2756};
...@@ -3694,6 +2918,173 @@ pub const OpenClOpcode = enum(u16) {...@@ -3694,6 +2918,173 @@ pub const OpenClOpcode = enum(u16) {
3694 u_abs_diff = 202,2918 u_abs_diff = 202,
3695 u_mul_hi = 203,2919 u_mul_hi = 203,
3696 u_mad_hi = 204,2920 u_mad_hi = 204,
2921
2922 pub fn operands(opcode: OpenClOpcode) []const Operand {
2923 return switch (opcode) {
2924 .acos => &.{.{ .kind = .id_ref }},
2925 .acosh => &.{.{ .kind = .id_ref }},
2926 .acospi => &.{.{ .kind = .id_ref }},
2927 .asin => &.{.{ .kind = .id_ref }},
2928 .asinh => &.{.{ .kind = .id_ref }},
2929 .asinpi => &.{.{ .kind = .id_ref }},
2930 .atan => &.{.{ .kind = .id_ref }},
2931 .atan2 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2932 .atanh => &.{.{ .kind = .id_ref }},
2933 .atanpi => &.{.{ .kind = .id_ref }},
2934 .atan2pi => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2935 .cbrt => &.{.{ .kind = .id_ref }},
2936 .ceil => &.{.{ .kind = .id_ref }},
2937 .copysign => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2938 .cos => &.{.{ .kind = .id_ref }},
2939 .cosh => &.{.{ .kind = .id_ref }},
2940 .cospi => &.{.{ .kind = .id_ref }},
2941 .erfc => &.{.{ .kind = .id_ref }},
2942 .erf => &.{.{ .kind = .id_ref }},
2943 .exp => &.{.{ .kind = .id_ref }},
2944 .exp2 => &.{.{ .kind = .id_ref }},
2945 .exp10 => &.{.{ .kind = .id_ref }},
2946 .expm1 => &.{.{ .kind = .id_ref }},
2947 .fabs => &.{.{ .kind = .id_ref }},
2948 .fdim => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2949 .floor => &.{.{ .kind = .id_ref }},
2950 .fma => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2951 .fmax => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2952 .fmin => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2953 .fmod => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2954 .fract => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2955 .frexp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2956 .hypot => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2957 .ilogb => &.{.{ .kind = .id_ref }},
2958 .ldexp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2959 .lgamma => &.{.{ .kind = .id_ref }},
2960 .lgamma_r => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2961 .log => &.{.{ .kind = .id_ref }},
2962 .log2 => &.{.{ .kind = .id_ref }},
2963 .log10 => &.{.{ .kind = .id_ref }},
2964 .log1p => &.{.{ .kind = .id_ref }},
2965 .logb => &.{.{ .kind = .id_ref }},
2966 .mad => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2967 .maxmag => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2968 .minmag => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2969 .modf => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2970 .nan => &.{.{ .kind = .id_ref }},
2971 .nextafter => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2972 .pow => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2973 .pown => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2974 .powr => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2975 .remainder => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2976 .remquo => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2977 .rint => &.{.{ .kind = .id_ref }},
2978 .rootn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2979 .round => &.{.{ .kind = .id_ref }},
2980 .rsqrt => &.{.{ .kind = .id_ref }},
2981 .sin => &.{.{ .kind = .id_ref }},
2982 .sincos => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2983 .sinh => &.{.{ .kind = .id_ref }},
2984 .sinpi => &.{.{ .kind = .id_ref }},
2985 .sqrt => &.{.{ .kind = .id_ref }},
2986 .tan => &.{.{ .kind = .id_ref }},
2987 .tanh => &.{.{ .kind = .id_ref }},
2988 .tanpi => &.{.{ .kind = .id_ref }},
2989 .tgamma => &.{.{ .kind = .id_ref }},
2990 .trunc => &.{.{ .kind = .id_ref }},
2991 .half_cos => &.{.{ .kind = .id_ref }},
2992 .half_divide => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
2993 .half_exp => &.{.{ .kind = .id_ref }},
2994 .half_exp2 => &.{.{ .kind = .id_ref }},
2995 .half_exp10 => &.{.{ .kind = .id_ref }},
2996 .half_log => &.{.{ .kind = .id_ref }},
2997 .half_log2 => &.{.{ .kind = .id_ref }},
2998 .half_log10 => &.{.{ .kind = .id_ref }},
2999 .half_powr => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3000 .half_recip => &.{.{ .kind = .id_ref }},
3001 .half_rsqrt => &.{.{ .kind = .id_ref }},
3002 .half_sin => &.{.{ .kind = .id_ref }},
3003 .half_sqrt => &.{.{ .kind = .id_ref }},
3004 .half_tan => &.{.{ .kind = .id_ref }},
3005 .native_cos => &.{.{ .kind = .id_ref }},
3006 .native_divide => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3007 .native_exp => &.{.{ .kind = .id_ref }},
3008 .native_exp2 => &.{.{ .kind = .id_ref }},
3009 .native_exp10 => &.{.{ .kind = .id_ref }},
3010 .native_log => &.{.{ .kind = .id_ref }},
3011 .native_log2 => &.{.{ .kind = .id_ref }},
3012 .native_log10 => &.{.{ .kind = .id_ref }},
3013 .native_powr => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3014 .native_recip => &.{.{ .kind = .id_ref }},
3015 .native_rsqrt => &.{.{ .kind = .id_ref }},
3016 .native_sin => &.{.{ .kind = .id_ref }},
3017 .native_sqrt => &.{.{ .kind = .id_ref }},
3018 .native_tan => &.{.{ .kind = .id_ref }},
3019 .fclamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3020 .degrees => &.{.{ .kind = .id_ref }},
3021 .fmax_common => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3022 .fmin_common => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3023 .mix => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3024 .radians => &.{.{ .kind = .id_ref }},
3025 .step => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3026 .smoothstep => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3027 .sign => &.{.{ .kind = .id_ref }},
3028 .cross => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3029 .distance => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3030 .length => &.{.{ .kind = .id_ref }},
3031 .normalize => &.{.{ .kind = .id_ref }},
3032 .fast_distance => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3033 .fast_length => &.{.{ .kind = .id_ref }},
3034 .fast_normalize => &.{.{ .kind = .id_ref }},
3035 .s_abs => &.{.{ .kind = .id_ref }},
3036 .s_abs_diff => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3037 .s_add_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3038 .u_add_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3039 .s_hadd => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3040 .u_hadd => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3041 .s_rhadd => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3042 .u_rhadd => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3043 .s_clamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3044 .u_clamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3045 .clz => &.{.{ .kind = .id_ref }},
3046 .ctz => &.{.{ .kind = .id_ref }},
3047 .s_mad_hi => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3048 .u_mad_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3049 .s_mad_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3050 .s_max => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3051 .u_max => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3052 .s_min => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3053 .u_min => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3054 .s_mul_hi => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3055 .rotate => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3056 .s_sub_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3057 .u_sub_sat => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3058 .u_upsample => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3059 .s_upsample => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3060 .popcount => &.{.{ .kind = .id_ref }},
3061 .s_mad24 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3062 .u_mad24 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3063 .s_mul24 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3064 .u_mul24 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3065 .vloadn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
3066 .vstoren => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3067 .vload_half => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3068 .vload_halfn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
3069 .vstore_half => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3070 .vstore_half_r => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .fp_rounding_mode } },
3071 .vstore_halfn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3072 .vstore_halfn_r => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .fp_rounding_mode } },
3073 .vloada_halfn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .literal_integer } },
3074 .vstorea_halfn => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3075 .vstorea_halfn_r => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .fp_rounding_mode } },
3076 .shuffle => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3077 .shuffle2 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3078 .printf => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .variadic } },
3079 .prefetch => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3080 .bitselect => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3081 .select => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3082 .u_abs => &.{.{ .kind = .id_ref }},
3083 .u_abs_diff => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3084 .u_mul_hi => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3085 .u_mad_hi => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3086 };
3087 }
3697};3088};
36983089
3699pub const GlslOpcode = enum(u16) {3090pub const GlslOpcode = enum(u16) {
...@@ -3778,12 +3169,94 @@ pub const GlslOpcode = enum(u16) {...@@ -3778,12 +3169,94 @@ pub const GlslOpcode = enum(u16) {
3778 NMin = 79,3169 NMin = 79,
3779 NMax = 80,3170 NMax = 80,
3780 NClamp = 81,3171 NClamp = 81,
3781};
37823172
3783pub const Zig = enum(u16) {3173 pub fn operands(opcode: GlslOpcode) []const Operand {
3784 InvocationGlobal = 0,3174 return switch (opcode) {
3175 .Round => &.{.{ .kind = .id_ref }},
3176 .RoundEven => &.{.{ .kind = .id_ref }},
3177 .Trunc => &.{.{ .kind = .id_ref }},
3178 .FAbs => &.{.{ .kind = .id_ref }},
3179 .SAbs => &.{.{ .kind = .id_ref }},
3180 .FSign => &.{.{ .kind = .id_ref }},
3181 .SSign => &.{.{ .kind = .id_ref }},
3182 .Floor => &.{.{ .kind = .id_ref }},
3183 .Ceil => &.{.{ .kind = .id_ref }},
3184 .Fract => &.{.{ .kind = .id_ref }},
3185 .Radians => &.{.{ .kind = .id_ref }},
3186 .Degrees => &.{.{ .kind = .id_ref }},
3187 .Sin => &.{.{ .kind = .id_ref }},
3188 .Cos => &.{.{ .kind = .id_ref }},
3189 .Tan => &.{.{ .kind = .id_ref }},
3190 .Asin => &.{.{ .kind = .id_ref }},
3191 .Acos => &.{.{ .kind = .id_ref }},
3192 .Atan => &.{.{ .kind = .id_ref }},
3193 .Sinh => &.{.{ .kind = .id_ref }},
3194 .Cosh => &.{.{ .kind = .id_ref }},
3195 .Tanh => &.{.{ .kind = .id_ref }},
3196 .Asinh => &.{.{ .kind = .id_ref }},
3197 .Acosh => &.{.{ .kind = .id_ref }},
3198 .Atanh => &.{.{ .kind = .id_ref }},
3199 .Atan2 => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3200 .Pow => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3201 .Exp => &.{.{ .kind = .id_ref }},
3202 .Log => &.{.{ .kind = .id_ref }},
3203 .Exp2 => &.{.{ .kind = .id_ref }},
3204 .Log2 => &.{.{ .kind = .id_ref }},
3205 .Sqrt => &.{.{ .kind = .id_ref }},
3206 .InverseSqrt => &.{.{ .kind = .id_ref }},
3207 .Determinant => &.{.{ .kind = .id_ref }},
3208 .MatrixInverse => &.{.{ .kind = .id_ref }},
3209 .Modf => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3210 .ModfStruct => &.{.{ .kind = .id_ref }},
3211 .FMin => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3212 .UMin => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3213 .SMin => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3214 .FMax => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3215 .UMax => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3216 .SMax => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3217 .FClamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3218 .UClamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3219 .SClamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3220 .FMix => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3221 .IMix => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3222 .Step => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3223 .SmoothStep => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3224 .Fma => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3225 .Frexp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3226 .FrexpStruct => &.{.{ .kind = .id_ref }},
3227 .Ldexp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3228 .PackSnorm4x8 => &.{.{ .kind = .id_ref }},
3229 .PackUnorm4x8 => &.{.{ .kind = .id_ref }},
3230 .PackSnorm2x16 => &.{.{ .kind = .id_ref }},
3231 .PackUnorm2x16 => &.{.{ .kind = .id_ref }},
3232 .PackHalf2x16 => &.{.{ .kind = .id_ref }},
3233 .PackDouble2x32 => &.{.{ .kind = .id_ref }},
3234 .UnpackSnorm2x16 => &.{.{ .kind = .id_ref }},
3235 .UnpackUnorm2x16 => &.{.{ .kind = .id_ref }},
3236 .UnpackHalf2x16 => &.{.{ .kind = .id_ref }},
3237 .UnpackSnorm4x8 => &.{.{ .kind = .id_ref }},
3238 .UnpackUnorm4x8 => &.{.{ .kind = .id_ref }},
3239 .UnpackDouble2x32 => &.{.{ .kind = .id_ref }},
3240 .Length => &.{.{ .kind = .id_ref }},
3241 .Distance => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3242 .Cross => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3243 .Normalize => &.{.{ .kind = .id_ref }},
3244 .FaceForward => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3245 .Reflect => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3246 .Refract => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3247 .FindILsb => &.{.{ .kind = .id_ref }},
3248 .FindSMsb => &.{.{ .kind = .id_ref }},
3249 .FindUMsb => &.{.{ .kind = .id_ref }},
3250 .InterpolateAtCentroid => &.{.{ .kind = .id_ref }},
3251 .InterpolateAtSample => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3252 .InterpolateAtOffset => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3253 .NMin => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3254 .NMax => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3255 .NClamp => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
3256 };
3257 }
3785};3258};
3786pub const ImageOperands = packed struct {3259pub const ImageOperands = packed struct(Word) {
3787 bias: bool = false,3260 bias: bool = false,
3788 lod: bool = false,3261 lod: bool = false,
3789 grad: bool = false,3262 grad: bool = false,
...@@ -3801,21 +3274,7 @@ pub const ImageOperands = packed struct {...@@ -3801,21 +3274,7 @@ pub const ImageOperands = packed struct {
3801 nontemporal: bool = false,3274 nontemporal: bool = false,
3802 _reserved_bit_15: bool = false,3275 _reserved_bit_15: bool = false,
3803 offsets: bool = false,3276 offsets: bool = false,
3804 _reserved_bit_17: bool = false,3277 _reserved_bits_17_to_31: u15 = 0,
3805 _reserved_bit_18: bool = false,
3806 _reserved_bit_19: bool = false,
3807 _reserved_bit_20: bool = false,
3808 _reserved_bit_21: bool = false,
3809 _reserved_bit_22: bool = false,
3810 _reserved_bit_23: bool = false,
3811 _reserved_bit_24: bool = false,
3812 _reserved_bit_25: bool = false,
3813 _reserved_bit_26: bool = false,
3814 _reserved_bit_27: bool = false,
3815 _reserved_bit_28: bool = false,
3816 _reserved_bit_29: bool = false,
3817 _reserved_bit_30: bool = false,
3818 _reserved_bit_31: bool = false,
38193278
3820 pub const Extended = struct {3279 pub const Extended = struct {
3821 bias: ?struct { id_ref: Id } = null,3280 bias: ?struct { id_ref: Id } = null,
...@@ -3835,92 +3294,27 @@ pub const ImageOperands = packed struct {...@@ -3835,92 +3294,27 @@ pub const ImageOperands = packed struct {
3835 nontemporal: bool = false,3294 nontemporal: bool = false,
3836 _reserved_bit_15: bool = false,3295 _reserved_bit_15: bool = false,
3837 offsets: ?struct { id_ref: Id } = null,3296 offsets: ?struct { id_ref: Id } = null,
3838 _reserved_bit_17: bool = false,3297 _reserved_bits_17_to_31: u15 = 0,
3839 _reserved_bit_18: bool = false,
3840 _reserved_bit_19: bool = false,
3841 _reserved_bit_20: bool = false,
3842 _reserved_bit_21: bool = false,
3843 _reserved_bit_22: bool = false,
3844 _reserved_bit_23: bool = false,
3845 _reserved_bit_24: bool = false,
3846 _reserved_bit_25: bool = false,
3847 _reserved_bit_26: bool = false,
3848 _reserved_bit_27: bool = false,
3849 _reserved_bit_28: bool = false,
3850 _reserved_bit_29: bool = false,
3851 _reserved_bit_30: bool = false,
3852 _reserved_bit_31: bool = false,
3853 };3298 };
3854};3299};
3855pub const FPFastMathMode = packed struct {3300pub const FPFastMathMode = packed struct(Word) {
3856 not_na_n: bool = false,3301 not_na_n: bool = false,
3857 not_inf: bool = false,3302 not_inf: bool = false,
3858 nsz: bool = false,3303 nsz: bool = false,
3859 allow_recip: bool = false,3304 allow_recip: bool = false,
3860 fast: bool = false,3305 fast: bool = false,
3861 _reserved_bit_5: bool = false,3306 _reserved_bits_5_to_15: u11 = 0,
3862 _reserved_bit_6: bool = false,
3863 _reserved_bit_7: bool = false,
3864 _reserved_bit_8: bool = false,
3865 _reserved_bit_9: bool = false,
3866 _reserved_bit_10: bool = false,
3867 _reserved_bit_11: bool = false,
3868 _reserved_bit_12: bool = false,
3869 _reserved_bit_13: bool = false,
3870 _reserved_bit_14: bool = false,
3871 _reserved_bit_15: bool = false,
3872 allow_contract: bool = false,3307 allow_contract: bool = false,
3873 allow_reassoc: bool = false,3308 allow_reassoc: bool = false,
3874 allow_transform: bool = false,3309 allow_transform: bool = false,
3875 _reserved_bit_19: bool = false,3310 _reserved_bits_19_to_31: u13 = 0,
3876 _reserved_bit_20: bool = false,
3877 _reserved_bit_21: bool = false,
3878 _reserved_bit_22: bool = false,
3879 _reserved_bit_23: bool = false,
3880 _reserved_bit_24: bool = false,
3881 _reserved_bit_25: bool = false,
3882 _reserved_bit_26: bool = false,
3883 _reserved_bit_27: bool = false,
3884 _reserved_bit_28: bool = false,
3885 _reserved_bit_29: bool = false,
3886 _reserved_bit_30: bool = false,
3887 _reserved_bit_31: bool = false,
3888};3311};
3889pub const SelectionControl = packed struct {3312pub const SelectionControl = packed struct(Word) {
3890 flatten: bool = false,3313 flatten: bool = false,
3891 dont_flatten: bool = false,3314 dont_flatten: bool = false,
3892 _reserved_bit_2: bool = false,3315 _reserved_bits_2_to_31: u30 = 0,
3893 _reserved_bit_3: bool = false,
3894 _reserved_bit_4: bool = false,
3895 _reserved_bit_5: bool = false,
3896 _reserved_bit_6: bool = false,
3897 _reserved_bit_7: bool = false,
3898 _reserved_bit_8: bool = false,
3899 _reserved_bit_9: bool = false,
3900 _reserved_bit_10: bool = false,
3901 _reserved_bit_11: bool = false,
3902 _reserved_bit_12: bool = false,
3903 _reserved_bit_13: bool = false,
3904 _reserved_bit_14: bool = false,
3905 _reserved_bit_15: bool = false,
3906 _reserved_bit_16: bool = false,
3907 _reserved_bit_17: bool = false,
3908 _reserved_bit_18: bool = false,
3909 _reserved_bit_19: bool = false,
3910 _reserved_bit_20: bool = false,
3911 _reserved_bit_21: bool = false,
3912 _reserved_bit_22: bool = false,
3913 _reserved_bit_23: bool = false,
3914 _reserved_bit_24: bool = false,
3915 _reserved_bit_25: bool = false,
3916 _reserved_bit_26: bool = false,
3917 _reserved_bit_27: bool = false,
3918 _reserved_bit_28: bool = false,
3919 _reserved_bit_29: bool = false,
3920 _reserved_bit_30: bool = false,
3921 _reserved_bit_31: bool = false,
3922};3316};
3923pub const LoopControl = packed struct {3317pub const LoopControl = packed struct(Word) {
3924 unroll: bool = false,3318 unroll: bool = false,
3925 dont_unroll: bool = false,3319 dont_unroll: bool = false,
3926 dependency_infinite: bool = false,3320 dependency_infinite: bool = false,
...@@ -3930,29 +3324,7 @@ pub const LoopControl = packed struct {...@@ -3930,29 +3324,7 @@ pub const LoopControl = packed struct {
3930 iteration_multiple: bool = false,3324 iteration_multiple: bool = false,
3931 peel_count: bool = false,3325 peel_count: bool = false,
3932 partial_count: bool = false,3326 partial_count: bool = false,
3933 _reserved_bit_9: bool = false,3327 _reserved_bits_9_to_31: u23 = 0,
3934 _reserved_bit_10: bool = false,
3935 _reserved_bit_11: bool = false,
3936 _reserved_bit_12: bool = false,
3937 _reserved_bit_13: bool = false,
3938 _reserved_bit_14: bool = false,
3939 _reserved_bit_15: bool = false,
3940 initiation_interval_altera: bool = false,
3941 max_concurrency_altera: bool = false,
3942 dependency_array_altera: bool = false,
3943 pipeline_enable_altera: bool = false,
3944 loop_coalesce_altera: bool = false,
3945 max_interleaving_altera: bool = false,
3946 speculated_iterations_altera: bool = false,
3947 no_fusion_altera: bool = false,
3948 loop_count_altera: bool = false,
3949 max_reinvocation_delay_altera: bool = false,
3950 _reserved_bit_26: bool = false,
3951 _reserved_bit_27: bool = false,
3952 _reserved_bit_28: bool = false,
3953 _reserved_bit_29: bool = false,
3954 _reserved_bit_30: bool = false,
3955 _reserved_bit_31: bool = false,
39563328
3957 pub const Extended = struct {3329 pub const Extended = struct {
3958 unroll: bool = false,3330 unroll: bool = false,
...@@ -3964,66 +3336,19 @@ pub const LoopControl = packed struct {...@@ -3964,66 +3336,19 @@ pub const LoopControl = packed struct {
3964 iteration_multiple: ?struct { literal_integer: LiteralInteger } = null,3336 iteration_multiple: ?struct { literal_integer: LiteralInteger } = null,
3965 peel_count: ?struct { literal_integer: LiteralInteger } = null,3337 peel_count: ?struct { literal_integer: LiteralInteger } = null,
3966 partial_count: ?struct { literal_integer: LiteralInteger } = null,3338 partial_count: ?struct { literal_integer: LiteralInteger } = null,
3967 _reserved_bit_9: bool = false,3339 _reserved_bits_9_to_31: u23 = 0,
3968 _reserved_bit_10: bool = false,
3969 _reserved_bit_11: bool = false,
3970 _reserved_bit_12: bool = false,
3971 _reserved_bit_13: bool = false,
3972 _reserved_bit_14: bool = false,
3973 _reserved_bit_15: bool = false,
3974 initiation_interval_altera: ?struct { literal_integer: LiteralInteger } = null,
3975 max_concurrency_altera: ?struct { literal_integer: LiteralInteger } = null,
3976 dependency_array_altera: ?struct { literal_integer: LiteralInteger } = null,
3977 pipeline_enable_altera: ?struct { literal_integer: LiteralInteger } = null,
3978 loop_coalesce_altera: ?struct { literal_integer: LiteralInteger } = null,
3979 max_interleaving_altera: ?struct { literal_integer: LiteralInteger } = null,
3980 speculated_iterations_altera: ?struct { literal_integer: LiteralInteger } = null,
3981 no_fusion_altera: bool = false,
3982 loop_count_altera: ?struct { literal_integer: LiteralInteger } = null,
3983 max_reinvocation_delay_altera: ?struct { literal_integer: LiteralInteger } = null,
3984 _reserved_bit_26: bool = false,
3985 _reserved_bit_27: bool = false,
3986 _reserved_bit_28: bool = false,
3987 _reserved_bit_29: bool = false,
3988 _reserved_bit_30: bool = false,
3989 _reserved_bit_31: bool = false,
3990 };3340 };
3991};3341};
3992pub const FunctionControl = packed struct {3342pub const FunctionControl = packed struct(Word) {
3993 @"inline": bool = false,3343 @"inline": bool = false,
3994 dont_inline: bool = false,3344 dont_inline: bool = false,
3995 pure: bool = false,3345 pure: bool = false,
3996 @"const": bool = false,3346 @"const": bool = false,
3997 _reserved_bit_4: bool = false,3347 _reserved_bits_4_to_15: u12 = 0,
3998 _reserved_bit_5: bool = false,
3999 _reserved_bit_6: bool = false,
4000 _reserved_bit_7: bool = false,
4001 _reserved_bit_8: bool = false,
4002 _reserved_bit_9: bool = false,
4003 _reserved_bit_10: bool = false,
4004 _reserved_bit_11: bool = false,
4005 _reserved_bit_12: bool = false,
4006 _reserved_bit_13: bool = false,
4007 _reserved_bit_14: bool = false,
4008 _reserved_bit_15: bool = false,
4009 opt_none_ext: bool = false,3348 opt_none_ext: bool = false,
4010 _reserved_bit_17: bool = false,3349 _reserved_bits_17_to_31: u15 = 0,
4011 _reserved_bit_18: bool = false,
4012 _reserved_bit_19: bool = false,
4013 _reserved_bit_20: bool = false,
4014 _reserved_bit_21: bool = false,
4015 _reserved_bit_22: bool = false,
4016 _reserved_bit_23: bool = false,
4017 _reserved_bit_24: bool = false,
4018 _reserved_bit_25: bool = false,
4019 _reserved_bit_26: bool = false,
4020 _reserved_bit_27: bool = false,
4021 _reserved_bit_28: bool = false,
4022 _reserved_bit_29: bool = false,
4023 _reserved_bit_30: bool = false,
4024 _reserved_bit_31: bool = false,
4025};3350};
4026pub const MemorySemantics = packed struct {3351pub const MemorySemantics = packed struct(Word) {
4027 _reserved_bit_0: bool = false,3352 _reserved_bit_0: bool = false,
4028 acquire: bool = false,3353 acquire: bool = false,
4029 release: bool = false,3354 release: bool = false,
...@@ -4040,56 +3365,16 @@ pub const MemorySemantics = packed struct {...@@ -4040,56 +3365,16 @@ pub const MemorySemantics = packed struct {
4040 make_available: bool = false,3365 make_available: bool = false,
4041 make_visible: bool = false,3366 make_visible: bool = false,
4042 @"volatile": bool = false,3367 @"volatile": bool = false,
4043 _reserved_bit_16: bool = false,3368 _reserved_bits_16_to_31: u16 = 0,
4044 _reserved_bit_17: bool = false,
4045 _reserved_bit_18: bool = false,
4046 _reserved_bit_19: bool = false,
4047 _reserved_bit_20: bool = false,
4048 _reserved_bit_21: bool = false,
4049 _reserved_bit_22: bool = false,
4050 _reserved_bit_23: bool = false,
4051 _reserved_bit_24: bool = false,
4052 _reserved_bit_25: bool = false,
4053 _reserved_bit_26: bool = false,
4054 _reserved_bit_27: bool = false,
4055 _reserved_bit_28: bool = false,
4056 _reserved_bit_29: bool = false,
4057 _reserved_bit_30: bool = false,
4058 _reserved_bit_31: bool = false,
4059};3369};
4060pub const MemoryAccess = packed struct {3370pub const MemoryAccess = packed struct(Word) {
4061 @"volatile": bool = false,3371 @"volatile": bool = false,
4062 aligned: bool = false,3372 aligned: bool = false,
4063 nontemporal: bool = false,3373 nontemporal: bool = false,
4064 make_pointer_available: bool = false,3374 make_pointer_available: bool = false,
4065 make_pointer_visible: bool = false,3375 make_pointer_visible: bool = false,
4066 non_private_pointer: bool = false,3376 non_private_pointer: bool = false,
4067 _reserved_bit_6: bool = false,3377 _reserved_bits_6_to_31: u26 = 0,
4068 _reserved_bit_7: bool = false,
4069 _reserved_bit_8: bool = false,
4070 _reserved_bit_9: bool = false,
4071 _reserved_bit_10: bool = false,
4072 _reserved_bit_11: bool = false,
4073 _reserved_bit_12: bool = false,
4074 _reserved_bit_13: bool = false,
4075 _reserved_bit_14: bool = false,
4076 _reserved_bit_15: bool = false,
4077 alias_scope_intel_mask: bool = false,
4078 no_alias_intel_mask: bool = false,
4079 _reserved_bit_18: bool = false,
4080 _reserved_bit_19: bool = false,
4081 _reserved_bit_20: bool = false,
4082 _reserved_bit_21: bool = false,
4083 _reserved_bit_22: bool = false,
4084 _reserved_bit_23: bool = false,
4085 _reserved_bit_24: bool = false,
4086 _reserved_bit_25: bool = false,
4087 _reserved_bit_26: bool = false,
4088 _reserved_bit_27: bool = false,
4089 _reserved_bit_28: bool = false,
4090 _reserved_bit_29: bool = false,
4091 _reserved_bit_30: bool = false,
4092 _reserved_bit_31: bool = false,
40933378
4094 pub const Extended = struct {3379 pub const Extended = struct {
4095 @"volatile": bool = false,3380 @"volatile": bool = false,
...@@ -4098,69 +3383,14 @@ pub const MemoryAccess = packed struct {...@@ -4098,69 +3383,14 @@ pub const MemoryAccess = packed struct {
4098 make_pointer_available: ?struct { id_scope: Id } = null,3383 make_pointer_available: ?struct { id_scope: Id } = null,
4099 make_pointer_visible: ?struct { id_scope: Id } = null,3384 make_pointer_visible: ?struct { id_scope: Id } = null,
4100 non_private_pointer: bool = false,3385 non_private_pointer: bool = false,
4101 _reserved_bit_6: bool = false,3386 _reserved_bits_6_to_31: u26 = 0,
4102 _reserved_bit_7: bool = false,
4103 _reserved_bit_8: bool = false,
4104 _reserved_bit_9: bool = false,
4105 _reserved_bit_10: bool = false,
4106 _reserved_bit_11: bool = false,
4107 _reserved_bit_12: bool = false,
4108 _reserved_bit_13: bool = false,
4109 _reserved_bit_14: bool = false,
4110 _reserved_bit_15: bool = false,
4111 alias_scope_intel_mask: ?struct { id_ref: Id } = null,
4112 no_alias_intel_mask: ?struct { id_ref: Id } = null,
4113 _reserved_bit_18: bool = false,
4114 _reserved_bit_19: bool = false,
4115 _reserved_bit_20: bool = false,
4116 _reserved_bit_21: bool = false,
4117 _reserved_bit_22: bool = false,
4118 _reserved_bit_23: bool = false,
4119 _reserved_bit_24: bool = false,
4120 _reserved_bit_25: bool = false,
4121 _reserved_bit_26: bool = false,
4122 _reserved_bit_27: bool = false,
4123 _reserved_bit_28: bool = false,
4124 _reserved_bit_29: bool = false,
4125 _reserved_bit_30: bool = false,
4126 _reserved_bit_31: bool = false,
4127 };3387 };
4128};3388};
4129pub const KernelProfilingInfo = packed struct {3389pub const KernelProfilingInfo = packed struct(Word) {
4130 cmd_exec_time: bool = false,3390 cmd_exec_time: bool = false,
4131 _reserved_bit_1: bool = false,3391 _reserved_bits_1_to_31: u31 = 0,
4132 _reserved_bit_2: bool = false,
4133 _reserved_bit_3: bool = false,
4134 _reserved_bit_4: bool = false,
4135 _reserved_bit_5: bool = false,
4136 _reserved_bit_6: bool = false,
4137 _reserved_bit_7: bool = false,
4138 _reserved_bit_8: bool = false,
4139 _reserved_bit_9: bool = false,
4140 _reserved_bit_10: bool = false,
4141 _reserved_bit_11: bool = false,
4142 _reserved_bit_12: bool = false,
4143 _reserved_bit_13: bool = false,
4144 _reserved_bit_14: bool = false,
4145 _reserved_bit_15: bool = false,
4146 _reserved_bit_16: bool = false,
4147 _reserved_bit_17: bool = false,
4148 _reserved_bit_18: bool = false,
4149 _reserved_bit_19: bool = false,
4150 _reserved_bit_20: bool = false,
4151 _reserved_bit_21: bool = false,
4152 _reserved_bit_22: bool = false,
4153 _reserved_bit_23: bool = false,
4154 _reserved_bit_24: bool = false,
4155 _reserved_bit_25: bool = false,
4156 _reserved_bit_26: bool = false,
4157 _reserved_bit_27: bool = false,
4158 _reserved_bit_28: bool = false,
4159 _reserved_bit_29: bool = false,
4160 _reserved_bit_30: bool = false,
4161 _reserved_bit_31: bool = false,
4162};3392};
4163pub const RayFlags = packed struct {3393pub const RayFlags = packed struct(Word) {
4164 opaque_khr: bool = false,3394 opaque_khr: bool = false,
4165 no_opaque_khr: bool = false,3395 no_opaque_khr: bool = false,
4166 terminate_on_first_hit_khr: bool = false,3396 terminate_on_first_hit_khr: bool = false,
...@@ -4172,95 +3402,17 @@ pub const RayFlags = packed struct {...@@ -4172,95 +3402,17 @@ pub const RayFlags = packed struct {
4172 skip_triangles_khr: bool = false,3402 skip_triangles_khr: bool = false,
4173 skip_aab_bs_khr: bool = false,3403 skip_aab_bs_khr: bool = false,
4174 force_opacity_micromap2state_ext: bool = false,3404 force_opacity_micromap2state_ext: bool = false,
4175 _reserved_bit_11: bool = false,3405 _reserved_bits_11_to_31: u21 = 0,
4176 _reserved_bit_12: bool = false,
4177 _reserved_bit_13: bool = false,
4178 _reserved_bit_14: bool = false,
4179 _reserved_bit_15: bool = false,
4180 _reserved_bit_16: bool = false,
4181 _reserved_bit_17: bool = false,
4182 _reserved_bit_18: bool = false,
4183 _reserved_bit_19: bool = false,
4184 _reserved_bit_20: bool = false,
4185 _reserved_bit_21: bool = false,
4186 _reserved_bit_22: bool = false,
4187 _reserved_bit_23: bool = false,
4188 _reserved_bit_24: bool = false,
4189 _reserved_bit_25: bool = false,
4190 _reserved_bit_26: bool = false,
4191 _reserved_bit_27: bool = false,
4192 _reserved_bit_28: bool = false,
4193 _reserved_bit_29: bool = false,
4194 _reserved_bit_30: bool = false,
4195 _reserved_bit_31: bool = false,
4196};3406};
4197pub const FragmentShadingRate = packed struct {3407pub const FragmentShadingRate = packed struct(Word) {
4198 vertical2pixels: bool = false,3408 vertical2pixels: bool = false,
4199 vertical4pixels: bool = false,3409 vertical4pixels: bool = false,
4200 horizontal2pixels: bool = false,3410 horizontal2pixels: bool = false,
4201 horizontal4pixels: bool = false,3411 horizontal4pixels: bool = false,
4202 _reserved_bit_4: bool = false,3412 _reserved_bits_4_to_31: u28 = 0,
4203 _reserved_bit_5: bool = false,
4204 _reserved_bit_6: bool = false,
4205 _reserved_bit_7: bool = false,
4206 _reserved_bit_8: bool = false,
4207 _reserved_bit_9: bool = false,
4208 _reserved_bit_10: bool = false,
4209 _reserved_bit_11: bool = false,
4210 _reserved_bit_12: bool = false,
4211 _reserved_bit_13: bool = false,
4212 _reserved_bit_14: bool = false,
4213 _reserved_bit_15: bool = false,
4214 _reserved_bit_16: bool = false,
4215 _reserved_bit_17: bool = false,
4216 _reserved_bit_18: bool = false,
4217 _reserved_bit_19: bool = false,
4218 _reserved_bit_20: bool = false,
4219 _reserved_bit_21: bool = false,
4220 _reserved_bit_22: bool = false,
4221 _reserved_bit_23: bool = false,
4222 _reserved_bit_24: bool = false,
4223 _reserved_bit_25: bool = false,
4224 _reserved_bit_26: bool = false,
4225 _reserved_bit_27: bool = false,
4226 _reserved_bit_28: bool = false,
4227 _reserved_bit_29: bool = false,
4228 _reserved_bit_30: bool = false,
4229 _reserved_bit_31: bool = false,
4230};3413};
4231pub const RawAccessChainOperands = packed struct {3414pub const RawAccessChainOperands = packed struct(Word) {
4232 robustness_per_component_nv: bool = false,3415 _reserved_bits_0_to_31: u32 = 0,
4233 robustness_per_element_nv: bool = false,
4234 _reserved_bit_2: bool = false,
4235 _reserved_bit_3: bool = false,
4236 _reserved_bit_4: bool = false,
4237 _reserved_bit_5: bool = false,
4238 _reserved_bit_6: bool = false,
4239 _reserved_bit_7: bool = false,
4240 _reserved_bit_8: bool = false,
4241 _reserved_bit_9: bool = false,
4242 _reserved_bit_10: bool = false,
4243 _reserved_bit_11: bool = false,
4244 _reserved_bit_12: bool = false,
4245 _reserved_bit_13: bool = false,
4246 _reserved_bit_14: bool = false,
4247 _reserved_bit_15: bool = false,
4248 _reserved_bit_16: bool = false,
4249 _reserved_bit_17: bool = false,
4250 _reserved_bit_18: bool = false,
4251 _reserved_bit_19: bool = false,
4252 _reserved_bit_20: bool = false,
4253 _reserved_bit_21: bool = false,
4254 _reserved_bit_22: bool = false,
4255 _reserved_bit_23: bool = false,
4256 _reserved_bit_24: bool = false,
4257 _reserved_bit_25: bool = false,
4258 _reserved_bit_26: bool = false,
4259 _reserved_bit_27: bool = false,
4260 _reserved_bit_28: bool = false,
4261 _reserved_bit_29: bool = false,
4262 _reserved_bit_30: bool = false,
4263 _reserved_bit_31: bool = false,
4264};3416};
4265pub const SourceLanguage = enum(u32) {3417pub const SourceLanguage = enum(u32) {
4266 unknown = 0,3418 unknown = 0,
...@@ -4286,8 +3438,6 @@ pub const ExecutionModel = enum(u32) {...@@ -4286,8 +3438,6 @@ pub const ExecutionModel = enum(u32) {
4286 fragment = 4,3438 fragment = 4,
4287 gl_compute = 5,3439 gl_compute = 5,
4288 kernel = 6,3440 kernel = 6,
4289 task_nv = 5267,
4290 mesh_nv = 5268,
4291 ray_generation_khr = 5313,3441 ray_generation_khr = 5313,
4292 intersection_khr = 5314,3442 intersection_khr = 5314,
4293 any_hit_khr = 5315,3443 any_hit_khr = 5315,
...@@ -4358,16 +3508,7 @@ pub const ExecutionMode = enum(u32) {...@@ -4358,16 +3508,7 @@ pub const ExecutionMode = enum(u32) {
4358 signed_zero_inf_nan_preserve = 4461,3508 signed_zero_inf_nan_preserve = 4461,
4359 rounding_mode_rte = 4462,3509 rounding_mode_rte = 4462,
4360 rounding_mode_rtz = 4463,3510 rounding_mode_rtz = 4463,
4361 non_coherent_tile_attachment_read_qcom = 4489,
4362 tile_shading_rate_qcom = 4490,
4363 early_and_late_fragment_tests_amd = 5017,
4364 stencil_ref_replacing_ext = 5027,3511 stencil_ref_replacing_ext = 5027,
4365 coalescing_amdx = 5069,
4366 is_api_entry_amdx = 5070,
4367 max_node_recursion_amdx = 5071,
4368 static_num_workgroups_amdx = 5072,
4369 shader_index_amdx = 5073,
4370 max_num_workgroups_amdx = 5077,
4371 stencil_ref_unchanged_front_amd = 5079,3512 stencil_ref_unchanged_front_amd = 5079,
4372 stencil_ref_greater_front_amd = 5080,3513 stencil_ref_greater_front_amd = 5080,
4373 stencil_ref_less_front_amd = 5081,3514 stencil_ref_less_front_amd = 5081,
...@@ -4376,7 +3517,6 @@ pub const ExecutionMode = enum(u32) {...@@ -4376,7 +3517,6 @@ pub const ExecutionMode = enum(u32) {
4376 stencil_ref_less_back_amd = 5084,3517 stencil_ref_less_back_amd = 5084,
4377 quad_derivatives_khr = 5088,3518 quad_derivatives_khr = 5088,
4378 require_full_quads_khr = 5089,3519 require_full_quads_khr = 5089,
4379 shares_input_with_amdx = 5102,
4380 arithmetic_poison_khr = 5157,3520 arithmetic_poison_khr = 5157,
4381 output_lines_ext = 5269,3521 output_lines_ext = 5269,
4382 output_primitives_ext = 5270,3522 output_primitives_ext = 5270,
...@@ -4390,24 +3530,8 @@ pub const ExecutionMode = enum(u32) {...@@ -4390,24 +3530,8 @@ pub const ExecutionMode = enum(u32) {
4390 shading_rate_interlock_ordered_ext = 5370,3530 shading_rate_interlock_ordered_ext = 5370,
4391 shading_rate_interlock_unordered_ext = 5371,3531 shading_rate_interlock_unordered_ext = 5371,
4392 shader64bit_indexing_ext = 5427,3532 shader64bit_indexing_ext = 5427,
4393 shared_local_memory_size_intel = 5618,
4394 rounding_mode_rtpintel = 5620,
4395 rounding_mode_rtnintel = 5621,
4396 floating_point_mode_altintel = 5622,
4397 floating_point_mode_ieeeintel = 5623,
4398 max_workgroup_size_intel = 5893,
4399 max_work_dim_intel = 5894,
4400 no_global_offset_intel = 5895,
4401 num_simd_workitems_intel = 5896,
4402 scheduler_target_fmax_mhz_intel = 5903,
4403 maximally_reconverges_khr = 6023,3533 maximally_reconverges_khr = 6023,
4404 fp_fast_math_default = 6028,3534 fp_fast_math_default = 6028,
4405 streaming_interface_intel = 6154,
4406 register_map_interface_intel = 6160,
4407 named_barrier_count_intel = 6417,
4408 maximum_registers_intel = 6461,
4409 maximum_registers_id_intel = 6462,
4410 named_maximum_registers_intel = 6463,
44113535
4412 pub const Extended = union(ExecutionMode) {3536 pub const Extended = union(ExecutionMode) {
4413 invocations: struct { literal_integer: LiteralInteger },3537 invocations: struct { literal_integer: LiteralInteger },
...@@ -4458,16 +3582,7 @@ pub const ExecutionMode = enum(u32) {...@@ -4458,16 +3582,7 @@ pub const ExecutionMode = enum(u32) {
4458 signed_zero_inf_nan_preserve: struct { target_width: LiteralInteger },3582 signed_zero_inf_nan_preserve: struct { target_width: LiteralInteger },
4459 rounding_mode_rte: struct { target_width: LiteralInteger },3583 rounding_mode_rte: struct { target_width: LiteralInteger },
4460 rounding_mode_rtz: struct { target_width: LiteralInteger },3584 rounding_mode_rtz: struct { target_width: LiteralInteger },
4461 non_coherent_tile_attachment_read_qcom,
4462 tile_shading_rate_qcom: struct { x_rate: LiteralInteger, y_rate: LiteralInteger, z_rate: LiteralInteger },
4463 early_and_late_fragment_tests_amd,
4464 stencil_ref_replacing_ext,3585 stencil_ref_replacing_ext,
4465 coalescing_amdx,
4466 is_api_entry_amdx: struct { is_entry: Id },
4467 max_node_recursion_amdx: struct { number_of_recursions: Id },
4468 static_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4469 shader_index_amdx: struct { shader_index: Id },
4470 max_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4471 stencil_ref_unchanged_front_amd,3586 stencil_ref_unchanged_front_amd,
4472 stencil_ref_greater_front_amd,3587 stencil_ref_greater_front_amd,
4473 stencil_ref_less_front_amd,3588 stencil_ref_less_front_amd,
...@@ -4476,7 +3591,6 @@ pub const ExecutionMode = enum(u32) {...@@ -4476,7 +3591,6 @@ pub const ExecutionMode = enum(u32) {
4476 stencil_ref_less_back_amd,3591 stencil_ref_less_back_amd,
4477 quad_derivatives_khr,3592 quad_derivatives_khr,
4478 require_full_quads_khr,3593 require_full_quads_khr,
4479 shares_input_with_amdx: struct { node_name: Id, shader_index: Id },
4480 arithmetic_poison_khr,3594 arithmetic_poison_khr,
4481 output_lines_ext,3595 output_lines_ext,
4482 output_primitives_ext: struct { primitive_count: LiteralInteger },3596 output_primitives_ext: struct { primitive_count: LiteralInteger },
...@@ -4490,24 +3604,8 @@ pub const ExecutionMode = enum(u32) {...@@ -4490,24 +3604,8 @@ pub const ExecutionMode = enum(u32) {
4490 shading_rate_interlock_ordered_ext,3604 shading_rate_interlock_ordered_ext,
4491 shading_rate_interlock_unordered_ext,3605 shading_rate_interlock_unordered_ext,
4492 shader64bit_indexing_ext,3606 shader64bit_indexing_ext,
4493 shared_local_memory_size_intel: struct { size: LiteralInteger },
4494 rounding_mode_rtpintel: struct { target_width: LiteralInteger },
4495 rounding_mode_rtnintel: struct { target_width: LiteralInteger },
4496 floating_point_mode_altintel: struct { target_width: LiteralInteger },
4497 floating_point_mode_ieeeintel: struct { target_width: LiteralInteger },
4498 max_workgroup_size_intel: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger, literal_integer_2: LiteralInteger },
4499 max_work_dim_intel: struct { literal_integer: LiteralInteger },
4500 no_global_offset_intel,
4501 num_simd_workitems_intel: struct { literal_integer: LiteralInteger },
4502 scheduler_target_fmax_mhz_intel: struct { literal_integer: LiteralInteger },
4503 maximally_reconverges_khr,3607 maximally_reconverges_khr,
4504 fp_fast_math_default: struct { target_type: Id, id_ref_1: Id },3608 fp_fast_math_default: struct { target_type: Id, id_ref_1: Id },
4505 streaming_interface_intel: struct { stall_free_return: LiteralInteger },
4506 register_map_interface_intel: struct { wait_for_done_write: LiteralInteger },
4507 named_barrier_count_intel: struct { barrier_count: LiteralInteger },
4508 maximum_registers_intel: struct { number_of_registers: LiteralInteger },
4509 maximum_registers_id_intel: struct { number_of_registers: Id },
4510 named_maximum_registers_intel: struct { named_maximum_number_of_registers: NamedMaximumNumberOfRegisters },
4511 };3609 };
4512};3610};
4513pub const StorageClass = enum(u32) {3611pub const StorageClass = enum(u32) {
...@@ -4525,8 +3623,6 @@ pub const StorageClass = enum(u32) {...@@ -4525,8 +3623,6 @@ pub const StorageClass = enum(u32) {
4525 image = 11,3623 image = 11,
4526 storage_buffer = 12,3624 storage_buffer = 12,
4527 tile_image_ext = 4172,3625 tile_image_ext = 4172,
4528 tile_attachment_qcom = 4491,
4529 node_payload_amdx = 5068,
4530 callable_data_khr = 5328,3626 callable_data_khr = 5328,
4531 incoming_callable_data_khr = 5329,3627 incoming_callable_data_khr = 5329,
4532 ray_payload_khr = 5338,3628 ray_payload_khr = 5338,
...@@ -4534,12 +3630,8 @@ pub const StorageClass = enum(u32) {...@@ -4534,12 +3630,8 @@ pub const StorageClass = enum(u32) {
4534 incoming_ray_payload_khr = 5342,3630 incoming_ray_payload_khr = 5342,
4535 shader_record_buffer_khr = 5343,3631 shader_record_buffer_khr = 5343,
4536 physical_storage_buffer = 5349,3632 physical_storage_buffer = 5349,
4537 hit_object_attribute_nv = 5385,
4538 task_payload_workgroup_ext = 5402,3633 task_payload_workgroup_ext = 5402,
4539 hit_object_attribute_ext = 5411,3634 hit_object_attribute_ext = 5411,
4540 code_section_intel = 5605,
4541 device_only_altera = 5936,
4542 host_only_altera = 5937,
4543};3635};
4544pub const Dim = enum(u32) {3636pub const Dim = enum(u32) {
4545 @"1d" = 0,3637 @"1d" = 0,
...@@ -4662,30 +3754,10 @@ pub const FPRoundingMode = enum(u32) {...@@ -4662,30 +3754,10 @@ pub const FPRoundingMode = enum(u32) {
4662 rtp = 2,3754 rtp = 2,
4663 rtn = 3,3755 rtn = 3,
4664};3756};
4665pub const FPDenormMode = enum(u32) {3757pub const FPDenormMode = enum(u32) {};
4666 preserve = 0,3758pub const QuantizationModes = enum(u32) {};
4667 flush_to_zero = 1,3759pub const FPOperationMode = enum(u32) {};
4668};3760pub const OverflowModes = enum(u32) {};
4669pub const QuantizationModes = enum(u32) {
4670 trn = 0,
4671 trn_zero = 1,
4672 rnd = 2,
4673 rnd_zero = 3,
4674 rnd_inf = 4,
4675 rnd_min_inf = 5,
4676 rnd_conv = 6,
4677 rnd_conv_odd = 7,
4678};
4679pub const FPOperationMode = enum(u32) {
4680 ieee = 0,
4681 alt = 1,
4682};
4683pub const OverflowModes = enum(u32) {
4684 wrap = 0,
4685 sat = 1,
4686 sat_zero = 2,
4687 sat_sym = 3,
4688};
4689pub const LinkageType = enum(u32) {3761pub const LinkageType = enum(u32) {
4690 @"export" = 0,3762 @"export" = 0,
4691 import = 1,3763 import = 1,
...@@ -4696,12 +3768,7 @@ pub const AccessQualifier = enum(u32) {...@@ -4696,12 +3768,7 @@ pub const AccessQualifier = enum(u32) {
4696 write_only = 1,3768 write_only = 1,
4697 read_write = 2,3769 read_write = 2,
4698};3770};
4699pub const HostAccessQualifier = enum(u32) {3771pub const HostAccessQualifier = enum(u32) {};
4700 none_intel = 0,
4701 read_intel = 1,
4702 write_intel = 2,
4703 read_write_intel = 3,
4704};
4705pub const FunctionParameterAttribute = enum(u32) {3772pub const FunctionParameterAttribute = enum(u32) {
4706 zext = 0,3773 zext = 0,
4707 sext = 1,3774 sext = 1,
...@@ -4764,106 +3831,17 @@ pub const Decoration = enum(u32) {...@@ -4764,106 +3831,17 @@ pub const Decoration = enum(u32) {
4764 saturated_to_largest_float8normal_conversion_ext = 4216,3831 saturated_to_largest_float8normal_conversion_ext = 4216,
4765 no_signed_wrap = 4469,3832 no_signed_wrap = 4469,
4766 no_unsigned_wrap = 4470,3833 no_unsigned_wrap = 4470,
4767 weight_texture_qcom = 4487,
4768 block_match_texture_qcom = 4488,
4769 block_match_sampler_qcom = 4499,
4770 explicit_interp_amd = 4999,
4771 node_shares_payload_limits_with_amdx = 5019,
4772 node_max_payloads_amdx = 5020,
4773 track_finish_writing_amdx = 5078,
4774 payload_node_name_amdx = 5091,
4775 payload_node_base_index_amdx = 5098,
4776 payload_node_sparse_array_amdx = 5099,
4777 payload_node_array_size_amdx = 5100,
4778 payload_dispatch_indirect_amdx = 5105,
4779 array_stride_id_ext = 5124,3834 array_stride_id_ext = 5124,
4780 offset_id_ext = 5125,3835 offset_id_ext = 5125,
4781 utf_encoded_khr = 5145,3836 utf_encoded_khr = 5145,
4782 override_coverage_nv = 5248,
4783 passthrough_nv = 5250,
4784 viewport_relative_nv = 5252,
4785 secondary_viewport_relative_nv = 5256,
4786 per_primitive_ext = 5271,3837 per_primitive_ext = 5271,
4787 per_view_nv = 5272,
4788 per_task_nv = 5273,
4789 per_vertex_khr = 5285,3838 per_vertex_khr = 5285,
4790 non_uniform = 5300,3839 non_uniform = 5300,
4791 restrict_pointer = 5355,3840 restrict_pointer = 5355,
4792 aliased_pointer = 5356,3841 aliased_pointer = 5356,
4793 member_offset_nv = 5358,
4794 hit_object_shader_record_buffer_nv = 5386,
4795 hit_object_shader_record_buffer_ext = 5389,3842 hit_object_shader_record_buffer_ext = 5389,
4796 bank_nv = 5397,
4797 bindless_sampler_nv = 5398,
4798 bindless_image_nv = 5399,
4799 bound_sampler_nv = 5400,
4800 bound_image_nv = 5401,
4801 simt_call_intel = 5599,
4802 referenced_indirectly_intel = 5602,
4803 clobber_intel = 5607,
4804 side_effects_intel = 5608,
4805 vector_compute_variable_intel = 5624,
4806 func_param_io_kind_intel = 5625,
4807 vector_compute_function_intel = 5626,
4808 stack_call_intel = 5627,
4809 global_variable_offset_intel = 5628,
4810 counter_buffer = 5634,3843 counter_buffer = 5634,
4811 user_semantic = 5635,3844 user_semantic = 5635,
4812 user_type_google = 5636,
4813 function_rounding_mode_intel = 5822,
4814 function_denorm_mode_intel = 5823,
4815 register_altera = 5825,
4816 memory_altera = 5826,
4817 numbanks_altera = 5827,
4818 bankwidth_altera = 5828,
4819 max_private_copies_altera = 5829,
4820 singlepump_altera = 5830,
4821 doublepump_altera = 5831,
4822 max_replicates_altera = 5832,
4823 simple_dual_port_altera = 5833,
4824 merge_altera = 5834,
4825 bank_bits_altera = 5835,
4826 force_pow2depth_altera = 5836,
4827 stridesize_altera = 5883,
4828 wordsize_altera = 5884,
4829 true_dual_port_altera = 5885,
4830 burst_coalesce_altera = 5899,
4831 cache_size_altera = 5900,
4832 dont_statically_coalesce_altera = 5901,
4833 prefetch_altera = 5902,
4834 stall_enable_altera = 5905,
4835 fuse_loops_in_function_altera = 5907,
4836 math_op_dsp_mode_altera = 5909,
4837 alias_scope_intel = 5914,
4838 no_alias_intel = 5915,
4839 initiation_interval_altera = 5917,
4840 max_concurrency_altera = 5918,
4841 pipeline_enable_altera = 5919,
4842 buffer_location_altera = 5921,
4843 io_pipe_storage_altera = 5944,
4844 function_floating_point_mode_intel = 6080,
4845 single_element_vector_intel = 6085,
4846 vector_compute_callable_function_intel = 6087,
4847 media_block_iointel = 6140,
4848 stall_free_altera = 6151,
4849 fp_max_error_decoration_intel = 6170,
4850 latency_control_label_altera = 6172,
4851 latency_control_constraint_altera = 6173,
4852 conduit_kernel_argument_altera = 6175,
4853 register_map_kernel_argument_altera = 6176,
4854 mm_host_interface_address_width_altera = 6177,
4855 mm_host_interface_data_width_altera = 6178,
4856 mm_host_interface_latency_altera = 6179,
4857 mm_host_interface_read_write_mode_altera = 6180,
4858 mm_host_interface_max_burst_altera = 6181,
4859 mm_host_interface_wait_request_altera = 6182,
4860 stable_kernel_argument_altera = 6183,
4861 host_access_intel = 6188,
4862 init_mode_altera = 6190,
4863 implement_in_register_map_altera = 6191,
4864 conditional_intel = 6247,
4865 cache_control_load_intel = 6442,
4866 cache_control_store_intel = 6443,
48673845
4868 pub const Extended = union(Decoration) {3846 pub const Extended = union(Decoration) {
4869 relaxed_precision,3847 relaxed_precision,
...@@ -4916,106 +3894,17 @@ pub const Decoration = enum(u32) {...@@ -4916,106 +3894,17 @@ pub const Decoration = enum(u32) {
4916 saturated_to_largest_float8normal_conversion_ext,3894 saturated_to_largest_float8normal_conversion_ext,
4917 no_signed_wrap,3895 no_signed_wrap,
4918 no_unsigned_wrap,3896 no_unsigned_wrap,
4919 weight_texture_qcom,
4920 block_match_texture_qcom,
4921 block_match_sampler_qcom,
4922 explicit_interp_amd,
4923 node_shares_payload_limits_with_amdx: struct { payload_type: Id },
4924 node_max_payloads_amdx: struct { max_number_of_payloads: Id },
4925 track_finish_writing_amdx,
4926 payload_node_name_amdx: struct { node_name: Id },
4927 payload_node_base_index_amdx: struct { base_index: Id },
4928 payload_node_sparse_array_amdx,
4929 payload_node_array_size_amdx: struct { array_size: Id },
4930 payload_dispatch_indirect_amdx,
4931 array_stride_id_ext: struct { array_stride: Id },3897 array_stride_id_ext: struct { array_stride: Id },
4932 offset_id_ext: struct { byte_offset: Id },3898 offset_id_ext: struct { byte_offset: Id },
4933 utf_encoded_khr,3899 utf_encoded_khr,
4934 override_coverage_nv,
4935 passthrough_nv,
4936 viewport_relative_nv,
4937 secondary_viewport_relative_nv: struct { offset: LiteralInteger },
4938 per_primitive_ext,3900 per_primitive_ext,
4939 per_view_nv,
4940 per_task_nv,
4941 per_vertex_khr,3901 per_vertex_khr,
4942 non_uniform,3902 non_uniform,
4943 restrict_pointer,3903 restrict_pointer,
4944 aliased_pointer,3904 aliased_pointer,
4945 member_offset_nv: struct { member_offset: LiteralInteger },
4946 hit_object_shader_record_buffer_nv,
4947 hit_object_shader_record_buffer_ext,3905 hit_object_shader_record_buffer_ext,
4948 bank_nv: struct { bank: LiteralInteger },
4949 bindless_sampler_nv,
4950 bindless_image_nv,
4951 bound_sampler_nv,
4952 bound_image_nv,
4953 simt_call_intel: struct { n: LiteralInteger },
4954 referenced_indirectly_intel,
4955 clobber_intel: struct { register: LiteralString },
4956 side_effects_intel,
4957 vector_compute_variable_intel,
4958 func_param_io_kind_intel: struct { kind: LiteralInteger },
4959 vector_compute_function_intel,
4960 stack_call_intel,
4961 global_variable_offset_intel: struct { offset: LiteralInteger },
4962 counter_buffer: struct { counter_buffer: Id },3906 counter_buffer: struct { counter_buffer: Id },
4963 user_semantic: struct { semantic: LiteralString },3907 user_semantic: struct { semantic: LiteralString },
4964 user_type_google: struct { user_type: LiteralString },
4965 function_rounding_mode_intel: struct { target_width: LiteralInteger, fp_rounding_mode: FPRoundingMode },
4966 function_denorm_mode_intel: struct { target_width: LiteralInteger, fp_denorm_mode: FPDenormMode },
4967 register_altera,
4968 memory_altera: struct { memory_type: LiteralString },
4969 numbanks_altera: struct { banks: LiteralInteger },
4970 bankwidth_altera: struct { bank_width: LiteralInteger },
4971 max_private_copies_altera: struct { maximum_copies: LiteralInteger },
4972 singlepump_altera,
4973 doublepump_altera,
4974 max_replicates_altera: struct { maximum_replicates: LiteralInteger },
4975 simple_dual_port_altera,
4976 merge_altera: struct { merge_key: LiteralString, merge_type: LiteralString },
4977 bank_bits_altera: struct { bank_bits: []const LiteralInteger = &.{} },
4978 force_pow2depth_altera: struct { force_key: LiteralInteger },
4979 stridesize_altera: struct { stride_size: LiteralInteger },
4980 wordsize_altera: struct { word_size: LiteralInteger },
4981 true_dual_port_altera,
4982 burst_coalesce_altera,
4983 cache_size_altera: struct { cache_size_in_bytes: LiteralInteger },
4984 dont_statically_coalesce_altera,
4985 prefetch_altera: struct { prefetcher_size_in_bytes: LiteralInteger },
4986 stall_enable_altera,
4987 fuse_loops_in_function_altera,
4988 math_op_dsp_mode_altera: struct { mode: LiteralInteger, propagate: LiteralInteger },
4989 alias_scope_intel: struct { aliasing_scopes_list: Id },
4990 no_alias_intel: struct { aliasing_scopes_list: Id },
4991 initiation_interval_altera: struct { cycles: LiteralInteger },
4992 max_concurrency_altera: struct { invocations: LiteralInteger },
4993 pipeline_enable_altera: struct { enable: LiteralInteger },
4994 buffer_location_altera: struct { buffer_location_id: LiteralInteger },
4995 io_pipe_storage_altera: struct { io_pipe_id: LiteralInteger },
4996 function_floating_point_mode_intel: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },
4997 single_element_vector_intel,
4998 vector_compute_callable_function_intel,
4999 media_block_iointel,
5000 stall_free_altera,
5001 fp_max_error_decoration_intel: struct { max_error: LiteralFloat },
5002 latency_control_label_altera: struct { latency_label: LiteralInteger },
5003 latency_control_constraint_altera: struct { relative_to: LiteralInteger, control_type: LiteralInteger, relative_cycle: LiteralInteger },
5004 conduit_kernel_argument_altera,
5005 register_map_kernel_argument_altera,
5006 mm_host_interface_address_width_altera: struct { address_width: LiteralInteger },
5007 mm_host_interface_data_width_altera: struct { data_width: LiteralInteger },
5008 mm_host_interface_latency_altera: struct { latency: LiteralInteger },
5009 mm_host_interface_read_write_mode_altera: struct { read_write_mode: AccessQualifier },
5010 mm_host_interface_max_burst_altera: struct { max_burst_count: LiteralInteger },
5011 mm_host_interface_wait_request_altera: struct { waitrequest: LiteralInteger },
5012 stable_kernel_argument_altera,
5013 host_access_intel: struct { access: HostAccessQualifier, name: LiteralString },
5014 init_mode_altera: struct { trigger: InitializationModeQualifier },
5015 implement_in_register_map_altera: struct { value: LiteralInteger },
5016 conditional_intel: struct { condition: Id },
5017 cache_control_load_intel: struct { cache_level: LiteralInteger, cache_control: LoadCacheControl },
5018 cache_control_store_intel: struct { cache_level: LiteralInteger, cache_control: StoreCacheControl },
5019 };3908 };
5020};3909};
5021pub const BuiltIn = enum(u32) {3910pub const BuiltIn = enum(u32) {
...@@ -5077,35 +3966,10 @@ pub const BuiltIn = enum(u32) {...@@ -5077,35 +3966,10 @@ pub const BuiltIn = enum(u32) {
5077 device_index = 4438,3966 device_index = 4438,
5078 view_index = 4440,3967 view_index = 4440,
5079 shading_rate_khr = 4444,3968 shading_rate_khr = 4444,
5080 tile_offset_qcom = 4492,
5081 tile_dimension_qcom = 4493,
5082 tile_apron_size_qcom = 4494,
5083 bary_coord_no_persp_amd = 4992,
5084 bary_coord_no_persp_centroid_amd = 4993,
5085 bary_coord_no_persp_sample_amd = 4994,
5086 bary_coord_smooth_amd = 4995,
5087 bary_coord_smooth_centroid_amd = 4996,
5088 bary_coord_smooth_sample_amd = 4997,
5089 bary_coord_pull_model_amd = 4998,
5090 frag_stencil_ref_ext = 5014,3969 frag_stencil_ref_ext = 5014,
5091 remaining_recursion_levels_amdx = 5021,
5092 shader_index_amdx = 5073,
5093 sampler_heap_ext = 5122,3970 sampler_heap_ext = 5122,
5094 resource_heap_ext = 5123,3971 resource_heap_ext = 5123,
5095 viewport_mask_nv = 5253,
5096 secondary_position_nv = 5257,
5097 secondary_viewport_mask_nv = 5258,
5098 position_per_view_nv = 5261,
5099 viewport_mask_per_view_nv = 5262,
5100 fully_covered_ext = 5264,3972 fully_covered_ext = 5264,
5101 task_count_nv = 5274,
5102 primitive_count_nv = 5275,
5103 primitive_indices_nv = 5276,
5104 clip_distance_per_view_nv = 5277,
5105 cull_distance_per_view_nv = 5278,
5106 layer_per_view_nv = 5279,
5107 mesh_view_count_nv = 5280,
5108 mesh_view_indices_nv = 5281,
5109 bary_coord_khr = 5286,3973 bary_coord_khr = 5286,
5110 bary_coord_no_persp_khr = 5287,3974 bary_coord_no_persp_khr = 5287,
5111 frag_size_ext = 5292,3975 frag_size_ext = 5292,
...@@ -5125,27 +3989,10 @@ pub const BuiltIn = enum(u32) {...@@ -5125,27 +3989,10 @@ pub const BuiltIn = enum(u32) {
5125 instance_custom_index_khr = 5327,3989 instance_custom_index_khr = 5327,
5126 object_to_world_khr = 5330,3990 object_to_world_khr = 5330,
5127 world_to_object_khr = 5331,3991 world_to_object_khr = 5331,
5128 hit_tnv = 5332,
5129 hit_kind_khr = 5333,3992 hit_kind_khr = 5333,
5130 current_ray_time_nv = 5334,
5131 hit_triangle_vertex_positions_khr = 5335,3993 hit_triangle_vertex_positions_khr = 5335,
5132 hit_micro_triangle_vertex_positions_nv = 5337,
5133 hit_micro_triangle_vertex_barycentrics_nv = 5344,
5134 incoming_ray_flags_khr = 5351,3994 incoming_ray_flags_khr = 5351,
5135 ray_geometry_index_khr = 5352,3995 ray_geometry_index_khr = 5352,
5136 hit_is_sphere_nv = 5359,
5137 hit_is_lssnv = 5360,
5138 hit_sphere_position_nv = 5361,
5139 warps_per_smnv = 5374,
5140 sm_count_nv = 5375,
5141 warp_idnv = 5376,
5142 smidnv = 5377,
5143 hit_lss_positions_nv = 5396,
5144 hit_kind_front_facing_micro_triangle_nv = 5405,
5145 hit_kind_back_facing_micro_triangle_nv = 5406,
5146 hit_sphere_radius_nv = 5420,
5147 hit_lss_radii_nv = 5421,
5148 cluster_idnv = 5436,
5149 cull_mask_khr = 6021,3996 cull_mask_khr = 6021,
5150};3997};
5151pub const Scope = enum(u32) {3998pub const Scope = enum(u32) {
...@@ -5342,608 +4189,173 @@ pub const Capability = enum(u32) {...@@ -5342,608 +4189,173 @@ pub const Capability = enum(u32) {
53424189
5343 pub fn dependencies(self: Capability) []const Extension {4190 pub fn dependencies(self: Capability) []const Extension {
5344 return switch (self) {4191 return switch (self) {
5345 .matrix => &.{4192 .matrix => &.{.v1_0},
5346 .v1_0,4193 .shader => &.{.v1_0},
5347 },4194 .geometry => &.{.v1_0},
5348 .shader => &.{4195 .tessellation => &.{.v1_0},
5349 .v1_0,4196 .addresses => &.{.v1_0},
5350 },4197 .linkage => &.{.v1_0},
5351 .geometry => &.{4198 .kernel => &.{.v1_0},
5352 .v1_0,4199 .vector16 => &.{.v1_0},
5353 },4200 .float16buffer => &.{.v1_0},
5354 .tessellation => &.{4201 .float16 => &.{.v1_0},
5355 .v1_0,4202 .float64 => &.{.v1_0},
5356 },4203 .int64 => &.{.v1_0},
5357 .addresses => &.{4204 .int64atomics => &.{.v1_0},
5358 .v1_0,4205 .image_basic => &.{.v1_0},
5359 },4206 .image_read_write => &.{.v1_0},
5360 .linkage => &.{4207 .image_mipmap => &.{.v1_0},
5361 .v1_0,4208 .pipes => &.{.v1_0},
5362 },4209 .groups => &.{.v1_0},
5363 .kernel => &.{4210 .device_enqueue => &.{.v1_0},
5364 .v1_0,4211 .literal_sampler => &.{.v1_0},
5365 },4212 .atomic_storage => &.{.v1_0},
5366 .vector16 => &.{4213 .int16 => &.{.v1_0},
5367 .v1_0,4214 .tessellation_point_size => &.{.v1_0},
5368 },4215 .geometry_point_size => &.{.v1_0},
5369 .float16buffer => &.{4216 .image_gather_extended => &.{.v1_0},
5370 .v1_0,4217 .storage_image_multisample => &.{.v1_0},
5371 },4218 .uniform_buffer_array_dynamic_indexing => &.{.v1_0},
5372 .float16 => &.{4219 .sampled_image_array_dynamic_indexing => &.{.v1_0},
5373 .v1_0,4220 .storage_buffer_array_dynamic_indexing => &.{.v1_0},
5374 },4221 .storage_image_array_dynamic_indexing => &.{.v1_0},
5375 .float64 => &.{4222 .clip_distance => &.{.v1_0},
5376 .v1_0,4223 .cull_distance => &.{.v1_0},
5377 },4224 .image_cube_array => &.{.v1_0},
5378 .int64 => &.{4225 .sample_rate_shading => &.{.v1_0},
5379 .v1_0,4226 .image_rect => &.{.v1_0},
5380 },4227 .sampled_rect => &.{.v1_0},
5381 .int64atomics => &.{4228 .generic_pointer => &.{.v1_0},
5382 .v1_0,4229 .int8 => &.{.v1_0},
5383 },4230 .input_attachment => &.{.v1_0},
5384 .image_basic => &.{4231 .sparse_residency => &.{.v1_0},
5385 .v1_0,4232 .min_lod => &.{.v1_0},
5386 },4233 .sampled_cube_array => &.{.v1_0},
5387 .image_read_write => &.{4234 .sampled_buffer => &.{.v1_0},
5388 .v1_0,4235 .image_buffer => &.{.v1_0},
5389 },4236 .image_ms_array => &.{.v1_0},
5390 .image_mipmap => &.{4237 .storage_image_extended_formats => &.{.v1_0},
5391 .v1_0,4238 .image_query => &.{.v1_0},
5392 },4239 .derivative_control => &.{.v1_0},
5393 .pipes => &.{4240 .interpolation_function => &.{.v1_0},
5394 .v1_0,4241 .transform_feedback => &.{.v1_0},
5395 },4242 .geometry_streams => &.{.v1_0},
5396 .groups => &.{4243 .storage_image_read_without_format => &.{.v1_0},
5397 .v1_0,4244 .storage_image_write_without_format => &.{.v1_0},
5398 },4245 .multi_viewport => &.{.v1_0},
5399 .device_enqueue => &.{4246 .subgroup_dispatch => &.{.v1_1},
5400 .v1_0,4247 .named_barrier => &.{.v1_1},
5401 },4248 .pipe_storage => &.{.v1_1},
5402 .literal_sampler => &.{4249 .group_non_uniform => &.{.v1_3},
5403 .v1_0,4250 .group_non_uniform_vote => &.{.v1_3},
5404 },4251 .group_non_uniform_arithmetic => &.{.v1_3},
5405 .atomic_storage => &.{4252 .group_non_uniform_ballot => &.{.v1_3},
5406 .v1_0,4253 .group_non_uniform_shuffle => &.{.v1_3},
5407 },4254 .group_non_uniform_shuffle_relative => &.{.v1_3},
5408 .int16 => &.{4255 .group_non_uniform_clustered => &.{.v1_3},
5409 .v1_0,4256 .group_non_uniform_quad => &.{.v1_3},
5410 },4257 .shader_layer => &.{.v1_5},
5411 .tessellation_point_size => &.{4258 .shader_viewport_index => &.{.v1_5},
5412 .v1_0,4259 .uniform_decoration => &.{.v1_6},
5413 },4260 .tile_image_color_read_access_ext => &.{ .v1_0, .SPV_EXT_shader_tile_image },
5414 .geometry_point_size => &.{4261 .tile_image_depth_read_access_ext => &.{ .v1_0, .SPV_EXT_shader_tile_image },
5415 .v1_0,4262 .tile_image_stencil_read_access_ext => &.{ .v1_0, .SPV_EXT_shader_tile_image },
5416 },4263 .float8ext => &.{ .v1_0, .SPV_EXT_float8 },
5417 .image_gather_extended => &.{4264 .float8cooperative_matrix_ext => &.{ .v1_0, .SPV_EXT_float8 },
5418 .v1_0,4265 .fragment_shading_rate_khr => &.{ .v1_0, .SPV_KHR_fragment_shading_rate },
5419 },4266 .subgroup_ballot_khr => &.{ .v1_0, .SPV_KHR_shader_ballot },
5420 .storage_image_multisample => &.{4267 .draw_parameters => &.{ .v1_3, .SPV_KHR_shader_draw_parameters },
5421 .v1_0,4268 .workgroup_memory_explicit_layout_khr => &.{ .v1_0, .SPV_KHR_workgroup_memory_explicit_layout },
5422 },4269 .workgroup_memory_explicit_layout8bit_access_khr => &.{ .v1_0, .SPV_KHR_workgroup_memory_explicit_layout },
5423 .uniform_buffer_array_dynamic_indexing => &.{4270 .workgroup_memory_explicit_layout16bit_access_khr => &.{ .v1_0, .SPV_KHR_workgroup_memory_explicit_layout },
5424 .v1_0,4271 .subgroup_vote_khr => &.{ .v1_0, .SPV_KHR_subgroup_vote },
5425 },4272 .storage_buffer16bit_access => &.{ .v1_3, .SPV_KHR_16bit_storage },
5426 .sampled_image_array_dynamic_indexing => &.{4273 .uniform_and_storage_buffer16bit_access => &.{ .v1_3, .SPV_KHR_16bit_storage },
5427 .v1_0,4274 .storage_push_constant16 => &.{ .v1_3, .SPV_KHR_16bit_storage },
5428 },4275 .storage_input_output16 => &.{ .v1_3, .SPV_KHR_16bit_storage },
5429 .storage_buffer_array_dynamic_indexing => &.{4276 .device_group => &.{ .v1_3, .SPV_KHR_device_group },
5430 .v1_0,4277 .multi_view => &.{ .v1_3, .SPV_KHR_multiview },
5431 },4278 .variable_pointers_storage_buffer => &.{ .v1_3, .SPV_KHR_variable_pointers },
5432 .storage_image_array_dynamic_indexing => &.{4279 .variable_pointers => &.{ .v1_3, .SPV_KHR_variable_pointers },
5433 .v1_0,4280 .atomic_storage_ops => &.{ .v1_0, .SPV_KHR_shader_atomic_counter_ops },
5434 },4281 .sample_mask_post_depth_coverage => &.{ .v1_0, .SPV_KHR_post_depth_coverage },
5435 .clip_distance => &.{4282 .storage_buffer8bit_access => &.{ .v1_5, .SPV_KHR_8bit_storage },
5436 .v1_0,4283 .uniform_and_storage_buffer8bit_access => &.{ .v1_5, .SPV_KHR_8bit_storage },
5437 },4284 .storage_push_constant8 => &.{ .v1_5, .SPV_KHR_8bit_storage },
5438 .cull_distance => &.{4285 .denorm_preserve => &.{ .v1_4, .SPV_KHR_float_controls },
5439 .v1_0,4286 .denorm_flush_to_zero => &.{ .v1_4, .SPV_KHR_float_controls },
5440 },4287 .signed_zero_inf_nan_preserve => &.{ .v1_4, .SPV_KHR_float_controls },
5441 .image_cube_array => &.{4288 .ray_query_provisional_khr => &.{ .v1_0, .SPV_KHR_ray_query },
5442 .v1_0,4289 .ray_query_khr => &.{ .v1_0, .SPV_KHR_ray_query },
5443 },4290 .untyped_pointers_khr => &.{ .v1_0, .SPV_KHR_untyped_pointers },
5444 .sample_rate_shading => &.{4291 .ray_traversal_primitive_culling_khr => &.{ .v1_0, .SPV_KHR_ray_query, .SPV_KHR_ray_tracing },
5445 .v1_0,4292 .ray_tracing_khr => &.{ .v1_0, .SPV_KHR_ray_tracing },
5446 },4293 .stencil_export_ext => &.{ .v1_0, .SPV_EXT_shader_stencil_export },
5447 .image_rect => &.{4294 .int64image_ext => &.{ .v1_0, .SPV_EXT_shader_image_int64 },
5448 .v1_0,4295 .shader_clock_khr => &.{ .v1_0, .SPV_KHR_shader_clock },
5449 },4296 .quad_control_khr => &.{ .v1_0, .SPV_KHR_quad_control },
5450 .sampled_rect => &.{4297 .b_float16type_khr => &.{ .v1_0, .SPV_KHR_bfloat16 },
5451 .v1_0,4298 .b_float16dot_product_khr => &.{ .v1_0, .SPV_KHR_bfloat16 },
5452 },4299 .b_float16cooperative_matrix_khr => &.{ .v1_0, .SPV_KHR_bfloat16 },
5453 .generic_pointer => &.{4300 .abort_khr => &.{ .v1_0, .SPV_KHR_abort },
5454 .v1_0,4301 .descriptor_heap_ext => &.{ .v1_0, .SPV_EXT_descriptor_heap },
5455 },4302 .constant_data_khr => &.{ .v1_0, .SPV_KHR_constant_data },
5456 .int8 => &.{4303 .poison_freeze_khr => &.{ .v1_0, .SPV_KHR_poison_freeze },
5457 .v1_0,4304 .shader_viewport_index_layer_ext => &.{ .v1_0, .SPV_EXT_shader_viewport_index_layer },
5458 },4305 .fragment_fully_covered_ext => &.{ .v1_0, .SPV_EXT_fragment_fully_covered },
5459 .input_attachment => &.{4306 .mesh_shading_ext => &.{ .v1_0, .SPV_EXT_mesh_shader },
5460 .v1_0,4307 .fragment_barycentric_khr => &.{ .v1_0, .SPV_KHR_fragment_shader_barycentric },
5461 },4308 .compute_derivative_group_quads_khr => &.{ .v1_0, .SPV_KHR_compute_shader_derivatives },
5462 .sparse_residency => &.{4309 .fragment_density_ext => &.{ .v1_0, .SPV_EXT_fragment_invocation_density },
5463 .v1_0,4310 .group_non_uniform_partitioned_ext => &.{ .v1_0, .SPV_EXT_shader_subgroup_partitioned },
5464 },4311 .shader_non_uniform => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5465 .min_lod => &.{4312 .runtime_descriptor_array => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5466 .v1_0,4313 .input_attachment_array_dynamic_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5467 },4314 .uniform_texel_buffer_array_dynamic_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5468 .sampled_cube_array => &.{4315 .storage_texel_buffer_array_dynamic_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5469 .v1_0,4316 .uniform_buffer_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5470 },4317 .sampled_image_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5471 .sampled_buffer => &.{4318 .storage_buffer_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5472 .v1_0,4319 .storage_image_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5473 },4320 .input_attachment_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5474 .image_buffer => &.{4321 .uniform_texel_buffer_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5475 .v1_0,4322 .storage_texel_buffer_array_non_uniform_indexing => &.{ .v1_5, .SPV_EXT_descriptor_indexing },
5476 },4323 .ray_tracing_position_fetch_khr => &.{ .v1_0, .SPV_KHR_ray_tracing_position_fetch },
5477 .image_ms_array => &.{4324 .vulkan_memory_model => &.{ .v1_5, .SPV_KHR_vulkan_memory_model },
5478 .v1_0,4325 .vulkan_memory_model_device_scope => &.{ .v1_5, .SPV_KHR_vulkan_memory_model },
5479 },4326 .physical_storage_buffer_addresses => &.{ .v1_5, .SPV_EXT_physical_storage_buffer, .SPV_KHR_physical_storage_buffer },
5480 .storage_image_extended_formats => &.{4327 .compute_derivative_group_linear_khr => &.{ .v1_0, .SPV_KHR_compute_shader_derivatives },
5481 .v1_0,4328 .ray_tracing_provisional_khr => &.{ .v1_0, .SPV_KHR_ray_tracing },
5482 },4329 .fragment_shader_sample_interlock_ext => &.{ .v1_0, .SPV_EXT_fragment_shader_interlock },
5483 .image_query => &.{4330 .fragment_shader_shading_rate_interlock_ext => &.{ .v1_0, .SPV_EXT_fragment_shader_interlock },
5484 .v1_0,4331 .fragment_shader_pixel_interlock_ext => &.{ .v1_0, .SPV_EXT_fragment_shader_interlock },
5485 },4332 .demote_to_helper_invocation => &.{ .v1_6, .SPV_EXT_demote_to_helper_invocation },
5486 .derivative_control => &.{4333 .ray_tracing_opacity_micromap_ext => &.{ .v1_0, .SPV_EXT_opacity_micromap },
5487 .v1_0,4334 .shader_invocation_reorder_ext => &.{ .v1_0, .SPV_EXT_shader_invocation_reorder },
5488 },4335 .ray_query_position_fetch_khr => &.{ .v1_0, .SPV_KHR_ray_tracing_position_fetch },
5489 .interpolation_function => &.{4336 .long_vector_ext => &.{ .v1_0, .SPV_EXT_long_vector },
5490 .v1_0,4337 .shader64bit_indexing_ext => &.{ .v1_0, .SPV_EXT_shader_64bit_indexing },
5491 },4338 .atomic_float32min_max_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float_min_max },
5492 .transform_feedback => &.{4339 .atomic_float64min_max_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float_min_max },
5493 .v1_0,4340 .atomic_float16min_max_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float_min_max },
5494 },4341 .expect_assume_khr => &.{ .v1_0, .SPV_KHR_expect_assume },
5495 .geometry_streams => &.{4342 .dot_product_input_all => &.{ .v1_6, .SPV_KHR_integer_dot_product },
5496 .v1_0,4343 .dot_product_input4x8bit => &.{ .v1_6, .SPV_KHR_integer_dot_product },
5497 },4344 .dot_product_input4x8bit_packed => &.{ .v1_6, .SPV_KHR_integer_dot_product },
5498 .storage_image_read_without_format => &.{4345 .dot_product => &.{ .v1_6, .SPV_KHR_integer_dot_product },
5499 .v1_0,4346 .ray_cull_mask_khr => &.{ .v1_0, .SPV_KHR_ray_cull_mask },
5500 },4347 .cooperative_matrix_khr => &.{ .v1_0, .SPV_KHR_cooperative_matrix },
5501 .storage_image_write_without_format => &.{4348 .replicated_composites_ext => &.{ .v1_0, .SPV_EXT_replicated_composites },
5502 .v1_0,4349 .bit_instructions => &.{ .v1_0, .SPV_KHR_bit_instructions },
5503 },4350 .group_non_uniform_rotate_khr => &.{ .v1_0, .SPV_KHR_subgroup_rotate },
5504 .multi_viewport => &.{4351 .float_controls2 => &.{ .v1_0, .SPV_KHR_float_controls2 },
5505 .v1_0,4352 .fmakhr => &.{ .v1_0, .SPV_KHR_fma },
5506 },4353 .atomic_float32add_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float_add },
5507 .subgroup_dispatch => &.{4354 .atomic_float64add_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float_add },
5508 .v1_1,4355 .opt_none_ext => &.{ .v1_0, .SPV_EXT_optnone },
5509 },4356 .atomic_float16add_ext => &.{ .v1_0, .SPV_EXT_shader_atomic_float16_add },
5510 .named_barrier => &.{4357 .arithmetic_fence_ext => &.{ .v1_0, .SPV_EXT_arithmetic_fence },
5511 .v1_1,4358 .group_uniform_arithmetic_khr => &.{ .v1_0, .SPV_KHR_uniform_group_instructions },
5512 },
5513 .pipe_storage => &.{
5514 .v1_1,
5515 },
5516 .group_non_uniform => &.{
5517 .v1_3,
5518 },
5519 .group_non_uniform_vote => &.{
5520 .v1_3,
5521 },
5522 .group_non_uniform_arithmetic => &.{
5523 .v1_3,
5524 },
5525 .group_non_uniform_ballot => &.{
5526 .v1_3,
5527 },
5528 .group_non_uniform_shuffle => &.{
5529 .v1_3,
5530 },
5531 .group_non_uniform_shuffle_relative => &.{
5532 .v1_3,
5533 },
5534 .group_non_uniform_clustered => &.{
5535 .v1_3,
5536 },
5537 .group_non_uniform_quad => &.{
5538 .v1_3,
5539 },
5540 .shader_layer => &.{
5541 .v1_5,
5542 },
5543 .shader_viewport_index => &.{
5544 .v1_5,
5545 },
5546 .uniform_decoration => &.{
5547 .v1_6,
5548 },
5549 .tile_image_color_read_access_ext => &.{
5550 .v1_0,
5551 .SPV_EXT_shader_tile_image,
5552 },
5553 .tile_image_depth_read_access_ext => &.{
5554 .v1_0,
5555 .SPV_EXT_shader_tile_image,
5556 },
5557 .tile_image_stencil_read_access_ext => &.{
5558 .v1_0,
5559 .SPV_EXT_shader_tile_image,
5560 },
5561 .float8ext => &.{
5562 .v1_0,
5563 .SPV_EXT_float8,
5564 },
5565 .float8cooperative_matrix_ext => &.{
5566 .v1_0,
5567 .SPV_EXT_float8,
5568 },
5569 .fragment_shading_rate_khr => &.{
5570 .v1_0,
5571 .SPV_KHR_fragment_shading_rate,
5572 },
5573 .subgroup_ballot_khr => &.{
5574 .v1_0,
5575 .SPV_KHR_shader_ballot,
5576 },
5577 .draw_parameters => &.{
5578 .v1_3,
5579 .SPV_KHR_shader_draw_parameters,
5580 },
5581 .workgroup_memory_explicit_layout_khr => &.{
5582 .v1_0,
5583 .SPV_KHR_workgroup_memory_explicit_layout,
5584 },
5585 .workgroup_memory_explicit_layout8bit_access_khr => &.{
5586 .v1_0,
5587 .SPV_KHR_workgroup_memory_explicit_layout,
5588 },
5589 .workgroup_memory_explicit_layout16bit_access_khr => &.{
5590 .v1_0,
5591 .SPV_KHR_workgroup_memory_explicit_layout,
5592 },
5593 .subgroup_vote_khr => &.{
5594 .v1_0,
5595 .SPV_KHR_subgroup_vote,
5596 },
5597 .storage_buffer16bit_access => &.{
5598 .v1_3,
5599 .SPV_KHR_16bit_storage,
5600 },
5601 .uniform_and_storage_buffer16bit_access => &.{
5602 .v1_3,
5603 .SPV_KHR_16bit_storage,
5604 },
5605 .storage_push_constant16 => &.{
5606 .v1_3,
5607 .SPV_KHR_16bit_storage,
5608 },
5609 .storage_input_output16 => &.{
5610 .v1_3,
5611 .SPV_KHR_16bit_storage,
5612 },
5613 .device_group => &.{
5614 .v1_3,
5615 .SPV_KHR_device_group,
5616 },
5617 .multi_view => &.{
5618 .v1_3,
5619 .SPV_KHR_multiview,
5620 },
5621 .variable_pointers_storage_buffer => &.{
5622 .v1_3,
5623 .SPV_KHR_variable_pointers,
5624 },
5625 .variable_pointers => &.{
5626 .v1_3,
5627 .SPV_KHR_variable_pointers,
5628 },
5629 .atomic_storage_ops => &.{
5630 .v1_0,
5631 .SPV_KHR_shader_atomic_counter_ops,
5632 },
5633 .sample_mask_post_depth_coverage => &.{
5634 .v1_0,
5635 .SPV_KHR_post_depth_coverage,
5636 },
5637 .storage_buffer8bit_access => &.{
5638 .v1_5,
5639 .SPV_KHR_8bit_storage,
5640 },
5641 .uniform_and_storage_buffer8bit_access => &.{
5642 .v1_5,
5643 .SPV_KHR_8bit_storage,
5644 },
5645 .storage_push_constant8 => &.{
5646 .v1_5,
5647 .SPV_KHR_8bit_storage,
5648 },
5649 .denorm_preserve => &.{
5650 .v1_4,
5651 .SPV_KHR_float_controls,
5652 },
5653 .denorm_flush_to_zero => &.{
5654 .v1_4,
5655 .SPV_KHR_float_controls,
5656 },
5657 .signed_zero_inf_nan_preserve => &.{
5658 .v1_4,
5659 .SPV_KHR_float_controls,
5660 },
5661 .ray_query_provisional_khr => &.{
5662 .v1_0,
5663 .SPV_KHR_ray_query,
5664 },
5665 .ray_query_khr => &.{
5666 .v1_0,
5667 .SPV_KHR_ray_query,
5668 },
5669 .untyped_pointers_khr => &.{
5670 .v1_0,
5671 .SPV_KHR_untyped_pointers,
5672 },
5673 .ray_traversal_primitive_culling_khr => &.{
5674 .v1_0,
5675 .SPV_KHR_ray_query,
5676 .SPV_KHR_ray_tracing,
5677 },
5678 .ray_tracing_khr => &.{
5679 .v1_0,
5680 .SPV_KHR_ray_tracing,
5681 },
5682 .stencil_export_ext => &.{
5683 .v1_0,
5684 .SPV_EXT_shader_stencil_export,
5685 },
5686 .int64image_ext => &.{
5687 .v1_0,
5688 .SPV_EXT_shader_image_int64,
5689 },
5690 .shader_clock_khr => &.{
5691 .v1_0,
5692 .SPV_KHR_shader_clock,
5693 },
5694 .quad_control_khr => &.{
5695 .v1_0,
5696 .SPV_KHR_quad_control,
5697 },
5698 .b_float16type_khr => &.{
5699 .v1_0,
5700 .SPV_KHR_bfloat16,
5701 },
5702 .b_float16dot_product_khr => &.{
5703 .v1_0,
5704 .SPV_KHR_bfloat16,
5705 },
5706 .b_float16cooperative_matrix_khr => &.{
5707 .v1_0,
5708 .SPV_KHR_bfloat16,
5709 },
5710 .abort_khr => &.{
5711 .v1_0,
5712 .SPV_KHR_abort,
5713 },
5714 .descriptor_heap_ext => &.{
5715 .v1_0,
5716 .SPV_EXT_descriptor_heap,
5717 },
5718 .constant_data_khr => &.{
5719 .v1_0,
5720 .SPV_KHR_constant_data,
5721 },
5722 .poison_freeze_khr => &.{
5723 .v1_0,
5724 .SPV_KHR_poison_freeze,
5725 },
5726 .shader_viewport_index_layer_ext => &.{
5727 .v1_0,
5728 .SPV_EXT_shader_viewport_index_layer,
5729 },
5730 .fragment_fully_covered_ext => &.{
5731 .v1_0,
5732 .SPV_EXT_fragment_fully_covered,
5733 },
5734 .mesh_shading_ext => &.{
5735 .v1_0,
5736 .SPV_EXT_mesh_shader,
5737 },
5738 .fragment_barycentric_khr => &.{
5739 .v1_0,
5740 .SPV_KHR_fragment_shader_barycentric,
5741 },
5742 .compute_derivative_group_quads_khr => &.{
5743 .v1_0,
5744 .SPV_KHR_compute_shader_derivatives,
5745 },
5746 .fragment_density_ext => &.{
5747 .v1_0,
5748 .SPV_EXT_fragment_invocation_density,
5749 },
5750 .group_non_uniform_partitioned_ext => &.{
5751 .v1_0,
5752 .SPV_EXT_shader_subgroup_partitioned,
5753 },
5754 .shader_non_uniform => &.{
5755 .v1_5,
5756 .SPV_EXT_descriptor_indexing,
5757 },
5758 .runtime_descriptor_array => &.{
5759 .v1_5,
5760 .SPV_EXT_descriptor_indexing,
5761 },
5762 .input_attachment_array_dynamic_indexing => &.{
5763 .v1_5,
5764 .SPV_EXT_descriptor_indexing,
5765 },
5766 .uniform_texel_buffer_array_dynamic_indexing => &.{
5767 .v1_5,
5768 .SPV_EXT_descriptor_indexing,
5769 },
5770 .storage_texel_buffer_array_dynamic_indexing => &.{
5771 .v1_5,
5772 .SPV_EXT_descriptor_indexing,
5773 },
5774 .uniform_buffer_array_non_uniform_indexing => &.{
5775 .v1_5,
5776 .SPV_EXT_descriptor_indexing,
5777 },
5778 .sampled_image_array_non_uniform_indexing => &.{
5779 .v1_5,
5780 .SPV_EXT_descriptor_indexing,
5781 },
5782 .storage_buffer_array_non_uniform_indexing => &.{
5783 .v1_5,
5784 .SPV_EXT_descriptor_indexing,
5785 },
5786 .storage_image_array_non_uniform_indexing => &.{
5787 .v1_5,
5788 .SPV_EXT_descriptor_indexing,
5789 },
5790 .input_attachment_array_non_uniform_indexing => &.{
5791 .v1_5,
5792 .SPV_EXT_descriptor_indexing,
5793 },
5794 .uniform_texel_buffer_array_non_uniform_indexing => &.{
5795 .v1_5,
5796 .SPV_EXT_descriptor_indexing,
5797 },
5798 .storage_texel_buffer_array_non_uniform_indexing => &.{
5799 .v1_5,
5800 .SPV_EXT_descriptor_indexing,
5801 },
5802 .ray_tracing_position_fetch_khr => &.{
5803 .v1_0,
5804 .SPV_KHR_ray_tracing_position_fetch,
5805 },
5806 .vulkan_memory_model => &.{
5807 .v1_5,
5808 .SPV_KHR_vulkan_memory_model,
5809 },
5810 .vulkan_memory_model_device_scope => &.{
5811 .v1_5,
5812 .SPV_KHR_vulkan_memory_model,
5813 },
5814 .physical_storage_buffer_addresses => &.{
5815 .v1_5,
5816 .SPV_EXT_physical_storage_buffer,
5817 .SPV_KHR_physical_storage_buffer,
5818 },
5819 .compute_derivative_group_linear_khr => &.{
5820 .v1_0,
5821 .SPV_KHR_compute_shader_derivatives,
5822 },
5823 .ray_tracing_provisional_khr => &.{
5824 .v1_0,
5825 .SPV_KHR_ray_tracing,
5826 },
5827 .fragment_shader_sample_interlock_ext => &.{
5828 .v1_0,
5829 .SPV_EXT_fragment_shader_interlock,
5830 },
5831 .fragment_shader_shading_rate_interlock_ext => &.{
5832 .v1_0,
5833 .SPV_EXT_fragment_shader_interlock,
5834 },
5835 .fragment_shader_pixel_interlock_ext => &.{
5836 .v1_0,
5837 .SPV_EXT_fragment_shader_interlock,
5838 },
5839 .demote_to_helper_invocation => &.{
5840 .v1_6,
5841 .SPV_EXT_demote_to_helper_invocation,
5842 },
5843 .ray_tracing_opacity_micromap_ext => &.{
5844 .v1_0,
5845 .SPV_EXT_opacity_micromap,
5846 },
5847 .shader_invocation_reorder_ext => &.{
5848 .v1_0,
5849 .SPV_EXT_shader_invocation_reorder,
5850 },
5851 .ray_query_position_fetch_khr => &.{
5852 .v1_0,
5853 .SPV_KHR_ray_tracing_position_fetch,
5854 },
5855 .long_vector_ext => &.{
5856 .v1_0,
5857 .SPV_EXT_long_vector,
5858 },
5859 .shader64bit_indexing_ext => &.{
5860 .v1_0,
5861 .SPV_EXT_shader_64bit_indexing,
5862 },
5863 .atomic_float32min_max_ext => &.{
5864 .v1_0,
5865 .SPV_EXT_shader_atomic_float_min_max,
5866 },
5867 .atomic_float64min_max_ext => &.{
5868 .v1_0,
5869 .SPV_EXT_shader_atomic_float_min_max,
5870 },
5871 .atomic_float16min_max_ext => &.{
5872 .v1_0,
5873 .SPV_EXT_shader_atomic_float_min_max,
5874 },
5875 .expect_assume_khr => &.{
5876 .v1_0,
5877 .SPV_KHR_expect_assume,
5878 },
5879 .dot_product_input_all => &.{
5880 .v1_6,
5881 .SPV_KHR_integer_dot_product,
5882 },
5883 .dot_product_input4x8bit => &.{
5884 .v1_6,
5885 .SPV_KHR_integer_dot_product,
5886 },
5887 .dot_product_input4x8bit_packed => &.{
5888 .v1_6,
5889 .SPV_KHR_integer_dot_product,
5890 },
5891 .dot_product => &.{
5892 .v1_6,
5893 .SPV_KHR_integer_dot_product,
5894 },
5895 .ray_cull_mask_khr => &.{
5896 .v1_0,
5897 .SPV_KHR_ray_cull_mask,
5898 },
5899 .cooperative_matrix_khr => &.{
5900 .v1_0,
5901 .SPV_KHR_cooperative_matrix,
5902 },
5903 .replicated_composites_ext => &.{
5904 .v1_0,
5905 .SPV_EXT_replicated_composites,
5906 },
5907 .bit_instructions => &.{
5908 .v1_0,
5909 .SPV_KHR_bit_instructions,
5910 },
5911 .group_non_uniform_rotate_khr => &.{
5912 .v1_0,
5913 .SPV_KHR_subgroup_rotate,
5914 },
5915 .float_controls2 => &.{
5916 .v1_0,
5917 .SPV_KHR_float_controls2,
5918 },
5919 .fmakhr => &.{
5920 .v1_0,
5921 .SPV_KHR_fma,
5922 },
5923 .atomic_float32add_ext => &.{
5924 .v1_0,
5925 .SPV_EXT_shader_atomic_float_add,
5926 },
5927 .atomic_float64add_ext => &.{
5928 .v1_0,
5929 .SPV_EXT_shader_atomic_float_add,
5930 },
5931 .opt_none_ext => &.{
5932 .v1_0,
5933 .SPV_EXT_optnone,
5934 },
5935 .atomic_float16add_ext => &.{
5936 .v1_0,
5937 .SPV_EXT_shader_atomic_float16_add,
5938 },
5939 .arithmetic_fence_ext => &.{
5940 .v1_0,
5941 .SPV_EXT_arithmetic_fence,
5942 },
5943 .group_uniform_arithmetic_khr => &.{
5944 .v1_0,
5945 .SPV_KHR_uniform_group_instructions,
5946 },
5947 };4359 };
5948 }4360 }
5949};4361};
...@@ -5963,84 +4375,28 @@ pub const RayQueryCandidateIntersectionType = enum(u32) {...@@ -5963,84 +4375,28 @@ pub const RayQueryCandidateIntersectionType = enum(u32) {
5963pub const PackedVectorFormat = enum(u32) {4375pub const PackedVectorFormat = enum(u32) {
5964 packed_vector_format4x8bit = 0,4376 packed_vector_format4x8bit = 0,
5965};4377};
5966pub const CooperativeMatrixOperands = packed struct {4378pub const CooperativeMatrixOperands = packed struct(Word) {
5967 matrix_a_signed_components_khr: bool = false,4379 matrix_a_signed_components_khr: bool = false,
5968 matrix_b_signed_components_khr: bool = false,4380 matrix_b_signed_components_khr: bool = false,
5969 matrix_c_signed_components_khr: bool = false,4381 matrix_c_signed_components_khr: bool = false,
5970 matrix_result_signed_components_khr: bool = false,4382 matrix_result_signed_components_khr: bool = false,
5971 saturating_accumulation_khr: bool = false,4383 saturating_accumulation_khr: bool = false,
5972 _reserved_bit_5: bool = false,4384 _reserved_bits_5_to_31: u27 = 0,
5973 _reserved_bit_6: bool = false,
5974 _reserved_bit_7: bool = false,
5975 _reserved_bit_8: bool = false,
5976 _reserved_bit_9: bool = false,
5977 _reserved_bit_10: bool = false,
5978 _reserved_bit_11: bool = false,
5979 _reserved_bit_12: bool = false,
5980 _reserved_bit_13: bool = false,
5981 _reserved_bit_14: bool = false,
5982 _reserved_bit_15: bool = false,
5983 _reserved_bit_16: bool = false,
5984 _reserved_bit_17: bool = false,
5985 _reserved_bit_18: bool = false,
5986 _reserved_bit_19: bool = false,
5987 _reserved_bit_20: bool = false,
5988 _reserved_bit_21: bool = false,
5989 _reserved_bit_22: bool = false,
5990 _reserved_bit_23: bool = false,
5991 _reserved_bit_24: bool = false,
5992 _reserved_bit_25: bool = false,
5993 _reserved_bit_26: bool = false,
5994 _reserved_bit_27: bool = false,
5995 _reserved_bit_28: bool = false,
5996 _reserved_bit_29: bool = false,
5997 _reserved_bit_30: bool = false,
5998 _reserved_bit_31: bool = false,
5999};4385};
6000pub const CooperativeMatrixLayout = enum(u32) {4386pub const CooperativeMatrixLayout = enum(u32) {
6001 row_major_khr = 0,4387 row_major_khr = 0,
6002 column_major_khr = 1,4388 column_major_khr = 1,
6003 row_blocked_interleaved_arm = 4202,
6004 column_blocked_interleaved_arm = 4203,
6005};4389};
6006pub const CooperativeMatrixUse = enum(u32) {4390pub const CooperativeMatrixUse = enum(u32) {
6007 matrix_akhr = 0,4391 matrix_akhr = 0,
6008 matrix_bkhr = 1,4392 matrix_bkhr = 1,
6009 matrix_accumulator_khr = 2,4393 matrix_accumulator_khr = 2,
6010};4394};
6011pub const CooperativeMatrixReduce = packed struct {4395pub const CooperativeMatrixReduce = packed struct(Word) {
6012 row: bool = false,4396 row: bool = false,
6013 column: bool = false,4397 column: bool = false,
6014 @"2x2": bool = false,4398 @"2x2": bool = false,
6015 _reserved_bit_3: bool = false,4399 _reserved_bits_3_to_31: u29 = 0,
6016 _reserved_bit_4: bool = false,
6017 _reserved_bit_5: bool = false,
6018 _reserved_bit_6: bool = false,
6019 _reserved_bit_7: bool = false,
6020 _reserved_bit_8: bool = false,
6021 _reserved_bit_9: bool = false,
6022 _reserved_bit_10: bool = false,
6023 _reserved_bit_11: bool = false,
6024 _reserved_bit_12: bool = false,
6025 _reserved_bit_13: bool = false,
6026 _reserved_bit_14: bool = false,
6027 _reserved_bit_15: bool = false,
6028 _reserved_bit_16: bool = false,
6029 _reserved_bit_17: bool = false,
6030 _reserved_bit_18: bool = false,
6031 _reserved_bit_19: bool = false,
6032 _reserved_bit_20: bool = false,
6033 _reserved_bit_21: bool = false,
6034 _reserved_bit_22: bool = false,
6035 _reserved_bit_23: bool = false,
6036 _reserved_bit_24: bool = false,
6037 _reserved_bit_25: bool = false,
6038 _reserved_bit_26: bool = false,
6039 _reserved_bit_27: bool = false,
6040 _reserved_bit_28: bool = false,
6041 _reserved_bit_29: bool = false,
6042 _reserved_bit_30: bool = false,
6043 _reserved_bit_31: bool = false,
6044};4400};
6045pub const TensorClampMode = enum(u32) {4401pub const TensorClampMode = enum(u32) {
6046 undefined = 0,4402 undefined = 0,
...@@ -6049,96 +4405,14 @@ pub const TensorClampMode = enum(u32) {...@@ -6049,96 +4405,14 @@ pub const TensorClampMode = enum(u32) {
6049 repeat = 3,4405 repeat = 3,
6050 repeat_mirrored = 4,4406 repeat_mirrored = 4,
6051};4407};
6052pub const TensorAddressingOperands = packed struct {4408pub const TensorAddressingOperands = packed struct(Word) {
6053 tensor_view: bool = false,4409 _reserved_bits_0_to_31: u32 = 0,
6054 decode_func: bool = false,
6055 _reserved_bit_2: bool = false,
6056 _reserved_bit_3: bool = false,
6057 _reserved_bit_4: bool = false,
6058 _reserved_bit_5: bool = false,
6059 _reserved_bit_6: bool = false,
6060 _reserved_bit_7: bool = false,
6061 _reserved_bit_8: bool = false,
6062 _reserved_bit_9: bool = false,
6063 _reserved_bit_10: bool = false,
6064 _reserved_bit_11: bool = false,
6065 _reserved_bit_12: bool = false,
6066 _reserved_bit_13: bool = false,
6067 _reserved_bit_14: bool = false,
6068 _reserved_bit_15: bool = false,
6069 _reserved_bit_16: bool = false,
6070 _reserved_bit_17: bool = false,
6071 _reserved_bit_18: bool = false,
6072 _reserved_bit_19: bool = false,
6073 _reserved_bit_20: bool = false,
6074 _reserved_bit_21: bool = false,
6075 _reserved_bit_22: bool = false,
6076 _reserved_bit_23: bool = false,
6077 _reserved_bit_24: bool = false,
6078 _reserved_bit_25: bool = false,
6079 _reserved_bit_26: bool = false,
6080 _reserved_bit_27: bool = false,
6081 _reserved_bit_28: bool = false,
6082 _reserved_bit_29: bool = false,
6083 _reserved_bit_30: bool = false,
6084 _reserved_bit_31: bool = false,
6085
6086 pub const Extended = struct {
6087 tensor_view: ?struct { id_ref: Id } = null,
6088 decode_func: ?struct { id_ref: Id } = null,
6089 _reserved_bit_2: bool = false,
6090 _reserved_bit_3: bool = false,
6091 _reserved_bit_4: bool = false,
6092 _reserved_bit_5: bool = false,
6093 _reserved_bit_6: bool = false,
6094 _reserved_bit_7: bool = false,
6095 _reserved_bit_8: bool = false,
6096 _reserved_bit_9: bool = false,
6097 _reserved_bit_10: bool = false,
6098 _reserved_bit_11: bool = false,
6099 _reserved_bit_12: bool = false,
6100 _reserved_bit_13: bool = false,
6101 _reserved_bit_14: bool = false,
6102 _reserved_bit_15: bool = false,
6103 _reserved_bit_16: bool = false,
6104 _reserved_bit_17: bool = false,
6105 _reserved_bit_18: bool = false,
6106 _reserved_bit_19: bool = false,
6107 _reserved_bit_20: bool = false,
6108 _reserved_bit_21: bool = false,
6109 _reserved_bit_22: bool = false,
6110 _reserved_bit_23: bool = false,
6111 _reserved_bit_24: bool = false,
6112 _reserved_bit_25: bool = false,
6113 _reserved_bit_26: bool = false,
6114 _reserved_bit_27: bool = false,
6115 _reserved_bit_28: bool = false,
6116 _reserved_bit_29: bool = false,
6117 _reserved_bit_30: bool = false,
6118 _reserved_bit_31: bool = false,
6119 };
6120};4410};
6121pub const InitializationModeQualifier = enum(u32) {4411pub const InitializationModeQualifier = enum(u32) {};
6122 init_on_device_reprogram_altera = 0,4412pub const LoadCacheControl = enum(u32) {};
6123 init_on_device_reset_altera = 1,4413pub const StoreCacheControl = enum(u32) {};
6124};4414pub const NamedMaximumNumberOfRegisters = enum(u32) {};
6125pub const LoadCacheControl = enum(u32) {4415pub const MatrixMultiplyAccumulateOperands = packed struct(Word) {
6126 uncached_intel = 0,
6127 cached_intel = 1,
6128 streaming_intel = 2,
6129 invalidate_after_read_intel = 3,
6130 const_cached_intel = 4,
6131};
6132pub const StoreCacheControl = enum(u32) {
6133 uncached_intel = 0,
6134 write_through_intel = 1,
6135 write_back_intel = 2,
6136 streaming_intel = 3,
6137};
6138pub const NamedMaximumNumberOfRegisters = enum(u32) {
6139 auto_intel = 0,
6140};
6141pub const MatrixMultiplyAccumulateOperands = packed struct {
6142 matrix_a_signed_components_intel: bool = false,4416 matrix_a_signed_components_intel: bool = false,
6143 matrix_b_signed_components_intel: bool = false,4417 matrix_b_signed_components_intel: bool = false,
6144 matrix_cb_float16intel: bool = false,4418 matrix_cb_float16intel: bool = false,
...@@ -6153,24 +4427,7 @@ pub const MatrixMultiplyAccumulateOperands = packed struct {...@@ -6153,24 +4427,7 @@ pub const MatrixMultiplyAccumulateOperands = packed struct {
6153 matrix_b_packed_float16intel: bool = false,4427 matrix_b_packed_float16intel: bool = false,
6154 matrix_a_packed_b_float16intel: bool = false,4428 matrix_a_packed_b_float16intel: bool = false,
6155 matrix_b_packed_b_float16intel: bool = false,4429 matrix_b_packed_b_float16intel: bool = false,
6156 _reserved_bit_14: bool = false,4430 _reserved_bits_14_to_31: u18 = 0,
6157 _reserved_bit_15: bool = false,
6158 _reserved_bit_16: bool = false,
6159 _reserved_bit_17: bool = false,
6160 _reserved_bit_18: bool = false,
6161 _reserved_bit_19: bool = false,
6162 _reserved_bit_20: bool = false,
6163 _reserved_bit_21: bool = false,
6164 _reserved_bit_22: bool = false,
6165 _reserved_bit_23: bool = false,
6166 _reserved_bit_24: bool = false,
6167 _reserved_bit_25: bool = false,
6168 _reserved_bit_26: bool = false,
6169 _reserved_bit_27: bool = false,
6170 _reserved_bit_28: bool = false,
6171 _reserved_bit_29: bool = false,
6172 _reserved_bit_30: bool = false,
6173 _reserved_bit_31: bool = false,
6174};4431};
6175pub const FPEncoding = enum(u32) {4432pub const FPEncoding = enum(u32) {
6176 b_float16khr = 0,4433 b_float16khr = 0,
...@@ -6200,10845 +4457,19 @@ pub const ComponentType = enum(u32) {...@@ -6200,10845 +4457,19 @@ pub const ComponentType = enum(u32) {
6200 float_e4m3nv = 1000491002,4457 float_e4m3nv = 1000491002,
6201 float_e5m2nv = 1000491003,4458 float_e5m2nv = 1000491003,
6202};4459};
6203pub const TensorOperands = packed struct {4460pub const TensorOperands = packed struct(Word) {
6204 nontemporal_arm: bool = false,4461 _reserved_bits_0_to_31: u32 = 0,
6205 out_of_bounds_value_arm: bool = false,
6206 make_element_available_arm: bool = false,
6207 make_element_visible_arm: bool = false,
6208 non_private_element_arm: bool = false,
6209 _reserved_bit_5: bool = false,
6210 _reserved_bit_6: bool = false,
6211 _reserved_bit_7: bool = false,
6212 _reserved_bit_8: bool = false,
6213 _reserved_bit_9: bool = false,
6214 _reserved_bit_10: bool = false,
6215 _reserved_bit_11: bool = false,
6216 _reserved_bit_12: bool = false,
6217 _reserved_bit_13: bool = false,
6218 _reserved_bit_14: bool = false,
6219 _reserved_bit_15: bool = false,
6220 _reserved_bit_16: bool = false,
6221 _reserved_bit_17: bool = false,
6222 _reserved_bit_18: bool = false,
6223 _reserved_bit_19: bool = false,
6224 _reserved_bit_20: bool = false,
6225 _reserved_bit_21: bool = false,
6226 _reserved_bit_22: bool = false,
6227 _reserved_bit_23: bool = false,
6228 _reserved_bit_24: bool = false,
6229 _reserved_bit_25: bool = false,
6230 _reserved_bit_26: bool = false,
6231 _reserved_bit_27: bool = false,
6232 _reserved_bit_28: bool = false,
6233 _reserved_bit_29: bool = false,
6234 _reserved_bit_30: bool = false,
6235 _reserved_bit_31: bool = false,
6236
6237 pub const Extended = struct {
6238 nontemporal_arm: bool = false,
6239 out_of_bounds_value_arm: ?struct { id_ref: Id } = null,
6240 make_element_available_arm: ?struct { id_ref: Id } = null,
6241 make_element_visible_arm: ?struct { id_ref: Id } = null,
6242 non_private_element_arm: bool = false,
6243 _reserved_bit_5: bool = false,
6244 _reserved_bit_6: bool = false,
6245 _reserved_bit_7: bool = false,
6246 _reserved_bit_8: bool = false,
6247 _reserved_bit_9: bool = false,
6248 _reserved_bit_10: bool = false,
6249 _reserved_bit_11: bool = false,
6250 _reserved_bit_12: bool = false,
6251 _reserved_bit_13: bool = false,
6252 _reserved_bit_14: bool = false,
6253 _reserved_bit_15: bool = false,
6254 _reserved_bit_16: bool = false,
6255 _reserved_bit_17: bool = false,
6256 _reserved_bit_18: bool = false,
6257 _reserved_bit_19: bool = false,
6258 _reserved_bit_20: bool = false,
6259 _reserved_bit_21: bool = false,
6260 _reserved_bit_22: bool = false,
6261 _reserved_bit_23: bool = false,
6262 _reserved_bit_24: bool = false,
6263 _reserved_bit_25: bool = false,
6264 _reserved_bit_26: bool = false,
6265 _reserved_bit_27: bool = false,
6266 _reserved_bit_28: bool = false,
6267 _reserved_bit_29: bool = false,
6268 _reserved_bit_30: bool = false,
6269 _reserved_bit_31: bool = false,
6270 };
6271};4462};
6272pub const InstructionSet = enum {4463pub const InstructionSet = enum {
6273 core,4464 core,
6274 @"OpenCL.std",4465 @"OpenCL.std",
6275 @"GLSL.std.450",4466 @"GLSL.std.450",
6276 zig,
62774467
6278 pub fn instructions(self: InstructionSet) []const Instruction {4468 pub fn operands(inst_set: InstructionSet, opcode: Word) ?[]const Operand {
6279 return switch (self) {4469 return switch (inst_set) {
6280 .core => &.{4470 .core => if (std.enums.fromInt(Opcode, opcode)) |op| op.operands() else null,
6281 .{4471 .@"OpenCL.std" => if (std.enums.fromInt(OpenClOpcode, opcode)) |op| op.operands() else null,
6282 .name = "OpNop",4472 .@"GLSL.std.450" => if (std.enums.fromInt(GlslOpcode, opcode)) |op| op.operands() else null,
6283 .opcode = 0,
6284 .operands = &.{},
6285 },
6286 .{
6287 .name = "OpUndef",
6288 .opcode = 1,
6289 .operands = &.{
6290 .{ .kind = .id_result_type, .quantifier = .required },
6291 .{ .kind = .id_result, .quantifier = .required },
6292 },
6293 },
6294 .{
6295 .name = "OpSourceContinued",
6296 .opcode = 2,
6297 .operands = &.{
6298 .{ .kind = .literal_string, .quantifier = .required },
6299 },
6300 },
6301 .{
6302 .name = "OpSource",
6303 .opcode = 3,
6304 .operands = &.{
6305 .{ .kind = .source_language, .quantifier = .required },
6306 .{ .kind = .literal_integer, .quantifier = .required },
6307 .{ .kind = .id_ref, .quantifier = .optional },
6308 .{ .kind = .literal_string, .quantifier = .optional },
6309 },
6310 },
6311 .{
6312 .name = "OpSourceExtension",
6313 .opcode = 4,
6314 .operands = &.{
6315 .{ .kind = .literal_string, .quantifier = .required },
6316 },
6317 },
6318 .{
6319 .name = "OpName",
6320 .opcode = 5,
6321 .operands = &.{
6322 .{ .kind = .id_ref, .quantifier = .required },
6323 .{ .kind = .literal_string, .quantifier = .required },
6324 },
6325 },
6326 .{
6327 .name = "OpMemberName",
6328 .opcode = 6,
6329 .operands = &.{
6330 .{ .kind = .id_ref, .quantifier = .required },
6331 .{ .kind = .literal_integer, .quantifier = .required },
6332 .{ .kind = .literal_string, .quantifier = .required },
6333 },
6334 },
6335 .{
6336 .name = "OpString",
6337 .opcode = 7,
6338 .operands = &.{
6339 .{ .kind = .id_result, .quantifier = .required },
6340 .{ .kind = .literal_string, .quantifier = .required },
6341 },
6342 },
6343 .{
6344 .name = "OpLine",
6345 .opcode = 8,
6346 .operands = &.{
6347 .{ .kind = .id_ref, .quantifier = .required },
6348 .{ .kind = .literal_integer, .quantifier = .required },
6349 .{ .kind = .literal_integer, .quantifier = .required },
6350 },
6351 },
6352 .{
6353 .name = "OpExtension",
6354 .opcode = 10,
6355 .operands = &.{
6356 .{ .kind = .literal_string, .quantifier = .required },
6357 },
6358 },
6359 .{
6360 .name = "OpExtInstImport",
6361 .opcode = 11,
6362 .operands = &.{
6363 .{ .kind = .id_result, .quantifier = .required },
6364 .{ .kind = .literal_string, .quantifier = .required },
6365 },
6366 },
6367 .{
6368 .name = "OpExtInst",
6369 .opcode = 12,
6370 .operands = &.{
6371 .{ .kind = .id_result_type, .quantifier = .required },
6372 .{ .kind = .id_result, .quantifier = .required },
6373 .{ .kind = .id_ref, .quantifier = .required },
6374 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
6375 .{ .kind = .id_ref, .quantifier = .variadic },
6376 },
6377 },
6378 .{
6379 .name = "OpMemoryModel",
6380 .opcode = 14,
6381 .operands = &.{
6382 .{ .kind = .addressing_model, .quantifier = .required },
6383 .{ .kind = .memory_model, .quantifier = .required },
6384 },
6385 },
6386 .{
6387 .name = "OpEntryPoint",
6388 .opcode = 15,
6389 .operands = &.{
6390 .{ .kind = .execution_model, .quantifier = .required },
6391 .{ .kind = .id_ref, .quantifier = .required },
6392 .{ .kind = .literal_string, .quantifier = .required },
6393 .{ .kind = .id_ref, .quantifier = .variadic },
6394 },
6395 },
6396 .{
6397 .name = "OpExecutionMode",
6398 .opcode = 16,
6399 .operands = &.{
6400 .{ .kind = .id_ref, .quantifier = .required },
6401 .{ .kind = .execution_mode, .quantifier = .required },
6402 },
6403 },
6404 .{
6405 .name = "OpCapability",
6406 .opcode = 17,
6407 .operands = &.{
6408 .{ .kind = .capability, .quantifier = .required },
6409 },
6410 },
6411 .{
6412 .name = "OpTypeVoid",
6413 .opcode = 19,
6414 .operands = &.{
6415 .{ .kind = .id_result, .quantifier = .required },
6416 },
6417 },
6418 .{
6419 .name = "OpTypeBool",
6420 .opcode = 20,
6421 .operands = &.{
6422 .{ .kind = .id_result, .quantifier = .required },
6423 },
6424 },
6425 .{
6426 .name = "OpTypeInt",
6427 .opcode = 21,
6428 .operands = &.{
6429 .{ .kind = .id_result, .quantifier = .required },
6430 .{ .kind = .literal_integer, .quantifier = .required },
6431 .{ .kind = .literal_integer, .quantifier = .required },
6432 },
6433 },
6434 .{
6435 .name = "OpTypeFloat",
6436 .opcode = 22,
6437 .operands = &.{
6438 .{ .kind = .id_result, .quantifier = .required },
6439 .{ .kind = .literal_integer, .quantifier = .required },
6440 .{ .kind = .fp_encoding, .quantifier = .optional },
6441 },
6442 },
6443 .{
6444 .name = "OpTypeVector",
6445 .opcode = 23,
6446 .operands = &.{
6447 .{ .kind = .id_result, .quantifier = .required },
6448 .{ .kind = .id_ref, .quantifier = .required },
6449 .{ .kind = .literal_integer, .quantifier = .required },
6450 },
6451 },
6452 .{
6453 .name = "OpTypeMatrix",
6454 .opcode = 24,
6455 .operands = &.{
6456 .{ .kind = .id_result, .quantifier = .required },
6457 .{ .kind = .id_ref, .quantifier = .required },
6458 .{ .kind = .literal_integer, .quantifier = .required },
6459 },
6460 },
6461 .{
6462 .name = "OpTypeImage",
6463 .opcode = 25,
6464 .operands = &.{
6465 .{ .kind = .id_result, .quantifier = .required },
6466 .{ .kind = .id_ref, .quantifier = .required },
6467 .{ .kind = .dim, .quantifier = .required },
6468 .{ .kind = .literal_integer, .quantifier = .required },
6469 .{ .kind = .literal_integer, .quantifier = .required },
6470 .{ .kind = .literal_integer, .quantifier = .required },
6471 .{ .kind = .literal_integer, .quantifier = .required },
6472 .{ .kind = .image_format, .quantifier = .required },
6473 .{ .kind = .access_qualifier, .quantifier = .optional },
6474 },
6475 },
6476 .{
6477 .name = "OpTypeSampler",
6478 .opcode = 26,
6479 .operands = &.{
6480 .{ .kind = .id_result, .quantifier = .required },
6481 },
6482 },
6483 .{
6484 .name = "OpTypeSampledImage",
6485 .opcode = 27,
6486 .operands = &.{
6487 .{ .kind = .id_result, .quantifier = .required },
6488 .{ .kind = .id_ref, .quantifier = .required },
6489 },
6490 },
6491 .{
6492 .name = "OpTypeArray",
6493 .opcode = 28,
6494 .operands = &.{
6495 .{ .kind = .id_result, .quantifier = .required },
6496 .{ .kind = .id_ref, .quantifier = .required },
6497 .{ .kind = .id_ref, .quantifier = .required },
6498 },
6499 },
6500 .{
6501 .name = "OpTypeRuntimeArray",
6502 .opcode = 29,
6503 .operands = &.{
6504 .{ .kind = .id_result, .quantifier = .required },
6505 .{ .kind = .id_ref, .quantifier = .required },
6506 },
6507 },
6508 .{
6509 .name = "OpTypeStruct",
6510 .opcode = 30,
6511 .operands = &.{
6512 .{ .kind = .id_result, .quantifier = .required },
6513 .{ .kind = .id_ref, .quantifier = .variadic },
6514 },
6515 },
6516 .{
6517 .name = "OpTypeOpaque",
6518 .opcode = 31,
6519 .operands = &.{
6520 .{ .kind = .id_result, .quantifier = .required },
6521 .{ .kind = .literal_string, .quantifier = .required },
6522 },
6523 },
6524 .{
6525 .name = "OpTypePointer",
6526 .opcode = 32,
6527 .operands = &.{
6528 .{ .kind = .id_result, .quantifier = .required },
6529 .{ .kind = .storage_class, .quantifier = .required },
6530 .{ .kind = .id_ref, .quantifier = .required },
6531 },
6532 },
6533 .{
6534 .name = "OpTypeFunction",
6535 .opcode = 33,
6536 .operands = &.{
6537 .{ .kind = .id_result, .quantifier = .required },
6538 .{ .kind = .id_ref, .quantifier = .required },
6539 .{ .kind = .id_ref, .quantifier = .variadic },
6540 },
6541 },
6542 .{
6543 .name = "OpTypeEvent",
6544 .opcode = 34,
6545 .operands = &.{
6546 .{ .kind = .id_result, .quantifier = .required },
6547 },
6548 },
6549 .{
6550 .name = "OpTypeDeviceEvent",
6551 .opcode = 35,
6552 .operands = &.{
6553 .{ .kind = .id_result, .quantifier = .required },
6554 },
6555 },
6556 .{
6557 .name = "OpTypeReserveId",
6558 .opcode = 36,
6559 .operands = &.{
6560 .{ .kind = .id_result, .quantifier = .required },
6561 },
6562 },
6563 .{
6564 .name = "OpTypeQueue",
6565 .opcode = 37,
6566 .operands = &.{
6567 .{ .kind = .id_result, .quantifier = .required },
6568 },
6569 },
6570 .{
6571 .name = "OpTypePipe",
6572 .opcode = 38,
6573 .operands = &.{
6574 .{ .kind = .id_result, .quantifier = .required },
6575 .{ .kind = .access_qualifier, .quantifier = .required },
6576 },
6577 },
6578 .{
6579 .name = "OpTypeForwardPointer",
6580 .opcode = 39,
6581 .operands = &.{
6582 .{ .kind = .id_ref, .quantifier = .required },
6583 .{ .kind = .storage_class, .quantifier = .required },
6584 },
6585 },
6586 .{
6587 .name = "OpConstantTrue",
6588 .opcode = 41,
6589 .operands = &.{
6590 .{ .kind = .id_result_type, .quantifier = .required },
6591 .{ .kind = .id_result, .quantifier = .required },
6592 },
6593 },
6594 .{
6595 .name = "OpConstantFalse",
6596 .opcode = 42,
6597 .operands = &.{
6598 .{ .kind = .id_result_type, .quantifier = .required },
6599 .{ .kind = .id_result, .quantifier = .required },
6600 },
6601 },
6602 .{
6603 .name = "OpConstant",
6604 .opcode = 43,
6605 .operands = &.{
6606 .{ .kind = .id_result_type, .quantifier = .required },
6607 .{ .kind = .id_result, .quantifier = .required },
6608 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6609 },
6610 },
6611 .{
6612 .name = "OpConstantComposite",
6613 .opcode = 44,
6614 .operands = &.{
6615 .{ .kind = .id_result_type, .quantifier = .required },
6616 .{ .kind = .id_result, .quantifier = .required },
6617 .{ .kind = .id_ref, .quantifier = .variadic },
6618 },
6619 },
6620 .{
6621 .name = "OpConstantSampler",
6622 .opcode = 45,
6623 .operands = &.{
6624 .{ .kind = .id_result_type, .quantifier = .required },
6625 .{ .kind = .id_result, .quantifier = .required },
6626 .{ .kind = .sampler_addressing_mode, .quantifier = .required },
6627 .{ .kind = .literal_integer, .quantifier = .required },
6628 .{ .kind = .sampler_filter_mode, .quantifier = .required },
6629 },
6630 },
6631 .{
6632 .name = "OpConstantNull",
6633 .opcode = 46,
6634 .operands = &.{
6635 .{ .kind = .id_result_type, .quantifier = .required },
6636 .{ .kind = .id_result, .quantifier = .required },
6637 },
6638 },
6639 .{
6640 .name = "OpSpecConstantTrue",
6641 .opcode = 48,
6642 .operands = &.{
6643 .{ .kind = .id_result_type, .quantifier = .required },
6644 .{ .kind = .id_result, .quantifier = .required },
6645 },
6646 },
6647 .{
6648 .name = "OpSpecConstantFalse",
6649 .opcode = 49,
6650 .operands = &.{
6651 .{ .kind = .id_result_type, .quantifier = .required },
6652 .{ .kind = .id_result, .quantifier = .required },
6653 },
6654 },
6655 .{
6656 .name = "OpSpecConstant",
6657 .opcode = 50,
6658 .operands = &.{
6659 .{ .kind = .id_result_type, .quantifier = .required },
6660 .{ .kind = .id_result, .quantifier = .required },
6661 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6662 },
6663 },
6664 .{
6665 .name = "OpSpecConstantComposite",
6666 .opcode = 51,
6667 .operands = &.{
6668 .{ .kind = .id_result_type, .quantifier = .required },
6669 .{ .kind = .id_result, .quantifier = .required },
6670 .{ .kind = .id_ref, .quantifier = .variadic },
6671 },
6672 },
6673 .{
6674 .name = "OpSpecConstantOp",
6675 .opcode = 52,
6676 .operands = &.{
6677 .{ .kind = .id_result_type, .quantifier = .required },
6678 .{ .kind = .id_result, .quantifier = .required },
6679 .{ .kind = .literal_spec_constant_op_integer, .quantifier = .required },
6680 },
6681 },
6682 .{
6683 .name = "OpFunction",
6684 .opcode = 54,
6685 .operands = &.{
6686 .{ .kind = .id_result_type, .quantifier = .required },
6687 .{ .kind = .id_result, .quantifier = .required },
6688 .{ .kind = .function_control, .quantifier = .required },
6689 .{ .kind = .id_ref, .quantifier = .required },
6690 },
6691 },
6692 .{
6693 .name = "OpFunctionParameter",
6694 .opcode = 55,
6695 .operands = &.{
6696 .{ .kind = .id_result_type, .quantifier = .required },
6697 .{ .kind = .id_result, .quantifier = .required },
6698 },
6699 },
6700 .{
6701 .name = "OpFunctionEnd",
6702 .opcode = 56,
6703 .operands = &.{},
6704 },
6705 .{
6706 .name = "OpFunctionCall",
6707 .opcode = 57,
6708 .operands = &.{
6709 .{ .kind = .id_result_type, .quantifier = .required },
6710 .{ .kind = .id_result, .quantifier = .required },
6711 .{ .kind = .id_ref, .quantifier = .required },
6712 .{ .kind = .id_ref, .quantifier = .variadic },
6713 },
6714 },
6715 .{
6716 .name = "OpVariable",
6717 .opcode = 59,
6718 .operands = &.{
6719 .{ .kind = .id_result_type, .quantifier = .required },
6720 .{ .kind = .id_result, .quantifier = .required },
6721 .{ .kind = .storage_class, .quantifier = .required },
6722 .{ .kind = .id_ref, .quantifier = .optional },
6723 },
6724 },
6725 .{
6726 .name = "OpImageTexelPointer",
6727 .opcode = 60,
6728 .operands = &.{
6729 .{ .kind = .id_result_type, .quantifier = .required },
6730 .{ .kind = .id_result, .quantifier = .required },
6731 .{ .kind = .id_ref, .quantifier = .required },
6732 .{ .kind = .id_ref, .quantifier = .required },
6733 .{ .kind = .id_ref, .quantifier = .required },
6734 },
6735 },
6736 .{
6737 .name = "OpLoad",
6738 .opcode = 61,
6739 .operands = &.{
6740 .{ .kind = .id_result_type, .quantifier = .required },
6741 .{ .kind = .id_result, .quantifier = .required },
6742 .{ .kind = .id_ref, .quantifier = .required },
6743 .{ .kind = .memory_access, .quantifier = .optional },
6744 },
6745 },
6746 .{
6747 .name = "OpStore",
6748 .opcode = 62,
6749 .operands = &.{
6750 .{ .kind = .id_ref, .quantifier = .required },
6751 .{ .kind = .id_ref, .quantifier = .required },
6752 .{ .kind = .memory_access, .quantifier = .optional },
6753 },
6754 },
6755 .{
6756 .name = "OpCopyMemory",
6757 .opcode = 63,
6758 .operands = &.{
6759 .{ .kind = .id_ref, .quantifier = .required },
6760 .{ .kind = .id_ref, .quantifier = .required },
6761 .{ .kind = .memory_access, .quantifier = .optional },
6762 .{ .kind = .memory_access, .quantifier = .optional },
6763 },
6764 },
6765 .{
6766 .name = "OpCopyMemorySized",
6767 .opcode = 64,
6768 .operands = &.{
6769 .{ .kind = .id_ref, .quantifier = .required },
6770 .{ .kind = .id_ref, .quantifier = .required },
6771 .{ .kind = .id_ref, .quantifier = .required },
6772 .{ .kind = .memory_access, .quantifier = .optional },
6773 .{ .kind = .memory_access, .quantifier = .optional },
6774 },
6775 },
6776 .{
6777 .name = "OpAccessChain",
6778 .opcode = 65,
6779 .operands = &.{
6780 .{ .kind = .id_result_type, .quantifier = .required },
6781 .{ .kind = .id_result, .quantifier = .required },
6782 .{ .kind = .id_ref, .quantifier = .required },
6783 .{ .kind = .id_ref, .quantifier = .variadic },
6784 },
6785 },
6786 .{
6787 .name = "OpInBoundsAccessChain",
6788 .opcode = 66,
6789 .operands = &.{
6790 .{ .kind = .id_result_type, .quantifier = .required },
6791 .{ .kind = .id_result, .quantifier = .required },
6792 .{ .kind = .id_ref, .quantifier = .required },
6793 .{ .kind = .id_ref, .quantifier = .variadic },
6794 },
6795 },
6796 .{
6797 .name = "OpPtrAccessChain",
6798 .opcode = 67,
6799 .operands = &.{
6800 .{ .kind = .id_result_type, .quantifier = .required },
6801 .{ .kind = .id_result, .quantifier = .required },
6802 .{ .kind = .id_ref, .quantifier = .required },
6803 .{ .kind = .id_ref, .quantifier = .required },
6804 .{ .kind = .id_ref, .quantifier = .variadic },
6805 },
6806 },
6807 .{
6808 .name = "OpArrayLength",
6809 .opcode = 68,
6810 .operands = &.{
6811 .{ .kind = .id_result_type, .quantifier = .required },
6812 .{ .kind = .id_result, .quantifier = .required },
6813 .{ .kind = .id_ref, .quantifier = .required },
6814 .{ .kind = .literal_integer, .quantifier = .required },
6815 },
6816 },
6817 .{
6818 .name = "OpGenericPtrMemSemantics",
6819 .opcode = 69,
6820 .operands = &.{
6821 .{ .kind = .id_result_type, .quantifier = .required },
6822 .{ .kind = .id_result, .quantifier = .required },
6823 .{ .kind = .id_ref, .quantifier = .required },
6824 },
6825 },
6826 .{
6827 .name = "OpInBoundsPtrAccessChain",
6828 .opcode = 70,
6829 .operands = &.{
6830 .{ .kind = .id_result_type, .quantifier = .required },
6831 .{ .kind = .id_result, .quantifier = .required },
6832 .{ .kind = .id_ref, .quantifier = .required },
6833 .{ .kind = .id_ref, .quantifier = .required },
6834 .{ .kind = .id_ref, .quantifier = .variadic },
6835 },
6836 },
6837 .{
6838 .name = "OpDecorate",
6839 .opcode = 71,
6840 .operands = &.{
6841 .{ .kind = .id_ref, .quantifier = .required },
6842 .{ .kind = .decoration, .quantifier = .required },
6843 },
6844 },
6845 .{
6846 .name = "OpMemberDecorate",
6847 .opcode = 72,
6848 .operands = &.{
6849 .{ .kind = .id_ref, .quantifier = .required },
6850 .{ .kind = .literal_integer, .quantifier = .required },
6851 .{ .kind = .decoration, .quantifier = .required },
6852 },
6853 },
6854 .{
6855 .name = "OpDecorationGroup",
6856 .opcode = 73,
6857 .operands = &.{
6858 .{ .kind = .id_result, .quantifier = .required },
6859 },
6860 },
6861 .{
6862 .name = "OpGroupDecorate",
6863 .opcode = 74,
6864 .operands = &.{
6865 .{ .kind = .id_ref, .quantifier = .required },
6866 .{ .kind = .id_ref, .quantifier = .variadic },
6867 },
6868 },
6869 .{
6870 .name = "OpGroupMemberDecorate",
6871 .opcode = 75,
6872 .operands = &.{
6873 .{ .kind = .id_ref, .quantifier = .required },
6874 .{ .kind = .pair_id_ref_literal_integer, .quantifier = .variadic },
6875 },
6876 },
6877 .{
6878 .name = "OpVectorExtractDynamic",
6879 .opcode = 77,
6880 .operands = &.{
6881 .{ .kind = .id_result_type, .quantifier = .required },
6882 .{ .kind = .id_result, .quantifier = .required },
6883 .{ .kind = .id_ref, .quantifier = .required },
6884 .{ .kind = .id_ref, .quantifier = .required },
6885 },
6886 },
6887 .{
6888 .name = "OpVectorInsertDynamic",
6889 .opcode = 78,
6890 .operands = &.{
6891 .{ .kind = .id_result_type, .quantifier = .required },
6892 .{ .kind = .id_result, .quantifier = .required },
6893 .{ .kind = .id_ref, .quantifier = .required },
6894 .{ .kind = .id_ref, .quantifier = .required },
6895 .{ .kind = .id_ref, .quantifier = .required },
6896 },
6897 },
6898 .{
6899 .name = "OpVectorShuffle",
6900 .opcode = 79,
6901 .operands = &.{
6902 .{ .kind = .id_result_type, .quantifier = .required },
6903 .{ .kind = .id_result, .quantifier = .required },
6904 .{ .kind = .id_ref, .quantifier = .required },
6905 .{ .kind = .id_ref, .quantifier = .required },
6906 .{ .kind = .literal_integer, .quantifier = .variadic },
6907 },
6908 },
6909 .{
6910 .name = "OpCompositeConstruct",
6911 .opcode = 80,
6912 .operands = &.{
6913 .{ .kind = .id_result_type, .quantifier = .required },
6914 .{ .kind = .id_result, .quantifier = .required },
6915 .{ .kind = .id_ref, .quantifier = .variadic },
6916 },
6917 },
6918 .{
6919 .name = "OpCompositeExtract",
6920 .opcode = 81,
6921 .operands = &.{
6922 .{ .kind = .id_result_type, .quantifier = .required },
6923 .{ .kind = .id_result, .quantifier = .required },
6924 .{ .kind = .id_ref, .quantifier = .required },
6925 .{ .kind = .literal_integer, .quantifier = .variadic },
6926 },
6927 },
6928 .{
6929 .name = "OpCompositeInsert",
6930 .opcode = 82,
6931 .operands = &.{
6932 .{ .kind = .id_result_type, .quantifier = .required },
6933 .{ .kind = .id_result, .quantifier = .required },
6934 .{ .kind = .id_ref, .quantifier = .required },
6935 .{ .kind = .id_ref, .quantifier = .required },
6936 .{ .kind = .literal_integer, .quantifier = .variadic },
6937 },
6938 },
6939 .{
6940 .name = "OpCopyObject",
6941 .opcode = 83,
6942 .operands = &.{
6943 .{ .kind = .id_result_type, .quantifier = .required },
6944 .{ .kind = .id_result, .quantifier = .required },
6945 .{ .kind = .id_ref, .quantifier = .required },
6946 },
6947 },
6948 .{
6949 .name = "OpTranspose",
6950 .opcode = 84,
6951 .operands = &.{
6952 .{ .kind = .id_result_type, .quantifier = .required },
6953 .{ .kind = .id_result, .quantifier = .required },
6954 .{ .kind = .id_ref, .quantifier = .required },
6955 },
6956 },
6957 .{
6958 .name = "OpSampledImage",
6959 .opcode = 86,
6960 .operands = &.{
6961 .{ .kind = .id_result_type, .quantifier = .required },
6962 .{ .kind = .id_result, .quantifier = .required },
6963 .{ .kind = .id_ref, .quantifier = .required },
6964 .{ .kind = .id_ref, .quantifier = .required },
6965 },
6966 },
6967 .{
6968 .name = "OpImageSampleImplicitLod",
6969 .opcode = 87,
6970 .operands = &.{
6971 .{ .kind = .id_result_type, .quantifier = .required },
6972 .{ .kind = .id_result, .quantifier = .required },
6973 .{ .kind = .id_ref, .quantifier = .required },
6974 .{ .kind = .id_ref, .quantifier = .required },
6975 .{ .kind = .image_operands, .quantifier = .optional },
6976 },
6977 },
6978 .{
6979 .name = "OpImageSampleExplicitLod",
6980 .opcode = 88,
6981 .operands = &.{
6982 .{ .kind = .id_result_type, .quantifier = .required },
6983 .{ .kind = .id_result, .quantifier = .required },
6984 .{ .kind = .id_ref, .quantifier = .required },
6985 .{ .kind = .id_ref, .quantifier = .required },
6986 .{ .kind = .image_operands, .quantifier = .required },
6987 },
6988 },
6989 .{
6990 .name = "OpImageSampleDrefImplicitLod",
6991 .opcode = 89,
6992 .operands = &.{
6993 .{ .kind = .id_result_type, .quantifier = .required },
6994 .{ .kind = .id_result, .quantifier = .required },
6995 .{ .kind = .id_ref, .quantifier = .required },
6996 .{ .kind = .id_ref, .quantifier = .required },
6997 .{ .kind = .id_ref, .quantifier = .required },
6998 .{ .kind = .image_operands, .quantifier = .optional },
6999 },
7000 },
7001 .{
7002 .name = "OpImageSampleDrefExplicitLod",
7003 .opcode = 90,
7004 .operands = &.{
7005 .{ .kind = .id_result_type, .quantifier = .required },
7006 .{ .kind = .id_result, .quantifier = .required },
7007 .{ .kind = .id_ref, .quantifier = .required },
7008 .{ .kind = .id_ref, .quantifier = .required },
7009 .{ .kind = .id_ref, .quantifier = .required },
7010 .{ .kind = .image_operands, .quantifier = .required },
7011 },
7012 },
7013 .{
7014 .name = "OpImageSampleProjImplicitLod",
7015 .opcode = 91,
7016 .operands = &.{
7017 .{ .kind = .id_result_type, .quantifier = .required },
7018 .{ .kind = .id_result, .quantifier = .required },
7019 .{ .kind = .id_ref, .quantifier = .required },
7020 .{ .kind = .id_ref, .quantifier = .required },
7021 .{ .kind = .image_operands, .quantifier = .optional },
7022 },
7023 },
7024 .{
7025 .name = "OpImageSampleProjExplicitLod",
7026 .opcode = 92,
7027 .operands = &.{
7028 .{ .kind = .id_result_type, .quantifier = .required },
7029 .{ .kind = .id_result, .quantifier = .required },
7030 .{ .kind = .id_ref, .quantifier = .required },
7031 .{ .kind = .id_ref, .quantifier = .required },
7032 .{ .kind = .image_operands, .quantifier = .required },
7033 },
7034 },
7035 .{
7036 .name = "OpImageSampleProjDrefImplicitLod",
7037 .opcode = 93,
7038 .operands = &.{
7039 .{ .kind = .id_result_type, .quantifier = .required },
7040 .{ .kind = .id_result, .quantifier = .required },
7041 .{ .kind = .id_ref, .quantifier = .required },
7042 .{ .kind = .id_ref, .quantifier = .required },
7043 .{ .kind = .id_ref, .quantifier = .required },
7044 .{ .kind = .image_operands, .quantifier = .optional },
7045 },
7046 },
7047 .{
7048 .name = "OpImageSampleProjDrefExplicitLod",
7049 .opcode = 94,
7050 .operands = &.{
7051 .{ .kind = .id_result_type, .quantifier = .required },
7052 .{ .kind = .id_result, .quantifier = .required },
7053 .{ .kind = .id_ref, .quantifier = .required },
7054 .{ .kind = .id_ref, .quantifier = .required },
7055 .{ .kind = .id_ref, .quantifier = .required },
7056 .{ .kind = .image_operands, .quantifier = .required },
7057 },
7058 },
7059 .{
7060 .name = "OpImageFetch",
7061 .opcode = 95,
7062 .operands = &.{
7063 .{ .kind = .id_result_type, .quantifier = .required },
7064 .{ .kind = .id_result, .quantifier = .required },
7065 .{ .kind = .id_ref, .quantifier = .required },
7066 .{ .kind = .id_ref, .quantifier = .required },
7067 .{ .kind = .image_operands, .quantifier = .optional },
7068 },
7069 },
7070 .{
7071 .name = "OpImageGather",
7072 .opcode = 96,
7073 .operands = &.{
7074 .{ .kind = .id_result_type, .quantifier = .required },
7075 .{ .kind = .id_result, .quantifier = .required },
7076 .{ .kind = .id_ref, .quantifier = .required },
7077 .{ .kind = .id_ref, .quantifier = .required },
7078 .{ .kind = .id_ref, .quantifier = .required },
7079 .{ .kind = .image_operands, .quantifier = .optional },
7080 },
7081 },
7082 .{
7083 .name = "OpImageDrefGather",
7084 .opcode = 97,
7085 .operands = &.{
7086 .{ .kind = .id_result_type, .quantifier = .required },
7087 .{ .kind = .id_result, .quantifier = .required },
7088 .{ .kind = .id_ref, .quantifier = .required },
7089 .{ .kind = .id_ref, .quantifier = .required },
7090 .{ .kind = .id_ref, .quantifier = .required },
7091 .{ .kind = .image_operands, .quantifier = .optional },
7092 },
7093 },
7094 .{
7095 .name = "OpImageRead",
7096 .opcode = 98,
7097 .operands = &.{
7098 .{ .kind = .id_result_type, .quantifier = .required },
7099 .{ .kind = .id_result, .quantifier = .required },
7100 .{ .kind = .id_ref, .quantifier = .required },
7101 .{ .kind = .id_ref, .quantifier = .required },
7102 .{ .kind = .image_operands, .quantifier = .optional },
7103 },
7104 },
7105 .{
7106 .name = "OpImageWrite",
7107 .opcode = 99,
7108 .operands = &.{
7109 .{ .kind = .id_ref, .quantifier = .required },
7110 .{ .kind = .id_ref, .quantifier = .required },
7111 .{ .kind = .id_ref, .quantifier = .required },
7112 .{ .kind = .image_operands, .quantifier = .optional },
7113 },
7114 },
7115 .{
7116 .name = "OpImage",
7117 .opcode = 100,
7118 .operands = &.{
7119 .{ .kind = .id_result_type, .quantifier = .required },
7120 .{ .kind = .id_result, .quantifier = .required },
7121 .{ .kind = .id_ref, .quantifier = .required },
7122 },
7123 },
7124 .{
7125 .name = "OpImageQueryFormat",
7126 .opcode = 101,
7127 .operands = &.{
7128 .{ .kind = .id_result_type, .quantifier = .required },
7129 .{ .kind = .id_result, .quantifier = .required },
7130 .{ .kind = .id_ref, .quantifier = .required },
7131 },
7132 },
7133 .{
7134 .name = "OpImageQueryOrder",
7135 .opcode = 102,
7136 .operands = &.{
7137 .{ .kind = .id_result_type, .quantifier = .required },
7138 .{ .kind = .id_result, .quantifier = .required },
7139 .{ .kind = .id_ref, .quantifier = .required },
7140 },
7141 },
7142 .{
7143 .name = "OpImageQuerySizeLod",
7144 .opcode = 103,
7145 .operands = &.{
7146 .{ .kind = .id_result_type, .quantifier = .required },
7147 .{ .kind = .id_result, .quantifier = .required },
7148 .{ .kind = .id_ref, .quantifier = .required },
7149 .{ .kind = .id_ref, .quantifier = .required },
7150 },
7151 },
7152 .{
7153 .name = "OpImageQuerySize",
7154 .opcode = 104,
7155 .operands = &.{
7156 .{ .kind = .id_result_type, .quantifier = .required },
7157 .{ .kind = .id_result, .quantifier = .required },
7158 .{ .kind = .id_ref, .quantifier = .required },
7159 },
7160 },
7161 .{
7162 .name = "OpImageQueryLod",
7163 .opcode = 105,
7164 .operands = &.{
7165 .{ .kind = .id_result_type, .quantifier = .required },
7166 .{ .kind = .id_result, .quantifier = .required },
7167 .{ .kind = .id_ref, .quantifier = .required },
7168 .{ .kind = .id_ref, .quantifier = .required },
7169 },
7170 },
7171 .{
7172 .name = "OpImageQueryLevels",
7173 .opcode = 106,
7174 .operands = &.{
7175 .{ .kind = .id_result_type, .quantifier = .required },
7176 .{ .kind = .id_result, .quantifier = .required },
7177 .{ .kind = .id_ref, .quantifier = .required },
7178 },
7179 },
7180 .{
7181 .name = "OpImageQuerySamples",
7182 .opcode = 107,
7183 .operands = &.{
7184 .{ .kind = .id_result_type, .quantifier = .required },
7185 .{ .kind = .id_result, .quantifier = .required },
7186 .{ .kind = .id_ref, .quantifier = .required },
7187 },
7188 },
7189 .{
7190 .name = "OpConvertFToU",
7191 .opcode = 109,
7192 .operands = &.{
7193 .{ .kind = .id_result_type, .quantifier = .required },
7194 .{ .kind = .id_result, .quantifier = .required },
7195 .{ .kind = .id_ref, .quantifier = .required },
7196 },
7197 },
7198 .{
7199 .name = "OpConvertFToS",
7200 .opcode = 110,
7201 .operands = &.{
7202 .{ .kind = .id_result_type, .quantifier = .required },
7203 .{ .kind = .id_result, .quantifier = .required },
7204 .{ .kind = .id_ref, .quantifier = .required },
7205 },
7206 },
7207 .{
7208 .name = "OpConvertSToF",
7209 .opcode = 111,
7210 .operands = &.{
7211 .{ .kind = .id_result_type, .quantifier = .required },
7212 .{ .kind = .id_result, .quantifier = .required },
7213 .{ .kind = .id_ref, .quantifier = .required },
7214 },
7215 },
7216 .{
7217 .name = "OpConvertUToF",
7218 .opcode = 112,
7219 .operands = &.{
7220 .{ .kind = .id_result_type, .quantifier = .required },
7221 .{ .kind = .id_result, .quantifier = .required },
7222 .{ .kind = .id_ref, .quantifier = .required },
7223 },
7224 },
7225 .{
7226 .name = "OpUConvert",
7227 .opcode = 113,
7228 .operands = &.{
7229 .{ .kind = .id_result_type, .quantifier = .required },
7230 .{ .kind = .id_result, .quantifier = .required },
7231 .{ .kind = .id_ref, .quantifier = .required },
7232 },
7233 },
7234 .{
7235 .name = "OpSConvert",
7236 .opcode = 114,
7237 .operands = &.{
7238 .{ .kind = .id_result_type, .quantifier = .required },
7239 .{ .kind = .id_result, .quantifier = .required },
7240 .{ .kind = .id_ref, .quantifier = .required },
7241 },
7242 },
7243 .{
7244 .name = "OpFConvert",
7245 .opcode = 115,
7246 .operands = &.{
7247 .{ .kind = .id_result_type, .quantifier = .required },
7248 .{ .kind = .id_result, .quantifier = .required },
7249 .{ .kind = .id_ref, .quantifier = .required },
7250 },
7251 },
7252 .{
7253 .name = "OpQuantizeToF16",
7254 .opcode = 116,
7255 .operands = &.{
7256 .{ .kind = .id_result_type, .quantifier = .required },
7257 .{ .kind = .id_result, .quantifier = .required },
7258 .{ .kind = .id_ref, .quantifier = .required },
7259 },
7260 },
7261 .{
7262 .name = "OpConvertPtrToU",
7263 .opcode = 117,
7264 .operands = &.{
7265 .{ .kind = .id_result_type, .quantifier = .required },
7266 .{ .kind = .id_result, .quantifier = .required },
7267 .{ .kind = .id_ref, .quantifier = .required },
7268 },
7269 },
7270 .{
7271 .name = "OpSatConvertSToU",
7272 .opcode = 118,
7273 .operands = &.{
7274 .{ .kind = .id_result_type, .quantifier = .required },
7275 .{ .kind = .id_result, .quantifier = .required },
7276 .{ .kind = .id_ref, .quantifier = .required },
7277 },
7278 },
7279 .{
7280 .name = "OpSatConvertUToS",
7281 .opcode = 119,
7282 .operands = &.{
7283 .{ .kind = .id_result_type, .quantifier = .required },
7284 .{ .kind = .id_result, .quantifier = .required },
7285 .{ .kind = .id_ref, .quantifier = .required },
7286 },
7287 },
7288 .{
7289 .name = "OpConvertUToPtr",
7290 .opcode = 120,
7291 .operands = &.{
7292 .{ .kind = .id_result_type, .quantifier = .required },
7293 .{ .kind = .id_result, .quantifier = .required },
7294 .{ .kind = .id_ref, .quantifier = .required },
7295 },
7296 },
7297 .{
7298 .name = "OpPtrCastToGeneric",
7299 .opcode = 121,
7300 .operands = &.{
7301 .{ .kind = .id_result_type, .quantifier = .required },
7302 .{ .kind = .id_result, .quantifier = .required },
7303 .{ .kind = .id_ref, .quantifier = .required },
7304 },
7305 },
7306 .{
7307 .name = "OpGenericCastToPtr",
7308 .opcode = 122,
7309 .operands = &.{
7310 .{ .kind = .id_result_type, .quantifier = .required },
7311 .{ .kind = .id_result, .quantifier = .required },
7312 .{ .kind = .id_ref, .quantifier = .required },
7313 },
7314 },
7315 .{
7316 .name = "OpGenericCastToPtrExplicit",
7317 .opcode = 123,
7318 .operands = &.{
7319 .{ .kind = .id_result_type, .quantifier = .required },
7320 .{ .kind = .id_result, .quantifier = .required },
7321 .{ .kind = .id_ref, .quantifier = .required },
7322 .{ .kind = .storage_class, .quantifier = .required },
7323 },
7324 },
7325 .{
7326 .name = "OpBitcast",
7327 .opcode = 124,
7328 .operands = &.{
7329 .{ .kind = .id_result_type, .quantifier = .required },
7330 .{ .kind = .id_result, .quantifier = .required },
7331 .{ .kind = .id_ref, .quantifier = .required },
7332 },
7333 },
7334 .{
7335 .name = "OpSNegate",
7336 .opcode = 126,
7337 .operands = &.{
7338 .{ .kind = .id_result_type, .quantifier = .required },
7339 .{ .kind = .id_result, .quantifier = .required },
7340 .{ .kind = .id_ref, .quantifier = .required },
7341 },
7342 },
7343 .{
7344 .name = "OpFNegate",
7345 .opcode = 127,
7346 .operands = &.{
7347 .{ .kind = .id_result_type, .quantifier = .required },
7348 .{ .kind = .id_result, .quantifier = .required },
7349 .{ .kind = .id_ref, .quantifier = .required },
7350 },
7351 },
7352 .{
7353 .name = "OpIAdd",
7354 .opcode = 128,
7355 .operands = &.{
7356 .{ .kind = .id_result_type, .quantifier = .required },
7357 .{ .kind = .id_result, .quantifier = .required },
7358 .{ .kind = .id_ref, .quantifier = .required },
7359 .{ .kind = .id_ref, .quantifier = .required },
7360 },
7361 },
7362 .{
7363 .name = "OpFAdd",
7364 .opcode = 129,
7365 .operands = &.{
7366 .{ .kind = .id_result_type, .quantifier = .required },
7367 .{ .kind = .id_result, .quantifier = .required },
7368 .{ .kind = .id_ref, .quantifier = .required },
7369 .{ .kind = .id_ref, .quantifier = .required },
7370 },
7371 },
7372 .{
7373 .name = "OpISub",
7374 .opcode = 130,
7375 .operands = &.{
7376 .{ .kind = .id_result_type, .quantifier = .required },
7377 .{ .kind = .id_result, .quantifier = .required },
7378 .{ .kind = .id_ref, .quantifier = .required },
7379 .{ .kind = .id_ref, .quantifier = .required },
7380 },
7381 },
7382 .{
7383 .name = "OpFSub",
7384 .opcode = 131,
7385 .operands = &.{
7386 .{ .kind = .id_result_type, .quantifier = .required },
7387 .{ .kind = .id_result, .quantifier = .required },
7388 .{ .kind = .id_ref, .quantifier = .required },
7389 .{ .kind = .id_ref, .quantifier = .required },
7390 },
7391 },
7392 .{
7393 .name = "OpIMul",
7394 .opcode = 132,
7395 .operands = &.{
7396 .{ .kind = .id_result_type, .quantifier = .required },
7397 .{ .kind = .id_result, .quantifier = .required },
7398 .{ .kind = .id_ref, .quantifier = .required },
7399 .{ .kind = .id_ref, .quantifier = .required },
7400 },
7401 },
7402 .{
7403 .name = "OpFMul",
7404 .opcode = 133,
7405 .operands = &.{
7406 .{ .kind = .id_result_type, .quantifier = .required },
7407 .{ .kind = .id_result, .quantifier = .required },
7408 .{ .kind = .id_ref, .quantifier = .required },
7409 .{ .kind = .id_ref, .quantifier = .required },
7410 },
7411 },
7412 .{
7413 .name = "OpUDiv",
7414 .opcode = 134,
7415 .operands = &.{
7416 .{ .kind = .id_result_type, .quantifier = .required },
7417 .{ .kind = .id_result, .quantifier = .required },
7418 .{ .kind = .id_ref, .quantifier = .required },
7419 .{ .kind = .id_ref, .quantifier = .required },
7420 },
7421 },
7422 .{
7423 .name = "OpSDiv",
7424 .opcode = 135,
7425 .operands = &.{
7426 .{ .kind = .id_result_type, .quantifier = .required },
7427 .{ .kind = .id_result, .quantifier = .required },
7428 .{ .kind = .id_ref, .quantifier = .required },
7429 .{ .kind = .id_ref, .quantifier = .required },
7430 },
7431 },
7432 .{
7433 .name = "OpFDiv",
7434 .opcode = 136,
7435 .operands = &.{
7436 .{ .kind = .id_result_type, .quantifier = .required },
7437 .{ .kind = .id_result, .quantifier = .required },
7438 .{ .kind = .id_ref, .quantifier = .required },
7439 .{ .kind = .id_ref, .quantifier = .required },
7440 },
7441 },
7442 .{
7443 .name = "OpUMod",
7444 .opcode = 137,
7445 .operands = &.{
7446 .{ .kind = .id_result_type, .quantifier = .required },
7447 .{ .kind = .id_result, .quantifier = .required },
7448 .{ .kind = .id_ref, .quantifier = .required },
7449 .{ .kind = .id_ref, .quantifier = .required },
7450 },
7451 },
7452 .{
7453 .name = "OpSRem",
7454 .opcode = 138,
7455 .operands = &.{
7456 .{ .kind = .id_result_type, .quantifier = .required },
7457 .{ .kind = .id_result, .quantifier = .required },
7458 .{ .kind = .id_ref, .quantifier = .required },
7459 .{ .kind = .id_ref, .quantifier = .required },
7460 },
7461 },
7462 .{
7463 .name = "OpSMod",
7464 .opcode = 139,
7465 .operands = &.{
7466 .{ .kind = .id_result_type, .quantifier = .required },
7467 .{ .kind = .id_result, .quantifier = .required },
7468 .{ .kind = .id_ref, .quantifier = .required },
7469 .{ .kind = .id_ref, .quantifier = .required },
7470 },
7471 },
7472 .{
7473 .name = "OpFRem",
7474 .opcode = 140,
7475 .operands = &.{
7476 .{ .kind = .id_result_type, .quantifier = .required },
7477 .{ .kind = .id_result, .quantifier = .required },
7478 .{ .kind = .id_ref, .quantifier = .required },
7479 .{ .kind = .id_ref, .quantifier = .required },
7480 },
7481 },
7482 .{
7483 .name = "OpFMod",
7484 .opcode = 141,
7485 .operands = &.{
7486 .{ .kind = .id_result_type, .quantifier = .required },
7487 .{ .kind = .id_result, .quantifier = .required },
7488 .{ .kind = .id_ref, .quantifier = .required },
7489 .{ .kind = .id_ref, .quantifier = .required },
7490 },
7491 },
7492 .{
7493 .name = "OpVectorTimesScalar",
7494 .opcode = 142,
7495 .operands = &.{
7496 .{ .kind = .id_result_type, .quantifier = .required },
7497 .{ .kind = .id_result, .quantifier = .required },
7498 .{ .kind = .id_ref, .quantifier = .required },
7499 .{ .kind = .id_ref, .quantifier = .required },
7500 },
7501 },
7502 .{
7503 .name = "OpMatrixTimesScalar",
7504 .opcode = 143,
7505 .operands = &.{
7506 .{ .kind = .id_result_type, .quantifier = .required },
7507 .{ .kind = .id_result, .quantifier = .required },
7508 .{ .kind = .id_ref, .quantifier = .required },
7509 .{ .kind = .id_ref, .quantifier = .required },
7510 },
7511 },
7512 .{
7513 .name = "OpVectorTimesMatrix",
7514 .opcode = 144,
7515 .operands = &.{
7516 .{ .kind = .id_result_type, .quantifier = .required },
7517 .{ .kind = .id_result, .quantifier = .required },
7518 .{ .kind = .id_ref, .quantifier = .required },
7519 .{ .kind = .id_ref, .quantifier = .required },
7520 },
7521 },
7522 .{
7523 .name = "OpMatrixTimesVector",
7524 .opcode = 145,
7525 .operands = &.{
7526 .{ .kind = .id_result_type, .quantifier = .required },
7527 .{ .kind = .id_result, .quantifier = .required },
7528 .{ .kind = .id_ref, .quantifier = .required },
7529 .{ .kind = .id_ref, .quantifier = .required },
7530 },
7531 },
7532 .{
7533 .name = "OpMatrixTimesMatrix",
7534 .opcode = 146,
7535 .operands = &.{
7536 .{ .kind = .id_result_type, .quantifier = .required },
7537 .{ .kind = .id_result, .quantifier = .required },
7538 .{ .kind = .id_ref, .quantifier = .required },
7539 .{ .kind = .id_ref, .quantifier = .required },
7540 },
7541 },
7542 .{
7543 .name = "OpOuterProduct",
7544 .opcode = 147,
7545 .operands = &.{
7546 .{ .kind = .id_result_type, .quantifier = .required },
7547 .{ .kind = .id_result, .quantifier = .required },
7548 .{ .kind = .id_ref, .quantifier = .required },
7549 .{ .kind = .id_ref, .quantifier = .required },
7550 },
7551 },
7552 .{
7553 .name = "OpDot",
7554 .opcode = 148,
7555 .operands = &.{
7556 .{ .kind = .id_result_type, .quantifier = .required },
7557 .{ .kind = .id_result, .quantifier = .required },
7558 .{ .kind = .id_ref, .quantifier = .required },
7559 .{ .kind = .id_ref, .quantifier = .required },
7560 },
7561 },
7562 .{
7563 .name = "OpIAddCarry",
7564 .opcode = 149,
7565 .operands = &.{
7566 .{ .kind = .id_result_type, .quantifier = .required },
7567 .{ .kind = .id_result, .quantifier = .required },
7568 .{ .kind = .id_ref, .quantifier = .required },
7569 .{ .kind = .id_ref, .quantifier = .required },
7570 },
7571 },
7572 .{
7573 .name = "OpISubBorrow",
7574 .opcode = 150,
7575 .operands = &.{
7576 .{ .kind = .id_result_type, .quantifier = .required },
7577 .{ .kind = .id_result, .quantifier = .required },
7578 .{ .kind = .id_ref, .quantifier = .required },
7579 .{ .kind = .id_ref, .quantifier = .required },
7580 },
7581 },
7582 .{
7583 .name = "OpUMulExtended",
7584 .opcode = 151,
7585 .operands = &.{
7586 .{ .kind = .id_result_type, .quantifier = .required },
7587 .{ .kind = .id_result, .quantifier = .required },
7588 .{ .kind = .id_ref, .quantifier = .required },
7589 .{ .kind = .id_ref, .quantifier = .required },
7590 },
7591 },
7592 .{
7593 .name = "OpSMulExtended",
7594 .opcode = 152,
7595 .operands = &.{
7596 .{ .kind = .id_result_type, .quantifier = .required },
7597 .{ .kind = .id_result, .quantifier = .required },
7598 .{ .kind = .id_ref, .quantifier = .required },
7599 .{ .kind = .id_ref, .quantifier = .required },
7600 },
7601 },
7602 .{
7603 .name = "OpAny",
7604 .opcode = 154,
7605 .operands = &.{
7606 .{ .kind = .id_result_type, .quantifier = .required },
7607 .{ .kind = .id_result, .quantifier = .required },
7608 .{ .kind = .id_ref, .quantifier = .required },
7609 },
7610 },
7611 .{
7612 .name = "OpAll",
7613 .opcode = 155,
7614 .operands = &.{
7615 .{ .kind = .id_result_type, .quantifier = .required },
7616 .{ .kind = .id_result, .quantifier = .required },
7617 .{ .kind = .id_ref, .quantifier = .required },
7618 },
7619 },
7620 .{
7621 .name = "OpIsNan",
7622 .opcode = 156,
7623 .operands = &.{
7624 .{ .kind = .id_result_type, .quantifier = .required },
7625 .{ .kind = .id_result, .quantifier = .required },
7626 .{ .kind = .id_ref, .quantifier = .required },
7627 },
7628 },
7629 .{
7630 .name = "OpIsInf",
7631 .opcode = 157,
7632 .operands = &.{
7633 .{ .kind = .id_result_type, .quantifier = .required },
7634 .{ .kind = .id_result, .quantifier = .required },
7635 .{ .kind = .id_ref, .quantifier = .required },
7636 },
7637 },
7638 .{
7639 .name = "OpIsFinite",
7640 .opcode = 158,
7641 .operands = &.{
7642 .{ .kind = .id_result_type, .quantifier = .required },
7643 .{ .kind = .id_result, .quantifier = .required },
7644 .{ .kind = .id_ref, .quantifier = .required },
7645 },
7646 },
7647 .{
7648 .name = "OpIsNormal",
7649 .opcode = 159,
7650 .operands = &.{
7651 .{ .kind = .id_result_type, .quantifier = .required },
7652 .{ .kind = .id_result, .quantifier = .required },
7653 .{ .kind = .id_ref, .quantifier = .required },
7654 },
7655 },
7656 .{
7657 .name = "OpSignBitSet",
7658 .opcode = 160,
7659 .operands = &.{
7660 .{ .kind = .id_result_type, .quantifier = .required },
7661 .{ .kind = .id_result, .quantifier = .required },
7662 .{ .kind = .id_ref, .quantifier = .required },
7663 },
7664 },
7665 .{
7666 .name = "OpLessOrGreater",
7667 .opcode = 161,
7668 .operands = &.{
7669 .{ .kind = .id_result_type, .quantifier = .required },
7670 .{ .kind = .id_result, .quantifier = .required },
7671 .{ .kind = .id_ref, .quantifier = .required },
7672 .{ .kind = .id_ref, .quantifier = .required },
7673 },
7674 },
7675 .{
7676 .name = "OpOrdered",
7677 .opcode = 162,
7678 .operands = &.{
7679 .{ .kind = .id_result_type, .quantifier = .required },
7680 .{ .kind = .id_result, .quantifier = .required },
7681 .{ .kind = .id_ref, .quantifier = .required },
7682 .{ .kind = .id_ref, .quantifier = .required },
7683 },
7684 },
7685 .{
7686 .name = "OpUnordered",
7687 .opcode = 163,
7688 .operands = &.{
7689 .{ .kind = .id_result_type, .quantifier = .required },
7690 .{ .kind = .id_result, .quantifier = .required },
7691 .{ .kind = .id_ref, .quantifier = .required },
7692 .{ .kind = .id_ref, .quantifier = .required },
7693 },
7694 },
7695 .{
7696 .name = "OpLogicalEqual",
7697 .opcode = 164,
7698 .operands = &.{
7699 .{ .kind = .id_result_type, .quantifier = .required },
7700 .{ .kind = .id_result, .quantifier = .required },
7701 .{ .kind = .id_ref, .quantifier = .required },
7702 .{ .kind = .id_ref, .quantifier = .required },
7703 },
7704 },
7705 .{
7706 .name = "OpLogicalNotEqual",
7707 .opcode = 165,
7708 .operands = &.{
7709 .{ .kind = .id_result_type, .quantifier = .required },
7710 .{ .kind = .id_result, .quantifier = .required },
7711 .{ .kind = .id_ref, .quantifier = .required },
7712 .{ .kind = .id_ref, .quantifier = .required },
7713 },
7714 },
7715 .{
7716 .name = "OpLogicalOr",
7717 .opcode = 166,
7718 .operands = &.{
7719 .{ .kind = .id_result_type, .quantifier = .required },
7720 .{ .kind = .id_result, .quantifier = .required },
7721 .{ .kind = .id_ref, .quantifier = .required },
7722 .{ .kind = .id_ref, .quantifier = .required },
7723 },
7724 },
7725 .{
7726 .name = "OpLogicalAnd",
7727 .opcode = 167,
7728 .operands = &.{
7729 .{ .kind = .id_result_type, .quantifier = .required },
7730 .{ .kind = .id_result, .quantifier = .required },
7731 .{ .kind = .id_ref, .quantifier = .required },
7732 .{ .kind = .id_ref, .quantifier = .required },
7733 },
7734 },
7735 .{
7736 .name = "OpLogicalNot",
7737 .opcode = 168,
7738 .operands = &.{
7739 .{ .kind = .id_result_type, .quantifier = .required },
7740 .{ .kind = .id_result, .quantifier = .required },
7741 .{ .kind = .id_ref, .quantifier = .required },
7742 },
7743 },
7744 .{
7745 .name = "OpSelect",
7746 .opcode = 169,
7747 .operands = &.{
7748 .{ .kind = .id_result_type, .quantifier = .required },
7749 .{ .kind = .id_result, .quantifier = .required },
7750 .{ .kind = .id_ref, .quantifier = .required },
7751 .{ .kind = .id_ref, .quantifier = .required },
7752 .{ .kind = .id_ref, .quantifier = .required },
7753 },
7754 },
7755 .{
7756 .name = "OpIEqual",
7757 .opcode = 170,
7758 .operands = &.{
7759 .{ .kind = .id_result_type, .quantifier = .required },
7760 .{ .kind = .id_result, .quantifier = .required },
7761 .{ .kind = .id_ref, .quantifier = .required },
7762 .{ .kind = .id_ref, .quantifier = .required },
7763 },
7764 },
7765 .{
7766 .name = "OpINotEqual",
7767 .opcode = 171,
7768 .operands = &.{
7769 .{ .kind = .id_result_type, .quantifier = .required },
7770 .{ .kind = .id_result, .quantifier = .required },
7771 .{ .kind = .id_ref, .quantifier = .required },
7772 .{ .kind = .id_ref, .quantifier = .required },
7773 },
7774 },
7775 .{
7776 .name = "OpUGreaterThan",
7777 .opcode = 172,
7778 .operands = &.{
7779 .{ .kind = .id_result_type, .quantifier = .required },
7780 .{ .kind = .id_result, .quantifier = .required },
7781 .{ .kind = .id_ref, .quantifier = .required },
7782 .{ .kind = .id_ref, .quantifier = .required },
7783 },
7784 },
7785 .{
7786 .name = "OpSGreaterThan",
7787 .opcode = 173,
7788 .operands = &.{
7789 .{ .kind = .id_result_type, .quantifier = .required },
7790 .{ .kind = .id_result, .quantifier = .required },
7791 .{ .kind = .id_ref, .quantifier = .required },
7792 .{ .kind = .id_ref, .quantifier = .required },
7793 },
7794 },
7795 .{
7796 .name = "OpUGreaterThanEqual",
7797 .opcode = 174,
7798 .operands = &.{
7799 .{ .kind = .id_result_type, .quantifier = .required },
7800 .{ .kind = .id_result, .quantifier = .required },
7801 .{ .kind = .id_ref, .quantifier = .required },
7802 .{ .kind = .id_ref, .quantifier = .required },
7803 },
7804 },
7805 .{
7806 .name = "OpSGreaterThanEqual",
7807 .opcode = 175,
7808 .operands = &.{
7809 .{ .kind = .id_result_type, .quantifier = .required },
7810 .{ .kind = .id_result, .quantifier = .required },
7811 .{ .kind = .id_ref, .quantifier = .required },
7812 .{ .kind = .id_ref, .quantifier = .required },
7813 },
7814 },
7815 .{
7816 .name = "OpULessThan",
7817 .opcode = 176,
7818 .operands = &.{
7819 .{ .kind = .id_result_type, .quantifier = .required },
7820 .{ .kind = .id_result, .quantifier = .required },
7821 .{ .kind = .id_ref, .quantifier = .required },
7822 .{ .kind = .id_ref, .quantifier = .required },
7823 },
7824 },
7825 .{
7826 .name = "OpSLessThan",
7827 .opcode = 177,
7828 .operands = &.{
7829 .{ .kind = .id_result_type, .quantifier = .required },
7830 .{ .kind = .id_result, .quantifier = .required },
7831 .{ .kind = .id_ref, .quantifier = .required },
7832 .{ .kind = .id_ref, .quantifier = .required },
7833 },
7834 },
7835 .{
7836 .name = "OpULessThanEqual",
7837 .opcode = 178,
7838 .operands = &.{
7839 .{ .kind = .id_result_type, .quantifier = .required },
7840 .{ .kind = .id_result, .quantifier = .required },
7841 .{ .kind = .id_ref, .quantifier = .required },
7842 .{ .kind = .id_ref, .quantifier = .required },
7843 },
7844 },
7845 .{
7846 .name = "OpSLessThanEqual",
7847 .opcode = 179,
7848 .operands = &.{
7849 .{ .kind = .id_result_type, .quantifier = .required },
7850 .{ .kind = .id_result, .quantifier = .required },
7851 .{ .kind = .id_ref, .quantifier = .required },
7852 .{ .kind = .id_ref, .quantifier = .required },
7853 },
7854 },
7855 .{
7856 .name = "OpFOrdEqual",
7857 .opcode = 180,
7858 .operands = &.{
7859 .{ .kind = .id_result_type, .quantifier = .required },
7860 .{ .kind = .id_result, .quantifier = .required },
7861 .{ .kind = .id_ref, .quantifier = .required },
7862 .{ .kind = .id_ref, .quantifier = .required },
7863 },
7864 },
7865 .{
7866 .name = "OpFUnordEqual",
7867 .opcode = 181,
7868 .operands = &.{
7869 .{ .kind = .id_result_type, .quantifier = .required },
7870 .{ .kind = .id_result, .quantifier = .required },
7871 .{ .kind = .id_ref, .quantifier = .required },
7872 .{ .kind = .id_ref, .quantifier = .required },
7873 },
7874 },
7875 .{
7876 .name = "OpFOrdNotEqual",
7877 .opcode = 182,
7878 .operands = &.{
7879 .{ .kind = .id_result_type, .quantifier = .required },
7880 .{ .kind = .id_result, .quantifier = .required },
7881 .{ .kind = .id_ref, .quantifier = .required },
7882 .{ .kind = .id_ref, .quantifier = .required },
7883 },
7884 },
7885 .{
7886 .name = "OpFUnordNotEqual",
7887 .opcode = 183,
7888 .operands = &.{
7889 .{ .kind = .id_result_type, .quantifier = .required },
7890 .{ .kind = .id_result, .quantifier = .required },
7891 .{ .kind = .id_ref, .quantifier = .required },
7892 .{ .kind = .id_ref, .quantifier = .required },
7893 },
7894 },
7895 .{
7896 .name = "OpFOrdLessThan",
7897 .opcode = 184,
7898 .operands = &.{
7899 .{ .kind = .id_result_type, .quantifier = .required },
7900 .{ .kind = .id_result, .quantifier = .required },
7901 .{ .kind = .id_ref, .quantifier = .required },
7902 .{ .kind = .id_ref, .quantifier = .required },
7903 },
7904 },
7905 .{
7906 .name = "OpFUnordLessThan",
7907 .opcode = 185,
7908 .operands = &.{
7909 .{ .kind = .id_result_type, .quantifier = .required },
7910 .{ .kind = .id_result, .quantifier = .required },
7911 .{ .kind = .id_ref, .quantifier = .required },
7912 .{ .kind = .id_ref, .quantifier = .required },
7913 },
7914 },
7915 .{
7916 .name = "OpFOrdGreaterThan",
7917 .opcode = 186,
7918 .operands = &.{
7919 .{ .kind = .id_result_type, .quantifier = .required },
7920 .{ .kind = .id_result, .quantifier = .required },
7921 .{ .kind = .id_ref, .quantifier = .required },
7922 .{ .kind = .id_ref, .quantifier = .required },
7923 },
7924 },
7925 .{
7926 .name = "OpFUnordGreaterThan",
7927 .opcode = 187,
7928 .operands = &.{
7929 .{ .kind = .id_result_type, .quantifier = .required },
7930 .{ .kind = .id_result, .quantifier = .required },
7931 .{ .kind = .id_ref, .quantifier = .required },
7932 .{ .kind = .id_ref, .quantifier = .required },
7933 },
7934 },
7935 .{
7936 .name = "OpFOrdLessThanEqual",
7937 .opcode = 188,
7938 .operands = &.{
7939 .{ .kind = .id_result_type, .quantifier = .required },
7940 .{ .kind = .id_result, .quantifier = .required },
7941 .{ .kind = .id_ref, .quantifier = .required },
7942 .{ .kind = .id_ref, .quantifier = .required },
7943 },
7944 },
7945 .{
7946 .name = "OpFUnordLessThanEqual",
7947 .opcode = 189,
7948 .operands = &.{
7949 .{ .kind = .id_result_type, .quantifier = .required },
7950 .{ .kind = .id_result, .quantifier = .required },
7951 .{ .kind = .id_ref, .quantifier = .required },
7952 .{ .kind = .id_ref, .quantifier = .required },
7953 },
7954 },
7955 .{
7956 .name = "OpFOrdGreaterThanEqual",
7957 .opcode = 190,
7958 .operands = &.{
7959 .{ .kind = .id_result_type, .quantifier = .required },
7960 .{ .kind = .id_result, .quantifier = .required },
7961 .{ .kind = .id_ref, .quantifier = .required },
7962 .{ .kind = .id_ref, .quantifier = .required },
7963 },
7964 },
7965 .{
7966 .name = "OpFUnordGreaterThanEqual",
7967 .opcode = 191,
7968 .operands = &.{
7969 .{ .kind = .id_result_type, .quantifier = .required },
7970 .{ .kind = .id_result, .quantifier = .required },
7971 .{ .kind = .id_ref, .quantifier = .required },
7972 .{ .kind = .id_ref, .quantifier = .required },
7973 },
7974 },
7975 .{
7976 .name = "OpShiftRightLogical",
7977 .opcode = 194,
7978 .operands = &.{
7979 .{ .kind = .id_result_type, .quantifier = .required },
7980 .{ .kind = .id_result, .quantifier = .required },
7981 .{ .kind = .id_ref, .quantifier = .required },
7982 .{ .kind = .id_ref, .quantifier = .required },
7983 },
7984 },
7985 .{
7986 .name = "OpShiftRightArithmetic",
7987 .opcode = 195,
7988 .operands = &.{
7989 .{ .kind = .id_result_type, .quantifier = .required },
7990 .{ .kind = .id_result, .quantifier = .required },
7991 .{ .kind = .id_ref, .quantifier = .required },
7992 .{ .kind = .id_ref, .quantifier = .required },
7993 },
7994 },
7995 .{
7996 .name = "OpShiftLeftLogical",
7997 .opcode = 196,
7998 .operands = &.{
7999 .{ .kind = .id_result_type, .quantifier = .required },
8000 .{ .kind = .id_result, .quantifier = .required },
8001 .{ .kind = .id_ref, .quantifier = .required },
8002 .{ .kind = .id_ref, .quantifier = .required },
8003 },
8004 },
8005 .{
8006 .name = "OpBitwiseOr",
8007 .opcode = 197,
8008 .operands = &.{
8009 .{ .kind = .id_result_type, .quantifier = .required },
8010 .{ .kind = .id_result, .quantifier = .required },
8011 .{ .kind = .id_ref, .quantifier = .required },
8012 .{ .kind = .id_ref, .quantifier = .required },
8013 },
8014 },
8015 .{
8016 .name = "OpBitwiseXor",
8017 .opcode = 198,
8018 .operands = &.{
8019 .{ .kind = .id_result_type, .quantifier = .required },
8020 .{ .kind = .id_result, .quantifier = .required },
8021 .{ .kind = .id_ref, .quantifier = .required },
8022 .{ .kind = .id_ref, .quantifier = .required },
8023 },
8024 },
8025 .{
8026 .name = "OpBitwiseAnd",
8027 .opcode = 199,
8028 .operands = &.{
8029 .{ .kind = .id_result_type, .quantifier = .required },
8030 .{ .kind = .id_result, .quantifier = .required },
8031 .{ .kind = .id_ref, .quantifier = .required },
8032 .{ .kind = .id_ref, .quantifier = .required },
8033 },
8034 },
8035 .{
8036 .name = "OpNot",
8037 .opcode = 200,
8038 .operands = &.{
8039 .{ .kind = .id_result_type, .quantifier = .required },
8040 .{ .kind = .id_result, .quantifier = .required },
8041 .{ .kind = .id_ref, .quantifier = .required },
8042 },
8043 },
8044 .{
8045 .name = "OpBitFieldInsert",
8046 .opcode = 201,
8047 .operands = &.{
8048 .{ .kind = .id_result_type, .quantifier = .required },
8049 .{ .kind = .id_result, .quantifier = .required },
8050 .{ .kind = .id_ref, .quantifier = .required },
8051 .{ .kind = .id_ref, .quantifier = .required },
8052 .{ .kind = .id_ref, .quantifier = .required },
8053 .{ .kind = .id_ref, .quantifier = .required },
8054 },
8055 },
8056 .{
8057 .name = "OpBitFieldSExtract",
8058 .opcode = 202,
8059 .operands = &.{
8060 .{ .kind = .id_result_type, .quantifier = .required },
8061 .{ .kind = .id_result, .quantifier = .required },
8062 .{ .kind = .id_ref, .quantifier = .required },
8063 .{ .kind = .id_ref, .quantifier = .required },
8064 .{ .kind = .id_ref, .quantifier = .required },
8065 },
8066 },
8067 .{
8068 .name = "OpBitFieldUExtract",
8069 .opcode = 203,
8070 .operands = &.{
8071 .{ .kind = .id_result_type, .quantifier = .required },
8072 .{ .kind = .id_result, .quantifier = .required },
8073 .{ .kind = .id_ref, .quantifier = .required },
8074 .{ .kind = .id_ref, .quantifier = .required },
8075 .{ .kind = .id_ref, .quantifier = .required },
8076 },
8077 },
8078 .{
8079 .name = "OpBitReverse",
8080 .opcode = 204,
8081 .operands = &.{
8082 .{ .kind = .id_result_type, .quantifier = .required },
8083 .{ .kind = .id_result, .quantifier = .required },
8084 .{ .kind = .id_ref, .quantifier = .required },
8085 },
8086 },
8087 .{
8088 .name = "OpBitCount",
8089 .opcode = 205,
8090 .operands = &.{
8091 .{ .kind = .id_result_type, .quantifier = .required },
8092 .{ .kind = .id_result, .quantifier = .required },
8093 .{ .kind = .id_ref, .quantifier = .required },
8094 },
8095 },
8096 .{
8097 .name = "OpDPdx",
8098 .opcode = 207,
8099 .operands = &.{
8100 .{ .kind = .id_result_type, .quantifier = .required },
8101 .{ .kind = .id_result, .quantifier = .required },
8102 .{ .kind = .id_ref, .quantifier = .required },
8103 },
8104 },
8105 .{
8106 .name = "OpDPdy",
8107 .opcode = 208,
8108 .operands = &.{
8109 .{ .kind = .id_result_type, .quantifier = .required },
8110 .{ .kind = .id_result, .quantifier = .required },
8111 .{ .kind = .id_ref, .quantifier = .required },
8112 },
8113 },
8114 .{
8115 .name = "OpFwidth",
8116 .opcode = 209,
8117 .operands = &.{
8118 .{ .kind = .id_result_type, .quantifier = .required },
8119 .{ .kind = .id_result, .quantifier = .required },
8120 .{ .kind = .id_ref, .quantifier = .required },
8121 },
8122 },
8123 .{
8124 .name = "OpDPdxFine",
8125 .opcode = 210,
8126 .operands = &.{
8127 .{ .kind = .id_result_type, .quantifier = .required },
8128 .{ .kind = .id_result, .quantifier = .required },
8129 .{ .kind = .id_ref, .quantifier = .required },
8130 },
8131 },
8132 .{
8133 .name = "OpDPdyFine",
8134 .opcode = 211,
8135 .operands = &.{
8136 .{ .kind = .id_result_type, .quantifier = .required },
8137 .{ .kind = .id_result, .quantifier = .required },
8138 .{ .kind = .id_ref, .quantifier = .required },
8139 },
8140 },
8141 .{
8142 .name = "OpFwidthFine",
8143 .opcode = 212,
8144 .operands = &.{
8145 .{ .kind = .id_result_type, .quantifier = .required },
8146 .{ .kind = .id_result, .quantifier = .required },
8147 .{ .kind = .id_ref, .quantifier = .required },
8148 },
8149 },
8150 .{
8151 .name = "OpDPdxCoarse",
8152 .opcode = 213,
8153 .operands = &.{
8154 .{ .kind = .id_result_type, .quantifier = .required },
8155 .{ .kind = .id_result, .quantifier = .required },
8156 .{ .kind = .id_ref, .quantifier = .required },
8157 },
8158 },
8159 .{
8160 .name = "OpDPdyCoarse",
8161 .opcode = 214,
8162 .operands = &.{
8163 .{ .kind = .id_result_type, .quantifier = .required },
8164 .{ .kind = .id_result, .quantifier = .required },
8165 .{ .kind = .id_ref, .quantifier = .required },
8166 },
8167 },
8168 .{
8169 .name = "OpFwidthCoarse",
8170 .opcode = 215,
8171 .operands = &.{
8172 .{ .kind = .id_result_type, .quantifier = .required },
8173 .{ .kind = .id_result, .quantifier = .required },
8174 .{ .kind = .id_ref, .quantifier = .required },
8175 },
8176 },
8177 .{
8178 .name = "OpEmitVertex",
8179 .opcode = 218,
8180 .operands = &.{},
8181 },
8182 .{
8183 .name = "OpEndPrimitive",
8184 .opcode = 219,
8185 .operands = &.{},
8186 },
8187 .{
8188 .name = "OpEmitStreamVertex",
8189 .opcode = 220,
8190 .operands = &.{
8191 .{ .kind = .id_ref, .quantifier = .required },
8192 },
8193 },
8194 .{
8195 .name = "OpEndStreamPrimitive",
8196 .opcode = 221,
8197 .operands = &.{
8198 .{ .kind = .id_ref, .quantifier = .required },
8199 },
8200 },
8201 .{
8202 .name = "OpControlBarrier",
8203 .opcode = 224,
8204 .operands = &.{
8205 .{ .kind = .id_scope, .quantifier = .required },
8206 .{ .kind = .id_scope, .quantifier = .required },
8207 .{ .kind = .id_memory_semantics, .quantifier = .required },
8208 },
8209 },
8210 .{
8211 .name = "OpMemoryBarrier",
8212 .opcode = 225,
8213 .operands = &.{
8214 .{ .kind = .id_scope, .quantifier = .required },
8215 .{ .kind = .id_memory_semantics, .quantifier = .required },
8216 },
8217 },
8218 .{
8219 .name = "OpAtomicLoad",
8220 .opcode = 227,
8221 .operands = &.{
8222 .{ .kind = .id_result_type, .quantifier = .required },
8223 .{ .kind = .id_result, .quantifier = .required },
8224 .{ .kind = .id_ref, .quantifier = .required },
8225 .{ .kind = .id_scope, .quantifier = .required },
8226 .{ .kind = .id_memory_semantics, .quantifier = .required },
8227 },
8228 },
8229 .{
8230 .name = "OpAtomicStore",
8231 .opcode = 228,
8232 .operands = &.{
8233 .{ .kind = .id_ref, .quantifier = .required },
8234 .{ .kind = .id_scope, .quantifier = .required },
8235 .{ .kind = .id_memory_semantics, .quantifier = .required },
8236 .{ .kind = .id_ref, .quantifier = .required },
8237 },
8238 },
8239 .{
8240 .name = "OpAtomicExchange",
8241 .opcode = 229,
8242 .operands = &.{
8243 .{ .kind = .id_result_type, .quantifier = .required },
8244 .{ .kind = .id_result, .quantifier = .required },
8245 .{ .kind = .id_ref, .quantifier = .required },
8246 .{ .kind = .id_scope, .quantifier = .required },
8247 .{ .kind = .id_memory_semantics, .quantifier = .required },
8248 .{ .kind = .id_ref, .quantifier = .required },
8249 },
8250 },
8251 .{
8252 .name = "OpAtomicCompareExchange",
8253 .opcode = 230,
8254 .operands = &.{
8255 .{ .kind = .id_result_type, .quantifier = .required },
8256 .{ .kind = .id_result, .quantifier = .required },
8257 .{ .kind = .id_ref, .quantifier = .required },
8258 .{ .kind = .id_scope, .quantifier = .required },
8259 .{ .kind = .id_memory_semantics, .quantifier = .required },
8260 .{ .kind = .id_memory_semantics, .quantifier = .required },
8261 .{ .kind = .id_ref, .quantifier = .required },
8262 .{ .kind = .id_ref, .quantifier = .required },
8263 },
8264 },
8265 .{
8266 .name = "OpAtomicCompareExchangeWeak",
8267 .opcode = 231,
8268 .operands = &.{
8269 .{ .kind = .id_result_type, .quantifier = .required },
8270 .{ .kind = .id_result, .quantifier = .required },
8271 .{ .kind = .id_ref, .quantifier = .required },
8272 .{ .kind = .id_scope, .quantifier = .required },
8273 .{ .kind = .id_memory_semantics, .quantifier = .required },
8274 .{ .kind = .id_memory_semantics, .quantifier = .required },
8275 .{ .kind = .id_ref, .quantifier = .required },
8276 .{ .kind = .id_ref, .quantifier = .required },
8277 },
8278 },
8279 .{
8280 .name = "OpAtomicIIncrement",
8281 .opcode = 232,
8282 .operands = &.{
8283 .{ .kind = .id_result_type, .quantifier = .required },
8284 .{ .kind = .id_result, .quantifier = .required },
8285 .{ .kind = .id_ref, .quantifier = .required },
8286 .{ .kind = .id_scope, .quantifier = .required },
8287 .{ .kind = .id_memory_semantics, .quantifier = .required },
8288 },
8289 },
8290 .{
8291 .name = "OpAtomicIDecrement",
8292 .opcode = 233,
8293 .operands = &.{
8294 .{ .kind = .id_result_type, .quantifier = .required },
8295 .{ .kind = .id_result, .quantifier = .required },
8296 .{ .kind = .id_ref, .quantifier = .required },
8297 .{ .kind = .id_scope, .quantifier = .required },
8298 .{ .kind = .id_memory_semantics, .quantifier = .required },
8299 },
8300 },
8301 .{
8302 .name = "OpAtomicIAdd",
8303 .opcode = 234,
8304 .operands = &.{
8305 .{ .kind = .id_result_type, .quantifier = .required },
8306 .{ .kind = .id_result, .quantifier = .required },
8307 .{ .kind = .id_ref, .quantifier = .required },
8308 .{ .kind = .id_scope, .quantifier = .required },
8309 .{ .kind = .id_memory_semantics, .quantifier = .required },
8310 .{ .kind = .id_ref, .quantifier = .required },
8311 },
8312 },
8313 .{
8314 .name = "OpAtomicISub",
8315 .opcode = 235,
8316 .operands = &.{
8317 .{ .kind = .id_result_type, .quantifier = .required },
8318 .{ .kind = .id_result, .quantifier = .required },
8319 .{ .kind = .id_ref, .quantifier = .required },
8320 .{ .kind = .id_scope, .quantifier = .required },
8321 .{ .kind = .id_memory_semantics, .quantifier = .required },
8322 .{ .kind = .id_ref, .quantifier = .required },
8323 },
8324 },
8325 .{
8326 .name = "OpAtomicSMin",
8327 .opcode = 236,
8328 .operands = &.{
8329 .{ .kind = .id_result_type, .quantifier = .required },
8330 .{ .kind = .id_result, .quantifier = .required },
8331 .{ .kind = .id_ref, .quantifier = .required },
8332 .{ .kind = .id_scope, .quantifier = .required },
8333 .{ .kind = .id_memory_semantics, .quantifier = .required },
8334 .{ .kind = .id_ref, .quantifier = .required },
8335 },
8336 },
8337 .{
8338 .name = "OpAtomicUMin",
8339 .opcode = 237,
8340 .operands = &.{
8341 .{ .kind = .id_result_type, .quantifier = .required },
8342 .{ .kind = .id_result, .quantifier = .required },
8343 .{ .kind = .id_ref, .quantifier = .required },
8344 .{ .kind = .id_scope, .quantifier = .required },
8345 .{ .kind = .id_memory_semantics, .quantifier = .required },
8346 .{ .kind = .id_ref, .quantifier = .required },
8347 },
8348 },
8349 .{
8350 .name = "OpAtomicSMax",
8351 .opcode = 238,
8352 .operands = &.{
8353 .{ .kind = .id_result_type, .quantifier = .required },
8354 .{ .kind = .id_result, .quantifier = .required },
8355 .{ .kind = .id_ref, .quantifier = .required },
8356 .{ .kind = .id_scope, .quantifier = .required },
8357 .{ .kind = .id_memory_semantics, .quantifier = .required },
8358 .{ .kind = .id_ref, .quantifier = .required },
8359 },
8360 },
8361 .{
8362 .name = "OpAtomicUMax",
8363 .opcode = 239,
8364 .operands = &.{
8365 .{ .kind = .id_result_type, .quantifier = .required },
8366 .{ .kind = .id_result, .quantifier = .required },
8367 .{ .kind = .id_ref, .quantifier = .required },
8368 .{ .kind = .id_scope, .quantifier = .required },
8369 .{ .kind = .id_memory_semantics, .quantifier = .required },
8370 .{ .kind = .id_ref, .quantifier = .required },
8371 },
8372 },
8373 .{
8374 .name = "OpAtomicAnd",
8375 .opcode = 240,
8376 .operands = &.{
8377 .{ .kind = .id_result_type, .quantifier = .required },
8378 .{ .kind = .id_result, .quantifier = .required },
8379 .{ .kind = .id_ref, .quantifier = .required },
8380 .{ .kind = .id_scope, .quantifier = .required },
8381 .{ .kind = .id_memory_semantics, .quantifier = .required },
8382 .{ .kind = .id_ref, .quantifier = .required },
8383 },
8384 },
8385 .{
8386 .name = "OpAtomicOr",
8387 .opcode = 241,
8388 .operands = &.{
8389 .{ .kind = .id_result_type, .quantifier = .required },
8390 .{ .kind = .id_result, .quantifier = .required },
8391 .{ .kind = .id_ref, .quantifier = .required },
8392 .{ .kind = .id_scope, .quantifier = .required },
8393 .{ .kind = .id_memory_semantics, .quantifier = .required },
8394 .{ .kind = .id_ref, .quantifier = .required },
8395 },
8396 },
8397 .{
8398 .name = "OpAtomicXor",
8399 .opcode = 242,
8400 .operands = &.{
8401 .{ .kind = .id_result_type, .quantifier = .required },
8402 .{ .kind = .id_result, .quantifier = .required },
8403 .{ .kind = .id_ref, .quantifier = .required },
8404 .{ .kind = .id_scope, .quantifier = .required },
8405 .{ .kind = .id_memory_semantics, .quantifier = .required },
8406 .{ .kind = .id_ref, .quantifier = .required },
8407 },
8408 },
8409 .{
8410 .name = "OpPhi",
8411 .opcode = 245,
8412 .operands = &.{
8413 .{ .kind = .id_result_type, .quantifier = .required },
8414 .{ .kind = .id_result, .quantifier = .required },
8415 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
8416 },
8417 },
8418 .{
8419 .name = "OpLoopMerge",
8420 .opcode = 246,
8421 .operands = &.{
8422 .{ .kind = .id_ref, .quantifier = .required },
8423 .{ .kind = .id_ref, .quantifier = .required },
8424 .{ .kind = .loop_control, .quantifier = .required },
8425 },
8426 },
8427 .{
8428 .name = "OpSelectionMerge",
8429 .opcode = 247,
8430 .operands = &.{
8431 .{ .kind = .id_ref, .quantifier = .required },
8432 .{ .kind = .selection_control, .quantifier = .required },
8433 },
8434 },
8435 .{
8436 .name = "OpLabel",
8437 .opcode = 248,
8438 .operands = &.{
8439 .{ .kind = .id_result, .quantifier = .required },
8440 },
8441 },
8442 .{
8443 .name = "OpBranch",
8444 .opcode = 249,
8445 .operands = &.{
8446 .{ .kind = .id_ref, .quantifier = .required },
8447 },
8448 },
8449 .{
8450 .name = "OpBranchConditional",
8451 .opcode = 250,
8452 .operands = &.{
8453 .{ .kind = .id_ref, .quantifier = .required },
8454 .{ .kind = .id_ref, .quantifier = .required },
8455 .{ .kind = .id_ref, .quantifier = .required },
8456 .{ .kind = .literal_integer, .quantifier = .variadic },
8457 },
8458 },
8459 .{
8460 .name = "OpSwitch",
8461 .opcode = 251,
8462 .operands = &.{
8463 .{ .kind = .id_ref, .quantifier = .required },
8464 .{ .kind = .id_ref, .quantifier = .required },
8465 .{ .kind = .pair_literal_integer_id_ref, .quantifier = .variadic },
8466 },
8467 },
8468 .{
8469 .name = "OpKill",
8470 .opcode = 252,
8471 .operands = &.{},
8472 },
8473 .{
8474 .name = "OpReturn",
8475 .opcode = 253,
8476 .operands = &.{},
8477 },
8478 .{
8479 .name = "OpReturnValue",
8480 .opcode = 254,
8481 .operands = &.{
8482 .{ .kind = .id_ref, .quantifier = .required },
8483 },
8484 },
8485 .{
8486 .name = "OpUnreachable",
8487 .opcode = 255,
8488 .operands = &.{},
8489 },
8490 .{
8491 .name = "OpLifetimeStart",
8492 .opcode = 256,
8493 .operands = &.{
8494 .{ .kind = .id_ref, .quantifier = .required },
8495 .{ .kind = .literal_integer, .quantifier = .required },
8496 },
8497 },
8498 .{
8499 .name = "OpLifetimeStop",
8500 .opcode = 257,
8501 .operands = &.{
8502 .{ .kind = .id_ref, .quantifier = .required },
8503 .{ .kind = .literal_integer, .quantifier = .required },
8504 },
8505 },
8506 .{
8507 .name = "OpGroupAsyncCopy",
8508 .opcode = 259,
8509 .operands = &.{
8510 .{ .kind = .id_result_type, .quantifier = .required },
8511 .{ .kind = .id_result, .quantifier = .required },
8512 .{ .kind = .id_scope, .quantifier = .required },
8513 .{ .kind = .id_ref, .quantifier = .required },
8514 .{ .kind = .id_ref, .quantifier = .required },
8515 .{ .kind = .id_ref, .quantifier = .required },
8516 .{ .kind = .id_ref, .quantifier = .required },
8517 .{ .kind = .id_ref, .quantifier = .required },
8518 },
8519 },
8520 .{
8521 .name = "OpGroupWaitEvents",
8522 .opcode = 260,
8523 .operands = &.{
8524 .{ .kind = .id_scope, .quantifier = .required },
8525 .{ .kind = .id_ref, .quantifier = .required },
8526 .{ .kind = .id_ref, .quantifier = .required },
8527 },
8528 },
8529 .{
8530 .name = "OpGroupAll",
8531 .opcode = 261,
8532 .operands = &.{
8533 .{ .kind = .id_result_type, .quantifier = .required },
8534 .{ .kind = .id_result, .quantifier = .required },
8535 .{ .kind = .id_scope, .quantifier = .required },
8536 .{ .kind = .id_ref, .quantifier = .required },
8537 },
8538 },
8539 .{
8540 .name = "OpGroupAny",
8541 .opcode = 262,
8542 .operands = &.{
8543 .{ .kind = .id_result_type, .quantifier = .required },
8544 .{ .kind = .id_result, .quantifier = .required },
8545 .{ .kind = .id_scope, .quantifier = .required },
8546 .{ .kind = .id_ref, .quantifier = .required },
8547 },
8548 },
8549 .{
8550 .name = "OpGroupBroadcast",
8551 .opcode = 263,
8552 .operands = &.{
8553 .{ .kind = .id_result_type, .quantifier = .required },
8554 .{ .kind = .id_result, .quantifier = .required },
8555 .{ .kind = .id_scope, .quantifier = .required },
8556 .{ .kind = .id_ref, .quantifier = .required },
8557 .{ .kind = .id_ref, .quantifier = .required },
8558 },
8559 },
8560 .{
8561 .name = "OpGroupIAdd",
8562 .opcode = 264,
8563 .operands = &.{
8564 .{ .kind = .id_result_type, .quantifier = .required },
8565 .{ .kind = .id_result, .quantifier = .required },
8566 .{ .kind = .id_scope, .quantifier = .required },
8567 .{ .kind = .group_operation, .quantifier = .required },
8568 .{ .kind = .id_ref, .quantifier = .required },
8569 },
8570 },
8571 .{
8572 .name = "OpGroupFAdd",
8573 .opcode = 265,
8574 .operands = &.{
8575 .{ .kind = .id_result_type, .quantifier = .required },
8576 .{ .kind = .id_result, .quantifier = .required },
8577 .{ .kind = .id_scope, .quantifier = .required },
8578 .{ .kind = .group_operation, .quantifier = .required },
8579 .{ .kind = .id_ref, .quantifier = .required },
8580 },
8581 },
8582 .{
8583 .name = "OpGroupFMin",
8584 .opcode = 266,
8585 .operands = &.{
8586 .{ .kind = .id_result_type, .quantifier = .required },
8587 .{ .kind = .id_result, .quantifier = .required },
8588 .{ .kind = .id_scope, .quantifier = .required },
8589 .{ .kind = .group_operation, .quantifier = .required },
8590 .{ .kind = .id_ref, .quantifier = .required },
8591 },
8592 },
8593 .{
8594 .name = "OpGroupUMin",
8595 .opcode = 267,
8596 .operands = &.{
8597 .{ .kind = .id_result_type, .quantifier = .required },
8598 .{ .kind = .id_result, .quantifier = .required },
8599 .{ .kind = .id_scope, .quantifier = .required },
8600 .{ .kind = .group_operation, .quantifier = .required },
8601 .{ .kind = .id_ref, .quantifier = .required },
8602 },
8603 },
8604 .{
8605 .name = "OpGroupSMin",
8606 .opcode = 268,
8607 .operands = &.{
8608 .{ .kind = .id_result_type, .quantifier = .required },
8609 .{ .kind = .id_result, .quantifier = .required },
8610 .{ .kind = .id_scope, .quantifier = .required },
8611 .{ .kind = .group_operation, .quantifier = .required },
8612 .{ .kind = .id_ref, .quantifier = .required },
8613 },
8614 },
8615 .{
8616 .name = "OpGroupFMax",
8617 .opcode = 269,
8618 .operands = &.{
8619 .{ .kind = .id_result_type, .quantifier = .required },
8620 .{ .kind = .id_result, .quantifier = .required },
8621 .{ .kind = .id_scope, .quantifier = .required },
8622 .{ .kind = .group_operation, .quantifier = .required },
8623 .{ .kind = .id_ref, .quantifier = .required },
8624 },
8625 },
8626 .{
8627 .name = "OpGroupUMax",
8628 .opcode = 270,
8629 .operands = &.{
8630 .{ .kind = .id_result_type, .quantifier = .required },
8631 .{ .kind = .id_result, .quantifier = .required },
8632 .{ .kind = .id_scope, .quantifier = .required },
8633 .{ .kind = .group_operation, .quantifier = .required },
8634 .{ .kind = .id_ref, .quantifier = .required },
8635 },
8636 },
8637 .{
8638 .name = "OpGroupSMax",
8639 .opcode = 271,
8640 .operands = &.{
8641 .{ .kind = .id_result_type, .quantifier = .required },
8642 .{ .kind = .id_result, .quantifier = .required },
8643 .{ .kind = .id_scope, .quantifier = .required },
8644 .{ .kind = .group_operation, .quantifier = .required },
8645 .{ .kind = .id_ref, .quantifier = .required },
8646 },
8647 },
8648 .{
8649 .name = "OpReadPipe",
8650 .opcode = 274,
8651 .operands = &.{
8652 .{ .kind = .id_result_type, .quantifier = .required },
8653 .{ .kind = .id_result, .quantifier = .required },
8654 .{ .kind = .id_ref, .quantifier = .required },
8655 .{ .kind = .id_ref, .quantifier = .required },
8656 .{ .kind = .id_ref, .quantifier = .required },
8657 .{ .kind = .id_ref, .quantifier = .required },
8658 },
8659 },
8660 .{
8661 .name = "OpWritePipe",
8662 .opcode = 275,
8663 .operands = &.{
8664 .{ .kind = .id_result_type, .quantifier = .required },
8665 .{ .kind = .id_result, .quantifier = .required },
8666 .{ .kind = .id_ref, .quantifier = .required },
8667 .{ .kind = .id_ref, .quantifier = .required },
8668 .{ .kind = .id_ref, .quantifier = .required },
8669 .{ .kind = .id_ref, .quantifier = .required },
8670 },
8671 },
8672 .{
8673 .name = "OpReservedReadPipe",
8674 .opcode = 276,
8675 .operands = &.{
8676 .{ .kind = .id_result_type, .quantifier = .required },
8677 .{ .kind = .id_result, .quantifier = .required },
8678 .{ .kind = .id_ref, .quantifier = .required },
8679 .{ .kind = .id_ref, .quantifier = .required },
8680 .{ .kind = .id_ref, .quantifier = .required },
8681 .{ .kind = .id_ref, .quantifier = .required },
8682 .{ .kind = .id_ref, .quantifier = .required },
8683 .{ .kind = .id_ref, .quantifier = .required },
8684 },
8685 },
8686 .{
8687 .name = "OpReservedWritePipe",
8688 .opcode = 277,
8689 .operands = &.{
8690 .{ .kind = .id_result_type, .quantifier = .required },
8691 .{ .kind = .id_result, .quantifier = .required },
8692 .{ .kind = .id_ref, .quantifier = .required },
8693 .{ .kind = .id_ref, .quantifier = .required },
8694 .{ .kind = .id_ref, .quantifier = .required },
8695 .{ .kind = .id_ref, .quantifier = .required },
8696 .{ .kind = .id_ref, .quantifier = .required },
8697 .{ .kind = .id_ref, .quantifier = .required },
8698 },
8699 },
8700 .{
8701 .name = "OpReserveReadPipePackets",
8702 .opcode = 278,
8703 .operands = &.{
8704 .{ .kind = .id_result_type, .quantifier = .required },
8705 .{ .kind = .id_result, .quantifier = .required },
8706 .{ .kind = .id_ref, .quantifier = .required },
8707 .{ .kind = .id_ref, .quantifier = .required },
8708 .{ .kind = .id_ref, .quantifier = .required },
8709 .{ .kind = .id_ref, .quantifier = .required },
8710 },
8711 },
8712 .{
8713 .name = "OpReserveWritePipePackets",
8714 .opcode = 279,
8715 .operands = &.{
8716 .{ .kind = .id_result_type, .quantifier = .required },
8717 .{ .kind = .id_result, .quantifier = .required },
8718 .{ .kind = .id_ref, .quantifier = .required },
8719 .{ .kind = .id_ref, .quantifier = .required },
8720 .{ .kind = .id_ref, .quantifier = .required },
8721 .{ .kind = .id_ref, .quantifier = .required },
8722 },
8723 },
8724 .{
8725 .name = "OpCommitReadPipe",
8726 .opcode = 280,
8727 .operands = &.{
8728 .{ .kind = .id_ref, .quantifier = .required },
8729 .{ .kind = .id_ref, .quantifier = .required },
8730 .{ .kind = .id_ref, .quantifier = .required },
8731 .{ .kind = .id_ref, .quantifier = .required },
8732 },
8733 },
8734 .{
8735 .name = "OpCommitWritePipe",
8736 .opcode = 281,
8737 .operands = &.{
8738 .{ .kind = .id_ref, .quantifier = .required },
8739 .{ .kind = .id_ref, .quantifier = .required },
8740 .{ .kind = .id_ref, .quantifier = .required },
8741 .{ .kind = .id_ref, .quantifier = .required },
8742 },
8743 },
8744 .{
8745 .name = "OpIsValidReserveId",
8746 .opcode = 282,
8747 .operands = &.{
8748 .{ .kind = .id_result_type, .quantifier = .required },
8749 .{ .kind = .id_result, .quantifier = .required },
8750 .{ .kind = .id_ref, .quantifier = .required },
8751 },
8752 },
8753 .{
8754 .name = "OpGetNumPipePackets",
8755 .opcode = 283,
8756 .operands = &.{
8757 .{ .kind = .id_result_type, .quantifier = .required },
8758 .{ .kind = .id_result, .quantifier = .required },
8759 .{ .kind = .id_ref, .quantifier = .required },
8760 .{ .kind = .id_ref, .quantifier = .required },
8761 .{ .kind = .id_ref, .quantifier = .required },
8762 },
8763 },
8764 .{
8765 .name = "OpGetMaxPipePackets",
8766 .opcode = 284,
8767 .operands = &.{
8768 .{ .kind = .id_result_type, .quantifier = .required },
8769 .{ .kind = .id_result, .quantifier = .required },
8770 .{ .kind = .id_ref, .quantifier = .required },
8771 .{ .kind = .id_ref, .quantifier = .required },
8772 .{ .kind = .id_ref, .quantifier = .required },
8773 },
8774 },
8775 .{
8776 .name = "OpGroupReserveReadPipePackets",
8777 .opcode = 285,
8778 .operands = &.{
8779 .{ .kind = .id_result_type, .quantifier = .required },
8780 .{ .kind = .id_result, .quantifier = .required },
8781 .{ .kind = .id_scope, .quantifier = .required },
8782 .{ .kind = .id_ref, .quantifier = .required },
8783 .{ .kind = .id_ref, .quantifier = .required },
8784 .{ .kind = .id_ref, .quantifier = .required },
8785 .{ .kind = .id_ref, .quantifier = .required },
8786 },
8787 },
8788 .{
8789 .name = "OpGroupReserveWritePipePackets",
8790 .opcode = 286,
8791 .operands = &.{
8792 .{ .kind = .id_result_type, .quantifier = .required },
8793 .{ .kind = .id_result, .quantifier = .required },
8794 .{ .kind = .id_scope, .quantifier = .required },
8795 .{ .kind = .id_ref, .quantifier = .required },
8796 .{ .kind = .id_ref, .quantifier = .required },
8797 .{ .kind = .id_ref, .quantifier = .required },
8798 .{ .kind = .id_ref, .quantifier = .required },
8799 },
8800 },
8801 .{
8802 .name = "OpGroupCommitReadPipe",
8803 .opcode = 287,
8804 .operands = &.{
8805 .{ .kind = .id_scope, .quantifier = .required },
8806 .{ .kind = .id_ref, .quantifier = .required },
8807 .{ .kind = .id_ref, .quantifier = .required },
8808 .{ .kind = .id_ref, .quantifier = .required },
8809 .{ .kind = .id_ref, .quantifier = .required },
8810 },
8811 },
8812 .{
8813 .name = "OpGroupCommitWritePipe",
8814 .opcode = 288,
8815 .operands = &.{
8816 .{ .kind = .id_scope, .quantifier = .required },
8817 .{ .kind = .id_ref, .quantifier = .required },
8818 .{ .kind = .id_ref, .quantifier = .required },
8819 .{ .kind = .id_ref, .quantifier = .required },
8820 .{ .kind = .id_ref, .quantifier = .required },
8821 },
8822 },
8823 .{
8824 .name = "OpEnqueueMarker",
8825 .opcode = 291,
8826 .operands = &.{
8827 .{ .kind = .id_result_type, .quantifier = .required },
8828 .{ .kind = .id_result, .quantifier = .required },
8829 .{ .kind = .id_ref, .quantifier = .required },
8830 .{ .kind = .id_ref, .quantifier = .required },
8831 .{ .kind = .id_ref, .quantifier = .required },
8832 .{ .kind = .id_ref, .quantifier = .required },
8833 },
8834 },
8835 .{
8836 .name = "OpEnqueueKernel",
8837 .opcode = 292,
8838 .operands = &.{
8839 .{ .kind = .id_result_type, .quantifier = .required },
8840 .{ .kind = .id_result, .quantifier = .required },
8841 .{ .kind = .id_ref, .quantifier = .required },
8842 .{ .kind = .id_ref, .quantifier = .required },
8843 .{ .kind = .id_ref, .quantifier = .required },
8844 .{ .kind = .id_ref, .quantifier = .required },
8845 .{ .kind = .id_ref, .quantifier = .required },
8846 .{ .kind = .id_ref, .quantifier = .required },
8847 .{ .kind = .id_ref, .quantifier = .required },
8848 .{ .kind = .id_ref, .quantifier = .required },
8849 .{ .kind = .id_ref, .quantifier = .required },
8850 .{ .kind = .id_ref, .quantifier = .required },
8851 .{ .kind = .id_ref, .quantifier = .variadic },
8852 },
8853 },
8854 .{
8855 .name = "OpGetKernelNDrangeSubGroupCount",
8856 .opcode = 293,
8857 .operands = &.{
8858 .{ .kind = .id_result_type, .quantifier = .required },
8859 .{ .kind = .id_result, .quantifier = .required },
8860 .{ .kind = .id_ref, .quantifier = .required },
8861 .{ .kind = .id_ref, .quantifier = .required },
8862 .{ .kind = .id_ref, .quantifier = .required },
8863 .{ .kind = .id_ref, .quantifier = .required },
8864 .{ .kind = .id_ref, .quantifier = .required },
8865 },
8866 },
8867 .{
8868 .name = "OpGetKernelNDrangeMaxSubGroupSize",
8869 .opcode = 294,
8870 .operands = &.{
8871 .{ .kind = .id_result_type, .quantifier = .required },
8872 .{ .kind = .id_result, .quantifier = .required },
8873 .{ .kind = .id_ref, .quantifier = .required },
8874 .{ .kind = .id_ref, .quantifier = .required },
8875 .{ .kind = .id_ref, .quantifier = .required },
8876 .{ .kind = .id_ref, .quantifier = .required },
8877 .{ .kind = .id_ref, .quantifier = .required },
8878 },
8879 },
8880 .{
8881 .name = "OpGetKernelWorkGroupSize",
8882 .opcode = 295,
8883 .operands = &.{
8884 .{ .kind = .id_result_type, .quantifier = .required },
8885 .{ .kind = .id_result, .quantifier = .required },
8886 .{ .kind = .id_ref, .quantifier = .required },
8887 .{ .kind = .id_ref, .quantifier = .required },
8888 .{ .kind = .id_ref, .quantifier = .required },
8889 .{ .kind = .id_ref, .quantifier = .required },
8890 },
8891 },
8892 .{
8893 .name = "OpGetKernelPreferredWorkGroupSizeMultiple",
8894 .opcode = 296,
8895 .operands = &.{
8896 .{ .kind = .id_result_type, .quantifier = .required },
8897 .{ .kind = .id_result, .quantifier = .required },
8898 .{ .kind = .id_ref, .quantifier = .required },
8899 .{ .kind = .id_ref, .quantifier = .required },
8900 .{ .kind = .id_ref, .quantifier = .required },
8901 .{ .kind = .id_ref, .quantifier = .required },
8902 },
8903 },
8904 .{
8905 .name = "OpRetainEvent",
8906 .opcode = 297,
8907 .operands = &.{
8908 .{ .kind = .id_ref, .quantifier = .required },
8909 },
8910 },
8911 .{
8912 .name = "OpReleaseEvent",
8913 .opcode = 298,
8914 .operands = &.{
8915 .{ .kind = .id_ref, .quantifier = .required },
8916 },
8917 },
8918 .{
8919 .name = "OpCreateUserEvent",
8920 .opcode = 299,
8921 .operands = &.{
8922 .{ .kind = .id_result_type, .quantifier = .required },
8923 .{ .kind = .id_result, .quantifier = .required },
8924 },
8925 },
8926 .{
8927 .name = "OpIsValidEvent",
8928 .opcode = 300,
8929 .operands = &.{
8930 .{ .kind = .id_result_type, .quantifier = .required },
8931 .{ .kind = .id_result, .quantifier = .required },
8932 .{ .kind = .id_ref, .quantifier = .required },
8933 },
8934 },
8935 .{
8936 .name = "OpSetUserEventStatus",
8937 .opcode = 301,
8938 .operands = &.{
8939 .{ .kind = .id_ref, .quantifier = .required },
8940 .{ .kind = .id_ref, .quantifier = .required },
8941 },
8942 },
8943 .{
8944 .name = "OpCaptureEventProfilingInfo",
8945 .opcode = 302,
8946 .operands = &.{
8947 .{ .kind = .id_ref, .quantifier = .required },
8948 .{ .kind = .id_ref, .quantifier = .required },
8949 .{ .kind = .id_ref, .quantifier = .required },
8950 },
8951 },
8952 .{
8953 .name = "OpGetDefaultQueue",
8954 .opcode = 303,
8955 .operands = &.{
8956 .{ .kind = .id_result_type, .quantifier = .required },
8957 .{ .kind = .id_result, .quantifier = .required },
8958 },
8959 },
8960 .{
8961 .name = "OpBuildNDRange",
8962 .opcode = 304,
8963 .operands = &.{
8964 .{ .kind = .id_result_type, .quantifier = .required },
8965 .{ .kind = .id_result, .quantifier = .required },
8966 .{ .kind = .id_ref, .quantifier = .required },
8967 .{ .kind = .id_ref, .quantifier = .required },
8968 .{ .kind = .id_ref, .quantifier = .required },
8969 },
8970 },
8971 .{
8972 .name = "OpImageSparseSampleImplicitLod",
8973 .opcode = 305,
8974 .operands = &.{
8975 .{ .kind = .id_result_type, .quantifier = .required },
8976 .{ .kind = .id_result, .quantifier = .required },
8977 .{ .kind = .id_ref, .quantifier = .required },
8978 .{ .kind = .id_ref, .quantifier = .required },
8979 .{ .kind = .image_operands, .quantifier = .optional },
8980 },
8981 },
8982 .{
8983 .name = "OpImageSparseSampleExplicitLod",
8984 .opcode = 306,
8985 .operands = &.{
8986 .{ .kind = .id_result_type, .quantifier = .required },
8987 .{ .kind = .id_result, .quantifier = .required },
8988 .{ .kind = .id_ref, .quantifier = .required },
8989 .{ .kind = .id_ref, .quantifier = .required },
8990 .{ .kind = .image_operands, .quantifier = .required },
8991 },
8992 },
8993 .{
8994 .name = "OpImageSparseSampleDrefImplicitLod",
8995 .opcode = 307,
8996 .operands = &.{
8997 .{ .kind = .id_result_type, .quantifier = .required },
8998 .{ .kind = .id_result, .quantifier = .required },
8999 .{ .kind = .id_ref, .quantifier = .required },
9000 .{ .kind = .id_ref, .quantifier = .required },
9001 .{ .kind = .id_ref, .quantifier = .required },
9002 .{ .kind = .image_operands, .quantifier = .optional },
9003 },
9004 },
9005 .{
9006 .name = "OpImageSparseSampleDrefExplicitLod",
9007 .opcode = 308,
9008 .operands = &.{
9009 .{ .kind = .id_result_type, .quantifier = .required },
9010 .{ .kind = .id_result, .quantifier = .required },
9011 .{ .kind = .id_ref, .quantifier = .required },
9012 .{ .kind = .id_ref, .quantifier = .required },
9013 .{ .kind = .id_ref, .quantifier = .required },
9014 .{ .kind = .image_operands, .quantifier = .required },
9015 },
9016 },
9017 .{
9018 .name = "OpImageSparseSampleProjImplicitLod",
9019 .opcode = 309,
9020 .operands = &.{
9021 .{ .kind = .id_result_type, .quantifier = .required },
9022 .{ .kind = .id_result, .quantifier = .required },
9023 .{ .kind = .id_ref, .quantifier = .required },
9024 .{ .kind = .id_ref, .quantifier = .required },
9025 .{ .kind = .image_operands, .quantifier = .optional },
9026 },
9027 },
9028 .{
9029 .name = "OpImageSparseSampleProjExplicitLod",
9030 .opcode = 310,
9031 .operands = &.{
9032 .{ .kind = .id_result_type, .quantifier = .required },
9033 .{ .kind = .id_result, .quantifier = .required },
9034 .{ .kind = .id_ref, .quantifier = .required },
9035 .{ .kind = .id_ref, .quantifier = .required },
9036 .{ .kind = .image_operands, .quantifier = .required },
9037 },
9038 },
9039 .{
9040 .name = "OpImageSparseSampleProjDrefImplicitLod",
9041 .opcode = 311,
9042 .operands = &.{
9043 .{ .kind = .id_result_type, .quantifier = .required },
9044 .{ .kind = .id_result, .quantifier = .required },
9045 .{ .kind = .id_ref, .quantifier = .required },
9046 .{ .kind = .id_ref, .quantifier = .required },
9047 .{ .kind = .id_ref, .quantifier = .required },
9048 .{ .kind = .image_operands, .quantifier = .optional },
9049 },
9050 },
9051 .{
9052 .name = "OpImageSparseSampleProjDrefExplicitLod",
9053 .opcode = 312,
9054 .operands = &.{
9055 .{ .kind = .id_result_type, .quantifier = .required },
9056 .{ .kind = .id_result, .quantifier = .required },
9057 .{ .kind = .id_ref, .quantifier = .required },
9058 .{ .kind = .id_ref, .quantifier = .required },
9059 .{ .kind = .id_ref, .quantifier = .required },
9060 .{ .kind = .image_operands, .quantifier = .required },
9061 },
9062 },
9063 .{
9064 .name = "OpImageSparseFetch",
9065 .opcode = 313,
9066 .operands = &.{
9067 .{ .kind = .id_result_type, .quantifier = .required },
9068 .{ .kind = .id_result, .quantifier = .required },
9069 .{ .kind = .id_ref, .quantifier = .required },
9070 .{ .kind = .id_ref, .quantifier = .required },
9071 .{ .kind = .image_operands, .quantifier = .optional },
9072 },
9073 },
9074 .{
9075 .name = "OpImageSparseGather",
9076 .opcode = 314,
9077 .operands = &.{
9078 .{ .kind = .id_result_type, .quantifier = .required },
9079 .{ .kind = .id_result, .quantifier = .required },
9080 .{ .kind = .id_ref, .quantifier = .required },
9081 .{ .kind = .id_ref, .quantifier = .required },
9082 .{ .kind = .id_ref, .quantifier = .required },
9083 .{ .kind = .image_operands, .quantifier = .optional },
9084 },
9085 },
9086 .{
9087 .name = "OpImageSparseDrefGather",
9088 .opcode = 315,
9089 .operands = &.{
9090 .{ .kind = .id_result_type, .quantifier = .required },
9091 .{ .kind = .id_result, .quantifier = .required },
9092 .{ .kind = .id_ref, .quantifier = .required },
9093 .{ .kind = .id_ref, .quantifier = .required },
9094 .{ .kind = .id_ref, .quantifier = .required },
9095 .{ .kind = .image_operands, .quantifier = .optional },
9096 },
9097 },
9098 .{
9099 .name = "OpImageSparseTexelsResident",
9100 .opcode = 316,
9101 .operands = &.{
9102 .{ .kind = .id_result_type, .quantifier = .required },
9103 .{ .kind = .id_result, .quantifier = .required },
9104 .{ .kind = .id_ref, .quantifier = .required },
9105 },
9106 },
9107 .{
9108 .name = "OpNoLine",
9109 .opcode = 317,
9110 .operands = &.{},
9111 },
9112 .{
9113 .name = "OpAtomicFlagTestAndSet",
9114 .opcode = 318,
9115 .operands = &.{
9116 .{ .kind = .id_result_type, .quantifier = .required },
9117 .{ .kind = .id_result, .quantifier = .required },
9118 .{ .kind = .id_ref, .quantifier = .required },
9119 .{ .kind = .id_scope, .quantifier = .required },
9120 .{ .kind = .id_memory_semantics, .quantifier = .required },
9121 },
9122 },
9123 .{
9124 .name = "OpAtomicFlagClear",
9125 .opcode = 319,
9126 .operands = &.{
9127 .{ .kind = .id_ref, .quantifier = .required },
9128 .{ .kind = .id_scope, .quantifier = .required },
9129 .{ .kind = .id_memory_semantics, .quantifier = .required },
9130 },
9131 },
9132 .{
9133 .name = "OpImageSparseRead",
9134 .opcode = 320,
9135 .operands = &.{
9136 .{ .kind = .id_result_type, .quantifier = .required },
9137 .{ .kind = .id_result, .quantifier = .required },
9138 .{ .kind = .id_ref, .quantifier = .required },
9139 .{ .kind = .id_ref, .quantifier = .required },
9140 .{ .kind = .image_operands, .quantifier = .optional },
9141 },
9142 },
9143 .{
9144 .name = "OpSizeOf",
9145 .opcode = 321,
9146 .operands = &.{
9147 .{ .kind = .id_result_type, .quantifier = .required },
9148 .{ .kind = .id_result, .quantifier = .required },
9149 .{ .kind = .id_ref, .quantifier = .required },
9150 },
9151 },
9152 .{
9153 .name = "OpTypePipeStorage",
9154 .opcode = 322,
9155 .operands = &.{
9156 .{ .kind = .id_result, .quantifier = .required },
9157 },
9158 },
9159 .{
9160 .name = "OpConstantPipeStorage",
9161 .opcode = 323,
9162 .operands = &.{
9163 .{ .kind = .id_result_type, .quantifier = .required },
9164 .{ .kind = .id_result, .quantifier = .required },
9165 .{ .kind = .literal_integer, .quantifier = .required },
9166 .{ .kind = .literal_integer, .quantifier = .required },
9167 .{ .kind = .literal_integer, .quantifier = .required },
9168 },
9169 },
9170 .{
9171 .name = "OpCreatePipeFromPipeStorage",
9172 .opcode = 324,
9173 .operands = &.{
9174 .{ .kind = .id_result_type, .quantifier = .required },
9175 .{ .kind = .id_result, .quantifier = .required },
9176 .{ .kind = .id_ref, .quantifier = .required },
9177 },
9178 },
9179 .{
9180 .name = "OpGetKernelLocalSizeForSubgroupCount",
9181 .opcode = 325,
9182 .operands = &.{
9183 .{ .kind = .id_result_type, .quantifier = .required },
9184 .{ .kind = .id_result, .quantifier = .required },
9185 .{ .kind = .id_ref, .quantifier = .required },
9186 .{ .kind = .id_ref, .quantifier = .required },
9187 .{ .kind = .id_ref, .quantifier = .required },
9188 .{ .kind = .id_ref, .quantifier = .required },
9189 .{ .kind = .id_ref, .quantifier = .required },
9190 },
9191 },
9192 .{
9193 .name = "OpGetKernelMaxNumSubgroups",
9194 .opcode = 326,
9195 .operands = &.{
9196 .{ .kind = .id_result_type, .quantifier = .required },
9197 .{ .kind = .id_result, .quantifier = .required },
9198 .{ .kind = .id_ref, .quantifier = .required },
9199 .{ .kind = .id_ref, .quantifier = .required },
9200 .{ .kind = .id_ref, .quantifier = .required },
9201 .{ .kind = .id_ref, .quantifier = .required },
9202 },
9203 },
9204 .{
9205 .name = "OpTypeNamedBarrier",
9206 .opcode = 327,
9207 .operands = &.{
9208 .{ .kind = .id_result, .quantifier = .required },
9209 },
9210 },
9211 .{
9212 .name = "OpNamedBarrierInitialize",
9213 .opcode = 328,
9214 .operands = &.{
9215 .{ .kind = .id_result_type, .quantifier = .required },
9216 .{ .kind = .id_result, .quantifier = .required },
9217 .{ .kind = .id_ref, .quantifier = .required },
9218 },
9219 },
9220 .{
9221 .name = "OpMemoryNamedBarrier",
9222 .opcode = 329,
9223 .operands = &.{
9224 .{ .kind = .id_ref, .quantifier = .required },
9225 .{ .kind = .id_scope, .quantifier = .required },
9226 .{ .kind = .id_memory_semantics, .quantifier = .required },
9227 },
9228 },
9229 .{
9230 .name = "OpModuleProcessed",
9231 .opcode = 330,
9232 .operands = &.{
9233 .{ .kind = .literal_string, .quantifier = .required },
9234 },
9235 },
9236 .{
9237 .name = "OpExecutionModeId",
9238 .opcode = 331,
9239 .operands = &.{
9240 .{ .kind = .id_ref, .quantifier = .required },
9241 .{ .kind = .execution_mode, .quantifier = .required },
9242 },
9243 },
9244 .{
9245 .name = "OpDecorateId",
9246 .opcode = 332,
9247 .operands = &.{
9248 .{ .kind = .id_ref, .quantifier = .required },
9249 .{ .kind = .decoration, .quantifier = .required },
9250 },
9251 },
9252 .{
9253 .name = "OpGroupNonUniformElect",
9254 .opcode = 333,
9255 .operands = &.{
9256 .{ .kind = .id_result_type, .quantifier = .required },
9257 .{ .kind = .id_result, .quantifier = .required },
9258 .{ .kind = .id_scope, .quantifier = .required },
9259 },
9260 },
9261 .{
9262 .name = "OpGroupNonUniformAll",
9263 .opcode = 334,
9264 .operands = &.{
9265 .{ .kind = .id_result_type, .quantifier = .required },
9266 .{ .kind = .id_result, .quantifier = .required },
9267 .{ .kind = .id_scope, .quantifier = .required },
9268 .{ .kind = .id_ref, .quantifier = .required },
9269 },
9270 },
9271 .{
9272 .name = "OpGroupNonUniformAny",
9273 .opcode = 335,
9274 .operands = &.{
9275 .{ .kind = .id_result_type, .quantifier = .required },
9276 .{ .kind = .id_result, .quantifier = .required },
9277 .{ .kind = .id_scope, .quantifier = .required },
9278 .{ .kind = .id_ref, .quantifier = .required },
9279 },
9280 },
9281 .{
9282 .name = "OpGroupNonUniformAllEqual",
9283 .opcode = 336,
9284 .operands = &.{
9285 .{ .kind = .id_result_type, .quantifier = .required },
9286 .{ .kind = .id_result, .quantifier = .required },
9287 .{ .kind = .id_scope, .quantifier = .required },
9288 .{ .kind = .id_ref, .quantifier = .required },
9289 },
9290 },
9291 .{
9292 .name = "OpGroupNonUniformBroadcast",
9293 .opcode = 337,
9294 .operands = &.{
9295 .{ .kind = .id_result_type, .quantifier = .required },
9296 .{ .kind = .id_result, .quantifier = .required },
9297 .{ .kind = .id_scope, .quantifier = .required },
9298 .{ .kind = .id_ref, .quantifier = .required },
9299 .{ .kind = .id_ref, .quantifier = .required },
9300 },
9301 },
9302 .{
9303 .name = "OpGroupNonUniformBroadcastFirst",
9304 .opcode = 338,
9305 .operands = &.{
9306 .{ .kind = .id_result_type, .quantifier = .required },
9307 .{ .kind = .id_result, .quantifier = .required },
9308 .{ .kind = .id_scope, .quantifier = .required },
9309 .{ .kind = .id_ref, .quantifier = .required },
9310 },
9311 },
9312 .{
9313 .name = "OpGroupNonUniformBallot",
9314 .opcode = 339,
9315 .operands = &.{
9316 .{ .kind = .id_result_type, .quantifier = .required },
9317 .{ .kind = .id_result, .quantifier = .required },
9318 .{ .kind = .id_scope, .quantifier = .required },
9319 .{ .kind = .id_ref, .quantifier = .required },
9320 },
9321 },
9322 .{
9323 .name = "OpGroupNonUniformInverseBallot",
9324 .opcode = 340,
9325 .operands = &.{
9326 .{ .kind = .id_result_type, .quantifier = .required },
9327 .{ .kind = .id_result, .quantifier = .required },
9328 .{ .kind = .id_scope, .quantifier = .required },
9329 .{ .kind = .id_ref, .quantifier = .required },
9330 },
9331 },
9332 .{
9333 .name = "OpGroupNonUniformBallotBitExtract",
9334 .opcode = 341,
9335 .operands = &.{
9336 .{ .kind = .id_result_type, .quantifier = .required },
9337 .{ .kind = .id_result, .quantifier = .required },
9338 .{ .kind = .id_scope, .quantifier = .required },
9339 .{ .kind = .id_ref, .quantifier = .required },
9340 .{ .kind = .id_ref, .quantifier = .required },
9341 },
9342 },
9343 .{
9344 .name = "OpGroupNonUniformBallotBitCount",
9345 .opcode = 342,
9346 .operands = &.{
9347 .{ .kind = .id_result_type, .quantifier = .required },
9348 .{ .kind = .id_result, .quantifier = .required },
9349 .{ .kind = .id_scope, .quantifier = .required },
9350 .{ .kind = .group_operation, .quantifier = .required },
9351 .{ .kind = .id_ref, .quantifier = .required },
9352 },
9353 },
9354 .{
9355 .name = "OpGroupNonUniformBallotFindLSB",
9356 .opcode = 343,
9357 .operands = &.{
9358 .{ .kind = .id_result_type, .quantifier = .required },
9359 .{ .kind = .id_result, .quantifier = .required },
9360 .{ .kind = .id_scope, .quantifier = .required },
9361 .{ .kind = .id_ref, .quantifier = .required },
9362 },
9363 },
9364 .{
9365 .name = "OpGroupNonUniformBallotFindMSB",
9366 .opcode = 344,
9367 .operands = &.{
9368 .{ .kind = .id_result_type, .quantifier = .required },
9369 .{ .kind = .id_result, .quantifier = .required },
9370 .{ .kind = .id_scope, .quantifier = .required },
9371 .{ .kind = .id_ref, .quantifier = .required },
9372 },
9373 },
9374 .{
9375 .name = "OpGroupNonUniformShuffle",
9376 .opcode = 345,
9377 .operands = &.{
9378 .{ .kind = .id_result_type, .quantifier = .required },
9379 .{ .kind = .id_result, .quantifier = .required },
9380 .{ .kind = .id_scope, .quantifier = .required },
9381 .{ .kind = .id_ref, .quantifier = .required },
9382 .{ .kind = .id_ref, .quantifier = .required },
9383 },
9384 },
9385 .{
9386 .name = "OpGroupNonUniformShuffleXor",
9387 .opcode = 346,
9388 .operands = &.{
9389 .{ .kind = .id_result_type, .quantifier = .required },
9390 .{ .kind = .id_result, .quantifier = .required },
9391 .{ .kind = .id_scope, .quantifier = .required },
9392 .{ .kind = .id_ref, .quantifier = .required },
9393 .{ .kind = .id_ref, .quantifier = .required },
9394 },
9395 },
9396 .{
9397 .name = "OpGroupNonUniformShuffleUp",
9398 .opcode = 347,
9399 .operands = &.{
9400 .{ .kind = .id_result_type, .quantifier = .required },
9401 .{ .kind = .id_result, .quantifier = .required },
9402 .{ .kind = .id_scope, .quantifier = .required },
9403 .{ .kind = .id_ref, .quantifier = .required },
9404 .{ .kind = .id_ref, .quantifier = .required },
9405 },
9406 },
9407 .{
9408 .name = "OpGroupNonUniformShuffleDown",
9409 .opcode = 348,
9410 .operands = &.{
9411 .{ .kind = .id_result_type, .quantifier = .required },
9412 .{ .kind = .id_result, .quantifier = .required },
9413 .{ .kind = .id_scope, .quantifier = .required },
9414 .{ .kind = .id_ref, .quantifier = .required },
9415 .{ .kind = .id_ref, .quantifier = .required },
9416 },
9417 },
9418 .{
9419 .name = "OpGroupNonUniformIAdd",
9420 .opcode = 349,
9421 .operands = &.{
9422 .{ .kind = .id_result_type, .quantifier = .required },
9423 .{ .kind = .id_result, .quantifier = .required },
9424 .{ .kind = .id_scope, .quantifier = .required },
9425 .{ .kind = .group_operation, .quantifier = .required },
9426 .{ .kind = .id_ref, .quantifier = .required },
9427 .{ .kind = .id_ref, .quantifier = .optional },
9428 },
9429 },
9430 .{
9431 .name = "OpGroupNonUniformFAdd",
9432 .opcode = 350,
9433 .operands = &.{
9434 .{ .kind = .id_result_type, .quantifier = .required },
9435 .{ .kind = .id_result, .quantifier = .required },
9436 .{ .kind = .id_scope, .quantifier = .required },
9437 .{ .kind = .group_operation, .quantifier = .required },
9438 .{ .kind = .id_ref, .quantifier = .required },
9439 .{ .kind = .id_ref, .quantifier = .optional },
9440 },
9441 },
9442 .{
9443 .name = "OpGroupNonUniformIMul",
9444 .opcode = 351,
9445 .operands = &.{
9446 .{ .kind = .id_result_type, .quantifier = .required },
9447 .{ .kind = .id_result, .quantifier = .required },
9448 .{ .kind = .id_scope, .quantifier = .required },
9449 .{ .kind = .group_operation, .quantifier = .required },
9450 .{ .kind = .id_ref, .quantifier = .required },
9451 .{ .kind = .id_ref, .quantifier = .optional },
9452 },
9453 },
9454 .{
9455 .name = "OpGroupNonUniformFMul",
9456 .opcode = 352,
9457 .operands = &.{
9458 .{ .kind = .id_result_type, .quantifier = .required },
9459 .{ .kind = .id_result, .quantifier = .required },
9460 .{ .kind = .id_scope, .quantifier = .required },
9461 .{ .kind = .group_operation, .quantifier = .required },
9462 .{ .kind = .id_ref, .quantifier = .required },
9463 .{ .kind = .id_ref, .quantifier = .optional },
9464 },
9465 },
9466 .{
9467 .name = "OpGroupNonUniformSMin",
9468 .opcode = 353,
9469 .operands = &.{
9470 .{ .kind = .id_result_type, .quantifier = .required },
9471 .{ .kind = .id_result, .quantifier = .required },
9472 .{ .kind = .id_scope, .quantifier = .required },
9473 .{ .kind = .group_operation, .quantifier = .required },
9474 .{ .kind = .id_ref, .quantifier = .required },
9475 .{ .kind = .id_ref, .quantifier = .optional },
9476 },
9477 },
9478 .{
9479 .name = "OpGroupNonUniformUMin",
9480 .opcode = 354,
9481 .operands = &.{
9482 .{ .kind = .id_result_type, .quantifier = .required },
9483 .{ .kind = .id_result, .quantifier = .required },
9484 .{ .kind = .id_scope, .quantifier = .required },
9485 .{ .kind = .group_operation, .quantifier = .required },
9486 .{ .kind = .id_ref, .quantifier = .required },
9487 .{ .kind = .id_ref, .quantifier = .optional },
9488 },
9489 },
9490 .{
9491 .name = "OpGroupNonUniformFMin",
9492 .opcode = 355,
9493 .operands = &.{
9494 .{ .kind = .id_result_type, .quantifier = .required },
9495 .{ .kind = .id_result, .quantifier = .required },
9496 .{ .kind = .id_scope, .quantifier = .required },
9497 .{ .kind = .group_operation, .quantifier = .required },
9498 .{ .kind = .id_ref, .quantifier = .required },
9499 .{ .kind = .id_ref, .quantifier = .optional },
9500 },
9501 },
9502 .{
9503 .name = "OpGroupNonUniformSMax",
9504 .opcode = 356,
9505 .operands = &.{
9506 .{ .kind = .id_result_type, .quantifier = .required },
9507 .{ .kind = .id_result, .quantifier = .required },
9508 .{ .kind = .id_scope, .quantifier = .required },
9509 .{ .kind = .group_operation, .quantifier = .required },
9510 .{ .kind = .id_ref, .quantifier = .required },
9511 .{ .kind = .id_ref, .quantifier = .optional },
9512 },
9513 },
9514 .{
9515 .name = "OpGroupNonUniformUMax",
9516 .opcode = 357,
9517 .operands = &.{
9518 .{ .kind = .id_result_type, .quantifier = .required },
9519 .{ .kind = .id_result, .quantifier = .required },
9520 .{ .kind = .id_scope, .quantifier = .required },
9521 .{ .kind = .group_operation, .quantifier = .required },
9522 .{ .kind = .id_ref, .quantifier = .required },
9523 .{ .kind = .id_ref, .quantifier = .optional },
9524 },
9525 },
9526 .{
9527 .name = "OpGroupNonUniformFMax",
9528 .opcode = 358,
9529 .operands = &.{
9530 .{ .kind = .id_result_type, .quantifier = .required },
9531 .{ .kind = .id_result, .quantifier = .required },
9532 .{ .kind = .id_scope, .quantifier = .required },
9533 .{ .kind = .group_operation, .quantifier = .required },
9534 .{ .kind = .id_ref, .quantifier = .required },
9535 .{ .kind = .id_ref, .quantifier = .optional },
9536 },
9537 },
9538 .{
9539 .name = "OpGroupNonUniformBitwiseAnd",
9540 .opcode = 359,
9541 .operands = &.{
9542 .{ .kind = .id_result_type, .quantifier = .required },
9543 .{ .kind = .id_result, .quantifier = .required },
9544 .{ .kind = .id_scope, .quantifier = .required },
9545 .{ .kind = .group_operation, .quantifier = .required },
9546 .{ .kind = .id_ref, .quantifier = .required },
9547 .{ .kind = .id_ref, .quantifier = .optional },
9548 },
9549 },
9550 .{
9551 .name = "OpGroupNonUniformBitwiseOr",
9552 .opcode = 360,
9553 .operands = &.{
9554 .{ .kind = .id_result_type, .quantifier = .required },
9555 .{ .kind = .id_result, .quantifier = .required },
9556 .{ .kind = .id_scope, .quantifier = .required },
9557 .{ .kind = .group_operation, .quantifier = .required },
9558 .{ .kind = .id_ref, .quantifier = .required },
9559 .{ .kind = .id_ref, .quantifier = .optional },
9560 },
9561 },
9562 .{
9563 .name = "OpGroupNonUniformBitwiseXor",
9564 .opcode = 361,
9565 .operands = &.{
9566 .{ .kind = .id_result_type, .quantifier = .required },
9567 .{ .kind = .id_result, .quantifier = .required },
9568 .{ .kind = .id_scope, .quantifier = .required },
9569 .{ .kind = .group_operation, .quantifier = .required },
9570 .{ .kind = .id_ref, .quantifier = .required },
9571 .{ .kind = .id_ref, .quantifier = .optional },
9572 },
9573 },
9574 .{
9575 .name = "OpGroupNonUniformLogicalAnd",
9576 .opcode = 362,
9577 .operands = &.{
9578 .{ .kind = .id_result_type, .quantifier = .required },
9579 .{ .kind = .id_result, .quantifier = .required },
9580 .{ .kind = .id_scope, .quantifier = .required },
9581 .{ .kind = .group_operation, .quantifier = .required },
9582 .{ .kind = .id_ref, .quantifier = .required },
9583 .{ .kind = .id_ref, .quantifier = .optional },
9584 },
9585 },
9586 .{
9587 .name = "OpGroupNonUniformLogicalOr",
9588 .opcode = 363,
9589 .operands = &.{
9590 .{ .kind = .id_result_type, .quantifier = .required },
9591 .{ .kind = .id_result, .quantifier = .required },
9592 .{ .kind = .id_scope, .quantifier = .required },
9593 .{ .kind = .group_operation, .quantifier = .required },
9594 .{ .kind = .id_ref, .quantifier = .required },
9595 .{ .kind = .id_ref, .quantifier = .optional },
9596 },
9597 },
9598 .{
9599 .name = "OpGroupNonUniformLogicalXor",
9600 .opcode = 364,
9601 .operands = &.{
9602 .{ .kind = .id_result_type, .quantifier = .required },
9603 .{ .kind = .id_result, .quantifier = .required },
9604 .{ .kind = .id_scope, .quantifier = .required },
9605 .{ .kind = .group_operation, .quantifier = .required },
9606 .{ .kind = .id_ref, .quantifier = .required },
9607 .{ .kind = .id_ref, .quantifier = .optional },
9608 },
9609 },
9610 .{
9611 .name = "OpGroupNonUniformQuadBroadcast",
9612 .opcode = 365,
9613 .operands = &.{
9614 .{ .kind = .id_result_type, .quantifier = .required },
9615 .{ .kind = .id_result, .quantifier = .required },
9616 .{ .kind = .id_scope, .quantifier = .required },
9617 .{ .kind = .id_ref, .quantifier = .required },
9618 .{ .kind = .id_ref, .quantifier = .required },
9619 },
9620 },
9621 .{
9622 .name = "OpGroupNonUniformQuadSwap",
9623 .opcode = 366,
9624 .operands = &.{
9625 .{ .kind = .id_result_type, .quantifier = .required },
9626 .{ .kind = .id_result, .quantifier = .required },
9627 .{ .kind = .id_scope, .quantifier = .required },
9628 .{ .kind = .id_ref, .quantifier = .required },
9629 .{ .kind = .id_ref, .quantifier = .required },
9630 },
9631 },
9632 .{
9633 .name = "OpCopyLogical",
9634 .opcode = 400,
9635 .operands = &.{
9636 .{ .kind = .id_result_type, .quantifier = .required },
9637 .{ .kind = .id_result, .quantifier = .required },
9638 .{ .kind = .id_ref, .quantifier = .required },
9639 },
9640 },
9641 .{
9642 .name = "OpPtrEqual",
9643 .opcode = 401,
9644 .operands = &.{
9645 .{ .kind = .id_result_type, .quantifier = .required },
9646 .{ .kind = .id_result, .quantifier = .required },
9647 .{ .kind = .id_ref, .quantifier = .required },
9648 .{ .kind = .id_ref, .quantifier = .required },
9649 },
9650 },
9651 .{
9652 .name = "OpPtrNotEqual",
9653 .opcode = 402,
9654 .operands = &.{
9655 .{ .kind = .id_result_type, .quantifier = .required },
9656 .{ .kind = .id_result, .quantifier = .required },
9657 .{ .kind = .id_ref, .quantifier = .required },
9658 .{ .kind = .id_ref, .quantifier = .required },
9659 },
9660 },
9661 .{
9662 .name = "OpPtrDiff",
9663 .opcode = 403,
9664 .operands = &.{
9665 .{ .kind = .id_result_type, .quantifier = .required },
9666 .{ .kind = .id_result, .quantifier = .required },
9667 .{ .kind = .id_ref, .quantifier = .required },
9668 .{ .kind = .id_ref, .quantifier = .required },
9669 },
9670 },
9671 .{
9672 .name = "OpColorAttachmentReadEXT",
9673 .opcode = 4160,
9674 .operands = &.{
9675 .{ .kind = .id_result_type, .quantifier = .required },
9676 .{ .kind = .id_result, .quantifier = .required },
9677 .{ .kind = .id_ref, .quantifier = .required },
9678 .{ .kind = .id_ref, .quantifier = .optional },
9679 },
9680 },
9681 .{
9682 .name = "OpDepthAttachmentReadEXT",
9683 .opcode = 4161,
9684 .operands = &.{
9685 .{ .kind = .id_result_type, .quantifier = .required },
9686 .{ .kind = .id_result, .quantifier = .required },
9687 .{ .kind = .id_ref, .quantifier = .optional },
9688 },
9689 },
9690 .{
9691 .name = "OpStencilAttachmentReadEXT",
9692 .opcode = 4162,
9693 .operands = &.{
9694 .{ .kind = .id_result_type, .quantifier = .required },
9695 .{ .kind = .id_result, .quantifier = .required },
9696 .{ .kind = .id_ref, .quantifier = .optional },
9697 },
9698 },
9699 .{
9700 .name = "OpTypeTensorARM",
9701 .opcode = 4163,
9702 .operands = &.{
9703 .{ .kind = .id_result, .quantifier = .required },
9704 .{ .kind = .id_ref, .quantifier = .required },
9705 .{ .kind = .id_ref, .quantifier = .optional },
9706 .{ .kind = .id_ref, .quantifier = .optional },
9707 },
9708 },
9709 .{
9710 .name = "OpTensorReadARM",
9711 .opcode = 4164,
9712 .operands = &.{
9713 .{ .kind = .id_result_type, .quantifier = .required },
9714 .{ .kind = .id_result, .quantifier = .required },
9715 .{ .kind = .id_ref, .quantifier = .required },
9716 .{ .kind = .id_ref, .quantifier = .required },
9717 .{ .kind = .tensor_operands, .quantifier = .optional },
9718 },
9719 },
9720 .{
9721 .name = "OpTensorWriteARM",
9722 .opcode = 4165,
9723 .operands = &.{
9724 .{ .kind = .id_ref, .quantifier = .required },
9725 .{ .kind = .id_ref, .quantifier = .required },
9726 .{ .kind = .id_ref, .quantifier = .required },
9727 .{ .kind = .tensor_operands, .quantifier = .optional },
9728 },
9729 },
9730 .{
9731 .name = "OpTensorQuerySizeARM",
9732 .opcode = 4166,
9733 .operands = &.{
9734 .{ .kind = .id_result_type, .quantifier = .required },
9735 .{ .kind = .id_result, .quantifier = .required },
9736 .{ .kind = .id_ref, .quantifier = .required },
9737 .{ .kind = .id_ref, .quantifier = .required },
9738 },
9739 },
9740 .{
9741 .name = "OpGraphConstantARM",
9742 .opcode = 4181,
9743 .operands = &.{
9744 .{ .kind = .id_result_type, .quantifier = .required },
9745 .{ .kind = .id_result, .quantifier = .required },
9746 .{ .kind = .literal_integer, .quantifier = .required },
9747 },
9748 },
9749 .{
9750 .name = "OpGraphEntryPointARM",
9751 .opcode = 4182,
9752 .operands = &.{
9753 .{ .kind = .id_ref, .quantifier = .required },
9754 .{ .kind = .literal_string, .quantifier = .required },
9755 .{ .kind = .id_ref, .quantifier = .variadic },
9756 },
9757 },
9758 .{
9759 .name = "OpGraphARM",
9760 .opcode = 4183,
9761 .operands = &.{
9762 .{ .kind = .id_result_type, .quantifier = .required },
9763 .{ .kind = .id_result, .quantifier = .required },
9764 },
9765 },
9766 .{
9767 .name = "OpGraphInputARM",
9768 .opcode = 4184,
9769 .operands = &.{
9770 .{ .kind = .id_result_type, .quantifier = .required },
9771 .{ .kind = .id_result, .quantifier = .required },
9772 .{ .kind = .id_ref, .quantifier = .required },
9773 .{ .kind = .id_ref, .quantifier = .variadic },
9774 },
9775 },
9776 .{
9777 .name = "OpGraphSetOutputARM",
9778 .opcode = 4185,
9779 .operands = &.{
9780 .{ .kind = .id_ref, .quantifier = .required },
9781 .{ .kind = .id_ref, .quantifier = .required },
9782 .{ .kind = .id_ref, .quantifier = .variadic },
9783 },
9784 },
9785 .{
9786 .name = "OpGraphEndARM",
9787 .opcode = 4186,
9788 .operands = &.{},
9789 },
9790 .{
9791 .name = "OpTypeGraphARM",
9792 .opcode = 4190,
9793 .operands = &.{
9794 .{ .kind = .id_result, .quantifier = .required },
9795 .{ .kind = .literal_integer, .quantifier = .required },
9796 .{ .kind = .id_ref, .quantifier = .variadic },
9797 },
9798 },
9799 .{
9800 .name = "OpTerminateInvocation",
9801 .opcode = 4416,
9802 .operands = &.{},
9803 },
9804 .{
9805 .name = "OpTypeUntypedPointerKHR",
9806 .opcode = 4417,
9807 .operands = &.{
9808 .{ .kind = .id_result, .quantifier = .required },
9809 .{ .kind = .storage_class, .quantifier = .required },
9810 },
9811 },
9812 .{
9813 .name = "OpUntypedVariableKHR",
9814 .opcode = 4418,
9815 .operands = &.{
9816 .{ .kind = .id_result_type, .quantifier = .required },
9817 .{ .kind = .id_result, .quantifier = .required },
9818 .{ .kind = .storage_class, .quantifier = .required },
9819 .{ .kind = .id_ref, .quantifier = .optional },
9820 .{ .kind = .id_ref, .quantifier = .optional },
9821 },
9822 },
9823 .{
9824 .name = "OpUntypedAccessChainKHR",
9825 .opcode = 4419,
9826 .operands = &.{
9827 .{ .kind = .id_result_type, .quantifier = .required },
9828 .{ .kind = .id_result, .quantifier = .required },
9829 .{ .kind = .id_ref, .quantifier = .required },
9830 .{ .kind = .id_ref, .quantifier = .required },
9831 .{ .kind = .id_ref, .quantifier = .variadic },
9832 },
9833 },
9834 .{
9835 .name = "OpUntypedInBoundsAccessChainKHR",
9836 .opcode = 4420,
9837 .operands = &.{
9838 .{ .kind = .id_result_type, .quantifier = .required },
9839 .{ .kind = .id_result, .quantifier = .required },
9840 .{ .kind = .id_ref, .quantifier = .required },
9841 .{ .kind = .id_ref, .quantifier = .required },
9842 .{ .kind = .id_ref, .quantifier = .variadic },
9843 },
9844 },
9845 .{
9846 .name = "OpSubgroupBallotKHR",
9847 .opcode = 4421,
9848 .operands = &.{
9849 .{ .kind = .id_result_type, .quantifier = .required },
9850 .{ .kind = .id_result, .quantifier = .required },
9851 .{ .kind = .id_ref, .quantifier = .required },
9852 },
9853 },
9854 .{
9855 .name = "OpSubgroupFirstInvocationKHR",
9856 .opcode = 4422,
9857 .operands = &.{
9858 .{ .kind = .id_result_type, .quantifier = .required },
9859 .{ .kind = .id_result, .quantifier = .required },
9860 .{ .kind = .id_ref, .quantifier = .required },
9861 },
9862 },
9863 .{
9864 .name = "OpUntypedPtrAccessChainKHR",
9865 .opcode = 4423,
9866 .operands = &.{
9867 .{ .kind = .id_result_type, .quantifier = .required },
9868 .{ .kind = .id_result, .quantifier = .required },
9869 .{ .kind = .id_ref, .quantifier = .required },
9870 .{ .kind = .id_ref, .quantifier = .required },
9871 .{ .kind = .id_ref, .quantifier = .required },
9872 .{ .kind = .id_ref, .quantifier = .variadic },
9873 },
9874 },
9875 .{
9876 .name = "OpUntypedInBoundsPtrAccessChainKHR",
9877 .opcode = 4424,
9878 .operands = &.{
9879 .{ .kind = .id_result_type, .quantifier = .required },
9880 .{ .kind = .id_result, .quantifier = .required },
9881 .{ .kind = .id_ref, .quantifier = .required },
9882 .{ .kind = .id_ref, .quantifier = .required },
9883 .{ .kind = .id_ref, .quantifier = .required },
9884 .{ .kind = .id_ref, .quantifier = .variadic },
9885 },
9886 },
9887 .{
9888 .name = "OpUntypedArrayLengthKHR",
9889 .opcode = 4425,
9890 .operands = &.{
9891 .{ .kind = .id_result_type, .quantifier = .required },
9892 .{ .kind = .id_result, .quantifier = .required },
9893 .{ .kind = .id_ref, .quantifier = .required },
9894 .{ .kind = .id_ref, .quantifier = .required },
9895 .{ .kind = .literal_integer, .quantifier = .required },
9896 },
9897 },
9898 .{
9899 .name = "OpUntypedPrefetchKHR",
9900 .opcode = 4426,
9901 .operands = &.{
9902 .{ .kind = .id_ref, .quantifier = .required },
9903 .{ .kind = .id_ref, .quantifier = .required },
9904 .{ .kind = .id_ref, .quantifier = .optional },
9905 .{ .kind = .id_ref, .quantifier = .optional },
9906 .{ .kind = .id_ref, .quantifier = .optional },
9907 },
9908 },
9909 .{
9910 .name = "OpFmaKHR",
9911 .opcode = 4427,
9912 .operands = &.{
9913 .{ .kind = .id_result_type, .quantifier = .required },
9914 .{ .kind = .id_result, .quantifier = .required },
9915 .{ .kind = .id_ref, .quantifier = .required },
9916 .{ .kind = .id_ref, .quantifier = .required },
9917 .{ .kind = .id_ref, .quantifier = .required },
9918 },
9919 },
9920 .{
9921 .name = "OpSubgroupAllKHR",
9922 .opcode = 4428,
9923 .operands = &.{
9924 .{ .kind = .id_result_type, .quantifier = .required },
9925 .{ .kind = .id_result, .quantifier = .required },
9926 .{ .kind = .id_ref, .quantifier = .required },
9927 },
9928 },
9929 .{
9930 .name = "OpSubgroupAnyKHR",
9931 .opcode = 4429,
9932 .operands = &.{
9933 .{ .kind = .id_result_type, .quantifier = .required },
9934 .{ .kind = .id_result, .quantifier = .required },
9935 .{ .kind = .id_ref, .quantifier = .required },
9936 },
9937 },
9938 .{
9939 .name = "OpSubgroupAllEqualKHR",
9940 .opcode = 4430,
9941 .operands = &.{
9942 .{ .kind = .id_result_type, .quantifier = .required },
9943 .{ .kind = .id_result, .quantifier = .required },
9944 .{ .kind = .id_ref, .quantifier = .required },
9945 },
9946 },
9947 .{
9948 .name = "OpGroupNonUniformRotateKHR",
9949 .opcode = 4431,
9950 .operands = &.{
9951 .{ .kind = .id_result_type, .quantifier = .required },
9952 .{ .kind = .id_result, .quantifier = .required },
9953 .{ .kind = .id_scope, .quantifier = .required },
9954 .{ .kind = .id_ref, .quantifier = .required },
9955 .{ .kind = .id_ref, .quantifier = .required },
9956 .{ .kind = .id_ref, .quantifier = .optional },
9957 },
9958 },
9959 .{
9960 .name = "OpSubgroupReadInvocationKHR",
9961 .opcode = 4432,
9962 .operands = &.{
9963 .{ .kind = .id_result_type, .quantifier = .required },
9964 .{ .kind = .id_result, .quantifier = .required },
9965 .{ .kind = .id_ref, .quantifier = .required },
9966 .{ .kind = .id_ref, .quantifier = .required },
9967 },
9968 },
9969 .{
9970 .name = "OpExtInstWithForwardRefsKHR",
9971 .opcode = 4433,
9972 .operands = &.{
9973 .{ .kind = .id_result_type, .quantifier = .required },
9974 .{ .kind = .id_result, .quantifier = .required },
9975 .{ .kind = .id_ref, .quantifier = .required },
9976 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
9977 .{ .kind = .id_ref, .quantifier = .variadic },
9978 },
9979 },
9980 .{
9981 .name = "OpUntypedGroupAsyncCopyKHR",
9982 .opcode = 4434,
9983 .operands = &.{
9984 .{ .kind = .id_result_type, .quantifier = .required },
9985 .{ .kind = .id_result, .quantifier = .required },
9986 .{ .kind = .id_ref, .quantifier = .required },
9987 .{ .kind = .id_ref, .quantifier = .required },
9988 .{ .kind = .id_ref, .quantifier = .required },
9989 .{ .kind = .id_ref, .quantifier = .required },
9990 .{ .kind = .id_ref, .quantifier = .required },
9991 .{ .kind = .id_ref, .quantifier = .required },
9992 .{ .kind = .id_ref, .quantifier = .required },
9993 .{ .kind = .memory_access, .quantifier = .optional },
9994 .{ .kind = .memory_access, .quantifier = .optional },
9995 },
9996 },
9997 .{
9998 .name = "OpTraceRayKHR",
9999 .opcode = 4445,
10000 .operands = &.{
10001 .{ .kind = .id_ref, .quantifier = .required },
10002 .{ .kind = .id_ref, .quantifier = .required },
10003 .{ .kind = .id_ref, .quantifier = .required },
10004 .{ .kind = .id_ref, .quantifier = .required },
10005 .{ .kind = .id_ref, .quantifier = .required },
10006 .{ .kind = .id_ref, .quantifier = .required },
10007 .{ .kind = .id_ref, .quantifier = .required },
10008 .{ .kind = .id_ref, .quantifier = .required },
10009 .{ .kind = .id_ref, .quantifier = .required },
10010 .{ .kind = .id_ref, .quantifier = .required },
10011 .{ .kind = .id_ref, .quantifier = .required },
10012 },
10013 },
10014 .{
10015 .name = "OpExecuteCallableKHR",
10016 .opcode = 4446,
10017 .operands = &.{
10018 .{ .kind = .id_ref, .quantifier = .required },
10019 .{ .kind = .id_ref, .quantifier = .required },
10020 },
10021 },
10022 .{
10023 .name = "OpConvertUToAccelerationStructureKHR",
10024 .opcode = 4447,
10025 .operands = &.{
10026 .{ .kind = .id_result_type, .quantifier = .required },
10027 .{ .kind = .id_result, .quantifier = .required },
10028 .{ .kind = .id_ref, .quantifier = .required },
10029 },
10030 },
10031 .{
10032 .name = "OpIgnoreIntersectionKHR",
10033 .opcode = 4448,
10034 .operands = &.{},
10035 },
10036 .{
10037 .name = "OpTerminateRayKHR",
10038 .opcode = 4449,
10039 .operands = &.{},
10040 },
10041 .{
10042 .name = "OpSDot",
10043 .opcode = 4450,
10044 .operands = &.{
10045 .{ .kind = .id_result_type, .quantifier = .required },
10046 .{ .kind = .id_result, .quantifier = .required },
10047 .{ .kind = .id_ref, .quantifier = .required },
10048 .{ .kind = .id_ref, .quantifier = .required },
10049 .{ .kind = .packed_vector_format, .quantifier = .optional },
10050 },
10051 },
10052 .{
10053 .name = "OpUDot",
10054 .opcode = 4451,
10055 .operands = &.{
10056 .{ .kind = .id_result_type, .quantifier = .required },
10057 .{ .kind = .id_result, .quantifier = .required },
10058 .{ .kind = .id_ref, .quantifier = .required },
10059 .{ .kind = .id_ref, .quantifier = .required },
10060 .{ .kind = .packed_vector_format, .quantifier = .optional },
10061 },
10062 },
10063 .{
10064 .name = "OpSUDot",
10065 .opcode = 4452,
10066 .operands = &.{
10067 .{ .kind = .id_result_type, .quantifier = .required },
10068 .{ .kind = .id_result, .quantifier = .required },
10069 .{ .kind = .id_ref, .quantifier = .required },
10070 .{ .kind = .id_ref, .quantifier = .required },
10071 .{ .kind = .packed_vector_format, .quantifier = .optional },
10072 },
10073 },
10074 .{
10075 .name = "OpSDotAccSat",
10076 .opcode = 4453,
10077 .operands = &.{
10078 .{ .kind = .id_result_type, .quantifier = .required },
10079 .{ .kind = .id_result, .quantifier = .required },
10080 .{ .kind = .id_ref, .quantifier = .required },
10081 .{ .kind = .id_ref, .quantifier = .required },
10082 .{ .kind = .id_ref, .quantifier = .required },
10083 .{ .kind = .packed_vector_format, .quantifier = .optional },
10084 },
10085 },
10086 .{
10087 .name = "OpUDotAccSat",
10088 .opcode = 4454,
10089 .operands = &.{
10090 .{ .kind = .id_result_type, .quantifier = .required },
10091 .{ .kind = .id_result, .quantifier = .required },
10092 .{ .kind = .id_ref, .quantifier = .required },
10093 .{ .kind = .id_ref, .quantifier = .required },
10094 .{ .kind = .id_ref, .quantifier = .required },
10095 .{ .kind = .packed_vector_format, .quantifier = .optional },
10096 },
10097 },
10098 .{
10099 .name = "OpSUDotAccSat",
10100 .opcode = 4455,
10101 .operands = &.{
10102 .{ .kind = .id_result_type, .quantifier = .required },
10103 .{ .kind = .id_result, .quantifier = .required },
10104 .{ .kind = .id_ref, .quantifier = .required },
10105 .{ .kind = .id_ref, .quantifier = .required },
10106 .{ .kind = .id_ref, .quantifier = .required },
10107 .{ .kind = .packed_vector_format, .quantifier = .optional },
10108 },
10109 },
10110 .{
10111 .name = "OpTypeCooperativeMatrixKHR",
10112 .opcode = 4456,
10113 .operands = &.{
10114 .{ .kind = .id_result, .quantifier = .required },
10115 .{ .kind = .id_ref, .quantifier = .required },
10116 .{ .kind = .id_scope, .quantifier = .required },
10117 .{ .kind = .id_ref, .quantifier = .required },
10118 .{ .kind = .id_ref, .quantifier = .required },
10119 .{ .kind = .id_ref, .quantifier = .required },
10120 },
10121 },
10122 .{
10123 .name = "OpCooperativeMatrixLoadKHR",
10124 .opcode = 4457,
10125 .operands = &.{
10126 .{ .kind = .id_result_type, .quantifier = .required },
10127 .{ .kind = .id_result, .quantifier = .required },
10128 .{ .kind = .id_ref, .quantifier = .required },
10129 .{ .kind = .id_ref, .quantifier = .required },
10130 .{ .kind = .id_ref, .quantifier = .optional },
10131 .{ .kind = .memory_access, .quantifier = .optional },
10132 },
10133 },
10134 .{
10135 .name = "OpCooperativeMatrixStoreKHR",
10136 .opcode = 4458,
10137 .operands = &.{
10138 .{ .kind = .id_ref, .quantifier = .required },
10139 .{ .kind = .id_ref, .quantifier = .required },
10140 .{ .kind = .id_ref, .quantifier = .required },
10141 .{ .kind = .id_ref, .quantifier = .optional },
10142 .{ .kind = .memory_access, .quantifier = .optional },
10143 },
10144 },
10145 .{
10146 .name = "OpCooperativeMatrixMulAddKHR",
10147 .opcode = 4459,
10148 .operands = &.{
10149 .{ .kind = .id_result_type, .quantifier = .required },
10150 .{ .kind = .id_result, .quantifier = .required },
10151 .{ .kind = .id_ref, .quantifier = .required },
10152 .{ .kind = .id_ref, .quantifier = .required },
10153 .{ .kind = .id_ref, .quantifier = .required },
10154 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10155 },
10156 },
10157 .{
10158 .name = "OpCooperativeMatrixLengthKHR",
10159 .opcode = 4460,
10160 .operands = &.{
10161 .{ .kind = .id_result_type, .quantifier = .required },
10162 .{ .kind = .id_result, .quantifier = .required },
10163 .{ .kind = .id_ref, .quantifier = .required },
10164 },
10165 },
10166 .{
10167 .name = "OpConstantCompositeReplicateEXT",
10168 .opcode = 4461,
10169 .operands = &.{
10170 .{ .kind = .id_result_type, .quantifier = .required },
10171 .{ .kind = .id_result, .quantifier = .required },
10172 .{ .kind = .id_ref, .quantifier = .required },
10173 },
10174 },
10175 .{
10176 .name = "OpSpecConstantCompositeReplicateEXT",
10177 .opcode = 4462,
10178 .operands = &.{
10179 .{ .kind = .id_result_type, .quantifier = .required },
10180 .{ .kind = .id_result, .quantifier = .required },
10181 .{ .kind = .id_ref, .quantifier = .required },
10182 },
10183 },
10184 .{
10185 .name = "OpCompositeConstructReplicateEXT",
10186 .opcode = 4463,
10187 .operands = &.{
10188 .{ .kind = .id_result_type, .quantifier = .required },
10189 .{ .kind = .id_result, .quantifier = .required },
10190 .{ .kind = .id_ref, .quantifier = .required },
10191 },
10192 },
10193 .{
10194 .name = "OpTypeRayQueryKHR",
10195 .opcode = 4472,
10196 .operands = &.{
10197 .{ .kind = .id_result, .quantifier = .required },
10198 },
10199 },
10200 .{
10201 .name = "OpRayQueryInitializeKHR",
10202 .opcode = 4473,
10203 .operands = &.{
10204 .{ .kind = .id_ref, .quantifier = .required },
10205 .{ .kind = .id_ref, .quantifier = .required },
10206 .{ .kind = .id_ref, .quantifier = .required },
10207 .{ .kind = .id_ref, .quantifier = .required },
10208 .{ .kind = .id_ref, .quantifier = .required },
10209 .{ .kind = .id_ref, .quantifier = .required },
10210 .{ .kind = .id_ref, .quantifier = .required },
10211 .{ .kind = .id_ref, .quantifier = .required },
10212 },
10213 },
10214 .{
10215 .name = "OpRayQueryTerminateKHR",
10216 .opcode = 4474,
10217 .operands = &.{
10218 .{ .kind = .id_ref, .quantifier = .required },
10219 },
10220 },
10221 .{
10222 .name = "OpRayQueryGenerateIntersectionKHR",
10223 .opcode = 4475,
10224 .operands = &.{
10225 .{ .kind = .id_ref, .quantifier = .required },
10226 .{ .kind = .id_ref, .quantifier = .required },
10227 },
10228 },
10229 .{
10230 .name = "OpRayQueryConfirmIntersectionKHR",
10231 .opcode = 4476,
10232 .operands = &.{
10233 .{ .kind = .id_ref, .quantifier = .required },
10234 },
10235 },
10236 .{
10237 .name = "OpRayQueryProceedKHR",
10238 .opcode = 4477,
10239 .operands = &.{
10240 .{ .kind = .id_result_type, .quantifier = .required },
10241 .{ .kind = .id_result, .quantifier = .required },
10242 .{ .kind = .id_ref, .quantifier = .required },
10243 },
10244 },
10245 .{
10246 .name = "OpRayQueryGetIntersectionTypeKHR",
10247 .opcode = 4479,
10248 .operands = &.{
10249 .{ .kind = .id_result_type, .quantifier = .required },
10250 .{ .kind = .id_result, .quantifier = .required },
10251 .{ .kind = .id_ref, .quantifier = .required },
10252 .{ .kind = .id_ref, .quantifier = .required },
10253 },
10254 },
10255 .{
10256 .name = "OpImageSampleWeightedQCOM",
10257 .opcode = 4480,
10258 .operands = &.{
10259 .{ .kind = .id_result_type, .quantifier = .required },
10260 .{ .kind = .id_result, .quantifier = .required },
10261 .{ .kind = .id_ref, .quantifier = .required },
10262 .{ .kind = .id_ref, .quantifier = .required },
10263 .{ .kind = .id_ref, .quantifier = .required },
10264 },
10265 },
10266 .{
10267 .name = "OpImageBoxFilterQCOM",
10268 .opcode = 4481,
10269 .operands = &.{
10270 .{ .kind = .id_result_type, .quantifier = .required },
10271 .{ .kind = .id_result, .quantifier = .required },
10272 .{ .kind = .id_ref, .quantifier = .required },
10273 .{ .kind = .id_ref, .quantifier = .required },
10274 .{ .kind = .id_ref, .quantifier = .required },
10275 },
10276 },
10277 .{
10278 .name = "OpImageBlockMatchSSDQCOM",
10279 .opcode = 4482,
10280 .operands = &.{
10281 .{ .kind = .id_result_type, .quantifier = .required },
10282 .{ .kind = .id_result, .quantifier = .required },
10283 .{ .kind = .id_ref, .quantifier = .required },
10284 .{ .kind = .id_ref, .quantifier = .required },
10285 .{ .kind = .id_ref, .quantifier = .required },
10286 .{ .kind = .id_ref, .quantifier = .required },
10287 .{ .kind = .id_ref, .quantifier = .required },
10288 },
10289 },
10290 .{
10291 .name = "OpImageBlockMatchSADQCOM",
10292 .opcode = 4483,
10293 .operands = &.{
10294 .{ .kind = .id_result_type, .quantifier = .required },
10295 .{ .kind = .id_result, .quantifier = .required },
10296 .{ .kind = .id_ref, .quantifier = .required },
10297 .{ .kind = .id_ref, .quantifier = .required },
10298 .{ .kind = .id_ref, .quantifier = .required },
10299 .{ .kind = .id_ref, .quantifier = .required },
10300 .{ .kind = .id_ref, .quantifier = .required },
10301 },
10302 },
10303 .{
10304 .name = "OpBitCastArrayQCOM",
10305 .opcode = 4497,
10306 .operands = &.{
10307 .{ .kind = .id_result_type, .quantifier = .required },
10308 .{ .kind = .id_result, .quantifier = .required },
10309 .{ .kind = .id_ref, .quantifier = .required },
10310 },
10311 },
10312 .{
10313 .name = "OpImageBlockMatchWindowSSDQCOM",
10314 .opcode = 4500,
10315 .operands = &.{
10316 .{ .kind = .id_result_type, .quantifier = .required },
10317 .{ .kind = .id_result, .quantifier = .required },
10318 .{ .kind = .id_ref, .quantifier = .required },
10319 .{ .kind = .id_ref, .quantifier = .required },
10320 .{ .kind = .id_ref, .quantifier = .required },
10321 .{ .kind = .id_ref, .quantifier = .required },
10322 .{ .kind = .id_ref, .quantifier = .required },
10323 },
10324 },
10325 .{
10326 .name = "OpImageBlockMatchWindowSADQCOM",
10327 .opcode = 4501,
10328 .operands = &.{
10329 .{ .kind = .id_result_type, .quantifier = .required },
10330 .{ .kind = .id_result, .quantifier = .required },
10331 .{ .kind = .id_ref, .quantifier = .required },
10332 .{ .kind = .id_ref, .quantifier = .required },
10333 .{ .kind = .id_ref, .quantifier = .required },
10334 .{ .kind = .id_ref, .quantifier = .required },
10335 .{ .kind = .id_ref, .quantifier = .required },
10336 },
10337 },
10338 .{
10339 .name = "OpImageBlockMatchGatherSSDQCOM",
10340 .opcode = 4502,
10341 .operands = &.{
10342 .{ .kind = .id_result_type, .quantifier = .required },
10343 .{ .kind = .id_result, .quantifier = .required },
10344 .{ .kind = .id_ref, .quantifier = .required },
10345 .{ .kind = .id_ref, .quantifier = .required },
10346 .{ .kind = .id_ref, .quantifier = .required },
10347 .{ .kind = .id_ref, .quantifier = .required },
10348 .{ .kind = .id_ref, .quantifier = .required },
10349 },
10350 },
10351 .{
10352 .name = "OpImageBlockMatchGatherSADQCOM",
10353 .opcode = 4503,
10354 .operands = &.{
10355 .{ .kind = .id_result_type, .quantifier = .required },
10356 .{ .kind = .id_result, .quantifier = .required },
10357 .{ .kind = .id_ref, .quantifier = .required },
10358 .{ .kind = .id_ref, .quantifier = .required },
10359 .{ .kind = .id_ref, .quantifier = .required },
10360 .{ .kind = .id_ref, .quantifier = .required },
10361 .{ .kind = .id_ref, .quantifier = .required },
10362 },
10363 },
10364 .{
10365 .name = "OpCompositeConstructCoopMatQCOM",
10366 .opcode = 4540,
10367 .operands = &.{
10368 .{ .kind = .id_result_type, .quantifier = .required },
10369 .{ .kind = .id_result, .quantifier = .required },
10370 .{ .kind = .id_ref, .quantifier = .required },
10371 },
10372 },
10373 .{
10374 .name = "OpCompositeExtractCoopMatQCOM",
10375 .opcode = 4541,
10376 .operands = &.{
10377 .{ .kind = .id_result_type, .quantifier = .required },
10378 .{ .kind = .id_result, .quantifier = .required },
10379 .{ .kind = .id_ref, .quantifier = .required },
10380 },
10381 },
10382 .{
10383 .name = "OpExtractSubArrayQCOM",
10384 .opcode = 4542,
10385 .operands = &.{
10386 .{ .kind = .id_result_type, .quantifier = .required },
10387 .{ .kind = .id_result, .quantifier = .required },
10388 .{ .kind = .id_ref, .quantifier = .required },
10389 .{ .kind = .id_ref, .quantifier = .required },
10390 },
10391 },
10392 .{
10393 .name = "OpGroupIAddNonUniformAMD",
10394 .opcode = 5000,
10395 .operands = &.{
10396 .{ .kind = .id_result_type, .quantifier = .required },
10397 .{ .kind = .id_result, .quantifier = .required },
10398 .{ .kind = .id_scope, .quantifier = .required },
10399 .{ .kind = .group_operation, .quantifier = .required },
10400 .{ .kind = .id_ref, .quantifier = .required },
10401 },
10402 },
10403 .{
10404 .name = "OpGroupFAddNonUniformAMD",
10405 .opcode = 5001,
10406 .operands = &.{
10407 .{ .kind = .id_result_type, .quantifier = .required },
10408 .{ .kind = .id_result, .quantifier = .required },
10409 .{ .kind = .id_scope, .quantifier = .required },
10410 .{ .kind = .group_operation, .quantifier = .required },
10411 .{ .kind = .id_ref, .quantifier = .required },
10412 },
10413 },
10414 .{
10415 .name = "OpGroupFMinNonUniformAMD",
10416 .opcode = 5002,
10417 .operands = &.{
10418 .{ .kind = .id_result_type, .quantifier = .required },
10419 .{ .kind = .id_result, .quantifier = .required },
10420 .{ .kind = .id_scope, .quantifier = .required },
10421 .{ .kind = .group_operation, .quantifier = .required },
10422 .{ .kind = .id_ref, .quantifier = .required },
10423 },
10424 },
10425 .{
10426 .name = "OpGroupUMinNonUniformAMD",
10427 .opcode = 5003,
10428 .operands = &.{
10429 .{ .kind = .id_result_type, .quantifier = .required },
10430 .{ .kind = .id_result, .quantifier = .required },
10431 .{ .kind = .id_scope, .quantifier = .required },
10432 .{ .kind = .group_operation, .quantifier = .required },
10433 .{ .kind = .id_ref, .quantifier = .required },
10434 },
10435 },
10436 .{
10437 .name = "OpGroupSMinNonUniformAMD",
10438 .opcode = 5004,
10439 .operands = &.{
10440 .{ .kind = .id_result_type, .quantifier = .required },
10441 .{ .kind = .id_result, .quantifier = .required },
10442 .{ .kind = .id_scope, .quantifier = .required },
10443 .{ .kind = .group_operation, .quantifier = .required },
10444 .{ .kind = .id_ref, .quantifier = .required },
10445 },
10446 },
10447 .{
10448 .name = "OpGroupFMaxNonUniformAMD",
10449 .opcode = 5005,
10450 .operands = &.{
10451 .{ .kind = .id_result_type, .quantifier = .required },
10452 .{ .kind = .id_result, .quantifier = .required },
10453 .{ .kind = .id_scope, .quantifier = .required },
10454 .{ .kind = .group_operation, .quantifier = .required },
10455 .{ .kind = .id_ref, .quantifier = .required },
10456 },
10457 },
10458 .{
10459 .name = "OpGroupUMaxNonUniformAMD",
10460 .opcode = 5006,
10461 .operands = &.{
10462 .{ .kind = .id_result_type, .quantifier = .required },
10463 .{ .kind = .id_result, .quantifier = .required },
10464 .{ .kind = .id_scope, .quantifier = .required },
10465 .{ .kind = .group_operation, .quantifier = .required },
10466 .{ .kind = .id_ref, .quantifier = .required },
10467 },
10468 },
10469 .{
10470 .name = "OpGroupSMaxNonUniformAMD",
10471 .opcode = 5007,
10472 .operands = &.{
10473 .{ .kind = .id_result_type, .quantifier = .required },
10474 .{ .kind = .id_result, .quantifier = .required },
10475 .{ .kind = .id_scope, .quantifier = .required },
10476 .{ .kind = .group_operation, .quantifier = .required },
10477 .{ .kind = .id_ref, .quantifier = .required },
10478 },
10479 },
10480 .{
10481 .name = "OpFragmentMaskFetchAMD",
10482 .opcode = 5011,
10483 .operands = &.{
10484 .{ .kind = .id_result_type, .quantifier = .required },
10485 .{ .kind = .id_result, .quantifier = .required },
10486 .{ .kind = .id_ref, .quantifier = .required },
10487 .{ .kind = .id_ref, .quantifier = .required },
10488 },
10489 },
10490 .{
10491 .name = "OpFragmentFetchAMD",
10492 .opcode = 5012,
10493 .operands = &.{
10494 .{ .kind = .id_result_type, .quantifier = .required },
10495 .{ .kind = .id_result, .quantifier = .required },
10496 .{ .kind = .id_ref, .quantifier = .required },
10497 .{ .kind = .id_ref, .quantifier = .required },
10498 .{ .kind = .id_ref, .quantifier = .required },
10499 },
10500 },
10501 .{
10502 .name = "OpReadClockKHR",
10503 .opcode = 5056,
10504 .operands = &.{
10505 .{ .kind = .id_result_type, .quantifier = .required },
10506 .{ .kind = .id_result, .quantifier = .required },
10507 .{ .kind = .id_scope, .quantifier = .required },
10508 },
10509 },
10510 .{
10511 .name = "OpAllocateNodePayloadsAMDX",
10512 .opcode = 5074,
10513 .operands = &.{
10514 .{ .kind = .id_result_type, .quantifier = .required },
10515 .{ .kind = .id_result, .quantifier = .required },
10516 .{ .kind = .id_scope, .quantifier = .required },
10517 .{ .kind = .id_ref, .quantifier = .required },
10518 .{ .kind = .id_ref, .quantifier = .required },
10519 },
10520 },
10521 .{
10522 .name = "OpEnqueueNodePayloadsAMDX",
10523 .opcode = 5075,
10524 .operands = &.{
10525 .{ .kind = .id_ref, .quantifier = .required },
10526 },
10527 },
10528 .{
10529 .name = "OpTypeNodePayloadArrayAMDX",
10530 .opcode = 5076,
10531 .operands = &.{
10532 .{ .kind = .id_result, .quantifier = .required },
10533 .{ .kind = .id_ref, .quantifier = .required },
10534 },
10535 },
10536 .{
10537 .name = "OpFinishWritingNodePayloadAMDX",
10538 .opcode = 5078,
10539 .operands = &.{
10540 .{ .kind = .id_result_type, .quantifier = .required },
10541 .{ .kind = .id_result, .quantifier = .required },
10542 .{ .kind = .id_ref, .quantifier = .required },
10543 },
10544 },
10545 .{
10546 .name = "OpNodePayloadArrayLengthAMDX",
10547 .opcode = 5090,
10548 .operands = &.{
10549 .{ .kind = .id_result_type, .quantifier = .required },
10550 .{ .kind = .id_result, .quantifier = .required },
10551 .{ .kind = .id_ref, .quantifier = .required },
10552 },
10553 },
10554 .{
10555 .name = "OpIsNodePayloadValidAMDX",
10556 .opcode = 5101,
10557 .operands = &.{
10558 .{ .kind = .id_result_type, .quantifier = .required },
10559 .{ .kind = .id_result, .quantifier = .required },
10560 .{ .kind = .id_ref, .quantifier = .required },
10561 .{ .kind = .id_ref, .quantifier = .required },
10562 },
10563 },
10564 .{
10565 .name = "OpConstantStringAMDX",
10566 .opcode = 5103,
10567 .operands = &.{
10568 .{ .kind = .id_result, .quantifier = .required },
10569 .{ .kind = .literal_string, .quantifier = .required },
10570 },
10571 },
10572 .{
10573 .name = "OpSpecConstantStringAMDX",
10574 .opcode = 5104,
10575 .operands = &.{
10576 .{ .kind = .id_result, .quantifier = .required },
10577 .{ .kind = .literal_string, .quantifier = .required },
10578 },
10579 },
10580 .{
10581 .name = "OpGroupNonUniformQuadAllKHR",
10582 .opcode = 5110,
10583 .operands = &.{
10584 .{ .kind = .id_result_type, .quantifier = .required },
10585 .{ .kind = .id_result, .quantifier = .required },
10586 .{ .kind = .id_ref, .quantifier = .required },
10587 },
10588 },
10589 .{
10590 .name = "OpGroupNonUniformQuadAnyKHR",
10591 .opcode = 5111,
10592 .operands = &.{
10593 .{ .kind = .id_result_type, .quantifier = .required },
10594 .{ .kind = .id_result, .quantifier = .required },
10595 .{ .kind = .id_ref, .quantifier = .required },
10596 },
10597 },
10598 .{
10599 .name = "OpTypeBufferEXT",
10600 .opcode = 5115,
10601 .operands = &.{
10602 .{ .kind = .id_result, .quantifier = .required },
10603 .{ .kind = .storage_class, .quantifier = .required },
10604 },
10605 },
10606 .{
10607 .name = "OpBufferPointerEXT",
10608 .opcode = 5119,
10609 .operands = &.{
10610 .{ .kind = .id_result_type, .quantifier = .required },
10611 .{ .kind = .id_result, .quantifier = .required },
10612 .{ .kind = .id_ref, .quantifier = .required },
10613 },
10614 },
10615 .{
10616 .name = "OpAbortKHR",
10617 .opcode = 5121,
10618 .operands = &.{
10619 .{ .kind = .id_ref, .quantifier = .required },
10620 .{ .kind = .id_ref, .quantifier = .required },
10621 },
10622 },
10623 .{
10624 .name = "OpUntypedImageTexelPointerEXT",
10625 .opcode = 5126,
10626 .operands = &.{
10627 .{ .kind = .id_result_type, .quantifier = .required },
10628 .{ .kind = .id_result, .quantifier = .required },
10629 .{ .kind = .id_ref, .quantifier = .required },
10630 .{ .kind = .id_ref, .quantifier = .required },
10631 .{ .kind = .id_ref, .quantifier = .required },
10632 .{ .kind = .id_ref, .quantifier = .required },
10633 },
10634 },
10635 .{
10636 .name = "OpMemberDecorateIdEXT",
10637 .opcode = 5127,
10638 .operands = &.{
10639 .{ .kind = .id_ref, .quantifier = .required },
10640 .{ .kind = .literal_integer, .quantifier = .required },
10641 .{ .kind = .decoration, .quantifier = .required },
10642 },
10643 },
10644 .{
10645 .name = "OpConstantSizeOfEXT",
10646 .opcode = 5129,
10647 .operands = &.{
10648 .{ .kind = .id_result_type, .quantifier = .required },
10649 .{ .kind = .id_result, .quantifier = .required },
10650 .{ .kind = .id_ref, .quantifier = .required },
10651 },
10652 },
10653 .{
10654 .name = "OpConstantDataKHR",
10655 .opcode = 5147,
10656 .operands = &.{
10657 .{ .kind = .id_result_type, .quantifier = .required },
10658 .{ .kind = .id_result, .quantifier = .required },
10659 .{ .kind = .literal_integer, .quantifier = .variadic },
10660 },
10661 },
10662 .{
10663 .name = "OpSpecConstantDataKHR",
10664 .opcode = 5148,
10665 .operands = &.{
10666 .{ .kind = .id_result_type, .quantifier = .required },
10667 .{ .kind = .id_result, .quantifier = .required },
10668 .{ .kind = .literal_integer, .quantifier = .variadic },
10669 },
10670 },
10671 .{
10672 .name = "OpPoisonKHR",
10673 .opcode = 5158,
10674 .operands = &.{
10675 .{ .kind = .id_result_type, .quantifier = .required },
10676 .{ .kind = .id_result, .quantifier = .required },
10677 },
10678 },
10679 .{
10680 .name = "OpFreezeKHR",
10681 .opcode = 5159,
10682 .operands = &.{
10683 .{ .kind = .id_result_type, .quantifier = .required },
10684 .{ .kind = .id_result, .quantifier = .required },
10685 .{ .kind = .id_ref, .quantifier = .required },
10686 },
10687 },
10688 .{
10689 .name = "OpHitObjectRecordHitMotionNV",
10690 .opcode = 5249,
10691 .operands = &.{
10692 .{ .kind = .id_ref, .quantifier = .required },
10693 .{ .kind = .id_ref, .quantifier = .required },
10694 .{ .kind = .id_ref, .quantifier = .required },
10695 .{ .kind = .id_ref, .quantifier = .required },
10696 .{ .kind = .id_ref, .quantifier = .required },
10697 .{ .kind = .id_ref, .quantifier = .required },
10698 .{ .kind = .id_ref, .quantifier = .required },
10699 .{ .kind = .id_ref, .quantifier = .required },
10700 .{ .kind = .id_ref, .quantifier = .required },
10701 .{ .kind = .id_ref, .quantifier = .required },
10702 .{ .kind = .id_ref, .quantifier = .required },
10703 .{ .kind = .id_ref, .quantifier = .required },
10704 .{ .kind = .id_ref, .quantifier = .required },
10705 .{ .kind = .id_ref, .quantifier = .required },
10706 },
10707 },
10708 .{
10709 .name = "OpHitObjectRecordHitWithIndexMotionNV",
10710 .opcode = 5250,
10711 .operands = &.{
10712 .{ .kind = .id_ref, .quantifier = .required },
10713 .{ .kind = .id_ref, .quantifier = .required },
10714 .{ .kind = .id_ref, .quantifier = .required },
10715 .{ .kind = .id_ref, .quantifier = .required },
10716 .{ .kind = .id_ref, .quantifier = .required },
10717 .{ .kind = .id_ref, .quantifier = .required },
10718 .{ .kind = .id_ref, .quantifier = .required },
10719 .{ .kind = .id_ref, .quantifier = .required },
10720 .{ .kind = .id_ref, .quantifier = .required },
10721 .{ .kind = .id_ref, .quantifier = .required },
10722 .{ .kind = .id_ref, .quantifier = .required },
10723 .{ .kind = .id_ref, .quantifier = .required },
10724 .{ .kind = .id_ref, .quantifier = .required },
10725 },
10726 },
10727 .{
10728 .name = "OpHitObjectRecordMissMotionNV",
10729 .opcode = 5251,
10730 .operands = &.{
10731 .{ .kind = .id_ref, .quantifier = .required },
10732 .{ .kind = .id_ref, .quantifier = .required },
10733 .{ .kind = .id_ref, .quantifier = .required },
10734 .{ .kind = .id_ref, .quantifier = .required },
10735 .{ .kind = .id_ref, .quantifier = .required },
10736 .{ .kind = .id_ref, .quantifier = .required },
10737 .{ .kind = .id_ref, .quantifier = .required },
10738 },
10739 },
10740 .{
10741 .name = "OpHitObjectGetWorldToObjectNV",
10742 .opcode = 5252,
10743 .operands = &.{
10744 .{ .kind = .id_result_type, .quantifier = .required },
10745 .{ .kind = .id_result, .quantifier = .required },
10746 .{ .kind = .id_ref, .quantifier = .required },
10747 },
10748 },
10749 .{
10750 .name = "OpHitObjectGetObjectToWorldNV",
10751 .opcode = 5253,
10752 .operands = &.{
10753 .{ .kind = .id_result_type, .quantifier = .required },
10754 .{ .kind = .id_result, .quantifier = .required },
10755 .{ .kind = .id_ref, .quantifier = .required },
10756 },
10757 },
10758 .{
10759 .name = "OpHitObjectGetObjectRayDirectionNV",
10760 .opcode = 5254,
10761 .operands = &.{
10762 .{ .kind = .id_result_type, .quantifier = .required },
10763 .{ .kind = .id_result, .quantifier = .required },
10764 .{ .kind = .id_ref, .quantifier = .required },
10765 },
10766 },
10767 .{
10768 .name = "OpHitObjectGetObjectRayOriginNV",
10769 .opcode = 5255,
10770 .operands = &.{
10771 .{ .kind = .id_result_type, .quantifier = .required },
10772 .{ .kind = .id_result, .quantifier = .required },
10773 .{ .kind = .id_ref, .quantifier = .required },
10774 },
10775 },
10776 .{
10777 .name = "OpHitObjectTraceRayMotionNV",
10778 .opcode = 5256,
10779 .operands = &.{
10780 .{ .kind = .id_ref, .quantifier = .required },
10781 .{ .kind = .id_ref, .quantifier = .required },
10782 .{ .kind = .id_ref, .quantifier = .required },
10783 .{ .kind = .id_ref, .quantifier = .required },
10784 .{ .kind = .id_ref, .quantifier = .required },
10785 .{ .kind = .id_ref, .quantifier = .required },
10786 .{ .kind = .id_ref, .quantifier = .required },
10787 .{ .kind = .id_ref, .quantifier = .required },
10788 .{ .kind = .id_ref, .quantifier = .required },
10789 .{ .kind = .id_ref, .quantifier = .required },
10790 .{ .kind = .id_ref, .quantifier = .required },
10791 .{ .kind = .id_ref, .quantifier = .required },
10792 .{ .kind = .id_ref, .quantifier = .required },
10793 },
10794 },
10795 .{
10796 .name = "OpHitObjectGetShaderRecordBufferHandleNV",
10797 .opcode = 5257,
10798 .operands = &.{
10799 .{ .kind = .id_result_type, .quantifier = .required },
10800 .{ .kind = .id_result, .quantifier = .required },
10801 .{ .kind = .id_ref, .quantifier = .required },
10802 },
10803 },
10804 .{
10805 .name = "OpHitObjectGetShaderBindingTableRecordIndexNV",
10806 .opcode = 5258,
10807 .operands = &.{
10808 .{ .kind = .id_result_type, .quantifier = .required },
10809 .{ .kind = .id_result, .quantifier = .required },
10810 .{ .kind = .id_ref, .quantifier = .required },
10811 },
10812 },
10813 .{
10814 .name = "OpHitObjectRecordEmptyNV",
10815 .opcode = 5259,
10816 .operands = &.{
10817 .{ .kind = .id_ref, .quantifier = .required },
10818 },
10819 },
10820 .{
10821 .name = "OpHitObjectTraceRayNV",
10822 .opcode = 5260,
10823 .operands = &.{
10824 .{ .kind = .id_ref, .quantifier = .required },
10825 .{ .kind = .id_ref, .quantifier = .required },
10826 .{ .kind = .id_ref, .quantifier = .required },
10827 .{ .kind = .id_ref, .quantifier = .required },
10828 .{ .kind = .id_ref, .quantifier = .required },
10829 .{ .kind = .id_ref, .quantifier = .required },
10830 .{ .kind = .id_ref, .quantifier = .required },
10831 .{ .kind = .id_ref, .quantifier = .required },
10832 .{ .kind = .id_ref, .quantifier = .required },
10833 .{ .kind = .id_ref, .quantifier = .required },
10834 .{ .kind = .id_ref, .quantifier = .required },
10835 .{ .kind = .id_ref, .quantifier = .required },
10836 },
10837 },
10838 .{
10839 .name = "OpHitObjectRecordHitNV",
10840 .opcode = 5261,
10841 .operands = &.{
10842 .{ .kind = .id_ref, .quantifier = .required },
10843 .{ .kind = .id_ref, .quantifier = .required },
10844 .{ .kind = .id_ref, .quantifier = .required },
10845 .{ .kind = .id_ref, .quantifier = .required },
10846 .{ .kind = .id_ref, .quantifier = .required },
10847 .{ .kind = .id_ref, .quantifier = .required },
10848 .{ .kind = .id_ref, .quantifier = .required },
10849 .{ .kind = .id_ref, .quantifier = .required },
10850 .{ .kind = .id_ref, .quantifier = .required },
10851 .{ .kind = .id_ref, .quantifier = .required },
10852 .{ .kind = .id_ref, .quantifier = .required },
10853 .{ .kind = .id_ref, .quantifier = .required },
10854 .{ .kind = .id_ref, .quantifier = .required },
10855 },
10856 },
10857 .{
10858 .name = "OpHitObjectRecordHitWithIndexNV",
10859 .opcode = 5262,
10860 .operands = &.{
10861 .{ .kind = .id_ref, .quantifier = .required },
10862 .{ .kind = .id_ref, .quantifier = .required },
10863 .{ .kind = .id_ref, .quantifier = .required },
10864 .{ .kind = .id_ref, .quantifier = .required },
10865 .{ .kind = .id_ref, .quantifier = .required },
10866 .{ .kind = .id_ref, .quantifier = .required },
10867 .{ .kind = .id_ref, .quantifier = .required },
10868 .{ .kind = .id_ref, .quantifier = .required },
10869 .{ .kind = .id_ref, .quantifier = .required },
10870 .{ .kind = .id_ref, .quantifier = .required },
10871 .{ .kind = .id_ref, .quantifier = .required },
10872 .{ .kind = .id_ref, .quantifier = .required },
10873 },
10874 },
10875 .{
10876 .name = "OpHitObjectRecordMissNV",
10877 .opcode = 5263,
10878 .operands = &.{
10879 .{ .kind = .id_ref, .quantifier = .required },
10880 .{ .kind = .id_ref, .quantifier = .required },
10881 .{ .kind = .id_ref, .quantifier = .required },
10882 .{ .kind = .id_ref, .quantifier = .required },
10883 .{ .kind = .id_ref, .quantifier = .required },
10884 .{ .kind = .id_ref, .quantifier = .required },
10885 },
10886 },
10887 .{
10888 .name = "OpHitObjectExecuteShaderNV",
10889 .opcode = 5264,
10890 .operands = &.{
10891 .{ .kind = .id_ref, .quantifier = .required },
10892 .{ .kind = .id_ref, .quantifier = .required },
10893 },
10894 },
10895 .{
10896 .name = "OpHitObjectGetCurrentTimeNV",
10897 .opcode = 5265,
10898 .operands = &.{
10899 .{ .kind = .id_result_type, .quantifier = .required },
10900 .{ .kind = .id_result, .quantifier = .required },
10901 .{ .kind = .id_ref, .quantifier = .required },
10902 },
10903 },
10904 .{
10905 .name = "OpHitObjectGetAttributesNV",
10906 .opcode = 5266,
10907 .operands = &.{
10908 .{ .kind = .id_ref, .quantifier = .required },
10909 .{ .kind = .id_ref, .quantifier = .required },
10910 },
10911 },
10912 .{
10913 .name = "OpHitObjectGetHitKindNV",
10914 .opcode = 5267,
10915 .operands = &.{
10916 .{ .kind = .id_result_type, .quantifier = .required },
10917 .{ .kind = .id_result, .quantifier = .required },
10918 .{ .kind = .id_ref, .quantifier = .required },
10919 },
10920 },
10921 .{
10922 .name = "OpHitObjectGetPrimitiveIndexNV",
10923 .opcode = 5268,
10924 .operands = &.{
10925 .{ .kind = .id_result_type, .quantifier = .required },
10926 .{ .kind = .id_result, .quantifier = .required },
10927 .{ .kind = .id_ref, .quantifier = .required },
10928 },
10929 },
10930 .{
10931 .name = "OpHitObjectGetGeometryIndexNV",
10932 .opcode = 5269,
10933 .operands = &.{
10934 .{ .kind = .id_result_type, .quantifier = .required },
10935 .{ .kind = .id_result, .quantifier = .required },
10936 .{ .kind = .id_ref, .quantifier = .required },
10937 },
10938 },
10939 .{
10940 .name = "OpHitObjectGetInstanceIdNV",
10941 .opcode = 5270,
10942 .operands = &.{
10943 .{ .kind = .id_result_type, .quantifier = .required },
10944 .{ .kind = .id_result, .quantifier = .required },
10945 .{ .kind = .id_ref, .quantifier = .required },
10946 },
10947 },
10948 .{
10949 .name = "OpHitObjectGetInstanceCustomIndexNV",
10950 .opcode = 5271,
10951 .operands = &.{
10952 .{ .kind = .id_result_type, .quantifier = .required },
10953 .{ .kind = .id_result, .quantifier = .required },
10954 .{ .kind = .id_ref, .quantifier = .required },
10955 },
10956 },
10957 .{
10958 .name = "OpHitObjectGetWorldRayDirectionNV",
10959 .opcode = 5272,
10960 .operands = &.{
10961 .{ .kind = .id_result_type, .quantifier = .required },
10962 .{ .kind = .id_result, .quantifier = .required },
10963 .{ .kind = .id_ref, .quantifier = .required },
10964 },
10965 },
10966 .{
10967 .name = "OpHitObjectGetWorldRayOriginNV",
10968 .opcode = 5273,
10969 .operands = &.{
10970 .{ .kind = .id_result_type, .quantifier = .required },
10971 .{ .kind = .id_result, .quantifier = .required },
10972 .{ .kind = .id_ref, .quantifier = .required },
10973 },
10974 },
10975 .{
10976 .name = "OpHitObjectGetRayTMaxNV",
10977 .opcode = 5274,
10978 .operands = &.{
10979 .{ .kind = .id_result_type, .quantifier = .required },
10980 .{ .kind = .id_result, .quantifier = .required },
10981 .{ .kind = .id_ref, .quantifier = .required },
10982 },
10983 },
10984 .{
10985 .name = "OpHitObjectGetRayTMinNV",
10986 .opcode = 5275,
10987 .operands = &.{
10988 .{ .kind = .id_result_type, .quantifier = .required },
10989 .{ .kind = .id_result, .quantifier = .required },
10990 .{ .kind = .id_ref, .quantifier = .required },
10991 },
10992 },
10993 .{
10994 .name = "OpHitObjectIsEmptyNV",
10995 .opcode = 5276,
10996 .operands = &.{
10997 .{ .kind = .id_result_type, .quantifier = .required },
10998 .{ .kind = .id_result, .quantifier = .required },
10999 .{ .kind = .id_ref, .quantifier = .required },
11000 },
11001 },
11002 .{
11003 .name = "OpHitObjectIsHitNV",
11004 .opcode = 5277,
11005 .operands = &.{
11006 .{ .kind = .id_result_type, .quantifier = .required },
11007 .{ .kind = .id_result, .quantifier = .required },
11008 .{ .kind = .id_ref, .quantifier = .required },
11009 },
11010 },
11011 .{
11012 .name = "OpHitObjectIsMissNV",
11013 .opcode = 5278,
11014 .operands = &.{
11015 .{ .kind = .id_result_type, .quantifier = .required },
11016 .{ .kind = .id_result, .quantifier = .required },
11017 .{ .kind = .id_ref, .quantifier = .required },
11018 },
11019 },
11020 .{
11021 .name = "OpReorderThreadWithHitObjectNV",
11022 .opcode = 5279,
11023 .operands = &.{
11024 .{ .kind = .id_ref, .quantifier = .required },
11025 .{ .kind = .id_ref, .quantifier = .optional },
11026 .{ .kind = .id_ref, .quantifier = .optional },
11027 },
11028 },
11029 .{
11030 .name = "OpReorderThreadWithHintNV",
11031 .opcode = 5280,
11032 .operands = &.{
11033 .{ .kind = .id_ref, .quantifier = .required },
11034 .{ .kind = .id_ref, .quantifier = .required },
11035 },
11036 },
11037 .{
11038 .name = "OpTypeHitObjectNV",
11039 .opcode = 5281,
11040 .operands = &.{
11041 .{ .kind = .id_result, .quantifier = .required },
11042 },
11043 },
11044 .{
11045 .name = "OpImageSampleFootprintNV",
11046 .opcode = 5283,
11047 .operands = &.{
11048 .{ .kind = .id_result_type, .quantifier = .required },
11049 .{ .kind = .id_result, .quantifier = .required },
11050 .{ .kind = .id_ref, .quantifier = .required },
11051 .{ .kind = .id_ref, .quantifier = .required },
11052 .{ .kind = .id_ref, .quantifier = .required },
11053 .{ .kind = .id_ref, .quantifier = .required },
11054 .{ .kind = .image_operands, .quantifier = .optional },
11055 },
11056 },
11057 .{
11058 .name = "OpTypeVectorIdEXT",
11059 .opcode = 5288,
11060 .operands = &.{
11061 .{ .kind = .id_result, .quantifier = .required },
11062 .{ .kind = .id_ref, .quantifier = .required },
11063 .{ .kind = .id_ref, .quantifier = .required },
11064 },
11065 },
11066 .{
11067 .name = "OpCooperativeVectorMatrixMulNV",
11068 .opcode = 5289,
11069 .operands = &.{
11070 .{ .kind = .id_result_type, .quantifier = .required },
11071 .{ .kind = .id_result, .quantifier = .required },
11072 .{ .kind = .id_ref, .quantifier = .required },
11073 .{ .kind = .id_ref, .quantifier = .required },
11074 .{ .kind = .id_ref, .quantifier = .required },
11075 .{ .kind = .id_ref, .quantifier = .required },
11076 .{ .kind = .id_ref, .quantifier = .required },
11077 .{ .kind = .id_ref, .quantifier = .required },
11078 .{ .kind = .id_ref, .quantifier = .required },
11079 .{ .kind = .id_ref, .quantifier = .required },
11080 .{ .kind = .id_ref, .quantifier = .required },
11081 .{ .kind = .id_ref, .quantifier = .optional },
11082 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
11083 },
11084 },
11085 .{
11086 .name = "OpCooperativeVectorOuterProductAccumulateNV",
11087 .opcode = 5290,
11088 .operands = &.{
11089 .{ .kind = .id_ref, .quantifier = .required },
11090 .{ .kind = .id_ref, .quantifier = .required },
11091 .{ .kind = .id_ref, .quantifier = .required },
11092 .{ .kind = .id_ref, .quantifier = .required },
11093 .{ .kind = .id_ref, .quantifier = .required },
11094 .{ .kind = .id_ref, .quantifier = .required },
11095 .{ .kind = .id_ref, .quantifier = .optional },
11096 },
11097 },
11098 .{
11099 .name = "OpCooperativeVectorReduceSumAccumulateNV",
11100 .opcode = 5291,
11101 .operands = &.{
11102 .{ .kind = .id_ref, .quantifier = .required },
11103 .{ .kind = .id_ref, .quantifier = .required },
11104 .{ .kind = .id_ref, .quantifier = .required },
11105 },
11106 },
11107 .{
11108 .name = "OpCooperativeVectorMatrixMulAddNV",
11109 .opcode = 5292,
11110 .operands = &.{
11111 .{ .kind = .id_result_type, .quantifier = .required },
11112 .{ .kind = .id_result, .quantifier = .required },
11113 .{ .kind = .id_ref, .quantifier = .required },
11114 .{ .kind = .id_ref, .quantifier = .required },
11115 .{ .kind = .id_ref, .quantifier = .required },
11116 .{ .kind = .id_ref, .quantifier = .required },
11117 .{ .kind = .id_ref, .quantifier = .required },
11118 .{ .kind = .id_ref, .quantifier = .required },
11119 .{ .kind = .id_ref, .quantifier = .required },
11120 .{ .kind = .id_ref, .quantifier = .required },
11121 .{ .kind = .id_ref, .quantifier = .required },
11122 .{ .kind = .id_ref, .quantifier = .required },
11123 .{ .kind = .id_ref, .quantifier = .required },
11124 .{ .kind = .id_ref, .quantifier = .required },
11125 .{ .kind = .id_ref, .quantifier = .optional },
11126 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
11127 },
11128 },
11129 .{
11130 .name = "OpCooperativeMatrixConvertNV",
11131 .opcode = 5293,
11132 .operands = &.{
11133 .{ .kind = .id_result_type, .quantifier = .required },
11134 .{ .kind = .id_result, .quantifier = .required },
11135 .{ .kind = .id_ref, .quantifier = .required },
11136 },
11137 },
11138 .{
11139 .name = "OpEmitMeshTasksEXT",
11140 .opcode = 5294,
11141 .operands = &.{
11142 .{ .kind = .id_ref, .quantifier = .required },
11143 .{ .kind = .id_ref, .quantifier = .required },
11144 .{ .kind = .id_ref, .quantifier = .required },
11145 .{ .kind = .id_ref, .quantifier = .optional },
11146 },
11147 },
11148 .{
11149 .name = "OpSetMeshOutputsEXT",
11150 .opcode = 5295,
11151 .operands = &.{
11152 .{ .kind = .id_ref, .quantifier = .required },
11153 .{ .kind = .id_ref, .quantifier = .required },
11154 },
11155 },
11156 .{
11157 .name = "OpGroupNonUniformPartitionEXT",
11158 .opcode = 5296,
11159 .operands = &.{
11160 .{ .kind = .id_result_type, .quantifier = .required },
11161 .{ .kind = .id_result, .quantifier = .required },
11162 .{ .kind = .id_ref, .quantifier = .required },
11163 },
11164 },
11165 .{
11166 .name = "OpWritePackedPrimitiveIndices4x8NV",
11167 .opcode = 5299,
11168 .operands = &.{
11169 .{ .kind = .id_ref, .quantifier = .required },
11170 .{ .kind = .id_ref, .quantifier = .required },
11171 },
11172 },
11173 .{
11174 .name = "OpFetchMicroTriangleVertexPositionNV",
11175 .opcode = 5300,
11176 .operands = &.{
11177 .{ .kind = .id_result_type, .quantifier = .required },
11178 .{ .kind = .id_result, .quantifier = .required },
11179 .{ .kind = .id_ref, .quantifier = .required },
11180 .{ .kind = .id_ref, .quantifier = .required },
11181 .{ .kind = .id_ref, .quantifier = .required },
11182 .{ .kind = .id_ref, .quantifier = .required },
11183 .{ .kind = .id_ref, .quantifier = .required },
11184 },
11185 },
11186 .{
11187 .name = "OpFetchMicroTriangleVertexBarycentricNV",
11188 .opcode = 5301,
11189 .operands = &.{
11190 .{ .kind = .id_result_type, .quantifier = .required },
11191 .{ .kind = .id_result, .quantifier = .required },
11192 .{ .kind = .id_ref, .quantifier = .required },
11193 .{ .kind = .id_ref, .quantifier = .required },
11194 .{ .kind = .id_ref, .quantifier = .required },
11195 .{ .kind = .id_ref, .quantifier = .required },
11196 .{ .kind = .id_ref, .quantifier = .required },
11197 },
11198 },
11199 .{
11200 .name = "OpCooperativeVectorLoadNV",
11201 .opcode = 5302,
11202 .operands = &.{
11203 .{ .kind = .id_result_type, .quantifier = .required },
11204 .{ .kind = .id_result, .quantifier = .required },
11205 .{ .kind = .id_ref, .quantifier = .required },
11206 .{ .kind = .id_ref, .quantifier = .required },
11207 .{ .kind = .memory_access, .quantifier = .optional },
11208 },
11209 },
11210 .{
11211 .name = "OpCooperativeVectorStoreNV",
11212 .opcode = 5303,
11213 .operands = &.{
11214 .{ .kind = .id_ref, .quantifier = .required },
11215 .{ .kind = .id_ref, .quantifier = .required },
11216 .{ .kind = .id_ref, .quantifier = .required },
11217 .{ .kind = .memory_access, .quantifier = .optional },
11218 },
11219 },
11220 .{
11221 .name = "OpHitObjectRecordFromQueryEXT",
11222 .opcode = 5304,
11223 .operands = &.{
11224 .{ .kind = .id_ref, .quantifier = .required },
11225 .{ .kind = .id_ref, .quantifier = .required },
11226 .{ .kind = .id_ref, .quantifier = .required },
11227 .{ .kind = .id_ref, .quantifier = .required },
11228 },
11229 },
11230 .{
11231 .name = "OpHitObjectRecordMissEXT",
11232 .opcode = 5305,
11233 .operands = &.{
11234 .{ .kind = .id_ref, .quantifier = .required },
11235 .{ .kind = .id_ref, .quantifier = .required },
11236 .{ .kind = .id_ref, .quantifier = .required },
11237 .{ .kind = .id_ref, .quantifier = .required },
11238 .{ .kind = .id_ref, .quantifier = .required },
11239 .{ .kind = .id_ref, .quantifier = .required },
11240 .{ .kind = .id_ref, .quantifier = .required },
11241 },
11242 },
11243 .{
11244 .name = "OpHitObjectRecordMissMotionEXT",
11245 .opcode = 5306,
11246 .operands = &.{
11247 .{ .kind = .id_ref, .quantifier = .required },
11248 .{ .kind = .id_ref, .quantifier = .required },
11249 .{ .kind = .id_ref, .quantifier = .required },
11250 .{ .kind = .id_ref, .quantifier = .required },
11251 .{ .kind = .id_ref, .quantifier = .required },
11252 .{ .kind = .id_ref, .quantifier = .required },
11253 .{ .kind = .id_ref, .quantifier = .required },
11254 .{ .kind = .id_ref, .quantifier = .required },
11255 },
11256 },
11257 .{
11258 .name = "OpHitObjectGetIntersectionTriangleVertexPositionsEXT",
11259 .opcode = 5307,
11260 .operands = &.{
11261 .{ .kind = .id_result_type, .quantifier = .required },
11262 .{ .kind = .id_result, .quantifier = .required },
11263 .{ .kind = .id_ref, .quantifier = .required },
11264 },
11265 },
11266 .{
11267 .name = "OpHitObjectGetRayFlagsEXT",
11268 .opcode = 5308,
11269 .operands = &.{
11270 .{ .kind = .id_result_type, .quantifier = .required },
11271 .{ .kind = .id_result, .quantifier = .required },
11272 .{ .kind = .id_ref, .quantifier = .required },
11273 },
11274 },
11275 .{
11276 .name = "OpHitObjectSetShaderBindingTableRecordIndexEXT",
11277 .opcode = 5309,
11278 .operands = &.{
11279 .{ .kind = .id_ref, .quantifier = .required },
11280 .{ .kind = .id_ref, .quantifier = .required },
11281 },
11282 },
11283 .{
11284 .name = "OpHitObjectReorderExecuteShaderEXT",
11285 .opcode = 5310,
11286 .operands = &.{
11287 .{ .kind = .id_ref, .quantifier = .required },
11288 .{ .kind = .id_ref, .quantifier = .required },
11289 .{ .kind = .id_ref, .quantifier = .optional },
11290 .{ .kind = .id_ref, .quantifier = .optional },
11291 },
11292 },
11293 .{
11294 .name = "OpHitObjectTraceReorderExecuteEXT",
11295 .opcode = 5311,
11296 .operands = &.{
11297 .{ .kind = .id_ref, .quantifier = .required },
11298 .{ .kind = .id_ref, .quantifier = .required },
11299 .{ .kind = .id_ref, .quantifier = .required },
11300 .{ .kind = .id_ref, .quantifier = .required },
11301 .{ .kind = .id_ref, .quantifier = .required },
11302 .{ .kind = .id_ref, .quantifier = .required },
11303 .{ .kind = .id_ref, .quantifier = .required },
11304 .{ .kind = .id_ref, .quantifier = .required },
11305 .{ .kind = .id_ref, .quantifier = .required },
11306 .{ .kind = .id_ref, .quantifier = .required },
11307 .{ .kind = .id_ref, .quantifier = .required },
11308 .{ .kind = .id_ref, .quantifier = .required },
11309 .{ .kind = .id_ref, .quantifier = .optional },
11310 .{ .kind = .id_ref, .quantifier = .optional },
11311 },
11312 },
11313 .{
11314 .name = "OpHitObjectTraceMotionReorderExecuteEXT",
11315 .opcode = 5312,
11316 .operands = &.{
11317 .{ .kind = .id_ref, .quantifier = .required },
11318 .{ .kind = .id_ref, .quantifier = .required },
11319 .{ .kind = .id_ref, .quantifier = .required },
11320 .{ .kind = .id_ref, .quantifier = .required },
11321 .{ .kind = .id_ref, .quantifier = .required },
11322 .{ .kind = .id_ref, .quantifier = .required },
11323 .{ .kind = .id_ref, .quantifier = .required },
11324 .{ .kind = .id_ref, .quantifier = .required },
11325 .{ .kind = .id_ref, .quantifier = .required },
11326 .{ .kind = .id_ref, .quantifier = .required },
11327 .{ .kind = .id_ref, .quantifier = .required },
11328 .{ .kind = .id_ref, .quantifier = .required },
11329 .{ .kind = .id_ref, .quantifier = .required },
11330 .{ .kind = .id_ref, .quantifier = .optional },
11331 .{ .kind = .id_ref, .quantifier = .optional },
11332 },
11333 },
11334 .{
11335 .name = "OpTypeHitObjectEXT",
11336 .opcode = 5313,
11337 .operands = &.{
11338 .{ .kind = .id_result, .quantifier = .required },
11339 },
11340 },
11341 .{
11342 .name = "OpReorderThreadWithHintEXT",
11343 .opcode = 5314,
11344 .operands = &.{
11345 .{ .kind = .id_ref, .quantifier = .required },
11346 .{ .kind = .id_ref, .quantifier = .required },
11347 },
11348 },
11349 .{
11350 .name = "OpReorderThreadWithHitObjectEXT",
11351 .opcode = 5315,
11352 .operands = &.{
11353 .{ .kind = .id_ref, .quantifier = .required },
11354 .{ .kind = .id_ref, .quantifier = .optional },
11355 .{ .kind = .id_ref, .quantifier = .optional },
11356 },
11357 },
11358 .{
11359 .name = "OpHitObjectTraceRayEXT",
11360 .opcode = 5316,
11361 .operands = &.{
11362 .{ .kind = .id_ref, .quantifier = .required },
11363 .{ .kind = .id_ref, .quantifier = .required },
11364 .{ .kind = .id_ref, .quantifier = .required },
11365 .{ .kind = .id_ref, .quantifier = .required },
11366 .{ .kind = .id_ref, .quantifier = .required },
11367 .{ .kind = .id_ref, .quantifier = .required },
11368 .{ .kind = .id_ref, .quantifier = .required },
11369 .{ .kind = .id_ref, .quantifier = .required },
11370 .{ .kind = .id_ref, .quantifier = .required },
11371 .{ .kind = .id_ref, .quantifier = .required },
11372 .{ .kind = .id_ref, .quantifier = .required },
11373 .{ .kind = .id_ref, .quantifier = .required },
11374 },
11375 },
11376 .{
11377 .name = "OpHitObjectTraceRayMotionEXT",
11378 .opcode = 5317,
11379 .operands = &.{
11380 .{ .kind = .id_ref, .quantifier = .required },
11381 .{ .kind = .id_ref, .quantifier = .required },
11382 .{ .kind = .id_ref, .quantifier = .required },
11383 .{ .kind = .id_ref, .quantifier = .required },
11384 .{ .kind = .id_ref, .quantifier = .required },
11385 .{ .kind = .id_ref, .quantifier = .required },
11386 .{ .kind = .id_ref, .quantifier = .required },
11387 .{ .kind = .id_ref, .quantifier = .required },
11388 .{ .kind = .id_ref, .quantifier = .required },
11389 .{ .kind = .id_ref, .quantifier = .required },
11390 .{ .kind = .id_ref, .quantifier = .required },
11391 .{ .kind = .id_ref, .quantifier = .required },
11392 .{ .kind = .id_ref, .quantifier = .required },
11393 },
11394 },
11395 .{
11396 .name = "OpHitObjectRecordEmptyEXT",
11397 .opcode = 5318,
11398 .operands = &.{
11399 .{ .kind = .id_ref, .quantifier = .required },
11400 },
11401 },
11402 .{
11403 .name = "OpHitObjectExecuteShaderEXT",
11404 .opcode = 5319,
11405 .operands = &.{
11406 .{ .kind = .id_ref, .quantifier = .required },
11407 .{ .kind = .id_ref, .quantifier = .required },
11408 },
11409 },
11410 .{
11411 .name = "OpHitObjectGetCurrentTimeEXT",
11412 .opcode = 5320,
11413 .operands = &.{
11414 .{ .kind = .id_result_type, .quantifier = .required },
11415 .{ .kind = .id_result, .quantifier = .required },
11416 .{ .kind = .id_ref, .quantifier = .required },
11417 },
11418 },
11419 .{
11420 .name = "OpHitObjectGetAttributesEXT",
11421 .opcode = 5321,
11422 .operands = &.{
11423 .{ .kind = .id_ref, .quantifier = .required },
11424 .{ .kind = .id_ref, .quantifier = .required },
11425 },
11426 },
11427 .{
11428 .name = "OpHitObjectGetHitKindEXT",
11429 .opcode = 5322,
11430 .operands = &.{
11431 .{ .kind = .id_result_type, .quantifier = .required },
11432 .{ .kind = .id_result, .quantifier = .required },
11433 .{ .kind = .id_ref, .quantifier = .required },
11434 },
11435 },
11436 .{
11437 .name = "OpHitObjectGetPrimitiveIndexEXT",
11438 .opcode = 5323,
11439 .operands = &.{
11440 .{ .kind = .id_result_type, .quantifier = .required },
11441 .{ .kind = .id_result, .quantifier = .required },
11442 .{ .kind = .id_ref, .quantifier = .required },
11443 },
11444 },
11445 .{
11446 .name = "OpHitObjectGetGeometryIndexEXT",
11447 .opcode = 5324,
11448 .operands = &.{
11449 .{ .kind = .id_result_type, .quantifier = .required },
11450 .{ .kind = .id_result, .quantifier = .required },
11451 .{ .kind = .id_ref, .quantifier = .required },
11452 },
11453 },
11454 .{
11455 .name = "OpHitObjectGetInstanceIdEXT",
11456 .opcode = 5325,
11457 .operands = &.{
11458 .{ .kind = .id_result_type, .quantifier = .required },
11459 .{ .kind = .id_result, .quantifier = .required },
11460 .{ .kind = .id_ref, .quantifier = .required },
11461 },
11462 },
11463 .{
11464 .name = "OpHitObjectGetInstanceCustomIndexEXT",
11465 .opcode = 5326,
11466 .operands = &.{
11467 .{ .kind = .id_result_type, .quantifier = .required },
11468 .{ .kind = .id_result, .quantifier = .required },
11469 .{ .kind = .id_ref, .quantifier = .required },
11470 },
11471 },
11472 .{
11473 .name = "OpHitObjectGetObjectRayOriginEXT",
11474 .opcode = 5327,
11475 .operands = &.{
11476 .{ .kind = .id_result_type, .quantifier = .required },
11477 .{ .kind = .id_result, .quantifier = .required },
11478 .{ .kind = .id_ref, .quantifier = .required },
11479 },
11480 },
11481 .{
11482 .name = "OpHitObjectGetObjectRayDirectionEXT",
11483 .opcode = 5328,
11484 .operands = &.{
11485 .{ .kind = .id_result_type, .quantifier = .required },
11486 .{ .kind = .id_result, .quantifier = .required },
11487 .{ .kind = .id_ref, .quantifier = .required },
11488 },
11489 },
11490 .{
11491 .name = "OpHitObjectGetWorldRayDirectionEXT",
11492 .opcode = 5329,
11493 .operands = &.{
11494 .{ .kind = .id_result_type, .quantifier = .required },
11495 .{ .kind = .id_result, .quantifier = .required },
11496 .{ .kind = .id_ref, .quantifier = .required },
11497 },
11498 },
11499 .{
11500 .name = "OpHitObjectGetWorldRayOriginEXT",
11501 .opcode = 5330,
11502 .operands = &.{
11503 .{ .kind = .id_result_type, .quantifier = .required },
11504 .{ .kind = .id_result, .quantifier = .required },
11505 .{ .kind = .id_ref, .quantifier = .required },
11506 },
11507 },
11508 .{
11509 .name = "OpHitObjectGetObjectToWorldEXT",
11510 .opcode = 5331,
11511 .operands = &.{
11512 .{ .kind = .id_result_type, .quantifier = .required },
11513 .{ .kind = .id_result, .quantifier = .required },
11514 .{ .kind = .id_ref, .quantifier = .required },
11515 },
11516 },
11517 .{
11518 .name = "OpHitObjectGetWorldToObjectEXT",
11519 .opcode = 5332,
11520 .operands = &.{
11521 .{ .kind = .id_result_type, .quantifier = .required },
11522 .{ .kind = .id_result, .quantifier = .required },
11523 .{ .kind = .id_ref, .quantifier = .required },
11524 },
11525 },
11526 .{
11527 .name = "OpHitObjectGetRayTMaxEXT",
11528 .opcode = 5333,
11529 .operands = &.{
11530 .{ .kind = .id_result_type, .quantifier = .required },
11531 .{ .kind = .id_result, .quantifier = .required },
11532 .{ .kind = .id_ref, .quantifier = .required },
11533 },
11534 },
11535 .{
11536 .name = "OpReportIntersectionKHR",
11537 .opcode = 5334,
11538 .operands = &.{
11539 .{ .kind = .id_result_type, .quantifier = .required },
11540 .{ .kind = .id_result, .quantifier = .required },
11541 .{ .kind = .id_ref, .quantifier = .required },
11542 .{ .kind = .id_ref, .quantifier = .required },
11543 },
11544 },
11545 .{
11546 .name = "OpIgnoreIntersectionNV",
11547 .opcode = 5335,
11548 .operands = &.{},
11549 },
11550 .{
11551 .name = "OpTerminateRayNV",
11552 .opcode = 5336,
11553 .operands = &.{},
11554 },
11555 .{
11556 .name = "OpTraceNV",
11557 .opcode = 5337,
11558 .operands = &.{
11559 .{ .kind = .id_ref, .quantifier = .required },
11560 .{ .kind = .id_ref, .quantifier = .required },
11561 .{ .kind = .id_ref, .quantifier = .required },
11562 .{ .kind = .id_ref, .quantifier = .required },
11563 .{ .kind = .id_ref, .quantifier = .required },
11564 .{ .kind = .id_ref, .quantifier = .required },
11565 .{ .kind = .id_ref, .quantifier = .required },
11566 .{ .kind = .id_ref, .quantifier = .required },
11567 .{ .kind = .id_ref, .quantifier = .required },
11568 .{ .kind = .id_ref, .quantifier = .required },
11569 .{ .kind = .id_ref, .quantifier = .required },
11570 },
11571 },
11572 .{
11573 .name = "OpTraceMotionNV",
11574 .opcode = 5338,
11575 .operands = &.{
11576 .{ .kind = .id_ref, .quantifier = .required },
11577 .{ .kind = .id_ref, .quantifier = .required },
11578 .{ .kind = .id_ref, .quantifier = .required },
11579 .{ .kind = .id_ref, .quantifier = .required },
11580 .{ .kind = .id_ref, .quantifier = .required },
11581 .{ .kind = .id_ref, .quantifier = .required },
11582 .{ .kind = .id_ref, .quantifier = .required },
11583 .{ .kind = .id_ref, .quantifier = .required },
11584 .{ .kind = .id_ref, .quantifier = .required },
11585 .{ .kind = .id_ref, .quantifier = .required },
11586 .{ .kind = .id_ref, .quantifier = .required },
11587 .{ .kind = .id_ref, .quantifier = .required },
11588 },
11589 },
11590 .{
11591 .name = "OpTraceRayMotionNV",
11592 .opcode = 5339,
11593 .operands = &.{
11594 .{ .kind = .id_ref, .quantifier = .required },
11595 .{ .kind = .id_ref, .quantifier = .required },
11596 .{ .kind = .id_ref, .quantifier = .required },
11597 .{ .kind = .id_ref, .quantifier = .required },
11598 .{ .kind = .id_ref, .quantifier = .required },
11599 .{ .kind = .id_ref, .quantifier = .required },
11600 .{ .kind = .id_ref, .quantifier = .required },
11601 .{ .kind = .id_ref, .quantifier = .required },
11602 .{ .kind = .id_ref, .quantifier = .required },
11603 .{ .kind = .id_ref, .quantifier = .required },
11604 .{ .kind = .id_ref, .quantifier = .required },
11605 .{ .kind = .id_ref, .quantifier = .required },
11606 },
11607 },
11608 .{
11609 .name = "OpRayQueryGetIntersectionTriangleVertexPositionsKHR",
11610 .opcode = 5340,
11611 .operands = &.{
11612 .{ .kind = .id_result_type, .quantifier = .required },
11613 .{ .kind = .id_result, .quantifier = .required },
11614 .{ .kind = .id_ref, .quantifier = .required },
11615 .{ .kind = .id_ref, .quantifier = .required },
11616 },
11617 },
11618 .{
11619 .name = "OpTypeAccelerationStructureKHR",
11620 .opcode = 5341,
11621 .operands = &.{
11622 .{ .kind = .id_result, .quantifier = .required },
11623 },
11624 },
11625 .{
11626 .name = "OpExecuteCallableNV",
11627 .opcode = 5344,
11628 .operands = &.{
11629 .{ .kind = .id_ref, .quantifier = .required },
11630 .{ .kind = .id_ref, .quantifier = .required },
11631 },
11632 },
11633 .{
11634 .name = "OpRayQueryGetIntersectionClusterIdNV",
11635 .opcode = 5345,
11636 .operands = &.{
11637 .{ .kind = .id_result_type, .quantifier = .required },
11638 .{ .kind = .id_result, .quantifier = .required },
11639 .{ .kind = .id_ref, .quantifier = .required },
11640 .{ .kind = .id_ref, .quantifier = .required },
11641 },
11642 },
11643 .{
11644 .name = "OpHitObjectGetClusterIdNV",
11645 .opcode = 5346,
11646 .operands = &.{
11647 .{ .kind = .id_result_type, .quantifier = .required },
11648 .{ .kind = .id_result, .quantifier = .required },
11649 .{ .kind = .id_ref, .quantifier = .required },
11650 },
11651 },
11652 .{
11653 .name = "OpHitObjectGetRayTMinEXT",
11654 .opcode = 5347,
11655 .operands = &.{
11656 .{ .kind = .id_result_type, .quantifier = .required },
11657 .{ .kind = .id_result, .quantifier = .required },
11658 .{ .kind = .id_ref, .quantifier = .required },
11659 },
11660 },
11661 .{
11662 .name = "OpHitObjectGetShaderBindingTableRecordIndexEXT",
11663 .opcode = 5348,
11664 .operands = &.{
11665 .{ .kind = .id_result_type, .quantifier = .required },
11666 .{ .kind = .id_result, .quantifier = .required },
11667 .{ .kind = .id_ref, .quantifier = .required },
11668 },
11669 },
11670 .{
11671 .name = "OpHitObjectGetShaderRecordBufferHandleEXT",
11672 .opcode = 5349,
11673 .operands = &.{
11674 .{ .kind = .id_result_type, .quantifier = .required },
11675 .{ .kind = .id_result, .quantifier = .required },
11676 .{ .kind = .id_ref, .quantifier = .required },
11677 },
11678 },
11679 .{
11680 .name = "OpHitObjectIsEmptyEXT",
11681 .opcode = 5350,
11682 .operands = &.{
11683 .{ .kind = .id_result_type, .quantifier = .required },
11684 .{ .kind = .id_result, .quantifier = .required },
11685 .{ .kind = .id_ref, .quantifier = .required },
11686 },
11687 },
11688 .{
11689 .name = "OpHitObjectIsHitEXT",
11690 .opcode = 5351,
11691 .operands = &.{
11692 .{ .kind = .id_result_type, .quantifier = .required },
11693 .{ .kind = .id_result, .quantifier = .required },
11694 .{ .kind = .id_ref, .quantifier = .required },
11695 },
11696 },
11697 .{
11698 .name = "OpHitObjectIsMissEXT",
11699 .opcode = 5352,
11700 .operands = &.{
11701 .{ .kind = .id_result_type, .quantifier = .required },
11702 .{ .kind = .id_result, .quantifier = .required },
11703 .{ .kind = .id_ref, .quantifier = .required },
11704 },
11705 },
11706 .{
11707 .name = "OpTypeCooperativeMatrixNV",
11708 .opcode = 5358,
11709 .operands = &.{
11710 .{ .kind = .id_result, .quantifier = .required },
11711 .{ .kind = .id_ref, .quantifier = .required },
11712 .{ .kind = .id_scope, .quantifier = .required },
11713 .{ .kind = .id_ref, .quantifier = .required },
11714 .{ .kind = .id_ref, .quantifier = .required },
11715 },
11716 },
11717 .{
11718 .name = "OpCooperativeMatrixLoadNV",
11719 .opcode = 5359,
11720 .operands = &.{
11721 .{ .kind = .id_result_type, .quantifier = .required },
11722 .{ .kind = .id_result, .quantifier = .required },
11723 .{ .kind = .id_ref, .quantifier = .required },
11724 .{ .kind = .id_ref, .quantifier = .required },
11725 .{ .kind = .id_ref, .quantifier = .required },
11726 .{ .kind = .memory_access, .quantifier = .optional },
11727 },
11728 },
11729 .{
11730 .name = "OpCooperativeMatrixStoreNV",
11731 .opcode = 5360,
11732 .operands = &.{
11733 .{ .kind = .id_ref, .quantifier = .required },
11734 .{ .kind = .id_ref, .quantifier = .required },
11735 .{ .kind = .id_ref, .quantifier = .required },
11736 .{ .kind = .id_ref, .quantifier = .required },
11737 .{ .kind = .memory_access, .quantifier = .optional },
11738 },
11739 },
11740 .{
11741 .name = "OpCooperativeMatrixMulAddNV",
11742 .opcode = 5361,
11743 .operands = &.{
11744 .{ .kind = .id_result_type, .quantifier = .required },
11745 .{ .kind = .id_result, .quantifier = .required },
11746 .{ .kind = .id_ref, .quantifier = .required },
11747 .{ .kind = .id_ref, .quantifier = .required },
11748 .{ .kind = .id_ref, .quantifier = .required },
11749 },
11750 },
11751 .{
11752 .name = "OpCooperativeMatrixLengthNV",
11753 .opcode = 5362,
11754 .operands = &.{
11755 .{ .kind = .id_result_type, .quantifier = .required },
11756 .{ .kind = .id_result, .quantifier = .required },
11757 .{ .kind = .id_ref, .quantifier = .required },
11758 },
11759 },
11760 .{
11761 .name = "OpBeginInvocationInterlockEXT",
11762 .opcode = 5364,
11763 .operands = &.{},
11764 },
11765 .{
11766 .name = "OpEndInvocationInterlockEXT",
11767 .opcode = 5365,
11768 .operands = &.{},
11769 },
11770 .{
11771 .name = "OpCooperativeMatrixReduceNV",
11772 .opcode = 5366,
11773 .operands = &.{
11774 .{ .kind = .id_result_type, .quantifier = .required },
11775 .{ .kind = .id_result, .quantifier = .required },
11776 .{ .kind = .id_ref, .quantifier = .required },
11777 .{ .kind = .cooperative_matrix_reduce, .quantifier = .required },
11778 .{ .kind = .id_ref, .quantifier = .required },
11779 },
11780 },
11781 .{
11782 .name = "OpCooperativeMatrixLoadTensorNV",
11783 .opcode = 5367,
11784 .operands = &.{
11785 .{ .kind = .id_result_type, .quantifier = .required },
11786 .{ .kind = .id_result, .quantifier = .required },
11787 .{ .kind = .id_ref, .quantifier = .required },
11788 .{ .kind = .id_ref, .quantifier = .required },
11789 .{ .kind = .id_ref, .quantifier = .required },
11790 .{ .kind = .memory_access, .quantifier = .required },
11791 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
11792 },
11793 },
11794 .{
11795 .name = "OpCooperativeMatrixStoreTensorNV",
11796 .opcode = 5368,
11797 .operands = &.{
11798 .{ .kind = .id_ref, .quantifier = .required },
11799 .{ .kind = .id_ref, .quantifier = .required },
11800 .{ .kind = .id_ref, .quantifier = .required },
11801 .{ .kind = .memory_access, .quantifier = .required },
11802 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
11803 },
11804 },
11805 .{
11806 .name = "OpCooperativeMatrixPerElementOpNV",
11807 .opcode = 5369,
11808 .operands = &.{
11809 .{ .kind = .id_result_type, .quantifier = .required },
11810 .{ .kind = .id_result, .quantifier = .required },
11811 .{ .kind = .id_ref, .quantifier = .required },
11812 .{ .kind = .id_ref, .quantifier = .required },
11813 .{ .kind = .id_ref, .quantifier = .variadic },
11814 },
11815 },
11816 .{
11817 .name = "OpTypeTensorLayoutNV",
11818 .opcode = 5370,
11819 .operands = &.{
11820 .{ .kind = .id_result, .quantifier = .required },
11821 .{ .kind = .id_ref, .quantifier = .required },
11822 .{ .kind = .id_ref, .quantifier = .required },
11823 },
11824 },
11825 .{
11826 .name = "OpTypeTensorViewNV",
11827 .opcode = 5371,
11828 .operands = &.{
11829 .{ .kind = .id_result, .quantifier = .required },
11830 .{ .kind = .id_ref, .quantifier = .required },
11831 .{ .kind = .id_ref, .quantifier = .required },
11832 .{ .kind = .id_ref, .quantifier = .variadic },
11833 },
11834 },
11835 .{
11836 .name = "OpCreateTensorLayoutNV",
11837 .opcode = 5372,
11838 .operands = &.{
11839 .{ .kind = .id_result_type, .quantifier = .required },
11840 .{ .kind = .id_result, .quantifier = .required },
11841 },
11842 },
11843 .{
11844 .name = "OpTensorLayoutSetDimensionNV",
11845 .opcode = 5373,
11846 .operands = &.{
11847 .{ .kind = .id_result_type, .quantifier = .required },
11848 .{ .kind = .id_result, .quantifier = .required },
11849 .{ .kind = .id_ref, .quantifier = .required },
11850 .{ .kind = .id_ref, .quantifier = .variadic },
11851 },
11852 },
11853 .{
11854 .name = "OpTensorLayoutSetStrideNV",
11855 .opcode = 5374,
11856 .operands = &.{
11857 .{ .kind = .id_result_type, .quantifier = .required },
11858 .{ .kind = .id_result, .quantifier = .required },
11859 .{ .kind = .id_ref, .quantifier = .required },
11860 .{ .kind = .id_ref, .quantifier = .variadic },
11861 },
11862 },
11863 .{
11864 .name = "OpTensorLayoutSliceNV",
11865 .opcode = 5375,
11866 .operands = &.{
11867 .{ .kind = .id_result_type, .quantifier = .required },
11868 .{ .kind = .id_result, .quantifier = .required },
11869 .{ .kind = .id_ref, .quantifier = .required },
11870 .{ .kind = .id_ref, .quantifier = .variadic },
11871 },
11872 },
11873 .{
11874 .name = "OpTensorLayoutSetClampValueNV",
11875 .opcode = 5376,
11876 .operands = &.{
11877 .{ .kind = .id_result_type, .quantifier = .required },
11878 .{ .kind = .id_result, .quantifier = .required },
11879 .{ .kind = .id_ref, .quantifier = .required },
11880 .{ .kind = .id_ref, .quantifier = .required },
11881 },
11882 },
11883 .{
11884 .name = "OpCreateTensorViewNV",
11885 .opcode = 5377,
11886 .operands = &.{
11887 .{ .kind = .id_result_type, .quantifier = .required },
11888 .{ .kind = .id_result, .quantifier = .required },
11889 },
11890 },
11891 .{
11892 .name = "OpTensorViewSetDimensionNV",
11893 .opcode = 5378,
11894 .operands = &.{
11895 .{ .kind = .id_result_type, .quantifier = .required },
11896 .{ .kind = .id_result, .quantifier = .required },
11897 .{ .kind = .id_ref, .quantifier = .required },
11898 .{ .kind = .id_ref, .quantifier = .variadic },
11899 },
11900 },
11901 .{
11902 .name = "OpTensorViewSetStrideNV",
11903 .opcode = 5379,
11904 .operands = &.{
11905 .{ .kind = .id_result_type, .quantifier = .required },
11906 .{ .kind = .id_result, .quantifier = .required },
11907 .{ .kind = .id_ref, .quantifier = .required },
11908 .{ .kind = .id_ref, .quantifier = .variadic },
11909 },
11910 },
11911 .{
11912 .name = "OpDemoteToHelperInvocation",
11913 .opcode = 5380,
11914 .operands = &.{},
11915 },
11916 .{
11917 .name = "OpIsHelperInvocationEXT",
11918 .opcode = 5381,
11919 .operands = &.{
11920 .{ .kind = .id_result_type, .quantifier = .required },
11921 .{ .kind = .id_result, .quantifier = .required },
11922 },
11923 },
11924 .{
11925 .name = "OpTensorViewSetClipNV",
11926 .opcode = 5382,
11927 .operands = &.{
11928 .{ .kind = .id_result_type, .quantifier = .required },
11929 .{ .kind = .id_result, .quantifier = .required },
11930 .{ .kind = .id_ref, .quantifier = .required },
11931 .{ .kind = .id_ref, .quantifier = .required },
11932 .{ .kind = .id_ref, .quantifier = .required },
11933 .{ .kind = .id_ref, .quantifier = .required },
11934 .{ .kind = .id_ref, .quantifier = .required },
11935 },
11936 },
11937 .{
11938 .name = "OpTensorLayoutSetBlockSizeNV",
11939 .opcode = 5384,
11940 .operands = &.{
11941 .{ .kind = .id_result_type, .quantifier = .required },
11942 .{ .kind = .id_result, .quantifier = .required },
11943 .{ .kind = .id_ref, .quantifier = .required },
11944 .{ .kind = .id_ref, .quantifier = .variadic },
11945 },
11946 },
11947 .{
11948 .name = "OpCooperativeMatrixTransposeNV",
11949 .opcode = 5390,
11950 .operands = &.{
11951 .{ .kind = .id_result_type, .quantifier = .required },
11952 .{ .kind = .id_result, .quantifier = .required },
11953 .{ .kind = .id_ref, .quantifier = .required },
11954 },
11955 },
11956 .{
11957 .name = "OpConvertUToImageNV",
11958 .opcode = 5391,
11959 .operands = &.{
11960 .{ .kind = .id_result_type, .quantifier = .required },
11961 .{ .kind = .id_result, .quantifier = .required },
11962 .{ .kind = .id_ref, .quantifier = .required },
11963 },
11964 },
11965 .{
11966 .name = "OpConvertUToSamplerNV",
11967 .opcode = 5392,
11968 .operands = &.{
11969 .{ .kind = .id_result_type, .quantifier = .required },
11970 .{ .kind = .id_result, .quantifier = .required },
11971 .{ .kind = .id_ref, .quantifier = .required },
11972 },
11973 },
11974 .{
11975 .name = "OpConvertImageToUNV",
11976 .opcode = 5393,
11977 .operands = &.{
11978 .{ .kind = .id_result_type, .quantifier = .required },
11979 .{ .kind = .id_result, .quantifier = .required },
11980 .{ .kind = .id_ref, .quantifier = .required },
11981 },
11982 },
11983 .{
11984 .name = "OpConvertSamplerToUNV",
11985 .opcode = 5394,
11986 .operands = &.{
11987 .{ .kind = .id_result_type, .quantifier = .required },
11988 .{ .kind = .id_result, .quantifier = .required },
11989 .{ .kind = .id_ref, .quantifier = .required },
11990 },
11991 },
11992 .{
11993 .name = "OpConvertUToSampledImageNV",
11994 .opcode = 5395,
11995 .operands = &.{
11996 .{ .kind = .id_result_type, .quantifier = .required },
11997 .{ .kind = .id_result, .quantifier = .required },
11998 .{ .kind = .id_ref, .quantifier = .required },
11999 },
12000 },
12001 .{
12002 .name = "OpConvertSampledImageToUNV",
12003 .opcode = 5396,
12004 .operands = &.{
12005 .{ .kind = .id_result_type, .quantifier = .required },
12006 .{ .kind = .id_result, .quantifier = .required },
12007 .{ .kind = .id_ref, .quantifier = .required },
12008 },
12009 },
12010 .{
12011 .name = "OpSamplerImageAddressingModeNV",
12012 .opcode = 5397,
12013 .operands = &.{
12014 .{ .kind = .literal_integer, .quantifier = .required },
12015 },
12016 },
12017 .{
12018 .name = "OpRawAccessChainNV",
12019 .opcode = 5398,
12020 .operands = &.{
12021 .{ .kind = .id_result_type, .quantifier = .required },
12022 .{ .kind = .id_result, .quantifier = .required },
12023 .{ .kind = .id_ref, .quantifier = .required },
12024 .{ .kind = .id_ref, .quantifier = .required },
12025 .{ .kind = .id_ref, .quantifier = .required },
12026 .{ .kind = .id_ref, .quantifier = .required },
12027 .{ .kind = .raw_access_chain_operands, .quantifier = .optional },
12028 },
12029 },
12030 .{
12031 .name = "OpRayQueryGetIntersectionSpherePositionNV",
12032 .opcode = 5427,
12033 .operands = &.{
12034 .{ .kind = .id_result_type, .quantifier = .required },
12035 .{ .kind = .id_result, .quantifier = .required },
12036 .{ .kind = .id_ref, .quantifier = .required },
12037 .{ .kind = .id_ref, .quantifier = .required },
12038 },
12039 },
12040 .{
12041 .name = "OpRayQueryGetIntersectionSphereRadiusNV",
12042 .opcode = 5428,
12043 .operands = &.{
12044 .{ .kind = .id_result_type, .quantifier = .required },
12045 .{ .kind = .id_result, .quantifier = .required },
12046 .{ .kind = .id_ref, .quantifier = .required },
12047 .{ .kind = .id_ref, .quantifier = .required },
12048 },
12049 },
12050 .{
12051 .name = "OpRayQueryGetIntersectionLSSPositionsNV",
12052 .opcode = 5429,
12053 .operands = &.{
12054 .{ .kind = .id_result_type, .quantifier = .required },
12055 .{ .kind = .id_result, .quantifier = .required },
12056 .{ .kind = .id_ref, .quantifier = .required },
12057 .{ .kind = .id_ref, .quantifier = .required },
12058 },
12059 },
12060 .{
12061 .name = "OpRayQueryGetIntersectionLSSRadiiNV",
12062 .opcode = 5430,
12063 .operands = &.{
12064 .{ .kind = .id_result_type, .quantifier = .required },
12065 .{ .kind = .id_result, .quantifier = .required },
12066 .{ .kind = .id_ref, .quantifier = .required },
12067 .{ .kind = .id_ref, .quantifier = .required },
12068 },
12069 },
12070 .{
12071 .name = "OpRayQueryGetIntersectionLSSHitValueNV",
12072 .opcode = 5431,
12073 .operands = &.{
12074 .{ .kind = .id_result_type, .quantifier = .required },
12075 .{ .kind = .id_result, .quantifier = .required },
12076 .{ .kind = .id_ref, .quantifier = .required },
12077 .{ .kind = .id_ref, .quantifier = .required },
12078 },
12079 },
12080 .{
12081 .name = "OpHitObjectGetSpherePositionNV",
12082 .opcode = 5432,
12083 .operands = &.{
12084 .{ .kind = .id_result_type, .quantifier = .required },
12085 .{ .kind = .id_result, .quantifier = .required },
12086 .{ .kind = .id_ref, .quantifier = .required },
12087 },
12088 },
12089 .{
12090 .name = "OpHitObjectGetSphereRadiusNV",
12091 .opcode = 5433,
12092 .operands = &.{
12093 .{ .kind = .id_result_type, .quantifier = .required },
12094 .{ .kind = .id_result, .quantifier = .required },
12095 .{ .kind = .id_ref, .quantifier = .required },
12096 },
12097 },
12098 .{
12099 .name = "OpHitObjectGetLSSPositionsNV",
12100 .opcode = 5434,
12101 .operands = &.{
12102 .{ .kind = .id_result_type, .quantifier = .required },
12103 .{ .kind = .id_result, .quantifier = .required },
12104 .{ .kind = .id_ref, .quantifier = .required },
12105 },
12106 },
12107 .{
12108 .name = "OpHitObjectGetLSSRadiiNV",
12109 .opcode = 5435,
12110 .operands = &.{
12111 .{ .kind = .id_result_type, .quantifier = .required },
12112 .{ .kind = .id_result, .quantifier = .required },
12113 .{ .kind = .id_ref, .quantifier = .required },
12114 },
12115 },
12116 .{
12117 .name = "OpHitObjectIsSphereHitNV",
12118 .opcode = 5436,
12119 .operands = &.{
12120 .{ .kind = .id_result_type, .quantifier = .required },
12121 .{ .kind = .id_result, .quantifier = .required },
12122 .{ .kind = .id_ref, .quantifier = .required },
12123 },
12124 },
12125 .{
12126 .name = "OpHitObjectIsLSSHitNV",
12127 .opcode = 5437,
12128 .operands = &.{
12129 .{ .kind = .id_result_type, .quantifier = .required },
12130 .{ .kind = .id_result, .quantifier = .required },
12131 .{ .kind = .id_ref, .quantifier = .required },
12132 },
12133 },
12134 .{
12135 .name = "OpRayQueryIsSphereHitNV",
12136 .opcode = 5438,
12137 .operands = &.{
12138 .{ .kind = .id_result_type, .quantifier = .required },
12139 .{ .kind = .id_result, .quantifier = .required },
12140 .{ .kind = .id_ref, .quantifier = .required },
12141 .{ .kind = .id_ref, .quantifier = .required },
12142 },
12143 },
12144 .{
12145 .name = "OpRayQueryIsLSSHitNV",
12146 .opcode = 5439,
12147 .operands = &.{
12148 .{ .kind = .id_result_type, .quantifier = .required },
12149 .{ .kind = .id_result, .quantifier = .required },
12150 .{ .kind = .id_ref, .quantifier = .required },
12151 .{ .kind = .id_ref, .quantifier = .required },
12152 },
12153 },
12154 .{
12155 .name = "OpSubgroupShuffleINTEL",
12156 .opcode = 5571,
12157 .operands = &.{
12158 .{ .kind = .id_result_type, .quantifier = .required },
12159 .{ .kind = .id_result, .quantifier = .required },
12160 .{ .kind = .id_ref, .quantifier = .required },
12161 .{ .kind = .id_ref, .quantifier = .required },
12162 },
12163 },
12164 .{
12165 .name = "OpSubgroupShuffleDownINTEL",
12166 .opcode = 5572,
12167 .operands = &.{
12168 .{ .kind = .id_result_type, .quantifier = .required },
12169 .{ .kind = .id_result, .quantifier = .required },
12170 .{ .kind = .id_ref, .quantifier = .required },
12171 .{ .kind = .id_ref, .quantifier = .required },
12172 .{ .kind = .id_ref, .quantifier = .required },
12173 },
12174 },
12175 .{
12176 .name = "OpSubgroupShuffleUpINTEL",
12177 .opcode = 5573,
12178 .operands = &.{
12179 .{ .kind = .id_result_type, .quantifier = .required },
12180 .{ .kind = .id_result, .quantifier = .required },
12181 .{ .kind = .id_ref, .quantifier = .required },
12182 .{ .kind = .id_ref, .quantifier = .required },
12183 .{ .kind = .id_ref, .quantifier = .required },
12184 },
12185 },
12186 .{
12187 .name = "OpSubgroupShuffleXorINTEL",
12188 .opcode = 5574,
12189 .operands = &.{
12190 .{ .kind = .id_result_type, .quantifier = .required },
12191 .{ .kind = .id_result, .quantifier = .required },
12192 .{ .kind = .id_ref, .quantifier = .required },
12193 .{ .kind = .id_ref, .quantifier = .required },
12194 },
12195 },
12196 .{
12197 .name = "OpSubgroupBlockReadINTEL",
12198 .opcode = 5575,
12199 .operands = &.{
12200 .{ .kind = .id_result_type, .quantifier = .required },
12201 .{ .kind = .id_result, .quantifier = .required },
12202 .{ .kind = .id_ref, .quantifier = .required },
12203 },
12204 },
12205 .{
12206 .name = "OpSubgroupBlockWriteINTEL",
12207 .opcode = 5576,
12208 .operands = &.{
12209 .{ .kind = .id_ref, .quantifier = .required },
12210 .{ .kind = .id_ref, .quantifier = .required },
12211 },
12212 },
12213 .{
12214 .name = "OpSubgroupImageBlockReadINTEL",
12215 .opcode = 5577,
12216 .operands = &.{
12217 .{ .kind = .id_result_type, .quantifier = .required },
12218 .{ .kind = .id_result, .quantifier = .required },
12219 .{ .kind = .id_ref, .quantifier = .required },
12220 .{ .kind = .id_ref, .quantifier = .required },
12221 },
12222 },
12223 .{
12224 .name = "OpSubgroupImageBlockWriteINTEL",
12225 .opcode = 5578,
12226 .operands = &.{
12227 .{ .kind = .id_ref, .quantifier = .required },
12228 .{ .kind = .id_ref, .quantifier = .required },
12229 .{ .kind = .id_ref, .quantifier = .required },
12230 },
12231 },
12232 .{
12233 .name = "OpSubgroupImageMediaBlockReadINTEL",
12234 .opcode = 5580,
12235 .operands = &.{
12236 .{ .kind = .id_result_type, .quantifier = .required },
12237 .{ .kind = .id_result, .quantifier = .required },
12238 .{ .kind = .id_ref, .quantifier = .required },
12239 .{ .kind = .id_ref, .quantifier = .required },
12240 .{ .kind = .id_ref, .quantifier = .required },
12241 .{ .kind = .id_ref, .quantifier = .required },
12242 },
12243 },
12244 .{
12245 .name = "OpSubgroupImageMediaBlockWriteINTEL",
12246 .opcode = 5581,
12247 .operands = &.{
12248 .{ .kind = .id_ref, .quantifier = .required },
12249 .{ .kind = .id_ref, .quantifier = .required },
12250 .{ .kind = .id_ref, .quantifier = .required },
12251 .{ .kind = .id_ref, .quantifier = .required },
12252 .{ .kind = .id_ref, .quantifier = .required },
12253 },
12254 },
12255 .{
12256 .name = "OpUCountLeadingZerosINTEL",
12257 .opcode = 5585,
12258 .operands = &.{
12259 .{ .kind = .id_result_type, .quantifier = .required },
12260 .{ .kind = .id_result, .quantifier = .required },
12261 .{ .kind = .id_ref, .quantifier = .required },
12262 },
12263 },
12264 .{
12265 .name = "OpUCountTrailingZerosINTEL",
12266 .opcode = 5586,
12267 .operands = &.{
12268 .{ .kind = .id_result_type, .quantifier = .required },
12269 .{ .kind = .id_result, .quantifier = .required },
12270 .{ .kind = .id_ref, .quantifier = .required },
12271 },
12272 },
12273 .{
12274 .name = "OpAbsISubINTEL",
12275 .opcode = 5587,
12276 .operands = &.{
12277 .{ .kind = .id_result_type, .quantifier = .required },
12278 .{ .kind = .id_result, .quantifier = .required },
12279 .{ .kind = .id_ref, .quantifier = .required },
12280 .{ .kind = .id_ref, .quantifier = .required },
12281 },
12282 },
12283 .{
12284 .name = "OpAbsUSubINTEL",
12285 .opcode = 5588,
12286 .operands = &.{
12287 .{ .kind = .id_result_type, .quantifier = .required },
12288 .{ .kind = .id_result, .quantifier = .required },
12289 .{ .kind = .id_ref, .quantifier = .required },
12290 .{ .kind = .id_ref, .quantifier = .required },
12291 },
12292 },
12293 .{
12294 .name = "OpIAddSatINTEL",
12295 .opcode = 5589,
12296 .operands = &.{
12297 .{ .kind = .id_result_type, .quantifier = .required },
12298 .{ .kind = .id_result, .quantifier = .required },
12299 .{ .kind = .id_ref, .quantifier = .required },
12300 .{ .kind = .id_ref, .quantifier = .required },
12301 },
12302 },
12303 .{
12304 .name = "OpUAddSatINTEL",
12305 .opcode = 5590,
12306 .operands = &.{
12307 .{ .kind = .id_result_type, .quantifier = .required },
12308 .{ .kind = .id_result, .quantifier = .required },
12309 .{ .kind = .id_ref, .quantifier = .required },
12310 .{ .kind = .id_ref, .quantifier = .required },
12311 },
12312 },
12313 .{
12314 .name = "OpIAverageINTEL",
12315 .opcode = 5591,
12316 .operands = &.{
12317 .{ .kind = .id_result_type, .quantifier = .required },
12318 .{ .kind = .id_result, .quantifier = .required },
12319 .{ .kind = .id_ref, .quantifier = .required },
12320 .{ .kind = .id_ref, .quantifier = .required },
12321 },
12322 },
12323 .{
12324 .name = "OpUAverageINTEL",
12325 .opcode = 5592,
12326 .operands = &.{
12327 .{ .kind = .id_result_type, .quantifier = .required },
12328 .{ .kind = .id_result, .quantifier = .required },
12329 .{ .kind = .id_ref, .quantifier = .required },
12330 .{ .kind = .id_ref, .quantifier = .required },
12331 },
12332 },
12333 .{
12334 .name = "OpIAverageRoundedINTEL",
12335 .opcode = 5593,
12336 .operands = &.{
12337 .{ .kind = .id_result_type, .quantifier = .required },
12338 .{ .kind = .id_result, .quantifier = .required },
12339 .{ .kind = .id_ref, .quantifier = .required },
12340 .{ .kind = .id_ref, .quantifier = .required },
12341 },
12342 },
12343 .{
12344 .name = "OpUAverageRoundedINTEL",
12345 .opcode = 5594,
12346 .operands = &.{
12347 .{ .kind = .id_result_type, .quantifier = .required },
12348 .{ .kind = .id_result, .quantifier = .required },
12349 .{ .kind = .id_ref, .quantifier = .required },
12350 .{ .kind = .id_ref, .quantifier = .required },
12351 },
12352 },
12353 .{
12354 .name = "OpISubSatINTEL",
12355 .opcode = 5595,
12356 .operands = &.{
12357 .{ .kind = .id_result_type, .quantifier = .required },
12358 .{ .kind = .id_result, .quantifier = .required },
12359 .{ .kind = .id_ref, .quantifier = .required },
12360 .{ .kind = .id_ref, .quantifier = .required },
12361 },
12362 },
12363 .{
12364 .name = "OpUSubSatINTEL",
12365 .opcode = 5596,
12366 .operands = &.{
12367 .{ .kind = .id_result_type, .quantifier = .required },
12368 .{ .kind = .id_result, .quantifier = .required },
12369 .{ .kind = .id_ref, .quantifier = .required },
12370 .{ .kind = .id_ref, .quantifier = .required },
12371 },
12372 },
12373 .{
12374 .name = "OpIMul32x16INTEL",
12375 .opcode = 5597,
12376 .operands = &.{
12377 .{ .kind = .id_result_type, .quantifier = .required },
12378 .{ .kind = .id_result, .quantifier = .required },
12379 .{ .kind = .id_ref, .quantifier = .required },
12380 .{ .kind = .id_ref, .quantifier = .required },
12381 },
12382 },
12383 .{
12384 .name = "OpUMul32x16INTEL",
12385 .opcode = 5598,
12386 .operands = &.{
12387 .{ .kind = .id_result_type, .quantifier = .required },
12388 .{ .kind = .id_result, .quantifier = .required },
12389 .{ .kind = .id_ref, .quantifier = .required },
12390 .{ .kind = .id_ref, .quantifier = .required },
12391 },
12392 },
12393 .{
12394 .name = "OpConstantFunctionPointerINTEL",
12395 .opcode = 5600,
12396 .operands = &.{
12397 .{ .kind = .id_result_type, .quantifier = .required },
12398 .{ .kind = .id_result, .quantifier = .required },
12399 .{ .kind = .id_ref, .quantifier = .required },
12400 },
12401 },
12402 .{
12403 .name = "OpFunctionPointerCallINTEL",
12404 .opcode = 5601,
12405 .operands = &.{
12406 .{ .kind = .id_result_type, .quantifier = .required },
12407 .{ .kind = .id_result, .quantifier = .required },
12408 .{ .kind = .id_ref, .quantifier = .variadic },
12409 },
12410 },
12411 .{
12412 .name = "OpAsmTargetINTEL",
12413 .opcode = 5609,
12414 .operands = &.{
12415 .{ .kind = .id_result, .quantifier = .required },
12416 .{ .kind = .literal_string, .quantifier = .required },
12417 },
12418 },
12419 .{
12420 .name = "OpAsmINTEL",
12421 .opcode = 5610,
12422 .operands = &.{
12423 .{ .kind = .id_result_type, .quantifier = .required },
12424 .{ .kind = .id_result, .quantifier = .required },
12425 .{ .kind = .id_ref, .quantifier = .required },
12426 .{ .kind = .id_ref, .quantifier = .required },
12427 .{ .kind = .literal_string, .quantifier = .required },
12428 .{ .kind = .literal_string, .quantifier = .required },
12429 },
12430 },
12431 .{
12432 .name = "OpAsmCallINTEL",
12433 .opcode = 5611,
12434 .operands = &.{
12435 .{ .kind = .id_result_type, .quantifier = .required },
12436 .{ .kind = .id_result, .quantifier = .required },
12437 .{ .kind = .id_ref, .quantifier = .required },
12438 .{ .kind = .id_ref, .quantifier = .variadic },
12439 },
12440 },
12441 .{
12442 .name = "OpAtomicFMinEXT",
12443 .opcode = 5614,
12444 .operands = &.{
12445 .{ .kind = .id_result_type, .quantifier = .required },
12446 .{ .kind = .id_result, .quantifier = .required },
12447 .{ .kind = .id_ref, .quantifier = .required },
12448 .{ .kind = .id_scope, .quantifier = .required },
12449 .{ .kind = .id_memory_semantics, .quantifier = .required },
12450 .{ .kind = .id_ref, .quantifier = .required },
12451 },
12452 },
12453 .{
12454 .name = "OpAtomicFMaxEXT",
12455 .opcode = 5615,
12456 .operands = &.{
12457 .{ .kind = .id_result_type, .quantifier = .required },
12458 .{ .kind = .id_result, .quantifier = .required },
12459 .{ .kind = .id_ref, .quantifier = .required },
12460 .{ .kind = .id_scope, .quantifier = .required },
12461 .{ .kind = .id_memory_semantics, .quantifier = .required },
12462 .{ .kind = .id_ref, .quantifier = .required },
12463 },
12464 },
12465 .{
12466 .name = "OpAssumeTrueKHR",
12467 .opcode = 5630,
12468 .operands = &.{
12469 .{ .kind = .id_ref, .quantifier = .required },
12470 },
12471 },
12472 .{
12473 .name = "OpExpectKHR",
12474 .opcode = 5631,
12475 .operands = &.{
12476 .{ .kind = .id_result_type, .quantifier = .required },
12477 .{ .kind = .id_result, .quantifier = .required },
12478 .{ .kind = .id_ref, .quantifier = .required },
12479 .{ .kind = .id_ref, .quantifier = .required },
12480 },
12481 },
12482 .{
12483 .name = "OpDecorateString",
12484 .opcode = 5632,
12485 .operands = &.{
12486 .{ .kind = .id_ref, .quantifier = .required },
12487 .{ .kind = .decoration, .quantifier = .required },
12488 },
12489 },
12490 .{
12491 .name = "OpMemberDecorateString",
12492 .opcode = 5633,
12493 .operands = &.{
12494 .{ .kind = .id_ref, .quantifier = .required },
12495 .{ .kind = .literal_integer, .quantifier = .required },
12496 .{ .kind = .decoration, .quantifier = .required },
12497 },
12498 },
12499 .{
12500 .name = "OpVmeImageINTEL",
12501 .opcode = 5699,
12502 .operands = &.{
12503 .{ .kind = .id_result_type, .quantifier = .required },
12504 .{ .kind = .id_result, .quantifier = .required },
12505 .{ .kind = .id_ref, .quantifier = .required },
12506 .{ .kind = .id_ref, .quantifier = .required },
12507 },
12508 },
12509 .{
12510 .name = "OpTypeVmeImageINTEL",
12511 .opcode = 5700,
12512 .operands = &.{
12513 .{ .kind = .id_result, .quantifier = .required },
12514 .{ .kind = .id_ref, .quantifier = .required },
12515 },
12516 },
12517 .{
12518 .name = "OpTypeAvcImePayloadINTEL",
12519 .opcode = 5701,
12520 .operands = &.{
12521 .{ .kind = .id_result, .quantifier = .required },
12522 },
12523 },
12524 .{
12525 .name = "OpTypeAvcRefPayloadINTEL",
12526 .opcode = 5702,
12527 .operands = &.{
12528 .{ .kind = .id_result, .quantifier = .required },
12529 },
12530 },
12531 .{
12532 .name = "OpTypeAvcSicPayloadINTEL",
12533 .opcode = 5703,
12534 .operands = &.{
12535 .{ .kind = .id_result, .quantifier = .required },
12536 },
12537 },
12538 .{
12539 .name = "OpTypeAvcMcePayloadINTEL",
12540 .opcode = 5704,
12541 .operands = &.{
12542 .{ .kind = .id_result, .quantifier = .required },
12543 },
12544 },
12545 .{
12546 .name = "OpTypeAvcMceResultINTEL",
12547 .opcode = 5705,
12548 .operands = &.{
12549 .{ .kind = .id_result, .quantifier = .required },
12550 },
12551 },
12552 .{
12553 .name = "OpTypeAvcImeResultINTEL",
12554 .opcode = 5706,
12555 .operands = &.{
12556 .{ .kind = .id_result, .quantifier = .required },
12557 },
12558 },
12559 .{
12560 .name = "OpTypeAvcImeResultSingleReferenceStreamoutINTEL",
12561 .opcode = 5707,
12562 .operands = &.{
12563 .{ .kind = .id_result, .quantifier = .required },
12564 },
12565 },
12566 .{
12567 .name = "OpTypeAvcImeResultDualReferenceStreamoutINTEL",
12568 .opcode = 5708,
12569 .operands = &.{
12570 .{ .kind = .id_result, .quantifier = .required },
12571 },
12572 },
12573 .{
12574 .name = "OpTypeAvcImeSingleReferenceStreaminINTEL",
12575 .opcode = 5709,
12576 .operands = &.{
12577 .{ .kind = .id_result, .quantifier = .required },
12578 },
12579 },
12580 .{
12581 .name = "OpTypeAvcImeDualReferenceStreaminINTEL",
12582 .opcode = 5710,
12583 .operands = &.{
12584 .{ .kind = .id_result, .quantifier = .required },
12585 },
12586 },
12587 .{
12588 .name = "OpTypeAvcRefResultINTEL",
12589 .opcode = 5711,
12590 .operands = &.{
12591 .{ .kind = .id_result, .quantifier = .required },
12592 },
12593 },
12594 .{
12595 .name = "OpTypeAvcSicResultINTEL",
12596 .opcode = 5712,
12597 .operands = &.{
12598 .{ .kind = .id_result, .quantifier = .required },
12599 },
12600 },
12601 .{
12602 .name = "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL",
12603 .opcode = 5713,
12604 .operands = &.{
12605 .{ .kind = .id_result_type, .quantifier = .required },
12606 .{ .kind = .id_result, .quantifier = .required },
12607 .{ .kind = .id_ref, .quantifier = .required },
12608 .{ .kind = .id_ref, .quantifier = .required },
12609 },
12610 },
12611 .{
12612 .name = "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL",
12613 .opcode = 5714,
12614 .operands = &.{
12615 .{ .kind = .id_result_type, .quantifier = .required },
12616 .{ .kind = .id_result, .quantifier = .required },
12617 .{ .kind = .id_ref, .quantifier = .required },
12618 .{ .kind = .id_ref, .quantifier = .required },
12619 },
12620 },
12621 .{
12622 .name = "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL",
12623 .opcode = 5715,
12624 .operands = &.{
12625 .{ .kind = .id_result_type, .quantifier = .required },
12626 .{ .kind = .id_result, .quantifier = .required },
12627 .{ .kind = .id_ref, .quantifier = .required },
12628 .{ .kind = .id_ref, .quantifier = .required },
12629 },
12630 },
12631 .{
12632 .name = "OpSubgroupAvcMceSetInterShapePenaltyINTEL",
12633 .opcode = 5716,
12634 .operands = &.{
12635 .{ .kind = .id_result_type, .quantifier = .required },
12636 .{ .kind = .id_result, .quantifier = .required },
12637 .{ .kind = .id_ref, .quantifier = .required },
12638 .{ .kind = .id_ref, .quantifier = .required },
12639 },
12640 },
12641 .{
12642 .name = "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL",
12643 .opcode = 5717,
12644 .operands = &.{
12645 .{ .kind = .id_result_type, .quantifier = .required },
12646 .{ .kind = .id_result, .quantifier = .required },
12647 .{ .kind = .id_ref, .quantifier = .required },
12648 .{ .kind = .id_ref, .quantifier = .required },
12649 },
12650 },
12651 .{
12652 .name = "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL",
12653 .opcode = 5718,
12654 .operands = &.{
12655 .{ .kind = .id_result_type, .quantifier = .required },
12656 .{ .kind = .id_result, .quantifier = .required },
12657 .{ .kind = .id_ref, .quantifier = .required },
12658 .{ .kind = .id_ref, .quantifier = .required },
12659 },
12660 },
12661 .{
12662 .name = "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL",
12663 .opcode = 5719,
12664 .operands = &.{
12665 .{ .kind = .id_result_type, .quantifier = .required },
12666 .{ .kind = .id_result, .quantifier = .required },
12667 .{ .kind = .id_ref, .quantifier = .required },
12668 .{ .kind = .id_ref, .quantifier = .required },
12669 },
12670 },
12671 .{
12672 .name = "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL",
12673 .opcode = 5720,
12674 .operands = &.{
12675 .{ .kind = .id_result_type, .quantifier = .required },
12676 .{ .kind = .id_result, .quantifier = .required },
12677 .{ .kind = .id_ref, .quantifier = .required },
12678 .{ .kind = .id_ref, .quantifier = .required },
12679 },
12680 },
12681 .{
12682 .name = "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL",
12683 .opcode = 5721,
12684 .operands = &.{
12685 .{ .kind = .id_result_type, .quantifier = .required },
12686 .{ .kind = .id_result, .quantifier = .required },
12687 },
12688 },
12689 .{
12690 .name = "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL",
12691 .opcode = 5722,
12692 .operands = &.{
12693 .{ .kind = .id_result_type, .quantifier = .required },
12694 .{ .kind = .id_result, .quantifier = .required },
12695 },
12696 },
12697 .{
12698 .name = "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL",
12699 .opcode = 5723,
12700 .operands = &.{
12701 .{ .kind = .id_result_type, .quantifier = .required },
12702 .{ .kind = .id_result, .quantifier = .required },
12703 },
12704 },
12705 .{
12706 .name = "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL",
12707 .opcode = 5724,
12708 .operands = &.{
12709 .{ .kind = .id_result_type, .quantifier = .required },
12710 .{ .kind = .id_result, .quantifier = .required },
12711 .{ .kind = .id_ref, .quantifier = .required },
12712 .{ .kind = .id_ref, .quantifier = .required },
12713 .{ .kind = .id_ref, .quantifier = .required },
12714 .{ .kind = .id_ref, .quantifier = .required },
12715 },
12716 },
12717 .{
12718 .name = "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL",
12719 .opcode = 5725,
12720 .operands = &.{
12721 .{ .kind = .id_result_type, .quantifier = .required },
12722 .{ .kind = .id_result, .quantifier = .required },
12723 .{ .kind = .id_ref, .quantifier = .required },
12724 .{ .kind = .id_ref, .quantifier = .required },
12725 },
12726 },
12727 .{
12728 .name = "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL",
12729 .opcode = 5726,
12730 .operands = &.{
12731 .{ .kind = .id_result_type, .quantifier = .required },
12732 .{ .kind = .id_result, .quantifier = .required },
12733 },
12734 },
12735 .{
12736 .name = "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL",
12737 .opcode = 5727,
12738 .operands = &.{
12739 .{ .kind = .id_result_type, .quantifier = .required },
12740 .{ .kind = .id_result, .quantifier = .required },
12741 },
12742 },
12743 .{
12744 .name = "OpSubgroupAvcMceSetAcOnlyHaarINTEL",
12745 .opcode = 5728,
12746 .operands = &.{
12747 .{ .kind = .id_result_type, .quantifier = .required },
12748 .{ .kind = .id_result, .quantifier = .required },
12749 .{ .kind = .id_ref, .quantifier = .required },
12750 },
12751 },
12752 .{
12753 .name = "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL",
12754 .opcode = 5729,
12755 .operands = &.{
12756 .{ .kind = .id_result_type, .quantifier = .required },
12757 .{ .kind = .id_result, .quantifier = .required },
12758 .{ .kind = .id_ref, .quantifier = .required },
12759 .{ .kind = .id_ref, .quantifier = .required },
12760 },
12761 },
12762 .{
12763 .name = "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL",
12764 .opcode = 5730,
12765 .operands = &.{
12766 .{ .kind = .id_result_type, .quantifier = .required },
12767 .{ .kind = .id_result, .quantifier = .required },
12768 .{ .kind = .id_ref, .quantifier = .required },
12769 .{ .kind = .id_ref, .quantifier = .required },
12770 },
12771 },
12772 .{
12773 .name = "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL",
12774 .opcode = 5731,
12775 .operands = &.{
12776 .{ .kind = .id_result_type, .quantifier = .required },
12777 .{ .kind = .id_result, .quantifier = .required },
12778 .{ .kind = .id_ref, .quantifier = .required },
12779 .{ .kind = .id_ref, .quantifier = .required },
12780 .{ .kind = .id_ref, .quantifier = .required },
12781 },
12782 },
12783 .{
12784 .name = "OpSubgroupAvcMceConvertToImePayloadINTEL",
12785 .opcode = 5732,
12786 .operands = &.{
12787 .{ .kind = .id_result_type, .quantifier = .required },
12788 .{ .kind = .id_result, .quantifier = .required },
12789 .{ .kind = .id_ref, .quantifier = .required },
12790 },
12791 },
12792 .{
12793 .name = "OpSubgroupAvcMceConvertToImeResultINTEL",
12794 .opcode = 5733,
12795 .operands = &.{
12796 .{ .kind = .id_result_type, .quantifier = .required },
12797 .{ .kind = .id_result, .quantifier = .required },
12798 .{ .kind = .id_ref, .quantifier = .required },
12799 },
12800 },
12801 .{
12802 .name = "OpSubgroupAvcMceConvertToRefPayloadINTEL",
12803 .opcode = 5734,
12804 .operands = &.{
12805 .{ .kind = .id_result_type, .quantifier = .required },
12806 .{ .kind = .id_result, .quantifier = .required },
12807 .{ .kind = .id_ref, .quantifier = .required },
12808 },
12809 },
12810 .{
12811 .name = "OpSubgroupAvcMceConvertToRefResultINTEL",
12812 .opcode = 5735,
12813 .operands = &.{
12814 .{ .kind = .id_result_type, .quantifier = .required },
12815 .{ .kind = .id_result, .quantifier = .required },
12816 .{ .kind = .id_ref, .quantifier = .required },
12817 },
12818 },
12819 .{
12820 .name = "OpSubgroupAvcMceConvertToSicPayloadINTEL",
12821 .opcode = 5736,
12822 .operands = &.{
12823 .{ .kind = .id_result_type, .quantifier = .required },
12824 .{ .kind = .id_result, .quantifier = .required },
12825 .{ .kind = .id_ref, .quantifier = .required },
12826 },
12827 },
12828 .{
12829 .name = "OpSubgroupAvcMceConvertToSicResultINTEL",
12830 .opcode = 5737,
12831 .operands = &.{
12832 .{ .kind = .id_result_type, .quantifier = .required },
12833 .{ .kind = .id_result, .quantifier = .required },
12834 .{ .kind = .id_ref, .quantifier = .required },
12835 },
12836 },
12837 .{
12838 .name = "OpSubgroupAvcMceGetMotionVectorsINTEL",
12839 .opcode = 5738,
12840 .operands = &.{
12841 .{ .kind = .id_result_type, .quantifier = .required },
12842 .{ .kind = .id_result, .quantifier = .required },
12843 .{ .kind = .id_ref, .quantifier = .required },
12844 },
12845 },
12846 .{
12847 .name = "OpSubgroupAvcMceGetInterDistortionsINTEL",
12848 .opcode = 5739,
12849 .operands = &.{
12850 .{ .kind = .id_result_type, .quantifier = .required },
12851 .{ .kind = .id_result, .quantifier = .required },
12852 .{ .kind = .id_ref, .quantifier = .required },
12853 },
12854 },
12855 .{
12856 .name = "OpSubgroupAvcMceGetBestInterDistortionsINTEL",
12857 .opcode = 5740,
12858 .operands = &.{
12859 .{ .kind = .id_result_type, .quantifier = .required },
12860 .{ .kind = .id_result, .quantifier = .required },
12861 .{ .kind = .id_ref, .quantifier = .required },
12862 },
12863 },
12864 .{
12865 .name = "OpSubgroupAvcMceGetInterMajorShapeINTEL",
12866 .opcode = 5741,
12867 .operands = &.{
12868 .{ .kind = .id_result_type, .quantifier = .required },
12869 .{ .kind = .id_result, .quantifier = .required },
12870 .{ .kind = .id_ref, .quantifier = .required },
12871 },
12872 },
12873 .{
12874 .name = "OpSubgroupAvcMceGetInterMinorShapeINTEL",
12875 .opcode = 5742,
12876 .operands = &.{
12877 .{ .kind = .id_result_type, .quantifier = .required },
12878 .{ .kind = .id_result, .quantifier = .required },
12879 .{ .kind = .id_ref, .quantifier = .required },
12880 },
12881 },
12882 .{
12883 .name = "OpSubgroupAvcMceGetInterDirectionsINTEL",
12884 .opcode = 5743,
12885 .operands = &.{
12886 .{ .kind = .id_result_type, .quantifier = .required },
12887 .{ .kind = .id_result, .quantifier = .required },
12888 .{ .kind = .id_ref, .quantifier = .required },
12889 },
12890 },
12891 .{
12892 .name = "OpSubgroupAvcMceGetInterMotionVectorCountINTEL",
12893 .opcode = 5744,
12894 .operands = &.{
12895 .{ .kind = .id_result_type, .quantifier = .required },
12896 .{ .kind = .id_result, .quantifier = .required },
12897 .{ .kind = .id_ref, .quantifier = .required },
12898 },
12899 },
12900 .{
12901 .name = "OpSubgroupAvcMceGetInterReferenceIdsINTEL",
12902 .opcode = 5745,
12903 .operands = &.{
12904 .{ .kind = .id_result_type, .quantifier = .required },
12905 .{ .kind = .id_result, .quantifier = .required },
12906 .{ .kind = .id_ref, .quantifier = .required },
12907 },
12908 },
12909 .{
12910 .name = "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL",
12911 .opcode = 5746,
12912 .operands = &.{
12913 .{ .kind = .id_result_type, .quantifier = .required },
12914 .{ .kind = .id_result, .quantifier = .required },
12915 .{ .kind = .id_ref, .quantifier = .required },
12916 .{ .kind = .id_ref, .quantifier = .required },
12917 .{ .kind = .id_ref, .quantifier = .required },
12918 },
12919 },
12920 .{
12921 .name = "OpSubgroupAvcImeInitializeINTEL",
12922 .opcode = 5747,
12923 .operands = &.{
12924 .{ .kind = .id_result_type, .quantifier = .required },
12925 .{ .kind = .id_result, .quantifier = .required },
12926 .{ .kind = .id_ref, .quantifier = .required },
12927 .{ .kind = .id_ref, .quantifier = .required },
12928 .{ .kind = .id_ref, .quantifier = .required },
12929 },
12930 },
12931 .{
12932 .name = "OpSubgroupAvcImeSetSingleReferenceINTEL",
12933 .opcode = 5748,
12934 .operands = &.{
12935 .{ .kind = .id_result_type, .quantifier = .required },
12936 .{ .kind = .id_result, .quantifier = .required },
12937 .{ .kind = .id_ref, .quantifier = .required },
12938 .{ .kind = .id_ref, .quantifier = .required },
12939 .{ .kind = .id_ref, .quantifier = .required },
12940 },
12941 },
12942 .{
12943 .name = "OpSubgroupAvcImeSetDualReferenceINTEL",
12944 .opcode = 5749,
12945 .operands = &.{
12946 .{ .kind = .id_result_type, .quantifier = .required },
12947 .{ .kind = .id_result, .quantifier = .required },
12948 .{ .kind = .id_ref, .quantifier = .required },
12949 .{ .kind = .id_ref, .quantifier = .required },
12950 .{ .kind = .id_ref, .quantifier = .required },
12951 .{ .kind = .id_ref, .quantifier = .required },
12952 },
12953 },
12954 .{
12955 .name = "OpSubgroupAvcImeRefWindowSizeINTEL",
12956 .opcode = 5750,
12957 .operands = &.{
12958 .{ .kind = .id_result_type, .quantifier = .required },
12959 .{ .kind = .id_result, .quantifier = .required },
12960 .{ .kind = .id_ref, .quantifier = .required },
12961 .{ .kind = .id_ref, .quantifier = .required },
12962 },
12963 },
12964 .{
12965 .name = "OpSubgroupAvcImeAdjustRefOffsetINTEL",
12966 .opcode = 5751,
12967 .operands = &.{
12968 .{ .kind = .id_result_type, .quantifier = .required },
12969 .{ .kind = .id_result, .quantifier = .required },
12970 .{ .kind = .id_ref, .quantifier = .required },
12971 .{ .kind = .id_ref, .quantifier = .required },
12972 .{ .kind = .id_ref, .quantifier = .required },
12973 .{ .kind = .id_ref, .quantifier = .required },
12974 },
12975 },
12976 .{
12977 .name = "OpSubgroupAvcImeConvertToMcePayloadINTEL",
12978 .opcode = 5752,
12979 .operands = &.{
12980 .{ .kind = .id_result_type, .quantifier = .required },
12981 .{ .kind = .id_result, .quantifier = .required },
12982 .{ .kind = .id_ref, .quantifier = .required },
12983 },
12984 },
12985 .{
12986 .name = "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL",
12987 .opcode = 5753,
12988 .operands = &.{
12989 .{ .kind = .id_result_type, .quantifier = .required },
12990 .{ .kind = .id_result, .quantifier = .required },
12991 .{ .kind = .id_ref, .quantifier = .required },
12992 .{ .kind = .id_ref, .quantifier = .required },
12993 },
12994 },
12995 .{
12996 .name = "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL",
12997 .opcode = 5754,
12998 .operands = &.{
12999 .{ .kind = .id_result_type, .quantifier = .required },
13000 .{ .kind = .id_result, .quantifier = .required },
13001 .{ .kind = .id_ref, .quantifier = .required },
13002 },
13003 },
13004 .{
13005 .name = "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL",
13006 .opcode = 5755,
13007 .operands = &.{
13008 .{ .kind = .id_result_type, .quantifier = .required },
13009 .{ .kind = .id_result, .quantifier = .required },
13010 .{ .kind = .id_ref, .quantifier = .required },
13011 .{ .kind = .id_ref, .quantifier = .required },
13012 },
13013 },
13014 .{
13015 .name = "OpSubgroupAvcImeSetWeightedSadINTEL",
13016 .opcode = 5756,
13017 .operands = &.{
13018 .{ .kind = .id_result_type, .quantifier = .required },
13019 .{ .kind = .id_result, .quantifier = .required },
13020 .{ .kind = .id_ref, .quantifier = .required },
13021 .{ .kind = .id_ref, .quantifier = .required },
13022 },
13023 },
13024 .{
13025 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL",
13026 .opcode = 5757,
13027 .operands = &.{
13028 .{ .kind = .id_result_type, .quantifier = .required },
13029 .{ .kind = .id_result, .quantifier = .required },
13030 .{ .kind = .id_ref, .quantifier = .required },
13031 .{ .kind = .id_ref, .quantifier = .required },
13032 .{ .kind = .id_ref, .quantifier = .required },
13033 },
13034 },
13035 .{
13036 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL",
13037 .opcode = 5758,
13038 .operands = &.{
13039 .{ .kind = .id_result_type, .quantifier = .required },
13040 .{ .kind = .id_result, .quantifier = .required },
13041 .{ .kind = .id_ref, .quantifier = .required },
13042 .{ .kind = .id_ref, .quantifier = .required },
13043 .{ .kind = .id_ref, .quantifier = .required },
13044 .{ .kind = .id_ref, .quantifier = .required },
13045 },
13046 },
13047 .{
13048 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL",
13049 .opcode = 5759,
13050 .operands = &.{
13051 .{ .kind = .id_result_type, .quantifier = .required },
13052 .{ .kind = .id_result, .quantifier = .required },
13053 .{ .kind = .id_ref, .quantifier = .required },
13054 .{ .kind = .id_ref, .quantifier = .required },
13055 .{ .kind = .id_ref, .quantifier = .required },
13056 .{ .kind = .id_ref, .quantifier = .required },
13057 },
13058 },
13059 .{
13060 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL",
13061 .opcode = 5760,
13062 .operands = &.{
13063 .{ .kind = .id_result_type, .quantifier = .required },
13064 .{ .kind = .id_result, .quantifier = .required },
13065 .{ .kind = .id_ref, .quantifier = .required },
13066 .{ .kind = .id_ref, .quantifier = .required },
13067 .{ .kind = .id_ref, .quantifier = .required },
13068 .{ .kind = .id_ref, .quantifier = .required },
13069 .{ .kind = .id_ref, .quantifier = .required },
13070 },
13071 },
13072 .{
13073 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL",
13074 .opcode = 5761,
13075 .operands = &.{
13076 .{ .kind = .id_result_type, .quantifier = .required },
13077 .{ .kind = .id_result, .quantifier = .required },
13078 .{ .kind = .id_ref, .quantifier = .required },
13079 .{ .kind = .id_ref, .quantifier = .required },
13080 .{ .kind = .id_ref, .quantifier = .required },
13081 },
13082 },
13083 .{
13084 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL",
13085 .opcode = 5762,
13086 .operands = &.{
13087 .{ .kind = .id_result_type, .quantifier = .required },
13088 .{ .kind = .id_result, .quantifier = .required },
13089 .{ .kind = .id_ref, .quantifier = .required },
13090 .{ .kind = .id_ref, .quantifier = .required },
13091 .{ .kind = .id_ref, .quantifier = .required },
13092 .{ .kind = .id_ref, .quantifier = .required },
13093 },
13094 },
13095 .{
13096 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL",
13097 .opcode = 5763,
13098 .operands = &.{
13099 .{ .kind = .id_result_type, .quantifier = .required },
13100 .{ .kind = .id_result, .quantifier = .required },
13101 .{ .kind = .id_ref, .quantifier = .required },
13102 .{ .kind = .id_ref, .quantifier = .required },
13103 .{ .kind = .id_ref, .quantifier = .required },
13104 .{ .kind = .id_ref, .quantifier = .required },
13105 },
13106 },
13107 .{
13108 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL",
13109 .opcode = 5764,
13110 .operands = &.{
13111 .{ .kind = .id_result_type, .quantifier = .required },
13112 .{ .kind = .id_result, .quantifier = .required },
13113 .{ .kind = .id_ref, .quantifier = .required },
13114 .{ .kind = .id_ref, .quantifier = .required },
13115 .{ .kind = .id_ref, .quantifier = .required },
13116 .{ .kind = .id_ref, .quantifier = .required },
13117 .{ .kind = .id_ref, .quantifier = .required },
13118 },
13119 },
13120 .{
13121 .name = "OpSubgroupAvcImeConvertToMceResultINTEL",
13122 .opcode = 5765,
13123 .operands = &.{
13124 .{ .kind = .id_result_type, .quantifier = .required },
13125 .{ .kind = .id_result, .quantifier = .required },
13126 .{ .kind = .id_ref, .quantifier = .required },
13127 },
13128 },
13129 .{
13130 .name = "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL",
13131 .opcode = 5766,
13132 .operands = &.{
13133 .{ .kind = .id_result_type, .quantifier = .required },
13134 .{ .kind = .id_result, .quantifier = .required },
13135 .{ .kind = .id_ref, .quantifier = .required },
13136 },
13137 },
13138 .{
13139 .name = "OpSubgroupAvcImeGetDualReferenceStreaminINTEL",
13140 .opcode = 5767,
13141 .operands = &.{
13142 .{ .kind = .id_result_type, .quantifier = .required },
13143 .{ .kind = .id_result, .quantifier = .required },
13144 .{ .kind = .id_ref, .quantifier = .required },
13145 },
13146 },
13147 .{
13148 .name = "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL",
13149 .opcode = 5768,
13150 .operands = &.{
13151 .{ .kind = .id_result_type, .quantifier = .required },
13152 .{ .kind = .id_result, .quantifier = .required },
13153 .{ .kind = .id_ref, .quantifier = .required },
13154 },
13155 },
13156 .{
13157 .name = "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL",
13158 .opcode = 5769,
13159 .operands = &.{
13160 .{ .kind = .id_result_type, .quantifier = .required },
13161 .{ .kind = .id_result, .quantifier = .required },
13162 .{ .kind = .id_ref, .quantifier = .required },
13163 },
13164 },
13165 .{
13166 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL",
13167 .opcode = 5770,
13168 .operands = &.{
13169 .{ .kind = .id_result_type, .quantifier = .required },
13170 .{ .kind = .id_result, .quantifier = .required },
13171 .{ .kind = .id_ref, .quantifier = .required },
13172 .{ .kind = .id_ref, .quantifier = .required },
13173 },
13174 },
13175 .{
13176 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL",
13177 .opcode = 5771,
13178 .operands = &.{
13179 .{ .kind = .id_result_type, .quantifier = .required },
13180 .{ .kind = .id_result, .quantifier = .required },
13181 .{ .kind = .id_ref, .quantifier = .required },
13182 .{ .kind = .id_ref, .quantifier = .required },
13183 },
13184 },
13185 .{
13186 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL",
13187 .opcode = 5772,
13188 .operands = &.{
13189 .{ .kind = .id_result_type, .quantifier = .required },
13190 .{ .kind = .id_result, .quantifier = .required },
13191 .{ .kind = .id_ref, .quantifier = .required },
13192 .{ .kind = .id_ref, .quantifier = .required },
13193 },
13194 },
13195 .{
13196 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL",
13197 .opcode = 5773,
13198 .operands = &.{
13199 .{ .kind = .id_result_type, .quantifier = .required },
13200 .{ .kind = .id_result, .quantifier = .required },
13201 .{ .kind = .id_ref, .quantifier = .required },
13202 .{ .kind = .id_ref, .quantifier = .required },
13203 .{ .kind = .id_ref, .quantifier = .required },
13204 },
13205 },
13206 .{
13207 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL",
13208 .opcode = 5774,
13209 .operands = &.{
13210 .{ .kind = .id_result_type, .quantifier = .required },
13211 .{ .kind = .id_result, .quantifier = .required },
13212 .{ .kind = .id_ref, .quantifier = .required },
13213 .{ .kind = .id_ref, .quantifier = .required },
13214 .{ .kind = .id_ref, .quantifier = .required },
13215 },
13216 },
13217 .{
13218 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL",
13219 .opcode = 5775,
13220 .operands = &.{
13221 .{ .kind = .id_result_type, .quantifier = .required },
13222 .{ .kind = .id_result, .quantifier = .required },
13223 .{ .kind = .id_ref, .quantifier = .required },
13224 .{ .kind = .id_ref, .quantifier = .required },
13225 .{ .kind = .id_ref, .quantifier = .required },
13226 },
13227 },
13228 .{
13229 .name = "OpSubgroupAvcImeGetBorderReachedINTEL",
13230 .opcode = 5776,
13231 .operands = &.{
13232 .{ .kind = .id_result_type, .quantifier = .required },
13233 .{ .kind = .id_result, .quantifier = .required },
13234 .{ .kind = .id_ref, .quantifier = .required },
13235 .{ .kind = .id_ref, .quantifier = .required },
13236 },
13237 },
13238 .{
13239 .name = "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL",
13240 .opcode = 5777,
13241 .operands = &.{
13242 .{ .kind = .id_result_type, .quantifier = .required },
13243 .{ .kind = .id_result, .quantifier = .required },
13244 .{ .kind = .id_ref, .quantifier = .required },
13245 },
13246 },
13247 .{
13248 .name = "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL",
13249 .opcode = 5778,
13250 .operands = &.{
13251 .{ .kind = .id_result_type, .quantifier = .required },
13252 .{ .kind = .id_result, .quantifier = .required },
13253 .{ .kind = .id_ref, .quantifier = .required },
13254 },
13255 },
13256 .{
13257 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL",
13258 .opcode = 5779,
13259 .operands = &.{
13260 .{ .kind = .id_result_type, .quantifier = .required },
13261 .{ .kind = .id_result, .quantifier = .required },
13262 .{ .kind = .id_ref, .quantifier = .required },
13263 },
13264 },
13265 .{
13266 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL",
13267 .opcode = 5780,
13268 .operands = &.{
13269 .{ .kind = .id_result_type, .quantifier = .required },
13270 .{ .kind = .id_result, .quantifier = .required },
13271 .{ .kind = .id_ref, .quantifier = .required },
13272 },
13273 },
13274 .{
13275 .name = "OpSubgroupAvcFmeInitializeINTEL",
13276 .opcode = 5781,
13277 .operands = &.{
13278 .{ .kind = .id_result_type, .quantifier = .required },
13279 .{ .kind = .id_result, .quantifier = .required },
13280 .{ .kind = .id_ref, .quantifier = .required },
13281 .{ .kind = .id_ref, .quantifier = .required },
13282 .{ .kind = .id_ref, .quantifier = .required },
13283 .{ .kind = .id_ref, .quantifier = .required },
13284 .{ .kind = .id_ref, .quantifier = .required },
13285 .{ .kind = .id_ref, .quantifier = .required },
13286 .{ .kind = .id_ref, .quantifier = .required },
13287 },
13288 },
13289 .{
13290 .name = "OpSubgroupAvcBmeInitializeINTEL",
13291 .opcode = 5782,
13292 .operands = &.{
13293 .{ .kind = .id_result_type, .quantifier = .required },
13294 .{ .kind = .id_result, .quantifier = .required },
13295 .{ .kind = .id_ref, .quantifier = .required },
13296 .{ .kind = .id_ref, .quantifier = .required },
13297 .{ .kind = .id_ref, .quantifier = .required },
13298 .{ .kind = .id_ref, .quantifier = .required },
13299 .{ .kind = .id_ref, .quantifier = .required },
13300 .{ .kind = .id_ref, .quantifier = .required },
13301 .{ .kind = .id_ref, .quantifier = .required },
13302 .{ .kind = .id_ref, .quantifier = .required },
13303 },
13304 },
13305 .{
13306 .name = "OpSubgroupAvcRefConvertToMcePayloadINTEL",
13307 .opcode = 5783,
13308 .operands = &.{
13309 .{ .kind = .id_result_type, .quantifier = .required },
13310 .{ .kind = .id_result, .quantifier = .required },
13311 .{ .kind = .id_ref, .quantifier = .required },
13312 },
13313 },
13314 .{
13315 .name = "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL",
13316 .opcode = 5784,
13317 .operands = &.{
13318 .{ .kind = .id_result_type, .quantifier = .required },
13319 .{ .kind = .id_result, .quantifier = .required },
13320 .{ .kind = .id_ref, .quantifier = .required },
13321 },
13322 },
13323 .{
13324 .name = "OpSubgroupAvcRefSetBilinearFilterEnableINTEL",
13325 .opcode = 5785,
13326 .operands = &.{
13327 .{ .kind = .id_result_type, .quantifier = .required },
13328 .{ .kind = .id_result, .quantifier = .required },
13329 .{ .kind = .id_ref, .quantifier = .required },
13330 },
13331 },
13332 .{
13333 .name = "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL",
13334 .opcode = 5786,
13335 .operands = &.{
13336 .{ .kind = .id_result_type, .quantifier = .required },
13337 .{ .kind = .id_result, .quantifier = .required },
13338 .{ .kind = .id_ref, .quantifier = .required },
13339 .{ .kind = .id_ref, .quantifier = .required },
13340 .{ .kind = .id_ref, .quantifier = .required },
13341 },
13342 },
13343 .{
13344 .name = "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL",
13345 .opcode = 5787,
13346 .operands = &.{
13347 .{ .kind = .id_result_type, .quantifier = .required },
13348 .{ .kind = .id_result, .quantifier = .required },
13349 .{ .kind = .id_ref, .quantifier = .required },
13350 .{ .kind = .id_ref, .quantifier = .required },
13351 .{ .kind = .id_ref, .quantifier = .required },
13352 .{ .kind = .id_ref, .quantifier = .required },
13353 },
13354 },
13355 .{
13356 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL",
13357 .opcode = 5788,
13358 .operands = &.{
13359 .{ .kind = .id_result_type, .quantifier = .required },
13360 .{ .kind = .id_result, .quantifier = .required },
13361 .{ .kind = .id_ref, .quantifier = .required },
13362 .{ .kind = .id_ref, .quantifier = .required },
13363 .{ .kind = .id_ref, .quantifier = .required },
13364 },
13365 },
13366 .{
13367 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL",
13368 .opcode = 5789,
13369 .operands = &.{
13370 .{ .kind = .id_result_type, .quantifier = .required },
13371 .{ .kind = .id_result, .quantifier = .required },
13372 .{ .kind = .id_ref, .quantifier = .required },
13373 .{ .kind = .id_ref, .quantifier = .required },
13374 .{ .kind = .id_ref, .quantifier = .required },
13375 .{ .kind = .id_ref, .quantifier = .required },
13376 },
13377 },
13378 .{
13379 .name = "OpSubgroupAvcRefConvertToMceResultINTEL",
13380 .opcode = 5790,
13381 .operands = &.{
13382 .{ .kind = .id_result_type, .quantifier = .required },
13383 .{ .kind = .id_result, .quantifier = .required },
13384 .{ .kind = .id_ref, .quantifier = .required },
13385 },
13386 },
13387 .{
13388 .name = "OpSubgroupAvcSicInitializeINTEL",
13389 .opcode = 5791,
13390 .operands = &.{
13391 .{ .kind = .id_result_type, .quantifier = .required },
13392 .{ .kind = .id_result, .quantifier = .required },
13393 .{ .kind = .id_ref, .quantifier = .required },
13394 },
13395 },
13396 .{
13397 .name = "OpSubgroupAvcSicConfigureSkcINTEL",
13398 .opcode = 5792,
13399 .operands = &.{
13400 .{ .kind = .id_result_type, .quantifier = .required },
13401 .{ .kind = .id_result, .quantifier = .required },
13402 .{ .kind = .id_ref, .quantifier = .required },
13403 .{ .kind = .id_ref, .quantifier = .required },
13404 .{ .kind = .id_ref, .quantifier = .required },
13405 .{ .kind = .id_ref, .quantifier = .required },
13406 .{ .kind = .id_ref, .quantifier = .required },
13407 .{ .kind = .id_ref, .quantifier = .required },
13408 },
13409 },
13410 .{
13411 .name = "OpSubgroupAvcSicConfigureIpeLumaINTEL",
13412 .opcode = 5793,
13413 .operands = &.{
13414 .{ .kind = .id_result_type, .quantifier = .required },
13415 .{ .kind = .id_result, .quantifier = .required },
13416 .{ .kind = .id_ref, .quantifier = .required },
13417 .{ .kind = .id_ref, .quantifier = .required },
13418 .{ .kind = .id_ref, .quantifier = .required },
13419 .{ .kind = .id_ref, .quantifier = .required },
13420 .{ .kind = .id_ref, .quantifier = .required },
13421 .{ .kind = .id_ref, .quantifier = .required },
13422 .{ .kind = .id_ref, .quantifier = .required },
13423 .{ .kind = .id_ref, .quantifier = .required },
13424 },
13425 },
13426 .{
13427 .name = "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL",
13428 .opcode = 5794,
13429 .operands = &.{
13430 .{ .kind = .id_result_type, .quantifier = .required },
13431 .{ .kind = .id_result, .quantifier = .required },
13432 .{ .kind = .id_ref, .quantifier = .required },
13433 .{ .kind = .id_ref, .quantifier = .required },
13434 .{ .kind = .id_ref, .quantifier = .required },
13435 .{ .kind = .id_ref, .quantifier = .required },
13436 .{ .kind = .id_ref, .quantifier = .required },
13437 .{ .kind = .id_ref, .quantifier = .required },
13438 .{ .kind = .id_ref, .quantifier = .required },
13439 .{ .kind = .id_ref, .quantifier = .required },
13440 .{ .kind = .id_ref, .quantifier = .required },
13441 .{ .kind = .id_ref, .quantifier = .required },
13442 .{ .kind = .id_ref, .quantifier = .required },
13443 },
13444 },
13445 .{
13446 .name = "OpSubgroupAvcSicGetMotionVectorMaskINTEL",
13447 .opcode = 5795,
13448 .operands = &.{
13449 .{ .kind = .id_result_type, .quantifier = .required },
13450 .{ .kind = .id_result, .quantifier = .required },
13451 .{ .kind = .id_ref, .quantifier = .required },
13452 .{ .kind = .id_ref, .quantifier = .required },
13453 },
13454 },
13455 .{
13456 .name = "OpSubgroupAvcSicConvertToMcePayloadINTEL",
13457 .opcode = 5796,
13458 .operands = &.{
13459 .{ .kind = .id_result_type, .quantifier = .required },
13460 .{ .kind = .id_result, .quantifier = .required },
13461 .{ .kind = .id_ref, .quantifier = .required },
13462 },
13463 },
13464 .{
13465 .name = "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL",
13466 .opcode = 5797,
13467 .operands = &.{
13468 .{ .kind = .id_result_type, .quantifier = .required },
13469 .{ .kind = .id_result, .quantifier = .required },
13470 .{ .kind = .id_ref, .quantifier = .required },
13471 .{ .kind = .id_ref, .quantifier = .required },
13472 },
13473 },
13474 .{
13475 .name = "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL",
13476 .opcode = 5798,
13477 .operands = &.{
13478 .{ .kind = .id_result_type, .quantifier = .required },
13479 .{ .kind = .id_result, .quantifier = .required },
13480 .{ .kind = .id_ref, .quantifier = .required },
13481 .{ .kind = .id_ref, .quantifier = .required },
13482 .{ .kind = .id_ref, .quantifier = .required },
13483 .{ .kind = .id_ref, .quantifier = .required },
13484 },
13485 },
13486 .{
13487 .name = "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL",
13488 .opcode = 5799,
13489 .operands = &.{
13490 .{ .kind = .id_result_type, .quantifier = .required },
13491 .{ .kind = .id_result, .quantifier = .required },
13492 .{ .kind = .id_ref, .quantifier = .required },
13493 .{ .kind = .id_ref, .quantifier = .required },
13494 },
13495 },
13496 .{
13497 .name = "OpSubgroupAvcSicSetBilinearFilterEnableINTEL",
13498 .opcode = 5800,
13499 .operands = &.{
13500 .{ .kind = .id_result_type, .quantifier = .required },
13501 .{ .kind = .id_result, .quantifier = .required },
13502 .{ .kind = .id_ref, .quantifier = .required },
13503 },
13504 },
13505 .{
13506 .name = "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL",
13507 .opcode = 5801,
13508 .operands = &.{
13509 .{ .kind = .id_result_type, .quantifier = .required },
13510 .{ .kind = .id_result, .quantifier = .required },
13511 .{ .kind = .id_ref, .quantifier = .required },
13512 .{ .kind = .id_ref, .quantifier = .required },
13513 },
13514 },
13515 .{
13516 .name = "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL",
13517 .opcode = 5802,
13518 .operands = &.{
13519 .{ .kind = .id_result_type, .quantifier = .required },
13520 .{ .kind = .id_result, .quantifier = .required },
13521 .{ .kind = .id_ref, .quantifier = .required },
13522 .{ .kind = .id_ref, .quantifier = .required },
13523 },
13524 },
13525 .{
13526 .name = "OpSubgroupAvcSicEvaluateIpeINTEL",
13527 .opcode = 5803,
13528 .operands = &.{
13529 .{ .kind = .id_result_type, .quantifier = .required },
13530 .{ .kind = .id_result, .quantifier = .required },
13531 .{ .kind = .id_ref, .quantifier = .required },
13532 .{ .kind = .id_ref, .quantifier = .required },
13533 },
13534 },
13535 .{
13536 .name = "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL",
13537 .opcode = 5804,
13538 .operands = &.{
13539 .{ .kind = .id_result_type, .quantifier = .required },
13540 .{ .kind = .id_result, .quantifier = .required },
13541 .{ .kind = .id_ref, .quantifier = .required },
13542 .{ .kind = .id_ref, .quantifier = .required },
13543 .{ .kind = .id_ref, .quantifier = .required },
13544 },
13545 },
13546 .{
13547 .name = "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL",
13548 .opcode = 5805,
13549 .operands = &.{
13550 .{ .kind = .id_result_type, .quantifier = .required },
13551 .{ .kind = .id_result, .quantifier = .required },
13552 .{ .kind = .id_ref, .quantifier = .required },
13553 .{ .kind = .id_ref, .quantifier = .required },
13554 .{ .kind = .id_ref, .quantifier = .required },
13555 .{ .kind = .id_ref, .quantifier = .required },
13556 },
13557 },
13558 .{
13559 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL",
13560 .opcode = 5806,
13561 .operands = &.{
13562 .{ .kind = .id_result_type, .quantifier = .required },
13563 .{ .kind = .id_result, .quantifier = .required },
13564 .{ .kind = .id_ref, .quantifier = .required },
13565 .{ .kind = .id_ref, .quantifier = .required },
13566 .{ .kind = .id_ref, .quantifier = .required },
13567 },
13568 },
13569 .{
13570 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL",
13571 .opcode = 5807,
13572 .operands = &.{
13573 .{ .kind = .id_result_type, .quantifier = .required },
13574 .{ .kind = .id_result, .quantifier = .required },
13575 .{ .kind = .id_ref, .quantifier = .required },
13576 .{ .kind = .id_ref, .quantifier = .required },
13577 .{ .kind = .id_ref, .quantifier = .required },
13578 .{ .kind = .id_ref, .quantifier = .required },
13579 },
13580 },
13581 .{
13582 .name = "OpSubgroupAvcSicConvertToMceResultINTEL",
13583 .opcode = 5808,
13584 .operands = &.{
13585 .{ .kind = .id_result_type, .quantifier = .required },
13586 .{ .kind = .id_result, .quantifier = .required },
13587 .{ .kind = .id_ref, .quantifier = .required },
13588 },
13589 },
13590 .{
13591 .name = "OpSubgroupAvcSicGetIpeLumaShapeINTEL",
13592 .opcode = 5809,
13593 .operands = &.{
13594 .{ .kind = .id_result_type, .quantifier = .required },
13595 .{ .kind = .id_result, .quantifier = .required },
13596 .{ .kind = .id_ref, .quantifier = .required },
13597 },
13598 },
13599 .{
13600 .name = "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL",
13601 .opcode = 5810,
13602 .operands = &.{
13603 .{ .kind = .id_result_type, .quantifier = .required },
13604 .{ .kind = .id_result, .quantifier = .required },
13605 .{ .kind = .id_ref, .quantifier = .required },
13606 },
13607 },
13608 .{
13609 .name = "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL",
13610 .opcode = 5811,
13611 .operands = &.{
13612 .{ .kind = .id_result_type, .quantifier = .required },
13613 .{ .kind = .id_result, .quantifier = .required },
13614 .{ .kind = .id_ref, .quantifier = .required },
13615 },
13616 },
13617 .{
13618 .name = "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL",
13619 .opcode = 5812,
13620 .operands = &.{
13621 .{ .kind = .id_result_type, .quantifier = .required },
13622 .{ .kind = .id_result, .quantifier = .required },
13623 .{ .kind = .id_ref, .quantifier = .required },
13624 },
13625 },
13626 .{
13627 .name = "OpSubgroupAvcSicGetIpeChromaModeINTEL",
13628 .opcode = 5813,
13629 .operands = &.{
13630 .{ .kind = .id_result_type, .quantifier = .required },
13631 .{ .kind = .id_result, .quantifier = .required },
13632 .{ .kind = .id_ref, .quantifier = .required },
13633 },
13634 },
13635 .{
13636 .name = "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL",
13637 .opcode = 5814,
13638 .operands = &.{
13639 .{ .kind = .id_result_type, .quantifier = .required },
13640 .{ .kind = .id_result, .quantifier = .required },
13641 .{ .kind = .id_ref, .quantifier = .required },
13642 },
13643 },
13644 .{
13645 .name = "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL",
13646 .opcode = 5815,
13647 .operands = &.{
13648 .{ .kind = .id_result_type, .quantifier = .required },
13649 .{ .kind = .id_result, .quantifier = .required },
13650 .{ .kind = .id_ref, .quantifier = .required },
13651 },
13652 },
13653 .{
13654 .name = "OpSubgroupAvcSicGetInterRawSadsINTEL",
13655 .opcode = 5816,
13656 .operands = &.{
13657 .{ .kind = .id_result_type, .quantifier = .required },
13658 .{ .kind = .id_result, .quantifier = .required },
13659 .{ .kind = .id_ref, .quantifier = .required },
13660 },
13661 },
13662 .{
13663 .name = "OpVariableLengthArrayINTEL",
13664 .opcode = 5818,
13665 .operands = &.{
13666 .{ .kind = .id_result_type, .quantifier = .required },
13667 .{ .kind = .id_result, .quantifier = .required },
13668 .{ .kind = .id_ref, .quantifier = .required },
13669 },
13670 },
13671 .{
13672 .name = "OpSaveMemoryINTEL",
13673 .opcode = 5819,
13674 .operands = &.{
13675 .{ .kind = .id_result_type, .quantifier = .required },
13676 .{ .kind = .id_result, .quantifier = .required },
13677 },
13678 },
13679 .{
13680 .name = "OpRestoreMemoryINTEL",
13681 .opcode = 5820,
13682 .operands = &.{
13683 .{ .kind = .id_ref, .quantifier = .required },
13684 },
13685 },
13686 .{
13687 .name = "OpArbitraryFloatSinCosPiALTERA",
13688 .opcode = 5840,
13689 .operands = &.{
13690 .{ .kind = .id_result_type, .quantifier = .required },
13691 .{ .kind = .id_result, .quantifier = .required },
13692 .{ .kind = .id_ref, .quantifier = .required },
13693 .{ .kind = .literal_integer, .quantifier = .required },
13694 .{ .kind = .literal_integer, .quantifier = .required },
13695 .{ .kind = .literal_integer, .quantifier = .required },
13696 .{ .kind = .literal_integer, .quantifier = .required },
13697 .{ .kind = .literal_integer, .quantifier = .required },
13698 },
13699 },
13700 .{
13701 .name = "OpArbitraryFloatCastALTERA",
13702 .opcode = 5841,
13703 .operands = &.{
13704 .{ .kind = .id_result_type, .quantifier = .required },
13705 .{ .kind = .id_result, .quantifier = .required },
13706 .{ .kind = .id_ref, .quantifier = .required },
13707 .{ .kind = .literal_integer, .quantifier = .required },
13708 .{ .kind = .literal_integer, .quantifier = .required },
13709 .{ .kind = .literal_integer, .quantifier = .required },
13710 .{ .kind = .literal_integer, .quantifier = .required },
13711 .{ .kind = .literal_integer, .quantifier = .required },
13712 },
13713 },
13714 .{
13715 .name = "OpArbitraryFloatCastFromIntALTERA",
13716 .opcode = 5842,
13717 .operands = &.{
13718 .{ .kind = .id_result_type, .quantifier = .required },
13719 .{ .kind = .id_result, .quantifier = .required },
13720 .{ .kind = .id_ref, .quantifier = .required },
13721 .{ .kind = .literal_integer, .quantifier = .required },
13722 .{ .kind = .literal_integer, .quantifier = .required },
13723 .{ .kind = .literal_integer, .quantifier = .required },
13724 .{ .kind = .literal_integer, .quantifier = .required },
13725 .{ .kind = .literal_integer, .quantifier = .required },
13726 },
13727 },
13728 .{
13729 .name = "OpArbitraryFloatCastToIntALTERA",
13730 .opcode = 5843,
13731 .operands = &.{
13732 .{ .kind = .id_result_type, .quantifier = .required },
13733 .{ .kind = .id_result, .quantifier = .required },
13734 .{ .kind = .id_ref, .quantifier = .required },
13735 .{ .kind = .literal_integer, .quantifier = .required },
13736 .{ .kind = .literal_integer, .quantifier = .required },
13737 .{ .kind = .literal_integer, .quantifier = .required },
13738 .{ .kind = .literal_integer, .quantifier = .required },
13739 .{ .kind = .literal_integer, .quantifier = .required },
13740 },
13741 },
13742 .{
13743 .name = "OpArbitraryFloatAddALTERA",
13744 .opcode = 5846,
13745 .operands = &.{
13746 .{ .kind = .id_result_type, .quantifier = .required },
13747 .{ .kind = .id_result, .quantifier = .required },
13748 .{ .kind = .id_ref, .quantifier = .required },
13749 .{ .kind = .literal_integer, .quantifier = .required },
13750 .{ .kind = .id_ref, .quantifier = .required },
13751 .{ .kind = .literal_integer, .quantifier = .required },
13752 .{ .kind = .literal_integer, .quantifier = .required },
13753 .{ .kind = .literal_integer, .quantifier = .required },
13754 .{ .kind = .literal_integer, .quantifier = .required },
13755 .{ .kind = .literal_integer, .quantifier = .required },
13756 },
13757 },
13758 .{
13759 .name = "OpArbitraryFloatSubALTERA",
13760 .opcode = 5847,
13761 .operands = &.{
13762 .{ .kind = .id_result_type, .quantifier = .required },
13763 .{ .kind = .id_result, .quantifier = .required },
13764 .{ .kind = .id_ref, .quantifier = .required },
13765 .{ .kind = .literal_integer, .quantifier = .required },
13766 .{ .kind = .id_ref, .quantifier = .required },
13767 .{ .kind = .literal_integer, .quantifier = .required },
13768 .{ .kind = .literal_integer, .quantifier = .required },
13769 .{ .kind = .literal_integer, .quantifier = .required },
13770 .{ .kind = .literal_integer, .quantifier = .required },
13771 .{ .kind = .literal_integer, .quantifier = .required },
13772 },
13773 },
13774 .{
13775 .name = "OpArbitraryFloatMulALTERA",
13776 .opcode = 5848,
13777 .operands = &.{
13778 .{ .kind = .id_result_type, .quantifier = .required },
13779 .{ .kind = .id_result, .quantifier = .required },
13780 .{ .kind = .id_ref, .quantifier = .required },
13781 .{ .kind = .literal_integer, .quantifier = .required },
13782 .{ .kind = .id_ref, .quantifier = .required },
13783 .{ .kind = .literal_integer, .quantifier = .required },
13784 .{ .kind = .literal_integer, .quantifier = .required },
13785 .{ .kind = .literal_integer, .quantifier = .required },
13786 .{ .kind = .literal_integer, .quantifier = .required },
13787 .{ .kind = .literal_integer, .quantifier = .required },
13788 },
13789 },
13790 .{
13791 .name = "OpArbitraryFloatDivALTERA",
13792 .opcode = 5849,
13793 .operands = &.{
13794 .{ .kind = .id_result_type, .quantifier = .required },
13795 .{ .kind = .id_result, .quantifier = .required },
13796 .{ .kind = .id_ref, .quantifier = .required },
13797 .{ .kind = .literal_integer, .quantifier = .required },
13798 .{ .kind = .id_ref, .quantifier = .required },
13799 .{ .kind = .literal_integer, .quantifier = .required },
13800 .{ .kind = .literal_integer, .quantifier = .required },
13801 .{ .kind = .literal_integer, .quantifier = .required },
13802 .{ .kind = .literal_integer, .quantifier = .required },
13803 .{ .kind = .literal_integer, .quantifier = .required },
13804 },
13805 },
13806 .{
13807 .name = "OpArbitraryFloatGTALTERA",
13808 .opcode = 5850,
13809 .operands = &.{
13810 .{ .kind = .id_result_type, .quantifier = .required },
13811 .{ .kind = .id_result, .quantifier = .required },
13812 .{ .kind = .id_ref, .quantifier = .required },
13813 .{ .kind = .literal_integer, .quantifier = .required },
13814 .{ .kind = .id_ref, .quantifier = .required },
13815 .{ .kind = .literal_integer, .quantifier = .required },
13816 },
13817 },
13818 .{
13819 .name = "OpArbitraryFloatGEALTERA",
13820 .opcode = 5851,
13821 .operands = &.{
13822 .{ .kind = .id_result_type, .quantifier = .required },
13823 .{ .kind = .id_result, .quantifier = .required },
13824 .{ .kind = .id_ref, .quantifier = .required },
13825 .{ .kind = .literal_integer, .quantifier = .required },
13826 .{ .kind = .id_ref, .quantifier = .required },
13827 .{ .kind = .literal_integer, .quantifier = .required },
13828 },
13829 },
13830 .{
13831 .name = "OpArbitraryFloatLTALTERA",
13832 .opcode = 5852,
13833 .operands = &.{
13834 .{ .kind = .id_result_type, .quantifier = .required },
13835 .{ .kind = .id_result, .quantifier = .required },
13836 .{ .kind = .id_ref, .quantifier = .required },
13837 .{ .kind = .literal_integer, .quantifier = .required },
13838 .{ .kind = .id_ref, .quantifier = .required },
13839 .{ .kind = .literal_integer, .quantifier = .required },
13840 },
13841 },
13842 .{
13843 .name = "OpArbitraryFloatLEALTERA",
13844 .opcode = 5853,
13845 .operands = &.{
13846 .{ .kind = .id_result_type, .quantifier = .required },
13847 .{ .kind = .id_result, .quantifier = .required },
13848 .{ .kind = .id_ref, .quantifier = .required },
13849 .{ .kind = .literal_integer, .quantifier = .required },
13850 .{ .kind = .id_ref, .quantifier = .required },
13851 .{ .kind = .literal_integer, .quantifier = .required },
13852 },
13853 },
13854 .{
13855 .name = "OpArbitraryFloatEQALTERA",
13856 .opcode = 5854,
13857 .operands = &.{
13858 .{ .kind = .id_result_type, .quantifier = .required },
13859 .{ .kind = .id_result, .quantifier = .required },
13860 .{ .kind = .id_ref, .quantifier = .required },
13861 .{ .kind = .literal_integer, .quantifier = .required },
13862 .{ .kind = .id_ref, .quantifier = .required },
13863 .{ .kind = .literal_integer, .quantifier = .required },
13864 },
13865 },
13866 .{
13867 .name = "OpArbitraryFloatRecipALTERA",
13868 .opcode = 5855,
13869 .operands = &.{
13870 .{ .kind = .id_result_type, .quantifier = .required },
13871 .{ .kind = .id_result, .quantifier = .required },
13872 .{ .kind = .id_ref, .quantifier = .required },
13873 .{ .kind = .literal_integer, .quantifier = .required },
13874 .{ .kind = .literal_integer, .quantifier = .required },
13875 .{ .kind = .literal_integer, .quantifier = .required },
13876 .{ .kind = .literal_integer, .quantifier = .required },
13877 .{ .kind = .literal_integer, .quantifier = .required },
13878 },
13879 },
13880 .{
13881 .name = "OpArbitraryFloatRSqrtALTERA",
13882 .opcode = 5856,
13883 .operands = &.{
13884 .{ .kind = .id_result_type, .quantifier = .required },
13885 .{ .kind = .id_result, .quantifier = .required },
13886 .{ .kind = .id_ref, .quantifier = .required },
13887 .{ .kind = .literal_integer, .quantifier = .required },
13888 .{ .kind = .literal_integer, .quantifier = .required },
13889 .{ .kind = .literal_integer, .quantifier = .required },
13890 .{ .kind = .literal_integer, .quantifier = .required },
13891 .{ .kind = .literal_integer, .quantifier = .required },
13892 },
13893 },
13894 .{
13895 .name = "OpArbitraryFloatCbrtALTERA",
13896 .opcode = 5857,
13897 .operands = &.{
13898 .{ .kind = .id_result_type, .quantifier = .required },
13899 .{ .kind = .id_result, .quantifier = .required },
13900 .{ .kind = .id_ref, .quantifier = .required },
13901 .{ .kind = .literal_integer, .quantifier = .required },
13902 .{ .kind = .literal_integer, .quantifier = .required },
13903 .{ .kind = .literal_integer, .quantifier = .required },
13904 .{ .kind = .literal_integer, .quantifier = .required },
13905 .{ .kind = .literal_integer, .quantifier = .required },
13906 },
13907 },
13908 .{
13909 .name = "OpArbitraryFloatHypotALTERA",
13910 .opcode = 5858,
13911 .operands = &.{
13912 .{ .kind = .id_result_type, .quantifier = .required },
13913 .{ .kind = .id_result, .quantifier = .required },
13914 .{ .kind = .id_ref, .quantifier = .required },
13915 .{ .kind = .literal_integer, .quantifier = .required },
13916 .{ .kind = .id_ref, .quantifier = .required },
13917 .{ .kind = .literal_integer, .quantifier = .required },
13918 .{ .kind = .literal_integer, .quantifier = .required },
13919 .{ .kind = .literal_integer, .quantifier = .required },
13920 .{ .kind = .literal_integer, .quantifier = .required },
13921 .{ .kind = .literal_integer, .quantifier = .required },
13922 },
13923 },
13924 .{
13925 .name = "OpArbitraryFloatSqrtALTERA",
13926 .opcode = 5859,
13927 .operands = &.{
13928 .{ .kind = .id_result_type, .quantifier = .required },
13929 .{ .kind = .id_result, .quantifier = .required },
13930 .{ .kind = .id_ref, .quantifier = .required },
13931 .{ .kind = .literal_integer, .quantifier = .required },
13932 .{ .kind = .literal_integer, .quantifier = .required },
13933 .{ .kind = .literal_integer, .quantifier = .required },
13934 .{ .kind = .literal_integer, .quantifier = .required },
13935 .{ .kind = .literal_integer, .quantifier = .required },
13936 },
13937 },
13938 .{
13939 .name = "OpArbitraryFloatLogINTEL",
13940 .opcode = 5860,
13941 .operands = &.{
13942 .{ .kind = .id_result_type, .quantifier = .required },
13943 .{ .kind = .id_result, .quantifier = .required },
13944 .{ .kind = .id_ref, .quantifier = .required },
13945 .{ .kind = .literal_integer, .quantifier = .required },
13946 .{ .kind = .literal_integer, .quantifier = .required },
13947 .{ .kind = .literal_integer, .quantifier = .required },
13948 .{ .kind = .literal_integer, .quantifier = .required },
13949 .{ .kind = .literal_integer, .quantifier = .required },
13950 },
13951 },
13952 .{
13953 .name = "OpArbitraryFloatLog2INTEL",
13954 .opcode = 5861,
13955 .operands = &.{
13956 .{ .kind = .id_result_type, .quantifier = .required },
13957 .{ .kind = .id_result, .quantifier = .required },
13958 .{ .kind = .id_ref, .quantifier = .required },
13959 .{ .kind = .literal_integer, .quantifier = .required },
13960 .{ .kind = .literal_integer, .quantifier = .required },
13961 .{ .kind = .literal_integer, .quantifier = .required },
13962 .{ .kind = .literal_integer, .quantifier = .required },
13963 .{ .kind = .literal_integer, .quantifier = .required },
13964 },
13965 },
13966 .{
13967 .name = "OpArbitraryFloatLog10INTEL",
13968 .opcode = 5862,
13969 .operands = &.{
13970 .{ .kind = .id_result_type, .quantifier = .required },
13971 .{ .kind = .id_result, .quantifier = .required },
13972 .{ .kind = .id_ref, .quantifier = .required },
13973 .{ .kind = .literal_integer, .quantifier = .required },
13974 .{ .kind = .literal_integer, .quantifier = .required },
13975 .{ .kind = .literal_integer, .quantifier = .required },
13976 .{ .kind = .literal_integer, .quantifier = .required },
13977 .{ .kind = .literal_integer, .quantifier = .required },
13978 },
13979 },
13980 .{
13981 .name = "OpArbitraryFloatLog1pINTEL",
13982 .opcode = 5863,
13983 .operands = &.{
13984 .{ .kind = .id_result_type, .quantifier = .required },
13985 .{ .kind = .id_result, .quantifier = .required },
13986 .{ .kind = .id_ref, .quantifier = .required },
13987 .{ .kind = .literal_integer, .quantifier = .required },
13988 .{ .kind = .literal_integer, .quantifier = .required },
13989 .{ .kind = .literal_integer, .quantifier = .required },
13990 .{ .kind = .literal_integer, .quantifier = .required },
13991 .{ .kind = .literal_integer, .quantifier = .required },
13992 },
13993 },
13994 .{
13995 .name = "OpArbitraryFloatExpINTEL",
13996 .opcode = 5864,
13997 .operands = &.{
13998 .{ .kind = .id_result_type, .quantifier = .required },
13999 .{ .kind = .id_result, .quantifier = .required },
14000 .{ .kind = .id_ref, .quantifier = .required },
14001 .{ .kind = .literal_integer, .quantifier = .required },
14002 .{ .kind = .literal_integer, .quantifier = .required },
14003 .{ .kind = .literal_integer, .quantifier = .required },
14004 .{ .kind = .literal_integer, .quantifier = .required },
14005 .{ .kind = .literal_integer, .quantifier = .required },
14006 },
14007 },
14008 .{
14009 .name = "OpArbitraryFloatExp2INTEL",
14010 .opcode = 5865,
14011 .operands = &.{
14012 .{ .kind = .id_result_type, .quantifier = .required },
14013 .{ .kind = .id_result, .quantifier = .required },
14014 .{ .kind = .id_ref, .quantifier = .required },
14015 .{ .kind = .literal_integer, .quantifier = .required },
14016 .{ .kind = .literal_integer, .quantifier = .required },
14017 .{ .kind = .literal_integer, .quantifier = .required },
14018 .{ .kind = .literal_integer, .quantifier = .required },
14019 .{ .kind = .literal_integer, .quantifier = .required },
14020 },
14021 },
14022 .{
14023 .name = "OpArbitraryFloatExp10INTEL",
14024 .opcode = 5866,
14025 .operands = &.{
14026 .{ .kind = .id_result_type, .quantifier = .required },
14027 .{ .kind = .id_result, .quantifier = .required },
14028 .{ .kind = .id_ref, .quantifier = .required },
14029 .{ .kind = .literal_integer, .quantifier = .required },
14030 .{ .kind = .literal_integer, .quantifier = .required },
14031 .{ .kind = .literal_integer, .quantifier = .required },
14032 .{ .kind = .literal_integer, .quantifier = .required },
14033 .{ .kind = .literal_integer, .quantifier = .required },
14034 },
14035 },
14036 .{
14037 .name = "OpArbitraryFloatExpm1INTEL",
14038 .opcode = 5867,
14039 .operands = &.{
14040 .{ .kind = .id_result_type, .quantifier = .required },
14041 .{ .kind = .id_result, .quantifier = .required },
14042 .{ .kind = .id_ref, .quantifier = .required },
14043 .{ .kind = .literal_integer, .quantifier = .required },
14044 .{ .kind = .literal_integer, .quantifier = .required },
14045 .{ .kind = .literal_integer, .quantifier = .required },
14046 .{ .kind = .literal_integer, .quantifier = .required },
14047 .{ .kind = .literal_integer, .quantifier = .required },
14048 },
14049 },
14050 .{
14051 .name = "OpArbitraryFloatSinINTEL",
14052 .opcode = 5868,
14053 .operands = &.{
14054 .{ .kind = .id_result_type, .quantifier = .required },
14055 .{ .kind = .id_result, .quantifier = .required },
14056 .{ .kind = .id_ref, .quantifier = .required },
14057 .{ .kind = .literal_integer, .quantifier = .required },
14058 .{ .kind = .literal_integer, .quantifier = .required },
14059 .{ .kind = .literal_integer, .quantifier = .required },
14060 .{ .kind = .literal_integer, .quantifier = .required },
14061 .{ .kind = .literal_integer, .quantifier = .required },
14062 },
14063 },
14064 .{
14065 .name = "OpArbitraryFloatCosINTEL",
14066 .opcode = 5869,
14067 .operands = &.{
14068 .{ .kind = .id_result_type, .quantifier = .required },
14069 .{ .kind = .id_result, .quantifier = .required },
14070 .{ .kind = .id_ref, .quantifier = .required },
14071 .{ .kind = .literal_integer, .quantifier = .required },
14072 .{ .kind = .literal_integer, .quantifier = .required },
14073 .{ .kind = .literal_integer, .quantifier = .required },
14074 .{ .kind = .literal_integer, .quantifier = .required },
14075 .{ .kind = .literal_integer, .quantifier = .required },
14076 },
14077 },
14078 .{
14079 .name = "OpArbitraryFloatSinCosINTEL",
14080 .opcode = 5870,
14081 .operands = &.{
14082 .{ .kind = .id_result_type, .quantifier = .required },
14083 .{ .kind = .id_result, .quantifier = .required },
14084 .{ .kind = .id_ref, .quantifier = .required },
14085 .{ .kind = .literal_integer, .quantifier = .required },
14086 .{ .kind = .literal_integer, .quantifier = .required },
14087 .{ .kind = .literal_integer, .quantifier = .required },
14088 .{ .kind = .literal_integer, .quantifier = .required },
14089 .{ .kind = .literal_integer, .quantifier = .required },
14090 },
14091 },
14092 .{
14093 .name = "OpArbitraryFloatSinPiINTEL",
14094 .opcode = 5871,
14095 .operands = &.{
14096 .{ .kind = .id_result_type, .quantifier = .required },
14097 .{ .kind = .id_result, .quantifier = .required },
14098 .{ .kind = .id_ref, .quantifier = .required },
14099 .{ .kind = .literal_integer, .quantifier = .required },
14100 .{ .kind = .literal_integer, .quantifier = .required },
14101 .{ .kind = .literal_integer, .quantifier = .required },
14102 .{ .kind = .literal_integer, .quantifier = .required },
14103 .{ .kind = .literal_integer, .quantifier = .required },
14104 },
14105 },
14106 .{
14107 .name = "OpArbitraryFloatCosPiINTEL",
14108 .opcode = 5872,
14109 .operands = &.{
14110 .{ .kind = .id_result_type, .quantifier = .required },
14111 .{ .kind = .id_result, .quantifier = .required },
14112 .{ .kind = .id_ref, .quantifier = .required },
14113 .{ .kind = .literal_integer, .quantifier = .required },
14114 .{ .kind = .literal_integer, .quantifier = .required },
14115 .{ .kind = .literal_integer, .quantifier = .required },
14116 .{ .kind = .literal_integer, .quantifier = .required },
14117 .{ .kind = .literal_integer, .quantifier = .required },
14118 },
14119 },
14120 .{
14121 .name = "OpArbitraryFloatASinINTEL",
14122 .opcode = 5873,
14123 .operands = &.{
14124 .{ .kind = .id_result_type, .quantifier = .required },
14125 .{ .kind = .id_result, .quantifier = .required },
14126 .{ .kind = .id_ref, .quantifier = .required },
14127 .{ .kind = .literal_integer, .quantifier = .required },
14128 .{ .kind = .literal_integer, .quantifier = .required },
14129 .{ .kind = .literal_integer, .quantifier = .required },
14130 .{ .kind = .literal_integer, .quantifier = .required },
14131 .{ .kind = .literal_integer, .quantifier = .required },
14132 },
14133 },
14134 .{
14135 .name = "OpArbitraryFloatASinPiINTEL",
14136 .opcode = 5874,
14137 .operands = &.{
14138 .{ .kind = .id_result_type, .quantifier = .required },
14139 .{ .kind = .id_result, .quantifier = .required },
14140 .{ .kind = .id_ref, .quantifier = .required },
14141 .{ .kind = .literal_integer, .quantifier = .required },
14142 .{ .kind = .literal_integer, .quantifier = .required },
14143 .{ .kind = .literal_integer, .quantifier = .required },
14144 .{ .kind = .literal_integer, .quantifier = .required },
14145 .{ .kind = .literal_integer, .quantifier = .required },
14146 },
14147 },
14148 .{
14149 .name = "OpArbitraryFloatACosINTEL",
14150 .opcode = 5875,
14151 .operands = &.{
14152 .{ .kind = .id_result_type, .quantifier = .required },
14153 .{ .kind = .id_result, .quantifier = .required },
14154 .{ .kind = .id_ref, .quantifier = .required },
14155 .{ .kind = .literal_integer, .quantifier = .required },
14156 .{ .kind = .literal_integer, .quantifier = .required },
14157 .{ .kind = .literal_integer, .quantifier = .required },
14158 .{ .kind = .literal_integer, .quantifier = .required },
14159 .{ .kind = .literal_integer, .quantifier = .required },
14160 },
14161 },
14162 .{
14163 .name = "OpArbitraryFloatACosPiINTEL",
14164 .opcode = 5876,
14165 .operands = &.{
14166 .{ .kind = .id_result_type, .quantifier = .required },
14167 .{ .kind = .id_result, .quantifier = .required },
14168 .{ .kind = .id_ref, .quantifier = .required },
14169 .{ .kind = .literal_integer, .quantifier = .required },
14170 .{ .kind = .literal_integer, .quantifier = .required },
14171 .{ .kind = .literal_integer, .quantifier = .required },
14172 .{ .kind = .literal_integer, .quantifier = .required },
14173 .{ .kind = .literal_integer, .quantifier = .required },
14174 },
14175 },
14176 .{
14177 .name = "OpArbitraryFloatATanINTEL",
14178 .opcode = 5877,
14179 .operands = &.{
14180 .{ .kind = .id_result_type, .quantifier = .required },
14181 .{ .kind = .id_result, .quantifier = .required },
14182 .{ .kind = .id_ref, .quantifier = .required },
14183 .{ .kind = .literal_integer, .quantifier = .required },
14184 .{ .kind = .literal_integer, .quantifier = .required },
14185 .{ .kind = .literal_integer, .quantifier = .required },
14186 .{ .kind = .literal_integer, .quantifier = .required },
14187 .{ .kind = .literal_integer, .quantifier = .required },
14188 },
14189 },
14190 .{
14191 .name = "OpArbitraryFloatATanPiINTEL",
14192 .opcode = 5878,
14193 .operands = &.{
14194 .{ .kind = .id_result_type, .quantifier = .required },
14195 .{ .kind = .id_result, .quantifier = .required },
14196 .{ .kind = .id_ref, .quantifier = .required },
14197 .{ .kind = .literal_integer, .quantifier = .required },
14198 .{ .kind = .literal_integer, .quantifier = .required },
14199 .{ .kind = .literal_integer, .quantifier = .required },
14200 .{ .kind = .literal_integer, .quantifier = .required },
14201 .{ .kind = .literal_integer, .quantifier = .required },
14202 },
14203 },
14204 .{
14205 .name = "OpArbitraryFloatATan2INTEL",
14206 .opcode = 5879,
14207 .operands = &.{
14208 .{ .kind = .id_result_type, .quantifier = .required },
14209 .{ .kind = .id_result, .quantifier = .required },
14210 .{ .kind = .id_ref, .quantifier = .required },
14211 .{ .kind = .literal_integer, .quantifier = .required },
14212 .{ .kind = .id_ref, .quantifier = .required },
14213 .{ .kind = .literal_integer, .quantifier = .required },
14214 .{ .kind = .literal_integer, .quantifier = .required },
14215 .{ .kind = .literal_integer, .quantifier = .required },
14216 .{ .kind = .literal_integer, .quantifier = .required },
14217 .{ .kind = .literal_integer, .quantifier = .required },
14218 },
14219 },
14220 .{
14221 .name = "OpArbitraryFloatPowINTEL",
14222 .opcode = 5880,
14223 .operands = &.{
14224 .{ .kind = .id_result_type, .quantifier = .required },
14225 .{ .kind = .id_result, .quantifier = .required },
14226 .{ .kind = .id_ref, .quantifier = .required },
14227 .{ .kind = .literal_integer, .quantifier = .required },
14228 .{ .kind = .id_ref, .quantifier = .required },
14229 .{ .kind = .literal_integer, .quantifier = .required },
14230 .{ .kind = .literal_integer, .quantifier = .required },
14231 .{ .kind = .literal_integer, .quantifier = .required },
14232 .{ .kind = .literal_integer, .quantifier = .required },
14233 .{ .kind = .literal_integer, .quantifier = .required },
14234 },
14235 },
14236 .{
14237 .name = "OpArbitraryFloatPowRINTEL",
14238 .opcode = 5881,
14239 .operands = &.{
14240 .{ .kind = .id_result_type, .quantifier = .required },
14241 .{ .kind = .id_result, .quantifier = .required },
14242 .{ .kind = .id_ref, .quantifier = .required },
14243 .{ .kind = .literal_integer, .quantifier = .required },
14244 .{ .kind = .id_ref, .quantifier = .required },
14245 .{ .kind = .literal_integer, .quantifier = .required },
14246 .{ .kind = .literal_integer, .quantifier = .required },
14247 .{ .kind = .literal_integer, .quantifier = .required },
14248 .{ .kind = .literal_integer, .quantifier = .required },
14249 .{ .kind = .literal_integer, .quantifier = .required },
14250 },
14251 },
14252 .{
14253 .name = "OpArbitraryFloatPowNINTEL",
14254 .opcode = 5882,
14255 .operands = &.{
14256 .{ .kind = .id_result_type, .quantifier = .required },
14257 .{ .kind = .id_result, .quantifier = .required },
14258 .{ .kind = .id_ref, .quantifier = .required },
14259 .{ .kind = .literal_integer, .quantifier = .required },
14260 .{ .kind = .id_ref, .quantifier = .required },
14261 .{ .kind = .literal_integer, .quantifier = .required },
14262 .{ .kind = .literal_integer, .quantifier = .required },
14263 .{ .kind = .literal_integer, .quantifier = .required },
14264 .{ .kind = .literal_integer, .quantifier = .required },
14265 .{ .kind = .literal_integer, .quantifier = .required },
14266 },
14267 },
14268 .{
14269 .name = "OpLoopControlINTEL",
14270 .opcode = 5887,
14271 .operands = &.{
14272 .{ .kind = .literal_integer, .quantifier = .variadic },
14273 },
14274 },
14275 .{
14276 .name = "OpAliasDomainDeclINTEL",
14277 .opcode = 5911,
14278 .operands = &.{
14279 .{ .kind = .id_result, .quantifier = .required },
14280 .{ .kind = .id_ref, .quantifier = .optional },
14281 },
14282 },
14283 .{
14284 .name = "OpAliasScopeDeclINTEL",
14285 .opcode = 5912,
14286 .operands = &.{
14287 .{ .kind = .id_result, .quantifier = .required },
14288 .{ .kind = .id_ref, .quantifier = .required },
14289 .{ .kind = .id_ref, .quantifier = .optional },
14290 },
14291 },
14292 .{
14293 .name = "OpAliasScopeListDeclINTEL",
14294 .opcode = 5913,
14295 .operands = &.{
14296 .{ .kind = .id_result, .quantifier = .required },
14297 .{ .kind = .id_ref, .quantifier = .variadic },
14298 },
14299 },
14300 .{
14301 .name = "OpFixedSqrtALTERA",
14302 .opcode = 5923,
14303 .operands = &.{
14304 .{ .kind = .id_result_type, .quantifier = .required },
14305 .{ .kind = .id_result, .quantifier = .required },
14306 .{ .kind = .id_ref, .quantifier = .required },
14307 .{ .kind = .literal_integer, .quantifier = .required },
14308 .{ .kind = .literal_integer, .quantifier = .required },
14309 .{ .kind = .literal_integer, .quantifier = .required },
14310 .{ .kind = .literal_integer, .quantifier = .required },
14311 .{ .kind = .literal_integer, .quantifier = .required },
14312 },
14313 },
14314 .{
14315 .name = "OpFixedRecipALTERA",
14316 .opcode = 5924,
14317 .operands = &.{
14318 .{ .kind = .id_result_type, .quantifier = .required },
14319 .{ .kind = .id_result, .quantifier = .required },
14320 .{ .kind = .id_ref, .quantifier = .required },
14321 .{ .kind = .literal_integer, .quantifier = .required },
14322 .{ .kind = .literal_integer, .quantifier = .required },
14323 .{ .kind = .literal_integer, .quantifier = .required },
14324 .{ .kind = .literal_integer, .quantifier = .required },
14325 .{ .kind = .literal_integer, .quantifier = .required },
14326 },
14327 },
14328 .{
14329 .name = "OpFixedRsqrtALTERA",
14330 .opcode = 5925,
14331 .operands = &.{
14332 .{ .kind = .id_result_type, .quantifier = .required },
14333 .{ .kind = .id_result, .quantifier = .required },
14334 .{ .kind = .id_ref, .quantifier = .required },
14335 .{ .kind = .literal_integer, .quantifier = .required },
14336 .{ .kind = .literal_integer, .quantifier = .required },
14337 .{ .kind = .literal_integer, .quantifier = .required },
14338 .{ .kind = .literal_integer, .quantifier = .required },
14339 .{ .kind = .literal_integer, .quantifier = .required },
14340 },
14341 },
14342 .{
14343 .name = "OpFixedSinALTERA",
14344 .opcode = 5926,
14345 .operands = &.{
14346 .{ .kind = .id_result_type, .quantifier = .required },
14347 .{ .kind = .id_result, .quantifier = .required },
14348 .{ .kind = .id_ref, .quantifier = .required },
14349 .{ .kind = .literal_integer, .quantifier = .required },
14350 .{ .kind = .literal_integer, .quantifier = .required },
14351 .{ .kind = .literal_integer, .quantifier = .required },
14352 .{ .kind = .literal_integer, .quantifier = .required },
14353 .{ .kind = .literal_integer, .quantifier = .required },
14354 },
14355 },
14356 .{
14357 .name = "OpFixedCosALTERA",
14358 .opcode = 5927,
14359 .operands = &.{
14360 .{ .kind = .id_result_type, .quantifier = .required },
14361 .{ .kind = .id_result, .quantifier = .required },
14362 .{ .kind = .id_ref, .quantifier = .required },
14363 .{ .kind = .literal_integer, .quantifier = .required },
14364 .{ .kind = .literal_integer, .quantifier = .required },
14365 .{ .kind = .literal_integer, .quantifier = .required },
14366 .{ .kind = .literal_integer, .quantifier = .required },
14367 .{ .kind = .literal_integer, .quantifier = .required },
14368 },
14369 },
14370 .{
14371 .name = "OpFixedSinCosALTERA",
14372 .opcode = 5928,
14373 .operands = &.{
14374 .{ .kind = .id_result_type, .quantifier = .required },
14375 .{ .kind = .id_result, .quantifier = .required },
14376 .{ .kind = .id_ref, .quantifier = .required },
14377 .{ .kind = .literal_integer, .quantifier = .required },
14378 .{ .kind = .literal_integer, .quantifier = .required },
14379 .{ .kind = .literal_integer, .quantifier = .required },
14380 .{ .kind = .literal_integer, .quantifier = .required },
14381 .{ .kind = .literal_integer, .quantifier = .required },
14382 },
14383 },
14384 .{
14385 .name = "OpFixedSinPiALTERA",
14386 .opcode = 5929,
14387 .operands = &.{
14388 .{ .kind = .id_result_type, .quantifier = .required },
14389 .{ .kind = .id_result, .quantifier = .required },
14390 .{ .kind = .id_ref, .quantifier = .required },
14391 .{ .kind = .literal_integer, .quantifier = .required },
14392 .{ .kind = .literal_integer, .quantifier = .required },
14393 .{ .kind = .literal_integer, .quantifier = .required },
14394 .{ .kind = .literal_integer, .quantifier = .required },
14395 .{ .kind = .literal_integer, .quantifier = .required },
14396 },
14397 },
14398 .{
14399 .name = "OpFixedCosPiALTERA",
14400 .opcode = 5930,
14401 .operands = &.{
14402 .{ .kind = .id_result_type, .quantifier = .required },
14403 .{ .kind = .id_result, .quantifier = .required },
14404 .{ .kind = .id_ref, .quantifier = .required },
14405 .{ .kind = .literal_integer, .quantifier = .required },
14406 .{ .kind = .literal_integer, .quantifier = .required },
14407 .{ .kind = .literal_integer, .quantifier = .required },
14408 .{ .kind = .literal_integer, .quantifier = .required },
14409 .{ .kind = .literal_integer, .quantifier = .required },
14410 },
14411 },
14412 .{
14413 .name = "OpFixedSinCosPiALTERA",
14414 .opcode = 5931,
14415 .operands = &.{
14416 .{ .kind = .id_result_type, .quantifier = .required },
14417 .{ .kind = .id_result, .quantifier = .required },
14418 .{ .kind = .id_ref, .quantifier = .required },
14419 .{ .kind = .literal_integer, .quantifier = .required },
14420 .{ .kind = .literal_integer, .quantifier = .required },
14421 .{ .kind = .literal_integer, .quantifier = .required },
14422 .{ .kind = .literal_integer, .quantifier = .required },
14423 .{ .kind = .literal_integer, .quantifier = .required },
14424 },
14425 },
14426 .{
14427 .name = "OpFixedLogALTERA",
14428 .opcode = 5932,
14429 .operands = &.{
14430 .{ .kind = .id_result_type, .quantifier = .required },
14431 .{ .kind = .id_result, .quantifier = .required },
14432 .{ .kind = .id_ref, .quantifier = .required },
14433 .{ .kind = .literal_integer, .quantifier = .required },
14434 .{ .kind = .literal_integer, .quantifier = .required },
14435 .{ .kind = .literal_integer, .quantifier = .required },
14436 .{ .kind = .literal_integer, .quantifier = .required },
14437 .{ .kind = .literal_integer, .quantifier = .required },
14438 },
14439 },
14440 .{
14441 .name = "OpFixedExpALTERA",
14442 .opcode = 5933,
14443 .operands = &.{
14444 .{ .kind = .id_result_type, .quantifier = .required },
14445 .{ .kind = .id_result, .quantifier = .required },
14446 .{ .kind = .id_ref, .quantifier = .required },
14447 .{ .kind = .literal_integer, .quantifier = .required },
14448 .{ .kind = .literal_integer, .quantifier = .required },
14449 .{ .kind = .literal_integer, .quantifier = .required },
14450 .{ .kind = .literal_integer, .quantifier = .required },
14451 .{ .kind = .literal_integer, .quantifier = .required },
14452 },
14453 },
14454 .{
14455 .name = "OpPtrCastToCrossWorkgroupALTERA",
14456 .opcode = 5934,
14457 .operands = &.{
14458 .{ .kind = .id_result_type, .quantifier = .required },
14459 .{ .kind = .id_result, .quantifier = .required },
14460 .{ .kind = .id_ref, .quantifier = .required },
14461 },
14462 },
14463 .{
14464 .name = "OpCrossWorkgroupCastToPtrALTERA",
14465 .opcode = 5938,
14466 .operands = &.{
14467 .{ .kind = .id_result_type, .quantifier = .required },
14468 .{ .kind = .id_result, .quantifier = .required },
14469 .{ .kind = .id_ref, .quantifier = .required },
14470 },
14471 },
14472 .{
14473 .name = "OpReadPipeBlockingALTERA",
14474 .opcode = 5946,
14475 .operands = &.{
14476 .{ .kind = .id_result_type, .quantifier = .required },
14477 .{ .kind = .id_result, .quantifier = .required },
14478 .{ .kind = .id_ref, .quantifier = .required },
14479 .{ .kind = .id_ref, .quantifier = .required },
14480 },
14481 },
14482 .{
14483 .name = "OpWritePipeBlockingALTERA",
14484 .opcode = 5947,
14485 .operands = &.{
14486 .{ .kind = .id_result_type, .quantifier = .required },
14487 .{ .kind = .id_result, .quantifier = .required },
14488 .{ .kind = .id_ref, .quantifier = .required },
14489 .{ .kind = .id_ref, .quantifier = .required },
14490 },
14491 },
14492 .{
14493 .name = "OpFPGARegALTERA",
14494 .opcode = 5949,
14495 .operands = &.{
14496 .{ .kind = .id_result_type, .quantifier = .required },
14497 .{ .kind = .id_result, .quantifier = .required },
14498 .{ .kind = .id_ref, .quantifier = .required },
14499 },
14500 },
14501 .{
14502 .name = "OpRayQueryGetRayTMinKHR",
14503 .opcode = 6016,
14504 .operands = &.{
14505 .{ .kind = .id_result_type, .quantifier = .required },
14506 .{ .kind = .id_result, .quantifier = .required },
14507 .{ .kind = .id_ref, .quantifier = .required },
14508 },
14509 },
14510 .{
14511 .name = "OpRayQueryGetRayFlagsKHR",
14512 .opcode = 6017,
14513 .operands = &.{
14514 .{ .kind = .id_result_type, .quantifier = .required },
14515 .{ .kind = .id_result, .quantifier = .required },
14516 .{ .kind = .id_ref, .quantifier = .required },
14517 },
14518 },
14519 .{
14520 .name = "OpRayQueryGetIntersectionTKHR",
14521 .opcode = 6018,
14522 .operands = &.{
14523 .{ .kind = .id_result_type, .quantifier = .required },
14524 .{ .kind = .id_result, .quantifier = .required },
14525 .{ .kind = .id_ref, .quantifier = .required },
14526 .{ .kind = .id_ref, .quantifier = .required },
14527 },
14528 },
14529 .{
14530 .name = "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
14531 .opcode = 6019,
14532 .operands = &.{
14533 .{ .kind = .id_result_type, .quantifier = .required },
14534 .{ .kind = .id_result, .quantifier = .required },
14535 .{ .kind = .id_ref, .quantifier = .required },
14536 .{ .kind = .id_ref, .quantifier = .required },
14537 },
14538 },
14539 .{
14540 .name = "OpRayQueryGetIntersectionInstanceIdKHR",
14541 .opcode = 6020,
14542 .operands = &.{
14543 .{ .kind = .id_result_type, .quantifier = .required },
14544 .{ .kind = .id_result, .quantifier = .required },
14545 .{ .kind = .id_ref, .quantifier = .required },
14546 .{ .kind = .id_ref, .quantifier = .required },
14547 },
14548 },
14549 .{
14550 .name = "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
14551 .opcode = 6021,
14552 .operands = &.{
14553 .{ .kind = .id_result_type, .quantifier = .required },
14554 .{ .kind = .id_result, .quantifier = .required },
14555 .{ .kind = .id_ref, .quantifier = .required },
14556 .{ .kind = .id_ref, .quantifier = .required },
14557 },
14558 },
14559 .{
14560 .name = "OpRayQueryGetIntersectionGeometryIndexKHR",
14561 .opcode = 6022,
14562 .operands = &.{
14563 .{ .kind = .id_result_type, .quantifier = .required },
14564 .{ .kind = .id_result, .quantifier = .required },
14565 .{ .kind = .id_ref, .quantifier = .required },
14566 .{ .kind = .id_ref, .quantifier = .required },
14567 },
14568 },
14569 .{
14570 .name = "OpRayQueryGetIntersectionPrimitiveIndexKHR",
14571 .opcode = 6023,
14572 .operands = &.{
14573 .{ .kind = .id_result_type, .quantifier = .required },
14574 .{ .kind = .id_result, .quantifier = .required },
14575 .{ .kind = .id_ref, .quantifier = .required },
14576 .{ .kind = .id_ref, .quantifier = .required },
14577 },
14578 },
14579 .{
14580 .name = "OpRayQueryGetIntersectionBarycentricsKHR",
14581 .opcode = 6024,
14582 .operands = &.{
14583 .{ .kind = .id_result_type, .quantifier = .required },
14584 .{ .kind = .id_result, .quantifier = .required },
14585 .{ .kind = .id_ref, .quantifier = .required },
14586 .{ .kind = .id_ref, .quantifier = .required },
14587 },
14588 },
14589 .{
14590 .name = "OpRayQueryGetIntersectionFrontFaceKHR",
14591 .opcode = 6025,
14592 .operands = &.{
14593 .{ .kind = .id_result_type, .quantifier = .required },
14594 .{ .kind = .id_result, .quantifier = .required },
14595 .{ .kind = .id_ref, .quantifier = .required },
14596 .{ .kind = .id_ref, .quantifier = .required },
14597 },
14598 },
14599 .{
14600 .name = "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
14601 .opcode = 6026,
14602 .operands = &.{
14603 .{ .kind = .id_result_type, .quantifier = .required },
14604 .{ .kind = .id_result, .quantifier = .required },
14605 .{ .kind = .id_ref, .quantifier = .required },
14606 },
14607 },
14608 .{
14609 .name = "OpRayQueryGetIntersectionObjectRayDirectionKHR",
14610 .opcode = 6027,
14611 .operands = &.{
14612 .{ .kind = .id_result_type, .quantifier = .required },
14613 .{ .kind = .id_result, .quantifier = .required },
14614 .{ .kind = .id_ref, .quantifier = .required },
14615 .{ .kind = .id_ref, .quantifier = .required },
14616 },
14617 },
14618 .{
14619 .name = "OpRayQueryGetIntersectionObjectRayOriginKHR",
14620 .opcode = 6028,
14621 .operands = &.{
14622 .{ .kind = .id_result_type, .quantifier = .required },
14623 .{ .kind = .id_result, .quantifier = .required },
14624 .{ .kind = .id_ref, .quantifier = .required },
14625 .{ .kind = .id_ref, .quantifier = .required },
14626 },
14627 },
14628 .{
14629 .name = "OpRayQueryGetWorldRayDirectionKHR",
14630 .opcode = 6029,
14631 .operands = &.{
14632 .{ .kind = .id_result_type, .quantifier = .required },
14633 .{ .kind = .id_result, .quantifier = .required },
14634 .{ .kind = .id_ref, .quantifier = .required },
14635 },
14636 },
14637 .{
14638 .name = "OpRayQueryGetWorldRayOriginKHR",
14639 .opcode = 6030,
14640 .operands = &.{
14641 .{ .kind = .id_result_type, .quantifier = .required },
14642 .{ .kind = .id_result, .quantifier = .required },
14643 .{ .kind = .id_ref, .quantifier = .required },
14644 },
14645 },
14646 .{
14647 .name = "OpRayQueryGetIntersectionObjectToWorldKHR",
14648 .opcode = 6031,
14649 .operands = &.{
14650 .{ .kind = .id_result_type, .quantifier = .required },
14651 .{ .kind = .id_result, .quantifier = .required },
14652 .{ .kind = .id_ref, .quantifier = .required },
14653 .{ .kind = .id_ref, .quantifier = .required },
14654 },
14655 },
14656 .{
14657 .name = "OpRayQueryGetIntersectionWorldToObjectKHR",
14658 .opcode = 6032,
14659 .operands = &.{
14660 .{ .kind = .id_result_type, .quantifier = .required },
14661 .{ .kind = .id_result, .quantifier = .required },
14662 .{ .kind = .id_ref, .quantifier = .required },
14663 .{ .kind = .id_ref, .quantifier = .required },
14664 },
14665 },
14666 .{
14667 .name = "OpAtomicFAddEXT",
14668 .opcode = 6035,
14669 .operands = &.{
14670 .{ .kind = .id_result_type, .quantifier = .required },
14671 .{ .kind = .id_result, .quantifier = .required },
14672 .{ .kind = .id_ref, .quantifier = .required },
14673 .{ .kind = .id_scope, .quantifier = .required },
14674 .{ .kind = .id_memory_semantics, .quantifier = .required },
14675 .{ .kind = .id_ref, .quantifier = .required },
14676 },
14677 },
14678 .{
14679 .name = "OpTypeBufferSurfaceINTEL",
14680 .opcode = 6086,
14681 .operands = &.{
14682 .{ .kind = .id_result, .quantifier = .required },
14683 .{ .kind = .access_qualifier, .quantifier = .required },
14684 },
14685 },
14686 .{
14687 .name = "OpTypeStructContinuedINTEL",
14688 .opcode = 6090,
14689 .operands = &.{
14690 .{ .kind = .id_ref, .quantifier = .variadic },
14691 },
14692 },
14693 .{
14694 .name = "OpConstantCompositeContinuedINTEL",
14695 .opcode = 6091,
14696 .operands = &.{
14697 .{ .kind = .id_ref, .quantifier = .variadic },
14698 },
14699 },
14700 .{
14701 .name = "OpSpecConstantCompositeContinuedINTEL",
14702 .opcode = 6092,
14703 .operands = &.{
14704 .{ .kind = .id_ref, .quantifier = .variadic },
14705 },
14706 },
14707 .{
14708 .name = "OpCompositeConstructContinuedINTEL",
14709 .opcode = 6096,
14710 .operands = &.{
14711 .{ .kind = .id_result_type, .quantifier = .required },
14712 .{ .kind = .id_result, .quantifier = .required },
14713 .{ .kind = .id_ref, .quantifier = .variadic },
14714 },
14715 },
14716 .{
14717 .name = "OpConvertFToBF16INTEL",
14718 .opcode = 6116,
14719 .operands = &.{
14720 .{ .kind = .id_result_type, .quantifier = .required },
14721 .{ .kind = .id_result, .quantifier = .required },
14722 .{ .kind = .id_ref, .quantifier = .required },
14723 },
14724 },
14725 .{
14726 .name = "OpConvertBF16ToFINTEL",
14727 .opcode = 6117,
14728 .operands = &.{
14729 .{ .kind = .id_result_type, .quantifier = .required },
14730 .{ .kind = .id_result, .quantifier = .required },
14731 .{ .kind = .id_ref, .quantifier = .required },
14732 },
14733 },
14734 .{
14735 .name = "OpControlBarrierArriveINTEL",
14736 .opcode = 6142,
14737 .operands = &.{
14738 .{ .kind = .id_scope, .quantifier = .required },
14739 .{ .kind = .id_scope, .quantifier = .required },
14740 .{ .kind = .id_memory_semantics, .quantifier = .required },
14741 },
14742 },
14743 .{
14744 .name = "OpControlBarrierWaitINTEL",
14745 .opcode = 6143,
14746 .operands = &.{
14747 .{ .kind = .id_scope, .quantifier = .required },
14748 .{ .kind = .id_scope, .quantifier = .required },
14749 .{ .kind = .id_memory_semantics, .quantifier = .required },
14750 },
14751 },
14752 .{
14753 .name = "OpArithmeticFenceEXT",
14754 .opcode = 6145,
14755 .operands = &.{
14756 .{ .kind = .id_result_type, .quantifier = .required },
14757 .{ .kind = .id_result, .quantifier = .required },
14758 .{ .kind = .id_ref, .quantifier = .required },
14759 },
14760 },
14761 .{
14762 .name = "OpTaskSequenceCreateALTERA",
14763 .opcode = 6163,
14764 .operands = &.{
14765 .{ .kind = .id_result_type, .quantifier = .required },
14766 .{ .kind = .id_result, .quantifier = .required },
14767 .{ .kind = .id_ref, .quantifier = .required },
14768 .{ .kind = .literal_integer, .quantifier = .required },
14769 .{ .kind = .literal_integer, .quantifier = .required },
14770 .{ .kind = .literal_integer, .quantifier = .required },
14771 .{ .kind = .literal_integer, .quantifier = .required },
14772 },
14773 },
14774 .{
14775 .name = "OpTaskSequenceAsyncALTERA",
14776 .opcode = 6164,
14777 .operands = &.{
14778 .{ .kind = .id_ref, .quantifier = .required },
14779 .{ .kind = .id_ref, .quantifier = .variadic },
14780 },
14781 },
14782 .{
14783 .name = "OpTaskSequenceGetALTERA",
14784 .opcode = 6165,
14785 .operands = &.{
14786 .{ .kind = .id_result_type, .quantifier = .required },
14787 .{ .kind = .id_result, .quantifier = .required },
14788 .{ .kind = .id_ref, .quantifier = .required },
14789 },
14790 },
14791 .{
14792 .name = "OpTaskSequenceReleaseALTERA",
14793 .opcode = 6166,
14794 .operands = &.{
14795 .{ .kind = .id_ref, .quantifier = .required },
14796 },
14797 },
14798 .{
14799 .name = "OpTypeTaskSequenceALTERA",
14800 .opcode = 6199,
14801 .operands = &.{
14802 .{ .kind = .id_result, .quantifier = .required },
14803 },
14804 },
14805 .{
14806 .name = "OpSubgroupBlockPrefetchINTEL",
14807 .opcode = 6221,
14808 .operands = &.{
14809 .{ .kind = .id_ref, .quantifier = .required },
14810 .{ .kind = .id_ref, .quantifier = .required },
14811 .{ .kind = .memory_access, .quantifier = .optional },
14812 },
14813 },
14814 .{
14815 .name = "OpSubgroup2DBlockLoadINTEL",
14816 .opcode = 6231,
14817 .operands = &.{
14818 .{ .kind = .id_ref, .quantifier = .required },
14819 .{ .kind = .id_ref, .quantifier = .required },
14820 .{ .kind = .id_ref, .quantifier = .required },
14821 .{ .kind = .id_ref, .quantifier = .required },
14822 .{ .kind = .id_ref, .quantifier = .required },
14823 .{ .kind = .id_ref, .quantifier = .required },
14824 .{ .kind = .id_ref, .quantifier = .required },
14825 .{ .kind = .id_ref, .quantifier = .required },
14826 .{ .kind = .id_ref, .quantifier = .required },
14827 .{ .kind = .id_ref, .quantifier = .required },
14828 },
14829 },
14830 .{
14831 .name = "OpSubgroup2DBlockLoadTransformINTEL",
14832 .opcode = 6232,
14833 .operands = &.{
14834 .{ .kind = .id_ref, .quantifier = .required },
14835 .{ .kind = .id_ref, .quantifier = .required },
14836 .{ .kind = .id_ref, .quantifier = .required },
14837 .{ .kind = .id_ref, .quantifier = .required },
14838 .{ .kind = .id_ref, .quantifier = .required },
14839 .{ .kind = .id_ref, .quantifier = .required },
14840 .{ .kind = .id_ref, .quantifier = .required },
14841 .{ .kind = .id_ref, .quantifier = .required },
14842 .{ .kind = .id_ref, .quantifier = .required },
14843 .{ .kind = .id_ref, .quantifier = .required },
14844 },
14845 },
14846 .{
14847 .name = "OpSubgroup2DBlockLoadTransposeINTEL",
14848 .opcode = 6233,
14849 .operands = &.{
14850 .{ .kind = .id_ref, .quantifier = .required },
14851 .{ .kind = .id_ref, .quantifier = .required },
14852 .{ .kind = .id_ref, .quantifier = .required },
14853 .{ .kind = .id_ref, .quantifier = .required },
14854 .{ .kind = .id_ref, .quantifier = .required },
14855 .{ .kind = .id_ref, .quantifier = .required },
14856 .{ .kind = .id_ref, .quantifier = .required },
14857 .{ .kind = .id_ref, .quantifier = .required },
14858 .{ .kind = .id_ref, .quantifier = .required },
14859 .{ .kind = .id_ref, .quantifier = .required },
14860 },
14861 },
14862 .{
14863 .name = "OpSubgroup2DBlockPrefetchINTEL",
14864 .opcode = 6234,
14865 .operands = &.{
14866 .{ .kind = .id_ref, .quantifier = .required },
14867 .{ .kind = .id_ref, .quantifier = .required },
14868 .{ .kind = .id_ref, .quantifier = .required },
14869 .{ .kind = .id_ref, .quantifier = .required },
14870 .{ .kind = .id_ref, .quantifier = .required },
14871 .{ .kind = .id_ref, .quantifier = .required },
14872 .{ .kind = .id_ref, .quantifier = .required },
14873 .{ .kind = .id_ref, .quantifier = .required },
14874 .{ .kind = .id_ref, .quantifier = .required },
14875 },
14876 },
14877 .{
14878 .name = "OpSubgroup2DBlockStoreINTEL",
14879 .opcode = 6235,
14880 .operands = &.{
14881 .{ .kind = .id_ref, .quantifier = .required },
14882 .{ .kind = .id_ref, .quantifier = .required },
14883 .{ .kind = .id_ref, .quantifier = .required },
14884 .{ .kind = .id_ref, .quantifier = .required },
14885 .{ .kind = .id_ref, .quantifier = .required },
14886 .{ .kind = .id_ref, .quantifier = .required },
14887 .{ .kind = .id_ref, .quantifier = .required },
14888 .{ .kind = .id_ref, .quantifier = .required },
14889 .{ .kind = .id_ref, .quantifier = .required },
14890 .{ .kind = .id_ref, .quantifier = .required },
14891 },
14892 },
14893 .{
14894 .name = "OpSubgroupMatrixMultiplyAccumulateINTEL",
14895 .opcode = 6237,
14896 .operands = &.{
14897 .{ .kind = .id_result_type, .quantifier = .required },
14898 .{ .kind = .id_result, .quantifier = .required },
14899 .{ .kind = .id_ref, .quantifier = .required },
14900 .{ .kind = .id_ref, .quantifier = .required },
14901 .{ .kind = .id_ref, .quantifier = .required },
14902 .{ .kind = .id_ref, .quantifier = .required },
14903 .{ .kind = .matrix_multiply_accumulate_operands, .quantifier = .optional },
14904 },
14905 },
14906 .{
14907 .name = "OpBitwiseFunctionINTEL",
14908 .opcode = 6242,
14909 .operands = &.{
14910 .{ .kind = .id_result_type, .quantifier = .required },
14911 .{ .kind = .id_result, .quantifier = .required },
14912 .{ .kind = .id_ref, .quantifier = .required },
14913 .{ .kind = .id_ref, .quantifier = .required },
14914 .{ .kind = .id_ref, .quantifier = .required },
14915 .{ .kind = .id_ref, .quantifier = .required },
14916 },
14917 },
14918 .{
14919 .name = "OpUntypedVariableLengthArrayINTEL",
14920 .opcode = 6244,
14921 .operands = &.{
14922 .{ .kind = .id_result_type, .quantifier = .required },
14923 .{ .kind = .id_result, .quantifier = .required },
14924 .{ .kind = .id_ref, .quantifier = .required },
14925 .{ .kind = .id_ref, .quantifier = .required },
14926 },
14927 },
14928 .{
14929 .name = "OpConditionalExtensionINTEL",
14930 .opcode = 6248,
14931 .operands = &.{
14932 .{ .kind = .id_ref, .quantifier = .required },
14933 .{ .kind = .literal_string, .quantifier = .required },
14934 },
14935 },
14936 .{
14937 .name = "OpConditionalEntryPointINTEL",
14938 .opcode = 6249,
14939 .operands = &.{
14940 .{ .kind = .id_ref, .quantifier = .required },
14941 .{ .kind = .execution_model, .quantifier = .required },
14942 .{ .kind = .id_ref, .quantifier = .required },
14943 .{ .kind = .literal_string, .quantifier = .required },
14944 .{ .kind = .id_ref, .quantifier = .variadic },
14945 },
14946 },
14947 .{
14948 .name = "OpConditionalCapabilityINTEL",
14949 .opcode = 6250,
14950 .operands = &.{
14951 .{ .kind = .id_ref, .quantifier = .required },
14952 .{ .kind = .capability, .quantifier = .required },
14953 },
14954 },
14955 .{
14956 .name = "OpSpecConstantTargetINTEL",
14957 .opcode = 6251,
14958 .operands = &.{
14959 .{ .kind = .id_result_type, .quantifier = .required },
14960 .{ .kind = .id_result, .quantifier = .required },
14961 .{ .kind = .literal_integer, .quantifier = .required },
14962 .{ .kind = .literal_integer, .quantifier = .variadic },
14963 },
14964 },
14965 .{
14966 .name = "OpSpecConstantArchitectureINTEL",
14967 .opcode = 6252,
14968 .operands = &.{
14969 .{ .kind = .id_result_type, .quantifier = .required },
14970 .{ .kind = .id_result, .quantifier = .required },
14971 .{ .kind = .literal_integer, .quantifier = .required },
14972 .{ .kind = .literal_integer, .quantifier = .required },
14973 .{ .kind = .literal_integer, .quantifier = .required },
14974 .{ .kind = .literal_integer, .quantifier = .required },
14975 },
14976 },
14977 .{
14978 .name = "OpSpecConstantCapabilitiesINTEL",
14979 .opcode = 6253,
14980 .operands = &.{
14981 .{ .kind = .id_result_type, .quantifier = .required },
14982 .{ .kind = .id_result, .quantifier = .required },
14983 .{ .kind = .capability, .quantifier = .variadic },
14984 },
14985 },
14986 .{
14987 .name = "OpConditionalCopyObjectINTEL",
14988 .opcode = 6254,
14989 .operands = &.{
14990 .{ .kind = .id_result_type, .quantifier = .required },
14991 .{ .kind = .id_result, .quantifier = .required },
14992 .{ .kind = .id_ref, .quantifier = .variadic },
14993 },
14994 },
14995 .{
14996 .name = "OpGroupIMulKHR",
14997 .opcode = 6401,
14998 .operands = &.{
14999 .{ .kind = .id_result_type, .quantifier = .required },
15000 .{ .kind = .id_result, .quantifier = .required },
15001 .{ .kind = .id_scope, .quantifier = .required },
15002 .{ .kind = .group_operation, .quantifier = .required },
15003 .{ .kind = .id_ref, .quantifier = .required },
15004 },
15005 },
15006 .{
15007 .name = "OpGroupFMulKHR",
15008 .opcode = 6402,
15009 .operands = &.{
15010 .{ .kind = .id_result_type, .quantifier = .required },
15011 .{ .kind = .id_result, .quantifier = .required },
15012 .{ .kind = .id_scope, .quantifier = .required },
15013 .{ .kind = .group_operation, .quantifier = .required },
15014 .{ .kind = .id_ref, .quantifier = .required },
15015 },
15016 },
15017 .{
15018 .name = "OpGroupBitwiseAndKHR",
15019 .opcode = 6403,
15020 .operands = &.{
15021 .{ .kind = .id_result_type, .quantifier = .required },
15022 .{ .kind = .id_result, .quantifier = .required },
15023 .{ .kind = .id_scope, .quantifier = .required },
15024 .{ .kind = .group_operation, .quantifier = .required },
15025 .{ .kind = .id_ref, .quantifier = .required },
15026 },
15027 },
15028 .{
15029 .name = "OpGroupBitwiseOrKHR",
15030 .opcode = 6404,
15031 .operands = &.{
15032 .{ .kind = .id_result_type, .quantifier = .required },
15033 .{ .kind = .id_result, .quantifier = .required },
15034 .{ .kind = .id_scope, .quantifier = .required },
15035 .{ .kind = .group_operation, .quantifier = .required },
15036 .{ .kind = .id_ref, .quantifier = .required },
15037 },
15038 },
15039 .{
15040 .name = "OpGroupBitwiseXorKHR",
15041 .opcode = 6405,
15042 .operands = &.{
15043 .{ .kind = .id_result_type, .quantifier = .required },
15044 .{ .kind = .id_result, .quantifier = .required },
15045 .{ .kind = .id_scope, .quantifier = .required },
15046 .{ .kind = .group_operation, .quantifier = .required },
15047 .{ .kind = .id_ref, .quantifier = .required },
15048 },
15049 },
15050 .{
15051 .name = "OpGroupLogicalAndKHR",
15052 .opcode = 6406,
15053 .operands = &.{
15054 .{ .kind = .id_result_type, .quantifier = .required },
15055 .{ .kind = .id_result, .quantifier = .required },
15056 .{ .kind = .id_scope, .quantifier = .required },
15057 .{ .kind = .group_operation, .quantifier = .required },
15058 .{ .kind = .id_ref, .quantifier = .required },
15059 },
15060 },
15061 .{
15062 .name = "OpGroupLogicalOrKHR",
15063 .opcode = 6407,
15064 .operands = &.{
15065 .{ .kind = .id_result_type, .quantifier = .required },
15066 .{ .kind = .id_result, .quantifier = .required },
15067 .{ .kind = .id_scope, .quantifier = .required },
15068 .{ .kind = .group_operation, .quantifier = .required },
15069 .{ .kind = .id_ref, .quantifier = .required },
15070 },
15071 },
15072 .{
15073 .name = "OpGroupLogicalXorKHR",
15074 .opcode = 6408,
15075 .operands = &.{
15076 .{ .kind = .id_result_type, .quantifier = .required },
15077 .{ .kind = .id_result, .quantifier = .required },
15078 .{ .kind = .id_scope, .quantifier = .required },
15079 .{ .kind = .group_operation, .quantifier = .required },
15080 .{ .kind = .id_ref, .quantifier = .required },
15081 },
15082 },
15083 .{
15084 .name = "OpRoundFToTF32INTEL",
15085 .opcode = 6426,
15086 .operands = &.{
15087 .{ .kind = .id_result_type, .quantifier = .required },
15088 .{ .kind = .id_result, .quantifier = .required },
15089 .{ .kind = .id_ref, .quantifier = .required },
15090 },
15091 },
15092 .{
15093 .name = "OpMaskedGatherINTEL",
15094 .opcode = 6428,
15095 .operands = &.{
15096 .{ .kind = .id_result_type, .quantifier = .required },
15097 .{ .kind = .id_result, .quantifier = .required },
15098 .{ .kind = .id_ref, .quantifier = .required },
15099 .{ .kind = .literal_integer, .quantifier = .required },
15100 .{ .kind = .id_ref, .quantifier = .required },
15101 .{ .kind = .id_ref, .quantifier = .required },
15102 },
15103 },
15104 .{
15105 .name = "OpMaskedScatterINTEL",
15106 .opcode = 6429,
15107 .operands = &.{
15108 .{ .kind = .id_ref, .quantifier = .required },
15109 .{ .kind = .id_ref, .quantifier = .required },
15110 .{ .kind = .literal_integer, .quantifier = .required },
15111 .{ .kind = .id_ref, .quantifier = .required },
15112 },
15113 },
15114 .{
15115 .name = "OpConvertHandleToImageINTEL",
15116 .opcode = 6529,
15117 .operands = &.{
15118 .{ .kind = .id_result_type, .quantifier = .required },
15119 .{ .kind = .id_result, .quantifier = .required },
15120 .{ .kind = .id_ref, .quantifier = .required },
15121 },
15122 },
15123 .{
15124 .name = "OpConvertHandleToSamplerINTEL",
15125 .opcode = 6530,
15126 .operands = &.{
15127 .{ .kind = .id_result_type, .quantifier = .required },
15128 .{ .kind = .id_result, .quantifier = .required },
15129 .{ .kind = .id_ref, .quantifier = .required },
15130 },
15131 },
15132 .{
15133 .name = "OpConvertHandleToSampledImageINTEL",
15134 .opcode = 6531,
15135 .operands = &.{
15136 .{ .kind = .id_result_type, .quantifier = .required },
15137 .{ .kind = .id_result, .quantifier = .required },
15138 .{ .kind = .id_ref, .quantifier = .required },
15139 },
15140 },
15141 .{
15142 .name = "OpFDot2MixAcc32VALVE",
15143 .opcode = 6916,
15144 .operands = &.{
15145 .{ .kind = .id_result_type, .quantifier = .required },
15146 .{ .kind = .id_result, .quantifier = .required },
15147 .{ .kind = .id_ref, .quantifier = .required },
15148 .{ .kind = .id_ref, .quantifier = .required },
15149 .{ .kind = .id_ref, .quantifier = .required },
15150 },
15151 },
15152 .{
15153 .name = "OpFDot2MixAcc16VALVE",
15154 .opcode = 6917,
15155 .operands = &.{
15156 .{ .kind = .id_result_type, .quantifier = .required },
15157 .{ .kind = .id_result, .quantifier = .required },
15158 .{ .kind = .id_ref, .quantifier = .required },
15159 .{ .kind = .id_ref, .quantifier = .required },
15160 .{ .kind = .id_ref, .quantifier = .required },
15161 },
15162 },
15163 .{
15164 .name = "OpFDot4MixAcc32VALVE",
15165 .opcode = 6918,
15166 .operands = &.{
15167 .{ .kind = .id_result_type, .quantifier = .required },
15168 .{ .kind = .id_result, .quantifier = .required },
15169 .{ .kind = .id_ref, .quantifier = .required },
15170 .{ .kind = .id_ref, .quantifier = .required },
15171 .{ .kind = .id_ref, .quantifier = .required },
15172 },
15173 },
15174 },
15175 .@"OpenCL.std" => &.{
15176 .{
15177 .name = "acos",
15178 .opcode = 0,
15179 .operands = &.{
15180 .{ .kind = .id_ref, .quantifier = .required },
15181 },
15182 },
15183 .{
15184 .name = "acosh",
15185 .opcode = 1,
15186 .operands = &.{
15187 .{ .kind = .id_ref, .quantifier = .required },
15188 },
15189 },
15190 .{
15191 .name = "acospi",
15192 .opcode = 2,
15193 .operands = &.{
15194 .{ .kind = .id_ref, .quantifier = .required },
15195 },
15196 },
15197 .{
15198 .name = "asin",
15199 .opcode = 3,
15200 .operands = &.{
15201 .{ .kind = .id_ref, .quantifier = .required },
15202 },
15203 },
15204 .{
15205 .name = "asinh",
15206 .opcode = 4,
15207 .operands = &.{
15208 .{ .kind = .id_ref, .quantifier = .required },
15209 },
15210 },
15211 .{
15212 .name = "asinpi",
15213 .opcode = 5,
15214 .operands = &.{
15215 .{ .kind = .id_ref, .quantifier = .required },
15216 },
15217 },
15218 .{
15219 .name = "atan",
15220 .opcode = 6,
15221 .operands = &.{
15222 .{ .kind = .id_ref, .quantifier = .required },
15223 },
15224 },
15225 .{
15226 .name = "atan2",
15227 .opcode = 7,
15228 .operands = &.{
15229 .{ .kind = .id_ref, .quantifier = .required },
15230 .{ .kind = .id_ref, .quantifier = .required },
15231 },
15232 },
15233 .{
15234 .name = "atanh",
15235 .opcode = 8,
15236 .operands = &.{
15237 .{ .kind = .id_ref, .quantifier = .required },
15238 },
15239 },
15240 .{
15241 .name = "atanpi",
15242 .opcode = 9,
15243 .operands = &.{
15244 .{ .kind = .id_ref, .quantifier = .required },
15245 },
15246 },
15247 .{
15248 .name = "atan2pi",
15249 .opcode = 10,
15250 .operands = &.{
15251 .{ .kind = .id_ref, .quantifier = .required },
15252 .{ .kind = .id_ref, .quantifier = .required },
15253 },
15254 },
15255 .{
15256 .name = "cbrt",
15257 .opcode = 11,
15258 .operands = &.{
15259 .{ .kind = .id_ref, .quantifier = .required },
15260 },
15261 },
15262 .{
15263 .name = "ceil",
15264 .opcode = 12,
15265 .operands = &.{
15266 .{ .kind = .id_ref, .quantifier = .required },
15267 },
15268 },
15269 .{
15270 .name = "copysign",
15271 .opcode = 13,
15272 .operands = &.{
15273 .{ .kind = .id_ref, .quantifier = .required },
15274 .{ .kind = .id_ref, .quantifier = .required },
15275 },
15276 },
15277 .{
15278 .name = "cos",
15279 .opcode = 14,
15280 .operands = &.{
15281 .{ .kind = .id_ref, .quantifier = .required },
15282 },
15283 },
15284 .{
15285 .name = "cosh",
15286 .opcode = 15,
15287 .operands = &.{
15288 .{ .kind = .id_ref, .quantifier = .required },
15289 },
15290 },
15291 .{
15292 .name = "cospi",
15293 .opcode = 16,
15294 .operands = &.{
15295 .{ .kind = .id_ref, .quantifier = .required },
15296 },
15297 },
15298 .{
15299 .name = "erfc",
15300 .opcode = 17,
15301 .operands = &.{
15302 .{ .kind = .id_ref, .quantifier = .required },
15303 },
15304 },
15305 .{
15306 .name = "erf",
15307 .opcode = 18,
15308 .operands = &.{
15309 .{ .kind = .id_ref, .quantifier = .required },
15310 },
15311 },
15312 .{
15313 .name = "exp",
15314 .opcode = 19,
15315 .operands = &.{
15316 .{ .kind = .id_ref, .quantifier = .required },
15317 },
15318 },
15319 .{
15320 .name = "exp2",
15321 .opcode = 20,
15322 .operands = &.{
15323 .{ .kind = .id_ref, .quantifier = .required },
15324 },
15325 },
15326 .{
15327 .name = "exp10",
15328 .opcode = 21,
15329 .operands = &.{
15330 .{ .kind = .id_ref, .quantifier = .required },
15331 },
15332 },
15333 .{
15334 .name = "expm1",
15335 .opcode = 22,
15336 .operands = &.{
15337 .{ .kind = .id_ref, .quantifier = .required },
15338 },
15339 },
15340 .{
15341 .name = "fabs",
15342 .opcode = 23,
15343 .operands = &.{
15344 .{ .kind = .id_ref, .quantifier = .required },
15345 },
15346 },
15347 .{
15348 .name = "fdim",
15349 .opcode = 24,
15350 .operands = &.{
15351 .{ .kind = .id_ref, .quantifier = .required },
15352 .{ .kind = .id_ref, .quantifier = .required },
15353 },
15354 },
15355 .{
15356 .name = "floor",
15357 .opcode = 25,
15358 .operands = &.{
15359 .{ .kind = .id_ref, .quantifier = .required },
15360 },
15361 },
15362 .{
15363 .name = "fma",
15364 .opcode = 26,
15365 .operands = &.{
15366 .{ .kind = .id_ref, .quantifier = .required },
15367 .{ .kind = .id_ref, .quantifier = .required },
15368 .{ .kind = .id_ref, .quantifier = .required },
15369 },
15370 },
15371 .{
15372 .name = "fmax",
15373 .opcode = 27,
15374 .operands = &.{
15375 .{ .kind = .id_ref, .quantifier = .required },
15376 .{ .kind = .id_ref, .quantifier = .required },
15377 },
15378 },
15379 .{
15380 .name = "fmin",
15381 .opcode = 28,
15382 .operands = &.{
15383 .{ .kind = .id_ref, .quantifier = .required },
15384 .{ .kind = .id_ref, .quantifier = .required },
15385 },
15386 },
15387 .{
15388 .name = "fmod",
15389 .opcode = 29,
15390 .operands = &.{
15391 .{ .kind = .id_ref, .quantifier = .required },
15392 .{ .kind = .id_ref, .quantifier = .required },
15393 },
15394 },
15395 .{
15396 .name = "fract",
15397 .opcode = 30,
15398 .operands = &.{
15399 .{ .kind = .id_ref, .quantifier = .required },
15400 .{ .kind = .id_ref, .quantifier = .required },
15401 },
15402 },
15403 .{
15404 .name = "frexp",
15405 .opcode = 31,
15406 .operands = &.{
15407 .{ .kind = .id_ref, .quantifier = .required },
15408 .{ .kind = .id_ref, .quantifier = .required },
15409 },
15410 },
15411 .{
15412 .name = "hypot",
15413 .opcode = 32,
15414 .operands = &.{
15415 .{ .kind = .id_ref, .quantifier = .required },
15416 .{ .kind = .id_ref, .quantifier = .required },
15417 },
15418 },
15419 .{
15420 .name = "ilogb",
15421 .opcode = 33,
15422 .operands = &.{
15423 .{ .kind = .id_ref, .quantifier = .required },
15424 },
15425 },
15426 .{
15427 .name = "ldexp",
15428 .opcode = 34,
15429 .operands = &.{
15430 .{ .kind = .id_ref, .quantifier = .required },
15431 .{ .kind = .id_ref, .quantifier = .required },
15432 },
15433 },
15434 .{
15435 .name = "lgamma",
15436 .opcode = 35,
15437 .operands = &.{
15438 .{ .kind = .id_ref, .quantifier = .required },
15439 },
15440 },
15441 .{
15442 .name = "lgamma_r",
15443 .opcode = 36,
15444 .operands = &.{
15445 .{ .kind = .id_ref, .quantifier = .required },
15446 .{ .kind = .id_ref, .quantifier = .required },
15447 },
15448 },
15449 .{
15450 .name = "log",
15451 .opcode = 37,
15452 .operands = &.{
15453 .{ .kind = .id_ref, .quantifier = .required },
15454 },
15455 },
15456 .{
15457 .name = "log2",
15458 .opcode = 38,
15459 .operands = &.{
15460 .{ .kind = .id_ref, .quantifier = .required },
15461 },
15462 },
15463 .{
15464 .name = "log10",
15465 .opcode = 39,
15466 .operands = &.{
15467 .{ .kind = .id_ref, .quantifier = .required },
15468 },
15469 },
15470 .{
15471 .name = "log1p",
15472 .opcode = 40,
15473 .operands = &.{
15474 .{ .kind = .id_ref, .quantifier = .required },
15475 },
15476 },
15477 .{
15478 .name = "logb",
15479 .opcode = 41,
15480 .operands = &.{
15481 .{ .kind = .id_ref, .quantifier = .required },
15482 },
15483 },
15484 .{
15485 .name = "mad",
15486 .opcode = 42,
15487 .operands = &.{
15488 .{ .kind = .id_ref, .quantifier = .required },
15489 .{ .kind = .id_ref, .quantifier = .required },
15490 .{ .kind = .id_ref, .quantifier = .required },
15491 },
15492 },
15493 .{
15494 .name = "maxmag",
15495 .opcode = 43,
15496 .operands = &.{
15497 .{ .kind = .id_ref, .quantifier = .required },
15498 .{ .kind = .id_ref, .quantifier = .required },
15499 },
15500 },
15501 .{
15502 .name = "minmag",
15503 .opcode = 44,
15504 .operands = &.{
15505 .{ .kind = .id_ref, .quantifier = .required },
15506 .{ .kind = .id_ref, .quantifier = .required },
15507 },
15508 },
15509 .{
15510 .name = "modf",
15511 .opcode = 45,
15512 .operands = &.{
15513 .{ .kind = .id_ref, .quantifier = .required },
15514 .{ .kind = .id_ref, .quantifier = .required },
15515 },
15516 },
15517 .{
15518 .name = "nan",
15519 .opcode = 46,
15520 .operands = &.{
15521 .{ .kind = .id_ref, .quantifier = .required },
15522 },
15523 },
15524 .{
15525 .name = "nextafter",
15526 .opcode = 47,
15527 .operands = &.{
15528 .{ .kind = .id_ref, .quantifier = .required },
15529 .{ .kind = .id_ref, .quantifier = .required },
15530 },
15531 },
15532 .{
15533 .name = "pow",
15534 .opcode = 48,
15535 .operands = &.{
15536 .{ .kind = .id_ref, .quantifier = .required },
15537 .{ .kind = .id_ref, .quantifier = .required },
15538 },
15539 },
15540 .{
15541 .name = "pown",
15542 .opcode = 49,
15543 .operands = &.{
15544 .{ .kind = .id_ref, .quantifier = .required },
15545 .{ .kind = .id_ref, .quantifier = .required },
15546 },
15547 },
15548 .{
15549 .name = "powr",
15550 .opcode = 50,
15551 .operands = &.{
15552 .{ .kind = .id_ref, .quantifier = .required },
15553 .{ .kind = .id_ref, .quantifier = .required },
15554 },
15555 },
15556 .{
15557 .name = "remainder",
15558 .opcode = 51,
15559 .operands = &.{
15560 .{ .kind = .id_ref, .quantifier = .required },
15561 .{ .kind = .id_ref, .quantifier = .required },
15562 },
15563 },
15564 .{
15565 .name = "remquo",
15566 .opcode = 52,
15567 .operands = &.{
15568 .{ .kind = .id_ref, .quantifier = .required },
15569 .{ .kind = .id_ref, .quantifier = .required },
15570 .{ .kind = .id_ref, .quantifier = .required },
15571 },
15572 },
15573 .{
15574 .name = "rint",
15575 .opcode = 53,
15576 .operands = &.{
15577 .{ .kind = .id_ref, .quantifier = .required },
15578 },
15579 },
15580 .{
15581 .name = "rootn",
15582 .opcode = 54,
15583 .operands = &.{
15584 .{ .kind = .id_ref, .quantifier = .required },
15585 .{ .kind = .id_ref, .quantifier = .required },
15586 },
15587 },
15588 .{
15589 .name = "round",
15590 .opcode = 55,
15591 .operands = &.{
15592 .{ .kind = .id_ref, .quantifier = .required },
15593 },
15594 },
15595 .{
15596 .name = "rsqrt",
15597 .opcode = 56,
15598 .operands = &.{
15599 .{ .kind = .id_ref, .quantifier = .required },
15600 },
15601 },
15602 .{
15603 .name = "sin",
15604 .opcode = 57,
15605 .operands = &.{
15606 .{ .kind = .id_ref, .quantifier = .required },
15607 },
15608 },
15609 .{
15610 .name = "sincos",
15611 .opcode = 58,
15612 .operands = &.{
15613 .{ .kind = .id_ref, .quantifier = .required },
15614 .{ .kind = .id_ref, .quantifier = .required },
15615 },
15616 },
15617 .{
15618 .name = "sinh",
15619 .opcode = 59,
15620 .operands = &.{
15621 .{ .kind = .id_ref, .quantifier = .required },
15622 },
15623 },
15624 .{
15625 .name = "sinpi",
15626 .opcode = 60,
15627 .operands = &.{
15628 .{ .kind = .id_ref, .quantifier = .required },
15629 },
15630 },
15631 .{
15632 .name = "sqrt",
15633 .opcode = 61,
15634 .operands = &.{
15635 .{ .kind = .id_ref, .quantifier = .required },
15636 },
15637 },
15638 .{
15639 .name = "tan",
15640 .opcode = 62,
15641 .operands = &.{
15642 .{ .kind = .id_ref, .quantifier = .required },
15643 },
15644 },
15645 .{
15646 .name = "tanh",
15647 .opcode = 63,
15648 .operands = &.{
15649 .{ .kind = .id_ref, .quantifier = .required },
15650 },
15651 },
15652 .{
15653 .name = "tanpi",
15654 .opcode = 64,
15655 .operands = &.{
15656 .{ .kind = .id_ref, .quantifier = .required },
15657 },
15658 },
15659 .{
15660 .name = "tgamma",
15661 .opcode = 65,
15662 .operands = &.{
15663 .{ .kind = .id_ref, .quantifier = .required },
15664 },
15665 },
15666 .{
15667 .name = "trunc",
15668 .opcode = 66,
15669 .operands = &.{
15670 .{ .kind = .id_ref, .quantifier = .required },
15671 },
15672 },
15673 .{
15674 .name = "half_cos",
15675 .opcode = 67,
15676 .operands = &.{
15677 .{ .kind = .id_ref, .quantifier = .required },
15678 },
15679 },
15680 .{
15681 .name = "half_divide",
15682 .opcode = 68,
15683 .operands = &.{
15684 .{ .kind = .id_ref, .quantifier = .required },
15685 .{ .kind = .id_ref, .quantifier = .required },
15686 },
15687 },
15688 .{
15689 .name = "half_exp",
15690 .opcode = 69,
15691 .operands = &.{
15692 .{ .kind = .id_ref, .quantifier = .required },
15693 },
15694 },
15695 .{
15696 .name = "half_exp2",
15697 .opcode = 70,
15698 .operands = &.{
15699 .{ .kind = .id_ref, .quantifier = .required },
15700 },
15701 },
15702 .{
15703 .name = "half_exp10",
15704 .opcode = 71,
15705 .operands = &.{
15706 .{ .kind = .id_ref, .quantifier = .required },
15707 },
15708 },
15709 .{
15710 .name = "half_log",
15711 .opcode = 72,
15712 .operands = &.{
15713 .{ .kind = .id_ref, .quantifier = .required },
15714 },
15715 },
15716 .{
15717 .name = "half_log2",
15718 .opcode = 73,
15719 .operands = &.{
15720 .{ .kind = .id_ref, .quantifier = .required },
15721 },
15722 },
15723 .{
15724 .name = "half_log10",
15725 .opcode = 74,
15726 .operands = &.{
15727 .{ .kind = .id_ref, .quantifier = .required },
15728 },
15729 },
15730 .{
15731 .name = "half_powr",
15732 .opcode = 75,
15733 .operands = &.{
15734 .{ .kind = .id_ref, .quantifier = .required },
15735 .{ .kind = .id_ref, .quantifier = .required },
15736 },
15737 },
15738 .{
15739 .name = "half_recip",
15740 .opcode = 76,
15741 .operands = &.{
15742 .{ .kind = .id_ref, .quantifier = .required },
15743 },
15744 },
15745 .{
15746 .name = "half_rsqrt",
15747 .opcode = 77,
15748 .operands = &.{
15749 .{ .kind = .id_ref, .quantifier = .required },
15750 },
15751 },
15752 .{
15753 .name = "half_sin",
15754 .opcode = 78,
15755 .operands = &.{
15756 .{ .kind = .id_ref, .quantifier = .required },
15757 },
15758 },
15759 .{
15760 .name = "half_sqrt",
15761 .opcode = 79,
15762 .operands = &.{
15763 .{ .kind = .id_ref, .quantifier = .required },
15764 },
15765 },
15766 .{
15767 .name = "half_tan",
15768 .opcode = 80,
15769 .operands = &.{
15770 .{ .kind = .id_ref, .quantifier = .required },
15771 },
15772 },
15773 .{
15774 .name = "native_cos",
15775 .opcode = 81,
15776 .operands = &.{
15777 .{ .kind = .id_ref, .quantifier = .required },
15778 },
15779 },
15780 .{
15781 .name = "native_divide",
15782 .opcode = 82,
15783 .operands = &.{
15784 .{ .kind = .id_ref, .quantifier = .required },
15785 .{ .kind = .id_ref, .quantifier = .required },
15786 },
15787 },
15788 .{
15789 .name = "native_exp",
15790 .opcode = 83,
15791 .operands = &.{
15792 .{ .kind = .id_ref, .quantifier = .required },
15793 },
15794 },
15795 .{
15796 .name = "native_exp2",
15797 .opcode = 84,
15798 .operands = &.{
15799 .{ .kind = .id_ref, .quantifier = .required },
15800 },
15801 },
15802 .{
15803 .name = "native_exp10",
15804 .opcode = 85,
15805 .operands = &.{
15806 .{ .kind = .id_ref, .quantifier = .required },
15807 },
15808 },
15809 .{
15810 .name = "native_log",
15811 .opcode = 86,
15812 .operands = &.{
15813 .{ .kind = .id_ref, .quantifier = .required },
15814 },
15815 },
15816 .{
15817 .name = "native_log2",
15818 .opcode = 87,
15819 .operands = &.{
15820 .{ .kind = .id_ref, .quantifier = .required },
15821 },
15822 },
15823 .{
15824 .name = "native_log10",
15825 .opcode = 88,
15826 .operands = &.{
15827 .{ .kind = .id_ref, .quantifier = .required },
15828 },
15829 },
15830 .{
15831 .name = "native_powr",
15832 .opcode = 89,
15833 .operands = &.{
15834 .{ .kind = .id_ref, .quantifier = .required },
15835 .{ .kind = .id_ref, .quantifier = .required },
15836 },
15837 },
15838 .{
15839 .name = "native_recip",
15840 .opcode = 90,
15841 .operands = &.{
15842 .{ .kind = .id_ref, .quantifier = .required },
15843 },
15844 },
15845 .{
15846 .name = "native_rsqrt",
15847 .opcode = 91,
15848 .operands = &.{
15849 .{ .kind = .id_ref, .quantifier = .required },
15850 },
15851 },
15852 .{
15853 .name = "native_sin",
15854 .opcode = 92,
15855 .operands = &.{
15856 .{ .kind = .id_ref, .quantifier = .required },
15857 },
15858 },
15859 .{
15860 .name = "native_sqrt",
15861 .opcode = 93,
15862 .operands = &.{
15863 .{ .kind = .id_ref, .quantifier = .required },
15864 },
15865 },
15866 .{
15867 .name = "native_tan",
15868 .opcode = 94,
15869 .operands = &.{
15870 .{ .kind = .id_ref, .quantifier = .required },
15871 },
15872 },
15873 .{
15874 .name = "fclamp",
15875 .opcode = 95,
15876 .operands = &.{
15877 .{ .kind = .id_ref, .quantifier = .required },
15878 .{ .kind = .id_ref, .quantifier = .required },
15879 .{ .kind = .id_ref, .quantifier = .required },
15880 },
15881 },
15882 .{
15883 .name = "degrees",
15884 .opcode = 96,
15885 .operands = &.{
15886 .{ .kind = .id_ref, .quantifier = .required },
15887 },
15888 },
15889 .{
15890 .name = "fmax_common",
15891 .opcode = 97,
15892 .operands = &.{
15893 .{ .kind = .id_ref, .quantifier = .required },
15894 .{ .kind = .id_ref, .quantifier = .required },
15895 },
15896 },
15897 .{
15898 .name = "fmin_common",
15899 .opcode = 98,
15900 .operands = &.{
15901 .{ .kind = .id_ref, .quantifier = .required },
15902 .{ .kind = .id_ref, .quantifier = .required },
15903 },
15904 },
15905 .{
15906 .name = "mix",
15907 .opcode = 99,
15908 .operands = &.{
15909 .{ .kind = .id_ref, .quantifier = .required },
15910 .{ .kind = .id_ref, .quantifier = .required },
15911 .{ .kind = .id_ref, .quantifier = .required },
15912 },
15913 },
15914 .{
15915 .name = "radians",
15916 .opcode = 100,
15917 .operands = &.{
15918 .{ .kind = .id_ref, .quantifier = .required },
15919 },
15920 },
15921 .{
15922 .name = "step",
15923 .opcode = 101,
15924 .operands = &.{
15925 .{ .kind = .id_ref, .quantifier = .required },
15926 .{ .kind = .id_ref, .quantifier = .required },
15927 },
15928 },
15929 .{
15930 .name = "smoothstep",
15931 .opcode = 102,
15932 .operands = &.{
15933 .{ .kind = .id_ref, .quantifier = .required },
15934 .{ .kind = .id_ref, .quantifier = .required },
15935 .{ .kind = .id_ref, .quantifier = .required },
15936 },
15937 },
15938 .{
15939 .name = "sign",
15940 .opcode = 103,
15941 .operands = &.{
15942 .{ .kind = .id_ref, .quantifier = .required },
15943 },
15944 },
15945 .{
15946 .name = "cross",
15947 .opcode = 104,
15948 .operands = &.{
15949 .{ .kind = .id_ref, .quantifier = .required },
15950 .{ .kind = .id_ref, .quantifier = .required },
15951 },
15952 },
15953 .{
15954 .name = "distance",
15955 .opcode = 105,
15956 .operands = &.{
15957 .{ .kind = .id_ref, .quantifier = .required },
15958 .{ .kind = .id_ref, .quantifier = .required },
15959 },
15960 },
15961 .{
15962 .name = "length",
15963 .opcode = 106,
15964 .operands = &.{
15965 .{ .kind = .id_ref, .quantifier = .required },
15966 },
15967 },
15968 .{
15969 .name = "normalize",
15970 .opcode = 107,
15971 .operands = &.{
15972 .{ .kind = .id_ref, .quantifier = .required },
15973 },
15974 },
15975 .{
15976 .name = "fast_distance",
15977 .opcode = 108,
15978 .operands = &.{
15979 .{ .kind = .id_ref, .quantifier = .required },
15980 .{ .kind = .id_ref, .quantifier = .required },
15981 },
15982 },
15983 .{
15984 .name = "fast_length",
15985 .opcode = 109,
15986 .operands = &.{
15987 .{ .kind = .id_ref, .quantifier = .required },
15988 },
15989 },
15990 .{
15991 .name = "fast_normalize",
15992 .opcode = 110,
15993 .operands = &.{
15994 .{ .kind = .id_ref, .quantifier = .required },
15995 },
15996 },
15997 .{
15998 .name = "s_abs",
15999 .opcode = 141,
16000 .operands = &.{
16001 .{ .kind = .id_ref, .quantifier = .required },
16002 },
16003 },
16004 .{
16005 .name = "s_abs_diff",
16006 .opcode = 142,
16007 .operands = &.{
16008 .{ .kind = .id_ref, .quantifier = .required },
16009 .{ .kind = .id_ref, .quantifier = .required },
16010 },
16011 },
16012 .{
16013 .name = "s_add_sat",
16014 .opcode = 143,
16015 .operands = &.{
16016 .{ .kind = .id_ref, .quantifier = .required },
16017 .{ .kind = .id_ref, .quantifier = .required },
16018 },
16019 },
16020 .{
16021 .name = "u_add_sat",
16022 .opcode = 144,
16023 .operands = &.{
16024 .{ .kind = .id_ref, .quantifier = .required },
16025 .{ .kind = .id_ref, .quantifier = .required },
16026 },
16027 },
16028 .{
16029 .name = "s_hadd",
16030 .opcode = 145,
16031 .operands = &.{
16032 .{ .kind = .id_ref, .quantifier = .required },
16033 .{ .kind = .id_ref, .quantifier = .required },
16034 },
16035 },
16036 .{
16037 .name = "u_hadd",
16038 .opcode = 146,
16039 .operands = &.{
16040 .{ .kind = .id_ref, .quantifier = .required },
16041 .{ .kind = .id_ref, .quantifier = .required },
16042 },
16043 },
16044 .{
16045 .name = "s_rhadd",
16046 .opcode = 147,
16047 .operands = &.{
16048 .{ .kind = .id_ref, .quantifier = .required },
16049 .{ .kind = .id_ref, .quantifier = .required },
16050 },
16051 },
16052 .{
16053 .name = "u_rhadd",
16054 .opcode = 148,
16055 .operands = &.{
16056 .{ .kind = .id_ref, .quantifier = .required },
16057 .{ .kind = .id_ref, .quantifier = .required },
16058 },
16059 },
16060 .{
16061 .name = "s_clamp",
16062 .opcode = 149,
16063 .operands = &.{
16064 .{ .kind = .id_ref, .quantifier = .required },
16065 .{ .kind = .id_ref, .quantifier = .required },
16066 .{ .kind = .id_ref, .quantifier = .required },
16067 },
16068 },
16069 .{
16070 .name = "u_clamp",
16071 .opcode = 150,
16072 .operands = &.{
16073 .{ .kind = .id_ref, .quantifier = .required },
16074 .{ .kind = .id_ref, .quantifier = .required },
16075 .{ .kind = .id_ref, .quantifier = .required },
16076 },
16077 },
16078 .{
16079 .name = "clz",
16080 .opcode = 151,
16081 .operands = &.{
16082 .{ .kind = .id_ref, .quantifier = .required },
16083 },
16084 },
16085 .{
16086 .name = "ctz",
16087 .opcode = 152,
16088 .operands = &.{
16089 .{ .kind = .id_ref, .quantifier = .required },
16090 },
16091 },
16092 .{
16093 .name = "s_mad_hi",
16094 .opcode = 153,
16095 .operands = &.{
16096 .{ .kind = .id_ref, .quantifier = .required },
16097 .{ .kind = .id_ref, .quantifier = .required },
16098 .{ .kind = .id_ref, .quantifier = .required },
16099 },
16100 },
16101 .{
16102 .name = "u_mad_sat",
16103 .opcode = 154,
16104 .operands = &.{
16105 .{ .kind = .id_ref, .quantifier = .required },
16106 .{ .kind = .id_ref, .quantifier = .required },
16107 .{ .kind = .id_ref, .quantifier = .required },
16108 },
16109 },
16110 .{
16111 .name = "s_mad_sat",
16112 .opcode = 155,
16113 .operands = &.{
16114 .{ .kind = .id_ref, .quantifier = .required },
16115 .{ .kind = .id_ref, .quantifier = .required },
16116 .{ .kind = .id_ref, .quantifier = .required },
16117 },
16118 },
16119 .{
16120 .name = "s_max",
16121 .opcode = 156,
16122 .operands = &.{
16123 .{ .kind = .id_ref, .quantifier = .required },
16124 .{ .kind = .id_ref, .quantifier = .required },
16125 },
16126 },
16127 .{
16128 .name = "u_max",
16129 .opcode = 157,
16130 .operands = &.{
16131 .{ .kind = .id_ref, .quantifier = .required },
16132 .{ .kind = .id_ref, .quantifier = .required },
16133 },
16134 },
16135 .{
16136 .name = "s_min",
16137 .opcode = 158,
16138 .operands = &.{
16139 .{ .kind = .id_ref, .quantifier = .required },
16140 .{ .kind = .id_ref, .quantifier = .required },
16141 },
16142 },
16143 .{
16144 .name = "u_min",
16145 .opcode = 159,
16146 .operands = &.{
16147 .{ .kind = .id_ref, .quantifier = .required },
16148 .{ .kind = .id_ref, .quantifier = .required },
16149 },
16150 },
16151 .{
16152 .name = "s_mul_hi",
16153 .opcode = 160,
16154 .operands = &.{
16155 .{ .kind = .id_ref, .quantifier = .required },
16156 .{ .kind = .id_ref, .quantifier = .required },
16157 },
16158 },
16159 .{
16160 .name = "rotate",
16161 .opcode = 161,
16162 .operands = &.{
16163 .{ .kind = .id_ref, .quantifier = .required },
16164 .{ .kind = .id_ref, .quantifier = .required },
16165 },
16166 },
16167 .{
16168 .name = "s_sub_sat",
16169 .opcode = 162,
16170 .operands = &.{
16171 .{ .kind = .id_ref, .quantifier = .required },
16172 .{ .kind = .id_ref, .quantifier = .required },
16173 },
16174 },
16175 .{
16176 .name = "u_sub_sat",
16177 .opcode = 163,
16178 .operands = &.{
16179 .{ .kind = .id_ref, .quantifier = .required },
16180 .{ .kind = .id_ref, .quantifier = .required },
16181 },
16182 },
16183 .{
16184 .name = "u_upsample",
16185 .opcode = 164,
16186 .operands = &.{
16187 .{ .kind = .id_ref, .quantifier = .required },
16188 .{ .kind = .id_ref, .quantifier = .required },
16189 },
16190 },
16191 .{
16192 .name = "s_upsample",
16193 .opcode = 165,
16194 .operands = &.{
16195 .{ .kind = .id_ref, .quantifier = .required },
16196 .{ .kind = .id_ref, .quantifier = .required },
16197 },
16198 },
16199 .{
16200 .name = "popcount",
16201 .opcode = 166,
16202 .operands = &.{
16203 .{ .kind = .id_ref, .quantifier = .required },
16204 },
16205 },
16206 .{
16207 .name = "s_mad24",
16208 .opcode = 167,
16209 .operands = &.{
16210 .{ .kind = .id_ref, .quantifier = .required },
16211 .{ .kind = .id_ref, .quantifier = .required },
16212 .{ .kind = .id_ref, .quantifier = .required },
16213 },
16214 },
16215 .{
16216 .name = "u_mad24",
16217 .opcode = 168,
16218 .operands = &.{
16219 .{ .kind = .id_ref, .quantifier = .required },
16220 .{ .kind = .id_ref, .quantifier = .required },
16221 .{ .kind = .id_ref, .quantifier = .required },
16222 },
16223 },
16224 .{
16225 .name = "s_mul24",
16226 .opcode = 169,
16227 .operands = &.{
16228 .{ .kind = .id_ref, .quantifier = .required },
16229 .{ .kind = .id_ref, .quantifier = .required },
16230 },
16231 },
16232 .{
16233 .name = "u_mul24",
16234 .opcode = 170,
16235 .operands = &.{
16236 .{ .kind = .id_ref, .quantifier = .required },
16237 .{ .kind = .id_ref, .quantifier = .required },
16238 },
16239 },
16240 .{
16241 .name = "vloadn",
16242 .opcode = 171,
16243 .operands = &.{
16244 .{ .kind = .id_ref, .quantifier = .required },
16245 .{ .kind = .id_ref, .quantifier = .required },
16246 .{ .kind = .literal_integer, .quantifier = .required },
16247 },
16248 },
16249 .{
16250 .name = "vstoren",
16251 .opcode = 172,
16252 .operands = &.{
16253 .{ .kind = .id_ref, .quantifier = .required },
16254 .{ .kind = .id_ref, .quantifier = .required },
16255 .{ .kind = .id_ref, .quantifier = .required },
16256 },
16257 },
16258 .{
16259 .name = "vload_half",
16260 .opcode = 173,
16261 .operands = &.{
16262 .{ .kind = .id_ref, .quantifier = .required },
16263 .{ .kind = .id_ref, .quantifier = .required },
16264 },
16265 },
16266 .{
16267 .name = "vload_halfn",
16268 .opcode = 174,
16269 .operands = &.{
16270 .{ .kind = .id_ref, .quantifier = .required },
16271 .{ .kind = .id_ref, .quantifier = .required },
16272 .{ .kind = .literal_integer, .quantifier = .required },
16273 },
16274 },
16275 .{
16276 .name = "vstore_half",
16277 .opcode = 175,
16278 .operands = &.{
16279 .{ .kind = .id_ref, .quantifier = .required },
16280 .{ .kind = .id_ref, .quantifier = .required },
16281 .{ .kind = .id_ref, .quantifier = .required },
16282 },
16283 },
16284 .{
16285 .name = "vstore_half_r",
16286 .opcode = 176,
16287 .operands = &.{
16288 .{ .kind = .id_ref, .quantifier = .required },
16289 .{ .kind = .id_ref, .quantifier = .required },
16290 .{ .kind = .id_ref, .quantifier = .required },
16291 .{ .kind = .fp_rounding_mode, .quantifier = .required },
16292 },
16293 },
16294 .{
16295 .name = "vstore_halfn",
16296 .opcode = 177,
16297 .operands = &.{
16298 .{ .kind = .id_ref, .quantifier = .required },
16299 .{ .kind = .id_ref, .quantifier = .required },
16300 .{ .kind = .id_ref, .quantifier = .required },
16301 },
16302 },
16303 .{
16304 .name = "vstore_halfn_r",
16305 .opcode = 178,
16306 .operands = &.{
16307 .{ .kind = .id_ref, .quantifier = .required },
16308 .{ .kind = .id_ref, .quantifier = .required },
16309 .{ .kind = .id_ref, .quantifier = .required },
16310 .{ .kind = .fp_rounding_mode, .quantifier = .required },
16311 },
16312 },
16313 .{
16314 .name = "vloada_halfn",
16315 .opcode = 179,
16316 .operands = &.{
16317 .{ .kind = .id_ref, .quantifier = .required },
16318 .{ .kind = .id_ref, .quantifier = .required },
16319 .{ .kind = .literal_integer, .quantifier = .required },
16320 },
16321 },
16322 .{
16323 .name = "vstorea_halfn",
16324 .opcode = 180,
16325 .operands = &.{
16326 .{ .kind = .id_ref, .quantifier = .required },
16327 .{ .kind = .id_ref, .quantifier = .required },
16328 .{ .kind = .id_ref, .quantifier = .required },
16329 },
16330 },
16331 .{
16332 .name = "vstorea_halfn_r",
16333 .opcode = 181,
16334 .operands = &.{
16335 .{ .kind = .id_ref, .quantifier = .required },
16336 .{ .kind = .id_ref, .quantifier = .required },
16337 .{ .kind = .id_ref, .quantifier = .required },
16338 .{ .kind = .fp_rounding_mode, .quantifier = .required },
16339 },
16340 },
16341 .{
16342 .name = "shuffle",
16343 .opcode = 182,
16344 .operands = &.{
16345 .{ .kind = .id_ref, .quantifier = .required },
16346 .{ .kind = .id_ref, .quantifier = .required },
16347 },
16348 },
16349 .{
16350 .name = "shuffle2",
16351 .opcode = 183,
16352 .operands = &.{
16353 .{ .kind = .id_ref, .quantifier = .required },
16354 .{ .kind = .id_ref, .quantifier = .required },
16355 .{ .kind = .id_ref, .quantifier = .required },
16356 },
16357 },
16358 .{
16359 .name = "printf",
16360 .opcode = 184,
16361 .operands = &.{
16362 .{ .kind = .id_ref, .quantifier = .required },
16363 .{ .kind = .id_ref, .quantifier = .variadic },
16364 },
16365 },
16366 .{
16367 .name = "prefetch",
16368 .opcode = 185,
16369 .operands = &.{
16370 .{ .kind = .id_ref, .quantifier = .required },
16371 .{ .kind = .id_ref, .quantifier = .required },
16372 },
16373 },
16374 .{
16375 .name = "bitselect",
16376 .opcode = 186,
16377 .operands = &.{
16378 .{ .kind = .id_ref, .quantifier = .required },
16379 .{ .kind = .id_ref, .quantifier = .required },
16380 .{ .kind = .id_ref, .quantifier = .required },
16381 },
16382 },
16383 .{
16384 .name = "select",
16385 .opcode = 187,
16386 .operands = &.{
16387 .{ .kind = .id_ref, .quantifier = .required },
16388 .{ .kind = .id_ref, .quantifier = .required },
16389 .{ .kind = .id_ref, .quantifier = .required },
16390 },
16391 },
16392 .{
16393 .name = "u_abs",
16394 .opcode = 201,
16395 .operands = &.{
16396 .{ .kind = .id_ref, .quantifier = .required },
16397 },
16398 },
16399 .{
16400 .name = "u_abs_diff",
16401 .opcode = 202,
16402 .operands = &.{
16403 .{ .kind = .id_ref, .quantifier = .required },
16404 .{ .kind = .id_ref, .quantifier = .required },
16405 },
16406 },
16407 .{
16408 .name = "u_mul_hi",
16409 .opcode = 203,
16410 .operands = &.{
16411 .{ .kind = .id_ref, .quantifier = .required },
16412 .{ .kind = .id_ref, .quantifier = .required },
16413 },
16414 },
16415 .{
16416 .name = "u_mad_hi",
16417 .opcode = 204,
16418 .operands = &.{
16419 .{ .kind = .id_ref, .quantifier = .required },
16420 .{ .kind = .id_ref, .quantifier = .required },
16421 .{ .kind = .id_ref, .quantifier = .required },
16422 },
16423 },
16424 },
16425 .@"GLSL.std.450" => &.{
16426 .{
16427 .name = "Round",
16428 .opcode = 1,
16429 .operands = &.{
16430 .{ .kind = .id_ref, .quantifier = .required },
16431 },
16432 },
16433 .{
16434 .name = "RoundEven",
16435 .opcode = 2,
16436 .operands = &.{
16437 .{ .kind = .id_ref, .quantifier = .required },
16438 },
16439 },
16440 .{
16441 .name = "Trunc",
16442 .opcode = 3,
16443 .operands = &.{
16444 .{ .kind = .id_ref, .quantifier = .required },
16445 },
16446 },
16447 .{
16448 .name = "FAbs",
16449 .opcode = 4,
16450 .operands = &.{
16451 .{ .kind = .id_ref, .quantifier = .required },
16452 },
16453 },
16454 .{
16455 .name = "SAbs",
16456 .opcode = 5,
16457 .operands = &.{
16458 .{ .kind = .id_ref, .quantifier = .required },
16459 },
16460 },
16461 .{
16462 .name = "FSign",
16463 .opcode = 6,
16464 .operands = &.{
16465 .{ .kind = .id_ref, .quantifier = .required },
16466 },
16467 },
16468 .{
16469 .name = "SSign",
16470 .opcode = 7,
16471 .operands = &.{
16472 .{ .kind = .id_ref, .quantifier = .required },
16473 },
16474 },
16475 .{
16476 .name = "Floor",
16477 .opcode = 8,
16478 .operands = &.{
16479 .{ .kind = .id_ref, .quantifier = .required },
16480 },
16481 },
16482 .{
16483 .name = "Ceil",
16484 .opcode = 9,
16485 .operands = &.{
16486 .{ .kind = .id_ref, .quantifier = .required },
16487 },
16488 },
16489 .{
16490 .name = "Fract",
16491 .opcode = 10,
16492 .operands = &.{
16493 .{ .kind = .id_ref, .quantifier = .required },
16494 },
16495 },
16496 .{
16497 .name = "Radians",
16498 .opcode = 11,
16499 .operands = &.{
16500 .{ .kind = .id_ref, .quantifier = .required },
16501 },
16502 },
16503 .{
16504 .name = "Degrees",
16505 .opcode = 12,
16506 .operands = &.{
16507 .{ .kind = .id_ref, .quantifier = .required },
16508 },
16509 },
16510 .{
16511 .name = "Sin",
16512 .opcode = 13,
16513 .operands = &.{
16514 .{ .kind = .id_ref, .quantifier = .required },
16515 },
16516 },
16517 .{
16518 .name = "Cos",
16519 .opcode = 14,
16520 .operands = &.{
16521 .{ .kind = .id_ref, .quantifier = .required },
16522 },
16523 },
16524 .{
16525 .name = "Tan",
16526 .opcode = 15,
16527 .operands = &.{
16528 .{ .kind = .id_ref, .quantifier = .required },
16529 },
16530 },
16531 .{
16532 .name = "Asin",
16533 .opcode = 16,
16534 .operands = &.{
16535 .{ .kind = .id_ref, .quantifier = .required },
16536 },
16537 },
16538 .{
16539 .name = "Acos",
16540 .opcode = 17,
16541 .operands = &.{
16542 .{ .kind = .id_ref, .quantifier = .required },
16543 },
16544 },
16545 .{
16546 .name = "Atan",
16547 .opcode = 18,
16548 .operands = &.{
16549 .{ .kind = .id_ref, .quantifier = .required },
16550 },
16551 },
16552 .{
16553 .name = "Sinh",
16554 .opcode = 19,
16555 .operands = &.{
16556 .{ .kind = .id_ref, .quantifier = .required },
16557 },
16558 },
16559 .{
16560 .name = "Cosh",
16561 .opcode = 20,
16562 .operands = &.{
16563 .{ .kind = .id_ref, .quantifier = .required },
16564 },
16565 },
16566 .{
16567 .name = "Tanh",
16568 .opcode = 21,
16569 .operands = &.{
16570 .{ .kind = .id_ref, .quantifier = .required },
16571 },
16572 },
16573 .{
16574 .name = "Asinh",
16575 .opcode = 22,
16576 .operands = &.{
16577 .{ .kind = .id_ref, .quantifier = .required },
16578 },
16579 },
16580 .{
16581 .name = "Acosh",
16582 .opcode = 23,
16583 .operands = &.{
16584 .{ .kind = .id_ref, .quantifier = .required },
16585 },
16586 },
16587 .{
16588 .name = "Atanh",
16589 .opcode = 24,
16590 .operands = &.{
16591 .{ .kind = .id_ref, .quantifier = .required },
16592 },
16593 },
16594 .{
16595 .name = "Atan2",
16596 .opcode = 25,
16597 .operands = &.{
16598 .{ .kind = .id_ref, .quantifier = .required },
16599 .{ .kind = .id_ref, .quantifier = .required },
16600 },
16601 },
16602 .{
16603 .name = "Pow",
16604 .opcode = 26,
16605 .operands = &.{
16606 .{ .kind = .id_ref, .quantifier = .required },
16607 .{ .kind = .id_ref, .quantifier = .required },
16608 },
16609 },
16610 .{
16611 .name = "Exp",
16612 .opcode = 27,
16613 .operands = &.{
16614 .{ .kind = .id_ref, .quantifier = .required },
16615 },
16616 },
16617 .{
16618 .name = "Log",
16619 .opcode = 28,
16620 .operands = &.{
16621 .{ .kind = .id_ref, .quantifier = .required },
16622 },
16623 },
16624 .{
16625 .name = "Exp2",
16626 .opcode = 29,
16627 .operands = &.{
16628 .{ .kind = .id_ref, .quantifier = .required },
16629 },
16630 },
16631 .{
16632 .name = "Log2",
16633 .opcode = 30,
16634 .operands = &.{
16635 .{ .kind = .id_ref, .quantifier = .required },
16636 },
16637 },
16638 .{
16639 .name = "Sqrt",
16640 .opcode = 31,
16641 .operands = &.{
16642 .{ .kind = .id_ref, .quantifier = .required },
16643 },
16644 },
16645 .{
16646 .name = "InverseSqrt",
16647 .opcode = 32,
16648 .operands = &.{
16649 .{ .kind = .id_ref, .quantifier = .required },
16650 },
16651 },
16652 .{
16653 .name = "Determinant",
16654 .opcode = 33,
16655 .operands = &.{
16656 .{ .kind = .id_ref, .quantifier = .required },
16657 },
16658 },
16659 .{
16660 .name = "MatrixInverse",
16661 .opcode = 34,
16662 .operands = &.{
16663 .{ .kind = .id_ref, .quantifier = .required },
16664 },
16665 },
16666 .{
16667 .name = "Modf",
16668 .opcode = 35,
16669 .operands = &.{
16670 .{ .kind = .id_ref, .quantifier = .required },
16671 .{ .kind = .id_ref, .quantifier = .required },
16672 },
16673 },
16674 .{
16675 .name = "ModfStruct",
16676 .opcode = 36,
16677 .operands = &.{
16678 .{ .kind = .id_ref, .quantifier = .required },
16679 },
16680 },
16681 .{
16682 .name = "FMin",
16683 .opcode = 37,
16684 .operands = &.{
16685 .{ .kind = .id_ref, .quantifier = .required },
16686 .{ .kind = .id_ref, .quantifier = .required },
16687 },
16688 },
16689 .{
16690 .name = "UMin",
16691 .opcode = 38,
16692 .operands = &.{
16693 .{ .kind = .id_ref, .quantifier = .required },
16694 .{ .kind = .id_ref, .quantifier = .required },
16695 },
16696 },
16697 .{
16698 .name = "SMin",
16699 .opcode = 39,
16700 .operands = &.{
16701 .{ .kind = .id_ref, .quantifier = .required },
16702 .{ .kind = .id_ref, .quantifier = .required },
16703 },
16704 },
16705 .{
16706 .name = "FMax",
16707 .opcode = 40,
16708 .operands = &.{
16709 .{ .kind = .id_ref, .quantifier = .required },
16710 .{ .kind = .id_ref, .quantifier = .required },
16711 },
16712 },
16713 .{
16714 .name = "UMax",
16715 .opcode = 41,
16716 .operands = &.{
16717 .{ .kind = .id_ref, .quantifier = .required },
16718 .{ .kind = .id_ref, .quantifier = .required },
16719 },
16720 },
16721 .{
16722 .name = "SMax",
16723 .opcode = 42,
16724 .operands = &.{
16725 .{ .kind = .id_ref, .quantifier = .required },
16726 .{ .kind = .id_ref, .quantifier = .required },
16727 },
16728 },
16729 .{
16730 .name = "FClamp",
16731 .opcode = 43,
16732 .operands = &.{
16733 .{ .kind = .id_ref, .quantifier = .required },
16734 .{ .kind = .id_ref, .quantifier = .required },
16735 .{ .kind = .id_ref, .quantifier = .required },
16736 },
16737 },
16738 .{
16739 .name = "UClamp",
16740 .opcode = 44,
16741 .operands = &.{
16742 .{ .kind = .id_ref, .quantifier = .required },
16743 .{ .kind = .id_ref, .quantifier = .required },
16744 .{ .kind = .id_ref, .quantifier = .required },
16745 },
16746 },
16747 .{
16748 .name = "SClamp",
16749 .opcode = 45,
16750 .operands = &.{
16751 .{ .kind = .id_ref, .quantifier = .required },
16752 .{ .kind = .id_ref, .quantifier = .required },
16753 .{ .kind = .id_ref, .quantifier = .required },
16754 },
16755 },
16756 .{
16757 .name = "FMix",
16758 .opcode = 46,
16759 .operands = &.{
16760 .{ .kind = .id_ref, .quantifier = .required },
16761 .{ .kind = .id_ref, .quantifier = .required },
16762 .{ .kind = .id_ref, .quantifier = .required },
16763 },
16764 },
16765 .{
16766 .name = "IMix",
16767 .opcode = 47,
16768 .operands = &.{
16769 .{ .kind = .id_ref, .quantifier = .required },
16770 .{ .kind = .id_ref, .quantifier = .required },
16771 .{ .kind = .id_ref, .quantifier = .required },
16772 },
16773 },
16774 .{
16775 .name = "Step",
16776 .opcode = 48,
16777 .operands = &.{
16778 .{ .kind = .id_ref, .quantifier = .required },
16779 .{ .kind = .id_ref, .quantifier = .required },
16780 },
16781 },
16782 .{
16783 .name = "SmoothStep",
16784 .opcode = 49,
16785 .operands = &.{
16786 .{ .kind = .id_ref, .quantifier = .required },
16787 .{ .kind = .id_ref, .quantifier = .required },
16788 .{ .kind = .id_ref, .quantifier = .required },
16789 },
16790 },
16791 .{
16792 .name = "Fma",
16793 .opcode = 50,
16794 .operands = &.{
16795 .{ .kind = .id_ref, .quantifier = .required },
16796 .{ .kind = .id_ref, .quantifier = .required },
16797 .{ .kind = .id_ref, .quantifier = .required },
16798 },
16799 },
16800 .{
16801 .name = "Frexp",
16802 .opcode = 51,
16803 .operands = &.{
16804 .{ .kind = .id_ref, .quantifier = .required },
16805 .{ .kind = .id_ref, .quantifier = .required },
16806 },
16807 },
16808 .{
16809 .name = "FrexpStruct",
16810 .opcode = 52,
16811 .operands = &.{
16812 .{ .kind = .id_ref, .quantifier = .required },
16813 },
16814 },
16815 .{
16816 .name = "Ldexp",
16817 .opcode = 53,
16818 .operands = &.{
16819 .{ .kind = .id_ref, .quantifier = .required },
16820 .{ .kind = .id_ref, .quantifier = .required },
16821 },
16822 },
16823 .{
16824 .name = "PackSnorm4x8",
16825 .opcode = 54,
16826 .operands = &.{
16827 .{ .kind = .id_ref, .quantifier = .required },
16828 },
16829 },
16830 .{
16831 .name = "PackUnorm4x8",
16832 .opcode = 55,
16833 .operands = &.{
16834 .{ .kind = .id_ref, .quantifier = .required },
16835 },
16836 },
16837 .{
16838 .name = "PackSnorm2x16",
16839 .opcode = 56,
16840 .operands = &.{
16841 .{ .kind = .id_ref, .quantifier = .required },
16842 },
16843 },
16844 .{
16845 .name = "PackUnorm2x16",
16846 .opcode = 57,
16847 .operands = &.{
16848 .{ .kind = .id_ref, .quantifier = .required },
16849 },
16850 },
16851 .{
16852 .name = "PackHalf2x16",
16853 .opcode = 58,
16854 .operands = &.{
16855 .{ .kind = .id_ref, .quantifier = .required },
16856 },
16857 },
16858 .{
16859 .name = "PackDouble2x32",
16860 .opcode = 59,
16861 .operands = &.{
16862 .{ .kind = .id_ref, .quantifier = .required },
16863 },
16864 },
16865 .{
16866 .name = "UnpackSnorm2x16",
16867 .opcode = 60,
16868 .operands = &.{
16869 .{ .kind = .id_ref, .quantifier = .required },
16870 },
16871 },
16872 .{
16873 .name = "UnpackUnorm2x16",
16874 .opcode = 61,
16875 .operands = &.{
16876 .{ .kind = .id_ref, .quantifier = .required },
16877 },
16878 },
16879 .{
16880 .name = "UnpackHalf2x16",
16881 .opcode = 62,
16882 .operands = &.{
16883 .{ .kind = .id_ref, .quantifier = .required },
16884 },
16885 },
16886 .{
16887 .name = "UnpackSnorm4x8",
16888 .opcode = 63,
16889 .operands = &.{
16890 .{ .kind = .id_ref, .quantifier = .required },
16891 },
16892 },
16893 .{
16894 .name = "UnpackUnorm4x8",
16895 .opcode = 64,
16896 .operands = &.{
16897 .{ .kind = .id_ref, .quantifier = .required },
16898 },
16899 },
16900 .{
16901 .name = "UnpackDouble2x32",
16902 .opcode = 65,
16903 .operands = &.{
16904 .{ .kind = .id_ref, .quantifier = .required },
16905 },
16906 },
16907 .{
16908 .name = "Length",
16909 .opcode = 66,
16910 .operands = &.{
16911 .{ .kind = .id_ref, .quantifier = .required },
16912 },
16913 },
16914 .{
16915 .name = "Distance",
16916 .opcode = 67,
16917 .operands = &.{
16918 .{ .kind = .id_ref, .quantifier = .required },
16919 .{ .kind = .id_ref, .quantifier = .required },
16920 },
16921 },
16922 .{
16923 .name = "Cross",
16924 .opcode = 68,
16925 .operands = &.{
16926 .{ .kind = .id_ref, .quantifier = .required },
16927 .{ .kind = .id_ref, .quantifier = .required },
16928 },
16929 },
16930 .{
16931 .name = "Normalize",
16932 .opcode = 69,
16933 .operands = &.{
16934 .{ .kind = .id_ref, .quantifier = .required },
16935 },
16936 },
16937 .{
16938 .name = "FaceForward",
16939 .opcode = 70,
16940 .operands = &.{
16941 .{ .kind = .id_ref, .quantifier = .required },
16942 .{ .kind = .id_ref, .quantifier = .required },
16943 .{ .kind = .id_ref, .quantifier = .required },
16944 },
16945 },
16946 .{
16947 .name = "Reflect",
16948 .opcode = 71,
16949 .operands = &.{
16950 .{ .kind = .id_ref, .quantifier = .required },
16951 .{ .kind = .id_ref, .quantifier = .required },
16952 },
16953 },
16954 .{
16955 .name = "Refract",
16956 .opcode = 72,
16957 .operands = &.{
16958 .{ .kind = .id_ref, .quantifier = .required },
16959 .{ .kind = .id_ref, .quantifier = .required },
16960 .{ .kind = .id_ref, .quantifier = .required },
16961 },
16962 },
16963 .{
16964 .name = "FindILsb",
16965 .opcode = 73,
16966 .operands = &.{
16967 .{ .kind = .id_ref, .quantifier = .required },
16968 },
16969 },
16970 .{
16971 .name = "FindSMsb",
16972 .opcode = 74,
16973 .operands = &.{
16974 .{ .kind = .id_ref, .quantifier = .required },
16975 },
16976 },
16977 .{
16978 .name = "FindUMsb",
16979 .opcode = 75,
16980 .operands = &.{
16981 .{ .kind = .id_ref, .quantifier = .required },
16982 },
16983 },
16984 .{
16985 .name = "InterpolateAtCentroid",
16986 .opcode = 76,
16987 .operands = &.{
16988 .{ .kind = .id_ref, .quantifier = .required },
16989 },
16990 },
16991 .{
16992 .name = "InterpolateAtSample",
16993 .opcode = 77,
16994 .operands = &.{
16995 .{ .kind = .id_ref, .quantifier = .required },
16996 .{ .kind = .id_ref, .quantifier = .required },
16997 },
16998 },
16999 .{
17000 .name = "InterpolateAtOffset",
17001 .opcode = 78,
17002 .operands = &.{
17003 .{ .kind = .id_ref, .quantifier = .required },
17004 .{ .kind = .id_ref, .quantifier = .required },
17005 },
17006 },
17007 .{
17008 .name = "NMin",
17009 .opcode = 79,
17010 .operands = &.{
17011 .{ .kind = .id_ref, .quantifier = .required },
17012 .{ .kind = .id_ref, .quantifier = .required },
17013 },
17014 },
17015 .{
17016 .name = "NMax",
17017 .opcode = 80,
17018 .operands = &.{
17019 .{ .kind = .id_ref, .quantifier = .required },
17020 .{ .kind = .id_ref, .quantifier = .required },
17021 },
17022 },
17023 .{
17024 .name = "NClamp",
17025 .opcode = 81,
17026 .operands = &.{
17027 .{ .kind = .id_ref, .quantifier = .required },
17028 .{ .kind = .id_ref, .quantifier = .required },
17029 .{ .kind = .id_ref, .quantifier = .required },
17030 },
17031 },
17032 },
17033 .zig => &.{
17034 .{
17035 .name = "InvocationGlobal",
17036 .opcode = 0,
17037 .operands = &.{
17038 .{ .kind = .id_ref, .quantifier = .required },
17039 },
17040 },
17041 },
17042 };4473 };
17043 }4474 }
17044};4475};
src/link.zig+2-2
...@@ -1319,7 +1319,7 @@ pub const File = struct {...@@ -1319,7 +1319,7 @@ pub const File = struct {
1319 .macho => MachO,1319 .macho => MachO,
1320 .c => C,1320 .c => C,
1321 .wasm => Wasm,1321 .wasm => Wasm,
1322 .spirv => SpirV,1322 .spirv => Spirv,
1323 .lld => Lld,1323 .lld => Lld,
1324 .plan9 => comptime unreachable,1324 .plan9 => comptime unreachable,
1325 .spork8 => Spork8,1325 .spork8 => Spork8,
...@@ -1423,7 +1423,7 @@ pub const File = struct {...@@ -1423,7 +1423,7 @@ pub const File = struct {
1423 pub const Elf = @import("link/Elf.zig");1423 pub const Elf = @import("link/Elf.zig");
1424 pub const Elf2 = @import("link/Elf2.zig");1424 pub const Elf2 = @import("link/Elf2.zig");
1425 pub const MachO = @import("link/MachO.zig");1425 pub const MachO = @import("link/MachO.zig");
1426 pub const SpirV = @import("link/SpirV.zig");1426 pub const Spirv = @import("link/Spirv.zig");
1427 pub const Wasm = @import("link/Wasm.zig");1427 pub const Wasm = @import("link/Wasm.zig");
1428 pub const Dwarf = @import("link/Dwarf.zig");1428 pub const Dwarf = @import("link/Dwarf.zig");
1429 pub const Dwarf2 = @import("link/Dwarf2.zig");1429 pub const Dwarf2 = @import("link/Dwarf2.zig");
src/link/SpirV.zig deleted-1216
...@@ -1,1216 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Path = std.Build.Cache.Path;
4const assert = std.debug.assert;
5const log = std.log.scoped(.link);
6const zig_version = @import("builtin").zig_version;
7const Zcu = @import("../Zcu.zig");
8const InternPool = @import("../InternPool.zig");
9const Compilation = @import("../Compilation.zig");
10const link = @import("../link.zig");
11const Air = @import("../Air.zig");
12const Type = @import("../Type.zig");
13const codegen = @import("../codegen.zig");
14const CodeGen = @import("../codegen/spirv/CodeGen.zig");
15const BinaryModule = @import("SpirV/BinaryModule.zig");
16const lower_invocation_globals = @import("SpirV/lower_invocation_globals.zig");
17const dedup_types = @import("SpirV/dedup_types.zig");
18const prune_unused = @import("SpirV/prune_unused.zig");
19const spec = @import("../codegen/spirv/spec.zig");
20const Section = @import("../codegen/spirv/Section.zig");
21const Id = spec.Id;
22const Word = spec.Word;
23const Mir = @import("../codegen/spirv/Mir.zig");
24
25const Linker = @This();
26
27base: link.File,
28fragments: std.array_hash_map.Auto(InternPool.Nav.Index, Mir) = .empty,
29pending_navs: std.ArrayList(InternPool.Nav.Index) = .empty,
30entry_points: std.ArrayList(EntryPointDecl) = .empty,
31external_objects: std.ArrayList(ExternalObject) = .empty,
32
33const EntryPointDecl = struct {
34 nav: InternPool.Nav.Index,
35 name: []const u8,
36 cc: std.builtin.CallingConvention,
37};
38
39const ExternalObject = struct {
40 instructions: []const Word,
41 id_bound: u32,
42};
43
44pub fn createEmpty(
45 arena: Allocator,
46 comp: *Compilation,
47 emit: Path,
48 options: link.File.OpenOptions,
49) !*Linker {
50 const io = comp.io;
51 const target = &comp.root_mod.resolved_target.result;
52
53 assert(!comp.config.use_lld); // Caught by Compilation.Config.resolve
54 assert(!comp.config.use_llvm); // Caught by Compilation.Config.resolve
55 assert(target.ofmt == .spirv); // Caught by Compilation.Config.resolve
56 switch (target.cpu.arch) {
57 .spirv32, .spirv64 => {},
58 else => unreachable, // Caught by Compilation.Config.resolve.
59 }
60 switch (target.os.tag) {
61 .opencl, .opengl, .vulkan => {},
62 else => unreachable, // Caught by Compilation.Config.resolve.
63 }
64
65 const linker = try arena.create(Linker);
66 linker.* = .{
67 .base = .{
68 .tag = .spirv,
69 .comp = comp,
70 .emit = emit,
71 .gc_sections = options.gc_sections orelse false,
72 .print_gc_sections = options.print_gc_sections,
73 .stack_size = options.stack_size orelse 0,
74 .allow_shlib_undefined = options.allow_shlib_undefined orelse false,
75 .file = null,
76 .build_id = options.build_id,
77 },
78 };
79 errdefer linker.deinit();
80
81 linker.base.file = try emit.root_dir.handle.createFile(io, emit.sub_path, .{
82 .truncate = true,
83 .read = true,
84 });
85
86 return linker;
87}
88
89pub fn open(
90 arena: Allocator,
91 comp: *Compilation,
92 emit: Path,
93 options: link.File.OpenOptions,
94) !*Linker {
95 return createEmpty(arena, comp, emit, options);
96}
97
98pub fn deinit(linker: *Linker) void {
99 const gpa = linker.base.comp.gpa;
100 for (linker.fragments.values()) |*mir| {
101 mir.deinit(gpa);
102 }
103 linker.fragments.deinit(gpa);
104 linker.pending_navs.deinit(gpa);
105 linker.entry_points.deinit(gpa);
106 for (linker.external_objects.items) |obj| {
107 gpa.free(obj.instructions);
108 }
109 linker.external_objects.deinit(gpa);
110}
111
112pub fn loadInput(linker: *Linker, input: link.Input) !void {
113 switch (input) {
114 .object => |obj| {
115 const comp = linker.base.comp;
116 const gpa = comp.gpa;
117 const io = comp.io;
118 const diags = &comp.link_diags;
119
120 const stat = obj.file.stat(io) catch |err|
121 return diags.fail("failed to stat SPIR-V object '{f}': {t}", .{ obj.path, err });
122 const file_size = std.math.cast(usize, stat.size) orelse
123 return diags.fail("SPIR-V object '{f}' is too large", .{obj.path});
124 if (file_size < 5 * @sizeOf(Word))
125 return diags.fail("SPIR-V object '{f}' is too small to contain a valid header", .{obj.path});
126 if (file_size % @sizeOf(Word) != 0)
127 return diags.fail("SPIR-V object '{f}' size is not a multiple of the word size", .{obj.path});
128
129 const word_count = file_size / @sizeOf(Word);
130 const all_words = try gpa.alloc(Word, word_count);
131 defer gpa.free(all_words);
132
133 const bytes = std.mem.sliceAsBytes(all_words);
134 const n_read = obj.file.readPositionalAll(io, bytes, 0) catch |err|
135 return diags.fail("failed to read SPIR-V object '{f}': {t}", .{ obj.path, err });
136 if (n_read != bytes.len)
137 return diags.fail("SPIR-V object '{f}': incomplete read", .{obj.path});
138
139 const needs_swap = all_words[0] == @byteSwap(spec.magic_number);
140 if (needs_swap) {
141 for (all_words) |*w| w.* = @byteSwap(w.*);
142 }
143
144 if (all_words[0] != spec.magic_number)
145 return diags.fail("SPIR-V object '{f}': invalid magic number", .{obj.path});
146
147 const id_bound = all_words[3];
148 const instructions = try gpa.dupe(Word, all_words[5..]);
149 errdefer gpa.free(instructions);
150
151 // OpCapability instructions appear at the top of the module
152 // so we can stop scanning as soon as we hit anything else.
153 var it: BinaryModule.Instruction.Iterator = .init(instructions, 0);
154 const has_linkage = while (it.next()) |inst| switch (inst.opcode) {
155 .OpCapability => {
156 const cap: spec.Capability = @fromBackingInt(@intCast(inst.operands[0]));
157 if (cap == .linkage) break true;
158 },
159 else => break false,
160 } else false;
161 if (!has_linkage) {
162 return diags.fail("SPIR-V object '{f}' is missing the Linkage capability and cannot be linked", .{obj.path});
163 }
164
165 try linker.external_objects.append(gpa, .{
166 .instructions = instructions,
167 .id_bound = id_bound,
168 });
169 },
170 else => {
171 const diags = &linker.base.comp.link_diags;
172 return diags.fail("unsupported link input for SPIR-V target", .{});
173 },
174 }
175}
176
177pub fn updateFunc(
178 linker: *Linker,
179 pt: Zcu.PerThread,
180 func_index: InternPool.Index,
181 mir: *codegen.AnyMir,
182) !void {
183 const gpa = linker.base.comp.gpa;
184 const nav = pt.zcu.funcInfo(func_index).owner_nav;
185
186 if (linker.fragments.getPtr(nav)) |existing| {
187 existing.deinit(gpa);
188 }
189
190 try linker.fragments.put(gpa, nav, mir.spirv);
191 mir.spirv = .{
192 .extended_instruction_set = &.{},
193 .globals = &.{},
194 .functions = &.{},
195 .annotations = &.{},
196 .debug_names = &.{},
197 .debug_strings = &.{},
198 .execution_modes = &.{},
199 .id_bound = 0,
200 .owner_nav = mir.spirv.owner_nav,
201 .kind = mir.spirv.kind,
202 .decl_result_id = .none,
203 .nav_refs = &.{},
204 .uav_refs = &.{},
205 .decl_deps = &.{},
206 .internal_globals = &.{},
207 .entry_points = &.{},
208 };
209}
210
211pub fn updateNav(linker: *Linker, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.Error!void {
212 const ip = &pt.zcu.intern_pool;
213 log.debug("deferring nav {f}({d}) to flush", .{ ip.getNav(nav).fqn.fmt(ip), nav });
214
215 const gpa = linker.base.comp.gpa;
216 linker.pending_navs.append(gpa, nav) catch return error.OutOfMemory;
217}
218
219pub fn updateExports(
220 linker: *Linker,
221 pt: Zcu.PerThread,
222 export_indices: []const Zcu.Export.Index,
223) link.Error!void {
224 const zcu = pt.zcu;
225 const ip = &zcu.intern_pool;
226 const gpa = linker.base.comp.gpa;
227 for (export_indices) |exp_index| {
228 const exp = exp_index.ptr(zcu);
229 const nav_index = switch (exp.exported) {
230 .nav => |nav| nav,
231 .uav => @panic("TODO: implement Linker linker code for exporting a constant value"),
232 };
233 const nav_ty = ip.getNav(nav_index).resolved.?.type;
234 if (ip.isFunctionType(nav_ty)) {
235 const cc = Type.fromInterned(nav_ty).fnCallingConvention(zcu);
236 try linker.entry_points.append(gpa, .{
237 .nav = nav_index,
238 .name = exp.opts.name.toSlice(ip),
239 .cc = cc,
240 });
241 }
242 }
243}
244
245pub fn flush(
246 linker: *Linker,
247 arena: Allocator,
248 tid: Zcu.PerThread.Id,
249 prog_node: std.Progress.Node,
250) link.Error!void {
251 const sub_prog_node = prog_node.start("Flush Module", 0);
252 defer sub_prog_node.end();
253
254 const comp = linker.base.comp;
255 const diags = &comp.link_diags;
256 const gpa = comp.gpa;
257 const io = comp.io;
258
259 if (comp.zcu) |zcu| {
260 const active = zcu.activate(tid);
261 defer active.deactivate();
262 const pt = active.pt;
263 for (linker.pending_navs.items) |nav| {
264 if (linker.fragments.contains(nav)) continue;
265
266 const mir = CodeGen.generateNav(pt, nav) catch |err| switch (err) {
267 error.OutOfMemory => return error.OutOfMemory,
268 error.AlreadyReported => continue,
269 error.Canceled => return error.Canceled,
270 };
271
272 linker.fragments.put(gpa, nav, mir) catch return error.OutOfMemory;
273 }
274 linker.pending_navs.clearRetainingCapacity();
275 }
276
277 const merged = mergeFragments(linker, gpa, arena) catch |err| switch (err) {
278 error.OutOfMemory => return error.OutOfMemory,
279 };
280
281 var binary = linkModule(arena, merged.words, merged.id_bound, sub_prog_node) catch |err| switch (err) {
282 error.OutOfMemory => |e| return e,
283 else => |other| {
284 return diags.fail("error while linking: {s}", .{@errorName(other)});
285 },
286 };
287 defer binary.deinit(arena);
288
289 const header = [_]Word{
290 spec.magic_number,
291 merged.version.toWord(),
292 merged.generator_id,
293 binary.id_bound,
294 0,
295 };
296
297 var file_writer = linker.base.file.?.writer(io, &.{});
298 file_writer.interface.writeSliceEndian(Word, &header, .little) catch |err| switch (err) {
299 error.WriteFailed => return diags.fail("failed to write: {t}", .{file_writer.err.?}),
300 };
301 file_writer.interface.writeSliceEndian(Word, binary.instructions, .little) catch |err| switch (err) {
302 error.WriteFailed => return diags.fail("failed to write: {t}", .{file_writer.err.?}),
303 };
304 file_writer.end() catch |err| switch (err) {
305 error.WriteFailed => return diags.fail("failed to write: {t}", .{file_writer.err.?}),
306 else => |e| return diags.fail("failed to write: {t}", .{e}),
307 };
308}
309
310fn linkModule(arena: Allocator, words: []const Word, id_bound: u32, progress: std.Progress.Node) !BinaryModule {
311 var parser = try BinaryModule.Parser.init(arena);
312 defer parser.deinit();
313 var binary = try parser.initFromWords(words, id_bound);
314 try prune_unused.run(&parser, &binary);
315 try dedup_types.run(&parser, &binary);
316 try lower_invocation_globals.run(&parser, &binary, progress);
317 return binary;
318}
319
320fn mergeFragments(linker: *Linker, gpa: Allocator, arena: Allocator) error{OutOfMemory}!MergedModule {
321 const comp = linker.base.comp;
322 const target = &comp.root_mod.resolved_target.result;
323 const maybe_ip: ?*InternPool = if (comp.zcu) |zcu| &zcu.intern_pool else null;
324 const is_obj = comp.config.output_mode == .Obj;
325
326 var next_id: Word = 1;
327
328 var nav_final_ids: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Id) = .empty;
329 defer nav_final_ids.deinit(gpa);
330
331 var uav_final_ids: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Id) = .empty;
332 defer uav_final_ids.deinit(gpa);
333
334 var frag_infos: std.ArrayList(FragmentInfo) = .empty;
335 defer frag_infos.deinit(gpa);
336 try frag_infos.ensureTotalCapacity(gpa, @intCast(linker.fragments.count()));
337
338 for (linker.fragments.keys(), linker.fragments.values()) |nav, *mir| {
339 const id_offset = next_id - 1;
340 frag_infos.appendAssumeCapacity(.{ .id_offset = id_offset });
341 if (mir.decl_result_id != .none) {
342 try nav_final_ids.put(gpa, nav, @fromBackingInt(@intCast(@backingInt(mir.decl_result_id) + id_offset)));
343 }
344 next_id += mir.id_bound - 1;
345 }
346
347 for (linker.fragments.values(), frag_infos.items) |*mir, frag_info| {
348 for (mir.nav_refs) |ref| {
349 if (!nav_final_ids.contains(ref.nav)) {
350 try nav_final_ids.put(gpa, ref.nav, @fromBackingInt(@intCast(@backingInt(ref.local_id) + frag_info.id_offset)));
351 }
352 }
353 for (mir.uav_refs) |ref| {
354 const key = .{ ref.val, ref.storage_class };
355 if (!uav_final_ids.contains(key)) {
356 try uav_final_ids.put(gpa, key, @fromBackingInt(@intCast(@backingInt(ref.local_id) + frag_info.id_offset)));
357 }
358 }
359 }
360
361 // Resolve Zig extern navs against external objects.
362 var ext_id_offsets: std.ArrayList(Word) = .empty;
363 defer ext_id_offsets.deinit(gpa);
364 try ext_id_offsets.ensureTotalCapacity(gpa, linker.external_objects.items.len);
365
366 var unresolved_extern_count: u32 = 0;
367 var resolved_ids: std.array_hash_map.Auto(Id, void) = .empty;
368 defer resolved_ids.deinit(gpa);
369
370 if (maybe_ip) |ip| {
371 var extern_name_map: std.array_hash_map.String(InternPool.Nav.Index) = .empty;
372 defer extern_name_map.deinit(gpa);
373
374 var nav_it = nav_final_ids.iterator();
375 while (nav_it.next()) |entry| {
376 const nav = ip.getNav(entry.key_ptr.*);
377 if (!nav.resolved.?.is_extern_decl) continue;
378 const name = if (nav.getExtern(ip)) |e| e.name.toSlice(ip) else nav.fqn.toSlice(ip);
379 try extern_name_map.put(gpa, name, entry.key_ptr.*);
380 }
381
382 for (linker.external_objects.items) |ext_obj| {
383 const id_offset = next_id - 1;
384 ext_id_offsets.appendAssumeCapacity(id_offset);
385
386 var it: BinaryModule.Instruction.Iterator = .init(ext_obj.instructions, 0);
387 while (it.next()) |inst| {
388 const ld = LinkageDecoration.parse(inst) orelse continue;
389 if (ld.linkage_type != .@"export") continue;
390 const remapped_id: Id = @fromBackingInt(@intCast(@backingInt(ld.target_id) + id_offset));
391
392 if (extern_name_map.get(ld.name)) |nav_index| {
393 log.debug("extern resolve: '{s}' -> ext_fn_id={d}", .{ ld.name, @backingInt(remapped_id) });
394 nav_final_ids.getPtr(nav_index).?.* = remapped_id;
395 _ = extern_name_map.swapRemove(ld.name);
396 try resolved_ids.put(gpa, remapped_id, {});
397 }
398 }
399 next_id += ext_obj.id_bound - 1;
400 }
401
402 unresolved_extern_count = @intCast(extern_name_map.count());
403 } else {
404 for (linker.external_objects.items) |ext_obj| {
405 ext_id_offsets.appendAssumeCapacity(next_id - 1);
406 next_id += ext_obj.id_bound - 1;
407 }
408 }
409
410 var parser = BinaryModule.Parser.init(gpa) catch return error.OutOfMemory;
411 defer parser.deinit();
412 var sections: Sections = .{};
413 defer sections.deinit(gpa);
414
415 try mergeZigFragments(linker, gpa, &parser, &sections, frag_infos.items, &nav_final_ids, &uav_final_ids, &resolved_ids, maybe_ip);
416
417 var has_linkage = false;
418 try appendExternalObjects(linker, gpa, &parser, ext_id_offsets.items, &sections, &has_linkage, linker.fragments.count() == 0, is_obj, &resolved_ids);
419
420 if (is_obj) {
421 for (linker.entry_points.items) |ep| {
422 if (ep.cc != .spirv_device) continue;
423 const final_id = nav_final_ids.get(ep.nav) orelse continue;
424 try sections.annotations.emit(gpa, .OpDecorate, .{
425 .target = final_id,
426 .decoration = .{ .linkage_attributes = .{ .name = ep.name, .linkage_type = .@"export" } },
427 });
428 has_linkage = true;
429 }
430 if (unresolved_extern_count > 0) has_linkage = true;
431 }
432
433 var capabilities_section = Section{};
434 defer capabilities_section.deinit(gpa);
435 var extensions_section = Section{};
436 defer extensions_section.deinit(gpa);
437 var memory_model_section = Section{};
438 defer memory_model_section.deinit(gpa);
439
440 try emitPreamble(
441 gpa,
442 target,
443 has_linkage,
444 &capabilities_section,
445 &extensions_section,
446 &memory_model_section,
447 );
448 try emitEntryPoints(
449 linker,
450 gpa,
451 target,
452 &sections.entry_points,
453 &sections.execution_modes,
454 &nav_final_ids,
455 &uav_final_ids,
456 &frag_infos,
457 );
458
459 const zig_packed_version = (zig_version.major << 12) | (zig_version.minor << 7) | zig_version.patch;
460 if (maybe_ip) |ip| {
461 try emitSourceInfo(gpa, ip, zig_packed_version, &sections.debug_strings);
462 }
463
464 const version: spec.Version = .{
465 .major = 1,
466 .minor = blk: {
467 if (target.cpu.has(.spirv, .v1_6)) break :blk 6;
468 if (target.cpu.has(.spirv, .v1_5)) break :blk 5;
469 if (target.cpu.has(.spirv, .v1_4)) break :blk 4;
470 if (target.cpu.has(.spirv, .v1_3)) break :blk 3;
471 if (target.cpu.has(.spirv, .v1_2)) break :blk 2;
472 if (target.cpu.has(.spirv, .v1_1)) break :blk 1;
473 break :blk 0;
474 },
475 };
476
477 const buffers = &[_][]const Word{
478 capabilities_section.toWords(),
479 extensions_section.toWords(),
480 sections.ext_inst.toWords(),
481 memory_model_section.toWords(),
482 sections.entry_points.toWords(),
483 sections.execution_modes.toWords(),
484 sections.debug_strings.toWords(),
485 sections.debug_names.toWords(),
486 sections.annotations.toWords(),
487 sections.globals.toWords(),
488 sections.functions.toWords(),
489 };
490
491 var total_size: usize = 0;
492 for (buffers) |buffer| total_size += buffer.len;
493 const result = try arena.alloc(Word, total_size);
494
495 var offset: usize = 0;
496 for (buffers) |buffer| {
497 @memcpy(result[offset..][0..buffer.len], buffer);
498 offset += buffer.len;
499 }
500
501 return .{
502 .words = result,
503 .id_bound = next_id,
504 .version = version,
505 .generator_id = (spec.zig_generator_id << 16) | zig_packed_version,
506 };
507}
508
509fn mergeZigFragments(
510 linker: *Linker,
511 gpa: Allocator,
512 parser: *BinaryModule.Parser,
513 sections: *Sections,
514 frag_infos: []const FragmentInfo,
515 nav_final_ids: *const std.AutoHashMapUnmanaged(InternPool.Nav.Index, Id),
516 uav_final_ids: *const std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Id),
517 resolved_ids: *const std.array_hash_map.Auto(Id, void),
518 maybe_ip: ?*InternPool,
519) error{OutOfMemory}!void {
520 for (linker.fragments.values(), frag_infos) |*mir, frag_info| {
521 var id_remap: std.AutoHashMapUnmanaged(Id, Id) = .empty;
522 defer id_remap.deinit(gpa);
523
524 var resolved_local_ids: std.array_hash_map.Auto(Id, void) = .empty;
525 defer resolved_local_ids.deinit(gpa);
526
527 for (mir.nav_refs) |ref| {
528 if (nav_final_ids.get(ref.nav)) |final_id| {
529 try id_remap.put(gpa, ref.local_id, final_id);
530 if (maybe_ip) |ip| {
531 const nav = ip.getNav(ref.nav);
532 if (nav.resolved.?.is_extern_decl and resolved_ids.contains(final_id)) {
533 try resolved_local_ids.put(gpa, ref.local_id, {});
534 }
535 }
536 }
537 }
538 for (mir.uav_refs) |ref| {
539 if (uav_final_ids.get(.{ ref.val, ref.storage_class })) |final_id| {
540 try id_remap.put(gpa, ref.local_id, final_id);
541 }
542 }
543
544 try remapAndAppend(gpa, &sections.ext_inst, mir.extended_instruction_set, frag_info.id_offset, &id_remap, parser);
545 try remapAndAppend(gpa, &sections.globals, mir.globals, frag_info.id_offset, &id_remap, parser);
546
547 try remapFilteredInsts(gpa, &sections.functions, mir.functions, frag_info.id_offset, &id_remap, parser, &resolved_local_ids, .skip_functions);
548 try remapFilteredInsts(gpa, &sections.annotations, mir.annotations, frag_info.id_offset, &id_remap, parser, &resolved_local_ids, .skip_linkage);
549 try remapFilteredInsts(gpa, &sections.debug_names, mir.debug_names, frag_info.id_offset, &id_remap, parser, &resolved_local_ids, .skip_names);
550 try remapAndAppend(gpa, &sections.debug_strings, mir.debug_strings, frag_info.id_offset, &id_remap, parser);
551 try remapAndAppend(gpa, &sections.execution_modes, mir.execution_modes, frag_info.id_offset, &id_remap, parser);
552
553 for (mir.entry_points) |ep| {
554 try linker.entry_points.append(gpa, .{ .nav = mir.owner_nav, .name = ep.name, .cc = ep.cc });
555 }
556 }
557}
558
559const FilterMode = enum { skip_functions, skip_linkage, skip_names };
560
561fn remapFilteredInsts(
562 gpa: Allocator,
563 dest: *Section,
564 words: []const Word,
565 id_offset: Word,
566 id_remap: *const std.AutoHashMapUnmanaged(Id, Id),
567 parser: *BinaryModule.Parser,
568 skip_ids: *const std.array_hash_map.Auto(Id, void),
569 mode: FilterMode,
570) error{OutOfMemory}!void {
571 if (words.len == 0) return;
572 var it: BinaryModule.Instruction.Iterator = .init(words, 0);
573 var skip_function = false;
574 while (it.next()) |inst| {
575 switch (mode) {
576 .skip_functions => {
577 if (inst.opcode == .OpFunction) {
578 skip_function = skip_ids.contains(@fromBackingInt(@intCast(inst.operands[1])));
579 }
580 if (skip_function) {
581 if (inst.opcode == .OpFunctionEnd) skip_function = false;
582 continue;
583 }
584 },
585 .skip_linkage => {
586 if (LinkageDecoration.parse(inst)) |ld| {
587 if (skip_ids.contains(ld.target_id)) continue;
588 }
589 },
590 .skip_names => {
591 if (inst.opcode == .OpName and inst.operands.len >= 1) {
592 if (skip_ids.contains(@fromBackingInt(@intCast(inst.operands[0])))) continue;
593 }
594 },
595 }
596 try remapAndAppendInst(gpa, dest, words, inst, id_offset, id_remap, parser);
597 }
598}
599
600fn emitPreamble(
601 gpa: Allocator,
602 target: *const std.Target,
603 has_linkage: bool,
604 capabilities: *Section,
605 extensions: *Section,
606 memory_model: *Section,
607) !void {
608 var caps: std.EnumSet(spec.Capability) = .empty;
609 var exts: std.StringHashMapUnmanaged(void) = .empty;
610 defer exts.deinit(gpa);
611
612 switch (target.os.tag) {
613 .opengl, .vulkan => caps.insert(.shader),
614 .opencl, .amdhsa => {
615 caps.insert(.kernel);
616 caps.insert(.addresses);
617 },
618 else => unreachable,
619 }
620 if (target.cpu.arch == .spirv64) {
621 caps.insert(.int64);
622 if (target.os.tag == .vulkan) {
623 caps.insert(.physical_storage_buffer_addresses);
624 try exts.put(gpa, "SPV_KHR_physical_storage_buffer", {});
625 }
626 }
627 if (has_linkage) caps.insert(.linkage);
628
629 inline for (@typeInfo(spec.Capability).@"enum".field_names) |cap_name| {
630 if (@hasField(std.Target.spirv.Feature, cap_name)) {
631 if (target.cpu.has(.spirv, @field(std.Target.spirv.Feature, cap_name)))
632 caps.insert(@field(spec.Capability, cap_name));
633 }
634 }
635 inline for (@typeInfo(spec.Extension).@"enum".field_names) |ext_name| {
636 switch (@field(spec.Extension, ext_name)) {
637 .v1_0, .v1_1, .v1_2, .v1_3, .v1_4, .v1_5, .v1_6 => {},
638 else => if (@hasField(std.Target.spirv.Feature, ext_name)) {
639 if (target.cpu.has(.spirv, @field(std.Target.spirv.Feature, ext_name)))
640 try exts.put(gpa, ext_name, {});
641 },
642 }
643 }
644
645 var cit = caps.iterator();
646 while (cit.next()) |cap| try capabilities.emit(gpa, .OpCapability, .{ .capability = cap });
647 var eit = exts.iterator();
648 while (eit.next()) |e| try extensions.emit(gpa, .OpExtension, .{ .name = e.key_ptr.* });
649
650 const addressing_model: spec.AddressingModel = switch (target.os.tag) {
651 .opengl => .logical,
652 .vulkan => switch (target.cpu.arch) {
653 .spirv32 => .logical,
654 .spirv64 => .physical_storage_buffer64,
655 else => unreachable,
656 },
657 .opencl => switch (target.cpu.arch) {
658 .spirv32 => .physical32,
659 .spirv64 => .physical64,
660 else => unreachable,
661 },
662 .amdhsa => .physical64,
663 else => unreachable,
664 };
665 try memory_model.emit(gpa, .OpMemoryModel, .{
666 .addressing_model = addressing_model,
667 .memory_model = switch (target.os.tag) {
668 .opencl => .open_cl,
669 .vulkan, .opengl => .glsl450,
670 .amdhsa => unreachable, // TODO
671 else => unreachable,
672 },
673 });
674}
675
676fn emitEntryPoints(
677 linker: *Linker,
678 gpa: Allocator,
679 target: *const std.Target,
680 entry_points_section: *Section,
681 execution_modes_section: *Section,
682 nav_final_ids: *const std.AutoHashMapUnmanaged(InternPool.Nav.Index, Id),
683 uav_final_ids: *const std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Id),
684 frag_infos: *const std.ArrayList(FragmentInfo),
685) error{OutOfMemory}!void {
686 for (linker.entry_points.items) |ep| {
687 const final_id = nav_final_ids.get(ep.nav) orelse continue;
688
689 var interface: std.ArrayList(Id) = .empty;
690 defer interface.deinit(gpa);
691 var visited: std.AutoHashMapUnmanaged(InternPool.Nav.Index, void) = .empty;
692 defer visited.deinit(gpa);
693 try collectEntryPointInterface(linker, ep.nav, &interface, &visited, nav_final_ids, uav_final_ids, frag_infos, gpa);
694
695 const exec_model: spec.ExecutionModel = switch (target.os.tag) {
696 .vulkan, .opengl => switch (ep.cc) {
697 .spirv_vertex => .vertex,
698 .spirv_fragment => .fragment,
699 .spirv_kernel => .gl_compute,
700 .spirv_task => .task_ext,
701 .spirv_mesh => .mesh_ext,
702 .spirv_device => continue,
703 else => unreachable,
704 },
705 .opencl => switch (ep.cc) {
706 .spirv_kernel => .kernel,
707 .spirv_device => continue,
708 else => unreachable,
709 },
710 else => unreachable,
711 };
712
713 try entry_points_section.emit(gpa, .OpEntryPoint, .{
714 .execution_model = exec_model,
715 .entry_point = final_id,
716 .name = ep.name,
717 .interface = interface.items,
718 });
719
720 switch (ep.cc) {
721 .spirv_kernel, .spirv_task => |kernel| {
722 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
723 .entry_point = final_id,
724 .mode = .{ .local_size = .{ .x_size = kernel.x, .y_size = kernel.y, .z_size = kernel.z } },
725 });
726 },
727 .spirv_fragment => |fragment| {
728 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
729 .entry_point = final_id,
730 .mode = if (target.os.tag == .vulkan) .origin_upper_left else .origin_lower_left,
731 });
732 if (fragment.pixel_centered_integer) {
733 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
734 .entry_point = final_id,
735 .mode = .pixel_center_integer,
736 });
737 }
738 const exec_mode: ?spec.ExecutionMode.Extended = switch (fragment.depth_assumption) {
739 .none => null,
740 .greater => .depth_greater,
741 .less => .depth_less,
742 .unchanged => .depth_unchanged,
743 };
744 if (exec_mode) |mode| {
745 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
746 .entry_point = final_id,
747 .mode = mode,
748 });
749 }
750 },
751 .spirv_mesh => |mesh| {
752 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
753 .entry_point = final_id,
754 .mode = .{ .output_vertices = .{ .vertex_count = mesh.max_vertices } },
755 });
756 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
757 .entry_point = final_id,
758 .mode = .{ .output_primitives_ext = .{ .primitive_count = mesh.max_primitives } },
759 });
760 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
761 .entry_point = final_id,
762 .mode = .{ .local_size = .{ .x_size = mesh.x, .y_size = mesh.y, .z_size = mesh.z } },
763 });
764 try execution_modes_section.emit(gpa, .OpExecutionMode, .{
765 .entry_point = final_id,
766 .mode = switch (mesh.stage_output) {
767 .output_points => .output_points,
768 .output_lines => .output_lines_ext,
769 .output_triangles => .output_triangles_ext,
770 },
771 });
772 },
773 else => {},
774 }
775 }
776}
777
778fn emitSourceInfo(gpa: Allocator, ip: *InternPool, version: u32, debug_strings: *Section) error{OutOfMemory}!void {
779 var error_info: std.Io.Writer.Allocating = .init(gpa);
780 defer error_info.deinit();
781 error_info.writer.writeAll("zig_errors:") catch return error.OutOfMemory;
782 for (ip.global_error_set.getNamesFromMainThread()) |name| {
783 error_info.writer.writeByte(':') catch return error.OutOfMemory;
784 std.Uri.Component.percentEncode(
785 &error_info.writer,
786 name.toSlice(ip),
787 struct {
788 fn isValidChar(c: u8) bool {
789 return switch (c) {
790 0, '%', ':' => false,
791 else => true,
792 };
793 }
794 }.isValidChar,
795 ) catch return error.OutOfMemory;
796 }
797 try debug_strings.emit(gpa, .OpSourceExtension, .{ .extension = error_info.written() });
798 try debug_strings.emit(gpa, .OpSource, .{ .source_language = .zig, .version = version, .file = null, .source = null });
799}
800
801const MergedModule = struct {
802 words: []const Word,
803 id_bound: Word,
804 version: spec.Version,
805 generator_id: u32,
806};
807
808const FragmentInfo = struct {
809 id_offset: Word,
810};
811
812const LinkageDecoration = struct {
813 target_id: Id,
814 name: []const u8,
815 linkage_type: spec.LinkageType,
816
817 fn parse(inst: BinaryModule.Instruction) ?LinkageDecoration {
818 if (inst.opcode != .OpDecorate) return null;
819 if (inst.operands.len < 3) return null;
820 if (inst.operands[1] != @backingInt(spec.Decoration.linkage_attributes)) return null;
821 return .{
822 .target_id = @fromBackingInt(@intCast(inst.operands[0])),
823 .name = std.mem.sliceTo(std.mem.sliceAsBytes(inst.operands[2 .. inst.operands.len - 1]), 0),
824 .linkage_type = @fromBackingInt(@intCast(inst.operands[inst.operands.len - 1])),
825 };
826 }
827};
828
829const Sections = struct {
830 ext_inst: Section = .{},
831 globals: Section = .{},
832 functions: Section = .{},
833 annotations: Section = .{},
834 debug_names: Section = .{},
835 debug_strings: Section = .{},
836 entry_points: Section = .{},
837 execution_modes: Section = .{},
838
839 fn deinit(self: *Sections, gpa: Allocator) void {
840 self.ext_inst.deinit(gpa);
841 self.globals.deinit(gpa);
842 self.functions.deinit(gpa);
843 self.annotations.deinit(gpa);
844 self.debug_names.deinit(gpa);
845 self.debug_strings.deinit(gpa);
846 self.entry_points.deinit(gpa);
847 self.execution_modes.deinit(gpa);
848 }
849
850 const SectionClass = enum { ext_inst, debug_name, debug_string, annotation, global };
851
852 fn classifyPreambleInst(opcode: spec.Opcode) SectionClass {
853 return switch (opcode) {
854 .OpExtInstImport => .ext_inst,
855 .OpName, .OpMemberName => .debug_name,
856 .OpString => .debug_string,
857 .OpDecorate,
858 .OpMemberDecorate,
859 .OpGroupDecorate,
860 .OpGroupMemberDecorate,
861 .OpDecorationGroup,
862 .OpDecorateId,
863 .OpDecorateString,
864 .OpMemberDecorateString,
865 => .annotation,
866 else => .global,
867 };
868 }
869
870 fn getSection(self: *Sections, class: SectionClass) *Section {
871 return switch (class) {
872 .ext_inst => &self.ext_inst,
873 .debug_name => &self.debug_names,
874 .debug_string => &self.debug_strings,
875 .annotation => &self.annotations,
876 .global => &self.globals,
877 };
878 }
879};
880
881fn appendExternalObjects(
882 linker: *Linker,
883 gpa: Allocator,
884 parser: *BinaryModule.Parser,
885 ext_id_offsets: []const Word,
886 sections: *Sections,
887 has_linkage: *bool,
888 keep_entry_points: bool,
889 is_obj: bool,
890 resolved_ids: *const std.array_hash_map.Auto(Id, void),
891) error{OutOfMemory}!void {
892 var export_map: std.array_hash_map.String(Id) = .empty;
893 defer export_map.deinit(gpa);
894
895 for (linker.external_objects.items, ext_id_offsets) |ext_obj, id_offset| {
896 var it: BinaryModule.Instruction.Iterator = .init(ext_obj.instructions, 0);
897 while (it.next()) |inst| {
898 const ld = LinkageDecoration.parse(inst) orelse continue;
899 if (ld.linkage_type != .@"export") continue;
900 try export_map.put(gpa, ld.name, @fromBackingInt(@intCast(@backingInt(ld.target_id) + id_offset)));
901 }
902 }
903
904 var per_obj_remaps = try gpa.alloc(std.AutoHashMapUnmanaged(Id, Id), linker.external_objects.items.len);
905 defer {
906 for (per_obj_remaps) |*m| m.deinit(gpa);
907 gpa.free(per_obj_remaps);
908 }
909 for (per_obj_remaps) |*m| m.* = .empty;
910
911 var resolved_linkage_ids: std.array_hash_map.Auto(Id, void) = .empty;
912 defer resolved_linkage_ids.deinit(gpa);
913
914 for (resolved_ids.keys()) |id| {
915 try resolved_linkage_ids.put(gpa, id, {});
916 }
917
918 for (linker.external_objects.items, ext_id_offsets, 0..) |ext_obj, id_offset, obj_idx| {
919 var it: BinaryModule.Instruction.Iterator = .init(ext_obj.instructions, 0);
920 while (it.next()) |inst| {
921 const ld = LinkageDecoration.parse(inst) orelse continue;
922 if (ld.linkage_type != .import) continue;
923 const remapped_import: Id = @fromBackingInt(@intCast(@backingInt(ld.target_id) + id_offset));
924
925 if (export_map.get(ld.name)) |export_id| {
926 try per_obj_remaps[obj_idx].put(gpa, ld.target_id, export_id);
927 try resolved_linkage_ids.put(gpa, remapped_import, {});
928 try resolved_linkage_ids.put(gpa, export_id, {});
929 log.debug("cross-object resolve: '{s}' import={d} -> export={d}", .{
930 ld.name, @backingInt(remapped_import), @backingInt(export_id),
931 });
932 } else {
933 has_linkage.* = true;
934 }
935 }
936 }
937
938 for (linker.external_objects.items, ext_id_offsets, 0..) |ext_obj, id_offset, obj_idx| {
939 var binary = parser.initFromWords(ext_obj.instructions, ext_obj.id_bound) catch
940 return error.OutOfMemory;
941 defer binary.deinit(gpa);
942
943 const id_remap = &per_obj_remaps[obj_idx];
944
945 var preamble_it: BinaryModule.Instruction.Iterator = .init(ext_obj.instructions, 0);
946 while (preamble_it.next()) |inst| {
947 if (inst.offset >= binary.functions_start) break;
948
949 switch (inst.opcode) {
950 .OpCapability,
951 .OpExtension,
952 .OpMemoryModel,
953 .OpSource,
954 .OpSourceExtension,
955 .OpSourceContinued,
956 => continue,
957 .OpEntryPoint => {
958 if (keep_entry_points)
959 try remapAndAppendInst(gpa, &sections.entry_points, ext_obj.instructions, inst, id_offset, id_remap, parser);
960 continue;
961 },
962 .OpExecutionMode, .OpExecutionModeId => {
963 if (keep_entry_points)
964 try remapAndAppendInst(gpa, &sections.execution_modes, ext_obj.instructions, inst, id_offset, id_remap, parser);
965 continue;
966 },
967 else => {},
968 }
969
970 if (LinkageDecoration.parse(inst)) |ld| {
971 const remapped: Id = @fromBackingInt(@intCast(@backingInt(ld.target_id) + id_offset));
972 if (resolved_linkage_ids.contains(remapped)) {
973 if (ld.linkage_type == .@"export" and is_obj) {
974 has_linkage.* = true;
975 } else {
976 continue;
977 }
978 }
979 }
980
981 if (inst.opcode == .OpName and inst.operands.len >= 1) {
982 if (id_remap.contains(@fromBackingInt(@intCast(inst.operands[0])))) continue;
983 }
984
985 const dest = sections.getSection(Sections.classifyPreambleInst(inst.opcode));
986 try remapAndAppendInst(gpa, dest, ext_obj.instructions, inst, id_offset, id_remap, parser);
987 }
988
989 var fn_it: BinaryModule.Instruction.Iterator = .init(ext_obj.instructions, binary.functions_start);
990 var skip_function = false;
991 while (fn_it.next()) |inst| {
992 if (inst.opcode == .OpFunction) {
993 skip_function = id_remap.contains(@fromBackingInt(@intCast(inst.operands[1])));
994 }
995 if (!skip_function) {
996 try remapAndAppendInst(gpa, &sections.functions, ext_obj.instructions, inst, id_offset, id_remap, parser);
997 }
998 if (inst.opcode == .OpFunctionEnd) {
999 skip_function = false;
1000 }
1001 }
1002 }
1003}
1004
1005fn collectEntryPointInterface(
1006 linker: *Linker,
1007 nav: InternPool.Nav.Index,
1008 interface: *std.ArrayList(Id),
1009 visited: *std.AutoHashMapUnmanaged(InternPool.Nav.Index, void),
1010 nav_final_ids: *const std.AutoHashMapUnmanaged(InternPool.Nav.Index, Id),
1011 uav_final_ids: *const std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Id),
1012 frag_infos: *const std.ArrayList(FragmentInfo),
1013 gpa: Allocator,
1014) error{OutOfMemory}!void {
1015 const visited_gop = try visited.getOrPut(gpa, nav);
1016 if (visited_gop.found_existing) return;
1017
1018 const frag_index = linker.fragments.getIndex(nav) orelse return;
1019 const mir = &linker.fragments.values()[frag_index];
1020 const id_offset = frag_infos.items[frag_index].id_offset;
1021
1022 if (mir.kind == .global) {
1023 if (nav_final_ids.get(nav)) |final_id| {
1024 try interface.append(gpa, final_id);
1025 }
1026 }
1027
1028 for (mir.uav_refs) |ref| {
1029 if (ref.kind == .global) {
1030 if (uav_final_ids.get(.{ ref.val, ref.storage_class })) |final_id| {
1031 try interface.append(gpa, final_id);
1032 }
1033 }
1034 }
1035
1036 for (mir.internal_globals) |local_id| {
1037 const global_id: Id = @fromBackingInt(@intCast(@backingInt(local_id) + id_offset));
1038 try interface.append(gpa, global_id);
1039 }
1040
1041 for (mir.decl_deps) |dep| {
1042 try collectEntryPointInterface(linker, dep.nav, interface, visited, nav_final_ids, uav_final_ids, frag_infos, gpa);
1043 }
1044}
1045
1046fn remapAndAppend(
1047 gpa: Allocator,
1048 dest: *Section,
1049 words: []const Word,
1050 id_offset: Word,
1051 id_remap: *const std.AutoHashMapUnmanaged(Id, Id),
1052 parser: *BinaryModule.Parser,
1053) error{OutOfMemory}!void {
1054 if (words.len == 0) return;
1055
1056 try dest.instructions.ensureUnusedCapacity(gpa, words.len);
1057
1058 var it: BinaryModule.Instruction.Iterator = .init(words, 0);
1059 while (it.next()) |inst| {
1060 try remapAndAppendInst(gpa, dest, words, inst, id_offset, id_remap, parser);
1061 }
1062}
1063
1064fn remapAndAppendInst(
1065 gpa: Allocator,
1066 dest: *Section,
1067 words: []const Word,
1068 inst: BinaryModule.Instruction,
1069 id_offset: Word,
1070 id_remap: *const std.AutoHashMapUnmanaged(Id, Id),
1071 parser: *BinaryModule.Parser,
1072) error{OutOfMemory}!void {
1073 const inst_words = words[inst.offset..][0..((words[inst.offset] >> 16))];
1074 try dest.instructions.ensureUnusedCapacity(gpa, inst_words.len);
1075 const dest_start = dest.instructions.items.len;
1076 dest.instructions.appendSliceAssumeCapacity(inst_words);
1077 const inst_slice = dest.instructions.items[dest_start..][0..inst_words.len];
1078
1079 const inst_spec = parser.getInstSpec(inst.opcode) orelse return;
1080 var offset: usize = 0;
1081 for (inst_spec.operands) |operand| {
1082 const cat = operand.kind.category();
1083 switch (operand.quantifier) {
1084 .required, .optional => {
1085 if (offset >= inst.operands.len) break;
1086 offset += remapOperand(operand.kind, cat, inst, inst_slice, offset, id_offset, id_remap);
1087 },
1088 .variadic => {
1089 while (offset < inst.operands.len) {
1090 offset += remapOperand(operand.kind, cat, inst, inst_slice, offset, id_offset, id_remap);
1091 }
1092 },
1093 }
1094 }
1095}
1096
1097fn remapOperand(
1098 kind: spec.OperandKind,
1099 cat: spec.OperandCategory,
1100 inst: BinaryModule.Instruction,
1101 inst_slice: []Word,
1102 offset: usize,
1103 id_offset: Word,
1104 id_remap: *const std.AutoHashMapUnmanaged(Id, Id),
1105) usize {
1106 switch (cat) {
1107 .id => {
1108 remapSingleId(&inst_slice[1 + offset], id_offset, id_remap);
1109 return 1;
1110 },
1111 .literal => return operandLiteralWordCount(kind, inst, offset),
1112 .composite => {
1113 remapCompositeOperand(kind, inst_slice, offset, id_offset, id_remap);
1114 return 2;
1115 },
1116 .bit_enum => {
1117 const mask = inst_slice[1 + offset];
1118 var consumed: usize = 1;
1119 for (kind.enumerants()) |e| {
1120 if ((mask & e.value) == 0) continue;
1121 for (e.parameters) |param_kind| {
1122 if (offset + consumed >= inst.operands.len) return consumed;
1123 consumed += remapOperand(
1124 param_kind,
1125 param_kind.category(),
1126 inst,
1127 inst_slice,
1128 offset + consumed,
1129 id_offset,
1130 id_remap,
1131 );
1132 }
1133 }
1134 return consumed;
1135 },
1136 .value_enum => {
1137 const value = inst_slice[1 + offset];
1138 var consumed: usize = 1;
1139 for (kind.enumerants()) |e| {
1140 if (e.value != value) continue;
1141 for (e.parameters) |param_kind| {
1142 if (offset + consumed >= inst.operands.len) return consumed;
1143 consumed += remapOperand(
1144 param_kind,
1145 param_kind.category(),
1146 inst,
1147 inst_slice,
1148 offset + consumed,
1149 id_offset,
1150 id_remap,
1151 );
1152 }
1153 break;
1154 }
1155 return consumed;
1156 },
1157 }
1158}
1159
1160fn remapCompositeOperand(
1161 kind: spec.OperandKind,
1162 inst_slice: []Word,
1163 offset: usize,
1164 id_offset: Word,
1165 id_remap: *const std.AutoHashMapUnmanaged(Id, Id),
1166) void {
1167 switch (kind) {
1168 .pair_literal_integer_id_ref => {
1169 remapSingleId(&inst_slice[1 + offset + 1], id_offset, id_remap);
1170 },
1171 .pair_id_ref_literal_integer => {
1172 remapSingleId(&inst_slice[1 + offset], id_offset, id_remap);
1173 },
1174 .pair_id_ref_id_ref => {
1175 remapSingleId(&inst_slice[1 + offset], id_offset, id_remap);
1176 remapSingleId(&inst_slice[1 + offset + 1], id_offset, id_remap);
1177 },
1178 else => {},
1179 }
1180}
1181
1182fn operandLiteralWordCount(kind: spec.OperandKind, inst: BinaryModule.Instruction, offset: usize) usize {
1183 return switch (kind) {
1184 .literal_integer, .literal_float => 1,
1185 .literal_string => blk: {
1186 var count: usize = 0;
1187 var off = offset;
1188 while (off < inst.operands.len) {
1189 const word = inst.operands[off];
1190 count += 1;
1191 off += 1;
1192 if (word & 0xFF000000 == 0 or
1193 word & 0x00FF0000 == 0 or
1194 word & 0x0000FF00 == 0 or
1195 word & 0x000000FF == 0)
1196 {
1197 break;
1198 }
1199 }
1200 break :blk count;
1201 },
1202 .literal_context_dependent_number => inst.operands.len - offset,
1203 .literal_ext_inst_integer => 1,
1204 else => 1,
1205 };
1206}
1207
1208fn remapSingleId(word: *Word, id_offset: Word, id_remap: *const std.AutoHashMapUnmanaged(Id, Id)) void {
1209 const id: Id = @fromBackingInt(@intCast(word.*));
1210 if (id == .none) return;
1211 if (id_remap.get(id)) |final_id| {
1212 word.* = @backingInt(final_id);
1213 } else {
1214 word.* = @backingInt(id) + id_offset;
1215 }
1216}
src/link/SpirV/BinaryModule.zig deleted-347
...@@ -1,347 +0,0 @@
1const std = @import("std");
2const assert = std.debug.assert;
3const Allocator = std.mem.Allocator;
4const log = std.log.scoped(.spirv_parse);
5
6const spec = @import("../../codegen/spirv/spec.zig");
7const Opcode = spec.Opcode;
8const Word = spec.Word;
9const InstructionSet = spec.InstructionSet;
10const ResultId = spec.Id;
11
12const BinaryModule = @This();
13
14/// The result-id bound of this SPIR-V module.
15id_bound: u32,
16
17/// The instructions of this module (no header).
18instructions: []const Word,
19
20/// Maps OpExtInstImport result-ids to their InstructionSet.
21ext_inst_map: std.AutoHashMapUnmanaged(ResultId, InstructionSet),
22
23/// Width of arithmetic types (OpTypeInt/OpTypeFloat). Needed to correctly
24/// parse operands of Op(Spec)Constant and OpSwitch.
25arith_type_width: std.AutoHashMapUnmanaged(ResultId, u16),
26
27functions_start: usize,
28
29pub fn deinit(bm: *BinaryModule, gpa: Allocator) void {
30 bm.ext_inst_map.deinit(gpa);
31 bm.arith_type_width.deinit(gpa);
32 bm.* = undefined;
33}
34
35pub fn iterateInstructions(bm: BinaryModule) Instruction.Iterator {
36 return Instruction.Iterator.init(bm.instructions, 0);
37}
38
39pub fn iterateInstructionsFrom(bm: BinaryModule, offset: usize) Instruction.Iterator {
40 return Instruction.Iterator.init(bm.instructions, offset);
41}
42
43pub const Instruction = struct {
44 pub const Iterator = struct {
45 words: []const Word,
46 offset: usize = 0,
47
48 pub fn init(words: []const Word, start_offset: usize) Iterator {
49 return .{ .words = words, .offset = start_offset };
50 }
51
52 pub fn next(it: *Iterator) ?Instruction {
53 if (it.offset >= it.words.len) return null;
54
55 const instruction_len = it.words[it.offset] >> 16;
56 defer it.offset += instruction_len;
57 assert(instruction_len != 0);
58 assert(it.offset < it.words.len);
59
60 return Instruction{
61 .opcode = @fromBackingInt(@intCast(it.words[it.offset] & 0xFFFF)),
62 .offset = it.offset,
63 .operands = it.words[it.offset..][1..instruction_len],
64 };
65 }
66 };
67
68 opcode: Opcode,
69 offset: usize,
70 operands: []const Word,
71};
72
73pub const Parser = struct {
74 gpa: Allocator,
75 opcode_table: std.AutoHashMapUnmanaged(u32, u16) = .empty,
76
77 pub fn init(gpa: Allocator) !Parser {
78 var parser = Parser{ .gpa = gpa };
79 errdefer parser.deinit();
80
81 inline for (std.meta.tags(InstructionSet)) |set| {
82 const instructions = set.instructions();
83 try parser.opcode_table.ensureUnusedCapacity(gpa, @intCast(instructions.len));
84 for (instructions, 0..) |inst, i| {
85 const entry = parser.opcode_table.getOrPutAssumeCapacity(mapSetAndOpcode(set, @intCast(inst.opcode)));
86 if (!entry.found_existing) {
87 entry.value_ptr.* = @intCast(i);
88 }
89 }
90 }
91
92 return parser;
93 }
94
95 pub fn deinit(parser: *Parser) void {
96 parser.opcode_table.deinit(parser.gpa);
97 }
98
99 fn mapSetAndOpcode(set: InstructionSet, opcode: u16) u32 {
100 return (@as(u32, @backingInt(set)) << 16) | opcode;
101 }
102
103 pub fn getInstSpec(parser: Parser, opcode: Opcode) ?spec.Instruction {
104 const index = parser.opcode_table.get(mapSetAndOpcode(.core, @backingInt(opcode))) orelse return null;
105 return InstructionSet.core.instructions()[index];
106 }
107
108 /// Build a BinaryModule from raw instruction words (no header).
109 /// Scans for ext_inst_map, arith_type_width, and the functions section offset.
110 pub fn initFromWords(parser: *Parser, words: []const Word, id_bound: u32) !BinaryModule {
111 var binary = BinaryModule{
112 .id_bound = id_bound,
113 .instructions = words,
114 .ext_inst_map = .{},
115 .arith_type_width = .{},
116 .functions_start = undefined,
117 };
118
119 var maybe_function_section: ?usize = null;
120 var it = binary.iterateInstructions();
121 while (it.next()) |inst| {
122 const inst_spec = parser.getInstSpec(inst.opcode) orelse continue;
123 const operands = inst.operands;
124
125 switch (inst.opcode) {
126 .OpExtInstImport => {
127 const set_name = std.mem.sliceTo(std.mem.sliceAsBytes(operands[1..]), 0);
128 const set = std.meta.stringToEnum(InstructionSet, set_name) orelse continue;
129 if (set == .core) continue;
130 try binary.ext_inst_map.put(parser.gpa, @fromBackingInt(@intCast(operands[0])), set);
131 },
132 .OpTypeInt, .OpTypeFloat => {
133 try binary.arith_type_width.put(parser.gpa, @fromBackingInt(@intCast(operands[0])), @intCast(operands[1]));
134 },
135 .OpFunction => if (maybe_function_section == null) {
136 maybe_function_section = inst.offset;
137 },
138 else => {},
139 }
140
141 // propagate arith type widths through instructions that return int/float
142 const spec_operands = inst_spec.operands;
143 if (spec_operands.len >= 2 and
144 spec_operands[0].kind == .id_result_type and
145 spec_operands[1].kind == .id_result)
146 {
147 if (operands.len >= 2) {
148 if (binary.arith_type_width.get(@fromBackingInt(@intCast(operands[0])))) |width| {
149 try binary.arith_type_width.put(parser.gpa, @fromBackingInt(@intCast(operands[1])), width);
150 }
151 }
152 }
153 }
154
155 binary.functions_start = maybe_function_section orelse binary.instructions.len;
156
157 return binary;
158 }
159
160 /// Parse offsets in the instruction that contain result-ids.
161 /// Returned offsets are relative to inst.operands.
162 pub fn parseInstructionResultIds(
163 parser: *Parser,
164 binary: BinaryModule,
165 inst: Instruction,
166 offsets: *std.ArrayList(u16),
167 ) !void {
168 const index = parser.opcode_table.get(mapSetAndOpcode(.core, @backingInt(inst.opcode))).?;
169 const operands = InstructionSet.core.instructions()[index].operands;
170
171 var offset: usize = 0;
172 switch (inst.opcode) {
173 .OpSpecConstantOp => {
174 assert(operands[0].kind == .id_result_type);
175 assert(operands[1].kind == .id_result);
176 offset = try parser.parseOperandsResultIds(binary, inst, operands[0..2], offset, offsets);
177
178 if (offset >= inst.operands.len) return error.InvalidPhysicalFormat;
179 const spec_opcode = std.math.cast(u16, inst.operands[offset]) orelse return error.InvalidPhysicalFormat;
180 const spec_index = parser.opcode_table.get(mapSetAndOpcode(.core, spec_opcode)) orelse
181 return error.InvalidPhysicalFormat;
182 const spec_operands = InstructionSet.core.instructions()[spec_index].operands;
183 assert(spec_operands[0].kind == .id_result_type);
184 assert(spec_operands[1].kind == .id_result);
185 offset = try parser.parseOperandsResultIds(binary, inst, spec_operands[2..], offset + 1, offsets);
186 },
187 .OpExtInst => {
188 assert(operands[0].kind == .id_result_type);
189 assert(operands[1].kind == .id_result);
190 offset = try parser.parseOperandsResultIds(binary, inst, operands[0..2], offset, offsets);
191
192 if (offset + 1 >= inst.operands.len) return error.InvalidPhysicalFormat;
193 const set_id: ResultId = @fromBackingInt(@intCast(inst.operands[offset]));
194 try offsets.append(parser.gpa, @intCast(offset));
195 const set = binary.ext_inst_map.get(set_id) orelse {
196 log.err("invalid instruction set {}", .{@backingInt(set_id)});
197 return error.InvalidId;
198 };
199 const ext_opcode = std.math.cast(u16, inst.operands[offset + 1]) orelse return error.InvalidPhysicalFormat;
200 const ext_index = parser.opcode_table.get(mapSetAndOpcode(set, ext_opcode)) orelse
201 return error.InvalidPhysicalFormat;
202 const ext_operands = set.instructions()[ext_index].operands;
203 offset = try parser.parseOperandsResultIds(binary, inst, ext_operands, offset + 2, offsets);
204 },
205 else => {
206 offset = try parser.parseOperandsResultIds(binary, inst, operands, offset, offsets);
207 },
208 }
209
210 if (offset != inst.operands.len) return error.InvalidPhysicalFormat;
211 }
212
213 fn parseOperandsResultIds(
214 parser: *Parser,
215 binary: BinaryModule,
216 inst: Instruction,
217 operands: []const spec.Operand,
218 start_offset: usize,
219 offsets: *std.ArrayList(u16),
220 ) !usize {
221 var offset = start_offset;
222 for (operands) |operand| {
223 offset = try parser.parseOperandResultIds(binary, inst, operand, offset, offsets);
224 }
225 return offset;
226 }
227
228 fn parseOperandResultIds(
229 parser: *Parser,
230 binary: BinaryModule,
231 inst: Instruction,
232 operand: spec.Operand,
233 start_offset: usize,
234 offsets: *std.ArrayList(u16),
235 ) !usize {
236 var offset = start_offset;
237 switch (operand.quantifier) {
238 .variadic => while (offset < inst.operands.len) {
239 offset = try parser.parseOperandKindResultIds(binary, inst, operand.kind, offset, offsets);
240 },
241 .optional => if (offset < inst.operands.len) {
242 offset = try parser.parseOperandKindResultIds(binary, inst, operand.kind, offset, offsets);
243 },
244 .required => {
245 offset = try parser.parseOperandKindResultIds(binary, inst, operand.kind, offset, offsets);
246 },
247 }
248 return offset;
249 }
250
251 fn parseOperandKindResultIds(
252 parser: *Parser,
253 binary: BinaryModule,
254 inst: Instruction,
255 kind: spec.OperandKind,
256 start_offset: usize,
257 offsets: *std.ArrayList(u16),
258 ) !usize {
259 var offset = start_offset;
260 if (offset >= inst.operands.len) return error.InvalidPhysicalFormat;
261
262 switch (kind.category()) {
263 .bit_enum => {
264 const mask = inst.operands[offset];
265 offset += 1;
266 for (kind.enumerants()) |enumerant| {
267 if ((mask & enumerant.value) != 0) {
268 for (enumerant.parameters) |param_kind| {
269 offset = try parser.parseOperandKindResultIds(binary, inst, param_kind, offset, offsets);
270 }
271 }
272 }
273 },
274 .value_enum => {
275 const value = inst.operands[offset];
276 offset += 1;
277 for (kind.enumerants()) |enumerant| {
278 if (value == enumerant.value) {
279 for (enumerant.parameters) |param_kind| {
280 offset = try parser.parseOperandKindResultIds(binary, inst, param_kind, offset, offsets);
281 }
282 break;
283 }
284 }
285 },
286 .id => {
287 try offsets.append(parser.gpa, @intCast(offset));
288 offset += 1;
289 },
290 else => switch (kind) {
291 .literal_integer, .literal_float => offset += 1,
292 .literal_string => while (true) {
293 if (offset >= inst.operands.len) return error.InvalidPhysicalFormat;
294 const word = inst.operands[offset];
295 offset += 1;
296
297 if (word & 0xFF000000 == 0 or
298 word & 0x00FF0000 == 0 or
299 word & 0x0000FF00 == 0 or
300 word & 0x000000FF == 0)
301 {
302 break;
303 }
304 },
305 .literal_context_dependent_number => {
306 assert(inst.opcode == .OpConstant or inst.opcode == .OpSpecConstant);
307 const bit_width = binary.arith_type_width.get(@fromBackingInt(@intCast(inst.operands[0]))) orelse {
308 log.err("invalid LiteralContextDependentNumber type {}", .{inst.operands[0]});
309 return error.InvalidId;
310 };
311 offset += switch (bit_width) {
312 1...32 => 1,
313 33...64 => 2,
314 else => unreachable,
315 };
316 },
317 .literal_ext_inst_integer => unreachable,
318 .literal_spec_constant_op_integer => unreachable,
319 .pair_literal_integer_id_ref => {
320 assert(inst.opcode == .OpSwitch);
321 const bit_width = binary.arith_type_width.get(@fromBackingInt(@intCast(inst.operands[0]))) orelse {
322 log.err("invalid OpSwitch type {}", .{inst.operands[0]});
323 return error.InvalidId;
324 };
325 offset += switch (bit_width) {
326 1...32 => 1,
327 33...64 => 2,
328 else => unreachable,
329 };
330 try offsets.append(parser.gpa, @intCast(offset));
331 offset += 1;
332 },
333 .pair_id_ref_literal_integer => {
334 try offsets.append(parser.gpa, @intCast(offset));
335 offset += 2;
336 },
337 .pair_id_ref_id_ref => {
338 try offsets.append(parser.gpa, @intCast(offset));
339 try offsets.append(parser.gpa, @intCast(offset + 1));
340 offset += 2;
341 },
342 else => unreachable,
343 },
344 }
345 return offset;
346 }
347};
src/link/SpirV/dedup_types.zig deleted-244
...@@ -1,244 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const BinaryModule = @import("BinaryModule.zig");
4
5const spec = @import("../../codegen/spirv/spec.zig");
6const Word = spec.Word;
7const Id = spec.Id;
8const Opcode = spec.Opcode;
9const Instruction = BinaryModule.Instruction;
10
11/// Deduplicate types and constants in a SPIR-V binary module.
12///
13/// The SPIR-V spec requires that non-aggregate types be unique.
14/// When merging fragments from parallel codegen, duplicate type definitions
15/// may exist. This pass identifies structurally identical types/constants,
16/// keeps one canonical instance, and remaps all references to duplicates.
17pub fn run(parser: *BinaryModule.Parser, binary: *BinaryModule) !void {
18 const gpa = parser.gpa;
19
20 const Decoration = struct { offset: usize, len: usize };
21 var decorations_by_id: std.array_hash_map.Auto(Id, std.ArrayList(Decoration)) = .empty;
22 defer {
23 for (decorations_by_id.values()) |*list| list.deinit(gpa);
24 decorations_by_id.deinit(gpa);
25 }
26
27 var it = binary.iterateInstructions();
28 while (it.next()) |inst| {
29 if (inst.offset >= binary.functions_start) break;
30 switch (inst.opcode) {
31 .OpName, .OpMemberName => continue,
32 else => switch (inst.opcode.class()) {
33 .annotation => {},
34 else => continue,
35 },
36 }
37 if (inst.operands.len == 0) continue;
38 const target_id: Id = @fromBackingInt(@intCast(inst.operands[0]));
39
40 const gop = try decorations_by_id.getOrPut(gpa, target_id);
41 if (!gop.found_existing) gop.value_ptr.* = .empty;
42 try gop.value_ptr.append(gpa, .{
43 .offset = inst.offset,
44 .len = 1 + inst.operands.len,
45 });
46 }
47
48 var canonical_map: std.array_hash_map.Custom(TypeKey, Id, TypeKey.HashContext, true) = .empty;
49 defer {
50 for (canonical_map.keys()) |key| gpa.free(key.words);
51 canonical_map.deinit(gpa);
52 }
53
54 var id_remap: std.AutoHashMapUnmanaged(Id, Id) = .empty;
55 defer id_remap.deinit(gpa);
56
57 var id_offsets: std.ArrayList(u16) = .empty;
58 defer id_offsets.deinit(gpa);
59
60 var key_words: std.ArrayList(Word) = .empty;
61 defer key_words.deinit(gpa);
62
63 var dec_hashes: std.ArrayList(u64) = .empty;
64 defer dec_hashes.deinit(gpa);
65
66 // first pass: build canonical map, identify duplicates
67 it = binary.iterateInstructions();
68 while (it.next()) |inst| {
69 if (inst.offset >= binary.functions_start) break;
70 if (!canDeduplicate(inst.opcode)) continue;
71
72 const result_id_index: usize = switch (inst.opcode.class()) {
73 .type_declaration, .extension => 0,
74 .constant_creation => 1,
75 else => continue,
76 };
77 if (result_id_index >= inst.operands.len) continue;
78 const result_id: Id = @fromBackingInt(@intCast(inst.operands[result_id_index]));
79
80 key_words.items.len = 0;
81 try key_words.append(gpa, @backingInt(inst.opcode));
82
83 id_offsets.items.len = 0;
84 parser.parseInstructionResultIds(binary.*, inst, &id_offsets) catch continue;
85
86 for (inst.operands, 0..) |word, i| {
87 if (i == result_id_index) continue;
88 if (std.mem.findScalar(u16, id_offsets.items, @intCast(i)) != null) {
89 const canonical = id_remap.get(@fromBackingInt(@intCast(word))) orelse @as(Id, @fromBackingInt(@intCast(word)));
90 try key_words.append(gpa, @backingInt(canonical));
91 } else {
92 try key_words.append(gpa, word);
93 }
94 }
95
96 if (decorations_by_id.getPtr(result_id)) |dec_list| {
97 dec_hashes.items.len = 0;
98 for (dec_list.items) |dec| {
99 const dec_words = binary.instructions[dec.offset..][0..dec.len];
100 var hasher = std.hash.Wyhash.init(0);
101 hasher.update(std.mem.asBytes(&dec_words[0]));
102 for (dec_words[2..]) |w| {
103 const w_val = if (id_remap.get(@fromBackingInt(@intCast(w)))) |c| @backingInt(c) else w;
104 hasher.update(std.mem.asBytes(&w_val));
105 }
106 try dec_hashes.append(gpa, hasher.final());
107 }
108 std.mem.sort(u64, dec_hashes.items, {}, std.sort.asc(u64));
109 var prev: u64 = 0;
110 for (dec_hashes.items) |h| {
111 if (h == prev) continue;
112 prev = h;
113 try key_words.append(gpa, @truncate(h));
114 try key_words.append(gpa, @truncate(h >> 32));
115 }
116 }
117
118 const key = TypeKey{ .words = try gpa.dupe(Word, key_words.items) };
119 const gop = try canonical_map.getOrPut(gpa, key);
120 if (gop.found_existing) {
121 try id_remap.put(gpa, result_id, gop.value_ptr.*);
122 gpa.free(key.words);
123 } else {
124 gop.value_ptr.* = result_id;
125 }
126 }
127
128 if (id_remap.count() == 0) return;
129
130 // second pass: rewrite id references, remove duplicates and redundant annotations
131 var new_words: std.ArrayList(Word) = .empty;
132 defer new_words.deinit(gpa);
133 try new_words.ensureTotalCapacity(gpa, binary.instructions.len);
134
135 var emitted_annotations: std.AutoHashMapUnmanaged(u64, void) = .empty;
136 defer emitted_annotations.deinit(gpa);
137
138 var new_functions_offset: ?usize = null;
139 var max_id: Word = 0;
140
141 it = binary.iterateInstructions();
142 while (it.next()) |inst| {
143 if (new_functions_offset == null and inst.offset >= binary.functions_start) {
144 new_functions_offset = new_words.items.len;
145 }
146
147 if (canDeduplicate(inst.opcode)) {
148 const result_id_index: usize = switch (inst.opcode.class()) {
149 .type_declaration, .extension => 0,
150 .constant_creation => 1,
151 else => unreachable,
152 };
153 if (result_id_index < inst.operands.len) {
154 const result_id: Id = @fromBackingInt(@intCast(inst.operands[result_id_index]));
155 if (id_remap.contains(result_id)) continue;
156 }
157 }
158
159 switch (inst.opcode.class()) {
160 .annotation, .debug => {
161 if (inst.operands.len > 0) {
162 const target: Id = @fromBackingInt(@intCast(inst.operands[0]));
163 if (id_remap.contains(target)) continue;
164 }
165 },
166 else => {},
167 }
168
169 const inst_start = new_words.items.len;
170 new_words.appendAssumeCapacity(binary.instructions[inst.offset]);
171 new_words.appendSliceAssumeCapacity(inst.operands);
172 const inst_slice = new_words.items[inst_start + 1 ..];
173
174 id_offsets.items.len = 0;
175 parser.parseInstructionResultIds(binary.*, inst, &id_offsets) catch continue;
176
177 const inst_spec = parser.getInstSpec(inst.opcode);
178 const maybe_result_id_index: ?usize = if (inst_spec) |ispec| blk: {
179 break :blk for (0..@min(2, ispec.operands.len)) |i| {
180 if (ispec.operands[i].kind == .id_result) break @intCast(i);
181 } else null;
182 } else null;
183
184 for (inst_slice, 0..) |*word, i| {
185 if (std.mem.findScalar(u16, id_offsets.items, @intCast(i)) == null) continue;
186 max_id = @max(max_id, word.*);
187 if (maybe_result_id_index != null and i == maybe_result_id_index.?) continue;
188
189 if (id_remap.get(@fromBackingInt(@intCast(word.*)))) |canonical| {
190 word.* = @backingInt(canonical);
191 max_id = @max(max_id, word.*);
192 }
193 }
194
195 switch (inst.opcode.class()) {
196 .annotation, .debug => {
197 const ann_words = new_words.items[inst_start..];
198 const ann_hash = std.hash.Wyhash.hash(0, std.mem.sliceAsBytes(ann_words));
199 const gop = try emitted_annotations.getOrPut(gpa, ann_hash);
200 if (gop.found_existing) {
201 new_words.items.len = inst_start;
202 continue;
203 }
204 },
205 else => {},
206 }
207 }
208
209 var remap_it = id_remap.iterator();
210 while (remap_it.next()) |entry| {
211 _ = binary.ext_inst_map.remove(entry.key_ptr.*);
212 _ = binary.arith_type_width.remove(entry.key_ptr.*);
213 }
214
215 binary.instructions = try gpa.dupe(Word, new_words.items);
216 binary.functions_start = new_functions_offset orelse new_words.items.len;
217 binary.id_bound = max_id + 1;
218}
219
220fn canDeduplicate(opcode: Opcode) bool {
221 return switch (opcode) {
222 .OpTypeForwardPointer => false,
223 .OpGroupDecorate, .OpGroupMemberDecorate => false,
224 else => switch (opcode.class()) {
225 .type_declaration, .constant_creation => true,
226 .extension => opcode == .OpExtInstImport,
227 else => false,
228 },
229 };
230}
231
232const TypeKey = struct {
233 words: []const Word,
234
235 const HashContext = struct {
236 pub fn hash(_: @This(), key: TypeKey) u32 {
237 return @truncate(std.hash.Wyhash.hash(0, std.mem.sliceAsBytes(key.words)));
238 }
239
240 pub fn eql(_: @This(), a: TypeKey, b: TypeKey, _: usize) bool {
241 return std.mem.eql(Word, a.words, b.words);
242 }
243 };
244};
src/link/SpirV/lower_invocation_globals.zig deleted-803
...@@ -1,803 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const assert = std.debug.assert;
4const log = std.log.scoped(.spirv_link);
5
6const BinaryModule = @import("BinaryModule.zig");
7const Section = @import("../../codegen/spirv/Section.zig");
8const spec = @import("../../codegen/spirv/spec.zig");
9const ResultId = spec.Id;
10const Word = spec.Word;
11
12/// This structure contains all the stuff that we need to parse from the module in
13/// order to run this pass, as well as some functions to ease its use.
14const ModuleInfo = struct {
15 /// Information about a particular function.
16 const Fn = struct {
17 /// The index of the first callee in `callee_store`.
18 first_callee: usize,
19 /// The return type id of this function
20 return_type: ResultId,
21 /// The parameter types of this function
22 param_types: []const ResultId,
23 /// The set of (result-id's of) invocation globals that are accessed
24 /// in this function, or after resolution, that are accessed in this
25 /// function or any of it's callees.
26 invocation_globals: std.array_hash_map.Auto(ResultId, void),
27 };
28
29 /// Information about a particular invocation global
30 const InvocationGlobal = struct {
31 /// The list of invocation globals that this invocation global
32 /// depends on.
33 dependencies: std.array_hash_map.Auto(ResultId, void),
34 /// The invocation global's type
35 ty: ResultId,
36 /// Initializer function. May be `none`.
37 /// Note that if the initializer is `none`, then `dependencies` is empty.
38 initializer: ResultId,
39 };
40
41 /// Maps function result-id -> Fn information structure.
42 functions: std.array_hash_map.Auto(ResultId, Fn),
43 /// Set of OpFunction result-ids in this module.
44 entry_points: std.array_hash_map.Auto(ResultId, void),
45 /// For each function, a list of function result-ids that it calls.
46 callee_store: []const ResultId,
47 /// Maps each invocation global result-id to a type-id.
48 invocation_globals: std.array_hash_map.Auto(ResultId, InvocationGlobal),
49 /// Subset of `invocation_globals` reachable from any entry point.
50 live_invocation_globals: std.array_hash_map.Auto(ResultId, void),
51 /// Initializer functions of unreachable invocation globals. Their
52 /// OpFunction...OpFunctionEnd ranges are skipped during rewriteFunctions.
53 dead_initializers: std.array_hash_map.Auto(ResultId, void),
54
55 /// Fetch the list of callees per function. Guaranteed to contain only unique IDs.
56 fn callees(self: ModuleInfo, fn_id: ResultId) []const ResultId {
57 const fn_index = self.functions.getIndex(fn_id).?;
58 const values = self.functions.values();
59 const first_callee = values[fn_index].first_callee;
60 if (fn_index == values.len - 1) {
61 return self.callee_store[first_callee..];
62 } else {
63 const next_first_callee = values[fn_index + 1].first_callee;
64 return self.callee_store[first_callee..next_first_callee];
65 }
66 }
67
68 /// Extract most of the required information from the binary. The remaining info is
69 /// constructed by `resolve()`.
70 fn parse(
71 arena: Allocator,
72 parser: *BinaryModule.Parser,
73 binary: BinaryModule,
74 ) !ModuleInfo {
75 var entry_points: std.array_hash_map.Auto(ResultId, void) = .empty;
76 var functions: std.array_hash_map.Auto(ResultId, Fn) = .empty;
77 var fn_types = std.AutoHashMap(ResultId, struct {
78 return_type: ResultId,
79 param_types: []const ResultId,
80 }).init(arena);
81 var calls: std.array_hash_map.Auto(ResultId, void) = .empty;
82 var callee_store: std.ArrayList(ResultId) = .empty;
83 var function_invocation_globals: std.array_hash_map.Auto(ResultId, void) = .empty;
84 var result_id_offsets: std.ArrayList(u16) = .empty;
85 var invocation_globals: std.array_hash_map.Auto(ResultId, InvocationGlobal) = .empty;
86
87 var maybe_current_function: ?ResultId = null;
88 var fn_ty_id: ResultId = undefined;
89
90 var it = binary.iterateInstructions();
91 while (it.next()) |inst| {
92 result_id_offsets.items.len = 0;
93 try parser.parseInstructionResultIds(binary, inst, &result_id_offsets);
94
95 switch (inst.opcode) {
96 .OpEntryPoint => {
97 const entry_point: ResultId = @fromBackingInt(@intCast(inst.operands[1]));
98 const entry = try entry_points.getOrPut(arena, entry_point);
99 if (entry.found_existing) {
100 log.err("Entry point type {f} has duplicate definition", .{entry_point});
101 return error.DuplicateId;
102 }
103 },
104 .OpTypeFunction => {
105 const fn_type: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
106 const return_type: ResultId = @fromBackingInt(@intCast(inst.operands[1]));
107 const param_types: []const ResultId = @ptrCast(inst.operands[2..]);
108
109 const entry = try fn_types.getOrPut(fn_type);
110 if (entry.found_existing) {
111 log.err("Function type {f} has duplicate definition", .{fn_type});
112 return error.DuplicateId;
113 }
114
115 entry.value_ptr.* = .{
116 .return_type = return_type,
117 .param_types = param_types,
118 };
119 },
120 .OpExtInst => {
121 // Note: format and set are already verified by parseInstructionResultIds().
122 const global_type: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
123 const result_id: ResultId = @fromBackingInt(@intCast(inst.operands[1]));
124 const set_id: ResultId = @fromBackingInt(@intCast(inst.operands[2]));
125 const set_inst = inst.operands[3];
126
127 const set = binary.ext_inst_map.get(set_id).?;
128 if (set == .zig and set_inst == 0) {
129 const initializer: ResultId = if (inst.operands.len >= 5)
130 @fromBackingInt(@intCast(inst.operands[4]))
131 else
132 .none;
133
134 try invocation_globals.put(arena, result_id, .{
135 .dependencies = .{},
136 .ty = global_type,
137 .initializer = initializer,
138 });
139 }
140 },
141 .OpFunction => {
142 if (maybe_current_function) |current_function| {
143 log.err("OpFunction {f} does not have an OpFunctionEnd", .{current_function});
144 return error.InvalidPhysicalFormat;
145 }
146
147 maybe_current_function = @fromBackingInt(@intCast(inst.operands[1]));
148 fn_ty_id = @fromBackingInt(@intCast(inst.operands[3]));
149 function_invocation_globals.clearRetainingCapacity();
150 },
151 .OpFunctionCall => {
152 const callee: ResultId = @fromBackingInt(@intCast(inst.operands[2]));
153 try calls.put(arena, callee, {});
154 },
155 .OpFunctionEnd => {
156 const current_function = maybe_current_function orelse {
157 log.err("encountered OpFunctionEnd without corresponding OpFunction", .{});
158 return error.InvalidPhysicalFormat;
159 };
160 const entry = try functions.getOrPut(arena, current_function);
161 if (entry.found_existing) {
162 log.err("Function {f} has duplicate definition", .{current_function});
163 return error.DuplicateId;
164 }
165
166 const first_callee = callee_store.items.len;
167 try callee_store.appendSlice(arena, calls.keys());
168
169 const fn_type = fn_types.get(fn_ty_id) orelse {
170 log.err("Function {f} has invalid OpFunction type", .{current_function});
171 return error.InvalidId;
172 };
173
174 entry.value_ptr.* = .{
175 .first_callee = first_callee,
176 .return_type = fn_type.return_type,
177 .param_types = fn_type.param_types,
178 .invocation_globals = try function_invocation_globals.clone(arena),
179 };
180 maybe_current_function = null;
181 calls.clearRetainingCapacity();
182 },
183 else => {},
184 }
185
186 for (result_id_offsets.items) |off| {
187 const result_id: ResultId = @fromBackingInt(@intCast(inst.operands[off]));
188 if (invocation_globals.contains(result_id)) {
189 try function_invocation_globals.put(arena, result_id, {});
190 }
191 }
192 }
193
194 if (maybe_current_function) |current_function| {
195 log.err("OpFunction {f} does not have an OpFunctionEnd", .{current_function});
196 return error.InvalidPhysicalFormat;
197 }
198
199 return .{
200 .functions = functions,
201 .entry_points = entry_points,
202 .callee_store = callee_store.items,
203 .invocation_globals = invocation_globals,
204 .live_invocation_globals = .empty,
205 .dead_initializers = .empty,
206 };
207 }
208
209 /// Derive the remaining info from the structures filled in by parsing.
210 fn resolve(self: *ModuleInfo, arena: Allocator) !void {
211 try self.resolveInvocationGlobalUsage(arena);
212 try self.resolveInvocationGlobalDependencies(arena);
213 try self.resolveLiveSet(arena);
214 }
215
216 fn resolveLiveSet(self: *ModuleInfo, arena: Allocator) !void {
217 for (self.entry_points.keys()) |ep_id| {
218 const ep_info = self.functions.get(ep_id) orelse continue;
219 for (ep_info.invocation_globals.keys()) |g| {
220 try self.live_invocation_globals.put(arena, g, {});
221 const g_info = self.invocation_globals.get(g).?;
222 for (g_info.dependencies.keys()) |dep| {
223 try self.live_invocation_globals.put(arena, dep, {});
224 }
225 }
226 }
227 for (self.invocation_globals.keys(), self.invocation_globals.values()) |g, info| {
228 if (info.initializer == .none) continue;
229 if (self.live_invocation_globals.contains(g)) continue;
230 try self.dead_initializers.put(arena, info.initializer, {});
231 }
232 }
233
234 /// For each function, extend the list of `invocation_globals` with the
235 /// invocation globals that ALL of its dependencies use.
236 fn resolveInvocationGlobalUsage(self: *ModuleInfo, arena: Allocator) !void {
237 var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.functions.count());
238
239 for (self.functions.keys()) |id| {
240 try self.resolveInvocationGlobalUsageStep(arena, id, &seen);
241 }
242 }
243
244 fn resolveInvocationGlobalUsageStep(
245 self: *ModuleInfo,
246 arena: Allocator,
247 id: ResultId,
248 seen: *std.bit_set.Dynamic,
249 ) !void {
250 const index = self.functions.getIndex(id) orelse {
251 log.err("function calls invalid function {f}", .{id});
252 return error.InvalidId;
253 };
254
255 if (seen.isSet(index)) {
256 return;
257 }
258 seen.set(index);
259
260 const info = &self.functions.values()[index];
261 for (self.callees(id)) |callee| {
262 try self.resolveInvocationGlobalUsageStep(arena, callee, seen);
263 const callee_info = self.functions.get(callee).?;
264 for (callee_info.invocation_globals.keys()) |global| {
265 try info.invocation_globals.put(arena, global, {});
266 }
267 }
268 }
269
270 /// For each invocation global, populate and fully resolve the `dependencies` set.
271 /// This requires `resolveInvocationGlobalUsage()` to be already done.
272 fn resolveInvocationGlobalDependencies(
273 self: *ModuleInfo,
274 arena: Allocator,
275 ) !void {
276 var seen: std.bit_set.Dynamic = try .initEmpty(arena, self.invocation_globals.count());
277
278 for (self.invocation_globals.keys()) |id| {
279 try self.resolveInvocationGlobalDependenciesStep(arena, id, &seen);
280 }
281 }
282
283 fn resolveInvocationGlobalDependenciesStep(
284 self: *ModuleInfo,
285 arena: Allocator,
286 id: ResultId,
287 seen: *std.bit_set.Dynamic,
288 ) !void {
289 const index = self.invocation_globals.getIndex(id) orelse {
290 log.err("invalid invocation global {f}", .{id});
291 return error.InvalidId;
292 };
293
294 if (seen.isSet(index)) {
295 return;
296 }
297 seen.set(index);
298
299 const info = &self.invocation_globals.values()[index];
300 if (info.initializer == .none) {
301 return;
302 }
303
304 const initializer = self.functions.get(info.initializer) orelse {
305 log.err("invocation global {f} has invalid initializer {f}", .{ id, info.initializer });
306 return error.InvalidId;
307 };
308
309 for (initializer.invocation_globals.keys()) |dependency| {
310 if (dependency == id) {
311 // The set of invocation global dependencies includes the dependency itself,
312 // so we need to skip that case.
313 continue;
314 }
315
316 try info.dependencies.put(arena, dependency, {});
317 try self.resolveInvocationGlobalDependenciesStep(arena, dependency, seen);
318
319 const dep_info = self.invocation_globals.getPtr(dependency).?;
320
321 for (dep_info.dependencies.keys()) |global| {
322 try info.dependencies.put(arena, global, {});
323 }
324 }
325 }
326};
327
328const ModuleBuilder = struct {
329 const FunctionType = struct {
330 return_type: ResultId,
331 param_types: []const ResultId,
332
333 const Context = struct {
334 pub fn hash(_: @This(), ty: FunctionType) u32 {
335 var hasher = std.hash.Wyhash.init(0);
336 hasher.update(std.mem.asBytes(&ty.return_type));
337 hasher.update(std.mem.sliceAsBytes(ty.param_types));
338 return @truncate(hasher.final());
339 }
340
341 pub fn eql(_: @This(), a: FunctionType, b: FunctionType, _: usize) bool {
342 if (a.return_type != b.return_type) return false;
343 return std.mem.eql(ResultId, a.param_types, b.param_types);
344 }
345 };
346 };
347
348 const FunctionNewInfo = struct {
349 /// This is here just so that we don't need to allocate the new
350 /// param_types multiple times.
351 new_function_type: ResultId,
352 /// The first ID of the parameters for the invocation globals.
353 /// Each global is allocate here according to the index in
354 /// `ModuleInfo.Fn.invocation_globals`.
355 global_id_base: u32,
356
357 fn invocationGlobalId(self: FunctionNewInfo, index: usize) ResultId {
358 return @fromBackingInt(@intCast(self.global_id_base + @as(u32, @intCast(index))));
359 }
360 };
361
362 arena: Allocator,
363 section: Section,
364 /// The ID bound of the new module.
365 id_bound: u32,
366 /// The first ID of the new entry points. Entry points are allocated from
367 /// here according to their index in `info.entry_points`.
368 entry_point_new_id_base: u32,
369 /// OpName operands saved for invocation globals to re-emit.
370 global_names: std.array_hash_map.Auto(ResultId, []const Word) = .empty,
371 /// A set of all function types in the new program. SPIR-V mandates that these are unique,
372 /// and until a general type deduplication pass is programmed, we just handle it here via this.
373 function_types: std.array_hash_map.Custom(FunctionType, ResultId, FunctionType.Context, true) = .empty,
374 /// Maps functions to new information required for creating the module
375 function_new_info: std.array_hash_map.Auto(ResultId, FunctionNewInfo) = .empty,
376 /// Offset of the functions section in the new binary.
377 new_functions_section: ?usize,
378
379 fn init(arena: Allocator, binary: BinaryModule, info: ModuleInfo) !ModuleBuilder {
380 var self = ModuleBuilder{
381 .arena = arena,
382 .section = .{},
383 .id_bound = binary.id_bound,
384 .entry_point_new_id_base = undefined,
385 .new_functions_section = null,
386 };
387 self.entry_point_new_id_base = @backingInt(self.allocIds(@intCast(info.entry_points.count())));
388 return self;
389 }
390
391 fn allocId(self: *ModuleBuilder) ResultId {
392 return self.allocIds(1);
393 }
394
395 fn allocIds(self: *ModuleBuilder, n: u32) ResultId {
396 defer self.id_bound += n;
397 return @fromBackingInt(@intCast(self.id_bound));
398 }
399
400 fn finalize(self: *ModuleBuilder, arena: Allocator, binary: *BinaryModule) !void {
401 binary.id_bound = self.id_bound;
402 binary.instructions = try arena.dupe(Word, self.section.instructions.items);
403 // Nothing is removed in this pass so we don't need to change any of the maps,
404 // just make sure the section is updated.
405 binary.functions_start = self.new_functions_section orelse binary.instructions.len;
406 }
407
408 fn emitGlobalNames(self: *ModuleBuilder, info: ModuleInfo) !void {
409 for (info.functions.keys(), info.functions.values()) |func, fn_info| {
410 if (info.dead_initializers.contains(func)) continue;
411 const new_info = self.function_new_info.get(func) orelse continue;
412 for (fn_info.invocation_globals.keys(), 0..) |global, i| {
413 if (!info.live_invocation_globals.contains(global)) continue;
414 const name_words = self.global_names.get(global) orelse continue;
415 const id = new_info.invocationGlobalId(i);
416 try self.section.emitRaw(self.arena, .OpName, 1 + name_words.len);
417 self.section.writeOperand(ResultId, id);
418 self.section.writeWords(name_words);
419 }
420 }
421 }
422
423 /// Process everything from `binary` up to the first function and emit it into the builder.
424 fn processPreamble(self: *ModuleBuilder, binary: BinaryModule, info: ModuleInfo) !void {
425 var emitted_global_names = false;
426 var it = binary.iterateInstructions();
427 while (it.next()) |inst| {
428 if (!emitted_global_names) switch (inst.opcode.class()) {
429 .annotation, .type_declaration, .constant_creation => {
430 try self.emitGlobalNames(info);
431 emitted_global_names = true;
432 },
433 else => {},
434 };
435
436 switch (inst.opcode) {
437 .OpName => {
438 const id: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
439 if (info.invocation_globals.contains(id)) {
440 try self.global_names.put(self.arena, id, inst.operands[1..]);
441 continue;
442 }
443 if (info.dead_initializers.contains(id)) continue;
444 },
445 .OpExtInstImport => {
446 const set_id: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
447 const set = binary.ext_inst_map.get(set_id).?;
448 if (set == .zig) continue;
449 },
450 .OpExtInst => {
451 const set_id: ResultId = @fromBackingInt(@intCast(inst.operands[2]));
452 const set_inst = inst.operands[3];
453 const set = binary.ext_inst_map.get(set_id).?;
454 if (set == .zig and set_inst == 0) {
455 continue;
456 }
457 },
458 .OpEntryPoint => {
459 const original_id: ResultId = @fromBackingInt(@intCast(inst.operands[1]));
460 const fn_info = info.functions.get(original_id).?;
461 if (fn_info.invocation_globals.count() > 0) {
462 const new_id_index = info.entry_points.getIndex(original_id).?;
463 const new_id: ResultId = @fromBackingInt(@intCast(self.entry_point_new_id_base + new_id_index));
464 try self.section.emitRaw(self.arena, .OpEntryPoint, inst.operands.len);
465 self.section.writeWord(inst.operands[0]);
466 self.section.writeOperand(ResultId, new_id);
467 self.section.writeWords(inst.operands[2..]);
468 } else {
469 try self.section.emitRawInstruction(self.arena, inst.opcode, inst.operands);
470 }
471 continue;
472 },
473 .OpExecutionMode, .OpExecutionModeId => {
474 const original_id: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
475 const fn_info = info.functions.get(original_id).?;
476 if (fn_info.invocation_globals.count() > 0) {
477 const new_id_index = info.entry_points.getIndex(original_id).?;
478 const new_id: ResultId = @fromBackingInt(@intCast(self.entry_point_new_id_base + new_id_index));
479 try self.section.emitRaw(self.arena, inst.opcode, inst.operands.len);
480 self.section.writeOperand(ResultId, new_id);
481 self.section.writeWords(inst.operands[1..]);
482 } else {
483 try self.section.emitRawInstruction(self.arena, inst.opcode, inst.operands);
484 }
485 continue;
486 },
487 .OpTypeFunction => {
488 continue;
489 },
490 .OpFunction => break,
491 else => {},
492 }
493
494 try self.section.emitRawInstruction(self.arena, inst.opcode, inst.operands);
495 }
496
497 if (!emitted_global_names) {
498 try self.emitGlobalNames(info);
499 }
500 }
501
502 /// Derive new information required for further emitting this module,
503 fn deriveNewFnInfo(self: *ModuleBuilder, info: ModuleInfo) !void {
504 for (info.functions.keys(), info.functions.values()) |func, fn_info| {
505 const invocation_global_count = fn_info.invocation_globals.count();
506 const new_param_types = try self.arena.alloc(ResultId, fn_info.param_types.len + invocation_global_count);
507 for (fn_info.invocation_globals.keys(), 0..) |global, i| {
508 new_param_types[i] = info.invocation_globals.get(global).?.ty;
509 }
510 @memcpy(new_param_types[invocation_global_count..], fn_info.param_types);
511
512 const new_type = try self.internFunctionType(fn_info.return_type, new_param_types);
513 try self.function_new_info.put(self.arena, func, .{
514 .new_function_type = new_type,
515 .global_id_base = @backingInt(self.allocIds(@intCast(invocation_global_count))),
516 });
517 }
518 }
519
520 /// Emit the new function types, which include the parameters for the invocation globals.
521 /// Currently, this function re-emits ALL function types to ensure that there are
522 /// no duplicates in the final program.
523 /// TODO: The above should be resolved by a generalized deduplication pass, and then
524 /// we only need to emit the new function pointers type here.
525 fn emitFunctionTypes(self: *ModuleBuilder, info: ModuleInfo) !void {
526 // TODO: Handle decorators. Function types usually don't have those
527 // though, but stuff like OpName could be a possibility.
528
529 // Entry points retain their old function type, so make sure to emit
530 // those in the `function_types` set.
531 for (info.entry_points.keys()) |func| {
532 const fn_info = info.functions.get(func).?;
533 _ = try self.internFunctionType(fn_info.return_type, fn_info.param_types);
534 }
535
536 for (self.function_types.keys(), self.function_types.values()) |fn_type, result_id| {
537 try self.section.emit(self.arena, .OpTypeFunction, .{
538 .id_result = result_id,
539 .return_type = fn_type.return_type,
540 .id_ref_2 = fn_type.param_types,
541 });
542 }
543 }
544
545 fn internFunctionType(self: *ModuleBuilder, return_type: ResultId, param_types: []const ResultId) !ResultId {
546 const entry = try self.function_types.getOrPut(self.arena, .{
547 .return_type = return_type,
548 .param_types = param_types,
549 });
550
551 if (!entry.found_existing) {
552 const new_id = self.allocId();
553 entry.value_ptr.* = new_id;
554 }
555
556 return entry.value_ptr.*;
557 }
558
559 /// Rewrite the modules functions and emit them with the new parameter types.
560 fn rewriteFunctions(
561 self: *ModuleBuilder,
562 parser: *BinaryModule.Parser,
563 binary: BinaryModule,
564 info: ModuleInfo,
565 ) !void {
566 var result_id_offsets: std.ArrayList(u16) = .empty;
567 var operands: std.ArrayList(u32) = .empty;
568
569 var maybe_current_function: ?ResultId = null;
570 var skip_until_end: bool = false;
571 var it = binary.iterateInstructionsFrom(binary.functions_start);
572 self.new_functions_section = self.section.instructions.items.len;
573 while (it.next()) |inst| {
574 if (skip_until_end) {
575 if (inst.opcode == .OpFunctionEnd) skip_until_end = false;
576 continue;
577 }
578 result_id_offsets.items.len = 0;
579 try parser.parseInstructionResultIds(binary, inst, &result_id_offsets);
580
581 operands.items.len = 0;
582 try operands.appendSlice(self.arena, inst.operands);
583
584 // Replace the result-ids with the global's new result-id if required.
585 for (result_id_offsets.items) |off| {
586 const result_id: ResultId = @fromBackingInt(@intCast(operands.items[off]));
587 if (info.invocation_globals.contains(result_id)) {
588 const func = maybe_current_function.?;
589 const new_info = self.function_new_info.get(func).?;
590 const fn_info = info.functions.get(func).?;
591 const index = fn_info.invocation_globals.getIndex(result_id).?;
592 operands.items[off] = @backingInt(new_info.invocationGlobalId(index));
593 }
594 }
595
596 switch (inst.opcode) {
597 .OpFunction => {
598 // Re-declare the function with the new parameters.
599 const func: ResultId = @fromBackingInt(@intCast(operands.items[1]));
600 if (info.dead_initializers.contains(func)) {
601 skip_until_end = true;
602 continue;
603 }
604 const fn_info = info.functions.get(func).?;
605 const new_info = self.function_new_info.get(func).?;
606
607 try self.section.emitRaw(self.arena, .OpFunction, 4);
608 self.section.writeOperand(ResultId, fn_info.return_type);
609 self.section.writeOperand(ResultId, func);
610 self.section.writeWord(operands.items[2]);
611 self.section.writeOperand(ResultId, new_info.new_function_type);
612
613 // Emit the OpFunctionParameters for the invocation globals. The functions
614 // actual parameters are emitted unchanged from their original form, so
615 // we don't need to handle those here.
616
617 for (fn_info.invocation_globals.keys(), 0..) |global, index| {
618 const ty = info.invocation_globals.get(global).?.ty;
619 const id = new_info.invocationGlobalId(index);
620 try self.section.emit(self.arena, .OpFunctionParameter, .{
621 .id_result_type = ty,
622 .id_result = id,
623 });
624 }
625
626 maybe_current_function = func;
627 },
628 .OpFunctionCall => {
629 // Add the required invocation globals to the function's new parameter list.
630 const caller = maybe_current_function.?;
631 const callee: ResultId = @fromBackingInt(@intCast(operands.items[2]));
632 const caller_info = info.functions.get(caller).?;
633 const callee_info = info.functions.get(callee).?;
634 const caller_new_info = self.function_new_info.get(caller).?;
635 const total_params = callee_info.invocation_globals.count() + callee_info.param_types.len;
636
637 try self.section.emitRaw(self.arena, .OpFunctionCall, 3 + total_params);
638 self.section.writeWord(operands.items[0]); // Copy result type-id
639 self.section.writeWord(operands.items[1]); // Copy result-id
640 self.section.writeOperand(ResultId, callee);
641
642 // Add the new arguments
643 for (callee_info.invocation_globals.keys()) |global| {
644 const caller_global_index = caller_info.invocation_globals.getIndex(global).?;
645 const id = caller_new_info.invocationGlobalId(caller_global_index);
646 self.section.writeOperand(ResultId, id);
647 }
648
649 // Add the original arguments
650 self.section.writeWords(operands.items[3..]);
651 },
652 else => {
653 try self.section.emitRawInstruction(self.arena, inst.opcode, operands.items);
654 },
655 }
656 }
657 }
658
659 fn emitNewEntryPoints(self: *ModuleBuilder, info: ModuleInfo) !void {
660 const arena = self.arena;
661 var all_function_invocation_globals: std.array_hash_map.Auto(ResultId, void) = .empty;
662
663 for (info.entry_points.keys(), 0..) |func, entry_point_index| {
664 const fn_info = info.functions.get(func).?;
665 if (fn_info.invocation_globals.count() == 0) continue;
666 const ep_id: ResultId = @fromBackingInt(@intCast(self.entry_point_new_id_base + @as(u32, @intCast(entry_point_index))));
667 const fn_type = self.function_types.get(.{
668 .return_type = fn_info.return_type,
669 .param_types = fn_info.param_types,
670 }).?;
671
672 try self.section.emit(arena, .OpFunction, .{
673 .id_result_type = fn_info.return_type,
674 .id_result = ep_id,
675 .function_control = .{}, // TODO: Copy the attributes from the original function maybe?
676 .function_type = fn_type,
677 });
678
679 // Emit OpFunctionParameter instructions for the original kernel's parameters.
680 const params_id_base: u32 = @backingInt(self.allocIds(@intCast(fn_info.param_types.len)));
681 for (fn_info.param_types, 0..) |param_type, i| {
682 const id: ResultId = @fromBackingInt(@intCast(params_id_base + @as(u32, @intCast(i))));
683 try self.section.emit(arena, .OpFunctionParameter, .{
684 .id_result_type = param_type,
685 .id_result = id,
686 });
687 }
688
689 try self.section.emit(arena, .OpLabel, .{
690 .id_result = self.allocId(),
691 });
692
693 // Besides the IDs of the main kernel, we also need the
694 // dependencies of the globals.
695 // Just quickly construct that set here.
696 all_function_invocation_globals.clearRetainingCapacity();
697 for (fn_info.invocation_globals.keys()) |global| {
698 try all_function_invocation_globals.put(arena, global, {});
699 const global_info = info.invocation_globals.get(global).?;
700 for (global_info.dependencies.keys()) |dependency| {
701 try all_function_invocation_globals.put(arena, dependency, {});
702 }
703 }
704
705 // Declare the IDs of the invocation globals.
706 const global_id_base: u32 = @backingInt(self.allocIds(@intCast(all_function_invocation_globals.count())));
707 for (all_function_invocation_globals.keys(), 0..) |global, i| {
708 const global_info = info.invocation_globals.get(global).?;
709
710 const id: ResultId = @fromBackingInt(@intCast(global_id_base + @as(u32, @intCast(i))));
711 try self.section.emit(arena, .OpVariable, .{
712 .id_result_type = global_info.ty,
713 .id_result = id,
714 .storage_class = .function,
715 .initializer = null,
716 });
717 }
718
719 // Call initializers for invocation globals that need it
720 for (all_function_invocation_globals.keys()) |global| {
721 const global_info = info.invocation_globals.get(global).?;
722 if (global_info.initializer == .none) continue;
723
724 const initializer_info = info.functions.get(global_info.initializer).?;
725 assert(initializer_info.param_types.len == 0);
726
727 try self.callWithGlobalsAndLinearParams(
728 &all_function_invocation_globals,
729 global_info.initializer,
730 initializer_info,
731 global_id_base,
732 undefined,
733 );
734 }
735
736 // Call the main kernel entry
737 try self.callWithGlobalsAndLinearParams(
738 &all_function_invocation_globals,
739 func,
740 fn_info,
741 global_id_base,
742 params_id_base,
743 );
744
745 try self.section.emit(arena, .OpReturn, {});
746 try self.section.emit(arena, .OpFunctionEnd, {});
747 }
748 }
749
750 fn callWithGlobalsAndLinearParams(
751 self: *ModuleBuilder,
752 all_globals: *const std.array_hash_map.Auto(ResultId, void),
753 func: ResultId,
754 callee_info: ModuleInfo.Fn,
755 global_id_base: u32,
756 params_id_base: u32,
757 ) !void {
758 const total_arguments = callee_info.invocation_globals.count() + callee_info.param_types.len;
759 try self.section.emitRaw(self.arena, .OpFunctionCall, 3 + total_arguments);
760 self.section.writeOperand(ResultId, callee_info.return_type);
761 self.section.writeOperand(ResultId, self.allocId());
762 self.section.writeOperand(ResultId, func);
763
764 // Add the invocation globals
765 for (callee_info.invocation_globals.keys()) |global| {
766 const index = all_globals.getIndex(global).?;
767 const id: ResultId = @fromBackingInt(@intCast(global_id_base + @as(u32, @intCast(index))));
768 self.section.writeOperand(ResultId, id);
769 }
770
771 // Add the arguments
772 for (0..callee_info.param_types.len) |index| {
773 const id: ResultId = @fromBackingInt(@intCast(params_id_base + @as(u32, @intCast(index))));
774 self.section.writeOperand(ResultId, id);
775 }
776 }
777};
778
779pub fn run(parser: *BinaryModule.Parser, binary: *BinaryModule, progress: std.Progress.Node) !void {
780 const sub_node = progress.start("Lower invocation globals", 6);
781 defer sub_node.end();
782
783 var arena_state = std.heap.ArenaAllocator.init(parser.gpa);
784 defer arena_state.deinit();
785 const arena = arena_state.allocator();
786
787 var info = try ModuleInfo.parse(arena, parser, binary.*);
788 try info.resolve(arena);
789
790 var builder = try ModuleBuilder.init(arena, binary.*, info);
791 sub_node.completeOne();
792 try builder.deriveNewFnInfo(info);
793 sub_node.completeOne();
794 try builder.processPreamble(binary.*, info);
795 sub_node.completeOne();
796 try builder.emitFunctionTypes(info);
797 sub_node.completeOne();
798 try builder.rewriteFunctions(parser, binary.*, info);
799 sub_node.completeOne();
800 try builder.emitNewEntryPoints(info);
801 sub_node.completeOne();
802 try builder.finalize(parser.gpa, binary);
803}
src/link/SpirV/prune_unused.zig deleted-257
...@@ -1,257 +0,0 @@
1const std = @import("std");
2const BinaryModule = @import("BinaryModule.zig");
3const spec = @import("../../codegen/spirv/spec.zig");
4const Opcode = spec.Opcode;
5const ResultId = spec.Id;
6const Word = spec.Word;
7
8pub fn run(parser: *BinaryModule.Parser, binary: *BinaryModule) !void {
9 const gpa = parser.gpa;
10
11 // map result-id → index in id_offsets for preamble instructions and function headers
12 var id_to_index: std.AutoHashMapUnmanaged(ResultId, u32) = .empty;
13 defer id_to_index.deinit(gpa);
14
15 // for each indexed instruction, its offset in the binary
16 var code_offsets: std.ArrayList(usize) = .empty;
17 defer code_offsets.deinit(gpa);
18
19 var it = binary.iterateInstructions();
20 while (it.next()) |inst| {
21 const inst_spec = parser.getInstSpec(inst.opcode) orelse continue;
22 const result_id = getResultId(inst, inst_spec) orelse continue;
23
24 // only index preamble instructions and function headers
25 if (inst.offset < binary.functions_start or inst.opcode == .OpFunction) {
26 const index: u32 = @intCast(code_offsets.items.len);
27 try id_to_index.put(gpa, result_id, index);
28 try code_offsets.append(gpa, inst.offset);
29 }
30 }
31
32 var alive: std.bit_set.Dynamic = try .initEmpty(gpa, code_offsets.items.len);
33 defer alive.deinit(gpa);
34
35 var id_offset_buf: std.ArrayList(u16) = .empty;
36 defer id_offset_buf.deinit(gpa);
37
38 // Mark non-prunable preamble instructions alive
39 // OpExtInst in the preamble is metadata (e.g. Zig error info) that references
40 // functions. skip it here so it doesn't root dead functions alive.
41 // These instructions are handled as prunable during the rewrite phase.
42 it = binary.iterateInstructions();
43 while (it.next()) |inst| {
44 if (inst.offset >= binary.functions_start) break;
45 if (canPrune(inst.opcode) or inst.opcode == .OpExtInst) continue;
46 try markAlive(
47 parser,
48 binary.*,
49 inst,
50 &alive,
51 &id_to_index,
52 &code_offsets,
53 &id_offset_buf,
54 );
55 }
56
57 // mark functions with LinkageAttributes Export alive
58 it = binary.iterateInstructions();
59 while (it.next()) |inst| {
60 if (inst.offset >= binary.functions_start) break;
61 if (inst.opcode == .OpDecorate and inst.operands.len >= 2 and
62 inst.operands[1] == @backingInt(spec.Decoration.linkage_attributes))
63 {
64 // Last word after the string is the linkage type; Export = 0.
65 if (inst.operands[inst.operands.len - 1] == @backingInt(spec.LinkageType.@"export")) {
66 const target: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
67 if (id_to_index.get(target)) |index| {
68 alive.set(index);
69 }
70 }
71 }
72 }
73
74 // mark alive functions' contents alive
75 it = binary.iterateInstructionsFrom(binary.functions_start);
76 while (it.next()) |inst| {
77 if (inst.opcode == .OpFunction) {
78 const inst_spec = parser.getInstSpec(inst.opcode) orelse continue;
79 const result_id = getResultId(inst, inst_spec) orelse continue;
80 const index = id_to_index.get(result_id) orelse continue;
81 if (!alive.isSet(index)) {
82 // skip dead function
83 while (it.next()) |inner| {
84 if (inner.opcode == .OpFunctionEnd) break;
85 }
86 continue;
87 }
88
89 // mark the function's type operands alive
90 try markAlive(parser, binary.*, inst, &alive, &id_to_index, &code_offsets, &id_offset_buf);
91 continue;
92 }
93
94 // mark operands of alive function contents
95 try markAlive(parser, binary.*, inst, &alive, &id_to_index, &code_offsets, &id_offset_buf);
96 }
97
98 // rewrite
99 var new_words: std.ArrayList(Word) = .empty;
100 defer new_words.deinit(gpa);
101 try new_words.ensureTotalCapacity(gpa, binary.instructions.len);
102
103 var new_functions_start: ?usize = null;
104
105 it = binary.iterateInstructions();
106 while (it.next()) |inst| {
107 if (inst.offset >= binary.functions_start and inst.opcode == .OpFunction) {
108 const inst_spec = parser.getInstSpec(inst.opcode) orelse continue;
109 const result_id = getResultId(inst, inst_spec) orelse continue;
110 const index = id_to_index.get(result_id) orelse continue;
111 if (!alive.isSet(index)) {
112 while (it.next()) |inner| {
113 if (inner.opcode == .OpFunctionEnd) break;
114 }
115 continue;
116 }
117 }
118
119 const is_prunable = canPrune(inst.opcode) or
120 (inst.opcode == .OpExtInst and inst.offset < binary.functions_start);
121 if (is_prunable) {
122 const inst_spec = parser.getInstSpec(inst.opcode) orelse {
123 appendInst(&new_words, binary, inst, &new_functions_start);
124 continue;
125 };
126
127 if (getResultId(inst, inst_spec)) |result_id| {
128 const index = id_to_index.get(result_id) orelse {
129 appendInst(&new_words, binary, inst, &new_functions_start);
130 continue;
131 };
132 if (!alive.isSet(index)) continue;
133 } else {
134 // annotation-style: emit only if the target id is alive
135 if (inst.operands.len > 0) {
136 const target: ResultId = @fromBackingInt(@intCast(inst.operands[0]));
137 if (id_to_index.get(target)) |idx| {
138 if (!alive.isSet(idx)) continue;
139 } else continue;
140 }
141 }
142 }
143
144 appendInst(&new_words, binary, inst, &new_functions_start);
145 }
146
147 {
148 var to_remove: std.ArrayList(ResultId) = .empty;
149 defer to_remove.deinit(gpa);
150
151 var ext_it = binary.ext_inst_map.iterator();
152 while (ext_it.next()) |entry| {
153 if (id_to_index.get(entry.key_ptr.*)) |index| {
154 if (!alive.isSet(index)) try to_remove.append(gpa, entry.key_ptr.*);
155 }
156 }
157 for (to_remove.items) |id| _ = binary.ext_inst_map.remove(id);
158
159 to_remove.items.len = 0;
160 var arith_it = binary.arith_type_width.iterator();
161 while (arith_it.next()) |entry| {
162 if (id_to_index.get(entry.key_ptr.*)) |index| {
163 if (!alive.isSet(index)) try to_remove.append(gpa, entry.key_ptr.*);
164 }
165 }
166 for (to_remove.items) |id| _ = binary.arith_type_width.remove(id);
167 }
168
169 binary.instructions = try gpa.dupe(Word, new_words.items);
170 binary.functions_start = new_functions_start orelse new_words.items.len;
171}
172
173fn appendInst(
174 new_words: *std.ArrayList(Word),
175 binary: *const BinaryModule,
176 inst: BinaryModule.Instruction,
177 new_functions_start: *?usize,
178) void {
179 if (new_functions_start.* == null and inst.offset >= binary.functions_start) {
180 new_functions_start.* = new_words.items.len;
181 }
182 const len = @as(usize, binary.instructions[inst.offset] >> 16);
183 new_words.appendSliceAssumeCapacity(binary.instructions[inst.offset..][0..len]);
184}
185
186fn markAlive(
187 parser: *BinaryModule.Parser,
188 binary: BinaryModule,
189 inst: BinaryModule.Instruction,
190 alive: *std.bit_set.Dynamic,
191 id_to_index: *const std.AutoHashMapUnmanaged(ResultId, u32),
192 code_offsets: *const std.ArrayList(usize),
193 id_offset_buf: *std.ArrayList(u16),
194) !void {
195 const start = id_offset_buf.items.len;
196 try parser.parseInstructionResultIds(binary, inst, id_offset_buf);
197 const end = id_offset_buf.items.len;
198
199 var i = start;
200 while (i < end) : (i += 1) {
201 const off = id_offset_buf.items[i];
202 const id: ResultId = @fromBackingInt(@intCast(inst.operands[off]));
203 const index = id_to_index.get(id) orelse continue;
204 if (alive.isSet(index)) continue;
205 alive.set(index);
206
207 const offset = code_offsets.items[index];
208 const ref_inst = BinaryModule.Instruction{
209 .opcode = @fromBackingInt(@intCast(binary.instructions[offset] & 0xFFFF)),
210 .offset = offset,
211 .operands = blk: {
212 const l = binary.instructions[offset] >> 16;
213 break :blk binary.instructions[offset..][1..l];
214 },
215 };
216
217 if (ref_inst.opcode == .OpFunction) {
218 var fn_it = binary.iterateInstructionsFrom(ref_inst.offset);
219 _ = fn_it.next();
220 while (fn_it.next()) |fn_inst| {
221 if (fn_inst.opcode == .OpFunctionEnd) break;
222 try markAlive(parser, binary, fn_inst, alive, id_to_index, code_offsets, id_offset_buf);
223 }
224 try markAlive(parser, binary, ref_inst, alive, id_to_index, code_offsets, id_offset_buf);
225 } else {
226 try markAlive(parser, binary, ref_inst, alive, id_to_index, code_offsets, id_offset_buf);
227 }
228 }
229}
230
231fn getResultId(inst: BinaryModule.Instruction, inst_spec: spec.Instruction) ?ResultId {
232 for (0..@min(2, inst_spec.operands.len)) |i| {
233 if (inst_spec.operands[i].kind == .id_result) {
234 if (i < inst.operands.len) return @fromBackingInt(@intCast(inst.operands[i]));
235 }
236 }
237 return null;
238}
239
240fn canPrune(op: Opcode) bool {
241 return switch (op.class()) {
242 .type_declaration,
243 .constant_creation,
244 .annotation,
245 => true,
246 else => switch (op) {
247 .OpFunction,
248 .OpUndef,
249 .OpString,
250 .OpName,
251 .OpMemberName,
252 .OpVariable,
253 => true,
254 else => false,
255 },
256 };
257}
src/link/Spirv.zig created+252
...@@ -0,0 +1,252 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Path = std.Build.Cache.Path;
4const assert = std.debug.assert;
5const Zcu = @import("../Zcu.zig");
6const InternPool = @import("../InternPool.zig");
7const Compilation = @import("../Compilation.zig");
8const link = @import("../link.zig");
9const codegen = @import("../codegen.zig");
10const CodeGen = @import("../codegen/spirv/CodeGen.zig");
11const Mir = @import("../codegen/spirv/Mir.zig");
12const spec = @import("../codegen/spirv/spec.zig");
13const Section = @import("../codegen/spirv/Section.zig");
14const Flush = @import("Spirv/Flush.zig");
15const Word = spec.Word;
16const Linker = @This();
17
18base: link.File,
19mirs: std.array_hash_map.Auto(InternPool.Nav.Index, Mir),
20objects: std.ArrayList(Object),
21exports: std.array_hash_map.Auto(InternPool.Nav.Index, InternPool.NullTerminatedString),
22
23pub const Object = struct { path: Path, mir: Mir };
24
25pub fn createEmpty(
26 arena: Allocator,
27 comp: *Compilation,
28 emit: Path,
29 options: link.File.OpenOptions,
30) !*Linker {
31 const file = try emit.root_dir.handle.createFile(comp.io, emit.sub_path, .{});
32 errdefer file.close(comp.io);
33 const linker = try arena.create(Linker);
34 linker.* = .{
35 .base = .{
36 .tag = .spirv,
37 .comp = comp,
38 .emit = emit,
39 .gc_sections = options.gc_sections orelse false,
40 .print_gc_sections = options.print_gc_sections,
41 .stack_size = options.stack_size orelse 0,
42 .allow_shlib_undefined = options.allow_shlib_undefined orelse false,
43 .file = file,
44 .build_id = options.build_id,
45 },
46 .mirs = .empty,
47 .objects = .empty,
48 .exports = .empty,
49 };
50 return linker;
51}
52
53pub fn open(
54 arena: Allocator,
55 comp: *Compilation,
56 emit: Path,
57 options: link.File.OpenOptions,
58) !*Linker {
59 return createEmpty(arena, comp, emit, options);
60}
61
62pub fn deinit(linker: *Linker) void {
63 const gpa = linker.base.comp.gpa;
64 for (linker.mirs.values()) |*mir| mir.deinit(gpa);
65 linker.mirs.deinit(gpa);
66 for (linker.objects.items) |*object| object.mir.deinit(gpa);
67 linker.objects.deinit(gpa);
68 linker.exports.deinit(gpa);
69}
70
71pub fn loadInput(linker: *Linker, input: link.Input) !void {
72 const diags = &linker.base.comp.link_diags;
73 switch (input) {
74 .object => |obj| try linker.loadObject(obj),
75 else => return diags.fail("unsupported link input for SPIR-V target", .{}),
76 }
77}
78
79fn loadObject(linker: *Linker, obj: link.Input.Object) !void {
80 const comp = linker.base.comp;
81 const gpa = comp.gpa;
82 const io = comp.io;
83 const diags = &comp.link_diags;
84
85 const file_size = obj.file.length(io) catch |err| {
86 return diags.failParse(obj.path, "failed to get file size: {t}", .{err});
87 };
88 if (file_size % @sizeOf(Word) != 0) {
89 return diags.failParse(obj.path, "file size is not a multiple of {d}", .{
90 @sizeOf(Word),
91 });
92 }
93
94 const words = try gpa.alloc(Word, @intCast(file_size / @sizeOf(Word)));
95 defer gpa.free(words);
96 const bytes = std.mem.sliceAsBytes(words);
97 const n_read = obj.file.readPositionalAll(io, bytes, 0) catch |err| {
98 return diags.failParse(obj.path, "failed to read: {t}", .{err});
99 };
100
101 if (n_read != bytes.len) {
102 return diags.failParse(obj.path, "incomplete read", .{});
103 }
104 const header_len = @sizeOf(spec.Header) / @sizeOf(Word);
105 if (words.len < header_len) {
106 return diags.failParse(obj.path, "header too small", .{});
107 }
108 const header = std.mem.bytesToValue(spec.Header, std.mem.sliceAsBytes(words[0..header_len]));
109 if (header.magic != spec.magic_number) {
110 return diags.failParse(obj.path, "invalid magic number", .{});
111 }
112 if (header.id_bound == 0) {
113 return diags.failParse(obj.path, "invalid id bound", .{});
114 }
115
116 const instructions = words[header_len..];
117 var module = Section.fromWords(gpa, instructions, header.id_bound) catch |err| switch (err) {
118 error.OutOfMemory => |e| return e,
119 else => return diags.failParse(obj.path, "failed to parse instructions: {t}", .{err}),
120 };
121 errdefer module.deinit(gpa);
122 try linker.objects.append(gpa, .{ .path = obj.path, .mir = .{
123 .id_bound = header.id_bound,
124 .module = module,
125 .nav_refs = &.{},
126 .externs = &.{},
127 .entry_points = &.{},
128 } });
129}
130
131pub fn updateFunc(
132 linker: *Linker,
133 pt: Zcu.PerThread,
134 func_index: InternPool.Index,
135 mir: *codegen.AnyMir,
136) !void {
137 const gpa = linker.base.comp.gpa;
138 const nav_index = pt.zcu.funcInfo(func_index).owner_nav;
139 const gop = try linker.mirs.getOrPut(gpa, nav_index);
140 if (gop.found_existing) gop.value_ptr.deinit(gpa);
141 gop.value_ptr.* = mir.spirv;
142 mir.spirv = .{
143 .id_bound = 1,
144 .module = .empty,
145 .nav_refs = &.{},
146 .externs = &.{},
147 .entry_points = &.{},
148 };
149}
150
151pub fn updateNav(
152 linker: *Linker,
153 pt: Zcu.PerThread,
154 nav_index: InternPool.Nav.Index,
155) link.Error!void {
156 const gpa = linker.base.comp.gpa;
157 const ip = &pt.zcu.intern_pool;
158 const resolved = ip.getNav(nav_index).resolved.?;
159 switch (ip.indexToKey(resolved.value)) {
160 .func => return,
161 .@"extern" => |@"extern"| if (ip.isFunctionType(@"extern".ty)) return,
162 else => if (!resolved.@"const") assert(resolved.@"threadlocal") else return,
163 }
164 var mir = CodeGen.generateNav(pt, nav_index) catch |err| switch (err) {
165 error.AlreadyReported => return,
166 else => |e| return e,
167 };
168 errdefer mir.deinit(gpa);
169 const gop = try linker.mirs.getOrPut(gpa, nav_index);
170 if (gop.found_existing) gop.value_ptr.deinit(gpa);
171 gop.value_ptr.* = mir;
172}
173
174pub fn updateExports(
175 linker: *Linker,
176 pt: Zcu.PerThread,
177 export_indices: []const Zcu.Export.Index,
178) link.Error!void {
179 const zcu = pt.zcu;
180 const ip = &zcu.intern_pool;
181 const gpa = linker.base.comp.gpa;
182 const diags = &linker.base.comp.link_diags;
183
184 linker.exports.clearRetainingCapacity();
185 try linker.exports.ensureUnusedCapacity(gpa, export_indices.len);
186 for (export_indices) |exp_index| {
187 const exp = exp_index.ptr(zcu);
188 const nav_index = switch (exp.exported) {
189 .nav => |nav| nav,
190 .uav => return diags.fail("cannot export a uav constant for SPIR-V target", .{}),
191 };
192 const nav = ip.getNav(nav_index);
193 const resolved = nav.resolved.?;
194 if (!ip.isFunctionType(resolved.type) and !resolved.@"threadlocal") {
195 return diags.fail("cannot export constant '{f}' for SPIR-V target", .{
196 nav.fqn.fmt(ip),
197 });
198 }
199 linker.exports.putAssumeCapacity(nav_index, exp.opts.name);
200 }
201}
202
203pub fn flush(
204 linker: *Linker,
205 arena: Allocator,
206 tid: Zcu.PerThread.Id,
207 prog_node: std.Progress.Node,
208) link.Error!void {
209 _ = tid;
210 const comp = linker.base.comp;
211 const gpa = comp.gpa;
212 const diags = &comp.link_diags;
213
214 const sub_node = prog_node.start("Flush Module", 1);
215 defer sub_node.end();
216
217 var f: Flush = .{
218 .linker = linker,
219 .arena = arena,
220 .id_bound = 1,
221 .navs = .empty,
222 .symbols = .empty,
223 .interned = .empty,
224 .variables = .empty,
225 .function_references = .empty,
226 .entry_points = .empty,
227 .deps = .empty,
228 .scratch = .empty,
229 .extended_instruction_sets = .empty,
230 .object_entry_points = .empty,
231 .object_execution_modes = .empty,
232 .debug_strings = .empty,
233 .names = .empty,
234 .decorations = .empty,
235 .globals = .empty,
236 .declarations = .empty,
237 .functions = .empty,
238 };
239 var out: Section = .empty;
240 defer out.deinit(gpa);
241
242 try f.emitModule(&out);
243 sub_node.completeOne();
244
245 var writer = linker.base.file.?.writer(comp.io, &.{});
246 writer.interface.writeSliceEndian(Word, out.instructions.items, .little) catch {
247 return diags.fail("failed to write {f}: {t}", .{ linker.base.emit, writer.err.? });
248 };
249 writer.end() catch |err| {
250 return diags.fail("failed to write {f}: {t}", .{ linker.base.emit, err });
251 };
252}
src/link/Spirv/Flush.zig created+665
...@@ -0,0 +1,665 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Path = std.Build.Cache.Path;
4const assert = std.debug.assert;
5const InternPool = @import("../../InternPool.zig");
6const link = @import("../../link.zig");
7const Type = @import("../../Type.zig");
8const Linker = @import("../Spirv.zig");
9const Mir = @import("../../codegen/spirv/Mir.zig");
10const spec = @import("../../codegen/spirv/spec.zig");
11const Section = @import("../../codegen/spirv/Section.zig");
12const zig_version = @import("builtin").zig_version;
13const Id = spec.Id;
14const Word = spec.Word;
15const Flush = @This();
16
17linker: *Linker,
18arena: Allocator,
19id_bound: Word,
20navs: std.array_hash_map.Auto(InternPool.Nav.Index, Id),
21symbols: std.array_hash_map.String(Symbol),
22interned: std.array_hash_map.String(Id),
23variables: std.array_hash_map.Auto(Id, spec.StorageClass),
24function_references: std.array_hash_map.Auto(Id, []const Id),
25entry_points: std.ArrayList(Mir.EntryPoint),
26deps: std.ArrayList(Id),
27scratch: Section,
28extended_instruction_sets: Section,
29object_entry_points: Section,
30object_execution_modes: Section,
31debug_strings: Section,
32names: Section,
33decorations: Section,
34globals: Section,
35declarations: Section,
36functions: Section,
37
38const Symbol = struct {
39 id: Id,
40 defined: bool,
41 declaration: []const Word,
42};
43
44const Annotation = struct {
45 target: Word,
46 class: spec.Class,
47 start: usize,
48 end: usize,
49};
50
51const Input = struct {
52 mir: *const Mir,
53 ids: []Id,
54 marks: []u32,
55 mark: u32,
56
57 fn copy(
58 input: *Input,
59 flush: *Flush,
60 dest: *Section,
61 start: usize,
62 end: usize,
63 result_index: ?usize,
64 ) !void {
65 const words = input.mir.module.instructions.items;
66 try dest.ensureUnusedCapacity(flush.arena, end - start);
67 for (words[start..end], start..) |word, i| {
68 if (i == result_index) {
69 dest.writeWord(0);
70 continue;
71 }
72 if (!input.mir.module.ids.isSet(i)) {
73 dest.writeWord(word);
74 continue;
75 }
76 if (input.marks[word] != input.mark) {
77 input.marks[word] = input.mark;
78 try flush.deps.append(flush.arena, input.ids[word]);
79 }
80 dest.writeWord(@backingInt(input.ids[word]));
81 }
82 }
83};
84
85fn allocId(flush: *Flush) Id {
86 const id: Id = @fromBackingInt(flush.id_bound);
87 flush.id_bound += 1;
88 return id;
89}
90
91fn navId(flush: *Flush, nav: InternPool.Nav.Index) !Id {
92 const gop = try flush.navs.getOrPut(flush.arena, nav);
93 if (!gop.found_existing) gop.value_ptr.* = flush.allocId();
94 return gop.value_ptr.*;
95}
96
97pub fn emitModule(flush: *Flush, out: *Section) link.Error!void {
98 const linker = flush.linker;
99 const comp = linker.base.comp;
100 const zcu = comp.zcu.?;
101 const ip = &zcu.intern_pool;
102 const gpa = comp.gpa;
103 const arena = flush.arena;
104 const diags = &comp.link_diags;
105 const target = &comp.root_mod.resolved_target.result;
106 const is_object = comp.config.output_mode == .Obj;
107
108 for (linker.exports.keys(), linker.exports.values()) |nav_index, name| {
109 if (!linker.mirs.contains(nav_index)) {
110 assert(zcu.failed_codegen.contains(nav_index));
111 return error.AlreadyReported;
112 }
113
114 const id = try flush.navId(nav_index);
115 const nav_ty: Type = .fromInterned(ip.getNav(nav_index).resolved.?.type);
116 if (nav_ty.zigTypeTag(zcu) == .@"fn") {
117 const cc = nav_ty.fnCallingConvention(zcu);
118 if (cc != .spirv_device) {
119 try flush.entry_points.append(arena, .{
120 .id = id,
121 .name = name.toSlice(ip),
122 .cc = cc,
123 });
124 continue;
125 }
126 }
127 if (!is_object) continue;
128
129 try flush.symbols.putNoClobber(arena, name.toSlice(ip), .{
130 .id = id,
131 .defined = true,
132 .declaration = &.{},
133 });
134 }
135
136 for (linker.objects.items) |*object| {
137 try flush.load(&object.mir, object.path);
138 }
139
140 const references = try zcu.resolveReferences();
141 for (linker.mirs.keys(), linker.mirs.values()) |nav_index, *mir| {
142 const nav = ip.getNav(nav_index);
143 if (nav.getExtern(ip) != null) continue;
144
145 const unit: InternPool.AnalUnit = switch (ip.indexToKey(nav.resolved.?.type)) {
146 .func_type => .wrap(.{ .func = zcu.navValue(nav_index).toIntern() }),
147 else => .wrap(.{ .nav_val = nav_index }),
148 };
149 if (references.contains(unit)) try flush.load(mir, null);
150 }
151
152 for (linker.mirs.keys(), linker.mirs.values()) |nav_index, *mir| {
153 if (ip.getNav(nav_index).getExtern(ip) == null) continue;
154 if (flush.navs.contains(nav_index)) try flush.load(mir, null);
155 }
156
157 var failed = false;
158 for (flush.navs.keys()) |nav_index| {
159 if (linker.mirs.contains(nav_index) or zcu.failed_codegen.contains(nav_index)) continue;
160 diags.addError("undefined reference to '{f}'", .{ip.getNav(nav_index).fqn.fmt(ip)});
161 failed = true;
162 }
163 for (flush.symbols.keys(), flush.symbols.values()) |name, symbol| {
164 if (is_object) {
165 try flush.decorations.emit(arena, .OpDecorate, .{
166 .target = symbol.id,
167 .decoration = .{ .linkage_attributes = .{
168 .name = name,
169 .linkage_type = if (symbol.defined) .@"export" else .import,
170 } },
171 });
172 }
173 if (symbol.defined) continue;
174 if (!is_object or symbol.declaration.len == 0) {
175 diags.addError("undefined symbol '{s}'", .{name});
176 failed = true;
177 continue;
178 }
179 const header: spec.InstructionHeader = @bitCast(symbol.declaration[0]);
180 const section = if (header.opcode == .OpVariable) &flush.globals else &flush.declarations;
181 try section.writeWords(arena, symbol.declaration);
182 }
183 if (failed) return error.AlreadyReported;
184
185 var version: spec.Version = .{ .major = 1, .minor = 0 };
186 for ([_]std.Target.spirv.Feature{
187 .v1_1,
188 .v1_2,
189 .v1_3,
190 .v1_4,
191 .v1_5,
192 .v1_6,
193 }) |feature| {
194 if (target.cpu.has(.spirv, feature)) version.minor += 1;
195 }
196
197 const zig_packed_version = (zig_version.major << 12) | (zig_version.minor << 7) | zig_version.patch;
198 const header: spec.Header = .{
199 .magic = spec.magic_number,
200 .version = version,
201 .generator = .{ .tool = spec.zig_generator_id, .version = zig_packed_version },
202 .id_bound = flush.id_bound,
203 .schema = 0,
204 };
205 try out.writeWords(gpa, @ptrCast(@alignCast(&header)));
206 try flush.emitCapabilities(out);
207 try out.writeWords(gpa, flush.extended_instruction_sets.instructions.items);
208 try flush.emitMemoryModel(out);
209 try flush.emitEntryPoints(out);
210 try out.writeWords(gpa, flush.object_entry_points.instructions.items);
211 try flush.emitExecutionModes(out);
212 try out.writeWords(gpa, flush.object_execution_modes.instructions.items);
213 try out.writeWords(gpa, flush.debug_strings.instructions.items);
214 try flush.emitSourceInfo(out, zig_packed_version);
215 try out.writeWords(gpa, flush.names.instructions.items);
216 try out.writeWords(gpa, flush.decorations.instructions.items);
217 try out.writeWords(gpa, flush.globals.instructions.items);
218 try out.writeWords(gpa, flush.declarations.instructions.items);
219 try out.writeWords(gpa, flush.functions.instructions.items);
220}
221
222fn load(flush: *Flush, mir: *const Mir, path: ?Path) link.Error!void {
223 const comp = flush.linker.base.comp;
224 const gpa = comp.gpa;
225 const arena = flush.arena;
226 const diags = &comp.link_diags;
227
228 const ids = try gpa.alloc(Id, mir.id_bound);
229 defer gpa.free(ids);
230 ids[0] = .none;
231 for (ids[1..], flush.id_bound..) |*id, i| id.* = @fromBackingInt(@intCast(i));
232 flush.id_bound += mir.id_bound - 1;
233
234 const marks = try gpa.alloc(u32, mir.id_bound);
235 defer gpa.free(marks);
236 @memset(marks, 0);
237 var input: Input = .{ .mir = mir, .ids = ids, .marks = marks, .mark = 0 };
238
239 var forward_pointers: std.bit_set.Dynamic = try .initEmpty(gpa, mir.id_bound);
240 defer forward_pointers.deinit(gpa);
241 var imports: std.array_hash_map.Auto(Word, u32) = .empty;
242 defer imports.deinit(gpa);
243 var annotations: std.ArrayList(Annotation) = .empty;
244 defer annotations.deinit(gpa);
245
246 for (mir.nav_refs) |ref| ids[@backingInt(ref.id)] = try flush.navId(ref.nav);
247 for (mir.externs) |ext| {
248 const gop = try flush.symbols.getOrPut(arena, ext.name);
249 if (!gop.found_existing) gop.value_ptr.* = .{
250 .id = ids[@backingInt(ext.id)],
251 .defined = false,
252 .declaration = &.{},
253 };
254 ids[@backingInt(ext.id)] = gop.value_ptr.id;
255 try imports.put(gpa, @backingInt(ext.id), @intCast(gop.index));
256 }
257
258 const words = mir.module.instructions.items;
259 var offset: usize = 0;
260 while (offset < words.len) {
261 const start = offset;
262 const header: spec.InstructionHeader = @bitCast(words[start]);
263 const inst = words[start..][0..header.word_count];
264 offset += inst.len;
265
266 if (header.opcode == .OpDecorate) {
267 const target = inst[1];
268 const decoration: spec.Decoration = @fromBackingInt(inst[2]);
269 if (decoration == .linkage_attributes) {
270 const parameters = inst[3..];
271 const name_words = parameters[0 .. parameters.len - 1];
272 const name = std.mem.sliceTo(std.mem.sliceAsBytes(name_words), 0);
273 const linkage: spec.LinkageType = @fromBackingInt(parameters[parameters.len - 1]);
274 const gop = try flush.symbols.getOrPut(arena, name);
275 if (!gop.found_existing) gop.value_ptr.* = .{
276 .id = ids[target],
277 .defined = false,
278 .declaration = &.{},
279 };
280
281 switch (linkage) {
282 .@"export" => {
283 if (gop.value_ptr.defined) {
284 return diags.failParse(path.?, "duplicate export '{s}'", .{name});
285 }
286 gop.value_ptr.defined = true;
287 },
288 .import => try imports.put(gpa, target, @intCast(gop.index)),
289 .link_once_odr => {
290 return diags.failParse(path.?, "unsupported linkage '{t}'", .{linkage});
291 },
292 }
293
294 ids[target] = gop.value_ptr.id;
295 continue;
296 }
297 }
298
299 const class = header.opcode.class();
300 const target: Word = switch (header.opcode) {
301 .OpName, .OpMemberName => inst[1],
302 .OpDecorationGroup, .OpGroupDecorate, .OpGroupMemberDecorate => {
303 return diags.failParse(path.?, "decoration groups are not supported", .{});
304 },
305 else => if (class == .annotation) inst[1] else continue,
306 };
307 try annotations.append(gpa, .{
308 .target = target,
309 .class = class,
310 .start = start,
311 .end = offset,
312 });
313 }
314
315 const starts = try gpa.alloc(u32, mir.id_bound + 1);
316 defer gpa.free(starts);
317 @memset(starts, 0);
318
319 for (annotations.items) |annotation| starts[annotation.target + 1] += 1;
320 for (1..starts.len) |i| starts[i] += starts[i - 1];
321
322 const cursors = try gpa.dupe(u32, starts);
323 defer gpa.free(cursors);
324 const by_target = try gpa.alloc(u32, annotations.items.len);
325 defer gpa.free(by_target);
326 for (annotations.items, 0..) |annotation, i| {
327 by_target[cursors[annotation.target]] = @intCast(i);
328 cursors[annotation.target] += 1;
329 }
330
331 var results: std.ArrayList(Word) = .empty;
332 defer results.deinit(gpa);
333
334 offset = 0;
335 while (offset < words.len) {
336 const start = offset;
337 const header: spec.InstructionHeader = @bitCast(words[start]);
338 const inst = words[start..][0..header.word_count];
339 offset += inst.len;
340 input.mark += 1;
341 flush.deps.clearRetainingCapacity();
342
343 const result_index = header.opcode.resultIndex() orelse {
344 switch (header.opcode) {
345 .OpEntryPoint => {
346 try input.copy(flush, &flush.object_entry_points, start, offset, null);
347 },
348 .OpExecutionMode, .OpExecutionModeId => {
349 try input.copy(flush, &flush.object_execution_modes, start, offset, null);
350 },
351 .OpTypeForwardPointer => {
352 forward_pointers.set(inst[1]);
353 try input.copy(flush, &flush.globals, start, offset, null);
354 },
355 else => {},
356 }
357 continue;
358 };
359 const result = inst[result_index];
360 results.clearRetainingCapacity();
361 try results.append(gpa, result);
362
363 var has_body = false;
364 if (header.opcode == .OpFunction) {
365 while (true) {
366 const body: spec.InstructionHeader = @bitCast(words[offset]);
367 if (body.opcode == .OpLabel) has_body = true;
368 if (body.opcode.resultIndex()) |index| {
369 try results.append(gpa, words[offset + index]);
370 }
371 offset += body.word_count;
372 if (body.opcode == .OpFunctionEnd) break;
373 }
374 }
375
376 for (results.items) |own| input.marks[own] = input.mark;
377
378 if (imports.get(result)) |symbol_index| {
379 flush.scratch.reset();
380 try input.copy(flush, &flush.scratch, start, offset, null);
381 const declaration = try arena.dupe(Word, flush.scratch.instructions.items);
382 flush.symbols.values()[symbol_index].declaration = declaration;
383 continue;
384 }
385
386 switch (header.opcode) {
387 .OpFunction => if (!has_body) return diags.failParse(path.?, "function declaration without linkage", .{}),
388 .OpVariable => try flush.variables.put(arena, ids[result], @fromBackingInt(inst[3])),
389 else => if (!forward_pointers.isSet(result)) {
390 flush.scratch.reset();
391 try input.copy(flush, &flush.scratch, start, offset, start + result_index);
392 for (by_target[starts[result]..starts[result + 1]]) |index| {
393 const annotation = annotations.items[index];
394 if (annotation.class != .annotation) continue;
395 const target = annotation.start + 1;
396 try input.copy(flush, &flush.scratch, annotation.start, annotation.end, target);
397 }
398
399 const key = std.mem.sliceAsBytes(flush.scratch.instructions.items);
400 const gop = try flush.interned.getOrPut(arena, key);
401 if (gop.found_existing) {
402 ids[result] = gop.value_ptr.*;
403 continue;
404 }
405 gop.key_ptr.* = try arena.dupe(u8, key);
406 gop.value_ptr.* = ids[result];
407 },
408 }
409
410 for (results.items) |target| {
411 for (by_target[starts[target]..starts[target + 1]]) |index| {
412 const annotation = annotations.items[index];
413 const section = switch (annotation.class) {
414 .debug => &flush.names,
415 .annotation => &flush.decorations,
416 else => unreachable,
417 };
418 try input.copy(flush, section, annotation.start, annotation.end, null);
419 }
420 }
421
422 const section = switch (header.opcode) {
423 .OpFunction => &flush.functions,
424 .OpExtInstImport => &flush.extended_instruction_sets,
425 .OpString => &flush.debug_strings,
426 else => &flush.globals,
427 };
428 try input.copy(flush, section, start, offset, null);
429 if (header.opcode == .OpFunction) {
430 const references = try arena.dupe(Id, flush.deps.items);
431 try flush.function_references.put(arena, ids[result], references);
432 }
433 }
434
435 for (mir.entry_points) |entry_point| {
436 try flush.entry_points.append(arena, .{
437 .id = ids[@backingInt(entry_point.id)],
438 .name = entry_point.name,
439 .cc = entry_point.cc,
440 });
441 }
442}
443
444fn emitCapabilities(flush: *Flush, out: *Section) link.Error!void {
445 const comp = flush.linker.base.comp;
446 const target = &comp.root_mod.resolved_target.result;
447 const gpa = comp.gpa;
448
449 switch (target.os.tag) {
450 .opengl, .vulkan => try out.emit(gpa, .OpCapability, .{ .capability = .shader }),
451 .opencl => {
452 try out.emit(gpa, .OpCapability, .{ .capability = .kernel });
453 try out.emit(gpa, .OpCapability, .{ .capability = .addresses });
454 },
455 else => unreachable,
456 }
457
458 if (target.cpu.arch == .spirv64) {
459 if (!target.cpu.has(.spirv, .int64)) {
460 try out.emit(gpa, .OpCapability, .{ .capability = .int64 });
461 }
462 if (target.os.tag == .vulkan) {
463 try out.emit(gpa, .OpCapability, .{ .capability = .physical_storage_buffer_addresses });
464 }
465 }
466
467 if (comp.config.output_mode == .Obj and flush.symbols.count() > 0) {
468 try out.emit(gpa, .OpCapability, .{ .capability = .linkage });
469 }
470
471 inline for (@typeInfo(spec.Capability).@"enum".field_names) |name| {
472 if (@hasField(std.Target.spirv.Feature, name)) {
473 const feature = @field(std.Target.spirv.Feature, name);
474 if (target.cpu.has(.spirv, feature)) {
475 try out.emit(gpa, .OpCapability, .{ .capability = @field(spec.Capability, name) });
476 }
477 }
478 }
479
480 if (target.cpu.arch == .spirv64 and target.os.tag == .vulkan) {
481 try out.emit(gpa, .OpExtension, .{ .name = "SPV_KHR_physical_storage_buffer" });
482 }
483
484 inline for (@typeInfo(spec.Extension).@"enum".field_names) |name| {
485 if (comptime std.mem.startsWith(u8, name, "v1_")) continue;
486 if (@hasField(std.Target.spirv.Feature, name)) {
487 const feature = @field(std.Target.spirv.Feature, name);
488 if (target.cpu.has(.spirv, feature)) try out.emit(gpa, .OpExtension, .{ .name = name });
489 }
490 }
491}
492
493fn emitMemoryModel(flush: *Flush, out: *Section) link.Error!void {
494 const comp = flush.linker.base.comp;
495 const target = &comp.root_mod.resolved_target.result;
496 const addressing_model: spec.AddressingModel = switch (target.os.tag) {
497 .opengl => .logical,
498 .vulkan => switch (target.cpu.arch) {
499 .spirv32 => .logical,
500 .spirv64 => .physical_storage_buffer64,
501 else => unreachable,
502 },
503 .opencl => switch (target.cpu.arch) {
504 .spirv32 => .physical32,
505 .spirv64 => .physical64,
506 else => unreachable,
507 },
508 else => unreachable,
509 };
510 try out.emit(comp.gpa, .OpMemoryModel, .{
511 .addressing_model = addressing_model,
512 .memory_model = switch (target.os.tag) {
513 .opencl => .open_cl,
514 .vulkan, .opengl => .glsl450,
515 else => unreachable,
516 },
517 });
518}
519
520fn emitEntryPoints(flush: *Flush, out: *Section) link.Error!void {
521 const comp = flush.linker.base.comp;
522 const gpa = comp.gpa;
523 const arena = flush.arena;
524 const target = &comp.root_mod.resolved_target.result;
525 const v1_4 = target.cpu.has(.spirv, .v1_4);
526
527 var visited: std.bit_set.Dynamic = try .initEmpty(arena, flush.id_bound);
528 var pending: std.ArrayList(Id) = .empty;
529 var interface: std.ArrayList(Id) = .empty;
530 for (flush.entry_points.items) |entry_point| {
531 const execution_model: spec.ExecutionModel = switch (entry_point.cc) {
532 .spirv_kernel => if (target.os.tag == .opencl) .kernel else .gl_compute,
533 .spirv_vertex => .vertex,
534 .spirv_fragment => .fragment,
535 .spirv_task => .task_ext,
536 .spirv_mesh => .mesh_ext,
537 else => unreachable,
538 };
539
540 visited.unsetAll();
541 interface.clearRetainingCapacity();
542 try pending.append(arena, entry_point.id);
543 while (pending.pop()) |id| {
544 if (visited.isSet(@backingInt(id))) continue;
545 visited.set(@backingInt(id));
546 if (flush.variables.get(id)) |storage_class| {
547 if (storage_class == .function) continue;
548 if (!v1_4 and storage_class != .input and storage_class != .output) continue;
549 try interface.append(arena, id);
550 } else if (flush.function_references.get(id)) |references| {
551 try pending.appendSlice(arena, references);
552 }
553 }
554
555 try out.emit(gpa, .OpEntryPoint, .{
556 .execution_model = execution_model,
557 .entry_point = entry_point.id,
558 .name = entry_point.name,
559 .interface = interface.items,
560 });
561 }
562}
563
564fn emitExecutionModes(flush: *Flush, out: *Section) link.Error!void {
565 const comp = flush.linker.base.comp;
566 const gpa = comp.gpa;
567 const target = &comp.root_mod.resolved_target.result;
568
569 for (flush.entry_points.items) |entry_point| switch (entry_point.cc) {
570 .spirv_kernel, .spirv_task => |kernel| {
571 try out.emit(gpa, .OpExecutionMode, .{
572 .entry_point = entry_point.id,
573 .mode = .{ .local_size = .{
574 .x_size = kernel.x,
575 .y_size = kernel.y,
576 .z_size = kernel.z,
577 } },
578 });
579 },
580 .spirv_fragment => |fragment| {
581 try out.emit(gpa, .OpExecutionMode, .{
582 .entry_point = entry_point.id,
583 .mode = if (target.os.tag == .vulkan) .origin_upper_left else .origin_lower_left,
584 });
585 if (fragment.pixel_centered_integer) {
586 try out.emit(gpa, .OpExecutionMode, .{
587 .entry_point = entry_point.id,
588 .mode = .pixel_center_integer,
589 });
590 }
591 if (fragment.depth_assumption != .none) {
592 try out.emit(gpa, .OpExecutionMode, .{
593 .entry_point = entry_point.id,
594 .mode = switch (fragment.depth_assumption) {
595 .none => unreachable,
596 .greater => .depth_greater,
597 .less => .depth_less,
598 .unchanged => .depth_unchanged,
599 },
600 });
601 }
602 },
603 .spirv_mesh => |mesh| {
604 try out.emit(gpa, .OpExecutionMode, .{
605 .entry_point = entry_point.id,
606 .mode = .{ .output_vertices = .{ .vertex_count = mesh.max_vertices } },
607 });
608 try out.emit(gpa, .OpExecutionMode, .{
609 .entry_point = entry_point.id,
610 .mode = .{ .output_primitives_ext = .{ .primitive_count = mesh.max_primitives } },
611 });
612 try out.emit(gpa, .OpExecutionMode, .{
613 .entry_point = entry_point.id,
614 .mode = .{ .local_size = .{
615 .x_size = mesh.x,
616 .y_size = mesh.y,
617 .z_size = mesh.z,
618 } },
619 });
620 try out.emit(gpa, .OpExecutionMode, .{
621 .entry_point = entry_point.id,
622 .mode = switch (mesh.stage_output) {
623 .output_points => .output_points,
624 .output_lines => .output_lines_ext,
625 .output_triangles => .output_triangles_ext,
626 },
627 });
628 },
629 else => {},
630 };
631}
632
633fn emitSourceInfo(flush: *Flush, out: *Section, version: u32) link.Error!void {
634 const comp = flush.linker.base.comp;
635 const gpa = comp.gpa;
636 const zcu = comp.zcu orelse return;
637 const ip = &zcu.intern_pool;
638
639 var error_info: std.Io.Writer.Allocating = .init(gpa);
640 defer error_info.deinit();
641 error_info.writer.writeAll("zig_errors:") catch return error.OutOfMemory;
642 for (ip.global_error_set.getNamesFromMainThread()) |name| {
643 error_info.writer.writeByte(':') catch return error.OutOfMemory;
644 std.Uri.Component.percentEncode(
645 &error_info.writer,
646 name.toSlice(ip),
647 struct {
648 fn isValidChar(c: u8) bool {
649 return switch (c) {
650 0, '%', ':' => false,
651 else => true,
652 };
653 }
654 }.isValidChar,
655 ) catch return error.OutOfMemory;
656 }
657
658 try out.emit(gpa, .OpSourceExtension, .{ .extension = error_info.written() });
659 try out.emit(gpa, .OpSource, .{
660 .source_language = .zig,
661 .version = version,
662 .file = null,
663 .source = null,
664 });
665}
src/target.zig+2
...@@ -604,6 +604,7 @@ pub fn defaultAddressSpace(...@@ -604,6 +604,7 @@ pub fn defaultAddressSpace(
604 // The default address space for functions on AVR is .flash to produce604 // The default address space for functions on AVR is .flash to produce
605 // correct fixups into progmem.605 // correct fixups into progmem.
606 if (context == .function and target.cpu.arch == .avr) return .flash;606 if (context == .function and target.cpu.arch == .avr) return .flash;
607 if (context == .global_mutable and target.os.tag == .vulkan) return .private;
607 return .generic;608 return .generic;
608}609}
609610
...@@ -649,6 +650,7 @@ pub fn shouldBlockPointerOps(target: *const std.Target, as: AddressSpace) bool {...@@ -649,6 +650,7 @@ pub fn shouldBlockPointerOps(target: *const std.Target, as: AddressSpace) bool {
649 // Logical pointers that never support operations650 // Logical pointers that never support operations
650 .constant,651 .constant,
651 .local,652 .local,
653 .private,
652 .input,654 .input,
653 .output,655 .output,
654 .uniform,656 .uniform,
test/behavior/addrspace_and_linksection.zig+4
...@@ -12,6 +12,8 @@ const var_linksection = linksections.?[1];...@@ -12,6 +12,8 @@ const var_linksection = linksections.?[1];
12const fn_linksection = linksections.?[2];12const fn_linksection = linksections.?[2];
1313
14test "addrspace on container-level const" {14test "addrspace on container-level const" {
15 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
16
15 const S = struct {17 const S = struct {
16 const a: u32 addrspace(.generic) = 123;18 const a: u32 addrspace(.generic) = 123;
17 fn check(ptr: anytype) !void {19 fn check(ptr: anytype) !void {
...@@ -47,6 +49,8 @@ test "addrspace and linksection on container-level const" {...@@ -47,6 +49,8 @@ test "addrspace and linksection on container-level const" {
47}49}
4850
49test "addrspace on container-level var" {51test "addrspace on container-level var" {
52 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
53
50 const S = struct {54 const S = struct {
51 var a: u32 addrspace(.generic) = 123;55 var a: u32 addrspace(.generic) = 123;
52 fn check(ptr: anytype) !void {56 fn check(ptr: anytype) !void {
test/behavior/align.zig+1
...@@ -467,6 +467,7 @@ var default_aligned_global = DefaultAligned{...@@ -467,6 +467,7 @@ var default_aligned_global = DefaultAligned{
467};467};
468468
469test "read 128-bit field from default aligned struct in global memory" {469test "read 128-bit field from default aligned struct in global memory" {
470 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
470 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO471 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
471 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;472 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
472 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO473 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/array.zig+1-1
...@@ -582,6 +582,7 @@ test "array with comptime-only element type" {...@@ -582,6 +582,7 @@ test "array with comptime-only element type" {
582}582}
583583
584test "tuple to array handles sentinel" {584test "tuple to array handles sentinel" {
585 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
585 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO586 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
586 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO587 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
587588
...@@ -936,7 +937,6 @@ test "accessing multidimensional global array at comptime" {...@@ -936,7 +937,6 @@ test "accessing multidimensional global array at comptime" {
936937
937test "union that needs padding bytes inside an array" {938test "union that needs padding bytes inside an array" {
938 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;939 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
939 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
941 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO941 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
942942
test/behavior/basic.zig+6
...@@ -60,6 +60,7 @@ const g1: i32 = 1233 + 1;...@@ -60,6 +60,7 @@ const g1: i32 = 1233 + 1;
60var g2: i32 = 0;60var g2: i32 = 0;
6161
62test "global variables" {62test "global variables" {
63 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
63 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO64 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
6465
65 try expect(g2 == 0);66 try expect(g2 == 0);
...@@ -683,6 +684,7 @@ var gdt = [_]GDTEntry{...@@ -683,6 +684,7 @@ var gdt = [_]GDTEntry{
683var global_ptr = &gdt[0];684var global_ptr = &gdt[0];
684685
685test "global constant is loaded with a runtime-known index" {686test "global constant is loaded with a runtime-known index" {
687 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
686 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO688 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
687689
688 const S = struct {690 const S = struct {
...@@ -999,6 +1001,8 @@ test "generic function uses return type of other generic function" {...@@ -999,6 +1001,8 @@ test "generic function uses return type of other generic function" {
999}1001}
10001002
1001test "const alloc with comptime-known initializer is made comptime-known" {1003test "const alloc with comptime-known initializer is made comptime-known" {
1004 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1005
1002 const S = struct {1006 const S = struct {
1003 a: bool,1007 a: bool,
1004 b: [2]u8,1008 b: [2]u8,
...@@ -1079,6 +1083,8 @@ test "inline call of function with a switch inside the return statement" {...@@ -1079,6 +1083,8 @@ test "inline call of function with a switch inside the return statement" {
1079}1083}
10801084
1081test "pointer to zero sized global is mutable" {1085test "pointer to zero sized global is mutable" {
1086 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1087
1082 const S = struct {1088 const S = struct {
1083 const Thing = struct {};1089 const Thing = struct {};
10841090
test/behavior/bitcast.zig-1
...@@ -110,7 +110,6 @@ test "@bitCast packed structs at runtime and comptime" {...@@ -110,7 +110,6 @@ test "@bitCast packed structs at runtime and comptime" {
110 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;110 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
111 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;111 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
112 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO112 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
113 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
114113
115 const Full = packed struct {114 const Full = packed struct {
116 number: u16,115 number: u16,
test/behavior/call.zig+2
...@@ -538,6 +538,8 @@ test "call function pointer in comptime field" {...@@ -538,6 +538,8 @@ test "call function pointer in comptime field" {
538}538}
539539
540test "generic function pointer can be called" {540test "generic function pointer can be called" {
541 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
542
541 const S = struct {543 const S = struct {
542 var ok = false;544 var ok = false;
543 fn foo(x: anytype) void {545 fn foo(x: anytype) void {
test/behavior/comptime_memory.zig+2
...@@ -431,6 +431,8 @@ test "type pun @ptrFromInt" {...@@ -431,6 +431,8 @@ test "type pun @ptrFromInt" {
431}431}
432432
433test "type pun null pointer-like optional" {433test "type pun null pointer-like optional" {
434 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
435
434 const p: ?*u8 = null;436 const p: ?*u8 = null;
435 // note that expectEqual hides the bug437 // note that expectEqual hides the bug
436 try testing.expect(@as(*const ?*i8, @ptrCast(&p)).* == null);438 try testing.expect(@as(*const ?*i8, @ptrCast(&p)).* == null);
test/behavior/decl_literals.zig-1
...@@ -35,7 +35,6 @@ test "decl literal with pointer" {...@@ -35,7 +35,6 @@ test "decl literal with pointer" {
35test "call decl literal with optional" {35test "call decl literal with optional" {
36 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;36 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
37 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;37 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
38 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3938
40 const S = struct {39 const S = struct {
41 x: u32,40 x: u32,
test/behavior/defer.zig+1
...@@ -89,6 +89,7 @@ fn runSomeErrorDefers(x: bool) !bool {...@@ -89,6 +89,7 @@ fn runSomeErrorDefers(x: bool) !bool {
89}89}
9090
91test "mixing normal and error defers" {91test "mixing normal and error defers" {
92 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
92 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO93 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
93 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO94 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9495
test/behavior/enum.zig-1
...@@ -930,7 +930,6 @@ test "constant enum initialization with differing sizes" {...@@ -930,7 +930,6 @@ test "constant enum initialization with differing sizes" {
930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;930 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
931 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO931 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
932 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;932 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
933 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
934 try test3_1(test3_foo);933 try test3_1(test3_foo);
935 try test3_2(test3_bar);934 try test3_2(test3_bar);
936}935}
test/behavior/error.zig+3-1
...@@ -524,7 +524,6 @@ test "function pointer with return type that is error union with payload which i...@@ -524,7 +524,6 @@ test "function pointer with return type that is error union with payload which i
524}524}
525525
526test "return result loc as peer result loc in inferred error set function" {526test "return result loc as peer result loc in inferred error set function" {
527 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
528 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;527 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
529 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO528 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
530 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO529 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -783,6 +782,7 @@ const NoReturn = struct {...@@ -783,6 +782,7 @@ const NoReturn = struct {
783};782};
784783
785test "error union of noreturn used with if" {784test "error union of noreturn used with if" {
785 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
786 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO786 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
787 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO787 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
788 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;788 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -796,6 +796,7 @@ test "error union of noreturn used with if" {...@@ -796,6 +796,7 @@ test "error union of noreturn used with if" {
796}796}
797797
798test "error union of noreturn used with try" {798test "error union of noreturn used with try" {
799 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
799 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO800 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
800 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO801 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
801 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;802 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -806,6 +807,7 @@ test "error union of noreturn used with try" {...@@ -806,6 +807,7 @@ test "error union of noreturn used with try" {
806}807}
807808
808test "error union of noreturn used with catch" {809test "error union of noreturn used with catch" {
810 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
809 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO811 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
810 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO812 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
811 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;813 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
test/behavior/eval.zig+13
...@@ -5,6 +5,8 @@ const expect = std.testing.expect;...@@ -5,6 +5,8 @@ const expect = std.testing.expect;
5const expectEqual = std.testing.expectEqual;5const expectEqual = std.testing.expectEqual;
66
7test "compile time recursion" {7test "compile time recursion" {
8 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
9
8 try expect(some_data.len == 21);10 try expect(some_data.len == 21);
9}11}
10var some_data: [@as(usize, @intCast(fibonacci(7)))]u8 = undefined;12var some_data: [@as(usize, @intCast(fibonacci(7)))]u8 = undefined;
...@@ -388,6 +390,7 @@ test "return 0 from function that has u0 return type" {...@@ -388,6 +390,7 @@ test "return 0 from function that has u0 return type" {
388}390}
389391
390test "statically initialized struct" {392test "statically initialized struct" {
393 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
391 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO394 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
392395
393 st_init_str_foo.x += 1;396 st_init_str_foo.x += 1;
...@@ -927,6 +930,7 @@ test "closure capture type of runtime-known var" {...@@ -927,6 +930,7 @@ test "closure capture type of runtime-known var" {
927}930}
928931
929test "comptime break passing through runtime condition converted to runtime break" {932test "comptime break passing through runtime condition converted to runtime break" {
933 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
930 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO934 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
931935
932 const S = struct {936 const S = struct {
...@@ -959,6 +963,7 @@ test "comptime break passing through runtime condition converted to runtime brea...@@ -959,6 +963,7 @@ test "comptime break passing through runtime condition converted to runtime brea
959}963}
960964
961test "comptime break to outer loop passing through runtime condition converted to runtime break" {965test "comptime break to outer loop passing through runtime condition converted to runtime break" {
966 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
962 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO967 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
963 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO968 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
964969
...@@ -1158,6 +1163,8 @@ test "repeated value is correctly expanded" {...@@ -1158,6 +1163,8 @@ test "repeated value is correctly expanded" {
1158}1163}
11591164
1160test "value in if block is comptime-known" {1165test "value in if block is comptime-known" {
1166 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1167
1161 const first = blk: {1168 const first = blk: {
1162 const s = if (false) "a" else "b";1169 const s = if (false) "a" else "b";
1163 break :blk "foo" ++ s;1170 break :blk "foo" ++ s;
...@@ -1266,6 +1273,8 @@ test "continue in inline for inside a comptime switch" {...@@ -1266,6 +1273,8 @@ test "continue in inline for inside a comptime switch" {
1266}1273}
12671274
1268test "length of global array is determinable at comptime" {1275test "length of global array is determinable at comptime" {
1276 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1277
1269 const S = struct {1278 const S = struct {
1270 var bytes: [1024]u8 = undefined;1279 var bytes: [1024]u8 = undefined;
12711280
...@@ -1313,6 +1322,7 @@ test "continue nested inline for loop in named block expr" {...@@ -1313,6 +1322,7 @@ test "continue nested inline for loop in named block expr" {
1313}1322}
13141323
1315test "x and false is comptime-known false" {1324test "x and false is comptime-known false" {
1325 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1316 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1326 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13171327
1318 const T = struct {1328 const T = struct {
...@@ -1340,6 +1350,7 @@ test "x and false is comptime-known false" {...@@ -1340,6 +1350,7 @@ test "x and false is comptime-known false" {
1340}1350}
13411351
1342test "x or true is comptime-known true" {1352test "x or true is comptime-known true" {
1353 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1343 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1354 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13441355
1345 const T = struct {1356 const T = struct {
...@@ -1401,6 +1412,8 @@ test "comptime function turns function value to function pointer" {...@@ -1401,6 +1412,8 @@ test "comptime function turns function value to function pointer" {
1401}1412}
14021413
1403test "container level const and var have unique addresses" {1414test "container level const and var have unique addresses" {
1415 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1416
1404 const S = struct {1417 const S = struct {
1405 x: i32,1418 x: i32,
1406 y: i32,1419 y: i32,
test/behavior/export_builtin.zig+2
...@@ -4,6 +4,7 @@ const expect = std.testing.expect;...@@ -4,6 +4,7 @@ const expect = std.testing.expect;
44
5test "exporting enum value" {5test "exporting enum value" {
6 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;6 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
78
8 const S = struct {9 const S = struct {
9 const E = enum(c_int) { one, two };10 const E = enum(c_int) { one, two };
...@@ -29,6 +30,7 @@ test "exporting with internal linkage" {...@@ -29,6 +30,7 @@ test "exporting with internal linkage" {
2930
30test "exporting using namespace access" {31test "exporting using namespace access" {
31 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;32 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
33 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
3234
33 const S = struct {35 const S = struct {
34 const Inner = struct {36 const Inner = struct {
test/behavior/floatop.zig-7
...@@ -464,7 +464,6 @@ test "@sqrt with vectors" {...@@ -464,7 +464,6 @@ test "@sqrt with vectors" {
464 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;464 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
465 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO465 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
466 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;466 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
467 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
468467
469 try testSqrtWithVectors();468 try testSqrtWithVectors();
470 try comptime testSqrtWithVectors();469 try comptime testSqrtWithVectors();
...@@ -532,7 +531,6 @@ test "@sin with vectors" {...@@ -532,7 +531,6 @@ test "@sin with vectors" {
532 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;531 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
533 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO532 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
534 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;533 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
535 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
536534
537 try testSinWithVectors();535 try testSinWithVectors();
538 try comptime testSinWithVectors();536 try comptime testSinWithVectors();
...@@ -600,7 +598,6 @@ test "@cos with vectors" {...@@ -600,7 +598,6 @@ test "@cos with vectors" {
600 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;598 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
601 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO599 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
602 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;600 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
603 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
604601
605 try testCosWithVectors();602 try testCosWithVectors();
606 try comptime testCosWithVectors();603 try comptime testCosWithVectors();
...@@ -668,7 +665,6 @@ test "@tan with vectors" {...@@ -668,7 +665,6 @@ test "@tan with vectors" {
668 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;665 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
669 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO666 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
670 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;667 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
671 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
672668
673 try testTanWithVectors();669 try testTanWithVectors();
674 try comptime testTanWithVectors();670 try comptime testTanWithVectors();
...@@ -740,7 +736,6 @@ test "@exp with vectors" {...@@ -740,7 +736,6 @@ test "@exp with vectors" {
740 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;736 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
741 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO737 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
742 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;738 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
743 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
744739
745 try testExpWithVectors();740 try testExpWithVectors();
746 try comptime testExpWithVectors();741 try comptime testExpWithVectors();
...@@ -807,7 +802,6 @@ test "@exp2 with @vectors" {...@@ -807,7 +802,6 @@ test "@exp2 with @vectors" {
807 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;802 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
808 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
809 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;804 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
810 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
811805
812 try testExp2WithVectors();806 try testExp2WithVectors();
813 try comptime testExp2WithVectors();807 try comptime testExp2WithVectors();
...@@ -939,7 +933,6 @@ test "@log2 with vectors" {...@@ -939,7 +933,6 @@ test "@log2 with vectors" {
939 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;933 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
940 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO934 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
941 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;935 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
942 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
943 // https://github.com/ziglang/zig/issues/13681936 // https://github.com/ziglang/zig/issues/13681
944 if (builtin.zig_backend == .stage2_llvm and937 if (builtin.zig_backend == .stage2_llvm and
945 builtin.cpu.arch == .aarch64 and938 builtin.cpu.arch == .aarch64 and
test/behavior/generics.zig+1
...@@ -516,6 +516,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" {...@@ -516,6 +516,7 @@ test "comptime callconv(.c) function ptr uses comptime type argument" {
516}516}
517517
518test "call generic function with from function called by the generic function" {518test "call generic function with from function called by the generic function" {
519 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
519 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;520 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
520 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;521 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
521 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO522 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
test/behavior/globals.zig+2-4
...@@ -4,6 +4,7 @@ const expect = std.testing.expect;...@@ -4,6 +4,7 @@ const expect = std.testing.expect;
44
5var pos = [2]f32{ 0.0, 0.0 };5var pos = [2]f32{ 0.0, 0.0 };
6test "store to global array" {6test "store to global array" {
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
7 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
8 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;9 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
910
...@@ -14,6 +15,7 @@ test "store to global array" {...@@ -14,6 +15,7 @@ test "store to global array" {
1415
15var vpos = @Vector(2, f32){ 0.0, 0.0 };16var vpos = @Vector(2, f32){ 0.0, 0.0 };
16test "store to global vector" {17test "store to global vector" {
18 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
17 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;19 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
18 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;20 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1921
...@@ -66,8 +68,6 @@ test "global loads can affect liveness" {...@@ -66,8 +68,6 @@ test "global loads can affect liveness" {
66}68}
6769
68test "global const can be self-referential" {70test "global const can be self-referential" {
69 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
70
71 const S = struct {71 const S = struct {
72 self: *const @This(),72 self: *const @This(),
73 x: u32,73 x: u32,
...@@ -112,8 +112,6 @@ test "global var can be self-referential" {...@@ -112,8 +112,6 @@ test "global var can be self-referential" {
112}112}
113113
114test "global const can be indirectly self-referential" {114test "global const can be indirectly self-referential" {
115 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
116
117 const S = struct {115 const S = struct {
118 other: *const @This(),116 other: *const @This(),
119 x: u32,117 x: u32,
test/behavior/if.zig+1
...@@ -44,6 +44,7 @@ var global_with_val: anyerror!u32 = 0;...@@ -44,6 +44,7 @@ var global_with_val: anyerror!u32 = 0;
44var global_with_err: anyerror!u32 = error.SomeError;44var global_with_err: anyerror!u32 = error.SomeError;
4545
46test "unwrap mutable global var" {46test "unwrap mutable global var" {
47 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
47 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO48 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
4849
49 if (global_with_val) |v| {50 if (global_with_val) |v| {
test/behavior/inline_switch.zig-2
...@@ -4,7 +4,6 @@ const builtin = @import("builtin");...@@ -4,7 +4,6 @@ const builtin = @import("builtin");
44
5test "inline scalar prongs" {5test "inline scalar prongs" {
6 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO6 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
87
9 var x: usize = 0;8 var x: usize = 0;
10 switch (x) {9 switch (x) {
...@@ -19,7 +18,6 @@ test "inline scalar prongs" {...@@ -19,7 +18,6 @@ test "inline scalar prongs" {
1918
20test "inline prong ranges" {19test "inline prong ranges" {
21 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2321
24 var x: usize = 0;22 var x: usize = 0;
25 _ = &x;23 _ = &x;
test/behavior/ir_block_deps.zig-1
...@@ -19,7 +19,6 @@ fn getErrInt() anyerror!i32 {...@@ -19,7 +19,6 @@ fn getErrInt() anyerror!i32 {
1919
20test "ir block deps" {20test "ir block deps" {
21 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO21 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
22 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
23 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO22 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2423
25 try expect((foo(1) catch unreachable) == 0);24 try expect((foo(1) catch unreachable) == 0);
test/behavior/math.zig+1
...@@ -2570,6 +2570,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme...@@ -2570,6 +2570,7 @@ test "partially-runtime integer vector division would be illegal if vector eleme
2570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2572 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2572 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2573 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2573 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;2574 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
25742575
2575 var lhs: @Vector(2, i8) = .{ -128, 5 };2576 var lhs: @Vector(2, i8) = .{ -128, 5 };
test/behavior/null.zig+1
...@@ -183,6 +183,7 @@ const SillyStruct = struct {...@@ -183,6 +183,7 @@ const SillyStruct = struct {
183const here_is_a_null_literal = SillyStruct{ .context = null };183const here_is_a_null_literal = SillyStruct{ .context = null };
184184
185test "unwrap optional which is field of global var" {185test "unwrap optional which is field of global var" {
186 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
186 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;187 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
187 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO188 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
188189
test/behavior/optional.zig+2-4
...@@ -319,7 +319,6 @@ test "assigning to an unwrapped optional field in an inline loop" {...@@ -319,7 +319,6 @@ test "assigning to an unwrapped optional field in an inline loop" {
319test "coerce an anon struct literal to optional struct" {319test "coerce an anon struct literal to optional struct" {
320 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO320 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
321 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO321 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
322 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
323322
324 const S = struct {323 const S = struct {
325 const Struct = struct {324 const Struct = struct {
...@@ -388,7 +387,6 @@ test "0-bit child type coerced to optional" {...@@ -388,7 +387,6 @@ test "0-bit child type coerced to optional" {
388test "array of optional unaligned types" {387test "array of optional unaligned types" {
389 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO388 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
390 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO389 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
391 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
392390
393 const Enum = enum { one, two, three };391 const Enum = enum { one, two, three };
394392
...@@ -477,6 +475,7 @@ const NoReturn = struct {...@@ -477,6 +475,7 @@ const NoReturn = struct {
477};475};
478476
479test "optional of noreturn used with if" {477test "optional of noreturn used with if" {
478 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
480 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO479 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
481480
482 NoReturn.a = 64;481 NoReturn.a = 64;
...@@ -488,6 +487,7 @@ test "optional of noreturn used with if" {...@@ -488,6 +487,7 @@ test "optional of noreturn used with if" {
488}487}
489488
490test "optional of noreturn used with orelse" {489test "optional of noreturn used with orelse" {
490 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
491 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO491 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
492492
493 NoReturn.a = 64;493 NoReturn.a = 64;
...@@ -652,8 +652,6 @@ test "result location initialization of optional with OPV payload" {...@@ -652,8 +652,6 @@ test "result location initialization of optional with OPV payload" {
652}652}
653653
654test "global comptime only optional" {654test "global comptime only optional" {
655 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
656
657 const S = struct {655 const S = struct {
658 const @"null": ?*type = null;656 const @"null": ?*type = null;
659 const @"void": ?*const type = &void;657 const @"void": ?*const type = &void;
test/behavior/packed-struct.zig-9
...@@ -794,7 +794,6 @@ test "nested packed struct at non-zero offset 2" {...@@ -794,7 +794,6 @@ test "nested packed struct at non-zero offset 2" {
794test "runtime init of unnamed packed struct type" {794test "runtime init of unnamed packed struct type" {
795 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;795 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
796 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO796 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
797 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
798797
799 var z: u8 = 123;798 var z: u8 = 123;
800 _ = &z;799 _ = &z;
...@@ -889,7 +888,6 @@ test "store undefined to packed result location" {...@@ -889,7 +888,6 @@ test "store undefined to packed result location" {
889 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;888 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
890 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;889 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
891 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;890 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
892 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
893891
894 var x: u4 = 0;892 var x: u4 = 0;
895 _ = &x;893 _ = &x;
...@@ -910,7 +908,6 @@ test "bitcast back and forth" {...@@ -910,7 +908,6 @@ test "bitcast back and forth" {
910// Originally reported at https://github.com/ziglang/zig/issues/14200908// Originally reported at https://github.com/ziglang/zig/issues/14200
911test "field access of packed struct smaller than its abi size inside struct initialized with rls" {909test "field access of packed struct smaller than its abi size inside struct initialized with rls" {
912 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;910 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
913 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
914 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO911 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
915912
916 const S = struct {913 const S = struct {
...@@ -1006,7 +1003,6 @@ test "packed struct acts as a namespace" {...@@ -1006,7 +1003,6 @@ test "packed struct acts as a namespace" {
1006test "assignment to non-byte-aligned field in packed struct" {1003test "assignment to non-byte-aligned field in packed struct" {
1007 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1004 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1008 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1005 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1009 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1010 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO1006 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
10111007
1012 const Frame = packed struct {1008 const Frame = packed struct {
...@@ -1046,7 +1042,6 @@ test "load flag from packed struct in union" {...@@ -1046,7 +1042,6 @@ test "load flag from packed struct in union" {
1046 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1042 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1047 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1043 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1048 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1044 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1049 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1050 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1045 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
10511046
1052 const A = packed struct {1047 const A = packed struct {
...@@ -1168,7 +1163,6 @@ test "packed struct equality" {...@@ -1168,7 +1163,6 @@ test "packed struct equality" {
11681163
1169test "packed struct equality ignores padding bits" {1164test "packed struct equality ignores padding bits" {
1170 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1165 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1171 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11721166
1173 const S = packed struct { b: bool };1167 const S = packed struct { b: bool };
1174 var s: S = undefined;1168 var s: S = undefined;
...@@ -1178,7 +1172,6 @@ test "packed struct equality ignores padding bits" {...@@ -1178,7 +1172,6 @@ test "packed struct equality ignores padding bits" {
1178}1172}
11791173
1180test "packed struct with signed field" {1174test "packed struct with signed field" {
1181 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1182 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1175 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11831176
1184 var s: packed struct {1177 var s: packed struct {
...@@ -1193,7 +1186,6 @@ test "packed struct with signed field" {...@@ -1193,7 +1186,6 @@ test "packed struct with signed field" {
1193test "assign packed struct initialized with RLS to packed struct literal field" {1186test "assign packed struct initialized with RLS to packed struct literal field" {
1194 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1187 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1195 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1188 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1196 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
11971189
1198 const Inner = packed struct { x: u17 };1190 const Inner = packed struct { x: u17 };
1199 const Outer = packed struct { inner: Inner, x: u15 };1191 const Outer = packed struct { inner: Inner, x: u15 };
...@@ -1209,7 +1201,6 @@ test "assign packed struct initialized with RLS to packed struct literal field"...@@ -1209,7 +1201,6 @@ test "assign packed struct initialized with RLS to packed struct literal field"
12091201
1210test "packed struct store of comparison result" {1202test "packed struct store of comparison result" {
1211 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;1203 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1212 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1213 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO1204 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
12141205
1215 const S1 = packed struct {1206 const S1 = packed struct {
test/behavior/pointers.zig+2
...@@ -642,6 +642,8 @@ test "result type preserved through multiple references" {...@@ -642,6 +642,8 @@ test "result type preserved through multiple references" {
642}642}
643643
644test "result type found through optional pointer" {644test "result type found through optional pointer" {
645 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
646
645 const ptr1: ?*const u32 = &@intCast(123);647 const ptr1: ?*const u32 = &@intCast(123);
646 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };648 const ptr2: ?[]const u8 = &.{ @intCast(123), @truncate(0xABCD) };
647 try expect(ptr1.?.* == 123);649 try expect(ptr1.?.* == 123);
test/behavior/shuffle.zig-1
...@@ -176,7 +176,6 @@ test "@shuffle u0" {...@@ -176,7 +176,6 @@ test "@shuffle u0" {
176 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO176 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
177 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO177 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
178 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;178 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
179 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
180179
181 const S = struct {180 const S = struct {
182 fn doTheTest() !void {181 fn doTheTest() !void {
test/behavior/sizeof_and_typeof.zig+1
...@@ -134,6 +134,7 @@ test "@TypeOf() has no runtime side effects" {...@@ -134,6 +134,7 @@ test "@TypeOf() has no runtime side effects" {
134}134}
135135
136test "branching logic inside @TypeOf" {136test "branching logic inside @TypeOf" {
137 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
137 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;138 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
138139
139 const S = struct {140 const S = struct {
test/behavior/slice.zig+1-2
...@@ -254,8 +254,6 @@ test "slicing pointer by length" {...@@ -254,8 +254,6 @@ test "slicing pointer by length" {
254const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500];254const x = @as([*]i32, @ptrFromInt(0x1000))[0..0x500];
255const y = x[0x100..];255const y = x[0x100..];
256test "compile time slice of pointer to hard coded address" {256test "compile time slice of pointer to hard coded address" {
257 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
258
259 try expect(@intFromPtr(x) == 0x1000);257 try expect(@intFromPtr(x) == 0x1000);
260 try expect(x.len == 0x500);258 try expect(x.len == 0x500);
261259
...@@ -858,6 +856,7 @@ test "slice len modification at comptime" {...@@ -858,6 +856,7 @@ test "slice len modification at comptime" {
858}856}
859857
860test "slice field ptr const" {858test "slice field ptr const" {
859 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
861 const const_slice: []const u8 = "string";860 const const_slice: []const u8 = "string";
862861
863 const const_ptr_const_slice = &const_slice;862 const const_ptr_const_slice = &const_slice;
test/behavior/splat.zig+1
...@@ -92,6 +92,7 @@ test "splat with an error union or optional result type" {...@@ -92,6 +92,7 @@ test "splat with an error union or optional result type" {
92}92}
9393
94test "read/write through global variable array of struct fields initialized via splat" {94test "read/write through global variable array of struct fields initialized via splat" {
95 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
95 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO96 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
96 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9798
test/behavior/struct.zig+5-4
...@@ -443,6 +443,7 @@ test "packed struct 24bits" {...@@ -443,6 +443,7 @@ test "packed struct 24bits" {
443}443}
444444
445test "runtime struct initialization of bitfield" {445test "runtime struct initialization of bitfield" {
446 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
446 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;447 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
447 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO448 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
448 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO449 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
...@@ -714,6 +715,7 @@ test "packed struct with u0 field access" {...@@ -714,6 +715,7 @@ test "packed struct with u0 field access" {
714}715}
715716
716test "access to global struct fields" {717test "access to global struct fields" {
718 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
717 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO719 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
718720
719 g_foo.bar.value = 42;721 g_foo.bar.value = 42;
...@@ -943,7 +945,6 @@ test "tuple element initialized with fn call" {...@@ -943,7 +945,6 @@ test "tuple element initialized with fn call" {
943}945}
944946
945test "struct with union field" {947test "struct with union field" {
946 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
947 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO948 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
948 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO949 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
949950
...@@ -1081,7 +1082,6 @@ test "anon init through error unions and optionals" {...@@ -1081,7 +1082,6 @@ test "anon init through error unions and optionals" {
1081test "anon init through optional" {1082test "anon init through optional" {
1082 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1083 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1083 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1084 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1084 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10851085
1086 const S = struct {1086 const S = struct {
1087 a: u32,1087 a: u32,
...@@ -1760,6 +1760,8 @@ test "circular dependency through pointer field of a struct" {...@@ -1760,6 +1760,8 @@ test "circular dependency through pointer field of a struct" {
1760}1760}
17611761
1762test "field calls do not force struct field init resolution" {1762test "field calls do not force struct field init resolution" {
1763 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1764
1763 const S = struct {1765 const S = struct {
1764 x: u32 = blk: {1766 x: u32 = blk: {
1765 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution1767 _ = @TypeOf(make().dummyFn()); // runtime field call - S not fully resolved - dummyFn call should not force field init resolution
...@@ -1943,8 +1945,6 @@ test "struct field default value is a call" {...@@ -1943,8 +1945,6 @@ test "struct field default value is a call" {
1943}1945}
19441946
1945test "aggregate initializers should allow initializing comptime fields, verifying equality" {1947test "aggregate initializers should allow initializing comptime fields, verifying equality" {
1946 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1947
1948 var x: u32 = 15;1948 var x: u32 = 15;
1949 _ = &x;1949 _ = &x;
1950 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });1950 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });
...@@ -1985,6 +1985,7 @@ test "assignment of field with padding" {...@@ -1985,6 +1985,7 @@ test "assignment of field with padding" {
1985}1985}
19861986
1987test "initiate global variable with runtime value" {1987test "initiate global variable with runtime value" {
1988 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1988 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;1989 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
1989 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1990 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
19901991
test/behavior/switch.zig+1-10
...@@ -252,6 +252,7 @@ fn poll() void {...@@ -252,6 +252,7 @@ fn poll() void {
252}252}
253253
254test "switch on global mutable var isn't constant-folded" {254test "switch on global mutable var isn't constant-folded" {
255 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
255 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO256 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
256257
257 while (state < 2) {258 while (state < 2) {
...@@ -270,7 +271,6 @@ test "switch prong with variable" {...@@ -270,7 +271,6 @@ test "switch prong with variable" {
270 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO271 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
271 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO272 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
272 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;273 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
273 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
274274
275 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });275 try switchProngWithVarFn(SwitchProngWithVarEnum{ .One = 13 });
276 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });276 try switchProngWithVarFn(SwitchProngWithVarEnum{ .Two = 13.0 });
...@@ -294,7 +294,6 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {...@@ -294,7 +294,6 @@ fn switchProngWithVarFn(a: SwitchProngWithVarEnum) !void {
294test "switch on enum using pointer capture" {294test "switch on enum using pointer capture" {
295 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO295 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
296 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO296 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
297 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
298297
299 try testSwitchEnumPtrCapture();298 try testSwitchEnumPtrCapture();
300 try comptime testSwitchEnumPtrCapture();299 try comptime testSwitchEnumPtrCapture();
...@@ -570,7 +569,6 @@ test "switch with null and T peer types and inferred result location type" {...@@ -570,7 +569,6 @@ test "switch with null and T peer types and inferred result location type" {
570test "switch prongs with cases with identical payload types" {569test "switch prongs with cases with identical payload types" {
571 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO570 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
572 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO571 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
573 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
574572
575 const Union = union(enum) {573 const Union = union(enum) {
576 A: usize,574 A: usize,
...@@ -726,7 +724,6 @@ test "switch on error set with single else" {...@@ -726,7 +724,6 @@ test "switch on error set with single else" {
726test "switch capture copies its payload" {724test "switch capture copies its payload" {
727 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO725 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
728 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO726 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
729 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
730727
731 const S = struct {728 const S = struct {
732 fn doTheTest() !void {729 fn doTheTest() !void {
...@@ -788,7 +785,6 @@ test "enum value without tag name used as switch item" {...@@ -788,7 +785,6 @@ test "enum value without tag name used as switch item" {
788}785}
789786
790test "switch item sizeof" {787test "switch item sizeof" {
791 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
792 const S = struct {788 const S = struct {
793 fn doTheTest() !void {789 fn doTheTest() !void {
794 var a: usize = 0;790 var a: usize = 0;
...@@ -817,8 +813,6 @@ test "comptime inline switch" {...@@ -817,8 +813,6 @@ test "comptime inline switch" {
817}813}
818814
819test "switch capture peer type resolution" {815test "switch capture peer type resolution" {
820 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
821
822 const U = union(enum) {816 const U = union(enum) {
823 a: u32,817 a: u32,
824 b: u64,818 b: u64,
...@@ -835,7 +829,6 @@ test "switch capture peer type resolution" {...@@ -835,7 +829,6 @@ test "switch capture peer type resolution" {
835829
836test "switch capture peer type resolution for in-memory coercible payloads" {830test "switch capture peer type resolution for in-memory coercible payloads" {
837 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;831 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
838 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
839832
840 const T1 = c_int;833 const T1 = c_int;
841 const t1_info = @typeInfo(T1).int;834 const t1_info = @typeInfo(T1).int;
...@@ -1166,8 +1159,6 @@ test "switch with uninstantiable union fields" {...@@ -1166,8 +1159,6 @@ test "switch with uninstantiable union fields" {
1166}1159}
11671160
1168test "switch with tag capture" {1161test "switch with tag capture" {
1169 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1170
1171 const U = union(enum) {1162 const U = union(enum) {
1172 a,1163 a,
1173 b: i32,1164 b: i32,
test/behavior/switch_loop.zig-2
...@@ -96,7 +96,6 @@ test "switch loop on tagged union" {...@@ -96,7 +96,6 @@ test "switch loop on tagged union" {
96 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;96 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
97 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
98 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO98 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
99 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; // TODO
100 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;99 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
101100
102 const S = struct {101 const S = struct {
...@@ -291,7 +290,6 @@ test "switch loop with discarded tag capture" {...@@ -291,7 +290,6 @@ test "switch loop with discarded tag capture" {
291}290}
292291
293test "switch loop with single catch-all prong" {292test "switch loop with single catch-all prong" {
294 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
295 const S = struct {293 const S = struct {
296 const E = enum { a, b, c };294 const E = enum { a, b, c };
297 const U = union(E) { a: u32, b: u16, c: u8 };295 const U = union(E) { a: u32, b: u16, c: u8 };
test/behavior/switch_prong_implicit_cast.zig-1
...@@ -18,7 +18,6 @@ test "switch prong implicit cast" {...@@ -18,7 +18,6 @@ test "switch prong implicit cast" {
18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;18 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
19 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;19 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO20 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
21 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
2221
23 const result = switch (foo(2) catch unreachable) {22 const result = switch (foo(2) catch unreachable) {
24 FormValue.One => false,23 FormValue.One => false,
test/behavior/threadlocal.zig-1
...@@ -6,7 +6,6 @@ test "thread local variable" {...@@ -6,7 +6,6 @@ test "thread local variable" {
6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO6 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
7 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO7 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO8 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
9 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
10 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO9 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; // TODO
1110
12 const S = struct {11 const S = struct {
test/behavior/tuple.zig+2-2
...@@ -203,8 +203,6 @@ test "offsetOf anon struct" {...@@ -203,8 +203,6 @@ test "offsetOf anon struct" {
203}203}
204204
205test "initializing tuple with mixed comptime-runtime fields" {205test "initializing tuple with mixed comptime-runtime fields" {
206 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
207
208 var x: u32 = 15;206 var x: u32 = 15;
209 _ = &x;207 _ = &x;
210 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });208 const T = @TypeOf(.{ @as(i32, -1234), @as(u32, 5678), x });
...@@ -548,6 +546,8 @@ test "OPV tuple fields aren't comptime" {...@@ -548,6 +546,8 @@ test "OPV tuple fields aren't comptime" {
548}546}
549547
550test "array of tuples that end with a zero-bit field followed by padding" {548test "array of tuples that end with a zero-bit field followed by padding" {
549 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
550
551 const S = struct {551 const S = struct {
552 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };552 var foo: [2]struct { u32, u8, void } = .{ .{ 1, 2, {} }, .{ 3, 4, {} } };
553 };553 };
test/behavior/type.zig+2
...@@ -406,6 +406,8 @@ test "matching captures causes opaque equivalence" {...@@ -406,6 +406,8 @@ test "matching captures causes opaque equivalence" {
406}406}
407407
408test "reify enum where fields refers to part of array" {408test "reify enum where fields refers to part of array" {
409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
410
409 const field_names: [3][]const u8 = .{ "foo", "bar", undefined };411 const field_names: [3][]const u8 = .{ "foo", "bar", undefined };
410 const field_values: [3]u8 = .{ undefined, 0, 1 };412 const field_values: [3]u8 = .{ undefined, 0, 1 };
411 const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]);413 const E = @Enum(u8, .exhaustive, field_names[0..2], field_values[1..3]);
test/behavior/union.zig+3-11
...@@ -442,6 +442,7 @@ const Foo1 = union(enum) {...@@ -442,6 +442,7 @@ const Foo1 = union(enum) {
442var glbl: Foo1 = undefined;442var glbl: Foo1 = undefined;
443443
444test "global union with single field is correctly initialized" {444test "global union with single field is correctly initialized" {
445 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
445 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;446 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
446 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO447 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
447448
...@@ -551,7 +552,6 @@ const Baz = enum { A, B, C, D };...@@ -551,7 +552,6 @@ const Baz = enum { A, B, C, D };
551552
552test "tagged union type" {553test "tagged union type" {
553 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO554 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
554 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
555555
556 const foo1 = TaggedFoo{ .One = 13 };556 const foo1 = TaggedFoo{ .One = 13 };
557 const foo2 = TaggedFoo{557 const foo2 = TaggedFoo{
...@@ -576,7 +576,6 @@ test "tagged union as return value" {...@@ -576,7 +576,6 @@ test "tagged union as return value" {
576 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;576 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
577 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO577 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
578 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;578 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
579 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
580579
581 switch (returnAnInt(13)) {580 switch (returnAnInt(13)) {
582 TaggedFoo.One => |value| try expect(value == 13),581 TaggedFoo.One => |value| try expect(value == 13),
...@@ -619,7 +618,6 @@ test "union(enum(u32)) with specified and unspecified tag values" {...@@ -619,7 +618,6 @@ test "union(enum(u32)) with specified and unspecified tag values" {
619 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;618 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
620 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;619 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
621 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO620 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
622 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
623621
624 comptime assert(Tag(Tag(MultipleChoice2)) == u32);622 comptime assert(Tag(Tag(MultipleChoice2)) == u32);
625 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });623 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });
...@@ -709,7 +707,6 @@ test "union with only 1 field casted to its enum type which has enum value speci...@@ -709,7 +707,6 @@ test "union with only 1 field casted to its enum type which has enum value speci
709test "@intFromEnum works on unions" {707test "@intFromEnum works on unions" {
710 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO708 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
711 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO709 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
712 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
713710
714 const Bar = union(enum) {711 const Bar = union(enum) {
715 A: bool,712 A: bool,
...@@ -793,7 +790,6 @@ test "@unionInit stored to a const" {...@@ -793,7 +790,6 @@ test "@unionInit stored to a const" {
793 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO790 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
794 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO791 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
795 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;792 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
796 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
797793
798 const S = struct {794 const S = struct {
799 const U = union(enum) {795 const U = union(enum) {
...@@ -823,7 +819,6 @@ test "@unionInit stored to a const" {...@@ -823,7 +819,6 @@ test "@unionInit stored to a const" {
823test "@unionInit can modify a union type" {819test "@unionInit can modify a union type" {
824 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO820 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
825 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO821 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
826 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
827822
828 const UnionInitEnum = union(enum) {823 const UnionInitEnum = union(enum) {
829 Boolean: bool,824 Boolean: bool,
...@@ -846,7 +841,6 @@ test "@unionInit can modify a union type" {...@@ -846,7 +841,6 @@ test "@unionInit can modify a union type" {
846test "@unionInit can modify a pointer value" {841test "@unionInit can modify a pointer value" {
847 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO842 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
848 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO843 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
849 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
850844
851 const UnionInitEnum = union(enum) {845 const UnionInitEnum = union(enum) {
852 Boolean: bool,846 Boolean: bool,
...@@ -954,7 +948,6 @@ test "function call result coerces from tagged union to the tag" {...@@ -954,7 +948,6 @@ test "function call result coerces from tagged union to the tag" {
954test "switching on non exhaustive union" {948test "switching on non exhaustive union" {
955 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO949 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
956 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO950 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
957 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
958951
959 const S = struct {952 const S = struct {
960 const E = enum(u8) {953 const E = enum(u8) {
...@@ -1256,7 +1249,6 @@ test "@unionInit uses tag value instead of field index" {...@@ -1256,7 +1249,6 @@ test "@unionInit uses tag value instead of field index" {
1256 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1249 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
1257 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO1250 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1258 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;1251 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
1259 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1260 const E = enum(u8) {1252 const E = enum(u8) {
1261 b = 255,1253 b = 255,
1262 a = 3,1254 a = 3,
...@@ -1414,6 +1406,8 @@ test "reinterpreting enum value inside packed union" {...@@ -1414,6 +1406,8 @@ test "reinterpreting enum value inside packed union" {
1414}1406}
14151407
1416test "access the tag of a global tagged union" {1408test "access the tag of a global tagged union" {
1409 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1410
1417 const U = union(enum) {1411 const U = union(enum) {
1418 a,1412 a,
1419 b: u8,1413 b: u8,
...@@ -2005,7 +1999,6 @@ test "circular dependency through pointer field of a union" {...@@ -2005,7 +1999,6 @@ test "circular dependency through pointer field of a union" {
20051999
2006test "pass nested union with rls" {2000test "pass nested union with rls" {
2007 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;2001 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
2008 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
20092002
2010 const Union = union(enum) {2003 const Union = union(enum) {
2011 a: u32,2004 a: u32,
...@@ -2052,7 +2045,6 @@ test "runtime union init, most-aligned field != largest" {...@@ -2052,7 +2045,6 @@ test "runtime union init, most-aligned field != largest" {
2052test "copied union field doesn't alias source" {2045test "copied union field doesn't alias source" {
2053 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2046 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2054 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO2047 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2055 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
20562048
2057 const U = union(enum) {2049 const U = union(enum) {
2058 array: [10]u32,2050 array: [10]u32,
test/behavior/vector.zig-1
...@@ -378,7 +378,6 @@ test "array of non-abi-sized integer to vector of same type" {...@@ -378,7 +378,6 @@ test "array of non-abi-sized integer to vector of same type" {
378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;378 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
379 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO379 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
380 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO380 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
381 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
382381
383 const S = struct {382 const S = struct {
384 fn doTheTest() !void {383 fn doTheTest() !void {
test/behavior/while.zig+5
...@@ -122,6 +122,8 @@ test "while copies its payload" {...@@ -122,6 +122,8 @@ test "while copies its payload" {
122}122}
123123
124test "continue and break" {124test "continue and break" {
125 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
126
125 try runContinueAndBreakTest();127 try runContinueAndBreakTest();
126 try expect(continue_and_break_counter == 8);128 try expect(continue_and_break_counter == 8);
127}129}
...@@ -140,6 +142,7 @@ fn runContinueAndBreakTest() !void {...@@ -140,6 +142,7 @@ fn runContinueAndBreakTest() !void {
140}142}
141143
142test "while with optional as condition" {144test "while with optional as condition" {
145 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
143 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;146 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
144 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO147 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
145 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;148 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -153,6 +156,7 @@ test "while with optional as condition" {...@@ -153,6 +156,7 @@ test "while with optional as condition" {
153}156}
154157
155test "while with optional as condition with else" {158test "while with optional as condition with else" {
159 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
156 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;160 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
157 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO161 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
158 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;162 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
...@@ -171,6 +175,7 @@ test "while with optional as condition with else" {...@@ -171,6 +175,7 @@ test "while with optional as condition with else" {
171}175}
172176
173test "while with error union condition" {177test "while with error union condition" {
178 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
174 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO179 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
175 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;180 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
176181
test/cases/compile_errors/SpirvType_vulkan_target.zig+3-16
...@@ -1,15 +1,3 @@...@@ -1,15 +1,3 @@
1comptime {
2 _ = @SpirvType(.{ .image = .{
3 .usage = .{ .storage = u32 },
4 .format = .unknown,
5 .dim = .@"2d",
6 .depth = .unknown,
7 .arrayed = false,
8 .multisampled = false,
9 .access = .read_only,
10 } });
11}
12
13comptime {1comptime {
14 _ = @SpirvType(.{ .image = .{2 _ = @SpirvType(.{ .image = .{
15 .usage = .{ .sampled = bool },3 .usage = .{ .sampled = bool },
...@@ -50,7 +38,6 @@ comptime {...@@ -50,7 +38,6 @@ comptime {
50// backend=selfhosted38// backend=selfhosted
51// target=spirv32-vulkan39// target=spirv32-vulkan
52//40//
53// :2:21: error: access qualifier '.read_only' is only valid under the 'opencl' os41// :2:21: error: invalid 'sampled' field value 'bool'
54// :14:21: error: invalid 'sampled' field value 'bool'42// :14:21: error: 'void' type for 'sampled' field is only valid under the 'opencl' OS
55// :26:21: error: 'void' type for 'sampled' field is only valid under the 'opencl' os43// :26:21: error: 'sampled' field value must be a 32-bit int, 64-bit int or 32-bit float under the 'vulkan' OS
56// :38:21: error: 'sampled' field value must be a 32-bit int, 64-bit int or 32-bit float under the 'vulkan' os
test/cases/compile_errors/extern_spirv_decoration_validation.zig+21-4
...@@ -1,13 +1,30 @@...@@ -1,13 +1,30 @@
1const x = @extern(*addrspace(.push_constant) u32, .{1const flat = @extern(*addrspace(.push_constant) u32, .{
2 .name = "x",2 .name = "flat",
3 .decoration = .{ .flat = 0 },3 .decoration = .{ .flat = 0 },
4});4});
5const location = @extern(*addrspace(.uniform) u32, .{
6 .name = "location",
7 .decoration = .{ .location = 0 },
8});
9const descriptor = @extern(*addrspace(.input) u32, .{
10 .name = "descriptor",
11 .decoration = .{ .descriptor = .{ .set = 0, .binding = 0 } },
12});
13
14comptime {
15 _ = flat;
16}
17comptime {
18 _ = location;
19}
5comptime {20comptime {
6 _ = x;21 _ = descriptor;
7}22}
823
9// error24// error
10// backend=selfhosted25// backend=selfhosted
11// target=spirv32-vulkan26// target=spirv32-vulkan
12//27//
13// :1:52: error: "flat" decoration requires "input" or "output" address space28// :1:55: error: 'flat' decoration requires 'input' or 'output' address space
29// :5:53: error: 'location' decoration requires 'input' or 'output' address space
30// :9:53: error: 'descriptor' decoration requires 'storage_buffer', 'uniform', 'constant' or 'global' address space
test/cases/compile_errors/spirv_global_var_must_be_threadlocal.zig created+12
...@@ -0,0 +1,12 @@
1var x: u32 = 0;
2
3comptime {
4 _ = x;
5}
6
7// error
8// backend=selfhosted
9// target=spirv32-vulkan
10//
11// :1:1: error: SPIR-V target does not support global variables
12// :1:1: note: consider using 'threadlocal'
test/cases/compile_errors/spirv_vulkan_threadlocal_addrspace.zig created+11
...@@ -0,0 +1,11 @@
1threadlocal var counter: u32 addrspace(.generic) = 0;
2
3export fn main() callconv(.kernel) void {
4 counter += 1;
5}
6
7// error
8// backend=selfhosted
9// target=spirv32-vulkan
10//
11// :1:41: error: threadlocal variables with address space 'generic' are not supported on vulkan
test/standalone/build.zig+1
...@@ -44,6 +44,7 @@ pub fn build(b: *std.Build) void {...@@ -44,6 +44,7 @@ pub fn build(b: *std.Build) void {
44 "../../tools/generate_linux_syscalls.zig",44 "../../tools/generate_linux_syscalls.zig",
45 "../../tools/process_headers.zig",45 "../../tools/process_headers.zig",
46 "../../tools/migrate_langref.zig",46 "../../tools/migrate_langref.zig",
47 "../../tools/unskip_spirv_tests.zig",
47 "../../tools/update-linux-headers.zig",48 "../../tools/update-linux-headers.zig",
48 "../../tools/update_clang_options.zig",49 "../../tools/update_clang_options.zig",
49 "../../tools/update_cpu_features.zig",50 "../../tools/update_cpu_features.zig",
tools/gen_spirv_spec.zig+304-224
...@@ -1,8 +1,8 @@...@@ -1,8 +1,8 @@
1const std = @import("std");1const std = @import("std");
2const Io = std.Io;2const Io = std.Io;
3const Allocator = std.mem.Allocator;3const Allocator = std.mem.Allocator;
4const ExtendedStructSet = std.StringHashMapUnmanaged(void);
4const assert = std.debug.assert;5const assert = std.debug.assert;
5
6const g = @import("spirv/grammar.zig");6const g = @import("spirv/grammar.zig");
7const CoreRegistry = g.CoreRegistry;7const CoreRegistry = g.CoreRegistry;
8const ExtensionRegistry = g.ExtensionRegistry;8const ExtensionRegistry = g.ExtensionRegistry;
...@@ -11,49 +11,23 @@ const OperandKind = g.OperandKind;...@@ -11,49 +11,23 @@ const OperandKind = g.OperandKind;
11const Enumerant = g.Enumerant;11const Enumerant = g.Enumerant;
12const Operand = g.Operand;12const Operand = g.Operand;
1313
14const ExtendedStructSet = std.StringHashMap(void);14const allowed_vendors = [_][]const u8{ "KHR", "EXT" };
1515const set_names = std.StaticStringMap(struct { []const u8, []const u8 }).initComptime(.{
16const allowed_vendors = [_][]const u8{16 .{ "opencl.std.100", .{ "OpenCL.std", "OpenClOpcode" } },
17 "KHR",17 .{ "glsl.std.450", .{ "GLSL.std.450", "GlslOpcode" } },
18 "EXT",18});
19};
20
21fn isAllowedCapability(name: []const u8) bool {
22 // core capabilities (no vendor suffix) end in a lowercase letter or digit.
23 const last = name[name.len - 1];
24 if (std.ascii.isLower(last) or std.ascii.isDigit(last)) return true;
25 for (allowed_vendors) |vendor| {
26 if (std.mem.endsWith(u8, name, vendor)) return true;
27 }
28 return false;
29}
30
31fn isAllowedExtension(name: []const u8) bool {
32 const spv_prefix = "SPV_";
33 if (!std.mem.startsWith(u8, name, spv_prefix)) return false;
34 const tail = name[spv_prefix.len..];
35 for (allowed_vendors) |vendor| {
36 if (std.mem.startsWith(u8, tail, vendor) and
37 tail.len > vendor.len and tail[vendor.len] == '_')
38 return true;
39 }
40 return false;
41}
4219
43const Extension = struct {20const Extension = struct {
44 name: []const u8,21 name: []const u8,
45 opcode_name: []const u8,22 opcode_name: []const u8,
46 spec: ExtensionRegistry,23 spec: ExtensionRegistry,
47};24};
48
49const CmpInst = struct {25const CmpInst = struct {
50 fn lt(_: CmpInst, a: Instruction, b: Instruction) bool {26 fn lt(_: CmpInst, a: Instruction, b: Instruction) bool {
51 return a.opcode < b.opcode;27 return a.opcode < b.opcode;
52 }28 }
53};29};
54
55const StringPair = struct { []const u8, []const u8 };30const StringPair = struct { []const u8, []const u8 };
56
57const StringPairContext = struct {31const StringPairContext = struct {
58 pub fn hash(_: @This(), a: StringPair) u32 {32 pub fn hash(_: @This(), a: StringPair) u32 {
59 var hasher = std.hash.Wyhash.init(0);33 var hasher = std.hash.Wyhash.init(0);
...@@ -70,34 +44,24 @@ const StringPairContext = struct {...@@ -70,34 +44,24 @@ const StringPairContext = struct {
70 return std.mem.eql(u8, a_x, b_x) and std.mem.eql(u8, a_y, b_y);44 return std.mem.eql(u8, a_x, b_x) and std.mem.eql(u8, a_y, b_y);
71 }45 }
72};46};
73
74const OperandKindMap = std.array_hash_map.Custom(StringPair, OperandKind, StringPairContext, true);47const OperandKindMap = std.array_hash_map.Custom(StringPair, OperandKind, StringPairContext, true);
7548
76/// Khronos made it so that these names are not defined explicitly, so
77/// we need to hardcode it (like they did).
78/// See https://github.com/KhronosGroup/SPIRV-Registry
79const set_names = std.StaticStringMap(struct { []const u8, []const u8 }).initComptime(.{
80 .{ "opencl.std.100", .{ "OpenCL.std", "OpenClOpcode" } },
81 .{ "glsl.std.450", .{ "GLSL.std.450", "GlslOpcode" } },
82 .{ "zig", .{ "zig", "Zig" } },
83});
84
85pub fn main(init: std.process.Init) !void {49pub fn main(init: std.process.Init) !void {
50 const io = init.io;
86 const arena = init.arena.allocator();51 const arena = init.arena.allocator();
87 const args = try init.minimal.args.toSlice(arena);52 const args = try init.minimal.args.toSlice(arena);
88 if (args.len != 3) {53 if (args.len != 2) {
89 usageAndExit(args[0], 1);54 usageAndExit(args[0], 1);
90 }55 }
9156
92 const io = init.io;
93
94 const json_path = try Io.Dir.path.join(arena, &.{ args[1], "include/spirv/unified1/" });57 const json_path = try Io.Dir.path.join(arena, &.{ args[1], "include/spirv/unified1/" });
95 const dir = try Io.Dir.cwd().openDir(io, json_path, .{ .iterate = true });58 const dir = try Io.Dir.cwd().openDir(io, json_path, .{ .iterate = true });
9659
97 const core_spec = try readRegistry(io, arena, CoreRegistry, dir, "spirv.core.grammar.json");60 var core_spec = try readRegistry(io, arena, CoreRegistry, dir, "spirv.core.grammar.json");
98 std.mem.sortUnstable(Instruction, core_spec.instructions, CmpInst{}, CmpInst.lt);61 std.mem.sortUnstable(Instruction, core_spec.instructions, CmpInst{}, CmpInst.lt);
62 keepEnabled(&core_spec.instructions, core_spec.operand_kinds);
9963
100 var exts = std.array_list.Managed(Extension).init(arena);64 var exts: std.ArrayList(Extension) = .empty;
10165
102 var it = dir.iterate();66 var it = dir.iterate();
103 while (try it.next(io)) |entry| {67 while (try it.next(io)) |entry| {
...@@ -108,8 +72,6 @@ pub fn main(init: std.process.Init) !void {...@@ -108,8 +72,6 @@ pub fn main(init: std.process.Init) !void {
108 try readExtRegistry(io, arena, &exts, dir, entry.name);72 try readExtRegistry(io, arena, &exts, dir, entry.name);
109 }73 }
11074
111 try readExtRegistry(io, arena, &exts, Io.Dir.cwd(), args[2]);
112
113 var allocating: std.Io.Writer.Allocating = .init(arena);75 var allocating: std.Io.Writer.Allocating = .init(arena);
114 defer allocating.deinit();76 defer allocating.deinit();
115 try render(arena, &allocating.writer, core_spec, exts.items);77 try render(arena, &allocating.writer, core_spec, exts.items);
...@@ -117,7 +79,6 @@ pub fn main(init: std.process.Init) !void {...@@ -117,7 +79,6 @@ pub fn main(init: std.process.Init) !void {
117 const output = allocating.written()[0 .. allocating.written().len - 1 :0];79 const output = allocating.written()[0 .. allocating.written().len - 1 :0];
11880
119 var tree = try std.zig.Ast.parse(arena, output, .{});81 var tree = try std.zig.Ast.parse(arena, output, .{});
120
121 if (tree.errors.len != 0) {82 if (tree.errors.len != 0) {
122 try std.zig.printAstErrorsToStderr(arena, io, tree, "", .auto);83 try std.zig.printAstErrorsToStderr(arena, io, tree, "", .auto);
123 return;84 return;
...@@ -138,7 +99,7 @@ pub fn main(init: std.process.Init) !void {...@@ -138,7 +99,7 @@ pub fn main(init: std.process.Init) !void {
138 try Io.File.stdout().writeStreamingAll(io, formatted_output);99 try Io.File.stdout().writeStreamingAll(io, formatted_output);
139}100}
140101
141fn readExtRegistry(io: Io, arena: Allocator, exts: *std.array_list.Managed(Extension), dir: Io.Dir, sub_path: []const u8) !void {102fn readExtRegistry(io: Io, arena: Allocator, exts: *std.ArrayList(Extension), dir: Io.Dir, sub_path: []const u8) !void {
142 const filename = Io.Dir.path.basename(sub_path);103 const filename = Io.Dir.path.basename(sub_path);
143 if (!std.mem.startsWith(u8, filename, "extinst.")) {104 if (!std.mem.startsWith(u8, filename, "extinst.")) {
144 return;105 return;
...@@ -146,16 +107,17 @@ fn readExtRegistry(io: Io, arena: Allocator, exts: *std.array_list.Managed(Exten...@@ -146,16 +107,17 @@ fn readExtRegistry(io: Io, arena: Allocator, exts: *std.array_list.Managed(Exten
146107
147 assert(std.mem.endsWith(u8, filename, ".grammar.json"));108 assert(std.mem.endsWith(u8, filename, ".grammar.json"));
148 const name = filename["extinst.".len .. filename.len - ".grammar.json".len];109 const name = filename["extinst.".len .. filename.len - ".grammar.json".len];
149 const spec = try readRegistry(io, arena, ExtensionRegistry, dir, sub_path);110 var spec = try readRegistry(io, arena, ExtensionRegistry, dir, sub_path);
150111
151 const set_name = set_names.get(name) orelse {112 const set_name = set_names.get(name) orelse {
152 std.log.info("ignored instruction set '{s}'", .{name});113 std.log.info("ignored instruction set '{s}'", .{name});
153 return;114 return;
154 };115 };
155116
156 std.sort.block(Instruction, spec.instructions, CmpInst{}, CmpInst.lt);117 std.mem.sort(Instruction, spec.instructions, CmpInst{}, CmpInst.lt);
118 keepEnabled(&spec.instructions, spec.operand_kinds);
157119
158 try exts.append(.{120 try exts.append(arena, .{
159 .name = set_name.@"0",121 .name = set_name.@"0",
160 .opcode_name = set_name.@"1",122 .opcode_name = set_name.@"1",
161 .spec = spec,123 .spec = spec,
...@@ -164,8 +126,6 @@ fn readExtRegistry(io: Io, arena: Allocator, exts: *std.array_list.Managed(Exten...@@ -164,8 +126,6 @@ fn readExtRegistry(io: Io, arena: Allocator, exts: *std.array_list.Managed(Exten
164126
165fn readRegistry(io: Io, arena: Allocator, comptime RegistryType: type, dir: Io.Dir, path: []const u8) !RegistryType {127fn readRegistry(io: Io, arena: Allocator, comptime RegistryType: type, dir: Io.Dir, path: []const u8) !RegistryType {
166 const spec = try dir.readFileAlloc(io, path, arena, .unlimited);128 const spec = try dir.readFileAlloc(io, path, arena, .unlimited);
167 // Required for json parsing.
168 // TODO: ALI
169 @setEvalBranchQuota(10000);129 @setEvalBranchQuota(10000);
170130
171 var scanner = std.json.Scanner.initCompleteInput(arena, spec);131 var scanner = std.json.Scanner.initCompleteInput(arena, spec);
...@@ -178,11 +138,9 @@ fn readRegistry(io: Io, arena: Allocator, comptime RegistryType: type, dir: Io.D...@@ -178,11 +138,9 @@ fn readRegistry(io: Io, arena: Allocator, comptime RegistryType: type, dir: Io.D
178 return parsed.value;138 return parsed.value;
179}139}
180140
181/// Returns a set with types that require an extra struct for the `Instruction` interface
182/// to the spir-v spec, or whether the original type can be used.
183fn extendedStructs(arena: Allocator, kinds: []const OperandKind) !ExtendedStructSet {141fn extendedStructs(arena: Allocator, kinds: []const OperandKind) !ExtendedStructSet {
184 var map = ExtendedStructSet.init(arena);142 var map: ExtendedStructSet = .empty;
185 try map.ensureTotalCapacity(@as(u32, @intCast(kinds.len)));143 try map.ensureTotalCapacity(arena, @as(u32, @intCast(kinds.len)));
186144
187 for (kinds) |kind| {145 for (kinds) |kind| {
188 const enumerants = kind.enumerants orelse continue;146 const enumerants = kind.enumerants orelse continue;
...@@ -199,10 +157,6 @@ fn extendedStructs(arena: Allocator, kinds: []const OperandKind) !ExtendedStruct...@@ -199,10 +157,6 @@ fn extendedStructs(arena: Allocator, kinds: []const OperandKind) !ExtendedStruct
199 return map;157 return map;
200}158}
201159
202// Return a score for a particular priority. Duplicate instruction/operand enum values are
203// removed by picking the tag with the lowest score to keep, and by making an alias for the
204// other. Note that the tag does not need to be just a tag at this point, in which case it
205// gets the lowest score automatically anyway.
206fn tagPriorityScore(tag: []const u8) usize {160fn tagPriorityScore(tag: []const u8) usize {
207 if (tag.len == 0) {161 if (tag.len == 0) {
208 return 1;162 return 1;
...@@ -223,45 +177,52 @@ fn render(...@@ -223,45 +177,52 @@ fn render(
223) !void {177) !void {
224 try writer.writeAll(178 try writer.writeAll(
225 \\//! This file is auto-generated by tools/gen_spirv_spec.zig.179 \\//! This file is auto-generated by tools/gen_spirv_spec.zig.
226 \\
227 \\const std = @import("std");180 \\const std = @import("std");
228 \\181 \\
182 \\pub const Word = u32;
229 \\pub const Version = packed struct(Word) {183 \\pub const Version = packed struct(Word) {
230 \\ padding: u8 = 0,184 \\ padding: u8 = 0,
231 \\ minor: u8,185 \\ minor: u8,
232 \\ major: u8,186 \\ major: u8,
233 \\ padding0: u8 = 0,187 \\ padding0: u8 = 0,
234 \\
235 \\ pub fn toWord(self: @This()) Word {
236 \\ return @bitCast(self);
237 \\ }
238 \\};188 \\};
239 \\189 \\pub const Generator = packed struct(Word) {
240 \\pub const Word = u32;190 \\ version: u16,
191 \\ tool: u16,
192 \\};
193 \\pub const Header = extern struct {
194 \\ magic: Word,
195 \\ version: Version,
196 \\ generator: Generator,
197 \\ id_bound: Word,
198 \\ schema: Word,
199 \\};
200 \\pub const InstructionHeader = packed struct(Word) {
201 \\ opcode: Opcode,
202 \\ word_count: u16,
203 \\};
241 \\pub const Id = enum(Word) {204 \\pub const Id = enum(Word) {
242 \\ none,205 \\ none,
243 \\ _,206 \\ _,
244 \\207 \\
245 \\ pub fn format(self: Id, writer: *std.Io.Writer) std.Io.Writer.Error!void {208 \\ pub fn format(id: Id, writer: *std.Io.Writer) std.Io.Writer.Error!void {
246 \\ switch (self) {209 \\ switch (id) {
247 \\ .none => try writer.writeAll("(none)"),210 \\ .none => try writer.writeAll("(none)"),
248 \\ else => try writer.print("%{d}", .{@intFromEnum(self)}),211 \\ else => try writer.print("%{d}", .{@backingInt(id)}),
249 \\ }212 \\ }
250 \\ }213 \\ }
251 \\};214 \\};
252 \\
253 \\pub const IdRange = struct {215 \\pub const IdRange = struct {
254 \\ base: u32,216 \\ base: u32,
255 \\ len: u32,217 \\ len: u32,
256 \\218 \\
257 \\ pub fn at(range: IdRange, i: usize) Id {219 \\ pub fn at(range: IdRange, i: usize) Id {
258 \\ std.debug.assert(i < range.len);220 \\ std.debug.assert(i < range.len);
259 \\ return @enumFromInt(range.base + i);221 \\ return @fromBackingInt(@intCast(range.base + i));
260 \\ }222 \\ }
261 \\};223 \\};
262 \\224 \\
263 \\pub const LiteralInteger = Word;225 \\pub const LiteralInteger = Word;
264 \\pub const LiteralFloat = Word;
265 \\pub const LiteralString = []const u8;226 \\pub const LiteralString = []const u8;
266 \\pub const LiteralContextDependentNumber = union(enum) {227 \\pub const LiteralContextDependentNumber = union(enum) {
267 \\ int32: i32,228 \\ int32: i32,
...@@ -285,7 +246,7 @@ fn render(...@@ -285,7 +246,7 @@ fn render(
285 \\246 \\
286 \\pub const Operand = struct {247 \\pub const Operand = struct {
287 \\ kind: OperandKind,248 \\ kind: OperandKind,
288 \\ quantifier: Quantifier,249 \\ quantifier: Quantifier = .required,
289 \\};250 \\};
290 \\251 \\
291 \\pub const OperandCategory = enum {252 \\pub const OperandCategory = enum {
...@@ -299,16 +260,10 @@ fn render(...@@ -299,16 +260,10 @@ fn render(
299 \\pub const Enumerant = struct {260 \\pub const Enumerant = struct {
300 \\ name: []const u8,261 \\ name: []const u8,
301 \\ value: Word,262 \\ value: Word,
302 \\ parameters: []const OperandKind,263 \\ parameters: []const Operand,
303 \\};264 \\};
304 \\265 \\
305 \\pub const Instruction = struct {266 \\pub const zig_generator_id: u16 = 41;
306 \\ name: []const u8,
307 \\ opcode: Word,
308 \\ operands: []const Operand,
309 \\};
310 \\
311 \\pub const zig_generator_id: Word = 41;
312 \\267 \\
313 );268 );
314269
...@@ -321,17 +276,11 @@ fn render(...@@ -321,17 +276,11 @@ fn render(
321 .{ registry.major_version, registry.minor_version, registry.revision, registry.magic_number },276 .{ registry.major_version, registry.minor_version, registry.revision, registry.magic_number },
322 );277 );
323278
324 // Merge the operand kinds from all extensions together.
325 var all_operand_kinds: OperandKindMap = .empty;279 var all_operand_kinds: OperandKindMap = .empty;
326 for (registry.operand_kinds) |kind| {280 for (registry.operand_kinds) |kind| {
327 try all_operand_kinds.putNoClobber(arena, .{ "core", kind.kind }, kind);281 try all_operand_kinds.putNoClobber(arena, .{ "core", kind.kind }, kind);
328 }282 }
329 for (extensions) |ext| {283 for (extensions) |ext| {
330 // Note: extensions may define the same operand kind, with different
331 // parameters. Instead of trying to merge them, just discriminate them
332 // using the name of the extension. This is similar to what
333 // the official headers do.
334
335 try all_operand_kinds.ensureUnusedCapacity(arena, ext.spec.operand_kinds.len);284 try all_operand_kinds.ensureUnusedCapacity(arena, ext.spec.operand_kinds.len);
336 for (ext.spec.operand_kinds) |kind| {285 for (ext.spec.operand_kinds) |kind| {
337 var new_kind = kind;286 var new_kind = kind;
...@@ -340,19 +289,19 @@ fn render(...@@ -340,19 +289,19 @@ fn render(
340 }289 }
341 }290 }
342291
343 const extended_structs = try extendedStructs(arena, all_operand_kinds.values());292 const kinds = all_operand_kinds.values();
344 // Note: extensions don't seem to have class.293 const extended_structs = try extendedStructs(arena, kinds);
345 try renderClass(arena, writer, registry.instructions);294 try renderClass(arena, writer, registry.instructions);
346 try renderOperandKind(writer, all_operand_kinds.values());295 try renderOperandKind(writer, kinds);
347296
348 try renderOpcodes(arena, writer, "Opcode", true, registry.instructions, extended_structs);297 try renderOpcodes(arena, writer, "core", "Opcode", true, registry.instructions, extended_structs, all_operand_kinds);
349 for (extensions) |ext| {298 for (extensions) |ext| {
350 try renderOpcodes(arena, writer, ext.opcode_name, false, ext.spec.instructions, extended_structs);299 try renderOpcodes(arena, writer, ext.name, ext.opcode_name, false, ext.spec.instructions, extended_structs, all_operand_kinds);
351 }300 }
352301
353 try renderOperandKinds(arena, writer, all_operand_kinds.values(), extended_structs);302 try renderOperandKinds(arena, writer, kinds, extended_structs);
354 try renderInstructionSet(writer, registry, extensions, all_operand_kinds);303 try renderInstructionSet(writer, extensions);
355 try renderExtension(arena, writer, all_operand_kinds.values());304 try renderExtension(arena, writer, kinds);
356}305}
357306
358fn renderExtension(307fn renderExtension(
...@@ -378,7 +327,6 @@ fn renderExtension(...@@ -378,7 +327,6 @@ fn renderExtension(
378 for (kinds) |kind| {327 for (kinds) |kind| {
379 if (std.mem.eql(u8, "Capability", kind.kind)) {328 if (std.mem.eql(u8, "Capability", kind.kind)) {
380 for (kind.enumerants.?) |enumerant| {329 for (kind.enumerants.?) |enumerant| {
381 if (!isAllowedCapability(enumerant.enumerant)) continue;
382 for (enumerant.extensions) |ext| {330 for (enumerant.extensions) |ext| {
383 if (!isAllowedExtension(ext)) continue;331 if (!isAllowedExtension(ext)) continue;
384 if (seen_extensions.contains(ext)) continue;332 if (seen_extensions.contains(ext)) continue;
...@@ -393,9 +341,7 @@ fn renderExtension(...@@ -393,9 +341,7 @@ fn renderExtension(
393341
394fn renderInstructionSet(342fn renderInstructionSet(
395 writer: *std.Io.Writer,343 writer: *std.Io.Writer,
396 core: CoreRegistry,
397 extensions: []const Extension,344 extensions: []const Extension,
398 all_operand_kinds: OperandKindMap,
399) !void {345) !void {
400 try writer.writeAll(346 try writer.writeAll(
401 \\pub const InstructionSet = enum {347 \\pub const InstructionSet = enum {
...@@ -408,14 +354,17 @@ fn renderInstructionSet(...@@ -408,14 +354,17 @@ fn renderInstructionSet(
408354
409 try writer.writeAll(355 try writer.writeAll(
410 \\356 \\
411 \\ pub fn instructions(self: InstructionSet) []const Instruction {357 \\ pub fn operands(inst_set: InstructionSet, opcode: Word) ?[]const Operand {
412 \\ return switch (self) {358 \\ return switch (inst_set) {
359 \\ .core => if (std.enums.fromInt(Opcode, opcode)) |op| op.operands() else null,
413 \\360 \\
414 );361 );
415362
416 try renderInstructionsCase(writer, "core", core.instructions, all_operand_kinds);
417 for (extensions) |ext| {363 for (extensions) |ext| {
418 try renderInstructionsCase(writer, ext.name, ext.spec.instructions, all_operand_kinds);364 try writer.print(
365 " .{f} => if (std.enums.fromInt({f}, opcode)) |op| op.operands() else null,\n",
366 .{ std.zig.fmtId(ext.name), std.zig.fmtId(ext.opcode_name) },
367 );
419 }368 }
420369
421 try writer.writeAll(370 try writer.writeAll(
...@@ -426,54 +375,6 @@ fn renderInstructionSet(...@@ -426,54 +375,6 @@ fn renderInstructionSet(
426 );375 );
427}376}
428377
429fn renderInstructionsCase(
430 writer: *std.Io.Writer,
431 set_name: []const u8,
432 instructions: []const Instruction,
433 all_operand_kinds: OperandKindMap,
434) !void {
435 // Note: theoretically we could dedup from tags and give every instruction a list of aliases,
436 // but there aren't so many total aliases and that would add more overhead in total. We will
437 // just filter those out when needed.
438
439 try writer.print(".{f} => &.{{\n", .{std.zig.fmtId(set_name)});
440
441 for (instructions) |inst| {
442 try writer.print(
443 \\.{{
444 \\ .name = "{s}",
445 \\ .opcode = {},
446 \\ .operands = &.{{
447 \\
448 , .{ inst.opname, inst.opcode });
449
450 for (inst.operands) |operand| {
451 const quantifier = if (operand.quantifier) |q|
452 switch (q) {
453 .@"?" => "optional",
454 .@"*" => "variadic",
455 }
456 else
457 "required";
458
459 const kind = all_operand_kinds.get(.{ set_name, operand.kind }) orelse
460 all_operand_kinds.get(.{ "core", operand.kind }).?;
461 try writer.print(".{{.kind = .{f}, .quantifier = .{s}}},\n", .{ formatId(kind.kind), quantifier });
462 }
463
464 try writer.writeAll(
465 \\ },
466 \\},
467 \\
468 );
469 }
470
471 try writer.writeAll(
472 \\},
473 \\
474 );
475}
476
477fn renderClass(arena: Allocator, writer: *std.Io.Writer, instructions: []const Instruction) !void {378fn renderClass(arena: Allocator, writer: *std.Io.Writer, instructions: []const Instruction) !void {
478 var class_map: std.array_hash_map.String(void) = .empty;379 var class_map: std.array_hash_map.String(void) = .empty;
479380
...@@ -513,7 +414,6 @@ const Formatter = struct {...@@ -513,7 +414,6 @@ const Formatter = struct {
513 }414 }
514 }415 }
515416
516 // make sure that this won't clobber with zig keywords
517 try writer.print("{f}", .{std.zig.fmtId(fw.buffered())});417 try writer.print("{f}", .{std.zig.fmtId(fw.buffered())});
518 }418 }
519};419};
...@@ -533,8 +433,8 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi...@@ -533,8 +433,8 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi
533 }433 }
534 try writer.writeAll(434 try writer.writeAll(
535 \\435 \\
536 \\pub fn category(self: OperandKind) OperandCategory {436 \\pub fn category(operand_kind: OperandKind) OperandCategory {
537 \\ return switch (self) {437 \\ return switch (operand_kind) {
538 \\ .opcode => .literal,438 \\ .opcode => .literal,
539 \\439 \\
540 );440 );
...@@ -551,8 +451,8 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi...@@ -551,8 +451,8 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi
551 try writer.writeAll(451 try writer.writeAll(
552 \\ };452 \\ };
553 \\}453 \\}
554 \\pub fn enumerants(self: OperandKind) []const Enumerant {454 \\pub fn enumerants(operand_kind: OperandKind) []const Enumerant {
555 \\ return switch (self) {455 \\ return switch (operand_kind) {
556 \\ .opcode => unreachable,456 \\ .opcode => unreachable,
557 \\457 \\
558 );458 );
...@@ -575,7 +475,24 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi...@@ -575,7 +475,24 @@ fn renderOperandKind(writer: *std.Io.Writer, operands: []const OperandKind) !voi
575 }475 }
576 try writer.writeAll("},\n");476 try writer.writeAll("},\n");
577 }477 }
578 try writer.writeAll("};\n}\n};\n");478 try writer.writeAll(
479 \\};
480 \\}
481 \\
482 \\pub fn bases(operand_kind: OperandKind) []const OperandKind {
483 \\ return switch (operand_kind) {
484 \\
485 );
486 for (operands) |operand| {
487 if (operand.category != .Composite) continue;
488 try writer.print(".{f} => &.{{", .{formatId(operand.kind)});
489 for (operand.bases.?, 0..) |base, i| {
490 if (i != 0) try writer.writeAll(", ");
491 try writer.print(".{f}", .{formatId(base)});
492 }
493 try writer.writeAll("},\n");
494 }
495 try writer.writeAll("else => unreachable,\n};\n}\n};\n");
579}496}
580497
581fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {498fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {
...@@ -588,8 +505,7 @@ fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {...@@ -588,8 +505,7 @@ fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {
588 for (enumerant.parameters, 0..) |param, i| {505 for (enumerant.parameters, 0..) |param, i| {
589 if (i != 0)506 if (i != 0)
590 try writer.writeAll(", ");507 try writer.writeAll(", ");
591 // Note, param.quantifier will always be one.508 try writer.print(".{{ .kind = .{f} }}", .{formatId(param.kind)});
592 try writer.print(".{f}", .{formatId(param.kind)});
593 }509 }
594 try writer.writeAll("}}");510 try writer.writeAll("}}");
595}511}
...@@ -597,16 +513,18 @@ fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {...@@ -597,16 +513,18 @@ fn renderEnumerant(writer: *std.Io.Writer, enumerant: Enumerant) !void {
597fn renderOpcodes(513fn renderOpcodes(
598 arena: Allocator,514 arena: Allocator,
599 writer: *std.Io.Writer,515 writer: *std.Io.Writer,
516 set_name: []const u8,
600 opcode_type_name: []const u8,517 opcode_type_name: []const u8,
601 want_operands: bool,518 want_operands: bool,
602 instructions: []const Instruction,519 instructions: []const Instruction,
603 extended_structs: ExtendedStructSet,520 extended_structs: ExtendedStructSet,
521 all_operand_kinds: OperandKindMap,
604) !void {522) !void {
605 var inst_map: std.array_hash_map.Auto(u32, usize) = .empty;523 var inst_map: std.array_hash_map.Auto(u32, usize) = .empty;
606 try inst_map.ensureTotalCapacity(arena, instructions.len);524 try inst_map.ensureTotalCapacity(arena, instructions.len);
607525
608 var aliases = std.array_list.Managed(struct { inst: usize, alias: usize }).init(arena);526 var aliases: std.ArrayList(struct { inst: usize, alias: usize }) = .empty;
609 try aliases.ensureTotalCapacity(instructions.len);527 try aliases.ensureTotalCapacity(arena, instructions.len);
610528
611 for (instructions, 0..) |inst, i| {529 for (instructions, 0..) |inst, i| {
612 if (inst.class) |class| {530 if (inst.class) |class| {
...@@ -651,13 +569,45 @@ fn renderOpcodes(...@@ -651,13 +569,45 @@ fn renderOpcodes(
651 });569 });
652 }570 }
653571
572 try writer.print(
573 \\
574 \\pub fn operands(opcode: {f}) []const Operand {{
575 \\ return switch (opcode) {{
576 \\
577 , .{std.zig.fmtId(opcode_type_name)});
578
579 for (instructions_indices) |i| {
580 const inst = instructions[i];
581 try writer.print(".{f} => &.{{", .{std.zig.fmtId(inst.opname)});
582 for (inst.operands, 0..) |operand, j| {
583 const kind = all_operand_kinds.get(.{ set_name, operand.kind }) orelse
584 all_operand_kinds.get(.{ "core", operand.kind }).?;
585 if (j != 0) try writer.writeAll(", ");
586 try writer.print(".{{ .kind = .{f}", .{formatId(kind.kind)});
587 if (operand.quantifier) |quantifier| {
588 try writer.print(", .quantifier = .{s}", .{switch (quantifier) {
589 .@"?" => "optional",
590 .@"*" => "variadic",
591 }});
592 }
593 try writer.writeAll(" }");
594 }
595 try writer.writeAll("},\n");
596 }
597
598 try writer.writeAll(
599 \\ };
600 \\}
601 \\
602 );
603
654 if (want_operands) {604 if (want_operands) {
655 try writer.print(605 try writer.writeAll(
656 \\606 \\
657 \\pub fn Operands(comptime self: {f}) type {{607 \\pub fn Operands(comptime opcode: Opcode) type {
658 \\ return switch (self) {{608 \\ return switch (opcode) {
659 \\609 \\
660 , .{std.zig.fmtId(opcode_type_name)});610 );
661611
662 for (instructions_indices) |i| {612 for (instructions_indices) |i| {
663 const inst = instructions[i];613 const inst = instructions[i];
...@@ -670,19 +620,104 @@ fn renderOpcodes(...@@ -670,19 +620,104 @@ fn renderOpcodes(
670 \\620 \\
671 );621 );
672622
673 try writer.print(623 try writer.writeAll(
674 \\pub fn class(self: {f}) Class {{
675 \\ return switch (self) {{
676 \\624 \\
677 , .{std.zig.fmtId(opcode_type_name)});625 \\pub fn class(opcode: Opcode) Class {
626 \\ return switch (@backingInt(opcode)) {
627 \\
628 );
678629
679 for (instructions_indices) |i| {630 var first: usize = 0;
680 const inst = instructions[i];631 while (first < instructions_indices.len) {
681 try writer.print(".{f} => .{f},\n", .{ std.zig.fmtId(inst.opname), formatId(inst.class.?) });632 const class = instructions[instructions_indices[first]].class.?;
633 var last = first;
634 while (last + 1 < instructions_indices.len and
635 std.mem.eql(u8, instructions[instructions_indices[last + 1]].class.?, class)) last += 1;
636 const lo = instructions[instructions_indices[first]].opcode;
637 const hi = instructions[instructions_indices[last]].opcode;
638 if (lo == hi) {
639 try writer.print("{d} => .{f},\n", .{ lo, formatId(class) });
640 } else {
641 try writer.print("{d}...{d} => .{f},\n", .{ lo, hi, formatId(class) });
642 }
643 first = last + 1;
682 }644 }
683645
684 try writer.writeAll(646 try writer.writeAll(
685 \\ };647 \\ else => unreachable,
648 \\ };
649 \\}
650 \\
651 \\pub fn resultIndex(opcode: Opcode) ?u8 {
652 \\ const list = opcode.operands();
653 \\ if (list.len == 0) return null;
654 \\ return switch (list[0].kind) {
655 \\ .id_result => 1,
656 \\ .id_result_type => 2,
657 \\ else => null,
658 \\ };
659 \\}
660 \\
661 \\pub fn instructionSize(comptime opcode: Opcode, ops: opcode.Operands()) usize {
662 \\ return operandsSize(opcode.Operands(), ops) + 1;
663 \\}
664 \\
665 \\fn operandsSize(comptime T: type, ops: T) usize {
666 \\ const info = switch (@typeInfo(T)) {
667 \\ .@"struct" => |info| info,
668 \\ .void => return 0,
669 \\ else => unreachable,
670 \\ };
671 \\
672 \\ var total: usize = 0;
673 \\ inline for (info.field_names, info.field_types) |field_name, field_type| {
674 \\ total += operandSize(field_type, @field(ops, field_name));
675 \\ }
676 \\
677 \\ return total;
678 \\}
679 \\
680 \\fn operandSize(comptime T: type, operand: T) usize {
681 \\ return switch (T) {
682 \\ LiteralSpecConstantOpInteger => unreachable,
683 \\ Id, LiteralInteger, LiteralExtInstInteger => 1,
684 \\ LiteralString => @divCeil(operand.len + 1, @sizeOf(Word)),
685 \\ LiteralContextDependentNumber => switch (operand) {
686 \\ .int32, .uint32, .float32 => 1,
687 \\ .int64, .uint64, .float64 => 2,
688 \\ },
689 \\ PairLiteralIntegerIdRef, PairIdRefLiteralInteger, PairIdRefIdRef => 2,
690 \\ else => switch (@typeInfo(T)) {
691 \\ .@"enum" => 1,
692 \\ .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
693 \\ .pointer => |info| blk: {
694 \\ std.debug.assert(info.size == .slice);
695 \\ var total: usize = 0;
696 \\ for (operand) |item| {
697 \\ total += operandSize(info.child, item);
698 \\ }
699 \\ break :blk total;
700 \\ },
701 \\ .@"struct" => |struct_info| {
702 \\ if (struct_info.layout == .@"packed") return 1;
703 \\ var total: usize = 0;
704 \\ inline for (struct_info.field_names, struct_info.field_types) |field_name, field_type| {
705 \\ switch (@typeInfo(field_type)) {
706 \\ .optional => |info| if (@field(operand, field_name)) |child| {
707 \\ total += operandsSize(info.child, child);
708 \\ },
709 \\ .bool, .int => {},
710 \\ else => unreachable,
711 \\ }
712 \\ }
713 \\ return total + 1;
714 \\ },
715 \\ .@"union" => switch (operand) {
716 \\ inline else => |op, tag| operandsSize(@FieldType(T, @tagName(tag)), op) + 1,
717 \\ },
718 \\ else => unreachable,
719 \\ },
720 \\ };
686 \\}721 \\}
687 \\722 \\
688 );723 );
...@@ -720,13 +755,12 @@ fn renderValueEnum(...@@ -720,13 +755,12 @@ fn renderValueEnum(
720 var enum_map: std.array_hash_map.Auto(u32, usize) = .empty;755 var enum_map: std.array_hash_map.Auto(u32, usize) = .empty;
721 try enum_map.ensureTotalCapacity(arena, enumerants.len);756 try enum_map.ensureTotalCapacity(arena, enumerants.len);
722757
723 var aliases = std.array_list.Managed(struct { enumerant: usize, alias: usize }).init(arena);758 var aliases: std.ArrayList(struct { enumerant: usize, alias: usize }) = .empty;
724 try aliases.ensureTotalCapacity(enumerants.len);759 try aliases.ensureTotalCapacity(arena, enumerants.len);
725760
726 for (enumerants, 0..) |enumerant, i| {761 for (enumerants, 0..) |enumerant, i| {
727 const value: u31 = switch (enumerant.value) {762 const value: u31 = switch (enumerant.value) {
728 .int => |value| value,763 .int => |value| value,
729 // Some extensions declare ints as string
730 .bitflag => |value| try std.fmt.parseInt(u31, value, 10),764 .bitflag => |value| try std.fmt.parseInt(u31, value, 10),
731 };765 };
732 const result = enum_map.getOrPutAssumeCapacity(value);766 const result = enum_map.getOrPutAssumeCapacity(value);
...@@ -751,15 +785,10 @@ fn renderValueEnum(...@@ -751,15 +785,10 @@ fn renderValueEnum(
751785
752 const enum_indices = enum_map.values();786 const enum_indices = enum_map.values();
753787
754 const is_capability = std.mem.eql(u8, "Capability", enumeration.kind);
755
756 try writer.print("pub const {f} = enum(u32) {{\n", .{std.zig.fmtId(enumeration.kind)});788 try writer.print("pub const {f} = enum(u32) {{\n", .{std.zig.fmtId(enumeration.kind)});
757789
758 for (enum_indices) |i| {790 for (enum_indices) |i| {
759 const enumerant = enumerants[i];791 const enumerant = enumerants[i];
760 if (is_capability and !isAllowedCapability(enumerant.enumerant)) continue;
761 // if (enumerant.value != .int) return error.InvalidRegistry;
762
763 switch (enumerant.value) {792 switch (enumerant.value) {
764 .int => |value| try writer.print("{f} = {},\n", .{ formatId(enumerant.enumerant), value }),793 .int => |value| try writer.print("{f} = {},\n", .{ formatId(enumerant.enumerant), value }),
765 .bitflag => |value| try writer.print("{f} = {s},\n", .{ formatId(enumerant.enumerant), value }),794 .bitflag => |value| try writer.print("{f} = {s},\n", .{ formatId(enumerant.enumerant), value }),
...@@ -769,8 +798,6 @@ fn renderValueEnum(...@@ -769,8 +798,6 @@ fn renderValueEnum(
769 try writer.writeByte('\n');798 try writer.writeByte('\n');
770799
771 for (aliases.items) |alias| {800 for (aliases.items) |alias| {
772 if (is_capability and (!isAllowedCapability(enumerants[alias.enumerant].enumerant) or
773 !isAllowedCapability(enumerants[alias.alias].enumerant))) continue;
774 try writer.print("pub const {f} = {f}.{f};\n", .{801 try writer.print("pub const {f} = {f}.{f};\n", .{
775 formatId(enumerants[alias.enumerant].enumerant),802 formatId(enumerants[alias.enumerant].enumerant),
776 std.zig.fmtId(enumeration.kind),803 std.zig.fmtId(enumeration.kind),
...@@ -778,32 +805,23 @@ fn renderValueEnum(...@@ -778,32 +805,23 @@ fn renderValueEnum(
778 });805 });
779 }806 }
780807
781 if (is_capability) {808 if (std.mem.eql(u8, "Capability", enumeration.kind)) {
782 try writer.writeAll(809 try writer.writeAll(
783 \\810 \\
784 \\pub fn dependencies(self: Capability) []const Extension {811 \\pub fn dependencies(self: Capability) []const Extension {
785 \\ return switch (self) {812 \\ return switch (self) {
786 );813 );
787
788 for (enum_indices) |i| {814 for (enum_indices) |i| {
789 const enumerant = enumerants[i];815 const enumerant = enumerants[i];
790 if (!isAllowedCapability(enumerant.enumerant)) continue;
791
792 // Convert version to enum.
793 // None is for reserved
794 // Example: "None" -> .v1_0
795 // Example: "1.5" -> .v1_5
796 const enum_version = enumerant.version.?;816 const enum_version = enumerant.version.?;
797 const version: [4]u8 = .{ 'v', '1', '_', if (enum_version[0] == 'N') '0' else enum_version[2] };817 const minor = if (enum_version[0] == 'N') '0' else enum_version[2];
798818 try writer.print("\n.{f} => &.{{.v1_{c}", .{ formatId(enumerant.enumerant), minor });
799 try writer.print("\n.{f} => &.{{.{s},", .{ formatId(enumerant.enumerant), version });
800 for (enumerant.extensions) |extension| {819 for (enumerant.extensions) |extension| {
801 if (!isAllowedExtension(extension)) continue;820 if (!isAllowedExtension(extension)) continue;
802 try writer.print(".{s},", .{extension});821 try writer.print(", .{s}", .{extension});
803 }822 }
804 try writer.writeAll("},");823 try writer.writeAll("},");
805 }824 }
806
807 try writer.writeAll(825 try writer.writeAll(
808 \\};826 \\};
809 \\}827 \\}
...@@ -834,22 +852,20 @@ fn renderBitEnum(...@@ -834,22 +852,20 @@ fn renderBitEnum(
834 enumeration: OperandKind,852 enumeration: OperandKind,
835 extended_structs: ExtendedStructSet,853 extended_structs: ExtendedStructSet,
836) !void {854) !void {
837 try writer.print("pub const {f} = packed struct {{\n", .{std.zig.fmtId(enumeration.kind)});855 try writer.print("pub const {f} = packed struct(Word) {{\n", .{std.zig.fmtId(enumeration.kind)});
838856
839 var flags_by_bitpos: [32]?usize = @splat(null);857 var flags_by_bitpos: [32]?usize = @splat(null);
840 const enumerants = enumeration.enumerants orelse return error.InvalidRegistry;858 const enumerants = enumeration.enumerants orelse return error.InvalidRegistry;
841859
842 var aliases = std.array_list.Managed(struct { flag: usize, alias: u5 }).init(arena);860 var aliases: std.ArrayList(struct { flag: usize, alias: u5 }) = .empty;
843 try aliases.ensureTotalCapacity(enumerants.len);861 try aliases.ensureTotalCapacity(arena, enumerants.len);
844862
845 for (enumerants, 0..) |enumerant, i| {863 for (enumerants, 0..) |enumerant, i| {
846 if (enumerant.value != .bitflag) return error.InvalidRegistry;864 if (enumerant.value != .bitflag) return error.InvalidRegistry;
847 const value = try parseHexInt(enumerant.value.bitflag);865 const value = try parseHexInt(enumerant.value.bitflag);
848 if (value == 0) {866 if (value == 0) {
849 continue; // Skip 'none' items867 continue;
850 } else if (std.mem.eql(u8, enumerant.enumerant, "FlagIsPublic")) {868 } else if (std.mem.eql(u8, enumerant.enumerant, "FlagIsPublic")) {
851 // This flag is special and poorly defined in the json files.
852 // Just skip it for now
853 continue;869 continue;
854 }870 }
855871
...@@ -872,14 +888,14 @@ fn renderBitEnum(...@@ -872,14 +888,14 @@ fn renderBitEnum(
872 }888 }
873 }889 }
874890
875 for (flags_by_bitpos, 0..) |maybe_flag_index, bitpos| {891 var bitpos: usize = 0;
876 if (maybe_flag_index) |flag_index| {892 while (bitpos < flags_by_bitpos.len) {
877 try writer.print("{f}", .{formatId(enumerants[flag_index].enumerant)});893 const flag_index = flags_by_bitpos[bitpos] orelse {
878 } else {894 bitpos = try renderReservedBits(writer, flags_by_bitpos, bitpos);
879 try writer.print("_reserved_bit_{}", .{bitpos});895 continue;
880 }896 };
881897 try writer.print("{f}: bool = false,\n", .{formatId(enumerants[flag_index].enumerant)});
882 try writer.writeAll(": bool = false,\n");898 bitpos += 1;
883 }899 }
884900
885 try writer.writeByte('\n');901 try writer.writeByte('\n');
...@@ -899,19 +915,31 @@ fn renderBitEnum(...@@ -899,19 +915,31 @@ fn renderBitEnum(
899915
900 try writer.print("\npub const Extended = struct {{\n", .{});916 try writer.print("\npub const Extended = struct {{\n", .{});
901917
902 for (flags_by_bitpos, 0..) |maybe_flag_index, bitpos| {918 bitpos = 0;
903 const flag_index = maybe_flag_index orelse {919 while (bitpos < flags_by_bitpos.len) {
904 try writer.print("_reserved_bit_{}: bool = false,\n", .{bitpos});920 const flag_index = flags_by_bitpos[bitpos] orelse {
921 bitpos = try renderReservedBits(writer, flags_by_bitpos, bitpos);
905 continue;922 continue;
906 };923 };
907 const enumerant = enumerants[flag_index];924 const enumerant = enumerants[flag_index];
908
909 try renderOperand(writer, .mask, enumerant.enumerant, enumerant.parameters, extended_structs, true);925 try renderOperand(writer, .mask, enumerant.enumerant, enumerant.parameters, extended_structs, true);
926 bitpos += 1;
910 }927 }
911928
912 try writer.writeAll("};\n};\n");929 try writer.writeAll("};\n};\n");
913}930}
914931
932fn renderReservedBits(writer: *std.Io.Writer, flags_by_bitpos: [32]?usize, start: usize) !usize {
933 var end = start + 1;
934 while (end < flags_by_bitpos.len and flags_by_bitpos[end] == null) end += 1;
935 if (end == start + 1) {
936 try writer.print("_reserved_bit_{}: bool = false,\n", .{start});
937 } else {
938 try writer.print("_reserved_bits_{}_to_{}: u{} = 0,\n", .{ start, end - 1, end - start });
939 }
940 return end;
941}
942
915fn renderOperand(943fn renderOperand(
916 writer: *std.Io.Writer,944 writer: *std.Io.Writer,
917 kind: enum {945 kind: enum {
...@@ -1001,8 +1029,6 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde...@@ -1001,8 +1029,6 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde
1001 const operand = operands[field_index];1029 const operand = operands[field_index];
10021030
1003 derive_from_kind: {1031 derive_from_kind: {
1004 // Operand names are often in the json encoded as "'Name'" (with two sets of quotes).
1005 // Additionally, some operands have ~ in them at the end (D~ref~).
1006 const name = std.mem.trim(u8, operand.name, "'~");1032 const name = std.mem.trim(u8, operand.name, "'~");
1007 if (name.len == 0) break :derive_from_kind;1033 if (name.len == 0) break :derive_from_kind;
10081034
...@@ -1019,8 +1045,6 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde...@@ -1019,8 +1045,6 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde
10191045
1020 try writer.print("{f}", .{formatId(operand.kind)});1046 try writer.print("{f}", .{formatId(operand.kind)});
10211047
1022 // For fields derived from type name, there could be any amount.
1023 // Simply check against all other fields, and if another similar one exists, add a number.
1024 const need_extra_index = for (operands, 0..) |other_operand, i| {1048 const need_extra_index = for (operands, 0..) |other_operand, i| {
1025 if (i != field_index and std.mem.eql(u8, operand.kind, other_operand.kind)) {1049 if (i != field_index and std.mem.eql(u8, operand.kind, other_operand.kind)) {
1026 break true;1050 break true;
...@@ -1032,6 +1056,62 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde...@@ -1032,6 +1056,62 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde
1032 }1056 }
1033}1057}
10341058
1059fn isAllowedCapability(name: []const u8) bool {
1060 const last = name[name.len - 1];
1061 if (std.ascii.isLower(last) or std.ascii.isDigit(last)) return true;
1062 for (allowed_vendors) |vendor| {
1063 if (std.mem.endsWith(u8, name, vendor)) return true;
1064 }
1065 return false;
1066}
1067
1068fn isAllowedExtension(name: []const u8) bool {
1069 const spv_prefix = "SPV_";
1070 if (!std.mem.startsWith(u8, name, spv_prefix)) return false;
1071 const tail = name[spv_prefix.len..];
1072 for (allowed_vendors) |vendor| {
1073 if (std.mem.startsWith(u8, tail, vendor) and
1074 tail.len > vendor.len and tail[vendor.len] == '_')
1075 return true;
1076 }
1077 return false;
1078}
1079
1080fn isEnabled(version: ?[]const u8, capabilities: []const []const u8, extensions: []const []const u8) bool {
1081 if (version) |v| if (!std.mem.eql(u8, v, "None")) return true;
1082 if (extensions.len != 0) {
1083 for (extensions) |ext| if (isAllowedExtension(ext)) return true;
1084 return false;
1085 }
1086 if (capabilities.len == 0) return true;
1087 for (capabilities) |cap| if (isAllowedCapability(cap)) return true;
1088 return false;
1089}
1090
1091fn keepEnabled(instructions: *[]Instruction, kinds: []OperandKind) void {
1092 var kept: usize = 0;
1093 for (instructions.*) |inst| {
1094 if (!isEnabled(inst.version, inst.capabilities, inst.extensions)) continue;
1095 instructions.*[kept] = inst;
1096 kept += 1;
1097 }
1098 instructions.* = instructions.*[0..kept];
1099 for (kinds) |*kind| {
1100 const enumerants = kind.enumerants orelse continue;
1101 var kept_enumerants: usize = 0;
1102 for (enumerants) |enumerant| {
1103 const enabled = if (std.mem.eql(u8, kind.kind, "Capability"))
1104 isAllowedCapability(enumerant.enumerant)
1105 else
1106 isEnabled(enumerant.version, enumerant.capabilities, enumerant.extensions);
1107 if (!enabled) continue;
1108 enumerants[kept_enumerants] = enumerant;
1109 kept_enumerants += 1;
1110 }
1111 kind.enumerants = enumerants[0..kept_enumerants];
1112 }
1113}
1114
1035fn parseHexInt(text: []const u8) !u31 {1115fn parseHexInt(text: []const u8) !u31 {
1036 const prefix = "0x";1116 const prefix = "0x";
1037 if (!std.mem.startsWith(u8, text, prefix))1117 if (!std.mem.startsWith(u8, text, prefix))
...@@ -1043,11 +1123,11 @@ fn usageAndExit(arg0: []const u8, code: u8) noreturn {...@@ -1043,11 +1123,11 @@ fn usageAndExit(arg0: []const u8, code: u8) noreturn {
1043 const stderr = std.debug.lockStderr(&.{});1123 const stderr = std.debug.lockStderr(&.{});
1044 const w = &stderr.file_writer.interface;1124 const w = &stderr.file_writer.interface;
1045 w.print(1125 w.print(
1046 \\Usage: {s} <SPIRV-Headers repository path> <path/to/zig/src/codegen/spirv/extinst.zig.grammar.json>1126 \\Usage: {s} <SPIRV-Headers repository path>
1047 \\1127 \\
1048 \\Generates Zig bindings for SPIR-V specifications found in the SPIRV-Headers1128 \\Generates Zig bindings for SPIR-V specifications found in the SPIRV-Headers
1049 \\repository. The result, printed to stdout, should be used to update1129 \\repository. The result, printed to stdout, should be used to update
1050 \\files in src/codegen/spirv. Don't forget to format the output.1130 \\src/codegen/spirv/spec.zig.
1051 \\1131 \\
1052 \\<SPIRV-Headers repository path> should point to a clone of1132 \\<SPIRV-Headers repository path> should point to a clone of
1053 \\https://github.com/KhronosGroup/SPIRV-Headers/1133 \\https://github.com/KhronosGroup/SPIRV-Headers/
tools/unskip_spirv_tests.zig created+264
...@@ -0,0 +1,264 @@
1const std = @import("std");
2const Io = std.Io;
3const Allocator = std.mem.Allocator;
4const Ast = std.zig.Ast;
5
6const usage =
7 \\Usage: unskip_spirv_tests <zig> <test_runner> <test_cmd> [test/behavior/*.zig ...]
8 \\
9 \\For example:
10 \\zig run tools/unskip_spirv_tests.zig -- zig-out/bin/zig \
11 \\ ../zig-spirv-test-executor/src/test_runner.zig \
12 \\ ../zig-spirv-test-executor/zig-out/bin/zig-spirv-test-executor [files...]
13 \\
14 \\Runs every behavior test that is skipped on stage2_spirv in isolation and
15 \\removes the skip if the test passes.
16 \\
17;
18
19const Test = struct {
20 body: Ast.Node.Index,
21 name: []const u8,
22 skip: ?Ast.Node.Index,
23};
24
25pub fn main(init: std.process.Init) !void {
26 const io = init.io;
27 const arena = init.arena.allocator();
28
29 var args = try init.minimal.args.iterateAllocator(arena);
30 _ = args.skip();
31 const zig = args.next() orelse std.process.fatal(usage, .{});
32 const test_runner = args.next() orelse std.process.fatal(usage, .{});
33 const test_cmd = args.next() orelse std.process.fatal(usage, .{});
34
35 var files: std.ArrayList([]const u8) = .empty;
36 while (args.next()) |path| try files.append(arena, path);
37
38 if (files.items.len == 0) {
39 var dir = try Io.Dir.openDir(.cwd(), io, "test/behavior", .{ .iterate = true });
40 defer dir.close(io);
41
42 var it = dir.iterate();
43 while (try it.next(io)) |entry| {
44 if (entry.kind != .file or !std.mem.endsWith(u8, entry.name, ".zig")) continue;
45 const path = try std.fs.path.join(arena, &.{ "test/behavior", entry.name });
46 const source = try Io.Dir.readFileAlloc(.cwd(), io, path, arena, .unlimited);
47 if (std.mem.find(u8, source, "stage2_spirv") != null) {
48 try files.append(arena, path);
49 }
50 }
51 }
52
53 var stdout_buffer: [4096]u8 = undefined;
54 var stdout_writer = Io.File.stdout().writer(io, &stdout_buffer);
55 const stdout = &stdout_writer.interface;
56
57 const progress = std.Progress.start(io, .{ .estimated_total_items = files.items.len });
58 const cache_dir = init.environ_map.get("ZIG_LOCAL_CACHE_DIR") orelse ".zig-cache";
59 const variant_dir = try std.fs.path.join(arena, &.{ cache_dir, "unskip" });
60 try Io.Dir.createDirPath(.cwd(), io, variant_dir);
61
62 var failures: std.array_hash_map.String(std.ArrayList([]const u8)) = .empty;
63 var total_removed: usize = 0;
64 var files_changed: usize = 0;
65 for (files.items) |path| {
66 const basename = std.fs.path.basename(path);
67 const source = try Io.Dir.readFileAlloc(.cwd(), io, path, arena, .unlimited);
68 const ast = try Ast.parse(arena, try arena.dupeSentinel(u8, source, 0), .{});
69 if (ast.errors.len != 0) std.process.fatal("{s}: parse error", .{path});
70
71 var tests: std.ArrayList(Test) = .empty;
72 var skips: usize = 0;
73 for (ast.rootDecls()) |decl| {
74 if (ast.nodeTag(decl) != .test_decl) continue;
75 const name_token, const body = ast.nodeData(decl).opt_token_and_node;
76 const token = name_token.unwrap() orelse continue;
77 const name = if (ast.tokenTag(token) == .string_literal)
78 try std.zig.string_literal.parseAlloc(arena, ast.tokenSlice(token))
79 else
80 ast.tokenSlice(token);
81
82 var buffer: [2]Ast.Node.Index = undefined;
83 const skip: ?Ast.Node.Index = for (ast.blockStatements(&buffer, body) orelse &.{}) |statement| {
84 const if_full = ast.fullIf(statement) orelse continue;
85 if (ast.nodeTag(if_full.ast.cond_expr) != .equal_equal) continue;
86 _, const rhs = ast.nodeData(if_full.ast.cond_expr).node_and_node;
87 if (!std.mem.eql(u8, ast.getNodeSource(rhs), ".stage2_spirv")) continue;
88 if (ast.nodeTag(if_full.ast.then_expr) != .@"return") continue;
89 const value = ast.nodeData(if_full.ast.then_expr).opt_node.unwrap() orelse continue;
90 if (!std.mem.eql(u8, ast.getNodeSource(value), "error.SkipZigTest")) continue;
91 break statement;
92 } else null;
93 skips += @intFromBool(skip != null);
94
95 try tests.append(arena, .{ .body = body, .name = name, .skip = skip });
96 }
97
98 if (skips == 0) {
99 progress.completeOne();
100 continue;
101 }
102
103 const file_node = progress.start(basename, skips);
104 defer file_node.end();
105 const variant_path = try std.fs.path.join(arena, &.{ variant_dir, basename });
106
107 var removed: Ast.Render.Fixups = .{};
108 for (tests.items) |candidate| {
109 const skip = candidate.skip orelse continue;
110 const test_node = file_node.start(candidate.name, 0);
111 defer test_node.end();
112
113 var fixups: Ast.Render.Fixups = .{};
114 try fixups.omit_nodes.put(arena, skip, {});
115 for (tests.items) |other| {
116 if (other.body == candidate.body) continue;
117 try fixups.replace_nodes_with_string.put(arena, other.body, "{ return error.SkipZigTest; }");
118 }
119
120 var variant: Io.Writer.Allocating = .init(arena);
121 try ast.render(arena, &variant.writer, fixups);
122 try Io.Dir.writeFile(.cwd(), io, .{ .sub_path = variant_path, .data = variant.written() });
123
124 const signature: []const u8 = signature: {
125 const result = std.process.run(arena, io, .{
126 .argv = &.{
127 zig, "test", variant_path,
128 "--test-runner", test_runner, "-target",
129 "spirv64-vulkan", "-mcpu", "vulkan_v1_2+variable_pointers+int64",
130 "-fno-llvm", "--zig-lib-dir", "lib",
131 "--test-cmd", test_cmd, "--test-cmd-bin",
132 },
133 .timeout = .{ .duration = .{ .raw = .fromSeconds(120), .clock = .awake } },
134 .progress_node = test_node,
135 }) catch |err| switch (err) {
136 error.Timeout => break :signature "timeout",
137 else => |e| return e,
138 };
139
140 if (result.term.success()) {
141 try removed.omit_nodes.put(arena, skip, {});
142 std.debug.print("{s}: removed skip for {s}\n", .{ basename, candidate.name });
143 continue;
144 }
145
146 const output = try std.mem.concat(arena, u8, &.{ result.stdout, result.stderr });
147 var lines = std.mem.splitScalar(u8, output, '\n');
148 while (lines.next()) |line| {
149 const rest = std.mem.cutPrefix(u8, line, "error: line ") orelse continue;
150 const colon = std.mem.findScalar(u8, rest, ':') orelse continue;
151 if (!allDigits(rest[0..colon])) continue;
152 break :signature try normalize(arena, "spirv-val: ", rest[colon + 1 ..]);
153 }
154 lines.reset();
155
156 while (lines.next()) |line| {
157 const rest = std.mem.cutPrefix(u8, line, "thread ") orelse continue;
158 const panic = std.mem.find(u8, rest, " panic: ") orelse continue;
159 if (std.mem.findScalar(u8, rest[0..panic], ' ') != null) continue;
160 break :signature try normalize(arena, "panic: ", rest[panic + " panic: ".len ..]);
161 }
162 lines.reset();
163
164 while (lines.next()) |line| {
165 const marker = std.mem.find(u8, line, ": error: ") orelse continue;
166 const location = line[0..marker];
167 const line_colon = std.mem.findScalarLast(u8, location, ':') orelse continue;
168 const file_colon = std.mem.findScalarLast(u8, location[0..line_colon], ':') orelse continue;
169 if (std.mem.findScalar(u8, location[0..file_colon], ' ') != null) continue;
170 if (!allDigits(location[file_colon + 1 .. line_colon])) continue;
171 if (!allDigits(location[line_colon + 1 ..])) continue;
172 const message = line[marker + ": error: ".len ..];
173 break :signature try normalize(arena, "compile error: ", message);
174 }
175 lines.reset();
176
177 while (lines.next()) |line| {
178 const rest = std.mem.cutPrefix(u8, line, "error: ") orelse continue;
179 break :signature try normalize(arena, "error: ", rest);
180 }
181
182 if (std.mem.trim(u8, output, &std.ascii.whitespace).len > 0) {
183 break :signature "unknown failure (no error: line found)";
184 }
185 break :signature "no output";
186 };
187
188 const gop = try failures.getOrPut(arena, signature);
189 if (!gop.found_existing) gop.value_ptr.* = .empty;
190 const failed_test = try std.fmt.allocPrint(arena, "{s} :: {s}", .{ basename, candidate.name });
191 try gop.value_ptr.append(arena, failed_test);
192 }
193
194 std.debug.print("{s}: {d}/{d} skips removed\n", .{ basename, removed.omit_nodes.count(), skips });
195 Io.Dir.deleteFile(.cwd(), io, variant_path) catch {};
196 if (removed.omit_nodes.count() == 0) continue;
197
198 var final: Io.Writer.Allocating = .init(arena);
199 try ast.render(arena, &final.writer, removed);
200 const rendered = try Ast.parse(arena, try arena.dupeSentinel(u8, final.written(), 0), .{});
201 const formatted = try rendered.renderAlloc(arena);
202 try Io.Dir.writeFile(.cwd(), io, .{ .sub_path = path, .data = formatted });
203 total_removed += removed.omit_nodes.count();
204 files_changed += 1;
205 }
206
207 progress.end();
208
209 try stdout.print("\nDone: removed {d} spirv skips across {d} files\n", .{ total_removed, files_changed });
210 if (failures.count() > 0) {
211 var total_failures: usize = 0;
212 for (failures.values()) |failed_tests| total_failures += failed_tests.items.len;
213 try stdout.print("\nMost common blockers ({d} failing attempts, {d} unique signatures):\n", .{
214 total_failures,
215 failures.count(),
216 });
217
218 const Ctx = struct {
219 failed_tests: []const std.ArrayList([]const u8),
220
221 pub fn lessThan(ctx: @This(), a: usize, b: usize) bool {
222 return ctx.failed_tests[a].items.len > ctx.failed_tests[b].items.len;
223 }
224 };
225 failures.sort(Ctx{ .failed_tests = failures.values() });
226
227 for (failures.keys()[0..@min(failures.count(), 30)], failures.values()) |signature, failed_tests| {
228 const count = failed_tests.items.len;
229 const percent = @as(f64, @floatFromInt(count)) * 100 / @as(f64, @floatFromInt(total_failures));
230 try stdout.print("{d:4} ({d:5.1}%) {s}\n", .{ count, percent, signature });
231 for (failed_tests.items) |failed_test| try stdout.print(" {s}\n", .{failed_test});
232 }
233 }
234 try stdout.flush();
235}
236
237fn allDigits(text: []const u8) bool {
238 if (text.len == 0) return false;
239 for (text) |c| if (!std.ascii.isDigit(c)) return false;
240 return true;
241}
242
243fn normalize(arena: Allocator, prefix: []const u8, message: []const u8) ![]u8 {
244 const source = try arena.dupeSentinel(u8, std.mem.trim(u8, message, &std.ascii.whitespace), 0);
245 var out: std.ArrayList(u8) = .empty;
246 try out.appendSlice(arena, prefix);
247 var tokenizer: std.zig.Tokenizer = .init(source);
248 var end: usize = 0;
249 while (true) {
250 const token = tokenizer.next();
251 if (token.tag == .eof) break;
252 try out.appendSlice(arena, source[end..token.loc.start]);
253 end = token.loc.end;
254 const text = source[token.loc.start..token.loc.end];
255 try out.appendSlice(arena, switch (token.tag) {
256 .number_literal => "<n>",
257 .char_literal, .string_literal => "<str>",
258 .identifier => if (token.loc.start > 0 and source[token.loc.start - 1] == '%') "<id>" else text,
259 else => text,
260 });
261 }
262 try out.appendSlice(arena, source[end..]);
263 return out.items[0..@min(out.items.len, prefix.len + 200)];
264}