authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-24 17:48:39-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-11-24 17:48:39-05:00
log972c0402411e19064139bc872a55fff55fbd95d6
tree662b07eac29bdadba4128d0fb4e9863a7f684ce9
parenta3552a6c5083a4a58223b38bc20df4ada0c736c1
parentbd6a57109331a873bc3f73932a5b039152670ceb
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #13611 from Snektron/spirv-assembler

spirv: assembler

12 files changed, 5969 insertions(+), 405 deletions(-)

lib/std/builtin.zig+1-1
...@@ -168,7 +168,7 @@ pub const AddressSpace = enum {...@@ -168,7 +168,7 @@ pub const AddressSpace = enum {
168 gs,168 gs,
169 fs,169 fs,
170 ss,170 ss,
171 // GPU address spaces171 // GPU address spaces.
172 global,172 global,
173 constant,173 constant,
174 param,174 param,
lib/std/target.zig+3-1
...@@ -1179,10 +1179,12 @@ pub const Target = struct {...@@ -1179,10 +1179,12 @@ pub const Target = struct {
1179 /// Returns whether this architecture supports the address space1179 /// Returns whether this architecture supports the address space
1180 pub fn supportsAddressSpace(arch: Arch, address_space: std.builtin.AddressSpace) bool {1180 pub fn supportsAddressSpace(arch: Arch, address_space: std.builtin.AddressSpace) bool {
1181 const is_nvptx = arch == .nvptx or arch == .nvptx64;1181 const is_nvptx = arch == .nvptx or arch == .nvptx64;
1182 const is_spirv = arch == .spirv32 or arch == .spirv64;
1183 const is_gpu = is_nvptx or is_spirv or arch == .amdgcn;
1182 return switch (address_space) {1184 return switch (address_space) {
1183 .generic => true,1185 .generic => true,
1184 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,1186 .fs, .gs, .ss => arch == .x86_64 or arch == .x86,
1185 .global, .constant, .local, .shared => arch == .amdgcn or is_nvptx,1187 .global, .constant, .local, .shared => is_gpu,
1186 .param => is_nvptx,1188 .param => is_nvptx,
1187 };1189 };
1188 }1190 }
src/Sema.zig+5-1
...@@ -30928,10 +30928,14 @@ pub fn analyzeAddressSpace(...@@ -30928,10 +30928,14 @@ pub fn analyzeAddressSpace(
30928 const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace);30928 const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace);
30929 const target = sema.mod.getTarget();30929 const target = sema.mod.getTarget();
30930 const arch = target.cpu.arch;30930 const arch = target.cpu.arch;
30931
30931 const is_nv = arch == .nvptx or arch == .nvptx64;30932 const is_nv = arch == .nvptx or arch == .nvptx64;
30932 const is_gpu = is_nv or arch == .amdgcn;30933 const is_amd = arch == .amdgcn;
30934 const is_spirv = arch == .spirv32 or arch == .spirv64;
30935 const is_gpu = is_nv or is_amd or is_spirv;
3093330936
30934 const supported = switch (address_space) {30937 const supported = switch (address_space) {
30938 // TODO: on spir-v only when os is opencl.
30935 .generic => true,30939 .generic => true,
30936 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,30940 .gs, .fs, .ss => (arch == .x86 or arch == .x86_64) and ctx == .pointer,
30937 // TODO: check that .shared and .local are left uninitialized30941 // TODO: check that .shared and .local are left uninitialized
src/codegen/spirv.zig+306-94
...@@ -10,6 +10,7 @@ const Type = @import("../type.zig").Type;...@@ -10,6 +10,7 @@ const Type = @import("../type.zig").Type;
10const Value = @import("../value.zig").Value;10const Value = @import("../value.zig").Value;
11const LazySrcLoc = Module.LazySrcLoc;11const LazySrcLoc = Module.LazySrcLoc;
12const Air = @import("../Air.zig");12const Air = @import("../Air.zig");
13const Zir = @import("../Zir.zig");
13const Liveness = @import("../Liveness.zig");14const Liveness = @import("../Liveness.zig");
1415
15const spec = @import("spirv/spec.zig");16const spec = @import("spirv/spec.zig");
...@@ -22,6 +23,7 @@ const IdResultType = spec.IdResultType;...@@ -22,6 +23,7 @@ const IdResultType = spec.IdResultType;
22const SpvModule = @import("spirv/Module.zig");23const SpvModule = @import("spirv/Module.zig");
23const SpvSection = @import("spirv/Section.zig");24const SpvSection = @import("spirv/Section.zig");
24const SpvType = @import("spirv/type.zig").Type;25const SpvType = @import("spirv/type.zig").Type;
26const SpvAssembler = @import("spirv/Assembler.zig");
2527
26const InstMap = std.AutoHashMapUnmanaged(Air.Inst.Index, IdRef);28const InstMap = std.AutoHashMapUnmanaged(Air.Inst.Index, IdRef);
2729
...@@ -37,10 +39,13 @@ pub const BlockMap = std.AutoHashMapUnmanaged(Air.Inst.Index, struct {...@@ -37,10 +39,13 @@ pub const BlockMap = std.AutoHashMapUnmanaged(Air.Inst.Index, struct {
3739
38/// This structure is used to compile a declaration, and contains all relevant meta-information to deal with that.40/// This structure is used to compile a declaration, and contains all relevant meta-information to deal with that.
39pub const DeclGen = struct {41pub const DeclGen = struct {
42 /// A general-purpose allocator that can be used for any allocations for this DeclGen.
43 gpa: Allocator,
44
40 /// The Zig module that we are generating decls for.45 /// The Zig module that we are generating decls for.
41 module: *Module,46 module: *Module,
4247
43 /// The SPIR-V module code should be put in.48 /// The SPIR-V module that instructions should be emitted into.
44 spv: *SpvModule,49 spv: *SpvModule,
4550
46 /// The decl we are currently generating code for.51 /// The decl we are currently generating code for.
...@@ -71,18 +76,14 @@ pub const DeclGen = struct {...@@ -71,18 +76,14 @@ pub const DeclGen = struct {
71 /// The label of the SPIR-V block we are currently generating.76 /// The label of the SPIR-V block we are currently generating.
72 current_block_label_id: IdRef,77 current_block_label_id: IdRef,
7378
74 /// The actual instructions for this function. We need to declare all locals in79 /// The code (prologue and body) for the function we are currently generating code for.
75 /// the first block, and because we don't know which locals there are going to be,80 func: SpvModule.Fn = .{},
76 /// we're just going to generate everything after the locals-section in this array.
77 /// Note: It will not contain OpFunction, OpFunctionParameter, OpVariable and the
78 /// initial OpLabel. These will be generated into spv.sections.functions directly.
79 code: SpvSection = .{},
8081
81 /// If `gen` returned `Error.CodegenFail`, this contains an explanatory message.82 /// If `gen` returned `Error.CodegenFail`, this contains an explanatory message.
82 /// Memory is owned by `module.gpa`.83 /// Memory is owned by `module.gpa`.
83 error_msg: ?*Module.ErrorMsg,84 error_msg: ?*Module.ErrorMsg,
8485
85 /// Possible errors the `gen` function may return.86 /// Possible errors the `genDecl` function may return.
86 const Error = error{ CodegenFail, OutOfMemory };87 const Error = error{ CodegenFail, OutOfMemory };
8788
88 /// This structure is used to return information about a type typically used for89 /// This structure is used to return information about a type typically used for
...@@ -132,8 +133,9 @@ pub const DeclGen = struct {...@@ -132,8 +133,9 @@ pub const DeclGen = struct {
132133
133 /// Initialize the common resources of a DeclGen. Some fields are left uninitialized,134 /// Initialize the common resources of a DeclGen. Some fields are left uninitialized,
134 /// only set when `gen` is called.135 /// only set when `gen` is called.
135 pub fn init(module: *Module, spv: *SpvModule) DeclGen {136 pub fn init(allocator: Allocator, module: *Module, spv: *SpvModule) DeclGen {
136 return .{137 return .{
138 .gpa = allocator,
137 .module = module,139 .module = module,
138 .spv = spv,140 .spv = spv,
139 .decl = undefined,141 .decl = undefined,
...@@ -158,12 +160,19 @@ pub const DeclGen = struct {...@@ -158,12 +160,19 @@ pub const DeclGen = struct {
158 self.inst_results.clearRetainingCapacity();160 self.inst_results.clearRetainingCapacity();
159 self.blocks.clearRetainingCapacity();161 self.blocks.clearRetainingCapacity();
160 self.current_block_label_id = undefined;162 self.current_block_label_id = undefined;
161 self.code.reset();163 self.func.reset();
162 self.error_msg = null;164 self.error_msg = null;
163165
164 self.genDecl() catch |err| switch (err) {166 self.genDecl() catch |err| switch (err) {
165 error.CodegenFail => return self.error_msg,167 error.CodegenFail => return self.error_msg,
166 else => |others| return others,168 else => |others| {
169 // There might be an error that happened *after* self.error_msg
170 // was already allocated, so be sure to free it.
171 if (self.error_msg) |error_msg| {
172 error_msg.deinit(self.module.gpa);
173 }
174 return others;
175 },
167 };176 };
168177
169 return null;178 return null;
...@@ -171,18 +180,18 @@ pub const DeclGen = struct {...@@ -171,18 +180,18 @@ pub const DeclGen = struct {
171180
172 /// Free resources owned by the DeclGen.181 /// Free resources owned by the DeclGen.
173 pub fn deinit(self: *DeclGen) void {182 pub fn deinit(self: *DeclGen) void {
174 self.args.deinit(self.spv.gpa);183 self.args.deinit(self.gpa);
175 self.inst_results.deinit(self.spv.gpa);184 self.inst_results.deinit(self.gpa);
176 self.blocks.deinit(self.spv.gpa);185 self.blocks.deinit(self.gpa);
177 self.code.deinit(self.spv.gpa);186 self.func.deinit(self.gpa);
178 }187 }
179188
180 /// Return the target which we are currently compiling for.189 /// Return the target which we are currently compiling for.
181 fn getTarget(self: *DeclGen) std.Target {190 pub fn getTarget(self: *DeclGen) std.Target {
182 return self.module.getTarget();191 return self.module.getTarget();
183 }192 }
184193
185 fn fail(self: *DeclGen, comptime format: []const u8, args: anytype) Error {194 pub fn fail(self: *DeclGen, comptime format: []const u8, args: anytype) Error {
186 @setCold(true);195 @setCold(true);
187 const src = LazySrcLoc.nodeOffset(0);196 const src = LazySrcLoc.nodeOffset(0);
188 const src_loc = src.toSrcLoc(self.decl);197 const src_loc = src.toSrcLoc(self.decl);
...@@ -191,13 +200,8 @@ pub const DeclGen = struct {...@@ -191,13 +200,8 @@ pub const DeclGen = struct {
191 return error.CodegenFail;200 return error.CodegenFail;
192 }201 }
193202
194 fn todo(self: *DeclGen, comptime format: []const u8, args: anytype) Error {203 pub fn todo(self: *DeclGen, comptime format: []const u8, args: anytype) Error {
195 @setCold(true);204 return self.fail("TODO (SPIR-V): " ++ format, args);
196 const src = LazySrcLoc.nodeOffset(0);
197 const src_loc = src.toSrcLoc(self.decl);
198 assert(self.error_msg == null);
199 self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, "TODO (SPIR-V): " ++ format, args);
200 return error.CodegenFail;
201 }205 }
202206
203 /// Fetch the result-id for a previously generated instruction or constant.207 /// Fetch the result-id for a previously generated instruction or constant.
...@@ -214,7 +218,7 @@ pub const DeclGen = struct {...@@ -214,7 +218,7 @@ pub const DeclGen = struct {
214 /// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to218 /// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
215 /// keep track of the previous block.219 /// keep track of the previous block.
216 fn beginSpvBlock(self: *DeclGen, label_id: IdResult) !void {220 fn beginSpvBlock(self: *DeclGen, label_id: IdResult) !void {
217 try self.code.emit(self.spv.gpa, .OpLabel, .{ .id_result = label_id });221 try self.func.body.emit(self.spv.gpa, .OpLabel, .{ .id_result = label_id });
218 self.current_block_label_id = label_id.toRef();222 self.current_block_label_id = label_id.toRef();
219 }223 }
220224
...@@ -320,6 +324,17 @@ pub const DeclGen = struct {...@@ -320,6 +324,17 @@ pub const DeclGen = struct {
320 /// Generate a constant representing `val`.324 /// Generate a constant representing `val`.
321 /// TODO: Deduplication?325 /// TODO: Deduplication?
322 fn genConstant(self: *DeclGen, ty: Type, val: Value) Error!IdRef {326 fn genConstant(self: *DeclGen, ty: Type, val: Value) Error!IdRef {
327 if (ty.zigTypeTag() == .Fn) {
328 const fn_decl_index = switch (val.tag()) {
329 .extern_fn => val.castTag(.extern_fn).?.data.owner_decl,
330 .function => val.castTag(.function).?.data.owner_decl,
331 else => unreachable,
332 };
333 const decl = self.module.declPtr(fn_decl_index);
334 self.module.markDeclAlive(decl);
335 return decl.fn_link.spirv.id.toRef();
336 }
337
323 const target = self.getTarget();338 const target = self.getTarget();
324 const section = &self.spv.sections.types_globals_constants;339 const section = &self.spv.sections.types_globals_constants;
325 const result_id = self.spv.allocId();340 const result_id = self.spv.allocId();
...@@ -387,7 +402,27 @@ pub const DeclGen = struct {...@@ -387,7 +402,27 @@ pub const DeclGen = struct {
387 .value = value,402 .value = value,
388 });403 });
389 },404 },
405 .Vector => switch (val.tag()) {
406 .aggregate => {
407 const elem_vals = val.castTag(.aggregate).?.data;
408 const vector_len = @intCast(usize, ty.vectorLen());
409 const elem_ty = ty.elemType();
410
411 const elem_refs = try self.gpa.alloc(IdRef, vector_len);
412 defer self.gpa.free(elem_refs);
413 for (elem_refs) |*elem, i| {
414 elem.* = try self.genConstant(elem_ty, elem_vals[i]);
415 }
416 try section.emit(self.spv.gpa, .OpConstantComposite, .{
417 .id_result_type = result_type_id,
418 .id_result = result_id,
419 .constituents = elem_refs,
420 });
421 },
422 else => unreachable, // TODO
423 },
390 .Void => unreachable,424 .Void => unreachable,
425 .Fn => unreachable,
391 else => return self.todo("constant generation of type {}", .{ty.fmtDebug()}),426 else => return self.todo("constant generation of type {}", .{ty.fmtDebug()}),
392 }427 }
393428
...@@ -396,7 +431,8 @@ pub const DeclGen = struct {...@@ -396,7 +431,8 @@ pub const DeclGen = struct {
396431
397 /// Turn a Zig type into a SPIR-V Type, and return its type result-id.432 /// Turn a Zig type into a SPIR-V Type, and return its type result-id.
398 fn resolveTypeId(self: *DeclGen, ty: Type) !IdResultType {433 fn resolveTypeId(self: *DeclGen, ty: Type) !IdResultType {
399 return self.spv.typeResultId(try self.resolveType(ty));434 const type_ref = try self.resolveType(ty);
435 return self.spv.typeResultId(type_ref);
400 }436 }
401437
402 /// Turn a Zig type into a SPIR-V Type, and return a reference to it.438 /// Turn a Zig type into a SPIR-V Type, and return a reference to it.
...@@ -447,8 +483,8 @@ pub const DeclGen = struct {...@@ -447,8 +483,8 @@ pub const DeclGen = struct {
447 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));483 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));
448 },484 },
449 .Fn => blk: {485 .Fn => blk: {
450 // We only support zig-calling-convention functions, no varargs.486 // We only support C-calling-convention functions for now, no varargs.
451 if (ty.fnCallingConvention() != .Unspecified)487 if (ty.fnCallingConvention() != .C)
452 return self.fail("Unsupported calling convention for SPIR-V", .{});488 return self.fail("Unsupported calling convention for SPIR-V", .{});
453 if (ty.fnIsVarArgs())489 if (ty.fnIsVarArgs())
454 return self.fail("VarArgs functions are unsupported for SPIR-V", .{});490 return self.fail("VarArgs functions are unsupported for SPIR-V", .{});
...@@ -464,11 +500,19 @@ pub const DeclGen = struct {...@@ -464,11 +500,19 @@ pub const DeclGen = struct {
464 payload.* = .{ .return_type = return_type, .parameters = param_types };500 payload.* = .{ .return_type = return_type, .parameters = param_types };
465 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));501 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));
466 },502 },
467 .Pointer => {503 .Pointer => blk: {
468 // This type can now be properly implemented, but we still need to implement the storage classes as proper address spaces.504 const payload = try self.spv.arena.create(SpvType.Payload.Pointer);
469 return self.todo("Implement type Pointer properly", .{});505 payload.* = .{
506 .storage_class = spirvStorageClass(ty.ptrAddressSpace()),
507 .child_type = try self.resolveType(ty.elemType()),
508 .array_stride = 0,
509 // Note: only available in Kernels!
510 .alignment = null,
511 .max_byte_offset = null,
512 };
513 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));
470 },514 },
471 .Vector => {515 .Vector => blk: {
472 // Although not 100% the same, Zig vectors map quite neatly to SPIR-V vectors (including many integer and float operations516 // Although not 100% the same, Zig vectors map quite neatly to SPIR-V vectors (including many integer and float operations
473 // which work on them), so simply use those.517 // which work on them), so simply use those.
474 // Note: SPIR-V vectors only support bools, ints and floats, so pointer vectors need to be supported another way.518 // Note: SPIR-V vectors only support bools, ints and floats, so pointer vectors need to be supported another way.
...@@ -476,8 +520,14 @@ pub const DeclGen = struct {...@@ -476,8 +520,14 @@ pub const DeclGen = struct {
476 // TODO: The SPIR-V spec mentions that vector sizes may be quite restricted! look into which we can use, and whether OpTypeVector520 // TODO: The SPIR-V spec mentions that vector sizes may be quite restricted! look into which we can use, and whether OpTypeVector
477 // is adequate at all for this.521 // is adequate at all for this.
478522
479 // TODO: Vectors are not yet supported by the self-hosted compiler itself it seems.523 // TODO: Properly verify sizes and child type.
480 return self.todo("Implement type Vector", .{});524
525 const payload = try self.spv.arena.create(SpvType.Payload.Vector);
526 payload.* = .{
527 .component_type = try self.resolveType(ty.elemType()),
528 .component_count = @intCast(u32, ty.vectorLen()),
529 };
530 break :blk try self.spv.resolveType(SpvType.initPayload(&payload.base));
481 },531 },
482532
483 .Null,533 .Null,
...@@ -494,25 +544,14 @@ pub const DeclGen = struct {...@@ -494,25 +544,14 @@ pub const DeclGen = struct {
494 };544 };
495 }545 }
496546
497 /// SPIR-V requires pointers to have a storage class (address space), and so we have a special function for that.547 fn spirvStorageClass(as: std.builtin.AddressSpace) spec.StorageClass {
498 /// TODO: The result of this needs to be cached.548 return switch (as) {
499 fn genPointerType(self: *DeclGen, ty: Type, storage_class: spec.StorageClass) !IdResultType {549 .generic => .Generic, // TODO: Disallow?
500 assert(ty.zigTypeTag() == .Pointer);550 .gs, .fs, .ss => unreachable,
501551 .shared => .Workgroup,
502 const result_id = self.spv.allocId();552 .local => .Private,
503553 .global, .param, .constant => unreachable,
504 // TODO: There are many constraints which are ignored for now: We may only create pointers to certain types, and to other types554 };
505 // if more capabilities are enabled. For example, we may only create pointers to f16 if Float16Buffer is enabled.
506 // These also relates to the pointer's address space.
507 const child_id = try self.resolveTypeId(ty.elemType());
508
509 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpTypePointer, .{
510 .id_result = result_id,
511 .storage_class = storage_class,
512 .type = child_id.toRef(),
513 });
514
515 return result_id.toResultType();
516 }555 }
517556
518 fn genDecl(self: *DeclGen) !void {557 fn genDecl(self: *DeclGen) !void {
...@@ -522,7 +561,7 @@ pub const DeclGen = struct {...@@ -522,7 +561,7 @@ pub const DeclGen = struct {
522 if (decl.val.castTag(.function)) |_| {561 if (decl.val.castTag(.function)) |_| {
523 assert(decl.ty.zigTypeTag() == .Fn);562 assert(decl.ty.zigTypeTag() == .Fn);
524 const prototype_id = try self.resolveTypeId(decl.ty);563 const prototype_id = try self.resolveTypeId(decl.ty);
525 try self.spv.sections.functions.emit(self.spv.gpa, .OpFunction, .{564 try self.func.prologue.emit(self.spv.gpa, .OpFunction, .{
526 .id_result_type = try self.resolveTypeId(decl.ty.fnReturnType()),565 .id_result_type = try self.resolveTypeId(decl.ty.fnReturnType()),
527 .id_result = result_id,566 .id_result = result_id,
528 .function_control = .{}, // TODO: We can set inline here if the type requires it.567 .function_control = .{}, // TODO: We can set inline here if the type requires it.
...@@ -532,11 +571,11 @@ pub const DeclGen = struct {...@@ -532,11 +571,11 @@ pub const DeclGen = struct {
532 const params = decl.ty.fnParamLen();571 const params = decl.ty.fnParamLen();
533 var i: usize = 0;572 var i: usize = 0;
534573
535 try self.args.ensureUnusedCapacity(self.spv.gpa, params);574 try self.args.ensureUnusedCapacity(self.gpa, params);
536 while (i < params) : (i += 1) {575 while (i < params) : (i += 1) {
537 const param_type_id = try self.resolveTypeId(decl.ty.fnParamType(i));576 const param_type_id = try self.resolveTypeId(decl.ty.fnParamType(i));
538 const arg_result_id = self.spv.allocId();577 const arg_result_id = self.spv.allocId();
539 try self.spv.sections.functions.emit(self.spv.gpa, .OpFunctionParameter, .{578 try self.func.prologue.emit(self.spv.gpa, .OpFunctionParameter, .{
540 .id_result_type = param_type_id,579 .id_result_type = param_type_id,
541 .id_result = arg_result_id,580 .id_result = arg_result_id,
542 });581 });
...@@ -546,9 +585,9 @@ pub const DeclGen = struct {...@@ -546,9 +585,9 @@ pub const DeclGen = struct {
546 // TODO: This could probably be done in a better way...585 // TODO: This could probably be done in a better way...
547 const root_block_id = self.spv.allocId();586 const root_block_id = self.spv.allocId();
548587
549 // We need to generate the label directly in the functions section here because we're going to write the local variables after588 // The root block of a function declaration should appear before OpVariable instructions,
550 // here. Since we're not generating in self.code, we're just going to bypass self.beginSpvBlock here.589 // so it is generated into the function's prologue.
551 try self.spv.sections.functions.emit(self.spv.gpa, .OpLabel, .{590 try self.func.prologue.emit(self.spv.gpa, .OpLabel, .{
552 .id_result = root_block_id,591 .id_result = root_block_id,
553 });592 });
554 self.current_block_label_id = root_block_id.toRef();593 self.current_block_label_id = root_block_id.toRef();
...@@ -557,8 +596,8 @@ pub const DeclGen = struct {...@@ -557,8 +596,8 @@ pub const DeclGen = struct {
557 try self.genBody(main_body);596 try self.genBody(main_body);
558597
559 // Append the actual code into the functions section.598 // Append the actual code into the functions section.
560 try self.spv.sections.functions.append(self.spv.gpa, self.code);599 try self.func.body.emit(self.spv.gpa, .OpFunctionEnd, {});
561 try self.spv.sections.functions.emit(self.spv.gpa, .OpFunctionEnd, {});600 try self.spv.addFunction(self.func);
562 } else {601 } else {
563 // TODO602 // TODO
564 // return self.todo("generate decl type {}", .{decl.ty.zigTypeTag()});603 // return self.todo("generate decl type {}", .{decl.ty.zigTypeTag()});
...@@ -579,6 +618,8 @@ pub const DeclGen = struct {...@@ -579,6 +618,8 @@ pub const DeclGen = struct {
579 .sub, .subwrap => try self.airArithOp(inst, .OpFSub, .OpISub, .OpISub),618 .sub, .subwrap => try self.airArithOp(inst, .OpFSub, .OpISub, .OpISub),
580 .mul, .mulwrap => try self.airArithOp(inst, .OpFMul, .OpIMul, .OpIMul),619 .mul, .mulwrap => try self.airArithOp(inst, .OpFMul, .OpIMul, .OpIMul),
581620
621 .shuffle => try self.airShuffle(inst),
622
582 .bit_and => try self.airBinOpSimple(inst, .OpBitwiseAnd),623 .bit_and => try self.airBinOpSimple(inst, .OpBitwiseAnd),
583 .bit_or => try self.airBinOpSimple(inst, .OpBitwiseOr),624 .bit_or => try self.airBinOpSimple(inst, .OpBitwiseOr),
584 .xor => try self.airBinOpSimple(inst, .OpBitwiseXor),625 .xor => try self.airBinOpSimple(inst, .OpBitwiseXor),
...@@ -608,14 +649,18 @@ pub const DeclGen = struct {...@@ -608,14 +649,18 @@ pub const DeclGen = struct {
608 .ret => return self.airRet(inst),649 .ret => return self.airRet(inst),
609 .store => return self.airStore(inst),650 .store => return self.airStore(inst),
610 .unreach => return self.airUnreach(),651 .unreach => return self.airUnreach(),
652 .assembly => (try self.airAssembly(inst)) orelse return,
653
654 .dbg_var_ptr => return,
655 .dbg_var_val => return,
656 .dbg_block_begin => return,
657 .dbg_block_end => return,
611 // zig fmt: on658 // zig fmt: on
612659
613 else => |tag| return self.todo("implement AIR tag {s}", .{660 else => |tag| return self.todo("implement AIR tag {s}", .{@tagName(tag)}),
614 @tagName(tag),
615 }),
616 };661 };
617662
618 try self.inst_results.putNoClobber(self.spv.gpa, inst, result_id);663 try self.inst_results.putNoClobber(self.gpa, inst, result_id);
619 }664 }
620665
621 fn airBinOpSimple(self: *DeclGen, inst: Air.Inst.Index, comptime opcode: Opcode) !IdRef {666 fn airBinOpSimple(self: *DeclGen, inst: Air.Inst.Index, comptime opcode: Opcode) !IdRef {
...@@ -624,7 +669,7 @@ pub const DeclGen = struct {...@@ -624,7 +669,7 @@ pub const DeclGen = struct {
624 const rhs_id = try self.resolve(bin_op.rhs);669 const rhs_id = try self.resolve(bin_op.rhs);
625 const result_id = self.spv.allocId();670 const result_id = self.spv.allocId();
626 const result_type_id = try self.resolveTypeId(self.air.typeOfIndex(inst));671 const result_type_id = try self.resolveTypeId(self.air.typeOfIndex(inst));
627 try self.code.emit(self.spv.gpa, opcode, .{672 try self.func.body.emit(self.spv.gpa, opcode, .{
628 .id_result_type = result_type_id,673 .id_result_type = result_type_id,
629 .id_result = result_id,674 .id_result = result_id,
630 .operand_1 = lhs_id,675 .operand_1 = lhs_id,
...@@ -680,9 +725,9 @@ pub const DeclGen = struct {...@@ -680,9 +725,9 @@ pub const DeclGen = struct {
680 };725 };
681726
682 switch (opcode_index) {727 switch (opcode_index) {
683 0 => try self.code.emit(self.spv.gpa, fop, operands),728 0 => try self.func.body.emit(self.spv.gpa, fop, operands),
684 1 => try self.code.emit(self.spv.gpa, sop, operands),729 1 => try self.func.body.emit(self.spv.gpa, sop, operands),
685 2 => try self.code.emit(self.spv.gpa, uop, operands),730 2 => try self.func.body.emit(self.spv.gpa, uop, operands),
686 else => unreachable,731 else => unreachable,
687 }732 }
688 // TODO: Trap on overflow? Probably going to be annoying.733 // TODO: Trap on overflow? Probably going to be annoying.
...@@ -691,6 +736,41 @@ pub const DeclGen = struct {...@@ -691,6 +736,41 @@ pub const DeclGen = struct {
691 return result_id.toRef();736 return result_id.toRef();
692 }737 }
693738
739 fn airShuffle(self: *DeclGen, inst: Air.Inst.Index) !IdRef {
740 const ty = self.air.typeOfIndex(inst);
741 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
742 const extra = self.air.extraData(Air.Shuffle, ty_pl.payload).data;
743 const a = try self.resolve(extra.a);
744 const b = try self.resolve(extra.b);
745 const mask = self.air.values[extra.mask];
746 const mask_len = extra.mask_len;
747 const a_len = self.air.typeOf(extra.a).vectorLen();
748
749 const result_id = self.spv.allocId();
750 const result_type_id = try self.resolveTypeId(ty);
751 // Similar to LLVM, SPIR-V uses indices larger than the length of the first vector
752 // to index into the second vector.
753 try self.func.body.emitRaw(self.spv.gpa, .OpVectorShuffle, 4 + mask_len);
754 self.func.body.writeOperand(spec.IdResultType, result_type_id);
755 self.func.body.writeOperand(spec.IdResult, result_id);
756 self.func.body.writeOperand(spec.IdRef, a);
757 self.func.body.writeOperand(spec.IdRef, b);
758
759 var i: usize = 0;
760 while (i < mask_len) : (i += 1) {
761 var buf: Value.ElemValueBuffer = undefined;
762 const elem = mask.elemValueBuffer(self.module, i, &buf);
763 if (elem.isUndef()) {
764 self.func.body.writeOperand(spec.LiteralInteger, 0xFFFF_FFFF);
765 } else {
766 const int = elem.toSignedInt();
767 const unsigned = if (int >= 0) @intCast(u32, int) else @intCast(u32, ~int + a_len);
768 self.func.body.writeOperand(spec.LiteralInteger, unsigned);
769 }
770 }
771 return result_id.toRef();
772 }
773
694 fn airCmp(self: *DeclGen, inst: Air.Inst.Index, comptime fop: Opcode, comptime sop: Opcode, comptime uop: Opcode) !IdRef {774 fn airCmp(self: *DeclGen, inst: Air.Inst.Index, comptime fop: Opcode, comptime sop: Opcode, comptime uop: Opcode) !IdRef {
695 const bin_op = self.air.instructions.items(.data)[inst].bin_op;775 const bin_op = self.air.instructions.items(.data)[inst].bin_op;
696 const lhs_id = try self.resolve(bin_op.lhs);776 const lhs_id = try self.resolve(bin_op.lhs);
...@@ -727,9 +807,9 @@ pub const DeclGen = struct {...@@ -727,9 +807,9 @@ pub const DeclGen = struct {
727 };807 };
728808
729 switch (opcode_index) {809 switch (opcode_index) {
730 0 => try self.code.emit(self.spv.gpa, fop, operands),810 0 => try self.func.body.emit(self.spv.gpa, fop, operands),
731 1 => try self.code.emit(self.spv.gpa, sop, operands),811 1 => try self.func.body.emit(self.spv.gpa, sop, operands),
732 2 => try self.code.emit(self.spv.gpa, uop, operands),812 2 => try self.func.body.emit(self.spv.gpa, uop, operands),
733 else => unreachable,813 else => unreachable,
734 }814 }
735815
...@@ -741,7 +821,7 @@ pub const DeclGen = struct {...@@ -741,7 +821,7 @@ pub const DeclGen = struct {
741 const operand_id = try self.resolve(ty_op.operand);821 const operand_id = try self.resolve(ty_op.operand);
742 const result_id = self.spv.allocId();822 const result_id = self.spv.allocId();
743 const result_type_id = try self.resolveTypeId(Type.initTag(.bool));823 const result_type_id = try self.resolveTypeId(Type.initTag(.bool));
744 try self.code.emit(self.spv.gpa, .OpLogicalNot, .{824 try self.func.body.emit(self.spv.gpa, .OpLogicalNot, .{
745 .id_result_type = result_type_id,825 .id_result_type = result_type_id,
746 .id_result = result_id,826 .id_result = result_id,
747 .operand = operand_id,827 .operand = operand_id,
...@@ -751,13 +831,18 @@ pub const DeclGen = struct {...@@ -751,13 +831,18 @@ pub const DeclGen = struct {
751831
752 fn airAlloc(self: *DeclGen, inst: Air.Inst.Index) !IdRef {832 fn airAlloc(self: *DeclGen, inst: Air.Inst.Index) !IdRef {
753 const ty = self.air.typeOfIndex(inst);833 const ty = self.air.typeOfIndex(inst);
754 const storage_class = spec.StorageClass.Function;834 const result_type_id = try self.resolveTypeId(ty);
755 const result_type_id = try self.genPointerType(ty, storage_class);
756 const result_id = self.spv.allocId();835 const result_id = self.spv.allocId();
757836
758 // Rather than generating into code here, we're just going to generate directly into the functions section so that837 // Rather than generating into code here, we're just going to generate directly into the functions section so that
759 // variable declarations appear in the first block of the function.838 // variable declarations appear in the first block of the function.
760 try self.spv.sections.functions.emit(self.spv.gpa, .OpVariable, .{839 const storage_class = spirvStorageClass(ty.ptrAddressSpace());
840 const section = if (storage_class == .Function)
841 &self.func.prologue
842 else
843 &self.spv.sections.types_globals_constants;
844
845 try section.emit(self.spv.gpa, .OpVariable, .{
761 .id_result_type = result_type_id,846 .id_result_type = result_type_id,
762 .id_result = result_id,847 .id_result = result_id,
763 .storage_class = storage_class,848 .storage_class = storage_class,
...@@ -779,15 +864,15 @@ pub const DeclGen = struct {...@@ -779,15 +864,15 @@ pub const DeclGen = struct {
779 const label_id = self.spv.allocId();864 const label_id = self.spv.allocId();
780865
781 // 4 chosen as arbitrary initial capacity.866 // 4 chosen as arbitrary initial capacity.
782 var incoming_blocks = try std.ArrayListUnmanaged(IncomingBlock).initCapacity(self.spv.gpa, 4);867 var incoming_blocks = try std.ArrayListUnmanaged(IncomingBlock).initCapacity(self.gpa, 4);
783868
784 try self.blocks.putNoClobber(self.spv.gpa, inst, .{869 try self.blocks.putNoClobber(self.gpa, inst, .{
785 .label_id = label_id.toRef(),870 .label_id = label_id.toRef(),
786 .incoming_blocks = &incoming_blocks,871 .incoming_blocks = &incoming_blocks,
787 });872 });
788 defer {873 defer {
789 assert(self.blocks.remove(inst));874 assert(self.blocks.remove(inst));
790 incoming_blocks.deinit(self.spv.gpa);875 incoming_blocks.deinit(self.gpa);
791 }876 }
792877
793 const ty = self.air.typeOfIndex(inst);878 const ty = self.air.typeOfIndex(inst);
...@@ -807,15 +892,14 @@ pub const DeclGen = struct {...@@ -807,15 +892,14 @@ pub const DeclGen = struct {
807 const result_id = self.spv.allocId();892 const result_id = self.spv.allocId();
808893
809 // TODO: OpPhi is limited in the types that it may produce, such as pointers. Figure out which other types894 // TODO: OpPhi is limited in the types that it may produce, such as pointers. Figure out which other types
810 // are not allowed to be created from a phi node, and throw an error for those. For now, resolveTypeId already throws895 // are not allowed to be created from a phi node, and throw an error for those.
811 // an error for pointers.
812 const result_type_id = try self.resolveTypeId(ty);896 const result_type_id = try self.resolveTypeId(ty);
813 _ = result_type_id;897 _ = result_type_id;
814898
815 try self.code.emitRaw(self.spv.gpa, .OpPhi, 2 + @intCast(u16, incoming_blocks.items.len * 2)); // result type + result + variable/parent...899 try self.func.body.emitRaw(self.spv.gpa, .OpPhi, 2 + @intCast(u16, incoming_blocks.items.len * 2)); // result type + result + variable/parent...
816900
817 for (incoming_blocks.items) |incoming| {901 for (incoming_blocks.items) |incoming| {
818 self.code.writeOperand(spec.PairIdRefIdRef, .{ incoming.break_value_id, incoming.src_label_id });902 self.func.body.writeOperand(spec.PairIdRefIdRef, .{ incoming.break_value_id, incoming.src_label_id });
819 }903 }
820904
821 return result_id.toRef();905 return result_id.toRef();
...@@ -829,10 +913,10 @@ pub const DeclGen = struct {...@@ -829,10 +913,10 @@ pub const DeclGen = struct {
829 if (operand_ty.hasRuntimeBits()) {913 if (operand_ty.hasRuntimeBits()) {
830 const operand_id = try self.resolve(br.operand);914 const operand_id = try self.resolve(br.operand);
831 // current_block_label_id should not be undefined here, lest there is a br or br_void in the function's body.915 // current_block_label_id should not be undefined here, lest there is a br or br_void in the function's body.
832 try block.incoming_blocks.append(self.spv.gpa, .{ .src_label_id = self.current_block_label_id, .break_value_id = operand_id });916 try block.incoming_blocks.append(self.gpa, .{ .src_label_id = self.current_block_label_id, .break_value_id = operand_id });
833 }917 }
834918
835 try self.code.emit(self.spv.gpa, .OpBranch, .{ .target_label = block.label_id });919 try self.func.body.emit(self.spv.gpa, .OpBranch, .{ .target_label = block.label_id });
836 }920 }
837921
838 fn airCondBr(self: *DeclGen, inst: Air.Inst.Index) !void {922 fn airCondBr(self: *DeclGen, inst: Air.Inst.Index) !void {
...@@ -849,7 +933,7 @@ pub const DeclGen = struct {...@@ -849,7 +933,7 @@ pub const DeclGen = struct {
849 // TODO: We can generate OpSelectionMerge here if we know the target block that both of these will resolve to,933 // TODO: We can generate OpSelectionMerge here if we know the target block that both of these will resolve to,
850 // but i don't know if those will always resolve to the same block.934 // but i don't know if those will always resolve to the same block.
851935
852 try self.code.emit(self.spv.gpa, .OpBranchConditional, .{936 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
853 .condition = condition_id,937 .condition = condition_id,
854 .true_label = then_label_id.toRef(),938 .true_label = then_label_id.toRef(),
855 .false_label = else_label_id.toRef(),939 .false_label = else_label_id.toRef(),
...@@ -864,7 +948,7 @@ pub const DeclGen = struct {...@@ -864,7 +948,7 @@ pub const DeclGen = struct {
864 fn airDbgStmt(self: *DeclGen, inst: Air.Inst.Index) !void {948 fn airDbgStmt(self: *DeclGen, inst: Air.Inst.Index) !void {
865 const dbg_stmt = self.air.instructions.items(.data)[inst].dbg_stmt;949 const dbg_stmt = self.air.instructions.items(.data)[inst].dbg_stmt;
866 const src_fname_id = try self.spv.resolveSourceFileName(self.decl);950 const src_fname_id = try self.spv.resolveSourceFileName(self.decl);
867 try self.code.emit(self.spv.gpa, .OpLine, .{951 try self.func.body.emit(self.spv.gpa, .OpLine, .{
868 .file = src_fname_id,952 .file = src_fname_id,
869 .line = dbg_stmt.line,953 .line = dbg_stmt.line,
870 .column = dbg_stmt.column,954 .column = dbg_stmt.column,
...@@ -883,7 +967,7 @@ pub const DeclGen = struct {...@@ -883,7 +967,7 @@ pub const DeclGen = struct {
883 .Volatile = ty.isVolatilePtr(),967 .Volatile = ty.isVolatilePtr(),
884 };968 };
885969
886 try self.code.emit(self.spv.gpa, .OpLoad, .{970 try self.func.body.emit(self.spv.gpa, .OpLoad, .{
887 .id_result_type = result_type_id,971 .id_result_type = result_type_id,
888 .id_result = result_id,972 .id_result = result_id,
889 .pointer = operand_id,973 .pointer = operand_id,
...@@ -900,13 +984,13 @@ pub const DeclGen = struct {...@@ -900,13 +984,13 @@ pub const DeclGen = struct {
900 const loop_label_id = self.spv.allocId();984 const loop_label_id = self.spv.allocId();
901985
902 // Jump to the loop entry point986 // Jump to the loop entry point
903 try self.code.emit(self.spv.gpa, .OpBranch, .{ .target_label = loop_label_id.toRef() });987 try self.func.body.emit(self.spv.gpa, .OpBranch, .{ .target_label = loop_label_id.toRef() });
904988
905 // TODO: Look into OpLoopMerge.989 // TODO: Look into OpLoopMerge.
906 try self.beginSpvBlock(loop_label_id);990 try self.beginSpvBlock(loop_label_id);
907 try self.genBody(body);991 try self.genBody(body);
908992
909 try self.code.emit(self.spv.gpa, .OpBranch, .{ .target_label = loop_label_id.toRef() });993 try self.func.body.emit(self.spv.gpa, .OpBranch, .{ .target_label = loop_label_id.toRef() });
910 }994 }
911995
912 fn airRet(self: *DeclGen, inst: Air.Inst.Index) !void {996 fn airRet(self: *DeclGen, inst: Air.Inst.Index) !void {
...@@ -914,9 +998,9 @@ pub const DeclGen = struct {...@@ -914,9 +998,9 @@ pub const DeclGen = struct {
914 const operand_ty = self.air.typeOf(operand);998 const operand_ty = self.air.typeOf(operand);
915 if (operand_ty.hasRuntimeBits()) {999 if (operand_ty.hasRuntimeBits()) {
916 const operand_id = try self.resolve(operand);1000 const operand_id = try self.resolve(operand);
917 try self.code.emit(self.spv.gpa, .OpReturnValue, .{ .value = operand_id });1001 try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{ .value = operand_id });
918 } else {1002 } else {
919 try self.code.emit(self.spv.gpa, .OpReturn, {});1003 try self.func.body.emit(self.spv.gpa, .OpReturn, {});
920 }1004 }
921 }1005 }
9221006
...@@ -930,7 +1014,7 @@ pub const DeclGen = struct {...@@ -930,7 +1014,7 @@ pub const DeclGen = struct {
930 .Volatile = lhs_ty.isVolatilePtr(),1014 .Volatile = lhs_ty.isVolatilePtr(),
931 };1015 };
9321016
933 try self.code.emit(self.spv.gpa, .OpStore, .{1017 try self.func.body.emit(self.spv.gpa, .OpStore, .{
934 .pointer = dst_ptr_id,1018 .pointer = dst_ptr_id,
935 .object = src_val_id,1019 .object = src_val_id,
936 .memory_access = access,1020 .memory_access = access,
...@@ -938,6 +1022,134 @@ pub const DeclGen = struct {...@@ -938,6 +1022,134 @@ pub const DeclGen = struct {
938 }1022 }
9391023
940 fn airUnreach(self: *DeclGen) !void {1024 fn airUnreach(self: *DeclGen) !void {
941 try self.code.emit(self.spv.gpa, .OpUnreachable, {});1025 try self.func.body.emit(self.spv.gpa, .OpUnreachable, {});
1026 }
1027
1028 fn airAssembly(self: *DeclGen, inst: Air.Inst.Index) !?IdRef {
1029 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
1030 const extra = self.air.extraData(Air.Asm, ty_pl.payload);
1031
1032 const is_volatile = @truncate(u1, extra.data.flags >> 31) != 0;
1033 const clobbers_len = @truncate(u31, extra.data.flags);
1034
1035 if (!is_volatile and self.liveness.isUnused(inst)) return null;
1036
1037 var extra_i: usize = extra.end;
1038 const outputs = @ptrCast([]const Air.Inst.Ref, self.air.extra[extra_i..][0..extra.data.outputs_len]);
1039 extra_i += outputs.len;
1040 const inputs = @ptrCast([]const Air.Inst.Ref, self.air.extra[extra_i..][0..extra.data.inputs_len]);
1041 extra_i += inputs.len;
1042
1043 if (outputs.len > 1) {
1044 return self.todo("implement inline asm with more than 1 output", .{});
1045 }
1046
1047 var output_extra_i = extra_i;
1048 for (outputs) |output| {
1049 if (output != .none) {
1050 return self.todo("implement inline asm with non-returned output", .{});
1051 }
1052 const extra_bytes = std.mem.sliceAsBytes(self.air.extra[extra_i..]);
1053 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(self.air.extra[extra_i..]), 0);
1054 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
1055 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
1056 // TODO: Record output and use it somewhere.
1057 }
1058
1059 var input_extra_i = extra_i;
1060 for (inputs) |input| {
1061 const extra_bytes = std.mem.sliceAsBytes(self.air.extra[extra_i..]);
1062 const constraint = std.mem.sliceTo(extra_bytes, 0);
1063 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
1064 // This equation accounts for the fact that even if we have exactly 4 bytes
1065 // for the string, we still use the next u32 for the null terminator.
1066 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
1067 // TODO: Record input and use it somewhere.
1068 _ = input;
1069 }
1070
1071 {
1072 var clobber_i: u32 = 0;
1073 while (clobber_i < clobbers_len) : (clobber_i += 1) {
1074 const clobber = std.mem.sliceTo(std.mem.sliceAsBytes(self.air.extra[extra_i..]), 0);
1075 extra_i += clobber.len / 4 + 1;
1076 // TODO: Record clobber and use it somewhere.
1077 }
1078 }
1079
1080 const asm_source = std.mem.sliceAsBytes(self.air.extra[extra_i..])[0..extra.data.source_len];
1081
1082 var as = SpvAssembler{
1083 .gpa = self.gpa,
1084 .src = asm_source,
1085 .spv = self.spv,
1086 .func = &self.func,
1087 };
1088 defer as.deinit();
1089
1090 for (inputs) |input| {
1091 const extra_bytes = std.mem.sliceAsBytes(self.air.extra[input_extra_i..]);
1092 const constraint = std.mem.sliceTo(extra_bytes, 0);
1093 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
1094 // This equation accounts for the fact that even if we have exactly 4 bytes
1095 // for the string, we still use the next u32 for the null terminator.
1096 input_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
1097
1098 const value = try self.resolve(input);
1099 try as.value_map.put(as.gpa, name, .{ .value = value });
1100 }
1101
1102 as.assemble() catch |err| switch (err) {
1103 error.AssembleFail => {
1104 // TODO: For now the compiler only supports a single error message per decl,
1105 // so to translate the possible multiple errors from the assembler, emit
1106 // them as notes here.
1107 // TODO: Translate proper error locations.
1108 assert(as.errors.items.len != 0);
1109 assert(self.error_msg == null);
1110 const loc = LazySrcLoc.nodeOffset(0);
1111 const src_loc = loc.toSrcLoc(self.decl);
1112 self.error_msg = try Module.ErrorMsg.create(self.module.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
1113 const notes = try self.module.gpa.alloc(Module.ErrorMsg, as.errors.items.len);
1114
1115 // Sub-scope to prevent `return error.CodegenFail` from running the errdefers.
1116 {
1117 errdefer self.module.gpa.free(notes);
1118 var i: usize = 0;
1119 errdefer for (notes[0..i]) |*note| {
1120 note.deinit(self.module.gpa);
1121 };
1122
1123 while (i < as.errors.items.len) : (i += 1) {
1124 notes[i] = try Module.ErrorMsg.init(self.module.gpa, src_loc, "{s}", .{as.errors.items[i].msg});
1125 }
1126 }
1127 self.error_msg.?.notes = notes;
1128 return error.CodegenFail;
1129 },
1130 else => |others| return others,
1131 };
1132
1133 for (outputs) |output| {
1134 _ = output;
1135 const extra_bytes = std.mem.sliceAsBytes(self.air.extra[output_extra_i..]);
1136 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(self.air.extra[output_extra_i..]), 0);
1137 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
1138 output_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
1139
1140 const result = as.value_map.get(name) orelse return {
1141 return self.fail("invalid asm output '{s}'", .{name});
1142 };
1143
1144 switch (result) {
1145 .just_declared, .unresolved_forward_reference => unreachable,
1146 .ty => return self.fail("cannot return spir-v type as value from assembly", .{}),
1147 .value => |ref| return ref,
1148 }
1149
1150 // TODO: Multiple results
1151 }
1152
1153 return null;
942 }1154 }
943};1155};
src/codegen/spirv/Assembler.zig created+1017
...@@ -0,0 +1,1017 @@
1const Assembler = @This();
2
3const std = @import("std");
4const Allocator = std.mem.Allocator;
5const assert = std.debug.assert;
6
7const spec = @import("spec.zig");
8const Opcode = spec.Opcode;
9const Word = spec.Word;
10const IdRef = spec.IdRef;
11const IdResult = spec.IdResult;
12
13const SpvModule = @import("Module.zig");
14const SpvType = @import("type.zig").Type;
15
16/// Represents a token in the assembly template.
17const Token = struct {
18 tag: Tag,
19 start: u32,
20 end: u32,
21
22 const Tag = enum {
23 /// Returned when there was no more input to match.
24 eof,
25 /// %identifier
26 result_id,
27 /// %identifier when appearing on the LHS of an equals sign.
28 /// While not technically a token, its relatively easy to resolve
29 /// this during lexical analysis and relieves a bunch of headaches
30 /// during parsing.
31 result_id_assign,
32 /// Mask, int, or float. These are grouped together as some
33 /// SPIR-V enumerants look a bit like integers as well (for example
34 /// "3D"), and so it is easier to just interpret them as the expected
35 /// type when resolving an instruction's operands.
36 value,
37 /// An enumerant that looks like an opcode, that is, OpXxxx.
38 /// Not necessarily a *valid* opcode.
39 opcode,
40 /// String literals.
41 /// Note, this token is also returned for unterminated
42 /// strings. In this case the closing " is not present.
43 string,
44 /// |.
45 pipe,
46 /// =.
47 equals,
48
49 fn name(self: Tag) []const u8 {
50 return switch (self) {
51 .eof => "<end of input>",
52 .result_id => "<result-id>",
53 .result_id_assign => "<assigned result-id>",
54 .value => "<value>",
55 .opcode => "<opcode>",
56 .string => "<string literal>",
57 .pipe => "'|'",
58 .equals => "'='",
59 };
60 }
61 };
62};
63
64/// This union represents utility information for a decoded operand.
65/// Note that this union only needs to maintain a minimal amount of
66/// bookkeeping: these values are enough to either decode the operands
67/// into a spec type, or emit it directly into its binary form.
68const Operand = union(enum) {
69 /// Any 'simple' 32-bit value. This could be a mask or
70 /// enumerant, etc, depending on the operands.
71 value: u32,
72
73 /// An int- or float literal encoded as 1 word. This may be
74 /// a 32-bit literal or smaller, already in the proper format:
75 /// the opper bits are 0 for floats and unsigned ints, and sign-extended
76 /// for signed ints.
77 literal32: u32,
78
79 /// An int- or float literal encoded as 2 words. This may be a 33-bit
80 /// to 64 bit literal, already in the proper format:
81 /// the opper bits are 0 for floats and unsigned ints, and sign-extended
82 /// for signed ints.
83 literal64: u64,
84
85 /// A result-id which is assigned to in this instruction. If present,
86 /// this is the first operand of the instruction.
87 result_id: AsmValue.Ref,
88
89 /// A result-id which referred to (not assigned to) in this instruction.
90 ref_id: AsmValue.Ref,
91
92 /// Offset into `inst.string_bytes`. The string ends at the next zero-terminator.
93 string: u32,
94};
95
96/// A structure representing an error message that the assembler may return, when
97/// the assembly source is not syntactically or semantically correct.
98const ErrorMsg = struct {
99 /// The offset in bytes from the start of `src` that this error occured.
100 byte_offset: u32,
101 /// An explanatory error message.
102 /// Memory is owned by `self.gpa`. TODO: Maybe allocate this with an arena
103 /// allocator if it is needed elsewhere?
104 msg: []const u8,
105};
106
107/// Possible errors the `assemble` function may return.
108const Error = error{ AssembleFail, OutOfMemory };
109
110/// This union is used to keep track of results of spir-v instructions. This can either be just a plain
111/// result-id, in the case of most instructions, or for example a type that is constructed from
112/// an OpTypeXxx instruction.
113const AsmValue = union(enum) {
114 /// The results are stored in an array hash map, and can be referred to either by name (without the %),
115 /// or by values of this index type.
116 pub const Ref = u32;
117
118 /// This result-value is the RHS of the current instruction.
119 just_declared,
120
121 /// This is used as placeholder for ref-ids of which the result-id is not yet known.
122 /// It will be further resolved at a later stage to a more concrete forward reference.
123 unresolved_forward_reference,
124
125 /// This result-value is a normal result produced by a different instruction.
126 value: IdRef,
127
128 /// This result-value represents a type registered into the module's type system.
129 ty: SpvType.Ref,
130
131 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue
132 /// is of a variant that allows the result to be obtained (not an unresolved
133 /// forward declaration, not in the process of being declared, etc).
134 pub fn resultId(self: AsmValue, spv: *const SpvModule) IdRef {
135 return switch (self) {
136 .just_declared, .unresolved_forward_reference => unreachable,
137 .value => |result| result,
138 .ty => |ref| spv.typeResultId(ref).toRef(),
139 };
140 }
141};
142
143/// This map type maps results to values. Results can be addressed either by name (without the %), or by
144/// AsmValue.Ref in AsmValueMap.keys/.values.
145const AsmValueMap = std.StringArrayHashMapUnmanaged(AsmValue);
146
147/// An allocator used for common allocations.
148gpa: Allocator,
149
150/// A list of errors that occured during processing the assembly.
151errors: std.ArrayListUnmanaged(ErrorMsg) = .{},
152
153/// The source code that is being assembled.
154src: []const u8,
155
156/// The module that this assembly is associated to.
157/// Instructions like OpType*, OpDecorate, etc are emitted into this module.
158spv: *SpvModule,
159
160/// The function that the function-specific instructions should be emitted to.
161func: *SpvModule.Fn,
162
163/// `self.src` tokenized.
164tokens: std.ArrayListUnmanaged(Token) = .{},
165
166/// The token that is next during parsing.
167current_token: u32 = 0,
168
169/// This field groups the properties of the instruction that is currently
170/// being parsed or has just been parsed.
171inst: struct {
172 /// The opcode of the current instruction.
173 opcode: Opcode = undefined,
174 /// Operands of the current instruction.
175 operands: std.ArrayListUnmanaged(Operand) = .{},
176 /// This is where string data resides. Strings are zero-terminated.
177 string_bytes: std.ArrayListUnmanaged(u8) = .{},
178
179 /// Return a reference to the result of this instruction, if any.
180 fn result(self: @This()) ?AsmValue.Ref {
181 // The result, if present, is either the first or second
182 // operand of an instruction.
183 for (self.operands.items[0..@min(self.operands.items.len, 2)]) |op| {
184 switch (op) {
185 .result_id => |index| return index,
186 else => {},
187 }
188 }
189 return null;
190 }
191} = .{},
192
193/// This map maps results to their tracked values.
194value_map: AsmValueMap = .{},
195
196/// Free the resources owned by this assembler.
197pub fn deinit(self: *Assembler) void {
198 for (self.errors.items) |err| {
199 self.gpa.free(err.msg);
200 }
201 self.tokens.deinit(self.gpa);
202 self.errors.deinit(self.gpa);
203 self.inst.operands.deinit(self.gpa);
204 self.inst.string_bytes.deinit(self.gpa);
205 self.value_map.deinit(self.gpa);
206}
207
208pub fn assemble(self: *Assembler) Error!void {
209 try self.tokenize();
210 while (!self.testToken(.eof)) {
211 try self.parseInstruction();
212 try self.processInstruction();
213 }
214 if (self.errors.items.len > 0)
215 return error.AssembleFail;
216}
217
218fn addError(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) !void {
219 const msg = try std.fmt.allocPrint(self.gpa, fmt, args);
220 errdefer self.gpa.free(msg);
221 try self.errors.append(self.gpa, .{
222 .byte_offset = offset,
223 .msg = msg,
224 });
225}
226
227fn fail(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) Error {
228 try self.addError(offset, fmt, args);
229 return error.AssembleFail;
230}
231
232fn todo(self: *Assembler, comptime fmt: []const u8, args: anytype) Error {
233 return self.fail(0, "todo: " ++ fmt, args);
234}
235
236/// Attempt to process the instruction currently in `self.inst`.
237/// This for example emits the instruction in the module or function, or
238/// records type definitions.
239/// If this function returns `error.AssembleFail`, an explanatory
240/// error message has already been emitted into `self.errors`.
241fn processInstruction(self: *Assembler) !void {
242 const result = switch (self.inst.opcode.class()) {
243 .TypeDeclaration => try self.processTypeInstruction(),
244 else => if (try self.processGenericInstruction()) |result|
245 result
246 else
247 return,
248 };
249
250 const result_ref = self.inst.result().?;
251 switch (self.value_map.values()[result_ref]) {
252 .just_declared => self.value_map.values()[result_ref] = result,
253 else => {
254 // TODO: Improve source location.
255 const name = self.value_map.keys()[result_ref];
256 return self.fail(0, "duplicate definition of %{s}", .{name});
257 },
258 }
259}
260
261/// Record `self.inst` into the module's type system, and return the AsmValue that
262/// refers to the result.
263fn processTypeInstruction(self: *Assembler) !AsmValue {
264 const operands = self.inst.operands.items;
265 const ty = switch (self.inst.opcode) {
266 .OpTypeVoid => SpvType.initTag(.void),
267 .OpTypeBool => SpvType.initTag(.bool),
268 .OpTypeInt => blk: {
269 const payload = try self.spv.arena.create(SpvType.Payload.Int);
270 const signedness: std.builtin.Signedness = switch (operands[2].literal32) {
271 0 => .unsigned,
272 1 => .signed,
273 else => {
274 // TODO: Improve source location.
275 return self.fail(0, "'{}' is not a valid signedness (expected 0 or 1)", .{operands[2].literal32});
276 },
277 };
278 payload.* = .{
279 .width = operands[1].literal32,
280 .signedness = signedness,
281 };
282 break :blk SpvType.initPayload(&payload.base);
283 },
284 .OpTypeFloat => blk: {
285 const payload = try self.spv.arena.create(SpvType.Payload.Float);
286 payload.* = .{
287 .width = operands[1].literal32,
288 };
289 break :blk SpvType.initPayload(&payload.base);
290 },
291 .OpTypeVector => blk: {
292 const payload = try self.spv.arena.create(SpvType.Payload.Vector);
293 payload.* = .{
294 .component_type = try self.resolveTypeRef(operands[1].ref_id),
295 .component_count = operands[2].literal32,
296 };
297 break :blk SpvType.initPayload(&payload.base);
298 },
299 .OpTypeMatrix => blk: {
300 const payload = try self.spv.arena.create(SpvType.Payload.Matrix);
301 payload.* = .{
302 .column_type = try self.resolveTypeRef(operands[1].ref_id),
303 .column_count = operands[2].literal32,
304 };
305 break :blk SpvType.initPayload(&payload.base);
306 },
307 .OpTypeImage => blk: {
308 const payload = try self.spv.arena.create(SpvType.Payload.Image);
309 payload.* = .{
310 .sampled_type = try self.resolveTypeRef(operands[1].ref_id),
311 .dim = @intToEnum(spec.Dim, operands[2].value),
312 .depth = switch (operands[3].literal32) {
313 0 => .no,
314 1 => .yes,
315 2 => .maybe,
316 else => {
317 return self.fail(0, "'{}' is not a valid image depth (expected 0, 1 or 2)", .{operands[3].literal32});
318 },
319 },
320 .arrayed = switch (operands[4].literal32) {
321 0 => false,
322 1 => true,
323 else => {
324 return self.fail(0, "'{}' is not a valid image arrayed-ness (expected 0 or 1)", .{operands[4].literal32});
325 },
326 },
327 .multisampled = switch (operands[5].literal32) {
328 0 => false,
329 1 => true,
330 else => {
331 return self.fail(0, "'{}' is not a valid image multisampled-ness (expected 0 or 1)", .{operands[5].literal32});
332 },
333 },
334 .sampled = switch (operands[6].literal32) {
335 0 => .known_at_runtime,
336 1 => .with_sampler,
337 2 => .without_sampler,
338 else => {
339 return self.fail(0, "'{}' is not a valid image sampled-ness (expected 0, 1 or 2)", .{operands[6].literal32});
340 },
341 },
342 .format = @intToEnum(spec.ImageFormat, operands[7].value),
343 .access_qualifier = if (operands.len > 8)
344 @intToEnum(spec.AccessQualifier, operands[8].value)
345 else
346 null,
347 };
348 break :blk SpvType.initPayload(&payload.base);
349 },
350 .OpTypeSampler => SpvType.initTag(.sampler),
351 .OpTypeSampledImage => blk: {
352 const payload = try self.spv.arena.create(SpvType.Payload.SampledImage);
353 payload.* = .{
354 .image_type = try self.resolveTypeRef(operands[1].ref_id),
355 };
356 break :blk SpvType.initPayload(&payload.base);
357 },
358 .OpTypeArray => {
359 // TODO: The length of an OpTypeArray is determined by a constant (which may be a spec constant),
360 // and so some consideration must be taken when entering this in the type system.
361 return self.todo("process OpTypeArray", .{});
362 },
363 .OpTypeRuntimeArray => blk: {
364 const payload = try self.spv.arena.create(SpvType.Payload.RuntimeArray);
365 payload.* = .{
366 .element_type = try self.resolveTypeRef(operands[1].ref_id),
367 // TODO: Fetch array stride from decorations.
368 .array_stride = 0,
369 };
370 break :blk SpvType.initPayload(&payload.base);
371 },
372 .OpTypeOpaque => blk: {
373 const payload = try self.spv.arena.create(SpvType.Payload.Opaque);
374 const name_offset = operands[1].string;
375 payload.* = .{
376 .name = std.mem.sliceTo(self.inst.string_bytes.items[name_offset..], 0),
377 };
378 break :blk SpvType.initPayload(&payload.base);
379 },
380 .OpTypePointer => blk: {
381 const payload = try self.spv.arena.create(SpvType.Payload.Pointer);
382 payload.* = .{
383 .storage_class = @intToEnum(spec.StorageClass, operands[1].value),
384 .child_type = try self.resolveTypeRef(operands[2].ref_id),
385 // TODO: Fetch these values from decorations.
386 .array_stride = 0,
387 .alignment = null,
388 .max_byte_offset = null,
389 };
390 break :blk SpvType.initPayload(&payload.base);
391 },
392 .OpTypeFunction => blk: {
393 const param_operands = operands[2..];
394 const param_types = try self.spv.arena.alloc(SpvType.Ref, param_operands.len);
395 for (param_types) |*param, i| {
396 param.* = try self.resolveTypeRef(param_operands[i].ref_id);
397 }
398 const payload = try self.spv.arena.create(SpvType.Payload.Function);
399 payload.* = .{
400 .return_type = try self.resolveTypeRef(operands[1].ref_id),
401 .parameters = param_types,
402 };
403 break :blk SpvType.initPayload(&payload.base);
404 },
405 .OpTypeEvent => SpvType.initTag(.event),
406 .OpTypeDeviceEvent => SpvType.initTag(.device_event),
407 .OpTypeReserveId => SpvType.initTag(.reserve_id),
408 .OpTypeQueue => SpvType.initTag(.queue),
409 .OpTypePipe => blk: {
410 const payload = try self.spv.arena.create(SpvType.Payload.Pipe);
411 payload.* = .{
412 .qualifier = @intToEnum(spec.AccessQualifier, operands[1].value),
413 };
414 break :blk SpvType.initPayload(&payload.base);
415 },
416 .OpTypePipeStorage => SpvType.initTag(.pipe_storage),
417 .OpTypeNamedBarrier => SpvType.initTag(.named_barrier),
418 else => return self.todo("process type instruction {s}", .{@tagName(self.inst.opcode)}),
419 };
420
421 const ref = try self.spv.resolveType(ty);
422 return AsmValue{ .ty = ref };
423}
424
425/// Emit `self.inst` into `self.spv` and `self.func`, and return the AsmValue
426/// that this produces (if any). This function processes common instructions:
427/// - No forward references are allowed in operands.
428/// - Target section is determined from instruction type.
429/// - Function-local instructions are emitted in `self.func`.
430fn processGenericInstruction(self: *Assembler) !?AsmValue {
431 const operands = self.inst.operands.items;
432 const section = switch (self.inst.opcode.class()) {
433 .ConstantCreation => &self.spv.sections.types_globals_constants,
434 .Annotation => &self.spv.sections.annotations,
435 .TypeDeclaration => unreachable, // Handled elsewhere.
436 else => switch (self.inst.opcode) {
437 .OpEntryPoint => &self.spv.sections.entry_points,
438 .OpExecutionMode, .OpExecutionModeId => &self.spv.sections.execution_modes,
439 .OpVariable => switch (@intToEnum(spec.StorageClass, operands[2].value)) {
440 .Function => &self.func.prologue,
441 else => &self.spv.sections.types_globals_constants,
442 },
443 // Default case - to be worked out further.
444 else => &self.func.body,
445 },
446 };
447
448 var maybe_result_id: ?IdResult = null;
449 const first_word = section.instructions.items.len;
450 // At this point we're not quite sure how many operands this instruction is going to have,
451 // so insert 0 and patch up the actual opcode word later.
452 try section.ensureUnusedCapacity(self.spv.gpa, 1);
453 section.writeWord(0);
454
455 for (operands) |operand| {
456 switch (operand) {
457 .value, .literal32 => |word| {
458 try section.ensureUnusedCapacity(self.spv.gpa, 1);
459 section.writeWord(word);
460 },
461 .literal64 => |dword| {
462 try section.ensureUnusedCapacity(self.spv.gpa, 2);
463 section.writeDoubleWord(dword);
464 },
465 .result_id => {
466 maybe_result_id = self.spv.allocId();
467 try section.ensureUnusedCapacity(self.spv.gpa, 1);
468 section.writeOperand(IdResult, maybe_result_id.?);
469 },
470 .ref_id => |index| {
471 const result = try self.resolveRef(index);
472 try section.ensureUnusedCapacity(self.spv.gpa, 1);
473 section.writeOperand(spec.IdRef, result.resultId(self.spv));
474 },
475 .string => |offset| {
476 const text = std.mem.sliceTo(self.inst.string_bytes.items[offset..], 0);
477 const size = std.math.divCeil(usize, text.len + 1, @sizeOf(Word)) catch unreachable;
478 try section.ensureUnusedCapacity(self.spv.gpa, size);
479 section.writeOperand(spec.LiteralString, text);
480 },
481 }
482 }
483
484 const actual_word_count = section.instructions.items.len - first_word;
485 section.instructions.items[first_word] |= @as(u32, @intCast(u16, actual_word_count)) << 16 | @enumToInt(self.inst.opcode);
486
487 if (maybe_result_id) |result| {
488 return AsmValue{ .value = result.toRef() };
489 }
490 return null;
491}
492
493/// Resolve a value reference. This function makes sure that the reference is
494/// not self-referential, but it does allow the result to be forward declared.
495fn resolveMaybeForwardRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
496 const value = self.value_map.values()[ref];
497 switch (value) {
498 .just_declared => {
499 const name = self.value_map.keys()[ref];
500 // TODO: Improve source location.
501 return self.fail(0, "self-referential parameter %{s}", .{name});
502 },
503 else => return value,
504 }
505}
506
507/// Resolve a value reference. This function
508/// makes sure that the result is not self-referential, nor that it is forward declared.
509fn resolveRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
510 const value = try self.resolveMaybeForwardRef(ref);
511 switch (value) {
512 .just_declared => unreachable,
513 .unresolved_forward_reference => {
514 const name = self.value_map.keys()[ref];
515 // TODO: Improve source location.
516 return self.fail(0, "reference to undeclared result-id %{s}", .{name});
517 },
518 else => return value,
519 }
520}
521
522/// Resolve a value reference as type.
523fn resolveTypeRef(self: *Assembler, ref: AsmValue.Ref) !SpvType.Ref {
524 const value = try self.resolveRef(ref);
525 switch (value) {
526 .just_declared, .unresolved_forward_reference => unreachable,
527 .ty => |ty_ref| return ty_ref,
528 else => {
529 const name = self.value_map.keys()[ref];
530 // TODO: Improve source location.
531 return self.fail(0, "expected operand %{s} to refer to a type", .{name});
532 },
533 }
534}
535
536/// Attempt to parse an instruction into `self.inst`.
537/// If this function returns `error.AssembleFail`, an explanatory
538/// error message has been emitted into `self.errors`.
539fn parseInstruction(self: *Assembler) !void {
540 self.inst.opcode = undefined;
541 self.inst.operands.shrinkRetainingCapacity(0);
542 self.inst.string_bytes.shrinkRetainingCapacity(0);
543
544 const lhs_result_tok = self.currentToken();
545 const maybe_lhs_result = if (self.eatToken(.result_id_assign)) blk: {
546 const name = self.tokenText(lhs_result_tok)[1..];
547 const entry = try self.value_map.getOrPut(self.gpa, name);
548 try self.expectToken(.equals);
549 if (!entry.found_existing) {
550 entry.value_ptr.* = .just_declared;
551 }
552 break :blk @intCast(AsmValue.Ref, entry.index);
553 } else null;
554
555 const opcode_tok = self.currentToken();
556 if (maybe_lhs_result != null) {
557 try self.expectToken(.opcode);
558 } else if (!self.eatToken(.opcode)) {
559 return self.fail(opcode_tok.start, "expected start of instruction, found {s}", .{opcode_tok.tag.name()});
560 }
561
562 const opcode_text = self.tokenText(opcode_tok);
563 @setEvalBranchQuota(10000);
564 self.inst.opcode = std.meta.stringToEnum(Opcode, opcode_text) orelse {
565 return self.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
566 };
567
568 const expected_operands = self.inst.opcode.operands();
569 // This is a loop because the result-id is not always the first operand.
570 const requires_lhs_result = for (expected_operands) |op| {
571 if (op.kind == .IdResult) break true;
572 } else false;
573
574 if (requires_lhs_result and maybe_lhs_result == null) {
575 return self.fail(opcode_tok.start, "opcode '{s}' expects result on left-hand side", .{@tagName(self.inst.opcode)});
576 } else if (!requires_lhs_result and maybe_lhs_result != null) {
577 return self.fail(
578 lhs_result_tok.start,
579 "opcode '{s}' does not expect a result-id on the left-hand side",
580 .{@tagName(self.inst.opcode)},
581 );
582 }
583
584 for (expected_operands) |operand| {
585 if (operand.kind == .IdResult) {
586 try self.inst.operands.append(self.gpa, .{ .result_id = maybe_lhs_result.? });
587 continue;
588 }
589
590 switch (operand.quantifier) {
591 .required => if (self.isAtInstructionBoundary()) {
592 return self.fail(
593 self.currentToken().start,
594 "missing required operand", // TODO: Operand name?
595 .{},
596 );
597 } else {
598 try self.parseOperand(operand.kind);
599 },
600 .optional => if (!self.isAtInstructionBoundary()) {
601 try self.parseOperand(operand.kind);
602 },
603 .variadic => while (!self.isAtInstructionBoundary()) {
604 try self.parseOperand(operand.kind);
605 },
606 }
607 }
608}
609
610/// Parse a single operand of a particular type.
611fn parseOperand(self: *Assembler, kind: spec.OperandKind) Error!void {
612 switch (kind.category()) {
613 .bit_enum => try self.parseBitEnum(kind),
614 .value_enum => try self.parseValueEnum(kind),
615 .id => try self.parseRefId(),
616 else => switch (kind) {
617 .LiteralInteger => try self.parseLiteralInteger(),
618 .LiteralString => try self.parseString(),
619 .LiteralContextDependentNumber => try self.parseContextDependentNumber(),
620 .PairIdRefIdRef => try self.parsePhiSource(),
621 else => return self.todo("parse operand of type {s}", .{@tagName(kind)}),
622 },
623 }
624}
625
626/// Also handles parsing any required extra operands.
627fn parseBitEnum(self: *Assembler, kind: spec.OperandKind) !void {
628 var tok = self.currentToken();
629 try self.expectToken(.value);
630
631 var text = self.tokenText(tok);
632 if (std.mem.eql(u8, text, "None")) {
633 try self.inst.operands.append(self.gpa, .{ .value = 0 });
634 return;
635 }
636
637 const enumerants = kind.enumerants();
638 var mask: u32 = 0;
639 while (true) {
640 const enumerant = for (enumerants) |enumerant| {
641 if (std.mem.eql(u8, enumerant.name, text))
642 break enumerant;
643 } else {
644 return self.fail(tok.start, "'{s}' is not a valid flag for bitmask {s}", .{ text, @tagName(kind) });
645 };
646 mask |= enumerant.value;
647 if (!self.eatToken(.pipe))
648 break;
649
650 tok = self.currentToken();
651 try self.expectToken(.value);
652 text = self.tokenText(tok);
653 }
654
655 try self.inst.operands.append(self.gpa, .{ .value = mask });
656
657 // Assume values are sorted.
658 // TODO: ensure in generator.
659 for (enumerants) |enumerant| {
660 if ((mask & enumerant.value) == 0)
661 continue;
662
663 for (enumerant.parameters) |param_kind| {
664 if (self.isAtInstructionBoundary()) {
665 return self.fail(self.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
666 }
667
668 try self.parseOperand(param_kind);
669 }
670 }
671}
672
673/// Also handles parsing any required extra operands.
674fn parseValueEnum(self: *Assembler, kind: spec.OperandKind) !void {
675 const tok = self.currentToken();
676 try self.expectToken(.value);
677
678 const text = self.tokenText(tok);
679 const enumerant = for (kind.enumerants()) |enumerant| {
680 if (std.mem.eql(u8, enumerant.name, text))
681 break enumerant;
682 } else {
683 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ text, @tagName(kind) });
684 };
685
686 try self.inst.operands.append(self.gpa, .{ .value = enumerant.value });
687
688 for (enumerant.parameters) |param_kind| {
689 if (self.isAtInstructionBoundary()) {
690 return self.fail(self.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
691 }
692
693 try self.parseOperand(param_kind);
694 }
695}
696
697fn parseRefId(self: *Assembler) !void {
698 const tok = self.currentToken();
699 try self.expectToken(.result_id);
700
701 const name = self.tokenText(tok)[1..];
702 const entry = try self.value_map.getOrPut(self.gpa, name);
703 if (!entry.found_existing) {
704 entry.value_ptr.* = .unresolved_forward_reference;
705 }
706
707 const index = @intCast(AsmValue.Ref, entry.index);
708 try self.inst.operands.append(self.gpa, .{ .ref_id = index });
709}
710
711fn parseLiteralInteger(self: *Assembler) !void {
712 const tok = self.currentToken();
713 try self.expectToken(.value);
714 // According to the SPIR-V machine readable grammar, a LiteralInteger
715 // may consist of one or more words. From the SPIR-V docs it seems like there
716 // only one instruction where multiple words are allowed, the literals that make up the
717 // switch cases of OpSwitch. This case is handled separately, and so we just assume
718 // everything is a 32-bit integer in this function.
719 const text = self.tokenText(tok);
720 const value = std.fmt.parseInt(u32, text, 0) catch {
721 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
722 };
723 try self.inst.operands.append(self.gpa, .{ .literal32 = value });
724}
725
726fn parseString(self: *Assembler) !void {
727 const tok = self.currentToken();
728 try self.expectToken(.string);
729 // Note, the string might not have a closing quote. In this case,
730 // an error is already emitted but we are trying to continue processing
731 // anyway, so in this function we have to deal with that situation.
732 const text = self.tokenText(tok);
733 assert(text.len > 0 and text[0] == '"');
734 const literal = if (text.len != 1 and text[text.len - 1] == '"')
735 text[1 .. text.len - 1]
736 else
737 text[1..];
738
739 const string_offset = @intCast(u32, self.inst.string_bytes.items.len);
740 try self.inst.string_bytes.ensureUnusedCapacity(self.gpa, literal.len + 1);
741 self.inst.string_bytes.appendSliceAssumeCapacity(literal);
742 self.inst.string_bytes.appendAssumeCapacity(0);
743
744 try self.inst.operands.append(self.gpa, .{ .string = string_offset });
745}
746
747fn parseContextDependentNumber(self: *Assembler) !void {
748 // For context dependent numbers, the actual type to parse is determined by the instruction.
749 // Currently, this operand appears in OpConstant and OpSpecConstant, where the too-be-parsed type
750 // is determined by the result type. That means that in this instructions we have to resolve the
751 // operand type early and look at the result to see how we need to proceed.
752 assert(self.inst.opcode == .OpConstant or self.inst.opcode == .OpSpecConstant);
753
754 const tok = self.currentToken();
755 const result_type_ref = try self.resolveTypeRef(self.inst.operands.items[0].ref_id);
756 const result_type = self.spv.type_cache.keys()[result_type_ref];
757 switch (result_type.tag()) {
758 .int => {
759 const int = result_type.castTag(.int).?;
760 try self.parseContextDependentInt(int.signedness, int.width);
761 },
762 .float => {
763 const width = result_type.castTag(.float).?.width;
764 switch (width) {
765 16 => try self.parseContextDependentFloat(16),
766 32 => try self.parseContextDependentFloat(32),
767 64 => try self.parseContextDependentFloat(64),
768 else => return self.fail(tok.start, "cannot parse {}-bit float literal", .{width}),
769 }
770 },
771 else => return self.fail(tok.start, "cannot parse literal constant {s}", .{@tagName(result_type.tag())}),
772 }
773}
774
775fn parseContextDependentInt(self: *Assembler, signedness: std.builtin.Signedness, width: u32) !void {
776 const tok = self.currentToken();
777 try self.expectToken(.value);
778
779 if (width == 0 or width > 2 * @bitSizeOf(spec.Word)) {
780 return self.fail(tok.start, "cannot parse {}-bit integer literal", .{width});
781 }
782
783 const text = self.tokenText(tok);
784 invalid: {
785 // Just parse the integer as the next larger integer type, and check if it overflows afterwards.
786 const int = std.fmt.parseInt(i128, text, 0) catch break :invalid;
787 const min = switch (signedness) {
788 .unsigned => 0,
789 .signed => -(@as(i128, 1) << (@intCast(u7, width) - 1)),
790 };
791 const max = (@as(i128, 1) << (@intCast(u7, width) - @boolToInt(signedness == .signed))) - 1;
792 if (int < min or int > max) {
793 break :invalid;
794 }
795
796 // Note, we store the sign-extended version here.
797 if (width <= @bitSizeOf(spec.Word)) {
798 try self.inst.operands.append(self.gpa, .{ .literal32 = @truncate(u32, @bitCast(u128, int)) });
799 } else {
800 try self.inst.operands.append(self.gpa, .{ .literal64 = @truncate(u64, @bitCast(u128, int)) });
801 }
802 return;
803 }
804
805 return self.fail(tok.start, "'{s}' is not a valid {s} {}-bit int literal", .{ text, @tagName(signedness), width });
806}
807
808fn parseContextDependentFloat(self: *Assembler, comptime width: u16) !void {
809 const Float = std.meta.Float(width);
810 const Int = std.meta.Int(.unsigned, width);
811
812 const tok = self.currentToken();
813 try self.expectToken(.value);
814
815 const text = self.tokenText(tok);
816
817 const value = std.fmt.parseFloat(Float, text) catch {
818 return self.fail(tok.start, "'{s}' is not a valid {}-bit float literal", .{ text, width });
819 };
820
821 const float_bits = @bitCast(Int, value);
822 if (width <= @bitSizeOf(spec.Word)) {
823 try self.inst.operands.append(self.gpa, .{ .literal32 = float_bits });
824 } else {
825 assert(width <= 2 * @bitSizeOf(spec.Word));
826 try self.inst.operands.append(self.gpa, .{ .literal64 = float_bits });
827 }
828}
829
830fn parsePhiSource(self: *Assembler) !void {
831 try self.parseRefId();
832 if (self.isAtInstructionBoundary()) {
833 return self.fail(self.currentToken().start, "missing phi block parent", .{});
834 }
835 try self.parseRefId();
836}
837
838/// Returns whether the `current_token` cursor is currently pointing
839/// at the start of a new instruction.
840fn isAtInstructionBoundary(self: Assembler) bool {
841 return switch (self.currentToken().tag) {
842 .opcode, .result_id_assign, .eof => true,
843 else => false,
844 };
845}
846
847fn expectToken(self: *Assembler, tag: Token.Tag) !void {
848 if (self.eatToken(tag))
849 return;
850
851 return self.fail(self.currentToken().start, "unexpected {s}, expected {s}", .{
852 self.currentToken().tag.name(),
853 tag.name(),
854 });
855}
856
857fn eatToken(self: *Assembler, tag: Token.Tag) bool {
858 if (self.testToken(tag)) {
859 self.current_token += 1;
860 return true;
861 }
862 return false;
863}
864
865fn testToken(self: Assembler, tag: Token.Tag) bool {
866 return self.currentToken().tag == tag;
867}
868
869fn currentToken(self: Assembler) Token {
870 return self.tokens.items[self.current_token];
871}
872
873fn tokenText(self: Assembler, tok: Token) []const u8 {
874 return self.src[tok.start..tok.end];
875}
876
877/// Tokenize `self.src` and put the tokens in `self.tokens`.
878/// Any errors encountered are appended to `self.errors`.
879fn tokenize(self: *Assembler) !void {
880 var offset: u32 = 0;
881 while (true) {
882 const tok = try self.nextToken(offset);
883 // Resolve result-id assignment now.
884 // Note: If the previous token wasn't a result-id, just ignore it,
885 // we will catch it while parsing.
886 if (tok.tag == .equals and self.tokens.items[self.tokens.items.len - 1].tag == .result_id) {
887 self.tokens.items[self.tokens.items.len - 1].tag = .result_id_assign;
888 }
889 try self.tokens.append(self.gpa, tok);
890 if (tok.tag == .eof)
891 break;
892 offset = tok.end;
893 }
894}
895
896/// Retrieve the next token from the input. This function will assert
897/// that the token is surrounded by whitespace if required, but will not
898/// interpret the token yet.
899/// Note: This function doesn't handle .result_id_assign - this is handled in
900/// tokenize().
901fn nextToken(self: *Assembler, start_offset: u32) !Token {
902 // We generally separate the input into the following types:
903 // - Whitespace. Generally ignored, but also used as delimiter for some
904 // tokens.
905 // - Values. This entails integers, floats, enums - anything that
906 // consists of alphanumeric characters, delimited by whitespace.
907 // - Result-IDs. This entails anything that consists of alphanumeric characters and _, and
908 // starts with a %. In contrast to values, this entity can be checked for complete correctness
909 // relatively easily here.
910 // - Strings. This entails quote-delimited text such as "abc".
911 // SPIR-V strings have only two escapes, \" and \\.
912 // - Sigils, = and |. In this assembler, these are not required to have whitespace
913 // around them (they act as delimiters) as they do in SPIRV-Tools.
914
915 var state: enum {
916 start,
917 value,
918 result_id,
919 string,
920 string_end,
921 escape,
922 } = .start;
923 var token_start = start_offset;
924 var offset = start_offset;
925 var tag = Token.Tag.eof;
926 while (offset < self.src.len) : (offset += 1) {
927 const c = self.src[offset];
928 switch (state) {
929 .start => switch (c) {
930 ' ', '\t', '\r', '\n' => token_start = offset + 1,
931 '"' => {
932 state = .string;
933 tag = .string;
934 },
935 '%' => {
936 state = .result_id;
937 tag = .result_id;
938 },
939 '|' => {
940 tag = .pipe;
941 offset += 1;
942 break;
943 },
944 '=' => {
945 tag = .equals;
946 offset += 1;
947 break;
948 },
949 else => {
950 state = .value;
951 tag = .value;
952 },
953 },
954 .value => switch (c) {
955 '"' => {
956 try self.addError(offset, "unexpected string literal", .{});
957 // The user most likely just forgot a delimiter here - keep
958 // the tag as value.
959 break;
960 },
961 ' ', '\t', '\r', '\n', '=', '|' => break,
962 else => {},
963 },
964 .result_id => switch (c) {
965 '_', 'a'...'z', 'A'...'Z', '0'...'9' => {},
966 ' ', '\t', '\r', '\n', '=', '|' => break,
967 else => {
968 try self.addError(offset, "illegal character in result-id", .{});
969 // Again, probably a forgotten delimiter here.
970 break;
971 },
972 },
973 .string => switch (c) {
974 '\\' => state = .escape,
975 '"' => state = .string_end,
976 else => {}, // Note, strings may include newlines
977 },
978 .string_end => switch (c) {
979 ' ', '\t', '\r', '\n', '=', '|' => break,
980 else => {
981 try self.addError(offset, "unexpected character after string literal", .{});
982 // The token is still unmistakibly a string.
983 break;
984 },
985 },
986 // Escapes simply skip the next char.
987 .escape => state = .string,
988 }
989 }
990
991 var tok = Token{
992 .tag = tag,
993 .start = token_start,
994 .end = offset,
995 };
996
997 switch (state) {
998 .string, .escape => {
999 try self.addError(token_start, "unterminated string", .{});
1000 },
1001 .result_id => if (offset - token_start == 1) {
1002 try self.addError(token_start, "result-id must have at least one name character", .{});
1003 },
1004 .value => {
1005 const text = self.tokenText(tok);
1006 const prefix = "Op";
1007 const looks_like_opcode = text.len > prefix.len and
1008 std.mem.startsWith(u8, text, prefix) and
1009 std.ascii.isUpper(text[prefix.len]);
1010 if (looks_like_opcode)
1011 tok.tag = .opcode;
1012 },
1013 else => {},
1014 }
1015
1016 return tok;
1017}
src/codegen/spirv/Module.zig+56-10
...@@ -24,6 +24,37 @@ const Type = @import("type.zig").Type;...@@ -24,6 +24,37 @@ const Type = @import("type.zig").Type;
2424
25const TypeCache = std.ArrayHashMapUnmanaged(Type, IdResultType, Type.ShallowHashContext32, true);25const TypeCache = std.ArrayHashMapUnmanaged(Type, IdResultType, Type.ShallowHashContext32, true);
2626
27/// This structure represents a function that is in-progress of being emitted.
28/// Commonly, the contents of this structure will be merged with the appropriate
29/// sections of the module and re-used. Note that the SPIR-V module system makes
30/// no attempt of compacting result-id's, so any Fn instance should ultimately
31/// be merged into the module it's result-id's are allocated from.
32pub const Fn = struct {
33 /// The prologue of this function; this section contains the function's
34 /// OpFunction, OpFunctionParameter, OpLabel and OpVariable instructions, and
35 /// is separated from the actual function contents as OpVariable instructions
36 /// must appear in the first block of a function definition.
37 prologue: Section = .{},
38 /// The code of the body of this function.
39 /// This section should also contain the OpFunctionEnd instruction marking
40 /// the end of this function definition.
41 body: Section = .{},
42
43 /// Reset this function without deallocating resources, so that
44 /// it may be used to emit code for another function.
45 pub fn reset(self: *Fn) void {
46 self.prologue.reset();
47 self.body.reset();
48 }
49
50 /// Free the resources owned by this function.
51 pub fn deinit(self: *Fn, a: Allocator) void {
52 self.prologue.deinit(a);
53 self.body.deinit(a);
54 self.* = undefined;
55 }
56};
57
27/// A general-purpose allocator which may be used to allocate resources for this module58/// A general-purpose allocator which may be used to allocate resources for this module
28gpa: Allocator,59gpa: Allocator,
2960
...@@ -40,7 +71,8 @@ sections: struct {...@@ -40,7 +71,8 @@ sections: struct {
40 // memory model defined by target, not required here.71 // memory model defined by target, not required here.
41 /// OpEntryPoint instructions.72 /// OpEntryPoint instructions.
42 entry_points: Section = .{},73 entry_points: Section = .{},
43 // OpExecutionMode and OpExecutionModeId instructions - skip for now.74 /// OpExecutionMode and OpExecutionModeId instructions.
75 execution_modes: Section = .{},
44 /// OpString, OpSourcExtension, OpSource, OpSourceContinued.76 /// OpString, OpSourcExtension, OpSource, OpSourceContinued.
45 debug_strings: Section = .{},77 debug_strings: Section = .{},
46 // OpName, OpMemberName - skip for now.78 // OpName, OpMemberName - skip for now.
...@@ -81,6 +113,7 @@ pub fn deinit(self: *Module) void {...@@ -81,6 +113,7 @@ pub fn deinit(self: *Module) void {
81 self.sections.capabilities.deinit(self.gpa);113 self.sections.capabilities.deinit(self.gpa);
82 self.sections.extensions.deinit(self.gpa);114 self.sections.extensions.deinit(self.gpa);
83 self.sections.entry_points.deinit(self.gpa);115 self.sections.entry_points.deinit(self.gpa);
116 self.sections.execution_modes.deinit(self.gpa);
84 self.sections.debug_strings.deinit(self.gpa);117 self.sections.debug_strings.deinit(self.gpa);
85 self.sections.annotations.deinit(self.gpa);118 self.sections.annotations.deinit(self.gpa);
86 self.sections.types_globals_constants.deinit(self.gpa);119 self.sections.types_globals_constants.deinit(self.gpa);
...@@ -107,7 +140,7 @@ pub fn flush(self: Module, file: std.fs.File) !void {...@@ -107,7 +140,7 @@ pub fn flush(self: Module, file: std.fs.File) !void {
107140
108 const header = [_]Word{141 const header = [_]Word{
109 spec.magic_number,142 spec.magic_number,
110 (spec.version.major << 16) | (spec.version.minor << 8),143 (1 << 16) | (5 << 8),
111 0, // TODO: Register Zig compiler magic number.144 0, // TODO: Register Zig compiler magic number.
112 self.idBound(),145 self.idBound(),
113 0, // Schema (currently reserved for future use)146 0, // Schema (currently reserved for future use)
...@@ -119,6 +152,7 @@ pub fn flush(self: Module, file: std.fs.File) !void {...@@ -119,6 +152,7 @@ pub fn flush(self: Module, file: std.fs.File) !void {
119 self.sections.capabilities.toWords(),152 self.sections.capabilities.toWords(),
120 self.sections.extensions.toWords(),153 self.sections.extensions.toWords(),
121 self.sections.entry_points.toWords(),154 self.sections.entry_points.toWords(),
155 self.sections.execution_modes.toWords(),
122 self.sections.debug_strings.toWords(),156 self.sections.debug_strings.toWords(),
123 self.sections.annotations.toWords(),157 self.sections.annotations.toWords(),
124 self.sections.types_globals_constants.toWords(),158 self.sections.types_globals_constants.toWords(),
...@@ -140,6 +174,12 @@ pub fn flush(self: Module, file: std.fs.File) !void {...@@ -140,6 +174,12 @@ pub fn flush(self: Module, file: std.fs.File) !void {
140 try file.pwritevAll(&iovc_buffers, 0);174 try file.pwritevAll(&iovc_buffers, 0);
141}175}
142176
177/// Merge the sections making up a function declaration into this module.
178pub fn addFunction(self: *Module, func: Fn) !void {
179 try self.sections.functions.append(self.gpa, func.prologue);
180 try self.sections.functions.append(self.gpa, func.body);
181}
182
143/// Fetch the result-id of an OpString instruction that encodes the path of the source183/// Fetch the result-id of an OpString instruction that encodes the path of the source
144/// file of the decl. This function may also emit an OpSource with source-level information regarding184/// file of the decl. This function may also emit an OpSource with source-level information regarding
145/// the decl.185/// the decl.
...@@ -175,11 +215,13 @@ pub fn resolveType(self: *Module, ty: Type) !Type.Ref {...@@ -175,11 +215,13 @@ pub fn resolveType(self: *Module, ty: Type) !Type.Ref {
175 if (!result.found_existing) {215 if (!result.found_existing) {
176 result.value_ptr.* = try self.emitType(ty);216 result.value_ptr.* = try self.emitType(ty);
177 }217 }
218
178 return result.index;219 return result.index;
179}220}
180221
181pub fn resolveTypeId(self: *Module, ty: Type) !IdRef {222pub fn resolveTypeId(self: *Module, ty: Type) !IdRef {
182 return self.typeResultId(try self.resolveType(ty));223 const type_ref = try self.resolveType(ty);
224 return self.typeResultId(type_ref);
183}225}
184226
185/// Get the result-id of a particular type, by reference. Asserts type_ref is valid.227/// Get the result-id of a particular type, by reference. Asserts type_ref is valid.
...@@ -208,14 +250,18 @@ pub fn emitType(self: *Module, ty: Type) !IdResultType {...@@ -208,14 +250,18 @@ pub fn emitType(self: *Module, ty: Type) !IdResultType {
208 switch (ty.tag()) {250 switch (ty.tag()) {
209 .void => try types.emit(self.gpa, .OpTypeVoid, result_id_operand),251 .void => try types.emit(self.gpa, .OpTypeVoid, result_id_operand),
210 .bool => try types.emit(self.gpa, .OpTypeBool, result_id_operand),252 .bool => try types.emit(self.gpa, .OpTypeBool, result_id_operand),
211 .int => try types.emit(self.gpa, .OpTypeInt, .{253 .int => {
212 .id_result = result_id,254 const signedness: spec.LiteralInteger = switch (ty.payload(.int).signedness) {
213 .width = ty.payload(.int).width,255 .unsigned => 0,
214 .signedness = switch (ty.payload(.int).signedness) {
215 .unsigned => @as(spec.LiteralInteger, 0),
216 .signed => 1,256 .signed => 1,
217 },257 };
218 }),258
259 try types.emit(self.gpa, .OpTypeInt, .{
260 .id_result = result_id,
261 .width = ty.payload(.int).width,
262 .signedness = signedness,
263 });
264 },
219 .float => try types.emit(self.gpa, .OpTypeFloat, .{265 .float => try types.emit(self.gpa, .OpTypeFloat, .{
220 .id_result = result_id,266 .id_result = result_id,
221 .width = ty.payload(.float).width,267 .width = ty.payload(.float).width,
src/codegen/spirv/Section.zig+8-3
...@@ -36,14 +36,19 @@ pub fn append(section: *Section, allocator: Allocator, other_section: Section) !...@@ -36,14 +36,19 @@ pub fn append(section: *Section, allocator: Allocator, other_section: Section) !
36 try section.instructions.appendSlice(allocator, other_section.instructions.items);36 try section.instructions.appendSlice(allocator, other_section.instructions.items);
37}37}
3838
39/// Ensure capacity of at least `capacity` more words in this section.
40pub fn ensureUnusedCapacity(section: *Section, allocator: Allocator, capacity: usize) !void {
41 try section.instructions.ensureUnusedCapacity(allocator, capacity);
42}
43
39/// Write an instruction and size, operands are to be inserted manually.44/// Write an instruction and size, operands are to be inserted manually.
40pub fn emitRaw(45pub fn emitRaw(
41 section: *Section,46 section: *Section,
42 allocator: Allocator,47 allocator: Allocator,
43 opcode: Opcode,48 opcode: Opcode,
44 operands: usize, // opcode itself not included49 operand_words: usize, // opcode itself not included
45) !void {50) !void {
46 const word_count = 1 + operands;51 const word_count = 1 + operand_words;
47 try section.instructions.ensureUnusedCapacity(allocator, word_count);52 try section.instructions.ensureUnusedCapacity(allocator, word_count);
48 section.writeWord((@intCast(Word, word_count << 16)) | @enumToInt(opcode));53 section.writeWord((@intCast(Word, word_count << 16)) | @enumToInt(opcode));
49}54}
...@@ -96,7 +101,7 @@ pub fn writeWords(section: *Section, words: []const Word) void {...@@ -96,7 +101,7 @@ pub fn writeWords(section: *Section, words: []const Word) void {
96 section.instructions.appendSliceAssumeCapacity(words);101 section.instructions.appendSliceAssumeCapacity(words);
97}102}
98103
99fn writeDoubleWord(section: *Section, dword: DoubleWord) void {104pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {
100 section.writeWords(&.{105 section.writeWords(&.{
101 @truncate(Word, dword),106 @truncate(Word, dword),
102 @truncate(Word, dword >> @bitSizeOf(Word)),107 @truncate(Word, dword >> @bitSizeOf(Word)),
src/codegen/spirv/spec.zig+4362-272
...@@ -39,8 +39,1103 @@ pub const PairLiteralIntegerIdRef = struct { value: LiteralInteger, label: IdRef...@@ -39,8 +39,1103 @@ pub const PairLiteralIntegerIdRef = struct { value: LiteralInteger, label: IdRef
39pub const PairIdRefLiteralInteger = struct { target: IdRef, member: LiteralInteger };39pub const PairIdRefLiteralInteger = struct { target: IdRef, member: LiteralInteger };
40pub const PairIdRefIdRef = [2]IdRef;40pub const PairIdRefIdRef = [2]IdRef;
4141
42pub const version = Version{ .major = 1, .minor = 5, .patch = 4 };42pub const Quantifier = enum {
43 required,
44 optional,
45 variadic,
46};
47
48pub const Operand = struct {
49 kind: OperandKind,
50 quantifier: Quantifier,
51};
52
53pub const OperandCategory = enum {
54 bit_enum,
55 value_enum,
56 id,
57 literal,
58 composite,
59};
60
61pub const Enumerant = struct {
62 name: []const u8,
63 value: Word,
64 parameters: []const OperandKind,
65};
66
67pub const version = Version{ .major = 1, .minor = 6, .patch = 1 };
43pub const magic_number: Word = 0x07230203;68pub const magic_number: Word = 0x07230203;
69
70pub const Class = enum {
71 Miscellaneous,
72 Debug,
73 Extension,
74 ModeSetting,
75 TypeDeclaration,
76 ConstantCreation,
77 Function,
78 Memory,
79 Annotation,
80 Composite,
81 Image,
82 Conversion,
83 Arithmetic,
84 RelationalAndLogical,
85 Bit,
86 Derivative,
87 Primitive,
88 Barrier,
89 Atomic,
90 ControlFlow,
91 Group,
92 Pipe,
93 DeviceSideEnqueue,
94 NonUniform,
95 Reserved,
96};
97pub const OperandKind = enum {
98 ImageOperands,
99 FPFastMathMode,
100 SelectionControl,
101 LoopControl,
102 FunctionControl,
103 MemorySemantics,
104 MemoryAccess,
105 KernelProfilingInfo,
106 RayFlags,
107 FragmentShadingRate,
108 SourceLanguage,
109 ExecutionModel,
110 AddressingModel,
111 MemoryModel,
112 ExecutionMode,
113 StorageClass,
114 Dim,
115 SamplerAddressingMode,
116 SamplerFilterMode,
117 ImageFormat,
118 ImageChannelOrder,
119 ImageChannelDataType,
120 FPRoundingMode,
121 FPDenormMode,
122 QuantizationModes,
123 FPOperationMode,
124 OverflowModes,
125 LinkageType,
126 AccessQualifier,
127 FunctionParameterAttribute,
128 Decoration,
129 BuiltIn,
130 Scope,
131 GroupOperation,
132 KernelEnqueueFlags,
133 Capability,
134 RayQueryIntersection,
135 RayQueryCommittedIntersectionType,
136 RayQueryCandidateIntersectionType,
137 PackedVectorFormat,
138 IdResultType,
139 IdResult,
140 IdMemorySemantics,
141 IdScope,
142 IdRef,
143 LiteralInteger,
144 LiteralString,
145 LiteralContextDependentNumber,
146 LiteralExtInstInteger,
147 LiteralSpecConstantOpInteger,
148 PairLiteralIntegerIdRef,
149 PairIdRefLiteralInteger,
150 PairIdRefIdRef,
151
152 pub fn category(self: OperandKind) OperandCategory {
153 return switch (self) {
154 .ImageOperands => .bit_enum,
155 .FPFastMathMode => .bit_enum,
156 .SelectionControl => .bit_enum,
157 .LoopControl => .bit_enum,
158 .FunctionControl => .bit_enum,
159 .MemorySemantics => .bit_enum,
160 .MemoryAccess => .bit_enum,
161 .KernelProfilingInfo => .bit_enum,
162 .RayFlags => .bit_enum,
163 .FragmentShadingRate => .bit_enum,
164 .SourceLanguage => .value_enum,
165 .ExecutionModel => .value_enum,
166 .AddressingModel => .value_enum,
167 .MemoryModel => .value_enum,
168 .ExecutionMode => .value_enum,
169 .StorageClass => .value_enum,
170 .Dim => .value_enum,
171 .SamplerAddressingMode => .value_enum,
172 .SamplerFilterMode => .value_enum,
173 .ImageFormat => .value_enum,
174 .ImageChannelOrder => .value_enum,
175 .ImageChannelDataType => .value_enum,
176 .FPRoundingMode => .value_enum,
177 .FPDenormMode => .value_enum,
178 .QuantizationModes => .value_enum,
179 .FPOperationMode => .value_enum,
180 .OverflowModes => .value_enum,
181 .LinkageType => .value_enum,
182 .AccessQualifier => .value_enum,
183 .FunctionParameterAttribute => .value_enum,
184 .Decoration => .value_enum,
185 .BuiltIn => .value_enum,
186 .Scope => .value_enum,
187 .GroupOperation => .value_enum,
188 .KernelEnqueueFlags => .value_enum,
189 .Capability => .value_enum,
190 .RayQueryIntersection => .value_enum,
191 .RayQueryCommittedIntersectionType => .value_enum,
192 .RayQueryCandidateIntersectionType => .value_enum,
193 .PackedVectorFormat => .value_enum,
194 .IdResultType => .id,
195 .IdResult => .id,
196 .IdMemorySemantics => .id,
197 .IdScope => .id,
198 .IdRef => .id,
199 .LiteralInteger => .literal,
200 .LiteralString => .literal,
201 .LiteralContextDependentNumber => .literal,
202 .LiteralExtInstInteger => .literal,
203 .LiteralSpecConstantOpInteger => .literal,
204 .PairLiteralIntegerIdRef => .composite,
205 .PairIdRefLiteralInteger => .composite,
206 .PairIdRefIdRef => .composite,
207 };
208 }
209 pub fn enumerants(self: OperandKind) []const Enumerant {
210 return switch (self) {
211 .ImageOperands => &[_]Enumerant{
212 .{ .name = "Bias", .value = 0x0001, .parameters = &[_]OperandKind{.IdRef} },
213 .{ .name = "Lod", .value = 0x0002, .parameters = &[_]OperandKind{.IdRef} },
214 .{ .name = "Grad", .value = 0x0004, .parameters = &[_]OperandKind{ .IdRef, .IdRef } },
215 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &[_]OperandKind{.IdRef} },
216 .{ .name = "Offset", .value = 0x0010, .parameters = &[_]OperandKind{.IdRef} },
217 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &[_]OperandKind{.IdRef} },
218 .{ .name = "Sample", .value = 0x0040, .parameters = &[_]OperandKind{.IdRef} },
219 .{ .name = "MinLod", .value = 0x0080, .parameters = &[_]OperandKind{.IdRef} },
220 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &[_]OperandKind{.IdScope} },
221 .{ .name = "MakeTexelAvailableKHR", .value = 0x0100, .parameters = &[_]OperandKind{.IdScope} },
222 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &[_]OperandKind{.IdScope} },
223 .{ .name = "MakeTexelVisibleKHR", .value = 0x0200, .parameters = &[_]OperandKind{.IdScope} },
224 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &[_]OperandKind{} },
225 .{ .name = "NonPrivateTexelKHR", .value = 0x0400, .parameters = &[_]OperandKind{} },
226 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &[_]OperandKind{} },
227 .{ .name = "VolatileTexelKHR", .value = 0x0800, .parameters = &[_]OperandKind{} },
228 .{ .name = "SignExtend", .value = 0x1000, .parameters = &[_]OperandKind{} },
229 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &[_]OperandKind{} },
230 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &[_]OperandKind{} },
231 .{ .name = "Offsets", .value = 0x10000, .parameters = &[_]OperandKind{.IdRef} },
232 },
233 .FPFastMathMode => &[_]Enumerant{
234 .{ .name = "NotNaN", .value = 0x0001, .parameters = &[_]OperandKind{} },
235 .{ .name = "NotInf", .value = 0x0002, .parameters = &[_]OperandKind{} },
236 .{ .name = "NSZ", .value = 0x0004, .parameters = &[_]OperandKind{} },
237 .{ .name = "AllowRecip", .value = 0x0008, .parameters = &[_]OperandKind{} },
238 .{ .name = "Fast", .value = 0x0010, .parameters = &[_]OperandKind{} },
239 .{ .name = "AllowContractFastINTEL", .value = 0x10000, .parameters = &[_]OperandKind{} },
240 .{ .name = "AllowReassocINTEL", .value = 0x20000, .parameters = &[_]OperandKind{} },
241 },
242 .SelectionControl => &[_]Enumerant{
243 .{ .name = "Flatten", .value = 0x0001, .parameters = &[_]OperandKind{} },
244 .{ .name = "DontFlatten", .value = 0x0002, .parameters = &[_]OperandKind{} },
245 },
246 .LoopControl => &[_]Enumerant{
247 .{ .name = "Unroll", .value = 0x0001, .parameters = &[_]OperandKind{} },
248 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &[_]OperandKind{} },
249 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &[_]OperandKind{} },
250 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &[_]OperandKind{.LiteralInteger} },
251 .{ .name = "MinIterations", .value = 0x0010, .parameters = &[_]OperandKind{.LiteralInteger} },
252 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &[_]OperandKind{.LiteralInteger} },
253 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &[_]OperandKind{.LiteralInteger} },
254 .{ .name = "PeelCount", .value = 0x0080, .parameters = &[_]OperandKind{.LiteralInteger} },
255 .{ .name = "PartialCount", .value = 0x0100, .parameters = &[_]OperandKind{.LiteralInteger} },
256 .{ .name = "InitiationIntervalINTEL", .value = 0x10000, .parameters = &[_]OperandKind{.LiteralInteger} },
257 .{ .name = "MaxConcurrencyINTEL", .value = 0x20000, .parameters = &[_]OperandKind{.LiteralInteger} },
258 .{ .name = "DependencyArrayINTEL", .value = 0x40000, .parameters = &[_]OperandKind{.LiteralInteger} },
259 .{ .name = "PipelineEnableINTEL", .value = 0x80000, .parameters = &[_]OperandKind{.LiteralInteger} },
260 .{ .name = "LoopCoalesceINTEL", .value = 0x100000, .parameters = &[_]OperandKind{.LiteralInteger} },
261 .{ .name = "MaxInterleavingINTEL", .value = 0x200000, .parameters = &[_]OperandKind{.LiteralInteger} },
262 .{ .name = "SpeculatedIterationsINTEL", .value = 0x400000, .parameters = &[_]OperandKind{.LiteralInteger} },
263 .{ .name = "NoFusionINTEL", .value = 0x800000, .parameters = &[_]OperandKind{.LiteralInteger} },
264 },
265 .FunctionControl => &[_]Enumerant{
266 .{ .name = "Inline", .value = 0x0001, .parameters = &[_]OperandKind{} },
267 .{ .name = "DontInline", .value = 0x0002, .parameters = &[_]OperandKind{} },
268 .{ .name = "Pure", .value = 0x0004, .parameters = &[_]OperandKind{} },
269 .{ .name = "Const", .value = 0x0008, .parameters = &[_]OperandKind{} },
270 .{ .name = "OptNoneINTEL", .value = 0x10000, .parameters = &[_]OperandKind{} },
271 },
272 .MemorySemantics => &[_]Enumerant{
273 .{ .name = "Relaxed", .value = 0x0000, .parameters = &[_]OperandKind{} },
274 .{ .name = "Acquire", .value = 0x0002, .parameters = &[_]OperandKind{} },
275 .{ .name = "Release", .value = 0x0004, .parameters = &[_]OperandKind{} },
276 .{ .name = "AcquireRelease", .value = 0x0008, .parameters = &[_]OperandKind{} },
277 .{ .name = "SequentiallyConsistent", .value = 0x0010, .parameters = &[_]OperandKind{} },
278 .{ .name = "UniformMemory", .value = 0x0040, .parameters = &[_]OperandKind{} },
279 .{ .name = "SubgroupMemory", .value = 0x0080, .parameters = &[_]OperandKind{} },
280 .{ .name = "WorkgroupMemory", .value = 0x0100, .parameters = &[_]OperandKind{} },
281 .{ .name = "CrossWorkgroupMemory", .value = 0x0200, .parameters = &[_]OperandKind{} },
282 .{ .name = "AtomicCounterMemory", .value = 0x0400, .parameters = &[_]OperandKind{} },
283 .{ .name = "ImageMemory", .value = 0x0800, .parameters = &[_]OperandKind{} },
284 .{ .name = "OutputMemory", .value = 0x1000, .parameters = &[_]OperandKind{} },
285 .{ .name = "OutputMemoryKHR", .value = 0x1000, .parameters = &[_]OperandKind{} },
286 .{ .name = "MakeAvailable", .value = 0x2000, .parameters = &[_]OperandKind{} },
287 .{ .name = "MakeAvailableKHR", .value = 0x2000, .parameters = &[_]OperandKind{} },
288 .{ .name = "MakeVisible", .value = 0x4000, .parameters = &[_]OperandKind{} },
289 .{ .name = "MakeVisibleKHR", .value = 0x4000, .parameters = &[_]OperandKind{} },
290 .{ .name = "Volatile", .value = 0x8000, .parameters = &[_]OperandKind{} },
291 },
292 .MemoryAccess => &[_]Enumerant{
293 .{ .name = "Volatile", .value = 0x0001, .parameters = &[_]OperandKind{} },
294 .{ .name = "Aligned", .value = 0x0002, .parameters = &[_]OperandKind{.LiteralInteger} },
295 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &[_]OperandKind{} },
296 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &[_]OperandKind{.IdScope} },
297 .{ .name = "MakePointerAvailableKHR", .value = 0x0008, .parameters = &[_]OperandKind{.IdScope} },
298 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &[_]OperandKind{.IdScope} },
299 .{ .name = "MakePointerVisibleKHR", .value = 0x0010, .parameters = &[_]OperandKind{.IdScope} },
300 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &[_]OperandKind{} },
301 .{ .name = "NonPrivatePointerKHR", .value = 0x0020, .parameters = &[_]OperandKind{} },
302 },
303 .KernelProfilingInfo => &[_]Enumerant{
304 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &[_]OperandKind{} },
305 },
306 .RayFlags => &[_]Enumerant{
307 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &[_]OperandKind{} },
308 .{ .name = "OpaqueKHR", .value = 0x0001, .parameters = &[_]OperandKind{} },
309 .{ .name = "NoOpaqueKHR", .value = 0x0002, .parameters = &[_]OperandKind{} },
310 .{ .name = "TerminateOnFirstHitKHR", .value = 0x0004, .parameters = &[_]OperandKind{} },
311 .{ .name = "SkipClosestHitShaderKHR", .value = 0x0008, .parameters = &[_]OperandKind{} },
312 .{ .name = "CullBackFacingTrianglesKHR", .value = 0x0010, .parameters = &[_]OperandKind{} },
313 .{ .name = "CullFrontFacingTrianglesKHR", .value = 0x0020, .parameters = &[_]OperandKind{} },
314 .{ .name = "CullOpaqueKHR", .value = 0x0040, .parameters = &[_]OperandKind{} },
315 .{ .name = "CullNoOpaqueKHR", .value = 0x0080, .parameters = &[_]OperandKind{} },
316 .{ .name = "SkipTrianglesKHR", .value = 0x0100, .parameters = &[_]OperandKind{} },
317 .{ .name = "SkipAABBsKHR", .value = 0x0200, .parameters = &[_]OperandKind{} },
318 },
319 .FragmentShadingRate => &[_]Enumerant{
320 .{ .name = "Vertical2Pixels", .value = 0x0001, .parameters = &[_]OperandKind{} },
321 .{ .name = "Vertical4Pixels", .value = 0x0002, .parameters = &[_]OperandKind{} },
322 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &[_]OperandKind{} },
323 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &[_]OperandKind{} },
324 },
325 .SourceLanguage => &[_]Enumerant{
326 .{ .name = "Unknown", .value = 0, .parameters = &[_]OperandKind{} },
327 .{ .name = "ESSL", .value = 1, .parameters = &[_]OperandKind{} },
328 .{ .name = "GLSL", .value = 2, .parameters = &[_]OperandKind{} },
329 .{ .name = "OpenCL_C", .value = 3, .parameters = &[_]OperandKind{} },
330 .{ .name = "OpenCL_CPP", .value = 4, .parameters = &[_]OperandKind{} },
331 .{ .name = "HLSL", .value = 5, .parameters = &[_]OperandKind{} },
332 .{ .name = "CPP_for_OpenCL", .value = 6, .parameters = &[_]OperandKind{} },
333 },
334 .ExecutionModel => &[_]Enumerant{
335 .{ .name = "Vertex", .value = 0, .parameters = &[_]OperandKind{} },
336 .{ .name = "TessellationControl", .value = 1, .parameters = &[_]OperandKind{} },
337 .{ .name = "TessellationEvaluation", .value = 2, .parameters = &[_]OperandKind{} },
338 .{ .name = "Geometry", .value = 3, .parameters = &[_]OperandKind{} },
339 .{ .name = "Fragment", .value = 4, .parameters = &[_]OperandKind{} },
340 .{ .name = "GLCompute", .value = 5, .parameters = &[_]OperandKind{} },
341 .{ .name = "Kernel", .value = 6, .parameters = &[_]OperandKind{} },
342 .{ .name = "TaskNV", .value = 5267, .parameters = &[_]OperandKind{} },
343 .{ .name = "MeshNV", .value = 5268, .parameters = &[_]OperandKind{} },
344 .{ .name = "RayGenerationNV", .value = 5313, .parameters = &[_]OperandKind{} },
345 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &[_]OperandKind{} },
346 .{ .name = "IntersectionNV", .value = 5314, .parameters = &[_]OperandKind{} },
347 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &[_]OperandKind{} },
348 .{ .name = "AnyHitNV", .value = 5315, .parameters = &[_]OperandKind{} },
349 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &[_]OperandKind{} },
350 .{ .name = "ClosestHitNV", .value = 5316, .parameters = &[_]OperandKind{} },
351 .{ .name = "ClosestHitKHR", .value = 5316, .parameters = &[_]OperandKind{} },
352 .{ .name = "MissNV", .value = 5317, .parameters = &[_]OperandKind{} },
353 .{ .name = "MissKHR", .value = 5317, .parameters = &[_]OperandKind{} },
354 .{ .name = "CallableNV", .value = 5318, .parameters = &[_]OperandKind{} },
355 .{ .name = "CallableKHR", .value = 5318, .parameters = &[_]OperandKind{} },
356 },
357 .AddressingModel => &[_]Enumerant{
358 .{ .name = "Logical", .value = 0, .parameters = &[_]OperandKind{} },
359 .{ .name = "Physical32", .value = 1, .parameters = &[_]OperandKind{} },
360 .{ .name = "Physical64", .value = 2, .parameters = &[_]OperandKind{} },
361 .{ .name = "PhysicalStorageBuffer64", .value = 5348, .parameters = &[_]OperandKind{} },
362 .{ .name = "PhysicalStorageBuffer64EXT", .value = 5348, .parameters = &[_]OperandKind{} },
363 },
364 .MemoryModel => &[_]Enumerant{
365 .{ .name = "Simple", .value = 0, .parameters = &[_]OperandKind{} },
366 .{ .name = "GLSL450", .value = 1, .parameters = &[_]OperandKind{} },
367 .{ .name = "OpenCL", .value = 2, .parameters = &[_]OperandKind{} },
368 .{ .name = "Vulkan", .value = 3, .parameters = &[_]OperandKind{} },
369 .{ .name = "VulkanKHR", .value = 3, .parameters = &[_]OperandKind{} },
370 },
371 .ExecutionMode => &[_]Enumerant{
372 .{ .name = "Invocations", .value = 0, .parameters = &[_]OperandKind{.LiteralInteger} },
373 .{ .name = "SpacingEqual", .value = 1, .parameters = &[_]OperandKind{} },
374 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &[_]OperandKind{} },
375 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &[_]OperandKind{} },
376 .{ .name = "VertexOrderCw", .value = 4, .parameters = &[_]OperandKind{} },
377 .{ .name = "VertexOrderCcw", .value = 5, .parameters = &[_]OperandKind{} },
378 .{ .name = "PixelCenterInteger", .value = 6, .parameters = &[_]OperandKind{} },
379 .{ .name = "OriginUpperLeft", .value = 7, .parameters = &[_]OperandKind{} },
380 .{ .name = "OriginLowerLeft", .value = 8, .parameters = &[_]OperandKind{} },
381 .{ .name = "EarlyFragmentTests", .value = 9, .parameters = &[_]OperandKind{} },
382 .{ .name = "PointMode", .value = 10, .parameters = &[_]OperandKind{} },
383 .{ .name = "Xfb", .value = 11, .parameters = &[_]OperandKind{} },
384 .{ .name = "DepthReplacing", .value = 12, .parameters = &[_]OperandKind{} },
385 .{ .name = "DepthGreater", .value = 14, .parameters = &[_]OperandKind{} },
386 .{ .name = "DepthLess", .value = 15, .parameters = &[_]OperandKind{} },
387 .{ .name = "DepthUnchanged", .value = 16, .parameters = &[_]OperandKind{} },
388 .{ .name = "LocalSize", .value = 17, .parameters = &[_]OperandKind{ .LiteralInteger, .LiteralInteger, .LiteralInteger } },
389 .{ .name = "LocalSizeHint", .value = 18, .parameters = &[_]OperandKind{ .LiteralInteger, .LiteralInteger, .LiteralInteger } },
390 .{ .name = "InputPoints", .value = 19, .parameters = &[_]OperandKind{} },
391 .{ .name = "InputLines", .value = 20, .parameters = &[_]OperandKind{} },
392 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &[_]OperandKind{} },
393 .{ .name = "Triangles", .value = 22, .parameters = &[_]OperandKind{} },
394 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &[_]OperandKind{} },
395 .{ .name = "Quads", .value = 24, .parameters = &[_]OperandKind{} },
396 .{ .name = "Isolines", .value = 25, .parameters = &[_]OperandKind{} },
397 .{ .name = "OutputVertices", .value = 26, .parameters = &[_]OperandKind{.LiteralInteger} },
398 .{ .name = "OutputPoints", .value = 27, .parameters = &[_]OperandKind{} },
399 .{ .name = "OutputLineStrip", .value = 28, .parameters = &[_]OperandKind{} },
400 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &[_]OperandKind{} },
401 .{ .name = "VecTypeHint", .value = 30, .parameters = &[_]OperandKind{.LiteralInteger} },
402 .{ .name = "ContractionOff", .value = 31, .parameters = &[_]OperandKind{} },
403 .{ .name = "Initializer", .value = 33, .parameters = &[_]OperandKind{} },
404 .{ .name = "Finalizer", .value = 34, .parameters = &[_]OperandKind{} },
405 .{ .name = "SubgroupSize", .value = 35, .parameters = &[_]OperandKind{.LiteralInteger} },
406 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &[_]OperandKind{.LiteralInteger} },
407 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &[_]OperandKind{.IdRef} },
408 .{ .name = "LocalSizeId", .value = 38, .parameters = &[_]OperandKind{ .IdRef, .IdRef, .IdRef } },
409 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &[_]OperandKind{ .IdRef, .IdRef, .IdRef } },
410 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &[_]OperandKind{} },
411 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &[_]OperandKind{} },
412 .{ .name = "DenormPreserve", .value = 4459, .parameters = &[_]OperandKind{.LiteralInteger} },
413 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &[_]OperandKind{.LiteralInteger} },
414 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &[_]OperandKind{.LiteralInteger} },
415 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &[_]OperandKind{.LiteralInteger} },
416 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &[_]OperandKind{.LiteralInteger} },
417 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &[_]OperandKind{} },
418 .{ .name = "OutputLinesNV", .value = 5269, .parameters = &[_]OperandKind{} },
419 .{ .name = "OutputPrimitivesNV", .value = 5270, .parameters = &[_]OperandKind{.LiteralInteger} },
420 .{ .name = "DerivativeGroupQuadsNV", .value = 5289, .parameters = &[_]OperandKind{} },
421 .{ .name = "DerivativeGroupLinearNV", .value = 5290, .parameters = &[_]OperandKind{} },
422 .{ .name = "OutputTrianglesNV", .value = 5298, .parameters = &[_]OperandKind{} },
423 .{ .name = "PixelInterlockOrderedEXT", .value = 5366, .parameters = &[_]OperandKind{} },
424 .{ .name = "PixelInterlockUnorderedEXT", .value = 5367, .parameters = &[_]OperandKind{} },
425 .{ .name = "SampleInterlockOrderedEXT", .value = 5368, .parameters = &[_]OperandKind{} },
426 .{ .name = "SampleInterlockUnorderedEXT", .value = 5369, .parameters = &[_]OperandKind{} },
427 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &[_]OperandKind{} },
428 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &[_]OperandKind{} },
429 .{ .name = "SharedLocalMemorySizeINTEL", .value = 5618, .parameters = &[_]OperandKind{.LiteralInteger} },
430 .{ .name = "RoundingModeRTPINTEL", .value = 5620, .parameters = &[_]OperandKind{.LiteralInteger} },
431 .{ .name = "RoundingModeRTNINTEL", .value = 5621, .parameters = &[_]OperandKind{.LiteralInteger} },
432 .{ .name = "FloatingPointModeALTINTEL", .value = 5622, .parameters = &[_]OperandKind{.LiteralInteger} },
433 .{ .name = "FloatingPointModeIEEEINTEL", .value = 5623, .parameters = &[_]OperandKind{.LiteralInteger} },
434 .{ .name = "MaxWorkgroupSizeINTEL", .value = 5893, .parameters = &[_]OperandKind{ .LiteralInteger, .LiteralInteger, .LiteralInteger } },
435 .{ .name = "MaxWorkDimINTEL", .value = 5894, .parameters = &[_]OperandKind{.LiteralInteger} },
436 .{ .name = "NoGlobalOffsetINTEL", .value = 5895, .parameters = &[_]OperandKind{} },
437 .{ .name = "NumSIMDWorkitemsINTEL", .value = 5896, .parameters = &[_]OperandKind{.LiteralInteger} },
438 .{ .name = "SchedulerTargetFmaxMhzINTEL", .value = 5903, .parameters = &[_]OperandKind{.LiteralInteger} },
439 },
440 .StorageClass => &[_]Enumerant{
441 .{ .name = "UniformConstant", .value = 0, .parameters = &[_]OperandKind{} },
442 .{ .name = "Input", .value = 1, .parameters = &[_]OperandKind{} },
443 .{ .name = "Uniform", .value = 2, .parameters = &[_]OperandKind{} },
444 .{ .name = "Output", .value = 3, .parameters = &[_]OperandKind{} },
445 .{ .name = "Workgroup", .value = 4, .parameters = &[_]OperandKind{} },
446 .{ .name = "CrossWorkgroup", .value = 5, .parameters = &[_]OperandKind{} },
447 .{ .name = "Private", .value = 6, .parameters = &[_]OperandKind{} },
448 .{ .name = "Function", .value = 7, .parameters = &[_]OperandKind{} },
449 .{ .name = "Generic", .value = 8, .parameters = &[_]OperandKind{} },
450 .{ .name = "PushConstant", .value = 9, .parameters = &[_]OperandKind{} },
451 .{ .name = "AtomicCounter", .value = 10, .parameters = &[_]OperandKind{} },
452 .{ .name = "Image", .value = 11, .parameters = &[_]OperandKind{} },
453 .{ .name = "StorageBuffer", .value = 12, .parameters = &[_]OperandKind{} },
454 .{ .name = "CallableDataNV", .value = 5328, .parameters = &[_]OperandKind{} },
455 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &[_]OperandKind{} },
456 .{ .name = "IncomingCallableDataNV", .value = 5329, .parameters = &[_]OperandKind{} },
457 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &[_]OperandKind{} },
458 .{ .name = "RayPayloadNV", .value = 5338, .parameters = &[_]OperandKind{} },
459 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &[_]OperandKind{} },
460 .{ .name = "HitAttributeNV", .value = 5339, .parameters = &[_]OperandKind{} },
461 .{ .name = "HitAttributeKHR", .value = 5339, .parameters = &[_]OperandKind{} },
462 .{ .name = "IncomingRayPayloadNV", .value = 5342, .parameters = &[_]OperandKind{} },
463 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &[_]OperandKind{} },
464 .{ .name = "ShaderRecordBufferNV", .value = 5343, .parameters = &[_]OperandKind{} },
465 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &[_]OperandKind{} },
466 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &[_]OperandKind{} },
467 .{ .name = "PhysicalStorageBufferEXT", .value = 5349, .parameters = &[_]OperandKind{} },
468 .{ .name = "CodeSectionINTEL", .value = 5605, .parameters = &[_]OperandKind{} },
469 .{ .name = "DeviceOnlyINTEL", .value = 5936, .parameters = &[_]OperandKind{} },
470 .{ .name = "HostOnlyINTEL", .value = 5937, .parameters = &[_]OperandKind{} },
471 },
472 .Dim => &[_]Enumerant{
473 .{ .name = "1D", .value = 0, .parameters = &[_]OperandKind{} },
474 .{ .name = "2D", .value = 1, .parameters = &[_]OperandKind{} },
475 .{ .name = "3D", .value = 2, .parameters = &[_]OperandKind{} },
476 .{ .name = "Cube", .value = 3, .parameters = &[_]OperandKind{} },
477 .{ .name = "Rect", .value = 4, .parameters = &[_]OperandKind{} },
478 .{ .name = "Buffer", .value = 5, .parameters = &[_]OperandKind{} },
479 .{ .name = "SubpassData", .value = 6, .parameters = &[_]OperandKind{} },
480 },
481 .SamplerAddressingMode => &[_]Enumerant{
482 .{ .name = "None", .value = 0, .parameters = &[_]OperandKind{} },
483 .{ .name = "ClampToEdge", .value = 1, .parameters = &[_]OperandKind{} },
484 .{ .name = "Clamp", .value = 2, .parameters = &[_]OperandKind{} },
485 .{ .name = "Repeat", .value = 3, .parameters = &[_]OperandKind{} },
486 .{ .name = "RepeatMirrored", .value = 4, .parameters = &[_]OperandKind{} },
487 },
488 .SamplerFilterMode => &[_]Enumerant{
489 .{ .name = "Nearest", .value = 0, .parameters = &[_]OperandKind{} },
490 .{ .name = "Linear", .value = 1, .parameters = &[_]OperandKind{} },
491 },
492 .ImageFormat => &[_]Enumerant{
493 .{ .name = "Unknown", .value = 0, .parameters = &[_]OperandKind{} },
494 .{ .name = "Rgba32f", .value = 1, .parameters = &[_]OperandKind{} },
495 .{ .name = "Rgba16f", .value = 2, .parameters = &[_]OperandKind{} },
496 .{ .name = "R32f", .value = 3, .parameters = &[_]OperandKind{} },
497 .{ .name = "Rgba8", .value = 4, .parameters = &[_]OperandKind{} },
498 .{ .name = "Rgba8Snorm", .value = 5, .parameters = &[_]OperandKind{} },
499 .{ .name = "Rg32f", .value = 6, .parameters = &[_]OperandKind{} },
500 .{ .name = "Rg16f", .value = 7, .parameters = &[_]OperandKind{} },
501 .{ .name = "R11fG11fB10f", .value = 8, .parameters = &[_]OperandKind{} },
502 .{ .name = "R16f", .value = 9, .parameters = &[_]OperandKind{} },
503 .{ .name = "Rgba16", .value = 10, .parameters = &[_]OperandKind{} },
504 .{ .name = "Rgb10A2", .value = 11, .parameters = &[_]OperandKind{} },
505 .{ .name = "Rg16", .value = 12, .parameters = &[_]OperandKind{} },
506 .{ .name = "Rg8", .value = 13, .parameters = &[_]OperandKind{} },
507 .{ .name = "R16", .value = 14, .parameters = &[_]OperandKind{} },
508 .{ .name = "R8", .value = 15, .parameters = &[_]OperandKind{} },
509 .{ .name = "Rgba16Snorm", .value = 16, .parameters = &[_]OperandKind{} },
510 .{ .name = "Rg16Snorm", .value = 17, .parameters = &[_]OperandKind{} },
511 .{ .name = "Rg8Snorm", .value = 18, .parameters = &[_]OperandKind{} },
512 .{ .name = "R16Snorm", .value = 19, .parameters = &[_]OperandKind{} },
513 .{ .name = "R8Snorm", .value = 20, .parameters = &[_]OperandKind{} },
514 .{ .name = "Rgba32i", .value = 21, .parameters = &[_]OperandKind{} },
515 .{ .name = "Rgba16i", .value = 22, .parameters = &[_]OperandKind{} },
516 .{ .name = "Rgba8i", .value = 23, .parameters = &[_]OperandKind{} },
517 .{ .name = "R32i", .value = 24, .parameters = &[_]OperandKind{} },
518 .{ .name = "Rg32i", .value = 25, .parameters = &[_]OperandKind{} },
519 .{ .name = "Rg16i", .value = 26, .parameters = &[_]OperandKind{} },
520 .{ .name = "Rg8i", .value = 27, .parameters = &[_]OperandKind{} },
521 .{ .name = "R16i", .value = 28, .parameters = &[_]OperandKind{} },
522 .{ .name = "R8i", .value = 29, .parameters = &[_]OperandKind{} },
523 .{ .name = "Rgba32ui", .value = 30, .parameters = &[_]OperandKind{} },
524 .{ .name = "Rgba16ui", .value = 31, .parameters = &[_]OperandKind{} },
525 .{ .name = "Rgba8ui", .value = 32, .parameters = &[_]OperandKind{} },
526 .{ .name = "R32ui", .value = 33, .parameters = &[_]OperandKind{} },
527 .{ .name = "Rgb10a2ui", .value = 34, .parameters = &[_]OperandKind{} },
528 .{ .name = "Rg32ui", .value = 35, .parameters = &[_]OperandKind{} },
529 .{ .name = "Rg16ui", .value = 36, .parameters = &[_]OperandKind{} },
530 .{ .name = "Rg8ui", .value = 37, .parameters = &[_]OperandKind{} },
531 .{ .name = "R16ui", .value = 38, .parameters = &[_]OperandKind{} },
532 .{ .name = "R8ui", .value = 39, .parameters = &[_]OperandKind{} },
533 .{ .name = "R64ui", .value = 40, .parameters = &[_]OperandKind{} },
534 .{ .name = "R64i", .value = 41, .parameters = &[_]OperandKind{} },
535 },
536 .ImageChannelOrder => &[_]Enumerant{
537 .{ .name = "R", .value = 0, .parameters = &[_]OperandKind{} },
538 .{ .name = "A", .value = 1, .parameters = &[_]OperandKind{} },
539 .{ .name = "RG", .value = 2, .parameters = &[_]OperandKind{} },
540 .{ .name = "RA", .value = 3, .parameters = &[_]OperandKind{} },
541 .{ .name = "RGB", .value = 4, .parameters = &[_]OperandKind{} },
542 .{ .name = "RGBA", .value = 5, .parameters = &[_]OperandKind{} },
543 .{ .name = "BGRA", .value = 6, .parameters = &[_]OperandKind{} },
544 .{ .name = "ARGB", .value = 7, .parameters = &[_]OperandKind{} },
545 .{ .name = "Intensity", .value = 8, .parameters = &[_]OperandKind{} },
546 .{ .name = "Luminance", .value = 9, .parameters = &[_]OperandKind{} },
547 .{ .name = "Rx", .value = 10, .parameters = &[_]OperandKind{} },
548 .{ .name = "RGx", .value = 11, .parameters = &[_]OperandKind{} },
549 .{ .name = "RGBx", .value = 12, .parameters = &[_]OperandKind{} },
550 .{ .name = "Depth", .value = 13, .parameters = &[_]OperandKind{} },
551 .{ .name = "DepthStencil", .value = 14, .parameters = &[_]OperandKind{} },
552 .{ .name = "sRGB", .value = 15, .parameters = &[_]OperandKind{} },
553 .{ .name = "sRGBx", .value = 16, .parameters = &[_]OperandKind{} },
554 .{ .name = "sRGBA", .value = 17, .parameters = &[_]OperandKind{} },
555 .{ .name = "sBGRA", .value = 18, .parameters = &[_]OperandKind{} },
556 .{ .name = "ABGR", .value = 19, .parameters = &[_]OperandKind{} },
557 },
558 .ImageChannelDataType => &[_]Enumerant{
559 .{ .name = "SnormInt8", .value = 0, .parameters = &[_]OperandKind{} },
560 .{ .name = "SnormInt16", .value = 1, .parameters = &[_]OperandKind{} },
561 .{ .name = "UnormInt8", .value = 2, .parameters = &[_]OperandKind{} },
562 .{ .name = "UnormInt16", .value = 3, .parameters = &[_]OperandKind{} },
563 .{ .name = "UnormShort565", .value = 4, .parameters = &[_]OperandKind{} },
564 .{ .name = "UnormShort555", .value = 5, .parameters = &[_]OperandKind{} },
565 .{ .name = "UnormInt101010", .value = 6, .parameters = &[_]OperandKind{} },
566 .{ .name = "SignedInt8", .value = 7, .parameters = &[_]OperandKind{} },
567 .{ .name = "SignedInt16", .value = 8, .parameters = &[_]OperandKind{} },
568 .{ .name = "SignedInt32", .value = 9, .parameters = &[_]OperandKind{} },
569 .{ .name = "UnsignedInt8", .value = 10, .parameters = &[_]OperandKind{} },
570 .{ .name = "UnsignedInt16", .value = 11, .parameters = &[_]OperandKind{} },
571 .{ .name = "UnsignedInt32", .value = 12, .parameters = &[_]OperandKind{} },
572 .{ .name = "HalfFloat", .value = 13, .parameters = &[_]OperandKind{} },
573 .{ .name = "Float", .value = 14, .parameters = &[_]OperandKind{} },
574 .{ .name = "UnormInt24", .value = 15, .parameters = &[_]OperandKind{} },
575 .{ .name = "UnormInt101010_2", .value = 16, .parameters = &[_]OperandKind{} },
576 },
577 .FPRoundingMode => &[_]Enumerant{
578 .{ .name = "RTE", .value = 0, .parameters = &[_]OperandKind{} },
579 .{ .name = "RTZ", .value = 1, .parameters = &[_]OperandKind{} },
580 .{ .name = "RTP", .value = 2, .parameters = &[_]OperandKind{} },
581 .{ .name = "RTN", .value = 3, .parameters = &[_]OperandKind{} },
582 },
583 .FPDenormMode => &[_]Enumerant{
584 .{ .name = "Preserve", .value = 0, .parameters = &[_]OperandKind{} },
585 .{ .name = "FlushToZero", .value = 1, .parameters = &[_]OperandKind{} },
586 },
587 .QuantizationModes => &[_]Enumerant{
588 .{ .name = "TRN", .value = 0, .parameters = &[_]OperandKind{} },
589 .{ .name = "TRN_ZERO", .value = 1, .parameters = &[_]OperandKind{} },
590 .{ .name = "RND", .value = 2, .parameters = &[_]OperandKind{} },
591 .{ .name = "RND_ZERO", .value = 3, .parameters = &[_]OperandKind{} },
592 .{ .name = "RND_INF", .value = 4, .parameters = &[_]OperandKind{} },
593 .{ .name = "RND_MIN_INF", .value = 5, .parameters = &[_]OperandKind{} },
594 .{ .name = "RND_CONV", .value = 6, .parameters = &[_]OperandKind{} },
595 .{ .name = "RND_CONV_ODD", .value = 7, .parameters = &[_]OperandKind{} },
596 },
597 .FPOperationMode => &[_]Enumerant{
598 .{ .name = "IEEE", .value = 0, .parameters = &[_]OperandKind{} },
599 .{ .name = "ALT", .value = 1, .parameters = &[_]OperandKind{} },
600 },
601 .OverflowModes => &[_]Enumerant{
602 .{ .name = "WRAP", .value = 0, .parameters = &[_]OperandKind{} },
603 .{ .name = "SAT", .value = 1, .parameters = &[_]OperandKind{} },
604 .{ .name = "SAT_ZERO", .value = 2, .parameters = &[_]OperandKind{} },
605 .{ .name = "SAT_SYM", .value = 3, .parameters = &[_]OperandKind{} },
606 },
607 .LinkageType => &[_]Enumerant{
608 .{ .name = "Export", .value = 0, .parameters = &[_]OperandKind{} },
609 .{ .name = "Import", .value = 1, .parameters = &[_]OperandKind{} },
610 .{ .name = "LinkOnceODR", .value = 2, .parameters = &[_]OperandKind{} },
611 },
612 .AccessQualifier => &[_]Enumerant{
613 .{ .name = "ReadOnly", .value = 0, .parameters = &[_]OperandKind{} },
614 .{ .name = "WriteOnly", .value = 1, .parameters = &[_]OperandKind{} },
615 .{ .name = "ReadWrite", .value = 2, .parameters = &[_]OperandKind{} },
616 },
617 .FunctionParameterAttribute => &[_]Enumerant{
618 .{ .name = "Zext", .value = 0, .parameters = &[_]OperandKind{} },
619 .{ .name = "Sext", .value = 1, .parameters = &[_]OperandKind{} },
620 .{ .name = "ByVal", .value = 2, .parameters = &[_]OperandKind{} },
621 .{ .name = "Sret", .value = 3, .parameters = &[_]OperandKind{} },
622 .{ .name = "NoAlias", .value = 4, .parameters = &[_]OperandKind{} },
623 .{ .name = "NoCapture", .value = 5, .parameters = &[_]OperandKind{} },
624 .{ .name = "NoWrite", .value = 6, .parameters = &[_]OperandKind{} },
625 .{ .name = "NoReadWrite", .value = 7, .parameters = &[_]OperandKind{} },
626 },
627 .Decoration => &[_]Enumerant{
628 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &[_]OperandKind{} },
629 .{ .name = "SpecId", .value = 1, .parameters = &[_]OperandKind{.LiteralInteger} },
630 .{ .name = "Block", .value = 2, .parameters = &[_]OperandKind{} },
631 .{ .name = "BufferBlock", .value = 3, .parameters = &[_]OperandKind{} },
632 .{ .name = "RowMajor", .value = 4, .parameters = &[_]OperandKind{} },
633 .{ .name = "ColMajor", .value = 5, .parameters = &[_]OperandKind{} },
634 .{ .name = "ArrayStride", .value = 6, .parameters = &[_]OperandKind{.LiteralInteger} },
635 .{ .name = "MatrixStride", .value = 7, .parameters = &[_]OperandKind{.LiteralInteger} },
636 .{ .name = "GLSLShared", .value = 8, .parameters = &[_]OperandKind{} },
637 .{ .name = "GLSLPacked", .value = 9, .parameters = &[_]OperandKind{} },
638 .{ .name = "CPacked", .value = 10, .parameters = &[_]OperandKind{} },
639 .{ .name = "BuiltIn", .value = 11, .parameters = &[_]OperandKind{.BuiltIn} },
640 .{ .name = "NoPerspective", .value = 13, .parameters = &[_]OperandKind{} },
641 .{ .name = "Flat", .value = 14, .parameters = &[_]OperandKind{} },
642 .{ .name = "Patch", .value = 15, .parameters = &[_]OperandKind{} },
643 .{ .name = "Centroid", .value = 16, .parameters = &[_]OperandKind{} },
644 .{ .name = "Sample", .value = 17, .parameters = &[_]OperandKind{} },
645 .{ .name = "Invariant", .value = 18, .parameters = &[_]OperandKind{} },
646 .{ .name = "Restrict", .value = 19, .parameters = &[_]OperandKind{} },
647 .{ .name = "Aliased", .value = 20, .parameters = &[_]OperandKind{} },
648 .{ .name = "Volatile", .value = 21, .parameters = &[_]OperandKind{} },
649 .{ .name = "Constant", .value = 22, .parameters = &[_]OperandKind{} },
650 .{ .name = "Coherent", .value = 23, .parameters = &[_]OperandKind{} },
651 .{ .name = "NonWritable", .value = 24, .parameters = &[_]OperandKind{} },
652 .{ .name = "NonReadable", .value = 25, .parameters = &[_]OperandKind{} },
653 .{ .name = "Uniform", .value = 26, .parameters = &[_]OperandKind{} },
654 .{ .name = "UniformId", .value = 27, .parameters = &[_]OperandKind{.IdScope} },
655 .{ .name = "SaturatedConversion", .value = 28, .parameters = &[_]OperandKind{} },
656 .{ .name = "Stream", .value = 29, .parameters = &[_]OperandKind{.LiteralInteger} },
657 .{ .name = "Location", .value = 30, .parameters = &[_]OperandKind{.LiteralInteger} },
658 .{ .name = "Component", .value = 31, .parameters = &[_]OperandKind{.LiteralInteger} },
659 .{ .name = "Index", .value = 32, .parameters = &[_]OperandKind{.LiteralInteger} },
660 .{ .name = "Binding", .value = 33, .parameters = &[_]OperandKind{.LiteralInteger} },
661 .{ .name = "DescriptorSet", .value = 34, .parameters = &[_]OperandKind{.LiteralInteger} },
662 .{ .name = "Offset", .value = 35, .parameters = &[_]OperandKind{.LiteralInteger} },
663 .{ .name = "XfbBuffer", .value = 36, .parameters = &[_]OperandKind{.LiteralInteger} },
664 .{ .name = "XfbStride", .value = 37, .parameters = &[_]OperandKind{.LiteralInteger} },
665 .{ .name = "FuncParamAttr", .value = 38, .parameters = &[_]OperandKind{.FunctionParameterAttribute} },
666 .{ .name = "FPRoundingMode", .value = 39, .parameters = &[_]OperandKind{.FPRoundingMode} },
667 .{ .name = "FPFastMathMode", .value = 40, .parameters = &[_]OperandKind{.FPFastMathMode} },
668 .{ .name = "LinkageAttributes", .value = 41, .parameters = &[_]OperandKind{ .LiteralString, .LinkageType } },
669 .{ .name = "NoContraction", .value = 42, .parameters = &[_]OperandKind{} },
670 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &[_]OperandKind{.LiteralInteger} },
671 .{ .name = "Alignment", .value = 44, .parameters = &[_]OperandKind{.LiteralInteger} },
672 .{ .name = "MaxByteOffset", .value = 45, .parameters = &[_]OperandKind{.LiteralInteger} },
673 .{ .name = "AlignmentId", .value = 46, .parameters = &[_]OperandKind{.IdRef} },
674 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &[_]OperandKind{.IdRef} },
675 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &[_]OperandKind{} },
676 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &[_]OperandKind{} },
677 .{ .name = "ExplicitInterpAMD", .value = 4999, .parameters = &[_]OperandKind{} },
678 .{ .name = "OverrideCoverageNV", .value = 5248, .parameters = &[_]OperandKind{} },
679 .{ .name = "PassthroughNV", .value = 5250, .parameters = &[_]OperandKind{} },
680 .{ .name = "ViewportRelativeNV", .value = 5252, .parameters = &[_]OperandKind{} },
681 .{ .name = "SecondaryViewportRelativeNV", .value = 5256, .parameters = &[_]OperandKind{.LiteralInteger} },
682 .{ .name = "PerPrimitiveNV", .value = 5271, .parameters = &[_]OperandKind{} },
683 .{ .name = "PerViewNV", .value = 5272, .parameters = &[_]OperandKind{} },
684 .{ .name = "PerTaskNV", .value = 5273, .parameters = &[_]OperandKind{} },
685 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &[_]OperandKind{} },
686 .{ .name = "PerVertexNV", .value = 5285, .parameters = &[_]OperandKind{} },
687 .{ .name = "NonUniform", .value = 5300, .parameters = &[_]OperandKind{} },
688 .{ .name = "NonUniformEXT", .value = 5300, .parameters = &[_]OperandKind{} },
689 .{ .name = "RestrictPointer", .value = 5355, .parameters = &[_]OperandKind{} },
690 .{ .name = "RestrictPointerEXT", .value = 5355, .parameters = &[_]OperandKind{} },
691 .{ .name = "AliasedPointer", .value = 5356, .parameters = &[_]OperandKind{} },
692 .{ .name = "AliasedPointerEXT", .value = 5356, .parameters = &[_]OperandKind{} },
693 .{ .name = "BindlessSamplerNV", .value = 5398, .parameters = &[_]OperandKind{} },
694 .{ .name = "BindlessImageNV", .value = 5399, .parameters = &[_]OperandKind{} },
695 .{ .name = "BoundSamplerNV", .value = 5400, .parameters = &[_]OperandKind{} },
696 .{ .name = "BoundImageNV", .value = 5401, .parameters = &[_]OperandKind{} },
697 .{ .name = "SIMTCallINTEL", .value = 5599, .parameters = &[_]OperandKind{.LiteralInteger} },
698 .{ .name = "ReferencedIndirectlyINTEL", .value = 5602, .parameters = &[_]OperandKind{} },
699 .{ .name = "ClobberINTEL", .value = 5607, .parameters = &[_]OperandKind{.LiteralString} },
700 .{ .name = "SideEffectsINTEL", .value = 5608, .parameters = &[_]OperandKind{} },
701 .{ .name = "VectorComputeVariableINTEL", .value = 5624, .parameters = &[_]OperandKind{} },
702 .{ .name = "FuncParamIOKindINTEL", .value = 5625, .parameters = &[_]OperandKind{.LiteralInteger} },
703 .{ .name = "VectorComputeFunctionINTEL", .value = 5626, .parameters = &[_]OperandKind{} },
704 .{ .name = "StackCallINTEL", .value = 5627, .parameters = &[_]OperandKind{} },
705 .{ .name = "GlobalVariableOffsetINTEL", .value = 5628, .parameters = &[_]OperandKind{.LiteralInteger} },
706 .{ .name = "CounterBuffer", .value = 5634, .parameters = &[_]OperandKind{.IdRef} },
707 .{ .name = "HlslCounterBufferGOOGLE", .value = 5634, .parameters = &[_]OperandKind{.IdRef} },
708 .{ .name = "UserSemantic", .value = 5635, .parameters = &[_]OperandKind{.LiteralString} },
709 .{ .name = "HlslSemanticGOOGLE", .value = 5635, .parameters = &[_]OperandKind{.LiteralString} },
710 .{ .name = "UserTypeGOOGLE", .value = 5636, .parameters = &[_]OperandKind{.LiteralString} },
711 .{ .name = "FunctionRoundingModeINTEL", .value = 5822, .parameters = &[_]OperandKind{ .LiteralInteger, .FPRoundingMode } },
712 .{ .name = "FunctionDenormModeINTEL", .value = 5823, .parameters = &[_]OperandKind{ .LiteralInteger, .FPDenormMode } },
713 .{ .name = "RegisterINTEL", .value = 5825, .parameters = &[_]OperandKind{} },
714 .{ .name = "MemoryINTEL", .value = 5826, .parameters = &[_]OperandKind{.LiteralString} },
715 .{ .name = "NumbanksINTEL", .value = 5827, .parameters = &[_]OperandKind{.LiteralInteger} },
716 .{ .name = "BankwidthINTEL", .value = 5828, .parameters = &[_]OperandKind{.LiteralInteger} },
717 .{ .name = "MaxPrivateCopiesINTEL", .value = 5829, .parameters = &[_]OperandKind{.LiteralInteger} },
718 .{ .name = "SinglepumpINTEL", .value = 5830, .parameters = &[_]OperandKind{} },
719 .{ .name = "DoublepumpINTEL", .value = 5831, .parameters = &[_]OperandKind{} },
720 .{ .name = "MaxReplicatesINTEL", .value = 5832, .parameters = &[_]OperandKind{.LiteralInteger} },
721 .{ .name = "SimpleDualPortINTEL", .value = 5833, .parameters = &[_]OperandKind{} },
722 .{ .name = "MergeINTEL", .value = 5834, .parameters = &[_]OperandKind{ .LiteralString, .LiteralString } },
723 .{ .name = "BankBitsINTEL", .value = 5835, .parameters = &[_]OperandKind{.LiteralInteger} },
724 .{ .name = "ForcePow2DepthINTEL", .value = 5836, .parameters = &[_]OperandKind{.LiteralInteger} },
725 .{ .name = "BurstCoalesceINTEL", .value = 5899, .parameters = &[_]OperandKind{} },
726 .{ .name = "CacheSizeINTEL", .value = 5900, .parameters = &[_]OperandKind{.LiteralInteger} },
727 .{ .name = "DontStaticallyCoalesceINTEL", .value = 5901, .parameters = &[_]OperandKind{} },
728 .{ .name = "PrefetchINTEL", .value = 5902, .parameters = &[_]OperandKind{.LiteralInteger} },
729 .{ .name = "StallEnableINTEL", .value = 5905, .parameters = &[_]OperandKind{} },
730 .{ .name = "FuseLoopsInFunctionINTEL", .value = 5907, .parameters = &[_]OperandKind{} },
731 .{ .name = "BufferLocationINTEL", .value = 5921, .parameters = &[_]OperandKind{.LiteralInteger} },
732 .{ .name = "IOPipeStorageINTEL", .value = 5944, .parameters = &[_]OperandKind{.LiteralInteger} },
733 .{ .name = "FunctionFloatingPointModeINTEL", .value = 6080, .parameters = &[_]OperandKind{ .LiteralInteger, .FPOperationMode } },
734 .{ .name = "SingleElementVectorINTEL", .value = 6085, .parameters = &[_]OperandKind{} },
735 .{ .name = "VectorComputeCallableFunctionINTEL", .value = 6087, .parameters = &[_]OperandKind{} },
736 .{ .name = "MediaBlockIOINTEL", .value = 6140, .parameters = &[_]OperandKind{} },
737 },
738 .BuiltIn => &[_]Enumerant{
739 .{ .name = "Position", .value = 0, .parameters = &[_]OperandKind{} },
740 .{ .name = "PointSize", .value = 1, .parameters = &[_]OperandKind{} },
741 .{ .name = "ClipDistance", .value = 3, .parameters = &[_]OperandKind{} },
742 .{ .name = "CullDistance", .value = 4, .parameters = &[_]OperandKind{} },
743 .{ .name = "VertexId", .value = 5, .parameters = &[_]OperandKind{} },
744 .{ .name = "InstanceId", .value = 6, .parameters = &[_]OperandKind{} },
745 .{ .name = "PrimitiveId", .value = 7, .parameters = &[_]OperandKind{} },
746 .{ .name = "InvocationId", .value = 8, .parameters = &[_]OperandKind{} },
747 .{ .name = "Layer", .value = 9, .parameters = &[_]OperandKind{} },
748 .{ .name = "ViewportIndex", .value = 10, .parameters = &[_]OperandKind{} },
749 .{ .name = "TessLevelOuter", .value = 11, .parameters = &[_]OperandKind{} },
750 .{ .name = "TessLevelInner", .value = 12, .parameters = &[_]OperandKind{} },
751 .{ .name = "TessCoord", .value = 13, .parameters = &[_]OperandKind{} },
752 .{ .name = "PatchVertices", .value = 14, .parameters = &[_]OperandKind{} },
753 .{ .name = "FragCoord", .value = 15, .parameters = &[_]OperandKind{} },
754 .{ .name = "PointCoord", .value = 16, .parameters = &[_]OperandKind{} },
755 .{ .name = "FrontFacing", .value = 17, .parameters = &[_]OperandKind{} },
756 .{ .name = "SampleId", .value = 18, .parameters = &[_]OperandKind{} },
757 .{ .name = "SamplePosition", .value = 19, .parameters = &[_]OperandKind{} },
758 .{ .name = "SampleMask", .value = 20, .parameters = &[_]OperandKind{} },
759 .{ .name = "FragDepth", .value = 22, .parameters = &[_]OperandKind{} },
760 .{ .name = "HelperInvocation", .value = 23, .parameters = &[_]OperandKind{} },
761 .{ .name = "NumWorkgroups", .value = 24, .parameters = &[_]OperandKind{} },
762 .{ .name = "WorkgroupSize", .value = 25, .parameters = &[_]OperandKind{} },
763 .{ .name = "WorkgroupId", .value = 26, .parameters = &[_]OperandKind{} },
764 .{ .name = "LocalInvocationId", .value = 27, .parameters = &[_]OperandKind{} },
765 .{ .name = "GlobalInvocationId", .value = 28, .parameters = &[_]OperandKind{} },
766 .{ .name = "LocalInvocationIndex", .value = 29, .parameters = &[_]OperandKind{} },
767 .{ .name = "WorkDim", .value = 30, .parameters = &[_]OperandKind{} },
768 .{ .name = "GlobalSize", .value = 31, .parameters = &[_]OperandKind{} },
769 .{ .name = "EnqueuedWorkgroupSize", .value = 32, .parameters = &[_]OperandKind{} },
770 .{ .name = "GlobalOffset", .value = 33, .parameters = &[_]OperandKind{} },
771 .{ .name = "GlobalLinearId", .value = 34, .parameters = &[_]OperandKind{} },
772 .{ .name = "SubgroupSize", .value = 36, .parameters = &[_]OperandKind{} },
773 .{ .name = "SubgroupMaxSize", .value = 37, .parameters = &[_]OperandKind{} },
774 .{ .name = "NumSubgroups", .value = 38, .parameters = &[_]OperandKind{} },
775 .{ .name = "NumEnqueuedSubgroups", .value = 39, .parameters = &[_]OperandKind{} },
776 .{ .name = "SubgroupId", .value = 40, .parameters = &[_]OperandKind{} },
777 .{ .name = "SubgroupLocalInvocationId", .value = 41, .parameters = &[_]OperandKind{} },
778 .{ .name = "VertexIndex", .value = 42, .parameters = &[_]OperandKind{} },
779 .{ .name = "InstanceIndex", .value = 43, .parameters = &[_]OperandKind{} },
780 .{ .name = "SubgroupEqMask", .value = 4416, .parameters = &[_]OperandKind{} },
781 .{ .name = "SubgroupEqMaskKHR", .value = 4416, .parameters = &[_]OperandKind{} },
782 .{ .name = "SubgroupGeMask", .value = 4417, .parameters = &[_]OperandKind{} },
783 .{ .name = "SubgroupGeMaskKHR", .value = 4417, .parameters = &[_]OperandKind{} },
784 .{ .name = "SubgroupGtMask", .value = 4418, .parameters = &[_]OperandKind{} },
785 .{ .name = "SubgroupGtMaskKHR", .value = 4418, .parameters = &[_]OperandKind{} },
786 .{ .name = "SubgroupLeMask", .value = 4419, .parameters = &[_]OperandKind{} },
787 .{ .name = "SubgroupLeMaskKHR", .value = 4419, .parameters = &[_]OperandKind{} },
788 .{ .name = "SubgroupLtMask", .value = 4420, .parameters = &[_]OperandKind{} },
789 .{ .name = "SubgroupLtMaskKHR", .value = 4420, .parameters = &[_]OperandKind{} },
790 .{ .name = "BaseVertex", .value = 4424, .parameters = &[_]OperandKind{} },
791 .{ .name = "BaseInstance", .value = 4425, .parameters = &[_]OperandKind{} },
792 .{ .name = "DrawIndex", .value = 4426, .parameters = &[_]OperandKind{} },
793 .{ .name = "PrimitiveShadingRateKHR", .value = 4432, .parameters = &[_]OperandKind{} },
794 .{ .name = "DeviceIndex", .value = 4438, .parameters = &[_]OperandKind{} },
795 .{ .name = "ViewIndex", .value = 4440, .parameters = &[_]OperandKind{} },
796 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &[_]OperandKind{} },
797 .{ .name = "BaryCoordNoPerspAMD", .value = 4992, .parameters = &[_]OperandKind{} },
798 .{ .name = "BaryCoordNoPerspCentroidAMD", .value = 4993, .parameters = &[_]OperandKind{} },
799 .{ .name = "BaryCoordNoPerspSampleAMD", .value = 4994, .parameters = &[_]OperandKind{} },
800 .{ .name = "BaryCoordSmoothAMD", .value = 4995, .parameters = &[_]OperandKind{} },
801 .{ .name = "BaryCoordSmoothCentroidAMD", .value = 4996, .parameters = &[_]OperandKind{} },
802 .{ .name = "BaryCoordSmoothSampleAMD", .value = 4997, .parameters = &[_]OperandKind{} },
803 .{ .name = "BaryCoordPullModelAMD", .value = 4998, .parameters = &[_]OperandKind{} },
804 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &[_]OperandKind{} },
805 .{ .name = "ViewportMaskNV", .value = 5253, .parameters = &[_]OperandKind{} },
806 .{ .name = "SecondaryPositionNV", .value = 5257, .parameters = &[_]OperandKind{} },
807 .{ .name = "SecondaryViewportMaskNV", .value = 5258, .parameters = &[_]OperandKind{} },
808 .{ .name = "PositionPerViewNV", .value = 5261, .parameters = &[_]OperandKind{} },
809 .{ .name = "ViewportMaskPerViewNV", .value = 5262, .parameters = &[_]OperandKind{} },
810 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &[_]OperandKind{} },
811 .{ .name = "TaskCountNV", .value = 5274, .parameters = &[_]OperandKind{} },
812 .{ .name = "PrimitiveCountNV", .value = 5275, .parameters = &[_]OperandKind{} },
813 .{ .name = "PrimitiveIndicesNV", .value = 5276, .parameters = &[_]OperandKind{} },
814 .{ .name = "ClipDistancePerViewNV", .value = 5277, .parameters = &[_]OperandKind{} },
815 .{ .name = "CullDistancePerViewNV", .value = 5278, .parameters = &[_]OperandKind{} },
816 .{ .name = "LayerPerViewNV", .value = 5279, .parameters = &[_]OperandKind{} },
817 .{ .name = "MeshViewCountNV", .value = 5280, .parameters = &[_]OperandKind{} },
818 .{ .name = "MeshViewIndicesNV", .value = 5281, .parameters = &[_]OperandKind{} },
819 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &[_]OperandKind{} },
820 .{ .name = "BaryCoordNV", .value = 5286, .parameters = &[_]OperandKind{} },
821 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &[_]OperandKind{} },
822 .{ .name = "BaryCoordNoPerspNV", .value = 5287, .parameters = &[_]OperandKind{} },
823 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &[_]OperandKind{} },
824 .{ .name = "FragmentSizeNV", .value = 5292, .parameters = &[_]OperandKind{} },
825 .{ .name = "FragInvocationCountEXT", .value = 5293, .parameters = &[_]OperandKind{} },
826 .{ .name = "InvocationsPerPixelNV", .value = 5293, .parameters = &[_]OperandKind{} },
827 .{ .name = "LaunchIdNV", .value = 5319, .parameters = &[_]OperandKind{} },
828 .{ .name = "LaunchIdKHR", .value = 5319, .parameters = &[_]OperandKind{} },
829 .{ .name = "LaunchSizeNV", .value = 5320, .parameters = &[_]OperandKind{} },
830 .{ .name = "LaunchSizeKHR", .value = 5320, .parameters = &[_]OperandKind{} },
831 .{ .name = "WorldRayOriginNV", .value = 5321, .parameters = &[_]OperandKind{} },
832 .{ .name = "WorldRayOriginKHR", .value = 5321, .parameters = &[_]OperandKind{} },
833 .{ .name = "WorldRayDirectionNV", .value = 5322, .parameters = &[_]OperandKind{} },
834 .{ .name = "WorldRayDirectionKHR", .value = 5322, .parameters = &[_]OperandKind{} },
835 .{ .name = "ObjectRayOriginNV", .value = 5323, .parameters = &[_]OperandKind{} },
836 .{ .name = "ObjectRayOriginKHR", .value = 5323, .parameters = &[_]OperandKind{} },
837 .{ .name = "ObjectRayDirectionNV", .value = 5324, .parameters = &[_]OperandKind{} },
838 .{ .name = "ObjectRayDirectionKHR", .value = 5324, .parameters = &[_]OperandKind{} },
839 .{ .name = "RayTminNV", .value = 5325, .parameters = &[_]OperandKind{} },
840 .{ .name = "RayTminKHR", .value = 5325, .parameters = &[_]OperandKind{} },
841 .{ .name = "RayTmaxNV", .value = 5326, .parameters = &[_]OperandKind{} },
842 .{ .name = "RayTmaxKHR", .value = 5326, .parameters = &[_]OperandKind{} },
843 .{ .name = "InstanceCustomIndexNV", .value = 5327, .parameters = &[_]OperandKind{} },
844 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &[_]OperandKind{} },
845 .{ .name = "ObjectToWorldNV", .value = 5330, .parameters = &[_]OperandKind{} },
846 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &[_]OperandKind{} },
847 .{ .name = "WorldToObjectNV", .value = 5331, .parameters = &[_]OperandKind{} },
848 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &[_]OperandKind{} },
849 .{ .name = "HitTNV", .value = 5332, .parameters = &[_]OperandKind{} },
850 .{ .name = "HitKindNV", .value = 5333, .parameters = &[_]OperandKind{} },
851 .{ .name = "HitKindKHR", .value = 5333, .parameters = &[_]OperandKind{} },
852 .{ .name = "CurrentRayTimeNV", .value = 5334, .parameters = &[_]OperandKind{} },
853 .{ .name = "IncomingRayFlagsNV", .value = 5351, .parameters = &[_]OperandKind{} },
854 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &[_]OperandKind{} },
855 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &[_]OperandKind{} },
856 .{ .name = "WarpsPerSMNV", .value = 5374, .parameters = &[_]OperandKind{} },
857 .{ .name = "SMCountNV", .value = 5375, .parameters = &[_]OperandKind{} },
858 .{ .name = "WarpIDNV", .value = 5376, .parameters = &[_]OperandKind{} },
859 .{ .name = "SMIDNV", .value = 5377, .parameters = &[_]OperandKind{} },
860 },
861 .Scope => &[_]Enumerant{
862 .{ .name = "CrossDevice", .value = 0, .parameters = &[_]OperandKind{} },
863 .{ .name = "Device", .value = 1, .parameters = &[_]OperandKind{} },
864 .{ .name = "Workgroup", .value = 2, .parameters = &[_]OperandKind{} },
865 .{ .name = "Subgroup", .value = 3, .parameters = &[_]OperandKind{} },
866 .{ .name = "Invocation", .value = 4, .parameters = &[_]OperandKind{} },
867 .{ .name = "QueueFamily", .value = 5, .parameters = &[_]OperandKind{} },
868 .{ .name = "QueueFamilyKHR", .value = 5, .parameters = &[_]OperandKind{} },
869 .{ .name = "ShaderCallKHR", .value = 6, .parameters = &[_]OperandKind{} },
870 },
871 .GroupOperation => &[_]Enumerant{
872 .{ .name = "Reduce", .value = 0, .parameters = &[_]OperandKind{} },
873 .{ .name = "InclusiveScan", .value = 1, .parameters = &[_]OperandKind{} },
874 .{ .name = "ExclusiveScan", .value = 2, .parameters = &[_]OperandKind{} },
875 .{ .name = "ClusteredReduce", .value = 3, .parameters = &[_]OperandKind{} },
876 .{ .name = "PartitionedReduceNV", .value = 6, .parameters = &[_]OperandKind{} },
877 .{ .name = "PartitionedInclusiveScanNV", .value = 7, .parameters = &[_]OperandKind{} },
878 .{ .name = "PartitionedExclusiveScanNV", .value = 8, .parameters = &[_]OperandKind{} },
879 },
880 .KernelEnqueueFlags => &[_]Enumerant{
881 .{ .name = "NoWait", .value = 0, .parameters = &[_]OperandKind{} },
882 .{ .name = "WaitKernel", .value = 1, .parameters = &[_]OperandKind{} },
883 .{ .name = "WaitWorkGroup", .value = 2, .parameters = &[_]OperandKind{} },
884 },
885 .Capability => &[_]Enumerant{
886 .{ .name = "Matrix", .value = 0, .parameters = &[_]OperandKind{} },
887 .{ .name = "Shader", .value = 1, .parameters = &[_]OperandKind{} },
888 .{ .name = "Geometry", .value = 2, .parameters = &[_]OperandKind{} },
889 .{ .name = "Tessellation", .value = 3, .parameters = &[_]OperandKind{} },
890 .{ .name = "Addresses", .value = 4, .parameters = &[_]OperandKind{} },
891 .{ .name = "Linkage", .value = 5, .parameters = &[_]OperandKind{} },
892 .{ .name = "Kernel", .value = 6, .parameters = &[_]OperandKind{} },
893 .{ .name = "Vector16", .value = 7, .parameters = &[_]OperandKind{} },
894 .{ .name = "Float16Buffer", .value = 8, .parameters = &[_]OperandKind{} },
895 .{ .name = "Float16", .value = 9, .parameters = &[_]OperandKind{} },
896 .{ .name = "Float64", .value = 10, .parameters = &[_]OperandKind{} },
897 .{ .name = "Int64", .value = 11, .parameters = &[_]OperandKind{} },
898 .{ .name = "Int64Atomics", .value = 12, .parameters = &[_]OperandKind{} },
899 .{ .name = "ImageBasic", .value = 13, .parameters = &[_]OperandKind{} },
900 .{ .name = "ImageReadWrite", .value = 14, .parameters = &[_]OperandKind{} },
901 .{ .name = "ImageMipmap", .value = 15, .parameters = &[_]OperandKind{} },
902 .{ .name = "Pipes", .value = 17, .parameters = &[_]OperandKind{} },
903 .{ .name = "Groups", .value = 18, .parameters = &[_]OperandKind{} },
904 .{ .name = "DeviceEnqueue", .value = 19, .parameters = &[_]OperandKind{} },
905 .{ .name = "LiteralSampler", .value = 20, .parameters = &[_]OperandKind{} },
906 .{ .name = "AtomicStorage", .value = 21, .parameters = &[_]OperandKind{} },
907 .{ .name = "Int16", .value = 22, .parameters = &[_]OperandKind{} },
908 .{ .name = "TessellationPointSize", .value = 23, .parameters = &[_]OperandKind{} },
909 .{ .name = "GeometryPointSize", .value = 24, .parameters = &[_]OperandKind{} },
910 .{ .name = "ImageGatherExtended", .value = 25, .parameters = &[_]OperandKind{} },
911 .{ .name = "StorageImageMultisample", .value = 27, .parameters = &[_]OperandKind{} },
912 .{ .name = "UniformBufferArrayDynamicIndexing", .value = 28, .parameters = &[_]OperandKind{} },
913 .{ .name = "SampledImageArrayDynamicIndexing", .value = 29, .parameters = &[_]OperandKind{} },
914 .{ .name = "StorageBufferArrayDynamicIndexing", .value = 30, .parameters = &[_]OperandKind{} },
915 .{ .name = "StorageImageArrayDynamicIndexing", .value = 31, .parameters = &[_]OperandKind{} },
916 .{ .name = "ClipDistance", .value = 32, .parameters = &[_]OperandKind{} },
917 .{ .name = "CullDistance", .value = 33, .parameters = &[_]OperandKind{} },
918 .{ .name = "ImageCubeArray", .value = 34, .parameters = &[_]OperandKind{} },
919 .{ .name = "SampleRateShading", .value = 35, .parameters = &[_]OperandKind{} },
920 .{ .name = "ImageRect", .value = 36, .parameters = &[_]OperandKind{} },
921 .{ .name = "SampledRect", .value = 37, .parameters = &[_]OperandKind{} },
922 .{ .name = "GenericPointer", .value = 38, .parameters = &[_]OperandKind{} },
923 .{ .name = "Int8", .value = 39, .parameters = &[_]OperandKind{} },
924 .{ .name = "InputAttachment", .value = 40, .parameters = &[_]OperandKind{} },
925 .{ .name = "SparseResidency", .value = 41, .parameters = &[_]OperandKind{} },
926 .{ .name = "MinLod", .value = 42, .parameters = &[_]OperandKind{} },
927 .{ .name = "Sampled1D", .value = 43, .parameters = &[_]OperandKind{} },
928 .{ .name = "Image1D", .value = 44, .parameters = &[_]OperandKind{} },
929 .{ .name = "SampledCubeArray", .value = 45, .parameters = &[_]OperandKind{} },
930 .{ .name = "SampledBuffer", .value = 46, .parameters = &[_]OperandKind{} },
931 .{ .name = "ImageBuffer", .value = 47, .parameters = &[_]OperandKind{} },
932 .{ .name = "ImageMSArray", .value = 48, .parameters = &[_]OperandKind{} },
933 .{ .name = "StorageImageExtendedFormats", .value = 49, .parameters = &[_]OperandKind{} },
934 .{ .name = "ImageQuery", .value = 50, .parameters = &[_]OperandKind{} },
935 .{ .name = "DerivativeControl", .value = 51, .parameters = &[_]OperandKind{} },
936 .{ .name = "InterpolationFunction", .value = 52, .parameters = &[_]OperandKind{} },
937 .{ .name = "TransformFeedback", .value = 53, .parameters = &[_]OperandKind{} },
938 .{ .name = "GeometryStreams", .value = 54, .parameters = &[_]OperandKind{} },
939 .{ .name = "StorageImageReadWithoutFormat", .value = 55, .parameters = &[_]OperandKind{} },
940 .{ .name = "StorageImageWriteWithoutFormat", .value = 56, .parameters = &[_]OperandKind{} },
941 .{ .name = "MultiViewport", .value = 57, .parameters = &[_]OperandKind{} },
942 .{ .name = "SubgroupDispatch", .value = 58, .parameters = &[_]OperandKind{} },
943 .{ .name = "NamedBarrier", .value = 59, .parameters = &[_]OperandKind{} },
944 .{ .name = "PipeStorage", .value = 60, .parameters = &[_]OperandKind{} },
945 .{ .name = "GroupNonUniform", .value = 61, .parameters = &[_]OperandKind{} },
946 .{ .name = "GroupNonUniformVote", .value = 62, .parameters = &[_]OperandKind{} },
947 .{ .name = "GroupNonUniformArithmetic", .value = 63, .parameters = &[_]OperandKind{} },
948 .{ .name = "GroupNonUniformBallot", .value = 64, .parameters = &[_]OperandKind{} },
949 .{ .name = "GroupNonUniformShuffle", .value = 65, .parameters = &[_]OperandKind{} },
950 .{ .name = "GroupNonUniformShuffleRelative", .value = 66, .parameters = &[_]OperandKind{} },
951 .{ .name = "GroupNonUniformClustered", .value = 67, .parameters = &[_]OperandKind{} },
952 .{ .name = "GroupNonUniformQuad", .value = 68, .parameters = &[_]OperandKind{} },
953 .{ .name = "ShaderLayer", .value = 69, .parameters = &[_]OperandKind{} },
954 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &[_]OperandKind{} },
955 .{ .name = "UniformDecoration", .value = 71, .parameters = &[_]OperandKind{} },
956 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &[_]OperandKind{} },
957 .{ .name = "SubgroupBallotKHR", .value = 4423, .parameters = &[_]OperandKind{} },
958 .{ .name = "DrawParameters", .value = 4427, .parameters = &[_]OperandKind{} },
959 .{ .name = "WorkgroupMemoryExplicitLayoutKHR", .value = 4428, .parameters = &[_]OperandKind{} },
960 .{ .name = "WorkgroupMemoryExplicitLayout8BitAccessKHR", .value = 4429, .parameters = &[_]OperandKind{} },
961 .{ .name = "WorkgroupMemoryExplicitLayout16BitAccessKHR", .value = 4430, .parameters = &[_]OperandKind{} },
962 .{ .name = "SubgroupVoteKHR", .value = 4431, .parameters = &[_]OperandKind{} },
963 .{ .name = "StorageBuffer16BitAccess", .value = 4433, .parameters = &[_]OperandKind{} },
964 .{ .name = "StorageUniformBufferBlock16", .value = 4433, .parameters = &[_]OperandKind{} },
965 .{ .name = "UniformAndStorageBuffer16BitAccess", .value = 4434, .parameters = &[_]OperandKind{} },
966 .{ .name = "StorageUniform16", .value = 4434, .parameters = &[_]OperandKind{} },
967 .{ .name = "StoragePushConstant16", .value = 4435, .parameters = &[_]OperandKind{} },
968 .{ .name = "StorageInputOutput16", .value = 4436, .parameters = &[_]OperandKind{} },
969 .{ .name = "DeviceGroup", .value = 4437, .parameters = &[_]OperandKind{} },
970 .{ .name = "MultiView", .value = 4439, .parameters = &[_]OperandKind{} },
971 .{ .name = "VariablePointersStorageBuffer", .value = 4441, .parameters = &[_]OperandKind{} },
972 .{ .name = "VariablePointers", .value = 4442, .parameters = &[_]OperandKind{} },
973 .{ .name = "AtomicStorageOps", .value = 4445, .parameters = &[_]OperandKind{} },
974 .{ .name = "SampleMaskPostDepthCoverage", .value = 4447, .parameters = &[_]OperandKind{} },
975 .{ .name = "StorageBuffer8BitAccess", .value = 4448, .parameters = &[_]OperandKind{} },
976 .{ .name = "UniformAndStorageBuffer8BitAccess", .value = 4449, .parameters = &[_]OperandKind{} },
977 .{ .name = "StoragePushConstant8", .value = 4450, .parameters = &[_]OperandKind{} },
978 .{ .name = "DenormPreserve", .value = 4464, .parameters = &[_]OperandKind{} },
979 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &[_]OperandKind{} },
980 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &[_]OperandKind{} },
981 .{ .name = "RoundingModeRTE", .value = 4467, .parameters = &[_]OperandKind{} },
982 .{ .name = "RoundingModeRTZ", .value = 4468, .parameters = &[_]OperandKind{} },
983 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &[_]OperandKind{} },
984 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &[_]OperandKind{} },
985 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &[_]OperandKind{} },
986 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &[_]OperandKind{} },
987 .{ .name = "Float16ImageAMD", .value = 5008, .parameters = &[_]OperandKind{} },
988 .{ .name = "ImageGatherBiasLodAMD", .value = 5009, .parameters = &[_]OperandKind{} },
989 .{ .name = "FragmentMaskAMD", .value = 5010, .parameters = &[_]OperandKind{} },
990 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &[_]OperandKind{} },
991 .{ .name = "ImageReadWriteLodAMD", .value = 5015, .parameters = &[_]OperandKind{} },
992 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &[_]OperandKind{} },
993 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &[_]OperandKind{} },
994 .{ .name = "SampleMaskOverrideCoverageNV", .value = 5249, .parameters = &[_]OperandKind{} },
995 .{ .name = "GeometryShaderPassthroughNV", .value = 5251, .parameters = &[_]OperandKind{} },
996 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &[_]OperandKind{} },
997 .{ .name = "ShaderViewportIndexLayerNV", .value = 5254, .parameters = &[_]OperandKind{} },
998 .{ .name = "ShaderViewportMaskNV", .value = 5255, .parameters = &[_]OperandKind{} },
999 .{ .name = "ShaderStereoViewNV", .value = 5259, .parameters = &[_]OperandKind{} },
1000 .{ .name = "PerViewAttributesNV", .value = 5260, .parameters = &[_]OperandKind{} },
1001 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &[_]OperandKind{} },
1002 .{ .name = "MeshShadingNV", .value = 5266, .parameters = &[_]OperandKind{} },
1003 .{ .name = "ImageFootprintNV", .value = 5282, .parameters = &[_]OperandKind{} },
1004 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &[_]OperandKind{} },
1005 .{ .name = "FragmentBarycentricNV", .value = 5284, .parameters = &[_]OperandKind{} },
1006 .{ .name = "ComputeDerivativeGroupQuadsNV", .value = 5288, .parameters = &[_]OperandKind{} },
1007 .{ .name = "FragmentDensityEXT", .value = 5291, .parameters = &[_]OperandKind{} },
1008 .{ .name = "ShadingRateNV", .value = 5291, .parameters = &[_]OperandKind{} },
1009 .{ .name = "GroupNonUniformPartitionedNV", .value = 5297, .parameters = &[_]OperandKind{} },
1010 .{ .name = "ShaderNonUniform", .value = 5301, .parameters = &[_]OperandKind{} },
1011 .{ .name = "ShaderNonUniformEXT", .value = 5301, .parameters = &[_]OperandKind{} },
1012 .{ .name = "RuntimeDescriptorArray", .value = 5302, .parameters = &[_]OperandKind{} },
1013 .{ .name = "RuntimeDescriptorArrayEXT", .value = 5302, .parameters = &[_]OperandKind{} },
1014 .{ .name = "InputAttachmentArrayDynamicIndexing", .value = 5303, .parameters = &[_]OperandKind{} },
1015 .{ .name = "InputAttachmentArrayDynamicIndexingEXT", .value = 5303, .parameters = &[_]OperandKind{} },
1016 .{ .name = "UniformTexelBufferArrayDynamicIndexing", .value = 5304, .parameters = &[_]OperandKind{} },
1017 .{ .name = "UniformTexelBufferArrayDynamicIndexingEXT", .value = 5304, .parameters = &[_]OperandKind{} },
1018 .{ .name = "StorageTexelBufferArrayDynamicIndexing", .value = 5305, .parameters = &[_]OperandKind{} },
1019 .{ .name = "StorageTexelBufferArrayDynamicIndexingEXT", .value = 5305, .parameters = &[_]OperandKind{} },
1020 .{ .name = "UniformBufferArrayNonUniformIndexing", .value = 5306, .parameters = &[_]OperandKind{} },
1021 .{ .name = "UniformBufferArrayNonUniformIndexingEXT", .value = 5306, .parameters = &[_]OperandKind{} },
1022 .{ .name = "SampledImageArrayNonUniformIndexing", .value = 5307, .parameters = &[_]OperandKind{} },
1023 .{ .name = "SampledImageArrayNonUniformIndexingEXT", .value = 5307, .parameters = &[_]OperandKind{} },
1024 .{ .name = "StorageBufferArrayNonUniformIndexing", .value = 5308, .parameters = &[_]OperandKind{} },
1025 .{ .name = "StorageBufferArrayNonUniformIndexingEXT", .value = 5308, .parameters = &[_]OperandKind{} },
1026 .{ .name = "StorageImageArrayNonUniformIndexing", .value = 5309, .parameters = &[_]OperandKind{} },
1027 .{ .name = "StorageImageArrayNonUniformIndexingEXT", .value = 5309, .parameters = &[_]OperandKind{} },
1028 .{ .name = "InputAttachmentArrayNonUniformIndexing", .value = 5310, .parameters = &[_]OperandKind{} },
1029 .{ .name = "InputAttachmentArrayNonUniformIndexingEXT", .value = 5310, .parameters = &[_]OperandKind{} },
1030 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &[_]OperandKind{} },
1031 .{ .name = "UniformTexelBufferArrayNonUniformIndexingEXT", .value = 5311, .parameters = &[_]OperandKind{} },
1032 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &[_]OperandKind{} },
1033 .{ .name = "StorageTexelBufferArrayNonUniformIndexingEXT", .value = 5312, .parameters = &[_]OperandKind{} },
1034 .{ .name = "RayTracingNV", .value = 5340, .parameters = &[_]OperandKind{} },
1035 .{ .name = "RayTracingMotionBlurNV", .value = 5341, .parameters = &[_]OperandKind{} },
1036 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &[_]OperandKind{} },
1037 .{ .name = "VulkanMemoryModelKHR", .value = 5345, .parameters = &[_]OperandKind{} },
1038 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &[_]OperandKind{} },
1039 .{ .name = "VulkanMemoryModelDeviceScopeKHR", .value = 5346, .parameters = &[_]OperandKind{} },
1040 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &[_]OperandKind{} },
1041 .{ .name = "PhysicalStorageBufferAddressesEXT", .value = 5347, .parameters = &[_]OperandKind{} },
1042 .{ .name = "ComputeDerivativeGroupLinearNV", .value = 5350, .parameters = &[_]OperandKind{} },
1043 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &[_]OperandKind{} },
1044 .{ .name = "CooperativeMatrixNV", .value = 5357, .parameters = &[_]OperandKind{} },
1045 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &[_]OperandKind{} },
1046 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &[_]OperandKind{} },
1047 .{ .name = "ShaderSMBuiltinsNV", .value = 5373, .parameters = &[_]OperandKind{} },
1048 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &[_]OperandKind{} },
1049 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &[_]OperandKind{} },
1050 .{ .name = "DemoteToHelperInvocationEXT", .value = 5379, .parameters = &[_]OperandKind{} },
1051 .{ .name = "BindlessTextureNV", .value = 5390, .parameters = &[_]OperandKind{} },
1052 .{ .name = "SubgroupShuffleINTEL", .value = 5568, .parameters = &[_]OperandKind{} },
1053 .{ .name = "SubgroupBufferBlockIOINTEL", .value = 5569, .parameters = &[_]OperandKind{} },
1054 .{ .name = "SubgroupImageBlockIOINTEL", .value = 5570, .parameters = &[_]OperandKind{} },
1055 .{ .name = "SubgroupImageMediaBlockIOINTEL", .value = 5579, .parameters = &[_]OperandKind{} },
1056 .{ .name = "RoundToInfinityINTEL", .value = 5582, .parameters = &[_]OperandKind{} },
1057 .{ .name = "FloatingPointModeINTEL", .value = 5583, .parameters = &[_]OperandKind{} },
1058 .{ .name = "IntegerFunctions2INTEL", .value = 5584, .parameters = &[_]OperandKind{} },
1059 .{ .name = "FunctionPointersINTEL", .value = 5603, .parameters = &[_]OperandKind{} },
1060 .{ .name = "IndirectReferencesINTEL", .value = 5604, .parameters = &[_]OperandKind{} },
1061 .{ .name = "AsmINTEL", .value = 5606, .parameters = &[_]OperandKind{} },
1062 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &[_]OperandKind{} },
1063 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &[_]OperandKind{} },
1064 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &[_]OperandKind{} },
1065 .{ .name = "VectorComputeINTEL", .value = 5617, .parameters = &[_]OperandKind{} },
1066 .{ .name = "VectorAnyINTEL", .value = 5619, .parameters = &[_]OperandKind{} },
1067 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &[_]OperandKind{} },
1068 .{ .name = "SubgroupAvcMotionEstimationINTEL", .value = 5696, .parameters = &[_]OperandKind{} },
1069 .{ .name = "SubgroupAvcMotionEstimationIntraINTEL", .value = 5697, .parameters = &[_]OperandKind{} },
1070 .{ .name = "SubgroupAvcMotionEstimationChromaINTEL", .value = 5698, .parameters = &[_]OperandKind{} },
1071 .{ .name = "VariableLengthArrayINTEL", .value = 5817, .parameters = &[_]OperandKind{} },
1072 .{ .name = "FunctionFloatControlINTEL", .value = 5821, .parameters = &[_]OperandKind{} },
1073 .{ .name = "FPGAMemoryAttributesINTEL", .value = 5824, .parameters = &[_]OperandKind{} },
1074 .{ .name = "FPFastMathModeINTEL", .value = 5837, .parameters = &[_]OperandKind{} },
1075 .{ .name = "ArbitraryPrecisionIntegersINTEL", .value = 5844, .parameters = &[_]OperandKind{} },
1076 .{ .name = "ArbitraryPrecisionFloatingPointINTEL", .value = 5845, .parameters = &[_]OperandKind{} },
1077 .{ .name = "UnstructuredLoopControlsINTEL", .value = 5886, .parameters = &[_]OperandKind{} },
1078 .{ .name = "FPGALoopControlsINTEL", .value = 5888, .parameters = &[_]OperandKind{} },
1079 .{ .name = "KernelAttributesINTEL", .value = 5892, .parameters = &[_]OperandKind{} },
1080 .{ .name = "FPGAKernelAttributesINTEL", .value = 5897, .parameters = &[_]OperandKind{} },
1081 .{ .name = "FPGAMemoryAccessesINTEL", .value = 5898, .parameters = &[_]OperandKind{} },
1082 .{ .name = "FPGAClusterAttributesINTEL", .value = 5904, .parameters = &[_]OperandKind{} },
1083 .{ .name = "LoopFuseINTEL", .value = 5906, .parameters = &[_]OperandKind{} },
1084 .{ .name = "FPGABufferLocationINTEL", .value = 5920, .parameters = &[_]OperandKind{} },
1085 .{ .name = "ArbitraryPrecisionFixedPointINTEL", .value = 5922, .parameters = &[_]OperandKind{} },
1086 .{ .name = "USMStorageClassesINTEL", .value = 5935, .parameters = &[_]OperandKind{} },
1087 .{ .name = "IOPipesINTEL", .value = 5943, .parameters = &[_]OperandKind{} },
1088 .{ .name = "BlockingPipesINTEL", .value = 5945, .parameters = &[_]OperandKind{} },
1089 .{ .name = "FPGARegINTEL", .value = 5948, .parameters = &[_]OperandKind{} },
1090 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &[_]OperandKind{} },
1091 .{ .name = "DotProductInputAllKHR", .value = 6016, .parameters = &[_]OperandKind{} },
1092 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &[_]OperandKind{} },
1093 .{ .name = "DotProductInput4x8BitKHR", .value = 6017, .parameters = &[_]OperandKind{} },
1094 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &[_]OperandKind{} },
1095 .{ .name = "DotProductInput4x8BitPackedKHR", .value = 6018, .parameters = &[_]OperandKind{} },
1096 .{ .name = "DotProduct", .value = 6019, .parameters = &[_]OperandKind{} },
1097 .{ .name = "DotProductKHR", .value = 6019, .parameters = &[_]OperandKind{} },
1098 .{ .name = "BitInstructions", .value = 6025, .parameters = &[_]OperandKind{} },
1099 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &[_]OperandKind{} },
1100 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &[_]OperandKind{} },
1101 .{ .name = "LongConstantCompositeINTEL", .value = 6089, .parameters = &[_]OperandKind{} },
1102 .{ .name = "OptNoneINTEL", .value = 6094, .parameters = &[_]OperandKind{} },
1103 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &[_]OperandKind{} },
1104 .{ .name = "DebugInfoModuleINTEL", .value = 6114, .parameters = &[_]OperandKind{} },
1105 },
1106 .RayQueryIntersection => &[_]Enumerant{
1107 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &[_]OperandKind{} },
1108 .{ .name = "RayQueryCommittedIntersectionKHR", .value = 1, .parameters = &[_]OperandKind{} },
1109 },
1110 .RayQueryCommittedIntersectionType => &[_]Enumerant{
1111 .{ .name = "RayQueryCommittedIntersectionNoneKHR", .value = 0, .parameters = &[_]OperandKind{} },
1112 .{ .name = "RayQueryCommittedIntersectionTriangleKHR", .value = 1, .parameters = &[_]OperandKind{} },
1113 .{ .name = "RayQueryCommittedIntersectionGeneratedKHR", .value = 2, .parameters = &[_]OperandKind{} },
1114 },
1115 .RayQueryCandidateIntersectionType => &[_]Enumerant{
1116 .{ .name = "RayQueryCandidateIntersectionTriangleKHR", .value = 0, .parameters = &[_]OperandKind{} },
1117 .{ .name = "RayQueryCandidateIntersectionAABBKHR", .value = 1, .parameters = &[_]OperandKind{} },
1118 },
1119 .PackedVectorFormat => &[_]Enumerant{
1120 .{ .name = "PackedVectorFormat4x8Bit", .value = 0, .parameters = &[_]OperandKind{} },
1121 .{ .name = "PackedVectorFormat4x8BitKHR", .value = 0, .parameters = &[_]OperandKind{} },
1122 },
1123 .IdResultType => unreachable,
1124 .IdResult => unreachable,
1125 .IdMemorySemantics => unreachable,
1126 .IdScope => unreachable,
1127 .IdRef => unreachable,
1128 .LiteralInteger => unreachable,
1129 .LiteralString => unreachable,
1130 .LiteralContextDependentNumber => unreachable,
1131 .LiteralExtInstInteger => unreachable,
1132 .LiteralSpecConstantOpInteger => unreachable,
1133 .PairLiteralIntegerIdRef => unreachable,
1134 .PairIdRefLiteralInteger => unreachable,
1135 .PairIdRefIdRef => unreachable,
1136 };
1137 }
1138};
44pub const Opcode = enum(u16) {1139pub const Opcode = enum(u16) {
45 OpNop = 0,1140 OpNop = 0,
46 OpUndef = 1,1141 OpUndef = 1,
...@@ -398,6 +1493,12 @@ pub const Opcode = enum(u16) {...@@ -398,6 +1493,12 @@ pub const Opcode = enum(u16) {
398 OpConvertUToAccelerationStructureKHR = 4447,1493 OpConvertUToAccelerationStructureKHR = 4447,
399 OpIgnoreIntersectionKHR = 4448,1494 OpIgnoreIntersectionKHR = 4448,
400 OpTerminateRayKHR = 4449,1495 OpTerminateRayKHR = 4449,
1496 OpSDot = 4450,
1497 OpUDot = 4451,
1498 OpSUDot = 4452,
1499 OpSDotAccSat = 4453,
1500 OpUDotAccSat = 4454,
1501 OpSUDotAccSat = 4455,
401 OpTypeRayQueryKHR = 4472,1502 OpTypeRayQueryKHR = 4472,
402 OpRayQueryInitializeKHR = 4473,1503 OpRayQueryInitializeKHR = 4473,
403 OpRayQueryTerminateKHR = 4474,1504 OpRayQueryTerminateKHR = 4474,
...@@ -423,6 +1524,8 @@ pub const Opcode = enum(u16) {...@@ -423,6 +1524,8 @@ pub const Opcode = enum(u16) {
423 OpIgnoreIntersectionNV = 5335,1524 OpIgnoreIntersectionNV = 5335,
424 OpTerminateRayNV = 5336,1525 OpTerminateRayNV = 5336,
425 OpTraceNV = 5337,1526 OpTraceNV = 5337,
1527 OpTraceMotionNV = 5338,
1528 OpTraceRayMotionNV = 5339,
426 OpTypeAccelerationStructureKHR = 5341,1529 OpTypeAccelerationStructureKHR = 5341,
427 OpExecuteCallableNV = 5344,1530 OpExecuteCallableNV = 5344,
428 OpTypeCooperativeMatrixNV = 5358,1531 OpTypeCooperativeMatrixNV = 5358,
...@@ -432,8 +1535,15 @@ pub const Opcode = enum(u16) {...@@ -432,8 +1535,15 @@ pub const Opcode = enum(u16) {
432 OpCooperativeMatrixLengthNV = 5362,1535 OpCooperativeMatrixLengthNV = 5362,
433 OpBeginInvocationInterlockEXT = 5364,1536 OpBeginInvocationInterlockEXT = 5364,
434 OpEndInvocationInterlockEXT = 5365,1537 OpEndInvocationInterlockEXT = 5365,
435 OpDemoteToHelperInvocationEXT = 5380,1538 OpDemoteToHelperInvocation = 5380,
436 OpIsHelperInvocationEXT = 5381,1539 OpIsHelperInvocationEXT = 5381,
1540 OpConvertUToImageNV = 5391,
1541 OpConvertUToSamplerNV = 5392,
1542 OpConvertImageToUNV = 5393,
1543 OpConvertSamplerToUNV = 5394,
1544 OpConvertUToSampledImageNV = 5395,
1545 OpConvertSampledImageToUNV = 5396,
1546 OpSamplerImageAddressingModeNV = 5397,
437 OpSubgroupShuffleINTEL = 5571,1547 OpSubgroupShuffleINTEL = 5571,
438 OpSubgroupShuffleDownINTEL = 5572,1548 OpSubgroupShuffleDownINTEL = 5572,
439 OpSubgroupShuffleUpINTEL = 5573,1549 OpSubgroupShuffleUpINTEL = 5573,
...@@ -458,141 +1568,13 @@ pub const Opcode = enum(u16) {...@@ -458,141 +1568,13 @@ pub const Opcode = enum(u16) {
458 OpUSubSatINTEL = 5596,1568 OpUSubSatINTEL = 5596,
459 OpIMul32x16INTEL = 5597,1569 OpIMul32x16INTEL = 5597,
460 OpUMul32x16INTEL = 5598,1570 OpUMul32x16INTEL = 5598,
461 OpConstFunctionPointerINTEL = 5600,
462 OpFunctionPointerCallINTEL = 5601,
463 OpAsmTargetINTEL = 5609,
464 OpAsmINTEL = 5610,
465 OpAsmCallINTEL = 5611,
466 OpAtomicFMinEXT = 5614,1571 OpAtomicFMinEXT = 5614,
467 OpAtomicFMaxEXT = 5615,1572 OpAtomicFMaxEXT = 5615,
468 OpAssumeTrueKHR = 5630,1573 OpAssumeTrueKHR = 5630,
469 OpExpectKHR = 5631,1574 OpExpectKHR = 5631,
470 OpDecorateString = 5632,1575 OpDecorateString = 5632,
471 OpMemberDecorateString = 5633,1576 OpMemberDecorateString = 5633,
472 OpVmeImageINTEL = 5699,
473 OpTypeVmeImageINTEL = 5700,
474 OpTypeAvcImePayloadINTEL = 5701,
475 OpTypeAvcRefPayloadINTEL = 5702,
476 OpTypeAvcSicPayloadINTEL = 5703,
477 OpTypeAvcMcePayloadINTEL = 5704,
478 OpTypeAvcMceResultINTEL = 5705,
479 OpTypeAvcImeResultINTEL = 5706,
480 OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
481 OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
482 OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
483 OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
484 OpTypeAvcRefResultINTEL = 5711,
485 OpTypeAvcSicResultINTEL = 5712,
486 OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
487 OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
488 OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
489 OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
490 OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
491 OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
492 OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
493 OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
494 OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
495 OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
496 OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
497 OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
498 OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
499 OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
500 OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
501 OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
502 OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
503 OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
504 OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
505 OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
506 OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
507 OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
508 OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
509 OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
510 OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
511 OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
512 OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
513 OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
514 OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
515 OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
516 OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
517 OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
518 OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
519 OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
520 OpSubgroupAvcImeInitializeINTEL = 5747,
521 OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
522 OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
523 OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
524 OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
525 OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
526 OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
527 OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
528 OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
529 OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
530 OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
531 OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
532 OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
533 OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
534 OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
535 OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
536 OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
537 OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
538 OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
539 OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
540 OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
541 OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
542 OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
543 OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
544 OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
545 OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
546 OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
547 OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
548 OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
549 OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
550 OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
551 OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
552 OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
553 OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
554 OpSubgroupAvcFmeInitializeINTEL = 5781,
555 OpSubgroupAvcBmeInitializeINTEL = 5782,
556 OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
557 OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
558 OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
559 OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
560 OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
561 OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
562 OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
563 OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
564 OpSubgroupAvcSicInitializeINTEL = 5791,
565 OpSubgroupAvcSicConfigureSkcINTEL = 5792,
566 OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
567 OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
568 OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
569 OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
570 OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
571 OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
572 OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
573 OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
574 OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
575 OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
576 OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
577 OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
578 OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
579 OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
580 OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
581 OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
582 OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
583 OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
584 OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
585 OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
586 OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
587 OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
588 OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
589 OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
590 OpVariableLengthArrayINTEL = 5818,
591 OpSaveMemoryINTEL = 5819,
592 OpRestoreMemoryINTEL = 5820,
593 OpLoopControlINTEL = 5887,1577 OpLoopControlINTEL = 5887,
594 OpPtrCastToCrossWorkgroupINTEL = 5934,
595 OpCrossWorkgroupCastToPtrINTEL = 5938,
596 OpReadPipeBlockingINTEL = 5946,1578 OpReadPipeBlockingINTEL = 5946,
597 OpWritePipeBlockingINTEL = 5947,1579 OpWritePipeBlockingINTEL = 5947,
598 OpFPGARegINTEL = 5949,1580 OpFPGARegINTEL = 5949,
...@@ -619,8 +1601,15 @@ pub const Opcode = enum(u16) {...@@ -619,8 +1601,15 @@ pub const Opcode = enum(u16) {
619 OpConstantCompositeContinuedINTEL = 6091,1601 OpConstantCompositeContinuedINTEL = 6091,
620 OpSpecConstantCompositeContinuedINTEL = 6092,1602 OpSpecConstantCompositeContinuedINTEL = 6092,
6211603
1604 pub const OpSDotKHR = Opcode.OpSDot;
1605 pub const OpUDotKHR = Opcode.OpUDot;
1606 pub const OpSUDotKHR = Opcode.OpSUDot;
1607 pub const OpSDotAccSatKHR = Opcode.OpSDotAccSat;
1608 pub const OpUDotAccSatKHR = Opcode.OpUDotAccSat;
1609 pub const OpSUDotAccSatKHR = Opcode.OpSUDotAccSat;
622 pub const OpReportIntersectionNV = Opcode.OpReportIntersectionKHR;1610 pub const OpReportIntersectionNV = Opcode.OpReportIntersectionKHR;
623 pub const OpTypeAccelerationStructureNV = Opcode.OpTypeAccelerationStructureKHR;1611 pub const OpTypeAccelerationStructureNV = Opcode.OpTypeAccelerationStructureKHR;
1612 pub const OpDemoteToHelperInvocationEXT = Opcode.OpDemoteToHelperInvocation;
624 pub const OpDecorateStringGOOGLE = Opcode.OpDecorateString;1613 pub const OpDecorateStringGOOGLE = Opcode.OpDecorateString;
625 pub const OpMemberDecorateStringGOOGLE = Opcode.OpMemberDecorateString;1614 pub const OpMemberDecorateStringGOOGLE = Opcode.OpMemberDecorateString;
6261615
...@@ -982,6 +1971,12 @@ pub const Opcode = enum(u16) {...@@ -982,6 +1971,12 @@ pub const Opcode = enum(u16) {
982 .OpConvertUToAccelerationStructureKHR => struct { id_result_type: IdResultType, id_result: IdResult, accel: IdRef },1971 .OpConvertUToAccelerationStructureKHR => struct { id_result_type: IdResultType, id_result: IdResult, accel: IdRef },
983 .OpIgnoreIntersectionKHR => void,1972 .OpIgnoreIntersectionKHR => void,
984 .OpTerminateRayKHR => void,1973 .OpTerminateRayKHR => void,
1974 .OpSDot => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, packed_vector_format: ?PackedVectorFormat = null },
1975 .OpUDot => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, packed_vector_format: ?PackedVectorFormat = null },
1976 .OpSUDot => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, packed_vector_format: ?PackedVectorFormat = null },
1977 .OpSDotAccSat => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, accumulator: IdRef, packed_vector_format: ?PackedVectorFormat = null },
1978 .OpUDotAccSat => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, accumulator: IdRef, packed_vector_format: ?PackedVectorFormat = null },
1979 .OpSUDotAccSat => struct { id_result_type: IdResultType, id_result: IdResult, vector_1: IdRef, vector_2: IdRef, accumulator: IdRef, packed_vector_format: ?PackedVectorFormat = null },
985 .OpTypeRayQueryKHR => struct { id_result: IdResult },1980 .OpTypeRayQueryKHR => struct { id_result: IdResult },
986 .OpRayQueryInitializeKHR => struct { rayquery: IdRef, accel: IdRef, rayflags: IdRef, cullmask: IdRef, rayorigin: IdRef, raytmin: IdRef, raydirection: IdRef, raytmax: IdRef },1981 .OpRayQueryInitializeKHR => struct { rayquery: IdRef, accel: IdRef, rayflags: IdRef, cullmask: IdRef, rayorigin: IdRef, raytmin: IdRef, raydirection: IdRef, raytmax: IdRef },
987 .OpRayQueryTerminateKHR => struct { rayquery: IdRef },1982 .OpRayQueryTerminateKHR => struct { rayquery: IdRef },
...@@ -1007,6 +2002,8 @@ pub const Opcode = enum(u16) {...@@ -1007,6 +2002,8 @@ pub const Opcode = enum(u16) {
1007 .OpIgnoreIntersectionNV => void,2002 .OpIgnoreIntersectionNV => void,
1008 .OpTerminateRayNV => void,2003 .OpTerminateRayNV => void,
1009 .OpTraceNV => struct { accel: IdRef, ray_flags: IdRef, cull_mask: IdRef, sbt_offset: IdRef, sbt_stride: IdRef, miss_index: IdRef, ray_origin: IdRef, ray_tmin: IdRef, ray_direction: IdRef, ray_tmax: IdRef, payloadid: IdRef },2004 .OpTraceNV => struct { accel: IdRef, ray_flags: IdRef, cull_mask: IdRef, sbt_offset: IdRef, sbt_stride: IdRef, miss_index: IdRef, ray_origin: IdRef, ray_tmin: IdRef, ray_direction: IdRef, ray_tmax: IdRef, payloadid: IdRef },
2005 .OpTraceMotionNV => struct { accel: IdRef, ray_flags: IdRef, cull_mask: IdRef, sbt_offset: IdRef, sbt_stride: IdRef, miss_index: IdRef, ray_origin: IdRef, ray_tmin: IdRef, ray_direction: IdRef, ray_tmax: IdRef, time: IdRef, payloadid: IdRef },
2006 .OpTraceRayMotionNV => struct { accel: IdRef, ray_flags: IdRef, cull_mask: IdRef, sbt_offset: IdRef, sbt_stride: IdRef, miss_index: IdRef, ray_origin: IdRef, ray_tmin: IdRef, ray_direction: IdRef, ray_tmax: IdRef, time: IdRef, payload: IdRef },
1010 .OpTypeAccelerationStructureKHR => struct { id_result: IdResult },2007 .OpTypeAccelerationStructureKHR => struct { id_result: IdResult },
1011 .OpExecuteCallableNV => struct { sbt_index: IdRef, callable_dataid: IdRef },2008 .OpExecuteCallableNV => struct { sbt_index: IdRef, callable_dataid: IdRef },
1012 .OpTypeCooperativeMatrixNV => struct { id_result: IdResult, component_type: IdRef, execution: IdScope, rows: IdRef, columns: IdRef },2009 .OpTypeCooperativeMatrixNV => struct { id_result: IdResult, component_type: IdRef, execution: IdScope, rows: IdRef, columns: IdRef },
...@@ -1016,8 +2013,15 @@ pub const Opcode = enum(u16) {...@@ -1016,8 +2013,15 @@ pub const Opcode = enum(u16) {
1016 .OpCooperativeMatrixLengthNV => struct { id_result_type: IdResultType, id_result: IdResult, type: IdRef },2013 .OpCooperativeMatrixLengthNV => struct { id_result_type: IdResultType, id_result: IdResult, type: IdRef },
1017 .OpBeginInvocationInterlockEXT => void,2014 .OpBeginInvocationInterlockEXT => void,
1018 .OpEndInvocationInterlockEXT => void,2015 .OpEndInvocationInterlockEXT => void,
1019 .OpDemoteToHelperInvocationEXT => void,2016 .OpDemoteToHelperInvocation => void,
1020 .OpIsHelperInvocationEXT => struct { id_result_type: IdResultType, id_result: IdResult },2017 .OpIsHelperInvocationEXT => struct { id_result_type: IdResultType, id_result: IdResult },
2018 .OpConvertUToImageNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2019 .OpConvertUToSamplerNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2020 .OpConvertImageToUNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2021 .OpConvertSamplerToUNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2022 .OpConvertUToSampledImageNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2023 .OpConvertSampledImageToUNV => struct { id_result_type: IdResultType, id_result: IdResult, operand: IdRef },
2024 .OpSamplerImageAddressingModeNV => struct { bit_width: LiteralInteger },
1021 .OpSubgroupShuffleINTEL => struct { id_result_type: IdResultType, id_result: IdResult, data: IdRef, invocationid: IdRef },2025 .OpSubgroupShuffleINTEL => struct { id_result_type: IdResultType, id_result: IdResult, data: IdRef, invocationid: IdRef },
1022 .OpSubgroupShuffleDownINTEL => struct { id_result_type: IdResultType, id_result: IdResult, current: IdRef, next: IdRef, delta: IdRef },2026 .OpSubgroupShuffleDownINTEL => struct { id_result_type: IdResultType, id_result: IdResult, current: IdRef, next: IdRef, delta: IdRef },
1023 .OpSubgroupShuffleUpINTEL => struct { id_result_type: IdResultType, id_result: IdResult, previous: IdRef, current: IdRef, delta: IdRef },2027 .OpSubgroupShuffleUpINTEL => struct { id_result_type: IdResultType, id_result: IdResult, previous: IdRef, current: IdRef, delta: IdRef },
...@@ -1042,141 +2046,13 @@ pub const Opcode = enum(u16) {...@@ -1042,141 +2046,13 @@ pub const Opcode = enum(u16) {
1042 .OpUSubSatINTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },2046 .OpUSubSatINTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },
1043 .OpIMul32x16INTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },2047 .OpIMul32x16INTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },
1044 .OpUMul32x16INTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },2048 .OpUMul32x16INTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: IdRef, operand_2: IdRef },
1045 .OpConstFunctionPointerINTEL => struct { id_result_type: IdResultType, id_result: IdResult, function: IdRef },
1046 .OpFunctionPointerCallINTEL => struct { id_result_type: IdResultType, id_result: IdResult, operand_1: []const IdRef = &.{} },
1047 .OpAsmTargetINTEL => struct { id_result_type: IdResultType, id_result: IdResult, asm_target: LiteralString },
1048 .OpAsmINTEL => struct { id_result_type: IdResultType, id_result: IdResult, asm_type: IdRef, target: IdRef, asm_instructions: LiteralString, constraints: LiteralString },
1049 .OpAsmCallINTEL => struct { id_result_type: IdResultType, id_result: IdResult, @"asm": IdRef, argument_0: []const IdRef = &.{} },
1050 .OpAtomicFMinEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },2049 .OpAtomicFMinEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },
1051 .OpAtomicFMaxEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },2050 .OpAtomicFMaxEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },
1052 .OpAssumeTrueKHR => struct { condition: IdRef },2051 .OpAssumeTrueKHR => struct { condition: IdRef },
1053 .OpExpectKHR => struct { id_result_type: IdResultType, id_result: IdResult, value: IdRef, expectedvalue: IdRef },2052 .OpExpectKHR => struct { id_result_type: IdResultType, id_result: IdResult, value: IdRef, expectedvalue: IdRef },
1054 .OpDecorateString => struct { target: IdRef, decoration: Decoration.Extended },2053 .OpDecorateString => struct { target: IdRef, decoration: Decoration.Extended },
1055 .OpMemberDecorateString => struct { struct_type: IdRef, member: LiteralInteger, decoration: Decoration.Extended },2054 .OpMemberDecorateString => struct { struct_type: IdRef, member: LiteralInteger, decoration: Decoration.Extended },
1056 .OpVmeImageINTEL => struct { id_result_type: IdResultType, id_result: IdResult, image_type: IdRef, sampler: IdRef },
1057 .OpTypeVmeImageINTEL => struct { id_result: IdResult, image_type: IdRef },
1058 .OpTypeAvcImePayloadINTEL => struct { id_result: IdResult },
1059 .OpTypeAvcRefPayloadINTEL => struct { id_result: IdResult },
1060 .OpTypeAvcSicPayloadINTEL => struct { id_result: IdResult },
1061 .OpTypeAvcMcePayloadINTEL => struct { id_result: IdResult },
1062 .OpTypeAvcMceResultINTEL => struct { id_result: IdResult },
1063 .OpTypeAvcImeResultINTEL => struct { id_result: IdResult },
1064 .OpTypeAvcImeResultSingleReferenceStreamoutINTEL => struct { id_result: IdResult },
1065 .OpTypeAvcImeResultDualReferenceStreamoutINTEL => struct { id_result: IdResult },
1066 .OpTypeAvcImeSingleReferenceStreaminINTEL => struct { id_result: IdResult },
1067 .OpTypeAvcImeDualReferenceStreaminINTEL => struct { id_result: IdResult },
1068 .OpTypeAvcRefResultINTEL => struct { id_result: IdResult },
1069 .OpTypeAvcSicResultINTEL => struct { id_result: IdResult },
1070 .OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1071 .OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, reference_base_penalty: IdRef, payload: IdRef },
1072 .OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1073 .OpSubgroupAvcMceSetInterShapePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_shape_penalty: IdRef, payload: IdRef },
1074 .OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1075 .OpSubgroupAvcMceSetInterDirectionPenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, direction_cost: IdRef, payload: IdRef },
1076 .OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1077 .OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1078 .OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1079 .OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1080 .OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1081 .OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_cost_center_delta: IdRef, packed_cost_table: IdRef, cost_precision: IdRef, payload: IdRef },
1082 .OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, slice_type: IdRef, qp: IdRef },
1083 .OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1084 .OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1085 .OpSubgroupAvcMceSetAcOnlyHaarINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1086 .OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL => struct { id_result_type: IdResultType, id_result: IdResult, source_field_polarity: IdRef, payload: IdRef },
1087 .OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL => struct { id_result_type: IdResultType, id_result: IdResult, reference_field_polarity: IdRef, payload: IdRef },
1088 .OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL => struct { id_result_type: IdResultType, id_result: IdResult, forward_reference_field_polarity: IdRef, backward_reference_field_polarity: IdRef, payload: IdRef },
1089 .OpSubgroupAvcMceConvertToImePayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1090 .OpSubgroupAvcMceConvertToImeResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1091 .OpSubgroupAvcMceConvertToRefPayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1092 .OpSubgroupAvcMceConvertToRefResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1093 .OpSubgroupAvcMceConvertToSicPayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1094 .OpSubgroupAvcMceConvertToSicResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1095 .OpSubgroupAvcMceGetMotionVectorsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1096 .OpSubgroupAvcMceGetInterDistortionsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1097 .OpSubgroupAvcMceGetBestInterDistortionsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1098 .OpSubgroupAvcMceGetInterMajorShapeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1099 .OpSubgroupAvcMceGetInterMinorShapeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1100 .OpSubgroupAvcMceGetInterDirectionsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1101 .OpSubgroupAvcMceGetInterMotionVectorCountINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1102 .OpSubgroupAvcMceGetInterReferenceIdsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1103 .OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_reference_ids: IdRef, packed_reference_parameter_field_polarities: IdRef, payload: IdRef },
1104 .OpSubgroupAvcImeInitializeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_coord: IdRef, partition_mask: IdRef, sad_adjustment: IdRef },
1105 .OpSubgroupAvcImeSetSingleReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, ref_offset: IdRef, search_window_config: IdRef, payload: IdRef },
1106 .OpSubgroupAvcImeSetDualReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, fwd_ref_offset: IdRef, bwd_ref_offset: IdRef, id_ref_4: IdRef, payload: IdRef },
1107 .OpSubgroupAvcImeRefWindowSizeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, search_window_config: IdRef, dual_ref: IdRef },
1108 .OpSubgroupAvcImeAdjustRefOffsetINTEL => struct { id_result_type: IdResultType, id_result: IdResult, ref_offset: IdRef, src_coord: IdRef, ref_window_size: IdRef, image_size: IdRef },
1109 .OpSubgroupAvcImeConvertToMcePayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1110 .OpSubgroupAvcImeSetMaxMotionVectorCountINTEL => struct { id_result_type: IdResultType, id_result: IdResult, max_motion_vector_count: IdRef, payload: IdRef },
1111 .OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1112 .OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL => struct { id_result_type: IdResultType, id_result: IdResult, threshold: IdRef, payload: IdRef },
1113 .OpSubgroupAvcImeSetWeightedSadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_sad_weights: IdRef, payload: IdRef },
1114 .OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef },
1115 .OpSubgroupAvcImeEvaluateWithDualReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef },
1116 .OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef, streamin_components: IdRef },
1117 .OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef, streamin_components: IdRef },
1118 .OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef },
1119 .OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef },
1120 .OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef, streamin_components: IdRef },
1121 .OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef, streamin_components: IdRef },
1122 .OpSubgroupAvcImeConvertToMceResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1123 .OpSubgroupAvcImeGetSingleReferenceStreaminINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1124 .OpSubgroupAvcImeGetDualReferenceStreaminINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1125 .OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1126 .OpSubgroupAvcImeStripDualReferenceStreamoutINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1127 .OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef },
1128 .OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef },
1129 .OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef },
1130 .OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef, direction: IdRef },
1131 .OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef, direction: IdRef },
1132 .OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef, major_shape: IdRef, direction: IdRef },
1133 .OpSubgroupAvcImeGetBorderReachedINTEL => struct { id_result_type: IdResultType, id_result: IdResult, image_select: IdRef, payload: IdRef },
1134 .OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1135 .OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1136 .OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1137 .OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1138 .OpSubgroupAvcFmeInitializeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_coord: IdRef, motion_vectors: IdRef, major_shapes: IdRef, minor_shapes: IdRef, direction: IdRef, pixel_resolution: IdRef, sad_adjustment: IdRef },
1139 .OpSubgroupAvcBmeInitializeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_coord: IdRef, motion_vectors: IdRef, major_shapes: IdRef, minor_shapes: IdRef, direction: IdRef, pixel_resolution: IdRef, bidirectional_weight: IdRef, sad_adjustment: IdRef },
1140 .OpSubgroupAvcRefConvertToMcePayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1141 .OpSubgroupAvcRefSetBidirectionalMixDisableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1142 .OpSubgroupAvcRefSetBilinearFilterEnableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1143 .OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef },
1144 .OpSubgroupAvcRefEvaluateWithDualReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef },
1145 .OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, packed_reference_ids: IdRef, payload: IdRef },
1146 .OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, packed_reference_ids: IdRef, packed_reference_field_polarities: IdRef, payload: IdRef },
1147 .OpSubgroupAvcRefConvertToMceResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1148 .OpSubgroupAvcSicInitializeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_coord: IdRef },
1149 .OpSubgroupAvcSicConfigureSkcINTEL => struct { id_result_type: IdResultType, id_result: IdResult, skip_block_partition_type: IdRef, skip_motion_vector_mask: IdRef, motion_vectors: IdRef, bidirectional_weight: IdRef, sad_adjustment: IdRef, payload: IdRef },
1150 .OpSubgroupAvcSicConfigureIpeLumaINTEL => struct { id_result_type: IdResultType, id_result: IdResult, luma_intra_partition_mask: IdRef, intra_neighbour_availabilty: IdRef, left_edge_luma_pixels: IdRef, upper_left_corner_luma_pixel: IdRef, upper_edge_luma_pixels: IdRef, upper_right_edge_luma_pixels: IdRef, sad_adjustment: IdRef, payload: IdRef },
1151 .OpSubgroupAvcSicConfigureIpeLumaChromaINTEL => struct { id_result_type: IdResultType, id_result: IdResult, luma_intra_partition_mask: IdRef, intra_neighbour_availabilty: IdRef, left_edge_luma_pixels: IdRef, upper_left_corner_luma_pixel: IdRef, upper_edge_luma_pixels: IdRef, upper_right_edge_luma_pixels: IdRef, left_edge_chroma_pixels: IdRef, upper_left_corner_chroma_pixel: IdRef, upper_edge_chroma_pixels: IdRef, sad_adjustment: IdRef, payload: IdRef },
1152 .OpSubgroupAvcSicGetMotionVectorMaskINTEL => struct { id_result_type: IdResultType, id_result: IdResult, skip_block_partition_type: IdRef, direction: IdRef },
1153 .OpSubgroupAvcSicConvertToMcePayloadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1154 .OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_shape_penalty: IdRef, payload: IdRef },
1155 .OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, luma_mode_penalty: IdRef, luma_packed_neighbor_modes: IdRef, luma_packed_non_dc_penalty: IdRef, payload: IdRef },
1156 .OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, chroma_mode_base_penalty: IdRef, payload: IdRef },
1157 .OpSubgroupAvcSicSetBilinearFilterEnableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1158 .OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packed_sad_coefficients: IdRef, payload: IdRef },
1159 .OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL => struct { id_result_type: IdResultType, id_result: IdResult, block_based_skip_type: IdRef, payload: IdRef },
1160 .OpSubgroupAvcSicEvaluateIpeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, payload: IdRef },
1161 .OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, ref_image: IdRef, payload: IdRef },
1162 .OpSubgroupAvcSicEvaluateWithDualReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, fwd_ref_image: IdRef, bwd_ref_image: IdRef, payload: IdRef },
1163 .OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, packed_reference_ids: IdRef, payload: IdRef },
1164 .OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL => struct { id_result_type: IdResultType, id_result: IdResult, src_image: IdRef, packed_reference_ids: IdRef, packed_reference_field_polarities: IdRef, payload: IdRef },
1165 .OpSubgroupAvcSicConvertToMceResultINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1166 .OpSubgroupAvcSicGetIpeLumaShapeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1167 .OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1168 .OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1169 .OpSubgroupAvcSicGetPackedIpeLumaModesINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1170 .OpSubgroupAvcSicGetIpeChromaModeINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1171 .OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1172 .OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1173 .OpSubgroupAvcSicGetInterRawSadsINTEL => struct { id_result_type: IdResultType, id_result: IdResult, payload: IdRef },
1174 .OpVariableLengthArrayINTEL => struct { id_result_type: IdResultType, id_result: IdResult, lenght: IdRef },
1175 .OpSaveMemoryINTEL => struct { id_result_type: IdResultType, id_result: IdResult },
1176 .OpRestoreMemoryINTEL => struct { ptr: IdRef },
1177 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },2055 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },
1178 .OpPtrCastToCrossWorkgroupINTEL => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef },
1179 .OpCrossWorkgroupCastToPtrINTEL => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef },
1180 .OpReadPipeBlockingINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packet_size: IdRef, packet_alignment: IdRef },2056 .OpReadPipeBlockingINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packet_size: IdRef, packet_alignment: IdRef },
1181 .OpWritePipeBlockingINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packet_size: IdRef, packet_alignment: IdRef },2057 .OpWritePipeBlockingINTEL => struct { id_result_type: IdResultType, id_result: IdResult, packet_size: IdRef, packet_alignment: IdRef },
1182 .OpFPGARegINTEL => struct { id_result_type: IdResultType, id_result: IdResult, result: IdRef, input: IdRef },2058 .OpFPGARegINTEL => struct { id_result_type: IdResultType, id_result: IdResult, result: IdRef, input: IdRef },
...@@ -1198,12 +2074,3169 @@ pub const Opcode = enum(u16) {...@@ -1198,12 +2074,3169 @@ pub const Opcode = enum(u16) {
1198 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: IdResultType, id_result: IdResult, rayquery: IdRef, intersection: IdRef },2074 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: IdResultType, id_result: IdResult, rayquery: IdRef, intersection: IdRef },
1199 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: IdResultType, id_result: IdResult, rayquery: IdRef, intersection: IdRef },2075 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: IdResultType, id_result: IdResult, rayquery: IdRef, intersection: IdRef },
1200 .OpAtomicFAddEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },2076 .OpAtomicFAddEXT => struct { id_result_type: IdResultType, id_result: IdResult, pointer: IdRef, memory: IdScope, semantics: IdMemorySemantics, value: IdRef },
1201 .OpTypeBufferSurfaceINTEL => struct { id_result: IdResult },2077 .OpTypeBufferSurfaceINTEL => struct { id_result: IdResult, accessqualifier: AccessQualifier },
1202 .OpTypeStructContinuedINTEL => struct { id_ref: []const IdRef = &.{} },2078 .OpTypeStructContinuedINTEL => struct { id_ref: []const IdRef = &.{} },
1203 .OpConstantCompositeContinuedINTEL => struct { constituents: []const IdRef = &.{} },2079 .OpConstantCompositeContinuedINTEL => struct { constituents: []const IdRef = &.{} },
1204 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const IdRef = &.{} },2080 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const IdRef = &.{} },
1205 };2081 };
1206 }2082 }
2083 pub fn operands(self: Opcode) []const Operand {
2084 return switch (self) {
2085 .OpNop => &[_]Operand{},
2086 .OpUndef => &[_]Operand{
2087 .{ .kind = .IdResultType, .quantifier = .required },
2088 .{ .kind = .IdResult, .quantifier = .required },
2089 },
2090 .OpSourceContinued => &[_]Operand{
2091 .{ .kind = .LiteralString, .quantifier = .required },
2092 },
2093 .OpSource => &[_]Operand{
2094 .{ .kind = .SourceLanguage, .quantifier = .required },
2095 .{ .kind = .LiteralInteger, .quantifier = .required },
2096 .{ .kind = .IdRef, .quantifier = .optional },
2097 .{ .kind = .LiteralString, .quantifier = .optional },
2098 },
2099 .OpSourceExtension => &[_]Operand{
2100 .{ .kind = .LiteralString, .quantifier = .required },
2101 },
2102 .OpName => &[_]Operand{
2103 .{ .kind = .IdRef, .quantifier = .required },
2104 .{ .kind = .LiteralString, .quantifier = .required },
2105 },
2106 .OpMemberName => &[_]Operand{
2107 .{ .kind = .IdRef, .quantifier = .required },
2108 .{ .kind = .LiteralInteger, .quantifier = .required },
2109 .{ .kind = .LiteralString, .quantifier = .required },
2110 },
2111 .OpString => &[_]Operand{
2112 .{ .kind = .IdResult, .quantifier = .required },
2113 .{ .kind = .LiteralString, .quantifier = .required },
2114 },
2115 .OpLine => &[_]Operand{
2116 .{ .kind = .IdRef, .quantifier = .required },
2117 .{ .kind = .LiteralInteger, .quantifier = .required },
2118 .{ .kind = .LiteralInteger, .quantifier = .required },
2119 },
2120 .OpExtension => &[_]Operand{
2121 .{ .kind = .LiteralString, .quantifier = .required },
2122 },
2123 .OpExtInstImport => &[_]Operand{
2124 .{ .kind = .IdResult, .quantifier = .required },
2125 .{ .kind = .LiteralString, .quantifier = .required },
2126 },
2127 .OpExtInst => &[_]Operand{
2128 .{ .kind = .IdResultType, .quantifier = .required },
2129 .{ .kind = .IdResult, .quantifier = .required },
2130 .{ .kind = .IdRef, .quantifier = .required },
2131 .{ .kind = .LiteralExtInstInteger, .quantifier = .required },
2132 .{ .kind = .IdRef, .quantifier = .variadic },
2133 },
2134 .OpMemoryModel => &[_]Operand{
2135 .{ .kind = .AddressingModel, .quantifier = .required },
2136 .{ .kind = .MemoryModel, .quantifier = .required },
2137 },
2138 .OpEntryPoint => &[_]Operand{
2139 .{ .kind = .ExecutionModel, .quantifier = .required },
2140 .{ .kind = .IdRef, .quantifier = .required },
2141 .{ .kind = .LiteralString, .quantifier = .required },
2142 .{ .kind = .IdRef, .quantifier = .variadic },
2143 },
2144 .OpExecutionMode => &[_]Operand{
2145 .{ .kind = .IdRef, .quantifier = .required },
2146 .{ .kind = .ExecutionMode, .quantifier = .required },
2147 },
2148 .OpCapability => &[_]Operand{
2149 .{ .kind = .Capability, .quantifier = .required },
2150 },
2151 .OpTypeVoid => &[_]Operand{
2152 .{ .kind = .IdResult, .quantifier = .required },
2153 },
2154 .OpTypeBool => &[_]Operand{
2155 .{ .kind = .IdResult, .quantifier = .required },
2156 },
2157 .OpTypeInt => &[_]Operand{
2158 .{ .kind = .IdResult, .quantifier = .required },
2159 .{ .kind = .LiteralInteger, .quantifier = .required },
2160 .{ .kind = .LiteralInteger, .quantifier = .required },
2161 },
2162 .OpTypeFloat => &[_]Operand{
2163 .{ .kind = .IdResult, .quantifier = .required },
2164 .{ .kind = .LiteralInteger, .quantifier = .required },
2165 },
2166 .OpTypeVector => &[_]Operand{
2167 .{ .kind = .IdResult, .quantifier = .required },
2168 .{ .kind = .IdRef, .quantifier = .required },
2169 .{ .kind = .LiteralInteger, .quantifier = .required },
2170 },
2171 .OpTypeMatrix => &[_]Operand{
2172 .{ .kind = .IdResult, .quantifier = .required },
2173 .{ .kind = .IdRef, .quantifier = .required },
2174 .{ .kind = .LiteralInteger, .quantifier = .required },
2175 },
2176 .OpTypeImage => &[_]Operand{
2177 .{ .kind = .IdResult, .quantifier = .required },
2178 .{ .kind = .IdRef, .quantifier = .required },
2179 .{ .kind = .Dim, .quantifier = .required },
2180 .{ .kind = .LiteralInteger, .quantifier = .required },
2181 .{ .kind = .LiteralInteger, .quantifier = .required },
2182 .{ .kind = .LiteralInteger, .quantifier = .required },
2183 .{ .kind = .LiteralInteger, .quantifier = .required },
2184 .{ .kind = .ImageFormat, .quantifier = .required },
2185 .{ .kind = .AccessQualifier, .quantifier = .optional },
2186 },
2187 .OpTypeSampler => &[_]Operand{
2188 .{ .kind = .IdResult, .quantifier = .required },
2189 },
2190 .OpTypeSampledImage => &[_]Operand{
2191 .{ .kind = .IdResult, .quantifier = .required },
2192 .{ .kind = .IdRef, .quantifier = .required },
2193 },
2194 .OpTypeArray => &[_]Operand{
2195 .{ .kind = .IdResult, .quantifier = .required },
2196 .{ .kind = .IdRef, .quantifier = .required },
2197 .{ .kind = .IdRef, .quantifier = .required },
2198 },
2199 .OpTypeRuntimeArray => &[_]Operand{
2200 .{ .kind = .IdResult, .quantifier = .required },
2201 .{ .kind = .IdRef, .quantifier = .required },
2202 },
2203 .OpTypeStruct => &[_]Operand{
2204 .{ .kind = .IdResult, .quantifier = .required },
2205 .{ .kind = .IdRef, .quantifier = .variadic },
2206 },
2207 .OpTypeOpaque => &[_]Operand{
2208 .{ .kind = .IdResult, .quantifier = .required },
2209 .{ .kind = .LiteralString, .quantifier = .required },
2210 },
2211 .OpTypePointer => &[_]Operand{
2212 .{ .kind = .IdResult, .quantifier = .required },
2213 .{ .kind = .StorageClass, .quantifier = .required },
2214 .{ .kind = .IdRef, .quantifier = .required },
2215 },
2216 .OpTypeFunction => &[_]Operand{
2217 .{ .kind = .IdResult, .quantifier = .required },
2218 .{ .kind = .IdRef, .quantifier = .required },
2219 .{ .kind = .IdRef, .quantifier = .variadic },
2220 },
2221 .OpTypeEvent => &[_]Operand{
2222 .{ .kind = .IdResult, .quantifier = .required },
2223 },
2224 .OpTypeDeviceEvent => &[_]Operand{
2225 .{ .kind = .IdResult, .quantifier = .required },
2226 },
2227 .OpTypeReserveId => &[_]Operand{
2228 .{ .kind = .IdResult, .quantifier = .required },
2229 },
2230 .OpTypeQueue => &[_]Operand{
2231 .{ .kind = .IdResult, .quantifier = .required },
2232 },
2233 .OpTypePipe => &[_]Operand{
2234 .{ .kind = .IdResult, .quantifier = .required },
2235 .{ .kind = .AccessQualifier, .quantifier = .required },
2236 },
2237 .OpTypeForwardPointer => &[_]Operand{
2238 .{ .kind = .IdRef, .quantifier = .required },
2239 .{ .kind = .StorageClass, .quantifier = .required },
2240 },
2241 .OpConstantTrue => &[_]Operand{
2242 .{ .kind = .IdResultType, .quantifier = .required },
2243 .{ .kind = .IdResult, .quantifier = .required },
2244 },
2245 .OpConstantFalse => &[_]Operand{
2246 .{ .kind = .IdResultType, .quantifier = .required },
2247 .{ .kind = .IdResult, .quantifier = .required },
2248 },
2249 .OpConstant => &[_]Operand{
2250 .{ .kind = .IdResultType, .quantifier = .required },
2251 .{ .kind = .IdResult, .quantifier = .required },
2252 .{ .kind = .LiteralContextDependentNumber, .quantifier = .required },
2253 },
2254 .OpConstantComposite => &[_]Operand{
2255 .{ .kind = .IdResultType, .quantifier = .required },
2256 .{ .kind = .IdResult, .quantifier = .required },
2257 .{ .kind = .IdRef, .quantifier = .variadic },
2258 },
2259 .OpConstantSampler => &[_]Operand{
2260 .{ .kind = .IdResultType, .quantifier = .required },
2261 .{ .kind = .IdResult, .quantifier = .required },
2262 .{ .kind = .SamplerAddressingMode, .quantifier = .required },
2263 .{ .kind = .LiteralInteger, .quantifier = .required },
2264 .{ .kind = .SamplerFilterMode, .quantifier = .required },
2265 },
2266 .OpConstantNull => &[_]Operand{
2267 .{ .kind = .IdResultType, .quantifier = .required },
2268 .{ .kind = .IdResult, .quantifier = .required },
2269 },
2270 .OpSpecConstantTrue => &[_]Operand{
2271 .{ .kind = .IdResultType, .quantifier = .required },
2272 .{ .kind = .IdResult, .quantifier = .required },
2273 },
2274 .OpSpecConstantFalse => &[_]Operand{
2275 .{ .kind = .IdResultType, .quantifier = .required },
2276 .{ .kind = .IdResult, .quantifier = .required },
2277 },
2278 .OpSpecConstant => &[_]Operand{
2279 .{ .kind = .IdResultType, .quantifier = .required },
2280 .{ .kind = .IdResult, .quantifier = .required },
2281 .{ .kind = .LiteralContextDependentNumber, .quantifier = .required },
2282 },
2283 .OpSpecConstantComposite => &[_]Operand{
2284 .{ .kind = .IdResultType, .quantifier = .required },
2285 .{ .kind = .IdResult, .quantifier = .required },
2286 .{ .kind = .IdRef, .quantifier = .variadic },
2287 },
2288 .OpSpecConstantOp => &[_]Operand{
2289 .{ .kind = .IdResultType, .quantifier = .required },
2290 .{ .kind = .IdResult, .quantifier = .required },
2291 .{ .kind = .LiteralSpecConstantOpInteger, .quantifier = .required },
2292 },
2293 .OpFunction => &[_]Operand{
2294 .{ .kind = .IdResultType, .quantifier = .required },
2295 .{ .kind = .IdResult, .quantifier = .required },
2296 .{ .kind = .FunctionControl, .quantifier = .required },
2297 .{ .kind = .IdRef, .quantifier = .required },
2298 },
2299 .OpFunctionParameter => &[_]Operand{
2300 .{ .kind = .IdResultType, .quantifier = .required },
2301 .{ .kind = .IdResult, .quantifier = .required },
2302 },
2303 .OpFunctionEnd => &[_]Operand{},
2304 .OpFunctionCall => &[_]Operand{
2305 .{ .kind = .IdResultType, .quantifier = .required },
2306 .{ .kind = .IdResult, .quantifier = .required },
2307 .{ .kind = .IdRef, .quantifier = .required },
2308 .{ .kind = .IdRef, .quantifier = .variadic },
2309 },
2310 .OpVariable => &[_]Operand{
2311 .{ .kind = .IdResultType, .quantifier = .required },
2312 .{ .kind = .IdResult, .quantifier = .required },
2313 .{ .kind = .StorageClass, .quantifier = .required },
2314 .{ .kind = .IdRef, .quantifier = .optional },
2315 },
2316 .OpImageTexelPointer => &[_]Operand{
2317 .{ .kind = .IdResultType, .quantifier = .required },
2318 .{ .kind = .IdResult, .quantifier = .required },
2319 .{ .kind = .IdRef, .quantifier = .required },
2320 .{ .kind = .IdRef, .quantifier = .required },
2321 .{ .kind = .IdRef, .quantifier = .required },
2322 },
2323 .OpLoad => &[_]Operand{
2324 .{ .kind = .IdResultType, .quantifier = .required },
2325 .{ .kind = .IdResult, .quantifier = .required },
2326 .{ .kind = .IdRef, .quantifier = .required },
2327 .{ .kind = .MemoryAccess, .quantifier = .optional },
2328 },
2329 .OpStore => &[_]Operand{
2330 .{ .kind = .IdRef, .quantifier = .required },
2331 .{ .kind = .IdRef, .quantifier = .required },
2332 .{ .kind = .MemoryAccess, .quantifier = .optional },
2333 },
2334 .OpCopyMemory => &[_]Operand{
2335 .{ .kind = .IdRef, .quantifier = .required },
2336 .{ .kind = .IdRef, .quantifier = .required },
2337 .{ .kind = .MemoryAccess, .quantifier = .optional },
2338 .{ .kind = .MemoryAccess, .quantifier = .optional },
2339 },
2340 .OpCopyMemorySized => &[_]Operand{
2341 .{ .kind = .IdRef, .quantifier = .required },
2342 .{ .kind = .IdRef, .quantifier = .required },
2343 .{ .kind = .IdRef, .quantifier = .required },
2344 .{ .kind = .MemoryAccess, .quantifier = .optional },
2345 .{ .kind = .MemoryAccess, .quantifier = .optional },
2346 },
2347 .OpAccessChain => &[_]Operand{
2348 .{ .kind = .IdResultType, .quantifier = .required },
2349 .{ .kind = .IdResult, .quantifier = .required },
2350 .{ .kind = .IdRef, .quantifier = .required },
2351 .{ .kind = .IdRef, .quantifier = .variadic },
2352 },
2353 .OpInBoundsAccessChain => &[_]Operand{
2354 .{ .kind = .IdResultType, .quantifier = .required },
2355 .{ .kind = .IdResult, .quantifier = .required },
2356 .{ .kind = .IdRef, .quantifier = .required },
2357 .{ .kind = .IdRef, .quantifier = .variadic },
2358 },
2359 .OpPtrAccessChain => &[_]Operand{
2360 .{ .kind = .IdResultType, .quantifier = .required },
2361 .{ .kind = .IdResult, .quantifier = .required },
2362 .{ .kind = .IdRef, .quantifier = .required },
2363 .{ .kind = .IdRef, .quantifier = .required },
2364 .{ .kind = .IdRef, .quantifier = .variadic },
2365 },
2366 .OpArrayLength => &[_]Operand{
2367 .{ .kind = .IdResultType, .quantifier = .required },
2368 .{ .kind = .IdResult, .quantifier = .required },
2369 .{ .kind = .IdRef, .quantifier = .required },
2370 .{ .kind = .LiteralInteger, .quantifier = .required },
2371 },
2372 .OpGenericPtrMemSemantics => &[_]Operand{
2373 .{ .kind = .IdResultType, .quantifier = .required },
2374 .{ .kind = .IdResult, .quantifier = .required },
2375 .{ .kind = .IdRef, .quantifier = .required },
2376 },
2377 .OpInBoundsPtrAccessChain => &[_]Operand{
2378 .{ .kind = .IdResultType, .quantifier = .required },
2379 .{ .kind = .IdResult, .quantifier = .required },
2380 .{ .kind = .IdRef, .quantifier = .required },
2381 .{ .kind = .IdRef, .quantifier = .required },
2382 .{ .kind = .IdRef, .quantifier = .variadic },
2383 },
2384 .OpDecorate => &[_]Operand{
2385 .{ .kind = .IdRef, .quantifier = .required },
2386 .{ .kind = .Decoration, .quantifier = .required },
2387 },
2388 .OpMemberDecorate => &[_]Operand{
2389 .{ .kind = .IdRef, .quantifier = .required },
2390 .{ .kind = .LiteralInteger, .quantifier = .required },
2391 .{ .kind = .Decoration, .quantifier = .required },
2392 },
2393 .OpDecorationGroup => &[_]Operand{
2394 .{ .kind = .IdResult, .quantifier = .required },
2395 },
2396 .OpGroupDecorate => &[_]Operand{
2397 .{ .kind = .IdRef, .quantifier = .required },
2398 .{ .kind = .IdRef, .quantifier = .variadic },
2399 },
2400 .OpGroupMemberDecorate => &[_]Operand{
2401 .{ .kind = .IdRef, .quantifier = .required },
2402 .{ .kind = .PairIdRefLiteralInteger, .quantifier = .variadic },
2403 },
2404 .OpVectorExtractDynamic => &[_]Operand{
2405 .{ .kind = .IdResultType, .quantifier = .required },
2406 .{ .kind = .IdResult, .quantifier = .required },
2407 .{ .kind = .IdRef, .quantifier = .required },
2408 .{ .kind = .IdRef, .quantifier = .required },
2409 },
2410 .OpVectorInsertDynamic => &[_]Operand{
2411 .{ .kind = .IdResultType, .quantifier = .required },
2412 .{ .kind = .IdResult, .quantifier = .required },
2413 .{ .kind = .IdRef, .quantifier = .required },
2414 .{ .kind = .IdRef, .quantifier = .required },
2415 .{ .kind = .IdRef, .quantifier = .required },
2416 },
2417 .OpVectorShuffle => &[_]Operand{
2418 .{ .kind = .IdResultType, .quantifier = .required },
2419 .{ .kind = .IdResult, .quantifier = .required },
2420 .{ .kind = .IdRef, .quantifier = .required },
2421 .{ .kind = .IdRef, .quantifier = .required },
2422 .{ .kind = .LiteralInteger, .quantifier = .variadic },
2423 },
2424 .OpCompositeConstruct => &[_]Operand{
2425 .{ .kind = .IdResultType, .quantifier = .required },
2426 .{ .kind = .IdResult, .quantifier = .required },
2427 .{ .kind = .IdRef, .quantifier = .variadic },
2428 },
2429 .OpCompositeExtract => &[_]Operand{
2430 .{ .kind = .IdResultType, .quantifier = .required },
2431 .{ .kind = .IdResult, .quantifier = .required },
2432 .{ .kind = .IdRef, .quantifier = .required },
2433 .{ .kind = .LiteralInteger, .quantifier = .variadic },
2434 },
2435 .OpCompositeInsert => &[_]Operand{
2436 .{ .kind = .IdResultType, .quantifier = .required },
2437 .{ .kind = .IdResult, .quantifier = .required },
2438 .{ .kind = .IdRef, .quantifier = .required },
2439 .{ .kind = .IdRef, .quantifier = .required },
2440 .{ .kind = .LiteralInteger, .quantifier = .variadic },
2441 },
2442 .OpCopyObject => &[_]Operand{
2443 .{ .kind = .IdResultType, .quantifier = .required },
2444 .{ .kind = .IdResult, .quantifier = .required },
2445 .{ .kind = .IdRef, .quantifier = .required },
2446 },
2447 .OpTranspose => &[_]Operand{
2448 .{ .kind = .IdResultType, .quantifier = .required },
2449 .{ .kind = .IdResult, .quantifier = .required },
2450 .{ .kind = .IdRef, .quantifier = .required },
2451 },
2452 .OpSampledImage => &[_]Operand{
2453 .{ .kind = .IdResultType, .quantifier = .required },
2454 .{ .kind = .IdResult, .quantifier = .required },
2455 .{ .kind = .IdRef, .quantifier = .required },
2456 .{ .kind = .IdRef, .quantifier = .required },
2457 },
2458 .OpImageSampleImplicitLod => &[_]Operand{
2459 .{ .kind = .IdResultType, .quantifier = .required },
2460 .{ .kind = .IdResult, .quantifier = .required },
2461 .{ .kind = .IdRef, .quantifier = .required },
2462 .{ .kind = .IdRef, .quantifier = .required },
2463 .{ .kind = .ImageOperands, .quantifier = .optional },
2464 },
2465 .OpImageSampleExplicitLod => &[_]Operand{
2466 .{ .kind = .IdResultType, .quantifier = .required },
2467 .{ .kind = .IdResult, .quantifier = .required },
2468 .{ .kind = .IdRef, .quantifier = .required },
2469 .{ .kind = .IdRef, .quantifier = .required },
2470 .{ .kind = .ImageOperands, .quantifier = .required },
2471 },
2472 .OpImageSampleDrefImplicitLod => &[_]Operand{
2473 .{ .kind = .IdResultType, .quantifier = .required },
2474 .{ .kind = .IdResult, .quantifier = .required },
2475 .{ .kind = .IdRef, .quantifier = .required },
2476 .{ .kind = .IdRef, .quantifier = .required },
2477 .{ .kind = .IdRef, .quantifier = .required },
2478 .{ .kind = .ImageOperands, .quantifier = .optional },
2479 },
2480 .OpImageSampleDrefExplicitLod => &[_]Operand{
2481 .{ .kind = .IdResultType, .quantifier = .required },
2482 .{ .kind = .IdResult, .quantifier = .required },
2483 .{ .kind = .IdRef, .quantifier = .required },
2484 .{ .kind = .IdRef, .quantifier = .required },
2485 .{ .kind = .IdRef, .quantifier = .required },
2486 .{ .kind = .ImageOperands, .quantifier = .required },
2487 },
2488 .OpImageSampleProjImplicitLod => &[_]Operand{
2489 .{ .kind = .IdResultType, .quantifier = .required },
2490 .{ .kind = .IdResult, .quantifier = .required },
2491 .{ .kind = .IdRef, .quantifier = .required },
2492 .{ .kind = .IdRef, .quantifier = .required },
2493 .{ .kind = .ImageOperands, .quantifier = .optional },
2494 },
2495 .OpImageSampleProjExplicitLod => &[_]Operand{
2496 .{ .kind = .IdResultType, .quantifier = .required },
2497 .{ .kind = .IdResult, .quantifier = .required },
2498 .{ .kind = .IdRef, .quantifier = .required },
2499 .{ .kind = .IdRef, .quantifier = .required },
2500 .{ .kind = .ImageOperands, .quantifier = .required },
2501 },
2502 .OpImageSampleProjDrefImplicitLod => &[_]Operand{
2503 .{ .kind = .IdResultType, .quantifier = .required },
2504 .{ .kind = .IdResult, .quantifier = .required },
2505 .{ .kind = .IdRef, .quantifier = .required },
2506 .{ .kind = .IdRef, .quantifier = .required },
2507 .{ .kind = .IdRef, .quantifier = .required },
2508 .{ .kind = .ImageOperands, .quantifier = .optional },
2509 },
2510 .OpImageSampleProjDrefExplicitLod => &[_]Operand{
2511 .{ .kind = .IdResultType, .quantifier = .required },
2512 .{ .kind = .IdResult, .quantifier = .required },
2513 .{ .kind = .IdRef, .quantifier = .required },
2514 .{ .kind = .IdRef, .quantifier = .required },
2515 .{ .kind = .IdRef, .quantifier = .required },
2516 .{ .kind = .ImageOperands, .quantifier = .required },
2517 },
2518 .OpImageFetch => &[_]Operand{
2519 .{ .kind = .IdResultType, .quantifier = .required },
2520 .{ .kind = .IdResult, .quantifier = .required },
2521 .{ .kind = .IdRef, .quantifier = .required },
2522 .{ .kind = .IdRef, .quantifier = .required },
2523 .{ .kind = .ImageOperands, .quantifier = .optional },
2524 },
2525 .OpImageGather => &[_]Operand{
2526 .{ .kind = .IdResultType, .quantifier = .required },
2527 .{ .kind = .IdResult, .quantifier = .required },
2528 .{ .kind = .IdRef, .quantifier = .required },
2529 .{ .kind = .IdRef, .quantifier = .required },
2530 .{ .kind = .IdRef, .quantifier = .required },
2531 .{ .kind = .ImageOperands, .quantifier = .optional },
2532 },
2533 .OpImageDrefGather => &[_]Operand{
2534 .{ .kind = .IdResultType, .quantifier = .required },
2535 .{ .kind = .IdResult, .quantifier = .required },
2536 .{ .kind = .IdRef, .quantifier = .required },
2537 .{ .kind = .IdRef, .quantifier = .required },
2538 .{ .kind = .IdRef, .quantifier = .required },
2539 .{ .kind = .ImageOperands, .quantifier = .optional },
2540 },
2541 .OpImageRead => &[_]Operand{
2542 .{ .kind = .IdResultType, .quantifier = .required },
2543 .{ .kind = .IdResult, .quantifier = .required },
2544 .{ .kind = .IdRef, .quantifier = .required },
2545 .{ .kind = .IdRef, .quantifier = .required },
2546 .{ .kind = .ImageOperands, .quantifier = .optional },
2547 },
2548 .OpImageWrite => &[_]Operand{
2549 .{ .kind = .IdRef, .quantifier = .required },
2550 .{ .kind = .IdRef, .quantifier = .required },
2551 .{ .kind = .IdRef, .quantifier = .required },
2552 .{ .kind = .ImageOperands, .quantifier = .optional },
2553 },
2554 .OpImage => &[_]Operand{
2555 .{ .kind = .IdResultType, .quantifier = .required },
2556 .{ .kind = .IdResult, .quantifier = .required },
2557 .{ .kind = .IdRef, .quantifier = .required },
2558 },
2559 .OpImageQueryFormat => &[_]Operand{
2560 .{ .kind = .IdResultType, .quantifier = .required },
2561 .{ .kind = .IdResult, .quantifier = .required },
2562 .{ .kind = .IdRef, .quantifier = .required },
2563 },
2564 .OpImageQueryOrder => &[_]Operand{
2565 .{ .kind = .IdResultType, .quantifier = .required },
2566 .{ .kind = .IdResult, .quantifier = .required },
2567 .{ .kind = .IdRef, .quantifier = .required },
2568 },
2569 .OpImageQuerySizeLod => &[_]Operand{
2570 .{ .kind = .IdResultType, .quantifier = .required },
2571 .{ .kind = .IdResult, .quantifier = .required },
2572 .{ .kind = .IdRef, .quantifier = .required },
2573 .{ .kind = .IdRef, .quantifier = .required },
2574 },
2575 .OpImageQuerySize => &[_]Operand{
2576 .{ .kind = .IdResultType, .quantifier = .required },
2577 .{ .kind = .IdResult, .quantifier = .required },
2578 .{ .kind = .IdRef, .quantifier = .required },
2579 },
2580 .OpImageQueryLod => &[_]Operand{
2581 .{ .kind = .IdResultType, .quantifier = .required },
2582 .{ .kind = .IdResult, .quantifier = .required },
2583 .{ .kind = .IdRef, .quantifier = .required },
2584 .{ .kind = .IdRef, .quantifier = .required },
2585 },
2586 .OpImageQueryLevels => &[_]Operand{
2587 .{ .kind = .IdResultType, .quantifier = .required },
2588 .{ .kind = .IdResult, .quantifier = .required },
2589 .{ .kind = .IdRef, .quantifier = .required },
2590 },
2591 .OpImageQuerySamples => &[_]Operand{
2592 .{ .kind = .IdResultType, .quantifier = .required },
2593 .{ .kind = .IdResult, .quantifier = .required },
2594 .{ .kind = .IdRef, .quantifier = .required },
2595 },
2596 .OpConvertFToU => &[_]Operand{
2597 .{ .kind = .IdResultType, .quantifier = .required },
2598 .{ .kind = .IdResult, .quantifier = .required },
2599 .{ .kind = .IdRef, .quantifier = .required },
2600 },
2601 .OpConvertFToS => &[_]Operand{
2602 .{ .kind = .IdResultType, .quantifier = .required },
2603 .{ .kind = .IdResult, .quantifier = .required },
2604 .{ .kind = .IdRef, .quantifier = .required },
2605 },
2606 .OpConvertSToF => &[_]Operand{
2607 .{ .kind = .IdResultType, .quantifier = .required },
2608 .{ .kind = .IdResult, .quantifier = .required },
2609 .{ .kind = .IdRef, .quantifier = .required },
2610 },
2611 .OpConvertUToF => &[_]Operand{
2612 .{ .kind = .IdResultType, .quantifier = .required },
2613 .{ .kind = .IdResult, .quantifier = .required },
2614 .{ .kind = .IdRef, .quantifier = .required },
2615 },
2616 .OpUConvert => &[_]Operand{
2617 .{ .kind = .IdResultType, .quantifier = .required },
2618 .{ .kind = .IdResult, .quantifier = .required },
2619 .{ .kind = .IdRef, .quantifier = .required },
2620 },
2621 .OpSConvert => &[_]Operand{
2622 .{ .kind = .IdResultType, .quantifier = .required },
2623 .{ .kind = .IdResult, .quantifier = .required },
2624 .{ .kind = .IdRef, .quantifier = .required },
2625 },
2626 .OpFConvert => &[_]Operand{
2627 .{ .kind = .IdResultType, .quantifier = .required },
2628 .{ .kind = .IdResult, .quantifier = .required },
2629 .{ .kind = .IdRef, .quantifier = .required },
2630 },
2631 .OpQuantizeToF16 => &[_]Operand{
2632 .{ .kind = .IdResultType, .quantifier = .required },
2633 .{ .kind = .IdResult, .quantifier = .required },
2634 .{ .kind = .IdRef, .quantifier = .required },
2635 },
2636 .OpConvertPtrToU => &[_]Operand{
2637 .{ .kind = .IdResultType, .quantifier = .required },
2638 .{ .kind = .IdResult, .quantifier = .required },
2639 .{ .kind = .IdRef, .quantifier = .required },
2640 },
2641 .OpSatConvertSToU => &[_]Operand{
2642 .{ .kind = .IdResultType, .quantifier = .required },
2643 .{ .kind = .IdResult, .quantifier = .required },
2644 .{ .kind = .IdRef, .quantifier = .required },
2645 },
2646 .OpSatConvertUToS => &[_]Operand{
2647 .{ .kind = .IdResultType, .quantifier = .required },
2648 .{ .kind = .IdResult, .quantifier = .required },
2649 .{ .kind = .IdRef, .quantifier = .required },
2650 },
2651 .OpConvertUToPtr => &[_]Operand{
2652 .{ .kind = .IdResultType, .quantifier = .required },
2653 .{ .kind = .IdResult, .quantifier = .required },
2654 .{ .kind = .IdRef, .quantifier = .required },
2655 },
2656 .OpPtrCastToGeneric => &[_]Operand{
2657 .{ .kind = .IdResultType, .quantifier = .required },
2658 .{ .kind = .IdResult, .quantifier = .required },
2659 .{ .kind = .IdRef, .quantifier = .required },
2660 },
2661 .OpGenericCastToPtr => &[_]Operand{
2662 .{ .kind = .IdResultType, .quantifier = .required },
2663 .{ .kind = .IdResult, .quantifier = .required },
2664 .{ .kind = .IdRef, .quantifier = .required },
2665 },
2666 .OpGenericCastToPtrExplicit => &[_]Operand{
2667 .{ .kind = .IdResultType, .quantifier = .required },
2668 .{ .kind = .IdResult, .quantifier = .required },
2669 .{ .kind = .IdRef, .quantifier = .required },
2670 .{ .kind = .StorageClass, .quantifier = .required },
2671 },
2672 .OpBitcast => &[_]Operand{
2673 .{ .kind = .IdResultType, .quantifier = .required },
2674 .{ .kind = .IdResult, .quantifier = .required },
2675 .{ .kind = .IdRef, .quantifier = .required },
2676 },
2677 .OpSNegate => &[_]Operand{
2678 .{ .kind = .IdResultType, .quantifier = .required },
2679 .{ .kind = .IdResult, .quantifier = .required },
2680 .{ .kind = .IdRef, .quantifier = .required },
2681 },
2682 .OpFNegate => &[_]Operand{
2683 .{ .kind = .IdResultType, .quantifier = .required },
2684 .{ .kind = .IdResult, .quantifier = .required },
2685 .{ .kind = .IdRef, .quantifier = .required },
2686 },
2687 .OpIAdd => &[_]Operand{
2688 .{ .kind = .IdResultType, .quantifier = .required },
2689 .{ .kind = .IdResult, .quantifier = .required },
2690 .{ .kind = .IdRef, .quantifier = .required },
2691 .{ .kind = .IdRef, .quantifier = .required },
2692 },
2693 .OpFAdd => &[_]Operand{
2694 .{ .kind = .IdResultType, .quantifier = .required },
2695 .{ .kind = .IdResult, .quantifier = .required },
2696 .{ .kind = .IdRef, .quantifier = .required },
2697 .{ .kind = .IdRef, .quantifier = .required },
2698 },
2699 .OpISub => &[_]Operand{
2700 .{ .kind = .IdResultType, .quantifier = .required },
2701 .{ .kind = .IdResult, .quantifier = .required },
2702 .{ .kind = .IdRef, .quantifier = .required },
2703 .{ .kind = .IdRef, .quantifier = .required },
2704 },
2705 .OpFSub => &[_]Operand{
2706 .{ .kind = .IdResultType, .quantifier = .required },
2707 .{ .kind = .IdResult, .quantifier = .required },
2708 .{ .kind = .IdRef, .quantifier = .required },
2709 .{ .kind = .IdRef, .quantifier = .required },
2710 },
2711 .OpIMul => &[_]Operand{
2712 .{ .kind = .IdResultType, .quantifier = .required },
2713 .{ .kind = .IdResult, .quantifier = .required },
2714 .{ .kind = .IdRef, .quantifier = .required },
2715 .{ .kind = .IdRef, .quantifier = .required },
2716 },
2717 .OpFMul => &[_]Operand{
2718 .{ .kind = .IdResultType, .quantifier = .required },
2719 .{ .kind = .IdResult, .quantifier = .required },
2720 .{ .kind = .IdRef, .quantifier = .required },
2721 .{ .kind = .IdRef, .quantifier = .required },
2722 },
2723 .OpUDiv => &[_]Operand{
2724 .{ .kind = .IdResultType, .quantifier = .required },
2725 .{ .kind = .IdResult, .quantifier = .required },
2726 .{ .kind = .IdRef, .quantifier = .required },
2727 .{ .kind = .IdRef, .quantifier = .required },
2728 },
2729 .OpSDiv => &[_]Operand{
2730 .{ .kind = .IdResultType, .quantifier = .required },
2731 .{ .kind = .IdResult, .quantifier = .required },
2732 .{ .kind = .IdRef, .quantifier = .required },
2733 .{ .kind = .IdRef, .quantifier = .required },
2734 },
2735 .OpFDiv => &[_]Operand{
2736 .{ .kind = .IdResultType, .quantifier = .required },
2737 .{ .kind = .IdResult, .quantifier = .required },
2738 .{ .kind = .IdRef, .quantifier = .required },
2739 .{ .kind = .IdRef, .quantifier = .required },
2740 },
2741 .OpUMod => &[_]Operand{
2742 .{ .kind = .IdResultType, .quantifier = .required },
2743 .{ .kind = .IdResult, .quantifier = .required },
2744 .{ .kind = .IdRef, .quantifier = .required },
2745 .{ .kind = .IdRef, .quantifier = .required },
2746 },
2747 .OpSRem => &[_]Operand{
2748 .{ .kind = .IdResultType, .quantifier = .required },
2749 .{ .kind = .IdResult, .quantifier = .required },
2750 .{ .kind = .IdRef, .quantifier = .required },
2751 .{ .kind = .IdRef, .quantifier = .required },
2752 },
2753 .OpSMod => &[_]Operand{
2754 .{ .kind = .IdResultType, .quantifier = .required },
2755 .{ .kind = .IdResult, .quantifier = .required },
2756 .{ .kind = .IdRef, .quantifier = .required },
2757 .{ .kind = .IdRef, .quantifier = .required },
2758 },
2759 .OpFRem => &[_]Operand{
2760 .{ .kind = .IdResultType, .quantifier = .required },
2761 .{ .kind = .IdResult, .quantifier = .required },
2762 .{ .kind = .IdRef, .quantifier = .required },
2763 .{ .kind = .IdRef, .quantifier = .required },
2764 },
2765 .OpFMod => &[_]Operand{
2766 .{ .kind = .IdResultType, .quantifier = .required },
2767 .{ .kind = .IdResult, .quantifier = .required },
2768 .{ .kind = .IdRef, .quantifier = .required },
2769 .{ .kind = .IdRef, .quantifier = .required },
2770 },
2771 .OpVectorTimesScalar => &[_]Operand{
2772 .{ .kind = .IdResultType, .quantifier = .required },
2773 .{ .kind = .IdResult, .quantifier = .required },
2774 .{ .kind = .IdRef, .quantifier = .required },
2775 .{ .kind = .IdRef, .quantifier = .required },
2776 },
2777 .OpMatrixTimesScalar => &[_]Operand{
2778 .{ .kind = .IdResultType, .quantifier = .required },
2779 .{ .kind = .IdResult, .quantifier = .required },
2780 .{ .kind = .IdRef, .quantifier = .required },
2781 .{ .kind = .IdRef, .quantifier = .required },
2782 },
2783 .OpVectorTimesMatrix => &[_]Operand{
2784 .{ .kind = .IdResultType, .quantifier = .required },
2785 .{ .kind = .IdResult, .quantifier = .required },
2786 .{ .kind = .IdRef, .quantifier = .required },
2787 .{ .kind = .IdRef, .quantifier = .required },
2788 },
2789 .OpMatrixTimesVector => &[_]Operand{
2790 .{ .kind = .IdResultType, .quantifier = .required },
2791 .{ .kind = .IdResult, .quantifier = .required },
2792 .{ .kind = .IdRef, .quantifier = .required },
2793 .{ .kind = .IdRef, .quantifier = .required },
2794 },
2795 .OpMatrixTimesMatrix => &[_]Operand{
2796 .{ .kind = .IdResultType, .quantifier = .required },
2797 .{ .kind = .IdResult, .quantifier = .required },
2798 .{ .kind = .IdRef, .quantifier = .required },
2799 .{ .kind = .IdRef, .quantifier = .required },
2800 },
2801 .OpOuterProduct => &[_]Operand{
2802 .{ .kind = .IdResultType, .quantifier = .required },
2803 .{ .kind = .IdResult, .quantifier = .required },
2804 .{ .kind = .IdRef, .quantifier = .required },
2805 .{ .kind = .IdRef, .quantifier = .required },
2806 },
2807 .OpDot => &[_]Operand{
2808 .{ .kind = .IdResultType, .quantifier = .required },
2809 .{ .kind = .IdResult, .quantifier = .required },
2810 .{ .kind = .IdRef, .quantifier = .required },
2811 .{ .kind = .IdRef, .quantifier = .required },
2812 },
2813 .OpIAddCarry => &[_]Operand{
2814 .{ .kind = .IdResultType, .quantifier = .required },
2815 .{ .kind = .IdResult, .quantifier = .required },
2816 .{ .kind = .IdRef, .quantifier = .required },
2817 .{ .kind = .IdRef, .quantifier = .required },
2818 },
2819 .OpISubBorrow => &[_]Operand{
2820 .{ .kind = .IdResultType, .quantifier = .required },
2821 .{ .kind = .IdResult, .quantifier = .required },
2822 .{ .kind = .IdRef, .quantifier = .required },
2823 .{ .kind = .IdRef, .quantifier = .required },
2824 },
2825 .OpUMulExtended => &[_]Operand{
2826 .{ .kind = .IdResultType, .quantifier = .required },
2827 .{ .kind = .IdResult, .quantifier = .required },
2828 .{ .kind = .IdRef, .quantifier = .required },
2829 .{ .kind = .IdRef, .quantifier = .required },
2830 },
2831 .OpSMulExtended => &[_]Operand{
2832 .{ .kind = .IdResultType, .quantifier = .required },
2833 .{ .kind = .IdResult, .quantifier = .required },
2834 .{ .kind = .IdRef, .quantifier = .required },
2835 .{ .kind = .IdRef, .quantifier = .required },
2836 },
2837 .OpAny => &[_]Operand{
2838 .{ .kind = .IdResultType, .quantifier = .required },
2839 .{ .kind = .IdResult, .quantifier = .required },
2840 .{ .kind = .IdRef, .quantifier = .required },
2841 },
2842 .OpAll => &[_]Operand{
2843 .{ .kind = .IdResultType, .quantifier = .required },
2844 .{ .kind = .IdResult, .quantifier = .required },
2845 .{ .kind = .IdRef, .quantifier = .required },
2846 },
2847 .OpIsNan => &[_]Operand{
2848 .{ .kind = .IdResultType, .quantifier = .required },
2849 .{ .kind = .IdResult, .quantifier = .required },
2850 .{ .kind = .IdRef, .quantifier = .required },
2851 },
2852 .OpIsInf => &[_]Operand{
2853 .{ .kind = .IdResultType, .quantifier = .required },
2854 .{ .kind = .IdResult, .quantifier = .required },
2855 .{ .kind = .IdRef, .quantifier = .required },
2856 },
2857 .OpIsFinite => &[_]Operand{
2858 .{ .kind = .IdResultType, .quantifier = .required },
2859 .{ .kind = .IdResult, .quantifier = .required },
2860 .{ .kind = .IdRef, .quantifier = .required },
2861 },
2862 .OpIsNormal => &[_]Operand{
2863 .{ .kind = .IdResultType, .quantifier = .required },
2864 .{ .kind = .IdResult, .quantifier = .required },
2865 .{ .kind = .IdRef, .quantifier = .required },
2866 },
2867 .OpSignBitSet => &[_]Operand{
2868 .{ .kind = .IdResultType, .quantifier = .required },
2869 .{ .kind = .IdResult, .quantifier = .required },
2870 .{ .kind = .IdRef, .quantifier = .required },
2871 },
2872 .OpLessOrGreater => &[_]Operand{
2873 .{ .kind = .IdResultType, .quantifier = .required },
2874 .{ .kind = .IdResult, .quantifier = .required },
2875 .{ .kind = .IdRef, .quantifier = .required },
2876 .{ .kind = .IdRef, .quantifier = .required },
2877 },
2878 .OpOrdered => &[_]Operand{
2879 .{ .kind = .IdResultType, .quantifier = .required },
2880 .{ .kind = .IdResult, .quantifier = .required },
2881 .{ .kind = .IdRef, .quantifier = .required },
2882 .{ .kind = .IdRef, .quantifier = .required },
2883 },
2884 .OpUnordered => &[_]Operand{
2885 .{ .kind = .IdResultType, .quantifier = .required },
2886 .{ .kind = .IdResult, .quantifier = .required },
2887 .{ .kind = .IdRef, .quantifier = .required },
2888 .{ .kind = .IdRef, .quantifier = .required },
2889 },
2890 .OpLogicalEqual => &[_]Operand{
2891 .{ .kind = .IdResultType, .quantifier = .required },
2892 .{ .kind = .IdResult, .quantifier = .required },
2893 .{ .kind = .IdRef, .quantifier = .required },
2894 .{ .kind = .IdRef, .quantifier = .required },
2895 },
2896 .OpLogicalNotEqual => &[_]Operand{
2897 .{ .kind = .IdResultType, .quantifier = .required },
2898 .{ .kind = .IdResult, .quantifier = .required },
2899 .{ .kind = .IdRef, .quantifier = .required },
2900 .{ .kind = .IdRef, .quantifier = .required },
2901 },
2902 .OpLogicalOr => &[_]Operand{
2903 .{ .kind = .IdResultType, .quantifier = .required },
2904 .{ .kind = .IdResult, .quantifier = .required },
2905 .{ .kind = .IdRef, .quantifier = .required },
2906 .{ .kind = .IdRef, .quantifier = .required },
2907 },
2908 .OpLogicalAnd => &[_]Operand{
2909 .{ .kind = .IdResultType, .quantifier = .required },
2910 .{ .kind = .IdResult, .quantifier = .required },
2911 .{ .kind = .IdRef, .quantifier = .required },
2912 .{ .kind = .IdRef, .quantifier = .required },
2913 },
2914 .OpLogicalNot => &[_]Operand{
2915 .{ .kind = .IdResultType, .quantifier = .required },
2916 .{ .kind = .IdResult, .quantifier = .required },
2917 .{ .kind = .IdRef, .quantifier = .required },
2918 },
2919 .OpSelect => &[_]Operand{
2920 .{ .kind = .IdResultType, .quantifier = .required },
2921 .{ .kind = .IdResult, .quantifier = .required },
2922 .{ .kind = .IdRef, .quantifier = .required },
2923 .{ .kind = .IdRef, .quantifier = .required },
2924 .{ .kind = .IdRef, .quantifier = .required },
2925 },
2926 .OpIEqual => &[_]Operand{
2927 .{ .kind = .IdResultType, .quantifier = .required },
2928 .{ .kind = .IdResult, .quantifier = .required },
2929 .{ .kind = .IdRef, .quantifier = .required },
2930 .{ .kind = .IdRef, .quantifier = .required },
2931 },
2932 .OpINotEqual => &[_]Operand{
2933 .{ .kind = .IdResultType, .quantifier = .required },
2934 .{ .kind = .IdResult, .quantifier = .required },
2935 .{ .kind = .IdRef, .quantifier = .required },
2936 .{ .kind = .IdRef, .quantifier = .required },
2937 },
2938 .OpUGreaterThan => &[_]Operand{
2939 .{ .kind = .IdResultType, .quantifier = .required },
2940 .{ .kind = .IdResult, .quantifier = .required },
2941 .{ .kind = .IdRef, .quantifier = .required },
2942 .{ .kind = .IdRef, .quantifier = .required },
2943 },
2944 .OpSGreaterThan => &[_]Operand{
2945 .{ .kind = .IdResultType, .quantifier = .required },
2946 .{ .kind = .IdResult, .quantifier = .required },
2947 .{ .kind = .IdRef, .quantifier = .required },
2948 .{ .kind = .IdRef, .quantifier = .required },
2949 },
2950 .OpUGreaterThanEqual => &[_]Operand{
2951 .{ .kind = .IdResultType, .quantifier = .required },
2952 .{ .kind = .IdResult, .quantifier = .required },
2953 .{ .kind = .IdRef, .quantifier = .required },
2954 .{ .kind = .IdRef, .quantifier = .required },
2955 },
2956 .OpSGreaterThanEqual => &[_]Operand{
2957 .{ .kind = .IdResultType, .quantifier = .required },
2958 .{ .kind = .IdResult, .quantifier = .required },
2959 .{ .kind = .IdRef, .quantifier = .required },
2960 .{ .kind = .IdRef, .quantifier = .required },
2961 },
2962 .OpULessThan => &[_]Operand{
2963 .{ .kind = .IdResultType, .quantifier = .required },
2964 .{ .kind = .IdResult, .quantifier = .required },
2965 .{ .kind = .IdRef, .quantifier = .required },
2966 .{ .kind = .IdRef, .quantifier = .required },
2967 },
2968 .OpSLessThan => &[_]Operand{
2969 .{ .kind = .IdResultType, .quantifier = .required },
2970 .{ .kind = .IdResult, .quantifier = .required },
2971 .{ .kind = .IdRef, .quantifier = .required },
2972 .{ .kind = .IdRef, .quantifier = .required },
2973 },
2974 .OpULessThanEqual => &[_]Operand{
2975 .{ .kind = .IdResultType, .quantifier = .required },
2976 .{ .kind = .IdResult, .quantifier = .required },
2977 .{ .kind = .IdRef, .quantifier = .required },
2978 .{ .kind = .IdRef, .quantifier = .required },
2979 },
2980 .OpSLessThanEqual => &[_]Operand{
2981 .{ .kind = .IdResultType, .quantifier = .required },
2982 .{ .kind = .IdResult, .quantifier = .required },
2983 .{ .kind = .IdRef, .quantifier = .required },
2984 .{ .kind = .IdRef, .quantifier = .required },
2985 },
2986 .OpFOrdEqual => &[_]Operand{
2987 .{ .kind = .IdResultType, .quantifier = .required },
2988 .{ .kind = .IdResult, .quantifier = .required },
2989 .{ .kind = .IdRef, .quantifier = .required },
2990 .{ .kind = .IdRef, .quantifier = .required },
2991 },
2992 .OpFUnordEqual => &[_]Operand{
2993 .{ .kind = .IdResultType, .quantifier = .required },
2994 .{ .kind = .IdResult, .quantifier = .required },
2995 .{ .kind = .IdRef, .quantifier = .required },
2996 .{ .kind = .IdRef, .quantifier = .required },
2997 },
2998 .OpFOrdNotEqual => &[_]Operand{
2999 .{ .kind = .IdResultType, .quantifier = .required },
3000 .{ .kind = .IdResult, .quantifier = .required },
3001 .{ .kind = .IdRef, .quantifier = .required },
3002 .{ .kind = .IdRef, .quantifier = .required },
3003 },
3004 .OpFUnordNotEqual => &[_]Operand{
3005 .{ .kind = .IdResultType, .quantifier = .required },
3006 .{ .kind = .IdResult, .quantifier = .required },
3007 .{ .kind = .IdRef, .quantifier = .required },
3008 .{ .kind = .IdRef, .quantifier = .required },
3009 },
3010 .OpFOrdLessThan => &[_]Operand{
3011 .{ .kind = .IdResultType, .quantifier = .required },
3012 .{ .kind = .IdResult, .quantifier = .required },
3013 .{ .kind = .IdRef, .quantifier = .required },
3014 .{ .kind = .IdRef, .quantifier = .required },
3015 },
3016 .OpFUnordLessThan => &[_]Operand{
3017 .{ .kind = .IdResultType, .quantifier = .required },
3018 .{ .kind = .IdResult, .quantifier = .required },
3019 .{ .kind = .IdRef, .quantifier = .required },
3020 .{ .kind = .IdRef, .quantifier = .required },
3021 },
3022 .OpFOrdGreaterThan => &[_]Operand{
3023 .{ .kind = .IdResultType, .quantifier = .required },
3024 .{ .kind = .IdResult, .quantifier = .required },
3025 .{ .kind = .IdRef, .quantifier = .required },
3026 .{ .kind = .IdRef, .quantifier = .required },
3027 },
3028 .OpFUnordGreaterThan => &[_]Operand{
3029 .{ .kind = .IdResultType, .quantifier = .required },
3030 .{ .kind = .IdResult, .quantifier = .required },
3031 .{ .kind = .IdRef, .quantifier = .required },
3032 .{ .kind = .IdRef, .quantifier = .required },
3033 },
3034 .OpFOrdLessThanEqual => &[_]Operand{
3035 .{ .kind = .IdResultType, .quantifier = .required },
3036 .{ .kind = .IdResult, .quantifier = .required },
3037 .{ .kind = .IdRef, .quantifier = .required },
3038 .{ .kind = .IdRef, .quantifier = .required },
3039 },
3040 .OpFUnordLessThanEqual => &[_]Operand{
3041 .{ .kind = .IdResultType, .quantifier = .required },
3042 .{ .kind = .IdResult, .quantifier = .required },
3043 .{ .kind = .IdRef, .quantifier = .required },
3044 .{ .kind = .IdRef, .quantifier = .required },
3045 },
3046 .OpFOrdGreaterThanEqual => &[_]Operand{
3047 .{ .kind = .IdResultType, .quantifier = .required },
3048 .{ .kind = .IdResult, .quantifier = .required },
3049 .{ .kind = .IdRef, .quantifier = .required },
3050 .{ .kind = .IdRef, .quantifier = .required },
3051 },
3052 .OpFUnordGreaterThanEqual => &[_]Operand{
3053 .{ .kind = .IdResultType, .quantifier = .required },
3054 .{ .kind = .IdResult, .quantifier = .required },
3055 .{ .kind = .IdRef, .quantifier = .required },
3056 .{ .kind = .IdRef, .quantifier = .required },
3057 },
3058 .OpShiftRightLogical => &[_]Operand{
3059 .{ .kind = .IdResultType, .quantifier = .required },
3060 .{ .kind = .IdResult, .quantifier = .required },
3061 .{ .kind = .IdRef, .quantifier = .required },
3062 .{ .kind = .IdRef, .quantifier = .required },
3063 },
3064 .OpShiftRightArithmetic => &[_]Operand{
3065 .{ .kind = .IdResultType, .quantifier = .required },
3066 .{ .kind = .IdResult, .quantifier = .required },
3067 .{ .kind = .IdRef, .quantifier = .required },
3068 .{ .kind = .IdRef, .quantifier = .required },
3069 },
3070 .OpShiftLeftLogical => &[_]Operand{
3071 .{ .kind = .IdResultType, .quantifier = .required },
3072 .{ .kind = .IdResult, .quantifier = .required },
3073 .{ .kind = .IdRef, .quantifier = .required },
3074 .{ .kind = .IdRef, .quantifier = .required },
3075 },
3076 .OpBitwiseOr => &[_]Operand{
3077 .{ .kind = .IdResultType, .quantifier = .required },
3078 .{ .kind = .IdResult, .quantifier = .required },
3079 .{ .kind = .IdRef, .quantifier = .required },
3080 .{ .kind = .IdRef, .quantifier = .required },
3081 },
3082 .OpBitwiseXor => &[_]Operand{
3083 .{ .kind = .IdResultType, .quantifier = .required },
3084 .{ .kind = .IdResult, .quantifier = .required },
3085 .{ .kind = .IdRef, .quantifier = .required },
3086 .{ .kind = .IdRef, .quantifier = .required },
3087 },
3088 .OpBitwiseAnd => &[_]Operand{
3089 .{ .kind = .IdResultType, .quantifier = .required },
3090 .{ .kind = .IdResult, .quantifier = .required },
3091 .{ .kind = .IdRef, .quantifier = .required },
3092 .{ .kind = .IdRef, .quantifier = .required },
3093 },
3094 .OpNot => &[_]Operand{
3095 .{ .kind = .IdResultType, .quantifier = .required },
3096 .{ .kind = .IdResult, .quantifier = .required },
3097 .{ .kind = .IdRef, .quantifier = .required },
3098 },
3099 .OpBitFieldInsert => &[_]Operand{
3100 .{ .kind = .IdResultType, .quantifier = .required },
3101 .{ .kind = .IdResult, .quantifier = .required },
3102 .{ .kind = .IdRef, .quantifier = .required },
3103 .{ .kind = .IdRef, .quantifier = .required },
3104 .{ .kind = .IdRef, .quantifier = .required },
3105 .{ .kind = .IdRef, .quantifier = .required },
3106 },
3107 .OpBitFieldSExtract => &[_]Operand{
3108 .{ .kind = .IdResultType, .quantifier = .required },
3109 .{ .kind = .IdResult, .quantifier = .required },
3110 .{ .kind = .IdRef, .quantifier = .required },
3111 .{ .kind = .IdRef, .quantifier = .required },
3112 .{ .kind = .IdRef, .quantifier = .required },
3113 },
3114 .OpBitFieldUExtract => &[_]Operand{
3115 .{ .kind = .IdResultType, .quantifier = .required },
3116 .{ .kind = .IdResult, .quantifier = .required },
3117 .{ .kind = .IdRef, .quantifier = .required },
3118 .{ .kind = .IdRef, .quantifier = .required },
3119 .{ .kind = .IdRef, .quantifier = .required },
3120 },
3121 .OpBitReverse => &[_]Operand{
3122 .{ .kind = .IdResultType, .quantifier = .required },
3123 .{ .kind = .IdResult, .quantifier = .required },
3124 .{ .kind = .IdRef, .quantifier = .required },
3125 },
3126 .OpBitCount => &[_]Operand{
3127 .{ .kind = .IdResultType, .quantifier = .required },
3128 .{ .kind = .IdResult, .quantifier = .required },
3129 .{ .kind = .IdRef, .quantifier = .required },
3130 },
3131 .OpDPdx => &[_]Operand{
3132 .{ .kind = .IdResultType, .quantifier = .required },
3133 .{ .kind = .IdResult, .quantifier = .required },
3134 .{ .kind = .IdRef, .quantifier = .required },
3135 },
3136 .OpDPdy => &[_]Operand{
3137 .{ .kind = .IdResultType, .quantifier = .required },
3138 .{ .kind = .IdResult, .quantifier = .required },
3139 .{ .kind = .IdRef, .quantifier = .required },
3140 },
3141 .OpFwidth => &[_]Operand{
3142 .{ .kind = .IdResultType, .quantifier = .required },
3143 .{ .kind = .IdResult, .quantifier = .required },
3144 .{ .kind = .IdRef, .quantifier = .required },
3145 },
3146 .OpDPdxFine => &[_]Operand{
3147 .{ .kind = .IdResultType, .quantifier = .required },
3148 .{ .kind = .IdResult, .quantifier = .required },
3149 .{ .kind = .IdRef, .quantifier = .required },
3150 },
3151 .OpDPdyFine => &[_]Operand{
3152 .{ .kind = .IdResultType, .quantifier = .required },
3153 .{ .kind = .IdResult, .quantifier = .required },
3154 .{ .kind = .IdRef, .quantifier = .required },
3155 },
3156 .OpFwidthFine => &[_]Operand{
3157 .{ .kind = .IdResultType, .quantifier = .required },
3158 .{ .kind = .IdResult, .quantifier = .required },
3159 .{ .kind = .IdRef, .quantifier = .required },
3160 },
3161 .OpDPdxCoarse => &[_]Operand{
3162 .{ .kind = .IdResultType, .quantifier = .required },
3163 .{ .kind = .IdResult, .quantifier = .required },
3164 .{ .kind = .IdRef, .quantifier = .required },
3165 },
3166 .OpDPdyCoarse => &[_]Operand{
3167 .{ .kind = .IdResultType, .quantifier = .required },
3168 .{ .kind = .IdResult, .quantifier = .required },
3169 .{ .kind = .IdRef, .quantifier = .required },
3170 },
3171 .OpFwidthCoarse => &[_]Operand{
3172 .{ .kind = .IdResultType, .quantifier = .required },
3173 .{ .kind = .IdResult, .quantifier = .required },
3174 .{ .kind = .IdRef, .quantifier = .required },
3175 },
3176 .OpEmitVertex => &[_]Operand{},
3177 .OpEndPrimitive => &[_]Operand{},
3178 .OpEmitStreamVertex => &[_]Operand{
3179 .{ .kind = .IdRef, .quantifier = .required },
3180 },
3181 .OpEndStreamPrimitive => &[_]Operand{
3182 .{ .kind = .IdRef, .quantifier = .required },
3183 },
3184 .OpControlBarrier => &[_]Operand{
3185 .{ .kind = .IdScope, .quantifier = .required },
3186 .{ .kind = .IdScope, .quantifier = .required },
3187 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3188 },
3189 .OpMemoryBarrier => &[_]Operand{
3190 .{ .kind = .IdScope, .quantifier = .required },
3191 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3192 },
3193 .OpAtomicLoad => &[_]Operand{
3194 .{ .kind = .IdResultType, .quantifier = .required },
3195 .{ .kind = .IdResult, .quantifier = .required },
3196 .{ .kind = .IdRef, .quantifier = .required },
3197 .{ .kind = .IdScope, .quantifier = .required },
3198 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3199 },
3200 .OpAtomicStore => &[_]Operand{
3201 .{ .kind = .IdRef, .quantifier = .required },
3202 .{ .kind = .IdScope, .quantifier = .required },
3203 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3204 .{ .kind = .IdRef, .quantifier = .required },
3205 },
3206 .OpAtomicExchange => &[_]Operand{
3207 .{ .kind = .IdResultType, .quantifier = .required },
3208 .{ .kind = .IdResult, .quantifier = .required },
3209 .{ .kind = .IdRef, .quantifier = .required },
3210 .{ .kind = .IdScope, .quantifier = .required },
3211 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3212 .{ .kind = .IdRef, .quantifier = .required },
3213 },
3214 .OpAtomicCompareExchange => &[_]Operand{
3215 .{ .kind = .IdResultType, .quantifier = .required },
3216 .{ .kind = .IdResult, .quantifier = .required },
3217 .{ .kind = .IdRef, .quantifier = .required },
3218 .{ .kind = .IdScope, .quantifier = .required },
3219 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3220 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3221 .{ .kind = .IdRef, .quantifier = .required },
3222 .{ .kind = .IdRef, .quantifier = .required },
3223 },
3224 .OpAtomicCompareExchangeWeak => &[_]Operand{
3225 .{ .kind = .IdResultType, .quantifier = .required },
3226 .{ .kind = .IdResult, .quantifier = .required },
3227 .{ .kind = .IdRef, .quantifier = .required },
3228 .{ .kind = .IdScope, .quantifier = .required },
3229 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3230 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3231 .{ .kind = .IdRef, .quantifier = .required },
3232 .{ .kind = .IdRef, .quantifier = .required },
3233 },
3234 .OpAtomicIIncrement => &[_]Operand{
3235 .{ .kind = .IdResultType, .quantifier = .required },
3236 .{ .kind = .IdResult, .quantifier = .required },
3237 .{ .kind = .IdRef, .quantifier = .required },
3238 .{ .kind = .IdScope, .quantifier = .required },
3239 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3240 },
3241 .OpAtomicIDecrement => &[_]Operand{
3242 .{ .kind = .IdResultType, .quantifier = .required },
3243 .{ .kind = .IdResult, .quantifier = .required },
3244 .{ .kind = .IdRef, .quantifier = .required },
3245 .{ .kind = .IdScope, .quantifier = .required },
3246 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3247 },
3248 .OpAtomicIAdd => &[_]Operand{
3249 .{ .kind = .IdResultType, .quantifier = .required },
3250 .{ .kind = .IdResult, .quantifier = .required },
3251 .{ .kind = .IdRef, .quantifier = .required },
3252 .{ .kind = .IdScope, .quantifier = .required },
3253 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3254 .{ .kind = .IdRef, .quantifier = .required },
3255 },
3256 .OpAtomicISub => &[_]Operand{
3257 .{ .kind = .IdResultType, .quantifier = .required },
3258 .{ .kind = .IdResult, .quantifier = .required },
3259 .{ .kind = .IdRef, .quantifier = .required },
3260 .{ .kind = .IdScope, .quantifier = .required },
3261 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3262 .{ .kind = .IdRef, .quantifier = .required },
3263 },
3264 .OpAtomicSMin => &[_]Operand{
3265 .{ .kind = .IdResultType, .quantifier = .required },
3266 .{ .kind = .IdResult, .quantifier = .required },
3267 .{ .kind = .IdRef, .quantifier = .required },
3268 .{ .kind = .IdScope, .quantifier = .required },
3269 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3270 .{ .kind = .IdRef, .quantifier = .required },
3271 },
3272 .OpAtomicUMin => &[_]Operand{
3273 .{ .kind = .IdResultType, .quantifier = .required },
3274 .{ .kind = .IdResult, .quantifier = .required },
3275 .{ .kind = .IdRef, .quantifier = .required },
3276 .{ .kind = .IdScope, .quantifier = .required },
3277 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3278 .{ .kind = .IdRef, .quantifier = .required },
3279 },
3280 .OpAtomicSMax => &[_]Operand{
3281 .{ .kind = .IdResultType, .quantifier = .required },
3282 .{ .kind = .IdResult, .quantifier = .required },
3283 .{ .kind = .IdRef, .quantifier = .required },
3284 .{ .kind = .IdScope, .quantifier = .required },
3285 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3286 .{ .kind = .IdRef, .quantifier = .required },
3287 },
3288 .OpAtomicUMax => &[_]Operand{
3289 .{ .kind = .IdResultType, .quantifier = .required },
3290 .{ .kind = .IdResult, .quantifier = .required },
3291 .{ .kind = .IdRef, .quantifier = .required },
3292 .{ .kind = .IdScope, .quantifier = .required },
3293 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3294 .{ .kind = .IdRef, .quantifier = .required },
3295 },
3296 .OpAtomicAnd => &[_]Operand{
3297 .{ .kind = .IdResultType, .quantifier = .required },
3298 .{ .kind = .IdResult, .quantifier = .required },
3299 .{ .kind = .IdRef, .quantifier = .required },
3300 .{ .kind = .IdScope, .quantifier = .required },
3301 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3302 .{ .kind = .IdRef, .quantifier = .required },
3303 },
3304 .OpAtomicOr => &[_]Operand{
3305 .{ .kind = .IdResultType, .quantifier = .required },
3306 .{ .kind = .IdResult, .quantifier = .required },
3307 .{ .kind = .IdRef, .quantifier = .required },
3308 .{ .kind = .IdScope, .quantifier = .required },
3309 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3310 .{ .kind = .IdRef, .quantifier = .required },
3311 },
3312 .OpAtomicXor => &[_]Operand{
3313 .{ .kind = .IdResultType, .quantifier = .required },
3314 .{ .kind = .IdResult, .quantifier = .required },
3315 .{ .kind = .IdRef, .quantifier = .required },
3316 .{ .kind = .IdScope, .quantifier = .required },
3317 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3318 .{ .kind = .IdRef, .quantifier = .required },
3319 },
3320 .OpPhi => &[_]Operand{
3321 .{ .kind = .IdResultType, .quantifier = .required },
3322 .{ .kind = .IdResult, .quantifier = .required },
3323 .{ .kind = .PairIdRefIdRef, .quantifier = .variadic },
3324 },
3325 .OpLoopMerge => &[_]Operand{
3326 .{ .kind = .IdRef, .quantifier = .required },
3327 .{ .kind = .IdRef, .quantifier = .required },
3328 .{ .kind = .LoopControl, .quantifier = .required },
3329 },
3330 .OpSelectionMerge => &[_]Operand{
3331 .{ .kind = .IdRef, .quantifier = .required },
3332 .{ .kind = .SelectionControl, .quantifier = .required },
3333 },
3334 .OpLabel => &[_]Operand{
3335 .{ .kind = .IdResult, .quantifier = .required },
3336 },
3337 .OpBranch => &[_]Operand{
3338 .{ .kind = .IdRef, .quantifier = .required },
3339 },
3340 .OpBranchConditional => &[_]Operand{
3341 .{ .kind = .IdRef, .quantifier = .required },
3342 .{ .kind = .IdRef, .quantifier = .required },
3343 .{ .kind = .IdRef, .quantifier = .required },
3344 .{ .kind = .LiteralInteger, .quantifier = .variadic },
3345 },
3346 .OpSwitch => &[_]Operand{
3347 .{ .kind = .IdRef, .quantifier = .required },
3348 .{ .kind = .IdRef, .quantifier = .required },
3349 .{ .kind = .PairLiteralIntegerIdRef, .quantifier = .variadic },
3350 },
3351 .OpKill => &[_]Operand{},
3352 .OpReturn => &[_]Operand{},
3353 .OpReturnValue => &[_]Operand{
3354 .{ .kind = .IdRef, .quantifier = .required },
3355 },
3356 .OpUnreachable => &[_]Operand{},
3357 .OpLifetimeStart => &[_]Operand{
3358 .{ .kind = .IdRef, .quantifier = .required },
3359 .{ .kind = .LiteralInteger, .quantifier = .required },
3360 },
3361 .OpLifetimeStop => &[_]Operand{
3362 .{ .kind = .IdRef, .quantifier = .required },
3363 .{ .kind = .LiteralInteger, .quantifier = .required },
3364 },
3365 .OpGroupAsyncCopy => &[_]Operand{
3366 .{ .kind = .IdResultType, .quantifier = .required },
3367 .{ .kind = .IdResult, .quantifier = .required },
3368 .{ .kind = .IdScope, .quantifier = .required },
3369 .{ .kind = .IdRef, .quantifier = .required },
3370 .{ .kind = .IdRef, .quantifier = .required },
3371 .{ .kind = .IdRef, .quantifier = .required },
3372 .{ .kind = .IdRef, .quantifier = .required },
3373 .{ .kind = .IdRef, .quantifier = .required },
3374 },
3375 .OpGroupWaitEvents => &[_]Operand{
3376 .{ .kind = .IdScope, .quantifier = .required },
3377 .{ .kind = .IdRef, .quantifier = .required },
3378 .{ .kind = .IdRef, .quantifier = .required },
3379 },
3380 .OpGroupAll => &[_]Operand{
3381 .{ .kind = .IdResultType, .quantifier = .required },
3382 .{ .kind = .IdResult, .quantifier = .required },
3383 .{ .kind = .IdScope, .quantifier = .required },
3384 .{ .kind = .IdRef, .quantifier = .required },
3385 },
3386 .OpGroupAny => &[_]Operand{
3387 .{ .kind = .IdResultType, .quantifier = .required },
3388 .{ .kind = .IdResult, .quantifier = .required },
3389 .{ .kind = .IdScope, .quantifier = .required },
3390 .{ .kind = .IdRef, .quantifier = .required },
3391 },
3392 .OpGroupBroadcast => &[_]Operand{
3393 .{ .kind = .IdResultType, .quantifier = .required },
3394 .{ .kind = .IdResult, .quantifier = .required },
3395 .{ .kind = .IdScope, .quantifier = .required },
3396 .{ .kind = .IdRef, .quantifier = .required },
3397 .{ .kind = .IdRef, .quantifier = .required },
3398 },
3399 .OpGroupIAdd => &[_]Operand{
3400 .{ .kind = .IdResultType, .quantifier = .required },
3401 .{ .kind = .IdResult, .quantifier = .required },
3402 .{ .kind = .IdScope, .quantifier = .required },
3403 .{ .kind = .GroupOperation, .quantifier = .required },
3404 .{ .kind = .IdRef, .quantifier = .required },
3405 },
3406 .OpGroupFAdd => &[_]Operand{
3407 .{ .kind = .IdResultType, .quantifier = .required },
3408 .{ .kind = .IdResult, .quantifier = .required },
3409 .{ .kind = .IdScope, .quantifier = .required },
3410 .{ .kind = .GroupOperation, .quantifier = .required },
3411 .{ .kind = .IdRef, .quantifier = .required },
3412 },
3413 .OpGroupFMin => &[_]Operand{
3414 .{ .kind = .IdResultType, .quantifier = .required },
3415 .{ .kind = .IdResult, .quantifier = .required },
3416 .{ .kind = .IdScope, .quantifier = .required },
3417 .{ .kind = .GroupOperation, .quantifier = .required },
3418 .{ .kind = .IdRef, .quantifier = .required },
3419 },
3420 .OpGroupUMin => &[_]Operand{
3421 .{ .kind = .IdResultType, .quantifier = .required },
3422 .{ .kind = .IdResult, .quantifier = .required },
3423 .{ .kind = .IdScope, .quantifier = .required },
3424 .{ .kind = .GroupOperation, .quantifier = .required },
3425 .{ .kind = .IdRef, .quantifier = .required },
3426 },
3427 .OpGroupSMin => &[_]Operand{
3428 .{ .kind = .IdResultType, .quantifier = .required },
3429 .{ .kind = .IdResult, .quantifier = .required },
3430 .{ .kind = .IdScope, .quantifier = .required },
3431 .{ .kind = .GroupOperation, .quantifier = .required },
3432 .{ .kind = .IdRef, .quantifier = .required },
3433 },
3434 .OpGroupFMax => &[_]Operand{
3435 .{ .kind = .IdResultType, .quantifier = .required },
3436 .{ .kind = .IdResult, .quantifier = .required },
3437 .{ .kind = .IdScope, .quantifier = .required },
3438 .{ .kind = .GroupOperation, .quantifier = .required },
3439 .{ .kind = .IdRef, .quantifier = .required },
3440 },
3441 .OpGroupUMax => &[_]Operand{
3442 .{ .kind = .IdResultType, .quantifier = .required },
3443 .{ .kind = .IdResult, .quantifier = .required },
3444 .{ .kind = .IdScope, .quantifier = .required },
3445 .{ .kind = .GroupOperation, .quantifier = .required },
3446 .{ .kind = .IdRef, .quantifier = .required },
3447 },
3448 .OpGroupSMax => &[_]Operand{
3449 .{ .kind = .IdResultType, .quantifier = .required },
3450 .{ .kind = .IdResult, .quantifier = .required },
3451 .{ .kind = .IdScope, .quantifier = .required },
3452 .{ .kind = .GroupOperation, .quantifier = .required },
3453 .{ .kind = .IdRef, .quantifier = .required },
3454 },
3455 .OpReadPipe => &[_]Operand{
3456 .{ .kind = .IdResultType, .quantifier = .required },
3457 .{ .kind = .IdResult, .quantifier = .required },
3458 .{ .kind = .IdRef, .quantifier = .required },
3459 .{ .kind = .IdRef, .quantifier = .required },
3460 .{ .kind = .IdRef, .quantifier = .required },
3461 .{ .kind = .IdRef, .quantifier = .required },
3462 },
3463 .OpWritePipe => &[_]Operand{
3464 .{ .kind = .IdResultType, .quantifier = .required },
3465 .{ .kind = .IdResult, .quantifier = .required },
3466 .{ .kind = .IdRef, .quantifier = .required },
3467 .{ .kind = .IdRef, .quantifier = .required },
3468 .{ .kind = .IdRef, .quantifier = .required },
3469 .{ .kind = .IdRef, .quantifier = .required },
3470 },
3471 .OpReservedReadPipe => &[_]Operand{
3472 .{ .kind = .IdResultType, .quantifier = .required },
3473 .{ .kind = .IdResult, .quantifier = .required },
3474 .{ .kind = .IdRef, .quantifier = .required },
3475 .{ .kind = .IdRef, .quantifier = .required },
3476 .{ .kind = .IdRef, .quantifier = .required },
3477 .{ .kind = .IdRef, .quantifier = .required },
3478 .{ .kind = .IdRef, .quantifier = .required },
3479 .{ .kind = .IdRef, .quantifier = .required },
3480 },
3481 .OpReservedWritePipe => &[_]Operand{
3482 .{ .kind = .IdResultType, .quantifier = .required },
3483 .{ .kind = .IdResult, .quantifier = .required },
3484 .{ .kind = .IdRef, .quantifier = .required },
3485 .{ .kind = .IdRef, .quantifier = .required },
3486 .{ .kind = .IdRef, .quantifier = .required },
3487 .{ .kind = .IdRef, .quantifier = .required },
3488 .{ .kind = .IdRef, .quantifier = .required },
3489 .{ .kind = .IdRef, .quantifier = .required },
3490 },
3491 .OpReserveReadPipePackets => &[_]Operand{
3492 .{ .kind = .IdResultType, .quantifier = .required },
3493 .{ .kind = .IdResult, .quantifier = .required },
3494 .{ .kind = .IdRef, .quantifier = .required },
3495 .{ .kind = .IdRef, .quantifier = .required },
3496 .{ .kind = .IdRef, .quantifier = .required },
3497 .{ .kind = .IdRef, .quantifier = .required },
3498 },
3499 .OpReserveWritePipePackets => &[_]Operand{
3500 .{ .kind = .IdResultType, .quantifier = .required },
3501 .{ .kind = .IdResult, .quantifier = .required },
3502 .{ .kind = .IdRef, .quantifier = .required },
3503 .{ .kind = .IdRef, .quantifier = .required },
3504 .{ .kind = .IdRef, .quantifier = .required },
3505 .{ .kind = .IdRef, .quantifier = .required },
3506 },
3507 .OpCommitReadPipe => &[_]Operand{
3508 .{ .kind = .IdRef, .quantifier = .required },
3509 .{ .kind = .IdRef, .quantifier = .required },
3510 .{ .kind = .IdRef, .quantifier = .required },
3511 .{ .kind = .IdRef, .quantifier = .required },
3512 },
3513 .OpCommitWritePipe => &[_]Operand{
3514 .{ .kind = .IdRef, .quantifier = .required },
3515 .{ .kind = .IdRef, .quantifier = .required },
3516 .{ .kind = .IdRef, .quantifier = .required },
3517 .{ .kind = .IdRef, .quantifier = .required },
3518 },
3519 .OpIsValidReserveId => &[_]Operand{
3520 .{ .kind = .IdResultType, .quantifier = .required },
3521 .{ .kind = .IdResult, .quantifier = .required },
3522 .{ .kind = .IdRef, .quantifier = .required },
3523 },
3524 .OpGetNumPipePackets => &[_]Operand{
3525 .{ .kind = .IdResultType, .quantifier = .required },
3526 .{ .kind = .IdResult, .quantifier = .required },
3527 .{ .kind = .IdRef, .quantifier = .required },
3528 .{ .kind = .IdRef, .quantifier = .required },
3529 .{ .kind = .IdRef, .quantifier = .required },
3530 },
3531 .OpGetMaxPipePackets => &[_]Operand{
3532 .{ .kind = .IdResultType, .quantifier = .required },
3533 .{ .kind = .IdResult, .quantifier = .required },
3534 .{ .kind = .IdRef, .quantifier = .required },
3535 .{ .kind = .IdRef, .quantifier = .required },
3536 .{ .kind = .IdRef, .quantifier = .required },
3537 },
3538 .OpGroupReserveReadPipePackets => &[_]Operand{
3539 .{ .kind = .IdResultType, .quantifier = .required },
3540 .{ .kind = .IdResult, .quantifier = .required },
3541 .{ .kind = .IdScope, .quantifier = .required },
3542 .{ .kind = .IdRef, .quantifier = .required },
3543 .{ .kind = .IdRef, .quantifier = .required },
3544 .{ .kind = .IdRef, .quantifier = .required },
3545 .{ .kind = .IdRef, .quantifier = .required },
3546 },
3547 .OpGroupReserveWritePipePackets => &[_]Operand{
3548 .{ .kind = .IdResultType, .quantifier = .required },
3549 .{ .kind = .IdResult, .quantifier = .required },
3550 .{ .kind = .IdScope, .quantifier = .required },
3551 .{ .kind = .IdRef, .quantifier = .required },
3552 .{ .kind = .IdRef, .quantifier = .required },
3553 .{ .kind = .IdRef, .quantifier = .required },
3554 .{ .kind = .IdRef, .quantifier = .required },
3555 },
3556 .OpGroupCommitReadPipe => &[_]Operand{
3557 .{ .kind = .IdScope, .quantifier = .required },
3558 .{ .kind = .IdRef, .quantifier = .required },
3559 .{ .kind = .IdRef, .quantifier = .required },
3560 .{ .kind = .IdRef, .quantifier = .required },
3561 .{ .kind = .IdRef, .quantifier = .required },
3562 },
3563 .OpGroupCommitWritePipe => &[_]Operand{
3564 .{ .kind = .IdScope, .quantifier = .required },
3565 .{ .kind = .IdRef, .quantifier = .required },
3566 .{ .kind = .IdRef, .quantifier = .required },
3567 .{ .kind = .IdRef, .quantifier = .required },
3568 .{ .kind = .IdRef, .quantifier = .required },
3569 },
3570 .OpEnqueueMarker => &[_]Operand{
3571 .{ .kind = .IdResultType, .quantifier = .required },
3572 .{ .kind = .IdResult, .quantifier = .required },
3573 .{ .kind = .IdRef, .quantifier = .required },
3574 .{ .kind = .IdRef, .quantifier = .required },
3575 .{ .kind = .IdRef, .quantifier = .required },
3576 .{ .kind = .IdRef, .quantifier = .required },
3577 },
3578 .OpEnqueueKernel => &[_]Operand{
3579 .{ .kind = .IdResultType, .quantifier = .required },
3580 .{ .kind = .IdResult, .quantifier = .required },
3581 .{ .kind = .IdRef, .quantifier = .required },
3582 .{ .kind = .IdRef, .quantifier = .required },
3583 .{ .kind = .IdRef, .quantifier = .required },
3584 .{ .kind = .IdRef, .quantifier = .required },
3585 .{ .kind = .IdRef, .quantifier = .required },
3586 .{ .kind = .IdRef, .quantifier = .required },
3587 .{ .kind = .IdRef, .quantifier = .required },
3588 .{ .kind = .IdRef, .quantifier = .required },
3589 .{ .kind = .IdRef, .quantifier = .required },
3590 .{ .kind = .IdRef, .quantifier = .required },
3591 .{ .kind = .IdRef, .quantifier = .variadic },
3592 },
3593 .OpGetKernelNDrangeSubGroupCount => &[_]Operand{
3594 .{ .kind = .IdResultType, .quantifier = .required },
3595 .{ .kind = .IdResult, .quantifier = .required },
3596 .{ .kind = .IdRef, .quantifier = .required },
3597 .{ .kind = .IdRef, .quantifier = .required },
3598 .{ .kind = .IdRef, .quantifier = .required },
3599 .{ .kind = .IdRef, .quantifier = .required },
3600 .{ .kind = .IdRef, .quantifier = .required },
3601 },
3602 .OpGetKernelNDrangeMaxSubGroupSize => &[_]Operand{
3603 .{ .kind = .IdResultType, .quantifier = .required },
3604 .{ .kind = .IdResult, .quantifier = .required },
3605 .{ .kind = .IdRef, .quantifier = .required },
3606 .{ .kind = .IdRef, .quantifier = .required },
3607 .{ .kind = .IdRef, .quantifier = .required },
3608 .{ .kind = .IdRef, .quantifier = .required },
3609 .{ .kind = .IdRef, .quantifier = .required },
3610 },
3611 .OpGetKernelWorkGroupSize => &[_]Operand{
3612 .{ .kind = .IdResultType, .quantifier = .required },
3613 .{ .kind = .IdResult, .quantifier = .required },
3614 .{ .kind = .IdRef, .quantifier = .required },
3615 .{ .kind = .IdRef, .quantifier = .required },
3616 .{ .kind = .IdRef, .quantifier = .required },
3617 .{ .kind = .IdRef, .quantifier = .required },
3618 },
3619 .OpGetKernelPreferredWorkGroupSizeMultiple => &[_]Operand{
3620 .{ .kind = .IdResultType, .quantifier = .required },
3621 .{ .kind = .IdResult, .quantifier = .required },
3622 .{ .kind = .IdRef, .quantifier = .required },
3623 .{ .kind = .IdRef, .quantifier = .required },
3624 .{ .kind = .IdRef, .quantifier = .required },
3625 .{ .kind = .IdRef, .quantifier = .required },
3626 },
3627 .OpRetainEvent => &[_]Operand{
3628 .{ .kind = .IdRef, .quantifier = .required },
3629 },
3630 .OpReleaseEvent => &[_]Operand{
3631 .{ .kind = .IdRef, .quantifier = .required },
3632 },
3633 .OpCreateUserEvent => &[_]Operand{
3634 .{ .kind = .IdResultType, .quantifier = .required },
3635 .{ .kind = .IdResult, .quantifier = .required },
3636 },
3637 .OpIsValidEvent => &[_]Operand{
3638 .{ .kind = .IdResultType, .quantifier = .required },
3639 .{ .kind = .IdResult, .quantifier = .required },
3640 .{ .kind = .IdRef, .quantifier = .required },
3641 },
3642 .OpSetUserEventStatus => &[_]Operand{
3643 .{ .kind = .IdRef, .quantifier = .required },
3644 .{ .kind = .IdRef, .quantifier = .required },
3645 },
3646 .OpCaptureEventProfilingInfo => &[_]Operand{
3647 .{ .kind = .IdRef, .quantifier = .required },
3648 .{ .kind = .IdRef, .quantifier = .required },
3649 .{ .kind = .IdRef, .quantifier = .required },
3650 },
3651 .OpGetDefaultQueue => &[_]Operand{
3652 .{ .kind = .IdResultType, .quantifier = .required },
3653 .{ .kind = .IdResult, .quantifier = .required },
3654 },
3655 .OpBuildNDRange => &[_]Operand{
3656 .{ .kind = .IdResultType, .quantifier = .required },
3657 .{ .kind = .IdResult, .quantifier = .required },
3658 .{ .kind = .IdRef, .quantifier = .required },
3659 .{ .kind = .IdRef, .quantifier = .required },
3660 .{ .kind = .IdRef, .quantifier = .required },
3661 },
3662 .OpImageSparseSampleImplicitLod => &[_]Operand{
3663 .{ .kind = .IdResultType, .quantifier = .required },
3664 .{ .kind = .IdResult, .quantifier = .required },
3665 .{ .kind = .IdRef, .quantifier = .required },
3666 .{ .kind = .IdRef, .quantifier = .required },
3667 .{ .kind = .ImageOperands, .quantifier = .optional },
3668 },
3669 .OpImageSparseSampleExplicitLod => &[_]Operand{
3670 .{ .kind = .IdResultType, .quantifier = .required },
3671 .{ .kind = .IdResult, .quantifier = .required },
3672 .{ .kind = .IdRef, .quantifier = .required },
3673 .{ .kind = .IdRef, .quantifier = .required },
3674 .{ .kind = .ImageOperands, .quantifier = .required },
3675 },
3676 .OpImageSparseSampleDrefImplicitLod => &[_]Operand{
3677 .{ .kind = .IdResultType, .quantifier = .required },
3678 .{ .kind = .IdResult, .quantifier = .required },
3679 .{ .kind = .IdRef, .quantifier = .required },
3680 .{ .kind = .IdRef, .quantifier = .required },
3681 .{ .kind = .IdRef, .quantifier = .required },
3682 .{ .kind = .ImageOperands, .quantifier = .optional },
3683 },
3684 .OpImageSparseSampleDrefExplicitLod => &[_]Operand{
3685 .{ .kind = .IdResultType, .quantifier = .required },
3686 .{ .kind = .IdResult, .quantifier = .required },
3687 .{ .kind = .IdRef, .quantifier = .required },
3688 .{ .kind = .IdRef, .quantifier = .required },
3689 .{ .kind = .IdRef, .quantifier = .required },
3690 .{ .kind = .ImageOperands, .quantifier = .required },
3691 },
3692 .OpImageSparseSampleProjImplicitLod => &[_]Operand{
3693 .{ .kind = .IdResultType, .quantifier = .required },
3694 .{ .kind = .IdResult, .quantifier = .required },
3695 .{ .kind = .IdRef, .quantifier = .required },
3696 .{ .kind = .IdRef, .quantifier = .required },
3697 .{ .kind = .ImageOperands, .quantifier = .optional },
3698 },
3699 .OpImageSparseSampleProjExplicitLod => &[_]Operand{
3700 .{ .kind = .IdResultType, .quantifier = .required },
3701 .{ .kind = .IdResult, .quantifier = .required },
3702 .{ .kind = .IdRef, .quantifier = .required },
3703 .{ .kind = .IdRef, .quantifier = .required },
3704 .{ .kind = .ImageOperands, .quantifier = .required },
3705 },
3706 .OpImageSparseSampleProjDrefImplicitLod => &[_]Operand{
3707 .{ .kind = .IdResultType, .quantifier = .required },
3708 .{ .kind = .IdResult, .quantifier = .required },
3709 .{ .kind = .IdRef, .quantifier = .required },
3710 .{ .kind = .IdRef, .quantifier = .required },
3711 .{ .kind = .IdRef, .quantifier = .required },
3712 .{ .kind = .ImageOperands, .quantifier = .optional },
3713 },
3714 .OpImageSparseSampleProjDrefExplicitLod => &[_]Operand{
3715 .{ .kind = .IdResultType, .quantifier = .required },
3716 .{ .kind = .IdResult, .quantifier = .required },
3717 .{ .kind = .IdRef, .quantifier = .required },
3718 .{ .kind = .IdRef, .quantifier = .required },
3719 .{ .kind = .IdRef, .quantifier = .required },
3720 .{ .kind = .ImageOperands, .quantifier = .required },
3721 },
3722 .OpImageSparseFetch => &[_]Operand{
3723 .{ .kind = .IdResultType, .quantifier = .required },
3724 .{ .kind = .IdResult, .quantifier = .required },
3725 .{ .kind = .IdRef, .quantifier = .required },
3726 .{ .kind = .IdRef, .quantifier = .required },
3727 .{ .kind = .ImageOperands, .quantifier = .optional },
3728 },
3729 .OpImageSparseGather => &[_]Operand{
3730 .{ .kind = .IdResultType, .quantifier = .required },
3731 .{ .kind = .IdResult, .quantifier = .required },
3732 .{ .kind = .IdRef, .quantifier = .required },
3733 .{ .kind = .IdRef, .quantifier = .required },
3734 .{ .kind = .IdRef, .quantifier = .required },
3735 .{ .kind = .ImageOperands, .quantifier = .optional },
3736 },
3737 .OpImageSparseDrefGather => &[_]Operand{
3738 .{ .kind = .IdResultType, .quantifier = .required },
3739 .{ .kind = .IdResult, .quantifier = .required },
3740 .{ .kind = .IdRef, .quantifier = .required },
3741 .{ .kind = .IdRef, .quantifier = .required },
3742 .{ .kind = .IdRef, .quantifier = .required },
3743 .{ .kind = .ImageOperands, .quantifier = .optional },
3744 },
3745 .OpImageSparseTexelsResident => &[_]Operand{
3746 .{ .kind = .IdResultType, .quantifier = .required },
3747 .{ .kind = .IdResult, .quantifier = .required },
3748 .{ .kind = .IdRef, .quantifier = .required },
3749 },
3750 .OpNoLine => &[_]Operand{},
3751 .OpAtomicFlagTestAndSet => &[_]Operand{
3752 .{ .kind = .IdResultType, .quantifier = .required },
3753 .{ .kind = .IdResult, .quantifier = .required },
3754 .{ .kind = .IdRef, .quantifier = .required },
3755 .{ .kind = .IdScope, .quantifier = .required },
3756 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3757 },
3758 .OpAtomicFlagClear => &[_]Operand{
3759 .{ .kind = .IdRef, .quantifier = .required },
3760 .{ .kind = .IdScope, .quantifier = .required },
3761 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3762 },
3763 .OpImageSparseRead => &[_]Operand{
3764 .{ .kind = .IdResultType, .quantifier = .required },
3765 .{ .kind = .IdResult, .quantifier = .required },
3766 .{ .kind = .IdRef, .quantifier = .required },
3767 .{ .kind = .IdRef, .quantifier = .required },
3768 .{ .kind = .ImageOperands, .quantifier = .optional },
3769 },
3770 .OpSizeOf => &[_]Operand{
3771 .{ .kind = .IdResultType, .quantifier = .required },
3772 .{ .kind = .IdResult, .quantifier = .required },
3773 .{ .kind = .IdRef, .quantifier = .required },
3774 },
3775 .OpTypePipeStorage => &[_]Operand{
3776 .{ .kind = .IdResult, .quantifier = .required },
3777 },
3778 .OpConstantPipeStorage => &[_]Operand{
3779 .{ .kind = .IdResultType, .quantifier = .required },
3780 .{ .kind = .IdResult, .quantifier = .required },
3781 .{ .kind = .LiteralInteger, .quantifier = .required },
3782 .{ .kind = .LiteralInteger, .quantifier = .required },
3783 .{ .kind = .LiteralInteger, .quantifier = .required },
3784 },
3785 .OpCreatePipeFromPipeStorage => &[_]Operand{
3786 .{ .kind = .IdResultType, .quantifier = .required },
3787 .{ .kind = .IdResult, .quantifier = .required },
3788 .{ .kind = .IdRef, .quantifier = .required },
3789 },
3790 .OpGetKernelLocalSizeForSubgroupCount => &[_]Operand{
3791 .{ .kind = .IdResultType, .quantifier = .required },
3792 .{ .kind = .IdResult, .quantifier = .required },
3793 .{ .kind = .IdRef, .quantifier = .required },
3794 .{ .kind = .IdRef, .quantifier = .required },
3795 .{ .kind = .IdRef, .quantifier = .required },
3796 .{ .kind = .IdRef, .quantifier = .required },
3797 .{ .kind = .IdRef, .quantifier = .required },
3798 },
3799 .OpGetKernelMaxNumSubgroups => &[_]Operand{
3800 .{ .kind = .IdResultType, .quantifier = .required },
3801 .{ .kind = .IdResult, .quantifier = .required },
3802 .{ .kind = .IdRef, .quantifier = .required },
3803 .{ .kind = .IdRef, .quantifier = .required },
3804 .{ .kind = .IdRef, .quantifier = .required },
3805 .{ .kind = .IdRef, .quantifier = .required },
3806 },
3807 .OpTypeNamedBarrier => &[_]Operand{
3808 .{ .kind = .IdResult, .quantifier = .required },
3809 },
3810 .OpNamedBarrierInitialize => &[_]Operand{
3811 .{ .kind = .IdResultType, .quantifier = .required },
3812 .{ .kind = .IdResult, .quantifier = .required },
3813 .{ .kind = .IdRef, .quantifier = .required },
3814 },
3815 .OpMemoryNamedBarrier => &[_]Operand{
3816 .{ .kind = .IdRef, .quantifier = .required },
3817 .{ .kind = .IdScope, .quantifier = .required },
3818 .{ .kind = .IdMemorySemantics, .quantifier = .required },
3819 },
3820 .OpModuleProcessed => &[_]Operand{
3821 .{ .kind = .LiteralString, .quantifier = .required },
3822 },
3823 .OpExecutionModeId => &[_]Operand{
3824 .{ .kind = .IdRef, .quantifier = .required },
3825 .{ .kind = .ExecutionMode, .quantifier = .required },
3826 },
3827 .OpDecorateId => &[_]Operand{
3828 .{ .kind = .IdRef, .quantifier = .required },
3829 .{ .kind = .Decoration, .quantifier = .required },
3830 },
3831 .OpGroupNonUniformElect => &[_]Operand{
3832 .{ .kind = .IdResultType, .quantifier = .required },
3833 .{ .kind = .IdResult, .quantifier = .required },
3834 .{ .kind = .IdScope, .quantifier = .required },
3835 },
3836 .OpGroupNonUniformAll => &[_]Operand{
3837 .{ .kind = .IdResultType, .quantifier = .required },
3838 .{ .kind = .IdResult, .quantifier = .required },
3839 .{ .kind = .IdScope, .quantifier = .required },
3840 .{ .kind = .IdRef, .quantifier = .required },
3841 },
3842 .OpGroupNonUniformAny => &[_]Operand{
3843 .{ .kind = .IdResultType, .quantifier = .required },
3844 .{ .kind = .IdResult, .quantifier = .required },
3845 .{ .kind = .IdScope, .quantifier = .required },
3846 .{ .kind = .IdRef, .quantifier = .required },
3847 },
3848 .OpGroupNonUniformAllEqual => &[_]Operand{
3849 .{ .kind = .IdResultType, .quantifier = .required },
3850 .{ .kind = .IdResult, .quantifier = .required },
3851 .{ .kind = .IdScope, .quantifier = .required },
3852 .{ .kind = .IdRef, .quantifier = .required },
3853 },
3854 .OpGroupNonUniformBroadcast => &[_]Operand{
3855 .{ .kind = .IdResultType, .quantifier = .required },
3856 .{ .kind = .IdResult, .quantifier = .required },
3857 .{ .kind = .IdScope, .quantifier = .required },
3858 .{ .kind = .IdRef, .quantifier = .required },
3859 .{ .kind = .IdRef, .quantifier = .required },
3860 },
3861 .OpGroupNonUniformBroadcastFirst => &[_]Operand{
3862 .{ .kind = .IdResultType, .quantifier = .required },
3863 .{ .kind = .IdResult, .quantifier = .required },
3864 .{ .kind = .IdScope, .quantifier = .required },
3865 .{ .kind = .IdRef, .quantifier = .required },
3866 },
3867 .OpGroupNonUniformBallot => &[_]Operand{
3868 .{ .kind = .IdResultType, .quantifier = .required },
3869 .{ .kind = .IdResult, .quantifier = .required },
3870 .{ .kind = .IdScope, .quantifier = .required },
3871 .{ .kind = .IdRef, .quantifier = .required },
3872 },
3873 .OpGroupNonUniformInverseBallot => &[_]Operand{
3874 .{ .kind = .IdResultType, .quantifier = .required },
3875 .{ .kind = .IdResult, .quantifier = .required },
3876 .{ .kind = .IdScope, .quantifier = .required },
3877 .{ .kind = .IdRef, .quantifier = .required },
3878 },
3879 .OpGroupNonUniformBallotBitExtract => &[_]Operand{
3880 .{ .kind = .IdResultType, .quantifier = .required },
3881 .{ .kind = .IdResult, .quantifier = .required },
3882 .{ .kind = .IdScope, .quantifier = .required },
3883 .{ .kind = .IdRef, .quantifier = .required },
3884 .{ .kind = .IdRef, .quantifier = .required },
3885 },
3886 .OpGroupNonUniformBallotBitCount => &[_]Operand{
3887 .{ .kind = .IdResultType, .quantifier = .required },
3888 .{ .kind = .IdResult, .quantifier = .required },
3889 .{ .kind = .IdScope, .quantifier = .required },
3890 .{ .kind = .GroupOperation, .quantifier = .required },
3891 .{ .kind = .IdRef, .quantifier = .required },
3892 },
3893 .OpGroupNonUniformBallotFindLSB => &[_]Operand{
3894 .{ .kind = .IdResultType, .quantifier = .required },
3895 .{ .kind = .IdResult, .quantifier = .required },
3896 .{ .kind = .IdScope, .quantifier = .required },
3897 .{ .kind = .IdRef, .quantifier = .required },
3898 },
3899 .OpGroupNonUniformBallotFindMSB => &[_]Operand{
3900 .{ .kind = .IdResultType, .quantifier = .required },
3901 .{ .kind = .IdResult, .quantifier = .required },
3902 .{ .kind = .IdScope, .quantifier = .required },
3903 .{ .kind = .IdRef, .quantifier = .required },
3904 },
3905 .OpGroupNonUniformShuffle => &[_]Operand{
3906 .{ .kind = .IdResultType, .quantifier = .required },
3907 .{ .kind = .IdResult, .quantifier = .required },
3908 .{ .kind = .IdScope, .quantifier = .required },
3909 .{ .kind = .IdRef, .quantifier = .required },
3910 .{ .kind = .IdRef, .quantifier = .required },
3911 },
3912 .OpGroupNonUniformShuffleXor => &[_]Operand{
3913 .{ .kind = .IdResultType, .quantifier = .required },
3914 .{ .kind = .IdResult, .quantifier = .required },
3915 .{ .kind = .IdScope, .quantifier = .required },
3916 .{ .kind = .IdRef, .quantifier = .required },
3917 .{ .kind = .IdRef, .quantifier = .required },
3918 },
3919 .OpGroupNonUniformShuffleUp => &[_]Operand{
3920 .{ .kind = .IdResultType, .quantifier = .required },
3921 .{ .kind = .IdResult, .quantifier = .required },
3922 .{ .kind = .IdScope, .quantifier = .required },
3923 .{ .kind = .IdRef, .quantifier = .required },
3924 .{ .kind = .IdRef, .quantifier = .required },
3925 },
3926 .OpGroupNonUniformShuffleDown => &[_]Operand{
3927 .{ .kind = .IdResultType, .quantifier = .required },
3928 .{ .kind = .IdResult, .quantifier = .required },
3929 .{ .kind = .IdScope, .quantifier = .required },
3930 .{ .kind = .IdRef, .quantifier = .required },
3931 .{ .kind = .IdRef, .quantifier = .required },
3932 },
3933 .OpGroupNonUniformIAdd => &[_]Operand{
3934 .{ .kind = .IdResultType, .quantifier = .required },
3935 .{ .kind = .IdResult, .quantifier = .required },
3936 .{ .kind = .IdScope, .quantifier = .required },
3937 .{ .kind = .GroupOperation, .quantifier = .required },
3938 .{ .kind = .IdRef, .quantifier = .required },
3939 .{ .kind = .IdRef, .quantifier = .optional },
3940 },
3941 .OpGroupNonUniformFAdd => &[_]Operand{
3942 .{ .kind = .IdResultType, .quantifier = .required },
3943 .{ .kind = .IdResult, .quantifier = .required },
3944 .{ .kind = .IdScope, .quantifier = .required },
3945 .{ .kind = .GroupOperation, .quantifier = .required },
3946 .{ .kind = .IdRef, .quantifier = .required },
3947 .{ .kind = .IdRef, .quantifier = .optional },
3948 },
3949 .OpGroupNonUniformIMul => &[_]Operand{
3950 .{ .kind = .IdResultType, .quantifier = .required },
3951 .{ .kind = .IdResult, .quantifier = .required },
3952 .{ .kind = .IdScope, .quantifier = .required },
3953 .{ .kind = .GroupOperation, .quantifier = .required },
3954 .{ .kind = .IdRef, .quantifier = .required },
3955 .{ .kind = .IdRef, .quantifier = .optional },
3956 },
3957 .OpGroupNonUniformFMul => &[_]Operand{
3958 .{ .kind = .IdResultType, .quantifier = .required },
3959 .{ .kind = .IdResult, .quantifier = .required },
3960 .{ .kind = .IdScope, .quantifier = .required },
3961 .{ .kind = .GroupOperation, .quantifier = .required },
3962 .{ .kind = .IdRef, .quantifier = .required },
3963 .{ .kind = .IdRef, .quantifier = .optional },
3964 },
3965 .OpGroupNonUniformSMin => &[_]Operand{
3966 .{ .kind = .IdResultType, .quantifier = .required },
3967 .{ .kind = .IdResult, .quantifier = .required },
3968 .{ .kind = .IdScope, .quantifier = .required },
3969 .{ .kind = .GroupOperation, .quantifier = .required },
3970 .{ .kind = .IdRef, .quantifier = .required },
3971 .{ .kind = .IdRef, .quantifier = .optional },
3972 },
3973 .OpGroupNonUniformUMin => &[_]Operand{
3974 .{ .kind = .IdResultType, .quantifier = .required },
3975 .{ .kind = .IdResult, .quantifier = .required },
3976 .{ .kind = .IdScope, .quantifier = .required },
3977 .{ .kind = .GroupOperation, .quantifier = .required },
3978 .{ .kind = .IdRef, .quantifier = .required },
3979 .{ .kind = .IdRef, .quantifier = .optional },
3980 },
3981 .OpGroupNonUniformFMin => &[_]Operand{
3982 .{ .kind = .IdResultType, .quantifier = .required },
3983 .{ .kind = .IdResult, .quantifier = .required },
3984 .{ .kind = .IdScope, .quantifier = .required },
3985 .{ .kind = .GroupOperation, .quantifier = .required },
3986 .{ .kind = .IdRef, .quantifier = .required },
3987 .{ .kind = .IdRef, .quantifier = .optional },
3988 },
3989 .OpGroupNonUniformSMax => &[_]Operand{
3990 .{ .kind = .IdResultType, .quantifier = .required },
3991 .{ .kind = .IdResult, .quantifier = .required },
3992 .{ .kind = .IdScope, .quantifier = .required },
3993 .{ .kind = .GroupOperation, .quantifier = .required },
3994 .{ .kind = .IdRef, .quantifier = .required },
3995 .{ .kind = .IdRef, .quantifier = .optional },
3996 },
3997 .OpGroupNonUniformUMax => &[_]Operand{
3998 .{ .kind = .IdResultType, .quantifier = .required },
3999 .{ .kind = .IdResult, .quantifier = .required },
4000 .{ .kind = .IdScope, .quantifier = .required },
4001 .{ .kind = .GroupOperation, .quantifier = .required },
4002 .{ .kind = .IdRef, .quantifier = .required },
4003 .{ .kind = .IdRef, .quantifier = .optional },
4004 },
4005 .OpGroupNonUniformFMax => &[_]Operand{
4006 .{ .kind = .IdResultType, .quantifier = .required },
4007 .{ .kind = .IdResult, .quantifier = .required },
4008 .{ .kind = .IdScope, .quantifier = .required },
4009 .{ .kind = .GroupOperation, .quantifier = .required },
4010 .{ .kind = .IdRef, .quantifier = .required },
4011 .{ .kind = .IdRef, .quantifier = .optional },
4012 },
4013 .OpGroupNonUniformBitwiseAnd => &[_]Operand{
4014 .{ .kind = .IdResultType, .quantifier = .required },
4015 .{ .kind = .IdResult, .quantifier = .required },
4016 .{ .kind = .IdScope, .quantifier = .required },
4017 .{ .kind = .GroupOperation, .quantifier = .required },
4018 .{ .kind = .IdRef, .quantifier = .required },
4019 .{ .kind = .IdRef, .quantifier = .optional },
4020 },
4021 .OpGroupNonUniformBitwiseOr => &[_]Operand{
4022 .{ .kind = .IdResultType, .quantifier = .required },
4023 .{ .kind = .IdResult, .quantifier = .required },
4024 .{ .kind = .IdScope, .quantifier = .required },
4025 .{ .kind = .GroupOperation, .quantifier = .required },
4026 .{ .kind = .IdRef, .quantifier = .required },
4027 .{ .kind = .IdRef, .quantifier = .optional },
4028 },
4029 .OpGroupNonUniformBitwiseXor => &[_]Operand{
4030 .{ .kind = .IdResultType, .quantifier = .required },
4031 .{ .kind = .IdResult, .quantifier = .required },
4032 .{ .kind = .IdScope, .quantifier = .required },
4033 .{ .kind = .GroupOperation, .quantifier = .required },
4034 .{ .kind = .IdRef, .quantifier = .required },
4035 .{ .kind = .IdRef, .quantifier = .optional },
4036 },
4037 .OpGroupNonUniformLogicalAnd => &[_]Operand{
4038 .{ .kind = .IdResultType, .quantifier = .required },
4039 .{ .kind = .IdResult, .quantifier = .required },
4040 .{ .kind = .IdScope, .quantifier = .required },
4041 .{ .kind = .GroupOperation, .quantifier = .required },
4042 .{ .kind = .IdRef, .quantifier = .required },
4043 .{ .kind = .IdRef, .quantifier = .optional },
4044 },
4045 .OpGroupNonUniformLogicalOr => &[_]Operand{
4046 .{ .kind = .IdResultType, .quantifier = .required },
4047 .{ .kind = .IdResult, .quantifier = .required },
4048 .{ .kind = .IdScope, .quantifier = .required },
4049 .{ .kind = .GroupOperation, .quantifier = .required },
4050 .{ .kind = .IdRef, .quantifier = .required },
4051 .{ .kind = .IdRef, .quantifier = .optional },
4052 },
4053 .OpGroupNonUniformLogicalXor => &[_]Operand{
4054 .{ .kind = .IdResultType, .quantifier = .required },
4055 .{ .kind = .IdResult, .quantifier = .required },
4056 .{ .kind = .IdScope, .quantifier = .required },
4057 .{ .kind = .GroupOperation, .quantifier = .required },
4058 .{ .kind = .IdRef, .quantifier = .required },
4059 .{ .kind = .IdRef, .quantifier = .optional },
4060 },
4061 .OpGroupNonUniformQuadBroadcast => &[_]Operand{
4062 .{ .kind = .IdResultType, .quantifier = .required },
4063 .{ .kind = .IdResult, .quantifier = .required },
4064 .{ .kind = .IdScope, .quantifier = .required },
4065 .{ .kind = .IdRef, .quantifier = .required },
4066 .{ .kind = .IdRef, .quantifier = .required },
4067 },
4068 .OpGroupNonUniformQuadSwap => &[_]Operand{
4069 .{ .kind = .IdResultType, .quantifier = .required },
4070 .{ .kind = .IdResult, .quantifier = .required },
4071 .{ .kind = .IdScope, .quantifier = .required },
4072 .{ .kind = .IdRef, .quantifier = .required },
4073 .{ .kind = .IdRef, .quantifier = .required },
4074 },
4075 .OpCopyLogical => &[_]Operand{
4076 .{ .kind = .IdResultType, .quantifier = .required },
4077 .{ .kind = .IdResult, .quantifier = .required },
4078 .{ .kind = .IdRef, .quantifier = .required },
4079 },
4080 .OpPtrEqual => &[_]Operand{
4081 .{ .kind = .IdResultType, .quantifier = .required },
4082 .{ .kind = .IdResult, .quantifier = .required },
4083 .{ .kind = .IdRef, .quantifier = .required },
4084 .{ .kind = .IdRef, .quantifier = .required },
4085 },
4086 .OpPtrNotEqual => &[_]Operand{
4087 .{ .kind = .IdResultType, .quantifier = .required },
4088 .{ .kind = .IdResult, .quantifier = .required },
4089 .{ .kind = .IdRef, .quantifier = .required },
4090 .{ .kind = .IdRef, .quantifier = .required },
4091 },
4092 .OpPtrDiff => &[_]Operand{
4093 .{ .kind = .IdResultType, .quantifier = .required },
4094 .{ .kind = .IdResult, .quantifier = .required },
4095 .{ .kind = .IdRef, .quantifier = .required },
4096 .{ .kind = .IdRef, .quantifier = .required },
4097 },
4098 .OpTerminateInvocation => &[_]Operand{},
4099 .OpSubgroupBallotKHR => &[_]Operand{
4100 .{ .kind = .IdResultType, .quantifier = .required },
4101 .{ .kind = .IdResult, .quantifier = .required },
4102 .{ .kind = .IdRef, .quantifier = .required },
4103 },
4104 .OpSubgroupFirstInvocationKHR => &[_]Operand{
4105 .{ .kind = .IdResultType, .quantifier = .required },
4106 .{ .kind = .IdResult, .quantifier = .required },
4107 .{ .kind = .IdRef, .quantifier = .required },
4108 },
4109 .OpSubgroupAllKHR => &[_]Operand{
4110 .{ .kind = .IdResultType, .quantifier = .required },
4111 .{ .kind = .IdResult, .quantifier = .required },
4112 .{ .kind = .IdRef, .quantifier = .required },
4113 },
4114 .OpSubgroupAnyKHR => &[_]Operand{
4115 .{ .kind = .IdResultType, .quantifier = .required },
4116 .{ .kind = .IdResult, .quantifier = .required },
4117 .{ .kind = .IdRef, .quantifier = .required },
4118 },
4119 .OpSubgroupAllEqualKHR => &[_]Operand{
4120 .{ .kind = .IdResultType, .quantifier = .required },
4121 .{ .kind = .IdResult, .quantifier = .required },
4122 .{ .kind = .IdRef, .quantifier = .required },
4123 },
4124 .OpSubgroupReadInvocationKHR => &[_]Operand{
4125 .{ .kind = .IdResultType, .quantifier = .required },
4126 .{ .kind = .IdResult, .quantifier = .required },
4127 .{ .kind = .IdRef, .quantifier = .required },
4128 .{ .kind = .IdRef, .quantifier = .required },
4129 },
4130 .OpTraceRayKHR => &[_]Operand{
4131 .{ .kind = .IdRef, .quantifier = .required },
4132 .{ .kind = .IdRef, .quantifier = .required },
4133 .{ .kind = .IdRef, .quantifier = .required },
4134 .{ .kind = .IdRef, .quantifier = .required },
4135 .{ .kind = .IdRef, .quantifier = .required },
4136 .{ .kind = .IdRef, .quantifier = .required },
4137 .{ .kind = .IdRef, .quantifier = .required },
4138 .{ .kind = .IdRef, .quantifier = .required },
4139 .{ .kind = .IdRef, .quantifier = .required },
4140 .{ .kind = .IdRef, .quantifier = .required },
4141 .{ .kind = .IdRef, .quantifier = .required },
4142 },
4143 .OpExecuteCallableKHR => &[_]Operand{
4144 .{ .kind = .IdRef, .quantifier = .required },
4145 .{ .kind = .IdRef, .quantifier = .required },
4146 },
4147 .OpConvertUToAccelerationStructureKHR => &[_]Operand{
4148 .{ .kind = .IdResultType, .quantifier = .required },
4149 .{ .kind = .IdResult, .quantifier = .required },
4150 .{ .kind = .IdRef, .quantifier = .required },
4151 },
4152 .OpIgnoreIntersectionKHR => &[_]Operand{},
4153 .OpTerminateRayKHR => &[_]Operand{},
4154 .OpSDot => &[_]Operand{
4155 .{ .kind = .IdResultType, .quantifier = .required },
4156 .{ .kind = .IdResult, .quantifier = .required },
4157 .{ .kind = .IdRef, .quantifier = .required },
4158 .{ .kind = .IdRef, .quantifier = .required },
4159 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4160 },
4161 .OpUDot => &[_]Operand{
4162 .{ .kind = .IdResultType, .quantifier = .required },
4163 .{ .kind = .IdResult, .quantifier = .required },
4164 .{ .kind = .IdRef, .quantifier = .required },
4165 .{ .kind = .IdRef, .quantifier = .required },
4166 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4167 },
4168 .OpSUDot => &[_]Operand{
4169 .{ .kind = .IdResultType, .quantifier = .required },
4170 .{ .kind = .IdResult, .quantifier = .required },
4171 .{ .kind = .IdRef, .quantifier = .required },
4172 .{ .kind = .IdRef, .quantifier = .required },
4173 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4174 },
4175 .OpSDotAccSat => &[_]Operand{
4176 .{ .kind = .IdResultType, .quantifier = .required },
4177 .{ .kind = .IdResult, .quantifier = .required },
4178 .{ .kind = .IdRef, .quantifier = .required },
4179 .{ .kind = .IdRef, .quantifier = .required },
4180 .{ .kind = .IdRef, .quantifier = .required },
4181 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4182 },
4183 .OpUDotAccSat => &[_]Operand{
4184 .{ .kind = .IdResultType, .quantifier = .required },
4185 .{ .kind = .IdResult, .quantifier = .required },
4186 .{ .kind = .IdRef, .quantifier = .required },
4187 .{ .kind = .IdRef, .quantifier = .required },
4188 .{ .kind = .IdRef, .quantifier = .required },
4189 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4190 },
4191 .OpSUDotAccSat => &[_]Operand{
4192 .{ .kind = .IdResultType, .quantifier = .required },
4193 .{ .kind = .IdResult, .quantifier = .required },
4194 .{ .kind = .IdRef, .quantifier = .required },
4195 .{ .kind = .IdRef, .quantifier = .required },
4196 .{ .kind = .IdRef, .quantifier = .required },
4197 .{ .kind = .PackedVectorFormat, .quantifier = .optional },
4198 },
4199 .OpTypeRayQueryKHR => &[_]Operand{
4200 .{ .kind = .IdResult, .quantifier = .required },
4201 },
4202 .OpRayQueryInitializeKHR => &[_]Operand{
4203 .{ .kind = .IdRef, .quantifier = .required },
4204 .{ .kind = .IdRef, .quantifier = .required },
4205 .{ .kind = .IdRef, .quantifier = .required },
4206 .{ .kind = .IdRef, .quantifier = .required },
4207 .{ .kind = .IdRef, .quantifier = .required },
4208 .{ .kind = .IdRef, .quantifier = .required },
4209 .{ .kind = .IdRef, .quantifier = .required },
4210 .{ .kind = .IdRef, .quantifier = .required },
4211 },
4212 .OpRayQueryTerminateKHR => &[_]Operand{
4213 .{ .kind = .IdRef, .quantifier = .required },
4214 },
4215 .OpRayQueryGenerateIntersectionKHR => &[_]Operand{
4216 .{ .kind = .IdRef, .quantifier = .required },
4217 .{ .kind = .IdRef, .quantifier = .required },
4218 },
4219 .OpRayQueryConfirmIntersectionKHR => &[_]Operand{
4220 .{ .kind = .IdRef, .quantifier = .required },
4221 },
4222 .OpRayQueryProceedKHR => &[_]Operand{
4223 .{ .kind = .IdResultType, .quantifier = .required },
4224 .{ .kind = .IdResult, .quantifier = .required },
4225 .{ .kind = .IdRef, .quantifier = .required },
4226 },
4227 .OpRayQueryGetIntersectionTypeKHR => &[_]Operand{
4228 .{ .kind = .IdResultType, .quantifier = .required },
4229 .{ .kind = .IdResult, .quantifier = .required },
4230 .{ .kind = .IdRef, .quantifier = .required },
4231 .{ .kind = .IdRef, .quantifier = .required },
4232 },
4233 .OpGroupIAddNonUniformAMD => &[_]Operand{
4234 .{ .kind = .IdResultType, .quantifier = .required },
4235 .{ .kind = .IdResult, .quantifier = .required },
4236 .{ .kind = .IdScope, .quantifier = .required },
4237 .{ .kind = .GroupOperation, .quantifier = .required },
4238 .{ .kind = .IdRef, .quantifier = .required },
4239 },
4240 .OpGroupFAddNonUniformAMD => &[_]Operand{
4241 .{ .kind = .IdResultType, .quantifier = .required },
4242 .{ .kind = .IdResult, .quantifier = .required },
4243 .{ .kind = .IdScope, .quantifier = .required },
4244 .{ .kind = .GroupOperation, .quantifier = .required },
4245 .{ .kind = .IdRef, .quantifier = .required },
4246 },
4247 .OpGroupFMinNonUniformAMD => &[_]Operand{
4248 .{ .kind = .IdResultType, .quantifier = .required },
4249 .{ .kind = .IdResult, .quantifier = .required },
4250 .{ .kind = .IdScope, .quantifier = .required },
4251 .{ .kind = .GroupOperation, .quantifier = .required },
4252 .{ .kind = .IdRef, .quantifier = .required },
4253 },
4254 .OpGroupUMinNonUniformAMD => &[_]Operand{
4255 .{ .kind = .IdResultType, .quantifier = .required },
4256 .{ .kind = .IdResult, .quantifier = .required },
4257 .{ .kind = .IdScope, .quantifier = .required },
4258 .{ .kind = .GroupOperation, .quantifier = .required },
4259 .{ .kind = .IdRef, .quantifier = .required },
4260 },
4261 .OpGroupSMinNonUniformAMD => &[_]Operand{
4262 .{ .kind = .IdResultType, .quantifier = .required },
4263 .{ .kind = .IdResult, .quantifier = .required },
4264 .{ .kind = .IdScope, .quantifier = .required },
4265 .{ .kind = .GroupOperation, .quantifier = .required },
4266 .{ .kind = .IdRef, .quantifier = .required },
4267 },
4268 .OpGroupFMaxNonUniformAMD => &[_]Operand{
4269 .{ .kind = .IdResultType, .quantifier = .required },
4270 .{ .kind = .IdResult, .quantifier = .required },
4271 .{ .kind = .IdScope, .quantifier = .required },
4272 .{ .kind = .GroupOperation, .quantifier = .required },
4273 .{ .kind = .IdRef, .quantifier = .required },
4274 },
4275 .OpGroupUMaxNonUniformAMD => &[_]Operand{
4276 .{ .kind = .IdResultType, .quantifier = .required },
4277 .{ .kind = .IdResult, .quantifier = .required },
4278 .{ .kind = .IdScope, .quantifier = .required },
4279 .{ .kind = .GroupOperation, .quantifier = .required },
4280 .{ .kind = .IdRef, .quantifier = .required },
4281 },
4282 .OpGroupSMaxNonUniformAMD => &[_]Operand{
4283 .{ .kind = .IdResultType, .quantifier = .required },
4284 .{ .kind = .IdResult, .quantifier = .required },
4285 .{ .kind = .IdScope, .quantifier = .required },
4286 .{ .kind = .GroupOperation, .quantifier = .required },
4287 .{ .kind = .IdRef, .quantifier = .required },
4288 },
4289 .OpFragmentMaskFetchAMD => &[_]Operand{
4290 .{ .kind = .IdResultType, .quantifier = .required },
4291 .{ .kind = .IdResult, .quantifier = .required },
4292 .{ .kind = .IdRef, .quantifier = .required },
4293 .{ .kind = .IdRef, .quantifier = .required },
4294 },
4295 .OpFragmentFetchAMD => &[_]Operand{
4296 .{ .kind = .IdResultType, .quantifier = .required },
4297 .{ .kind = .IdResult, .quantifier = .required },
4298 .{ .kind = .IdRef, .quantifier = .required },
4299 .{ .kind = .IdRef, .quantifier = .required },
4300 .{ .kind = .IdRef, .quantifier = .required },
4301 },
4302 .OpReadClockKHR => &[_]Operand{
4303 .{ .kind = .IdResultType, .quantifier = .required },
4304 .{ .kind = .IdResult, .quantifier = .required },
4305 .{ .kind = .IdScope, .quantifier = .required },
4306 },
4307 .OpImageSampleFootprintNV => &[_]Operand{
4308 .{ .kind = .IdResultType, .quantifier = .required },
4309 .{ .kind = .IdResult, .quantifier = .required },
4310 .{ .kind = .IdRef, .quantifier = .required },
4311 .{ .kind = .IdRef, .quantifier = .required },
4312 .{ .kind = .IdRef, .quantifier = .required },
4313 .{ .kind = .IdRef, .quantifier = .required },
4314 .{ .kind = .ImageOperands, .quantifier = .optional },
4315 },
4316 .OpGroupNonUniformPartitionNV => &[_]Operand{
4317 .{ .kind = .IdResultType, .quantifier = .required },
4318 .{ .kind = .IdResult, .quantifier = .required },
4319 .{ .kind = .IdRef, .quantifier = .required },
4320 },
4321 .OpWritePackedPrimitiveIndices4x8NV => &[_]Operand{
4322 .{ .kind = .IdRef, .quantifier = .required },
4323 .{ .kind = .IdRef, .quantifier = .required },
4324 },
4325 .OpReportIntersectionKHR => &[_]Operand{
4326 .{ .kind = .IdResultType, .quantifier = .required },
4327 .{ .kind = .IdResult, .quantifier = .required },
4328 .{ .kind = .IdRef, .quantifier = .required },
4329 .{ .kind = .IdRef, .quantifier = .required },
4330 },
4331 .OpIgnoreIntersectionNV => &[_]Operand{},
4332 .OpTerminateRayNV => &[_]Operand{},
4333 .OpTraceNV => &[_]Operand{
4334 .{ .kind = .IdRef, .quantifier = .required },
4335 .{ .kind = .IdRef, .quantifier = .required },
4336 .{ .kind = .IdRef, .quantifier = .required },
4337 .{ .kind = .IdRef, .quantifier = .required },
4338 .{ .kind = .IdRef, .quantifier = .required },
4339 .{ .kind = .IdRef, .quantifier = .required },
4340 .{ .kind = .IdRef, .quantifier = .required },
4341 .{ .kind = .IdRef, .quantifier = .required },
4342 .{ .kind = .IdRef, .quantifier = .required },
4343 .{ .kind = .IdRef, .quantifier = .required },
4344 .{ .kind = .IdRef, .quantifier = .required },
4345 },
4346 .OpTraceMotionNV => &[_]Operand{
4347 .{ .kind = .IdRef, .quantifier = .required },
4348 .{ .kind = .IdRef, .quantifier = .required },
4349 .{ .kind = .IdRef, .quantifier = .required },
4350 .{ .kind = .IdRef, .quantifier = .required },
4351 .{ .kind = .IdRef, .quantifier = .required },
4352 .{ .kind = .IdRef, .quantifier = .required },
4353 .{ .kind = .IdRef, .quantifier = .required },
4354 .{ .kind = .IdRef, .quantifier = .required },
4355 .{ .kind = .IdRef, .quantifier = .required },
4356 .{ .kind = .IdRef, .quantifier = .required },
4357 .{ .kind = .IdRef, .quantifier = .required },
4358 .{ .kind = .IdRef, .quantifier = .required },
4359 },
4360 .OpTraceRayMotionNV => &[_]Operand{
4361 .{ .kind = .IdRef, .quantifier = .required },
4362 .{ .kind = .IdRef, .quantifier = .required },
4363 .{ .kind = .IdRef, .quantifier = .required },
4364 .{ .kind = .IdRef, .quantifier = .required },
4365 .{ .kind = .IdRef, .quantifier = .required },
4366 .{ .kind = .IdRef, .quantifier = .required },
4367 .{ .kind = .IdRef, .quantifier = .required },
4368 .{ .kind = .IdRef, .quantifier = .required },
4369 .{ .kind = .IdRef, .quantifier = .required },
4370 .{ .kind = .IdRef, .quantifier = .required },
4371 .{ .kind = .IdRef, .quantifier = .required },
4372 .{ .kind = .IdRef, .quantifier = .required },
4373 },
4374 .OpTypeAccelerationStructureKHR => &[_]Operand{
4375 .{ .kind = .IdResult, .quantifier = .required },
4376 },
4377 .OpExecuteCallableNV => &[_]Operand{
4378 .{ .kind = .IdRef, .quantifier = .required },
4379 .{ .kind = .IdRef, .quantifier = .required },
4380 },
4381 .OpTypeCooperativeMatrixNV => &[_]Operand{
4382 .{ .kind = .IdResult, .quantifier = .required },
4383 .{ .kind = .IdRef, .quantifier = .required },
4384 .{ .kind = .IdScope, .quantifier = .required },
4385 .{ .kind = .IdRef, .quantifier = .required },
4386 .{ .kind = .IdRef, .quantifier = .required },
4387 },
4388 .OpCooperativeMatrixLoadNV => &[_]Operand{
4389 .{ .kind = .IdResultType, .quantifier = .required },
4390 .{ .kind = .IdResult, .quantifier = .required },
4391 .{ .kind = .IdRef, .quantifier = .required },
4392 .{ .kind = .IdRef, .quantifier = .required },
4393 .{ .kind = .IdRef, .quantifier = .required },
4394 .{ .kind = .MemoryAccess, .quantifier = .optional },
4395 },
4396 .OpCooperativeMatrixStoreNV => &[_]Operand{
4397 .{ .kind = .IdRef, .quantifier = .required },
4398 .{ .kind = .IdRef, .quantifier = .required },
4399 .{ .kind = .IdRef, .quantifier = .required },
4400 .{ .kind = .IdRef, .quantifier = .required },
4401 .{ .kind = .MemoryAccess, .quantifier = .optional },
4402 },
4403 .OpCooperativeMatrixMulAddNV => &[_]Operand{
4404 .{ .kind = .IdResultType, .quantifier = .required },
4405 .{ .kind = .IdResult, .quantifier = .required },
4406 .{ .kind = .IdRef, .quantifier = .required },
4407 .{ .kind = .IdRef, .quantifier = .required },
4408 .{ .kind = .IdRef, .quantifier = .required },
4409 },
4410 .OpCooperativeMatrixLengthNV => &[_]Operand{
4411 .{ .kind = .IdResultType, .quantifier = .required },
4412 .{ .kind = .IdResult, .quantifier = .required },
4413 .{ .kind = .IdRef, .quantifier = .required },
4414 },
4415 .OpBeginInvocationInterlockEXT => &[_]Operand{},
4416 .OpEndInvocationInterlockEXT => &[_]Operand{},
4417 .OpDemoteToHelperInvocation => &[_]Operand{},
4418 .OpIsHelperInvocationEXT => &[_]Operand{
4419 .{ .kind = .IdResultType, .quantifier = .required },
4420 .{ .kind = .IdResult, .quantifier = .required },
4421 },
4422 .OpConvertUToImageNV => &[_]Operand{
4423 .{ .kind = .IdResultType, .quantifier = .required },
4424 .{ .kind = .IdResult, .quantifier = .required },
4425 .{ .kind = .IdRef, .quantifier = .required },
4426 },
4427 .OpConvertUToSamplerNV => &[_]Operand{
4428 .{ .kind = .IdResultType, .quantifier = .required },
4429 .{ .kind = .IdResult, .quantifier = .required },
4430 .{ .kind = .IdRef, .quantifier = .required },
4431 },
4432 .OpConvertImageToUNV => &[_]Operand{
4433 .{ .kind = .IdResultType, .quantifier = .required },
4434 .{ .kind = .IdResult, .quantifier = .required },
4435 .{ .kind = .IdRef, .quantifier = .required },
4436 },
4437 .OpConvertSamplerToUNV => &[_]Operand{
4438 .{ .kind = .IdResultType, .quantifier = .required },
4439 .{ .kind = .IdResult, .quantifier = .required },
4440 .{ .kind = .IdRef, .quantifier = .required },
4441 },
4442 .OpConvertUToSampledImageNV => &[_]Operand{
4443 .{ .kind = .IdResultType, .quantifier = .required },
4444 .{ .kind = .IdResult, .quantifier = .required },
4445 .{ .kind = .IdRef, .quantifier = .required },
4446 },
4447 .OpConvertSampledImageToUNV => &[_]Operand{
4448 .{ .kind = .IdResultType, .quantifier = .required },
4449 .{ .kind = .IdResult, .quantifier = .required },
4450 .{ .kind = .IdRef, .quantifier = .required },
4451 },
4452 .OpSamplerImageAddressingModeNV => &[_]Operand{
4453 .{ .kind = .LiteralInteger, .quantifier = .required },
4454 },
4455 .OpSubgroupShuffleINTEL => &[_]Operand{
4456 .{ .kind = .IdResultType, .quantifier = .required },
4457 .{ .kind = .IdResult, .quantifier = .required },
4458 .{ .kind = .IdRef, .quantifier = .required },
4459 .{ .kind = .IdRef, .quantifier = .required },
4460 },
4461 .OpSubgroupShuffleDownINTEL => &[_]Operand{
4462 .{ .kind = .IdResultType, .quantifier = .required },
4463 .{ .kind = .IdResult, .quantifier = .required },
4464 .{ .kind = .IdRef, .quantifier = .required },
4465 .{ .kind = .IdRef, .quantifier = .required },
4466 .{ .kind = .IdRef, .quantifier = .required },
4467 },
4468 .OpSubgroupShuffleUpINTEL => &[_]Operand{
4469 .{ .kind = .IdResultType, .quantifier = .required },
4470 .{ .kind = .IdResult, .quantifier = .required },
4471 .{ .kind = .IdRef, .quantifier = .required },
4472 .{ .kind = .IdRef, .quantifier = .required },
4473 .{ .kind = .IdRef, .quantifier = .required },
4474 },
4475 .OpSubgroupShuffleXorINTEL => &[_]Operand{
4476 .{ .kind = .IdResultType, .quantifier = .required },
4477 .{ .kind = .IdResult, .quantifier = .required },
4478 .{ .kind = .IdRef, .quantifier = .required },
4479 .{ .kind = .IdRef, .quantifier = .required },
4480 },
4481 .OpSubgroupBlockReadINTEL => &[_]Operand{
4482 .{ .kind = .IdResultType, .quantifier = .required },
4483 .{ .kind = .IdResult, .quantifier = .required },
4484 .{ .kind = .IdRef, .quantifier = .required },
4485 },
4486 .OpSubgroupBlockWriteINTEL => &[_]Operand{
4487 .{ .kind = .IdRef, .quantifier = .required },
4488 .{ .kind = .IdRef, .quantifier = .required },
4489 },
4490 .OpSubgroupImageBlockReadINTEL => &[_]Operand{
4491 .{ .kind = .IdResultType, .quantifier = .required },
4492 .{ .kind = .IdResult, .quantifier = .required },
4493 .{ .kind = .IdRef, .quantifier = .required },
4494 .{ .kind = .IdRef, .quantifier = .required },
4495 },
4496 .OpSubgroupImageBlockWriteINTEL => &[_]Operand{
4497 .{ .kind = .IdRef, .quantifier = .required },
4498 .{ .kind = .IdRef, .quantifier = .required },
4499 .{ .kind = .IdRef, .quantifier = .required },
4500 },
4501 .OpSubgroupImageMediaBlockReadINTEL => &[_]Operand{
4502 .{ .kind = .IdResultType, .quantifier = .required },
4503 .{ .kind = .IdResult, .quantifier = .required },
4504 .{ .kind = .IdRef, .quantifier = .required },
4505 .{ .kind = .IdRef, .quantifier = .required },
4506 .{ .kind = .IdRef, .quantifier = .required },
4507 .{ .kind = .IdRef, .quantifier = .required },
4508 },
4509 .OpSubgroupImageMediaBlockWriteINTEL => &[_]Operand{
4510 .{ .kind = .IdRef, .quantifier = .required },
4511 .{ .kind = .IdRef, .quantifier = .required },
4512 .{ .kind = .IdRef, .quantifier = .required },
4513 .{ .kind = .IdRef, .quantifier = .required },
4514 .{ .kind = .IdRef, .quantifier = .required },
4515 },
4516 .OpUCountLeadingZerosINTEL => &[_]Operand{
4517 .{ .kind = .IdResultType, .quantifier = .required },
4518 .{ .kind = .IdResult, .quantifier = .required },
4519 .{ .kind = .IdRef, .quantifier = .required },
4520 },
4521 .OpUCountTrailingZerosINTEL => &[_]Operand{
4522 .{ .kind = .IdResultType, .quantifier = .required },
4523 .{ .kind = .IdResult, .quantifier = .required },
4524 .{ .kind = .IdRef, .quantifier = .required },
4525 },
4526 .OpAbsISubINTEL => &[_]Operand{
4527 .{ .kind = .IdResultType, .quantifier = .required },
4528 .{ .kind = .IdResult, .quantifier = .required },
4529 .{ .kind = .IdRef, .quantifier = .required },
4530 .{ .kind = .IdRef, .quantifier = .required },
4531 },
4532 .OpAbsUSubINTEL => &[_]Operand{
4533 .{ .kind = .IdResultType, .quantifier = .required },
4534 .{ .kind = .IdResult, .quantifier = .required },
4535 .{ .kind = .IdRef, .quantifier = .required },
4536 .{ .kind = .IdRef, .quantifier = .required },
4537 },
4538 .OpIAddSatINTEL => &[_]Operand{
4539 .{ .kind = .IdResultType, .quantifier = .required },
4540 .{ .kind = .IdResult, .quantifier = .required },
4541 .{ .kind = .IdRef, .quantifier = .required },
4542 .{ .kind = .IdRef, .quantifier = .required },
4543 },
4544 .OpUAddSatINTEL => &[_]Operand{
4545 .{ .kind = .IdResultType, .quantifier = .required },
4546 .{ .kind = .IdResult, .quantifier = .required },
4547 .{ .kind = .IdRef, .quantifier = .required },
4548 .{ .kind = .IdRef, .quantifier = .required },
4549 },
4550 .OpIAverageINTEL => &[_]Operand{
4551 .{ .kind = .IdResultType, .quantifier = .required },
4552 .{ .kind = .IdResult, .quantifier = .required },
4553 .{ .kind = .IdRef, .quantifier = .required },
4554 .{ .kind = .IdRef, .quantifier = .required },
4555 },
4556 .OpUAverageINTEL => &[_]Operand{
4557 .{ .kind = .IdResultType, .quantifier = .required },
4558 .{ .kind = .IdResult, .quantifier = .required },
4559 .{ .kind = .IdRef, .quantifier = .required },
4560 .{ .kind = .IdRef, .quantifier = .required },
4561 },
4562 .OpIAverageRoundedINTEL => &[_]Operand{
4563 .{ .kind = .IdResultType, .quantifier = .required },
4564 .{ .kind = .IdResult, .quantifier = .required },
4565 .{ .kind = .IdRef, .quantifier = .required },
4566 .{ .kind = .IdRef, .quantifier = .required },
4567 },
4568 .OpUAverageRoundedINTEL => &[_]Operand{
4569 .{ .kind = .IdResultType, .quantifier = .required },
4570 .{ .kind = .IdResult, .quantifier = .required },
4571 .{ .kind = .IdRef, .quantifier = .required },
4572 .{ .kind = .IdRef, .quantifier = .required },
4573 },
4574 .OpISubSatINTEL => &[_]Operand{
4575 .{ .kind = .IdResultType, .quantifier = .required },
4576 .{ .kind = .IdResult, .quantifier = .required },
4577 .{ .kind = .IdRef, .quantifier = .required },
4578 .{ .kind = .IdRef, .quantifier = .required },
4579 },
4580 .OpUSubSatINTEL => &[_]Operand{
4581 .{ .kind = .IdResultType, .quantifier = .required },
4582 .{ .kind = .IdResult, .quantifier = .required },
4583 .{ .kind = .IdRef, .quantifier = .required },
4584 .{ .kind = .IdRef, .quantifier = .required },
4585 },
4586 .OpIMul32x16INTEL => &[_]Operand{
4587 .{ .kind = .IdResultType, .quantifier = .required },
4588 .{ .kind = .IdResult, .quantifier = .required },
4589 .{ .kind = .IdRef, .quantifier = .required },
4590 .{ .kind = .IdRef, .quantifier = .required },
4591 },
4592 .OpUMul32x16INTEL => &[_]Operand{
4593 .{ .kind = .IdResultType, .quantifier = .required },
4594 .{ .kind = .IdResult, .quantifier = .required },
4595 .{ .kind = .IdRef, .quantifier = .required },
4596 .{ .kind = .IdRef, .quantifier = .required },
4597 },
4598 .OpAtomicFMinEXT => &[_]Operand{
4599 .{ .kind = .IdResultType, .quantifier = .required },
4600 .{ .kind = .IdResult, .quantifier = .required },
4601 .{ .kind = .IdRef, .quantifier = .required },
4602 .{ .kind = .IdScope, .quantifier = .required },
4603 .{ .kind = .IdMemorySemantics, .quantifier = .required },
4604 .{ .kind = .IdRef, .quantifier = .required },
4605 },
4606 .OpAtomicFMaxEXT => &[_]Operand{
4607 .{ .kind = .IdResultType, .quantifier = .required },
4608 .{ .kind = .IdResult, .quantifier = .required },
4609 .{ .kind = .IdRef, .quantifier = .required },
4610 .{ .kind = .IdScope, .quantifier = .required },
4611 .{ .kind = .IdMemorySemantics, .quantifier = .required },
4612 .{ .kind = .IdRef, .quantifier = .required },
4613 },
4614 .OpAssumeTrueKHR => &[_]Operand{
4615 .{ .kind = .IdRef, .quantifier = .required },
4616 },
4617 .OpExpectKHR => &[_]Operand{
4618 .{ .kind = .IdResultType, .quantifier = .required },
4619 .{ .kind = .IdResult, .quantifier = .required },
4620 .{ .kind = .IdRef, .quantifier = .required },
4621 .{ .kind = .IdRef, .quantifier = .required },
4622 },
4623 .OpDecorateString => &[_]Operand{
4624 .{ .kind = .IdRef, .quantifier = .required },
4625 .{ .kind = .Decoration, .quantifier = .required },
4626 },
4627 .OpMemberDecorateString => &[_]Operand{
4628 .{ .kind = .IdRef, .quantifier = .required },
4629 .{ .kind = .LiteralInteger, .quantifier = .required },
4630 .{ .kind = .Decoration, .quantifier = .required },
4631 },
4632 .OpLoopControlINTEL => &[_]Operand{
4633 .{ .kind = .LiteralInteger, .quantifier = .variadic },
4634 },
4635 .OpReadPipeBlockingINTEL => &[_]Operand{
4636 .{ .kind = .IdResultType, .quantifier = .required },
4637 .{ .kind = .IdResult, .quantifier = .required },
4638 .{ .kind = .IdRef, .quantifier = .required },
4639 .{ .kind = .IdRef, .quantifier = .required },
4640 },
4641 .OpWritePipeBlockingINTEL => &[_]Operand{
4642 .{ .kind = .IdResultType, .quantifier = .required },
4643 .{ .kind = .IdResult, .quantifier = .required },
4644 .{ .kind = .IdRef, .quantifier = .required },
4645 .{ .kind = .IdRef, .quantifier = .required },
4646 },
4647 .OpFPGARegINTEL => &[_]Operand{
4648 .{ .kind = .IdResultType, .quantifier = .required },
4649 .{ .kind = .IdResult, .quantifier = .required },
4650 .{ .kind = .IdRef, .quantifier = .required },
4651 .{ .kind = .IdRef, .quantifier = .required },
4652 },
4653 .OpRayQueryGetRayTMinKHR => &[_]Operand{
4654 .{ .kind = .IdResultType, .quantifier = .required },
4655 .{ .kind = .IdResult, .quantifier = .required },
4656 .{ .kind = .IdRef, .quantifier = .required },
4657 },
4658 .OpRayQueryGetRayFlagsKHR => &[_]Operand{
4659 .{ .kind = .IdResultType, .quantifier = .required },
4660 .{ .kind = .IdResult, .quantifier = .required },
4661 .{ .kind = .IdRef, .quantifier = .required },
4662 },
4663 .OpRayQueryGetIntersectionTKHR => &[_]Operand{
4664 .{ .kind = .IdResultType, .quantifier = .required },
4665 .{ .kind = .IdResult, .quantifier = .required },
4666 .{ .kind = .IdRef, .quantifier = .required },
4667 .{ .kind = .IdRef, .quantifier = .required },
4668 },
4669 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => &[_]Operand{
4670 .{ .kind = .IdResultType, .quantifier = .required },
4671 .{ .kind = .IdResult, .quantifier = .required },
4672 .{ .kind = .IdRef, .quantifier = .required },
4673 .{ .kind = .IdRef, .quantifier = .required },
4674 },
4675 .OpRayQueryGetIntersectionInstanceIdKHR => &[_]Operand{
4676 .{ .kind = .IdResultType, .quantifier = .required },
4677 .{ .kind = .IdResult, .quantifier = .required },
4678 .{ .kind = .IdRef, .quantifier = .required },
4679 .{ .kind = .IdRef, .quantifier = .required },
4680 },
4681 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => &[_]Operand{
4682 .{ .kind = .IdResultType, .quantifier = .required },
4683 .{ .kind = .IdResult, .quantifier = .required },
4684 .{ .kind = .IdRef, .quantifier = .required },
4685 .{ .kind = .IdRef, .quantifier = .required },
4686 },
4687 .OpRayQueryGetIntersectionGeometryIndexKHR => &[_]Operand{
4688 .{ .kind = .IdResultType, .quantifier = .required },
4689 .{ .kind = .IdResult, .quantifier = .required },
4690 .{ .kind = .IdRef, .quantifier = .required },
4691 .{ .kind = .IdRef, .quantifier = .required },
4692 },
4693 .OpRayQueryGetIntersectionPrimitiveIndexKHR => &[_]Operand{
4694 .{ .kind = .IdResultType, .quantifier = .required },
4695 .{ .kind = .IdResult, .quantifier = .required },
4696 .{ .kind = .IdRef, .quantifier = .required },
4697 .{ .kind = .IdRef, .quantifier = .required },
4698 },
4699 .OpRayQueryGetIntersectionBarycentricsKHR => &[_]Operand{
4700 .{ .kind = .IdResultType, .quantifier = .required },
4701 .{ .kind = .IdResult, .quantifier = .required },
4702 .{ .kind = .IdRef, .quantifier = .required },
4703 .{ .kind = .IdRef, .quantifier = .required },
4704 },
4705 .OpRayQueryGetIntersectionFrontFaceKHR => &[_]Operand{
4706 .{ .kind = .IdResultType, .quantifier = .required },
4707 .{ .kind = .IdResult, .quantifier = .required },
4708 .{ .kind = .IdRef, .quantifier = .required },
4709 .{ .kind = .IdRef, .quantifier = .required },
4710 },
4711 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => &[_]Operand{
4712 .{ .kind = .IdResultType, .quantifier = .required },
4713 .{ .kind = .IdResult, .quantifier = .required },
4714 .{ .kind = .IdRef, .quantifier = .required },
4715 },
4716 .OpRayQueryGetIntersectionObjectRayDirectionKHR => &[_]Operand{
4717 .{ .kind = .IdResultType, .quantifier = .required },
4718 .{ .kind = .IdResult, .quantifier = .required },
4719 .{ .kind = .IdRef, .quantifier = .required },
4720 .{ .kind = .IdRef, .quantifier = .required },
4721 },
4722 .OpRayQueryGetIntersectionObjectRayOriginKHR => &[_]Operand{
4723 .{ .kind = .IdResultType, .quantifier = .required },
4724 .{ .kind = .IdResult, .quantifier = .required },
4725 .{ .kind = .IdRef, .quantifier = .required },
4726 .{ .kind = .IdRef, .quantifier = .required },
4727 },
4728 .OpRayQueryGetWorldRayDirectionKHR => &[_]Operand{
4729 .{ .kind = .IdResultType, .quantifier = .required },
4730 .{ .kind = .IdResult, .quantifier = .required },
4731 .{ .kind = .IdRef, .quantifier = .required },
4732 },
4733 .OpRayQueryGetWorldRayOriginKHR => &[_]Operand{
4734 .{ .kind = .IdResultType, .quantifier = .required },
4735 .{ .kind = .IdResult, .quantifier = .required },
4736 .{ .kind = .IdRef, .quantifier = .required },
4737 },
4738 .OpRayQueryGetIntersectionObjectToWorldKHR => &[_]Operand{
4739 .{ .kind = .IdResultType, .quantifier = .required },
4740 .{ .kind = .IdResult, .quantifier = .required },
4741 .{ .kind = .IdRef, .quantifier = .required },
4742 .{ .kind = .IdRef, .quantifier = .required },
4743 },
4744 .OpRayQueryGetIntersectionWorldToObjectKHR => &[_]Operand{
4745 .{ .kind = .IdResultType, .quantifier = .required },
4746 .{ .kind = .IdResult, .quantifier = .required },
4747 .{ .kind = .IdRef, .quantifier = .required },
4748 .{ .kind = .IdRef, .quantifier = .required },
4749 },
4750 .OpAtomicFAddEXT => &[_]Operand{
4751 .{ .kind = .IdResultType, .quantifier = .required },
4752 .{ .kind = .IdResult, .quantifier = .required },
4753 .{ .kind = .IdRef, .quantifier = .required },
4754 .{ .kind = .IdScope, .quantifier = .required },
4755 .{ .kind = .IdMemorySemantics, .quantifier = .required },
4756 .{ .kind = .IdRef, .quantifier = .required },
4757 },
4758 .OpTypeBufferSurfaceINTEL => &[_]Operand{
4759 .{ .kind = .IdResult, .quantifier = .required },
4760 .{ .kind = .AccessQualifier, .quantifier = .required },
4761 },
4762 .OpTypeStructContinuedINTEL => &[_]Operand{
4763 .{ .kind = .IdRef, .quantifier = .variadic },
4764 },
4765 .OpConstantCompositeContinuedINTEL => &[_]Operand{
4766 .{ .kind = .IdRef, .quantifier = .variadic },
4767 },
4768 .OpSpecConstantCompositeContinuedINTEL => &[_]Operand{
4769 .{ .kind = .IdRef, .quantifier = .variadic },
4770 },
4771 };
4772 }
4773 pub fn class(self: Opcode) Class {
4774 return switch (self) {
4775 .OpNop => .Miscellaneous,
4776 .OpUndef => .Miscellaneous,
4777 .OpSourceContinued => .Debug,
4778 .OpSource => .Debug,
4779 .OpSourceExtension => .Debug,
4780 .OpName => .Debug,
4781 .OpMemberName => .Debug,
4782 .OpString => .Debug,
4783 .OpLine => .Debug,
4784 .OpExtension => .Extension,
4785 .OpExtInstImport => .Extension,
4786 .OpExtInst => .Extension,
4787 .OpMemoryModel => .ModeSetting,
4788 .OpEntryPoint => .ModeSetting,
4789 .OpExecutionMode => .ModeSetting,
4790 .OpCapability => .ModeSetting,
4791 .OpTypeVoid => .TypeDeclaration,
4792 .OpTypeBool => .TypeDeclaration,
4793 .OpTypeInt => .TypeDeclaration,
4794 .OpTypeFloat => .TypeDeclaration,
4795 .OpTypeVector => .TypeDeclaration,
4796 .OpTypeMatrix => .TypeDeclaration,
4797 .OpTypeImage => .TypeDeclaration,
4798 .OpTypeSampler => .TypeDeclaration,
4799 .OpTypeSampledImage => .TypeDeclaration,
4800 .OpTypeArray => .TypeDeclaration,
4801 .OpTypeRuntimeArray => .TypeDeclaration,
4802 .OpTypeStruct => .TypeDeclaration,
4803 .OpTypeOpaque => .TypeDeclaration,
4804 .OpTypePointer => .TypeDeclaration,
4805 .OpTypeFunction => .TypeDeclaration,
4806 .OpTypeEvent => .TypeDeclaration,
4807 .OpTypeDeviceEvent => .TypeDeclaration,
4808 .OpTypeReserveId => .TypeDeclaration,
4809 .OpTypeQueue => .TypeDeclaration,
4810 .OpTypePipe => .TypeDeclaration,
4811 .OpTypeForwardPointer => .TypeDeclaration,
4812 .OpConstantTrue => .ConstantCreation,
4813 .OpConstantFalse => .ConstantCreation,
4814 .OpConstant => .ConstantCreation,
4815 .OpConstantComposite => .ConstantCreation,
4816 .OpConstantSampler => .ConstantCreation,
4817 .OpConstantNull => .ConstantCreation,
4818 .OpSpecConstantTrue => .ConstantCreation,
4819 .OpSpecConstantFalse => .ConstantCreation,
4820 .OpSpecConstant => .ConstantCreation,
4821 .OpSpecConstantComposite => .ConstantCreation,
4822 .OpSpecConstantOp => .ConstantCreation,
4823 .OpFunction => .Function,
4824 .OpFunctionParameter => .Function,
4825 .OpFunctionEnd => .Function,
4826 .OpFunctionCall => .Function,
4827 .OpVariable => .Memory,
4828 .OpImageTexelPointer => .Memory,
4829 .OpLoad => .Memory,
4830 .OpStore => .Memory,
4831 .OpCopyMemory => .Memory,
4832 .OpCopyMemorySized => .Memory,
4833 .OpAccessChain => .Memory,
4834 .OpInBoundsAccessChain => .Memory,
4835 .OpPtrAccessChain => .Memory,
4836 .OpArrayLength => .Memory,
4837 .OpGenericPtrMemSemantics => .Memory,
4838 .OpInBoundsPtrAccessChain => .Memory,
4839 .OpDecorate => .Annotation,
4840 .OpMemberDecorate => .Annotation,
4841 .OpDecorationGroup => .Annotation,
4842 .OpGroupDecorate => .Annotation,
4843 .OpGroupMemberDecorate => .Annotation,
4844 .OpVectorExtractDynamic => .Composite,
4845 .OpVectorInsertDynamic => .Composite,
4846 .OpVectorShuffle => .Composite,
4847 .OpCompositeConstruct => .Composite,
4848 .OpCompositeExtract => .Composite,
4849 .OpCompositeInsert => .Composite,
4850 .OpCopyObject => .Composite,
4851 .OpTranspose => .Composite,
4852 .OpSampledImage => .Image,
4853 .OpImageSampleImplicitLod => .Image,
4854 .OpImageSampleExplicitLod => .Image,
4855 .OpImageSampleDrefImplicitLod => .Image,
4856 .OpImageSampleDrefExplicitLod => .Image,
4857 .OpImageSampleProjImplicitLod => .Image,
4858 .OpImageSampleProjExplicitLod => .Image,
4859 .OpImageSampleProjDrefImplicitLod => .Image,
4860 .OpImageSampleProjDrefExplicitLod => .Image,
4861 .OpImageFetch => .Image,
4862 .OpImageGather => .Image,
4863 .OpImageDrefGather => .Image,
4864 .OpImageRead => .Image,
4865 .OpImageWrite => .Image,
4866 .OpImage => .Image,
4867 .OpImageQueryFormat => .Image,
4868 .OpImageQueryOrder => .Image,
4869 .OpImageQuerySizeLod => .Image,
4870 .OpImageQuerySize => .Image,
4871 .OpImageQueryLod => .Image,
4872 .OpImageQueryLevels => .Image,
4873 .OpImageQuerySamples => .Image,
4874 .OpConvertFToU => .Conversion,
4875 .OpConvertFToS => .Conversion,
4876 .OpConvertSToF => .Conversion,
4877 .OpConvertUToF => .Conversion,
4878 .OpUConvert => .Conversion,
4879 .OpSConvert => .Conversion,
4880 .OpFConvert => .Conversion,
4881 .OpQuantizeToF16 => .Conversion,
4882 .OpConvertPtrToU => .Conversion,
4883 .OpSatConvertSToU => .Conversion,
4884 .OpSatConvertUToS => .Conversion,
4885 .OpConvertUToPtr => .Conversion,
4886 .OpPtrCastToGeneric => .Conversion,
4887 .OpGenericCastToPtr => .Conversion,
4888 .OpGenericCastToPtrExplicit => .Conversion,
4889 .OpBitcast => .Conversion,
4890 .OpSNegate => .Arithmetic,
4891 .OpFNegate => .Arithmetic,
4892 .OpIAdd => .Arithmetic,
4893 .OpFAdd => .Arithmetic,
4894 .OpISub => .Arithmetic,
4895 .OpFSub => .Arithmetic,
4896 .OpIMul => .Arithmetic,
4897 .OpFMul => .Arithmetic,
4898 .OpUDiv => .Arithmetic,
4899 .OpSDiv => .Arithmetic,
4900 .OpFDiv => .Arithmetic,
4901 .OpUMod => .Arithmetic,
4902 .OpSRem => .Arithmetic,
4903 .OpSMod => .Arithmetic,
4904 .OpFRem => .Arithmetic,
4905 .OpFMod => .Arithmetic,
4906 .OpVectorTimesScalar => .Arithmetic,
4907 .OpMatrixTimesScalar => .Arithmetic,
4908 .OpVectorTimesMatrix => .Arithmetic,
4909 .OpMatrixTimesVector => .Arithmetic,
4910 .OpMatrixTimesMatrix => .Arithmetic,
4911 .OpOuterProduct => .Arithmetic,
4912 .OpDot => .Arithmetic,
4913 .OpIAddCarry => .Arithmetic,
4914 .OpISubBorrow => .Arithmetic,
4915 .OpUMulExtended => .Arithmetic,
4916 .OpSMulExtended => .Arithmetic,
4917 .OpAny => .RelationalAndLogical,
4918 .OpAll => .RelationalAndLogical,
4919 .OpIsNan => .RelationalAndLogical,
4920 .OpIsInf => .RelationalAndLogical,
4921 .OpIsFinite => .RelationalAndLogical,
4922 .OpIsNormal => .RelationalAndLogical,
4923 .OpSignBitSet => .RelationalAndLogical,
4924 .OpLessOrGreater => .RelationalAndLogical,
4925 .OpOrdered => .RelationalAndLogical,
4926 .OpUnordered => .RelationalAndLogical,
4927 .OpLogicalEqual => .RelationalAndLogical,
4928 .OpLogicalNotEqual => .RelationalAndLogical,
4929 .OpLogicalOr => .RelationalAndLogical,
4930 .OpLogicalAnd => .RelationalAndLogical,
4931 .OpLogicalNot => .RelationalAndLogical,
4932 .OpSelect => .RelationalAndLogical,
4933 .OpIEqual => .RelationalAndLogical,
4934 .OpINotEqual => .RelationalAndLogical,
4935 .OpUGreaterThan => .RelationalAndLogical,
4936 .OpSGreaterThan => .RelationalAndLogical,
4937 .OpUGreaterThanEqual => .RelationalAndLogical,
4938 .OpSGreaterThanEqual => .RelationalAndLogical,
4939 .OpULessThan => .RelationalAndLogical,
4940 .OpSLessThan => .RelationalAndLogical,
4941 .OpULessThanEqual => .RelationalAndLogical,
4942 .OpSLessThanEqual => .RelationalAndLogical,
4943 .OpFOrdEqual => .RelationalAndLogical,
4944 .OpFUnordEqual => .RelationalAndLogical,
4945 .OpFOrdNotEqual => .RelationalAndLogical,
4946 .OpFUnordNotEqual => .RelationalAndLogical,
4947 .OpFOrdLessThan => .RelationalAndLogical,
4948 .OpFUnordLessThan => .RelationalAndLogical,
4949 .OpFOrdGreaterThan => .RelationalAndLogical,
4950 .OpFUnordGreaterThan => .RelationalAndLogical,
4951 .OpFOrdLessThanEqual => .RelationalAndLogical,
4952 .OpFUnordLessThanEqual => .RelationalAndLogical,
4953 .OpFOrdGreaterThanEqual => .RelationalAndLogical,
4954 .OpFUnordGreaterThanEqual => .RelationalAndLogical,
4955 .OpShiftRightLogical => .Bit,
4956 .OpShiftRightArithmetic => .Bit,
4957 .OpShiftLeftLogical => .Bit,
4958 .OpBitwiseOr => .Bit,
4959 .OpBitwiseXor => .Bit,
4960 .OpBitwiseAnd => .Bit,
4961 .OpNot => .Bit,
4962 .OpBitFieldInsert => .Bit,
4963 .OpBitFieldSExtract => .Bit,
4964 .OpBitFieldUExtract => .Bit,
4965 .OpBitReverse => .Bit,
4966 .OpBitCount => .Bit,
4967 .OpDPdx => .Derivative,
4968 .OpDPdy => .Derivative,
4969 .OpFwidth => .Derivative,
4970 .OpDPdxFine => .Derivative,
4971 .OpDPdyFine => .Derivative,
4972 .OpFwidthFine => .Derivative,
4973 .OpDPdxCoarse => .Derivative,
4974 .OpDPdyCoarse => .Derivative,
4975 .OpFwidthCoarse => .Derivative,
4976 .OpEmitVertex => .Primitive,
4977 .OpEndPrimitive => .Primitive,
4978 .OpEmitStreamVertex => .Primitive,
4979 .OpEndStreamPrimitive => .Primitive,
4980 .OpControlBarrier => .Barrier,
4981 .OpMemoryBarrier => .Barrier,
4982 .OpAtomicLoad => .Atomic,
4983 .OpAtomicStore => .Atomic,
4984 .OpAtomicExchange => .Atomic,
4985 .OpAtomicCompareExchange => .Atomic,
4986 .OpAtomicCompareExchangeWeak => .Atomic,
4987 .OpAtomicIIncrement => .Atomic,
4988 .OpAtomicIDecrement => .Atomic,
4989 .OpAtomicIAdd => .Atomic,
4990 .OpAtomicISub => .Atomic,
4991 .OpAtomicSMin => .Atomic,
4992 .OpAtomicUMin => .Atomic,
4993 .OpAtomicSMax => .Atomic,
4994 .OpAtomicUMax => .Atomic,
4995 .OpAtomicAnd => .Atomic,
4996 .OpAtomicOr => .Atomic,
4997 .OpAtomicXor => .Atomic,
4998 .OpPhi => .ControlFlow,
4999 .OpLoopMerge => .ControlFlow,
5000 .OpSelectionMerge => .ControlFlow,
5001 .OpLabel => .ControlFlow,
5002 .OpBranch => .ControlFlow,
5003 .OpBranchConditional => .ControlFlow,
5004 .OpSwitch => .ControlFlow,
5005 .OpKill => .ControlFlow,
5006 .OpReturn => .ControlFlow,
5007 .OpReturnValue => .ControlFlow,
5008 .OpUnreachable => .ControlFlow,
5009 .OpLifetimeStart => .ControlFlow,
5010 .OpLifetimeStop => .ControlFlow,
5011 .OpGroupAsyncCopy => .Group,
5012 .OpGroupWaitEvents => .Group,
5013 .OpGroupAll => .Group,
5014 .OpGroupAny => .Group,
5015 .OpGroupBroadcast => .Group,
5016 .OpGroupIAdd => .Group,
5017 .OpGroupFAdd => .Group,
5018 .OpGroupFMin => .Group,
5019 .OpGroupUMin => .Group,
5020 .OpGroupSMin => .Group,
5021 .OpGroupFMax => .Group,
5022 .OpGroupUMax => .Group,
5023 .OpGroupSMax => .Group,
5024 .OpReadPipe => .Pipe,
5025 .OpWritePipe => .Pipe,
5026 .OpReservedReadPipe => .Pipe,
5027 .OpReservedWritePipe => .Pipe,
5028 .OpReserveReadPipePackets => .Pipe,
5029 .OpReserveWritePipePackets => .Pipe,
5030 .OpCommitReadPipe => .Pipe,
5031 .OpCommitWritePipe => .Pipe,
5032 .OpIsValidReserveId => .Pipe,
5033 .OpGetNumPipePackets => .Pipe,
5034 .OpGetMaxPipePackets => .Pipe,
5035 .OpGroupReserveReadPipePackets => .Pipe,
5036 .OpGroupReserveWritePipePackets => .Pipe,
5037 .OpGroupCommitReadPipe => .Pipe,
5038 .OpGroupCommitWritePipe => .Pipe,
5039 .OpEnqueueMarker => .DeviceSideEnqueue,
5040 .OpEnqueueKernel => .DeviceSideEnqueue,
5041 .OpGetKernelNDrangeSubGroupCount => .DeviceSideEnqueue,
5042 .OpGetKernelNDrangeMaxSubGroupSize => .DeviceSideEnqueue,
5043 .OpGetKernelWorkGroupSize => .DeviceSideEnqueue,
5044 .OpGetKernelPreferredWorkGroupSizeMultiple => .DeviceSideEnqueue,
5045 .OpRetainEvent => .DeviceSideEnqueue,
5046 .OpReleaseEvent => .DeviceSideEnqueue,
5047 .OpCreateUserEvent => .DeviceSideEnqueue,
5048 .OpIsValidEvent => .DeviceSideEnqueue,
5049 .OpSetUserEventStatus => .DeviceSideEnqueue,
5050 .OpCaptureEventProfilingInfo => .DeviceSideEnqueue,
5051 .OpGetDefaultQueue => .DeviceSideEnqueue,
5052 .OpBuildNDRange => .DeviceSideEnqueue,
5053 .OpImageSparseSampleImplicitLod => .Image,
5054 .OpImageSparseSampleExplicitLod => .Image,
5055 .OpImageSparseSampleDrefImplicitLod => .Image,
5056 .OpImageSparseSampleDrefExplicitLod => .Image,
5057 .OpImageSparseSampleProjImplicitLod => .Image,
5058 .OpImageSparseSampleProjExplicitLod => .Image,
5059 .OpImageSparseSampleProjDrefImplicitLod => .Image,
5060 .OpImageSparseSampleProjDrefExplicitLod => .Image,
5061 .OpImageSparseFetch => .Image,
5062 .OpImageSparseGather => .Image,
5063 .OpImageSparseDrefGather => .Image,
5064 .OpImageSparseTexelsResident => .Image,
5065 .OpNoLine => .Debug,
5066 .OpAtomicFlagTestAndSet => .Atomic,
5067 .OpAtomicFlagClear => .Atomic,
5068 .OpImageSparseRead => .Image,
5069 .OpSizeOf => .Miscellaneous,
5070 .OpTypePipeStorage => .TypeDeclaration,
5071 .OpConstantPipeStorage => .Pipe,
5072 .OpCreatePipeFromPipeStorage => .Pipe,
5073 .OpGetKernelLocalSizeForSubgroupCount => .DeviceSideEnqueue,
5074 .OpGetKernelMaxNumSubgroups => .DeviceSideEnqueue,
5075 .OpTypeNamedBarrier => .TypeDeclaration,
5076 .OpNamedBarrierInitialize => .Barrier,
5077 .OpMemoryNamedBarrier => .Barrier,
5078 .OpModuleProcessed => .Debug,
5079 .OpExecutionModeId => .ModeSetting,
5080 .OpDecorateId => .Annotation,
5081 .OpGroupNonUniformElect => .NonUniform,
5082 .OpGroupNonUniformAll => .NonUniform,
5083 .OpGroupNonUniformAny => .NonUniform,
5084 .OpGroupNonUniformAllEqual => .NonUniform,
5085 .OpGroupNonUniformBroadcast => .NonUniform,
5086 .OpGroupNonUniformBroadcastFirst => .NonUniform,
5087 .OpGroupNonUniformBallot => .NonUniform,
5088 .OpGroupNonUniformInverseBallot => .NonUniform,
5089 .OpGroupNonUniformBallotBitExtract => .NonUniform,
5090 .OpGroupNonUniformBallotBitCount => .NonUniform,
5091 .OpGroupNonUniformBallotFindLSB => .NonUniform,
5092 .OpGroupNonUniformBallotFindMSB => .NonUniform,
5093 .OpGroupNonUniformShuffle => .NonUniform,
5094 .OpGroupNonUniformShuffleXor => .NonUniform,
5095 .OpGroupNonUniformShuffleUp => .NonUniform,
5096 .OpGroupNonUniformShuffleDown => .NonUniform,
5097 .OpGroupNonUniformIAdd => .NonUniform,
5098 .OpGroupNonUniformFAdd => .NonUniform,
5099 .OpGroupNonUniformIMul => .NonUniform,
5100 .OpGroupNonUniformFMul => .NonUniform,
5101 .OpGroupNonUniformSMin => .NonUniform,
5102 .OpGroupNonUniformUMin => .NonUniform,
5103 .OpGroupNonUniformFMin => .NonUniform,
5104 .OpGroupNonUniformSMax => .NonUniform,
5105 .OpGroupNonUniformUMax => .NonUniform,
5106 .OpGroupNonUniformFMax => .NonUniform,
5107 .OpGroupNonUniformBitwiseAnd => .NonUniform,
5108 .OpGroupNonUniformBitwiseOr => .NonUniform,
5109 .OpGroupNonUniformBitwiseXor => .NonUniform,
5110 .OpGroupNonUniformLogicalAnd => .NonUniform,
5111 .OpGroupNonUniformLogicalOr => .NonUniform,
5112 .OpGroupNonUniformLogicalXor => .NonUniform,
5113 .OpGroupNonUniformQuadBroadcast => .NonUniform,
5114 .OpGroupNonUniformQuadSwap => .NonUniform,
5115 .OpCopyLogical => .Composite,
5116 .OpPtrEqual => .Memory,
5117 .OpPtrNotEqual => .Memory,
5118 .OpPtrDiff => .Memory,
5119 .OpTerminateInvocation => .ControlFlow,
5120 .OpSubgroupBallotKHR => .Group,
5121 .OpSubgroupFirstInvocationKHR => .Group,
5122 .OpSubgroupAllKHR => .Group,
5123 .OpSubgroupAnyKHR => .Group,
5124 .OpSubgroupAllEqualKHR => .Group,
5125 .OpSubgroupReadInvocationKHR => .Group,
5126 .OpTraceRayKHR => .Reserved,
5127 .OpExecuteCallableKHR => .Reserved,
5128 .OpConvertUToAccelerationStructureKHR => .Reserved,
5129 .OpIgnoreIntersectionKHR => .Reserved,
5130 .OpTerminateRayKHR => .Reserved,
5131 .OpSDot => .Arithmetic,
5132 .OpUDot => .Arithmetic,
5133 .OpSUDot => .Arithmetic,
5134 .OpSDotAccSat => .Arithmetic,
5135 .OpUDotAccSat => .Arithmetic,
5136 .OpSUDotAccSat => .Arithmetic,
5137 .OpTypeRayQueryKHR => .Reserved,
5138 .OpRayQueryInitializeKHR => .Reserved,
5139 .OpRayQueryTerminateKHR => .Reserved,
5140 .OpRayQueryGenerateIntersectionKHR => .Reserved,
5141 .OpRayQueryConfirmIntersectionKHR => .Reserved,
5142 .OpRayQueryProceedKHR => .Reserved,
5143 .OpRayQueryGetIntersectionTypeKHR => .Reserved,
5144 .OpGroupIAddNonUniformAMD => .Group,
5145 .OpGroupFAddNonUniformAMD => .Group,
5146 .OpGroupFMinNonUniformAMD => .Group,
5147 .OpGroupUMinNonUniformAMD => .Group,
5148 .OpGroupSMinNonUniformAMD => .Group,
5149 .OpGroupFMaxNonUniformAMD => .Group,
5150 .OpGroupUMaxNonUniformAMD => .Group,
5151 .OpGroupSMaxNonUniformAMD => .Group,
5152 .OpFragmentMaskFetchAMD => .Reserved,
5153 .OpFragmentFetchAMD => .Reserved,
5154 .OpReadClockKHR => .Reserved,
5155 .OpImageSampleFootprintNV => .Image,
5156 .OpGroupNonUniformPartitionNV => .NonUniform,
5157 .OpWritePackedPrimitiveIndices4x8NV => .Reserved,
5158 .OpReportIntersectionKHR => .Reserved,
5159 .OpIgnoreIntersectionNV => .Reserved,
5160 .OpTerminateRayNV => .Reserved,
5161 .OpTraceNV => .Reserved,
5162 .OpTraceMotionNV => .Reserved,
5163 .OpTraceRayMotionNV => .Reserved,
5164 .OpTypeAccelerationStructureKHR => .Reserved,
5165 .OpExecuteCallableNV => .Reserved,
5166 .OpTypeCooperativeMatrixNV => .Reserved,
5167 .OpCooperativeMatrixLoadNV => .Reserved,
5168 .OpCooperativeMatrixStoreNV => .Reserved,
5169 .OpCooperativeMatrixMulAddNV => .Reserved,
5170 .OpCooperativeMatrixLengthNV => .Reserved,
5171 .OpBeginInvocationInterlockEXT => .Reserved,
5172 .OpEndInvocationInterlockEXT => .Reserved,
5173 .OpDemoteToHelperInvocation => .ControlFlow,
5174 .OpIsHelperInvocationEXT => .Reserved,
5175 .OpConvertUToImageNV => .Reserved,
5176 .OpConvertUToSamplerNV => .Reserved,
5177 .OpConvertImageToUNV => .Reserved,
5178 .OpConvertSamplerToUNV => .Reserved,
5179 .OpConvertUToSampledImageNV => .Reserved,
5180 .OpConvertSampledImageToUNV => .Reserved,
5181 .OpSamplerImageAddressingModeNV => .Reserved,
5182 .OpSubgroupShuffleINTEL => .Group,
5183 .OpSubgroupShuffleDownINTEL => .Group,
5184 .OpSubgroupShuffleUpINTEL => .Group,
5185 .OpSubgroupShuffleXorINTEL => .Group,
5186 .OpSubgroupBlockReadINTEL => .Group,
5187 .OpSubgroupBlockWriteINTEL => .Group,
5188 .OpSubgroupImageBlockReadINTEL => .Group,
5189 .OpSubgroupImageBlockWriteINTEL => .Group,
5190 .OpSubgroupImageMediaBlockReadINTEL => .Group,
5191 .OpSubgroupImageMediaBlockWriteINTEL => .Group,
5192 .OpUCountLeadingZerosINTEL => .Reserved,
5193 .OpUCountTrailingZerosINTEL => .Reserved,
5194 .OpAbsISubINTEL => .Reserved,
5195 .OpAbsUSubINTEL => .Reserved,
5196 .OpIAddSatINTEL => .Reserved,
5197 .OpUAddSatINTEL => .Reserved,
5198 .OpIAverageINTEL => .Reserved,
5199 .OpUAverageINTEL => .Reserved,
5200 .OpIAverageRoundedINTEL => .Reserved,
5201 .OpUAverageRoundedINTEL => .Reserved,
5202 .OpISubSatINTEL => .Reserved,
5203 .OpUSubSatINTEL => .Reserved,
5204 .OpIMul32x16INTEL => .Reserved,
5205 .OpUMul32x16INTEL => .Reserved,
5206 .OpAtomicFMinEXT => .Atomic,
5207 .OpAtomicFMaxEXT => .Atomic,
5208 .OpAssumeTrueKHR => .Miscellaneous,
5209 .OpExpectKHR => .Miscellaneous,
5210 .OpDecorateString => .Annotation,
5211 .OpMemberDecorateString => .Annotation,
5212 .OpLoopControlINTEL => .Reserved,
5213 .OpReadPipeBlockingINTEL => .Pipe,
5214 .OpWritePipeBlockingINTEL => .Pipe,
5215 .OpFPGARegINTEL => .Reserved,
5216 .OpRayQueryGetRayTMinKHR => .Reserved,
5217 .OpRayQueryGetRayFlagsKHR => .Reserved,
5218 .OpRayQueryGetIntersectionTKHR => .Reserved,
5219 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => .Reserved,
5220 .OpRayQueryGetIntersectionInstanceIdKHR => .Reserved,
5221 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => .Reserved,
5222 .OpRayQueryGetIntersectionGeometryIndexKHR => .Reserved,
5223 .OpRayQueryGetIntersectionPrimitiveIndexKHR => .Reserved,
5224 .OpRayQueryGetIntersectionBarycentricsKHR => .Reserved,
5225 .OpRayQueryGetIntersectionFrontFaceKHR => .Reserved,
5226 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => .Reserved,
5227 .OpRayQueryGetIntersectionObjectRayDirectionKHR => .Reserved,
5228 .OpRayQueryGetIntersectionObjectRayOriginKHR => .Reserved,
5229 .OpRayQueryGetWorldRayDirectionKHR => .Reserved,
5230 .OpRayQueryGetWorldRayOriginKHR => .Reserved,
5231 .OpRayQueryGetIntersectionObjectToWorldKHR => .Reserved,
5232 .OpRayQueryGetIntersectionWorldToObjectKHR => .Reserved,
5233 .OpAtomicFAddEXT => .Atomic,
5234 .OpTypeBufferSurfaceINTEL => .TypeDeclaration,
5235 .OpTypeStructContinuedINTEL => .TypeDeclaration,
5236 .OpConstantCompositeContinuedINTEL => .ConstantCreation,
5237 .OpSpecConstantCompositeContinuedINTEL => .ConstantCreation,
5238 };
5239 }
1207};5240};
1208pub const ImageOperands = packed struct {5241pub const ImageOperands = packed struct {
1209 Bias: bool = false,5242 Bias: bool = false,
...@@ -1220,9 +5253,9 @@ pub const ImageOperands = packed struct {...@@ -1220,9 +5253,9 @@ pub const ImageOperands = packed struct {
1220 VolatileTexel: bool = false,5253 VolatileTexel: bool = false,
1221 SignExtend: bool = false,5254 SignExtend: bool = false,
1222 ZeroExtend: bool = false,5255 ZeroExtend: bool = false,
1223 _reserved_bit_14: bool = false,5256 Nontemporal: bool = false,
1224 _reserved_bit_15: bool = false,5257 _reserved_bit_15: bool = false,
1225 _reserved_bit_16: bool = false,5258 Offsets: bool = false,
1226 _reserved_bit_17: bool = false,5259 _reserved_bit_17: bool = false,
1227 _reserved_bit_18: bool = false,5260 _reserved_bit_18: bool = false,
1228 _reserved_bit_19: bool = false,5261 _reserved_bit_19: bool = false,
...@@ -1259,9 +5292,9 @@ pub const ImageOperands = packed struct {...@@ -1259,9 +5292,9 @@ pub const ImageOperands = packed struct {
1259 VolatileTexel: bool = false,5292 VolatileTexel: bool = false,
1260 SignExtend: bool = false,5293 SignExtend: bool = false,
1261 ZeroExtend: bool = false,5294 ZeroExtend: bool = false,
1262 _reserved_bit_14: bool = false,5295 Nontemporal: bool = false,
1263 _reserved_bit_15: bool = false,5296 _reserved_bit_15: bool = false,
1264 _reserved_bit_16: bool = false,5297 Offsets: ?struct { id_ref: IdRef } = null,
1265 _reserved_bit_17: bool = false,5298 _reserved_bit_17: bool = false,
1266 _reserved_bit_18: bool = false,5299 _reserved_bit_18: bool = false,
1267 _reserved_bit_19: bool = false,5300 _reserved_bit_19: bool = false,
...@@ -1433,7 +5466,7 @@ pub const FunctionControl = packed struct {...@@ -1433,7 +5466,7 @@ pub const FunctionControl = packed struct {
1433 _reserved_bit_13: bool = false,5466 _reserved_bit_13: bool = false,
1434 _reserved_bit_14: bool = false,5467 _reserved_bit_14: bool = false,
1435 _reserved_bit_15: bool = false,5468 _reserved_bit_15: bool = false,
1436 _reserved_bit_16: bool = false,5469 OptNoneINTEL: bool = false,
1437 _reserved_bit_17: bool = false,5470 _reserved_bit_17: bool = false,
1438 _reserved_bit_18: bool = false,5471 _reserved_bit_18: bool = false,
1439 _reserved_bit_19: bool = false,5472 _reserved_bit_19: bool = false,
...@@ -1670,6 +5703,7 @@ pub const SourceLanguage = enum(u32) {...@@ -1670,6 +5703,7 @@ pub const SourceLanguage = enum(u32) {
1670 OpenCL_C = 3,5703 OpenCL_C = 3,
1671 OpenCL_CPP = 4,5704 OpenCL_CPP = 4,
1672 HLSL = 5,5705 HLSL = 5,
5706 CPP_for_OpenCL = 6,
1673};5707};
1674pub const ExecutionModel = enum(u32) {5708pub const ExecutionModel = enum(u32) {
1675 Vertex = 0,5709 Vertex = 0,
...@@ -1750,6 +5784,7 @@ pub const ExecutionMode = enum(u32) {...@@ -1750,6 +5784,7 @@ pub const ExecutionMode = enum(u32) {
1750 SubgroupsPerWorkgroupId = 37,5784 SubgroupsPerWorkgroupId = 37,
1751 LocalSizeId = 38,5785 LocalSizeId = 38,
1752 LocalSizeHintId = 39,5786 LocalSizeHintId = 39,
5787 SubgroupUniformControlFlowKHR = 4421,
1753 PostDepthCoverage = 4446,5788 PostDepthCoverage = 4446,
1754 DenormPreserve = 4459,5789 DenormPreserve = 4459,
1755 DenormFlushToZero = 4460,5790 DenormFlushToZero = 4460,
...@@ -1817,7 +5852,8 @@ pub const ExecutionMode = enum(u32) {...@@ -1817,7 +5852,8 @@ pub const ExecutionMode = enum(u32) {
1817 SubgroupsPerWorkgroup: struct { subgroups_per_workgroup: LiteralInteger },5852 SubgroupsPerWorkgroup: struct { subgroups_per_workgroup: LiteralInteger },
1818 SubgroupsPerWorkgroupId: struct { subgroups_per_workgroup: IdRef },5853 SubgroupsPerWorkgroupId: struct { subgroups_per_workgroup: IdRef },
1819 LocalSizeId: struct { x_size: IdRef, y_size: IdRef, z_size: IdRef },5854 LocalSizeId: struct { x_size: IdRef, y_size: IdRef, z_size: IdRef },
1820 LocalSizeHintId: struct { local_size_hint: IdRef },5855 LocalSizeHintId: struct { x_size_hint: IdRef, y_size_hint: IdRef, z_size_hint: IdRef },
5856 SubgroupUniformControlFlowKHR,
1821 PostDepthCoverage,5857 PostDepthCoverage,
1822 DenormPreserve: struct { target_width: LiteralInteger },5858 DenormPreserve: struct { target_width: LiteralInteger },
1823 DenormFlushToZero: struct { target_width: LiteralInteger },5859 DenormFlushToZero: struct { target_width: LiteralInteger },
...@@ -1996,10 +6032,26 @@ pub const FPDenormMode = enum(u32) {...@@ -1996,10 +6032,26 @@ pub const FPDenormMode = enum(u32) {
1996 Preserve = 0,6032 Preserve = 0,
1997 FlushToZero = 1,6033 FlushToZero = 1,
1998};6034};
6035pub const QuantizationModes = enum(u32) {
6036 TRN = 0,
6037 TRN_ZERO = 1,
6038 RND = 2,
6039 RND_ZERO = 3,
6040 RND_INF = 4,
6041 RND_MIN_INF = 5,
6042 RND_CONV = 6,
6043 RND_CONV_ODD = 7,
6044};
1999pub const FPOperationMode = enum(u32) {6045pub const FPOperationMode = enum(u32) {
2000 IEEE = 0,6046 IEEE = 0,
2001 ALT = 1,6047 ALT = 1,
2002};6048};
6049pub const OverflowModes = enum(u32) {
6050 WRAP = 0,
6051 SAT = 1,
6052 SAT_ZERO = 2,
6053 SAT_SYM = 3,
6054};
2003pub const LinkageType = enum(u32) {6055pub const LinkageType = enum(u32) {
2004 Export = 0,6056 Export = 0,
2005 Import = 1,6057 Import = 1,
...@@ -2078,10 +6130,14 @@ pub const Decoration = enum(u32) {...@@ -2078,10 +6130,14 @@ pub const Decoration = enum(u32) {
2078 PerPrimitiveNV = 5271,6130 PerPrimitiveNV = 5271,
2079 PerViewNV = 5272,6131 PerViewNV = 5272,
2080 PerTaskNV = 5273,6132 PerTaskNV = 5273,
2081 PerVertexNV = 5285,6133 PerVertexKHR = 5285,
2082 NonUniform = 5300,6134 NonUniform = 5300,
2083 RestrictPointer = 5355,6135 RestrictPointer = 5355,
2084 AliasedPointer = 5356,6136 AliasedPointer = 5356,
6137 BindlessSamplerNV = 5398,
6138 BindlessImageNV = 5399,
6139 BoundSamplerNV = 5400,
6140 BoundImageNV = 5401,
2085 SIMTCallINTEL = 5599,6141 SIMTCallINTEL = 5599,
2086 ReferencedIndirectlyINTEL = 5602,6142 ReferencedIndirectlyINTEL = 5602,
2087 ClobberINTEL = 5607,6143 ClobberINTEL = 5607,
...@@ -2119,7 +6175,9 @@ pub const Decoration = enum(u32) {...@@ -2119,7 +6175,9 @@ pub const Decoration = enum(u32) {
2119 FunctionFloatingPointModeINTEL = 6080,6175 FunctionFloatingPointModeINTEL = 6080,
2120 SingleElementVectorINTEL = 6085,6176 SingleElementVectorINTEL = 6085,
2121 VectorComputeCallableFunctionINTEL = 6087,6177 VectorComputeCallableFunctionINTEL = 6087,
6178 MediaBlockIOINTEL = 6140,
21226179
6180 pub const PerVertexNV = Decoration.PerVertexKHR;
2123 pub const NonUniformEXT = Decoration.NonUniform;6181 pub const NonUniformEXT = Decoration.NonUniform;
2124 pub const RestrictPointerEXT = Decoration.RestrictPointer;6182 pub const RestrictPointerEXT = Decoration.RestrictPointer;
2125 pub const AliasedPointerEXT = Decoration.AliasedPointer;6183 pub const AliasedPointerEXT = Decoration.AliasedPointer;
...@@ -2184,10 +6242,14 @@ pub const Decoration = enum(u32) {...@@ -2184,10 +6242,14 @@ pub const Decoration = enum(u32) {
2184 PerPrimitiveNV,6242 PerPrimitiveNV,
2185 PerViewNV,6243 PerViewNV,
2186 PerTaskNV,6244 PerTaskNV,
2187 PerVertexNV,6245 PerVertexKHR,
2188 NonUniform,6246 NonUniform,
2189 RestrictPointer,6247 RestrictPointer,
2190 AliasedPointer,6248 AliasedPointer,
6249 BindlessSamplerNV,
6250 BindlessImageNV,
6251 BoundSamplerNV,
6252 BoundImageNV,
2191 SIMTCallINTEL: struct { n: LiteralInteger },6253 SIMTCallINTEL: struct { n: LiteralInteger },
2192 ReferencedIndirectlyINTEL,6254 ReferencedIndirectlyINTEL,
2193 ClobberINTEL: struct { register: LiteralString },6255 ClobberINTEL: struct { register: LiteralString },
...@@ -2225,6 +6287,7 @@ pub const Decoration = enum(u32) {...@@ -2225,6 +6287,7 @@ pub const Decoration = enum(u32) {
2225 FunctionFloatingPointModeINTEL: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },6287 FunctionFloatingPointModeINTEL: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },
2226 SingleElementVectorINTEL,6288 SingleElementVectorINTEL,
2227 VectorComputeCallableFunctionINTEL,6289 VectorComputeCallableFunctionINTEL,
6290 MediaBlockIOINTEL,
2228 };6291 };
2229};6292};
2230pub const BuiltIn = enum(u32) {6293pub const BuiltIn = enum(u32) {
...@@ -2303,8 +6366,8 @@ pub const BuiltIn = enum(u32) {...@@ -2303,8 +6366,8 @@ pub const BuiltIn = enum(u32) {
2303 LayerPerViewNV = 5279,6366 LayerPerViewNV = 5279,
2304 MeshViewCountNV = 5280,6367 MeshViewCountNV = 5280,
2305 MeshViewIndicesNV = 5281,6368 MeshViewIndicesNV = 5281,
2306 BaryCoordNV = 5286,6369 BaryCoordKHR = 5286,
2307 BaryCoordNoPerspNV = 5287,6370 BaryCoordNoPerspKHR = 5287,
2308 FragSizeEXT = 5292,6371 FragSizeEXT = 5292,
2309 FragInvocationCountEXT = 5293,6372 FragInvocationCountEXT = 5293,
2310 LaunchIdKHR = 5319,6373 LaunchIdKHR = 5319,
...@@ -2320,6 +6383,7 @@ pub const BuiltIn = enum(u32) {...@@ -2320,6 +6383,7 @@ pub const BuiltIn = enum(u32) {
2320 WorldToObjectKHR = 5331,6383 WorldToObjectKHR = 5331,
2321 HitTNV = 5332,6384 HitTNV = 5332,
2322 HitKindKHR = 5333,6385 HitKindKHR = 5333,
6386 CurrentRayTimeNV = 5334,
2323 IncomingRayFlagsKHR = 5351,6387 IncomingRayFlagsKHR = 5351,
2324 RayGeometryIndexKHR = 5352,6388 RayGeometryIndexKHR = 5352,
2325 WarpsPerSMNV = 5374,6389 WarpsPerSMNV = 5374,
...@@ -2332,6 +6396,8 @@ pub const BuiltIn = enum(u32) {...@@ -2332,6 +6396,8 @@ pub const BuiltIn = enum(u32) {
2332 pub const SubgroupGtMaskKHR = BuiltIn.SubgroupGtMask;6396 pub const SubgroupGtMaskKHR = BuiltIn.SubgroupGtMask;
2333 pub const SubgroupLeMaskKHR = BuiltIn.SubgroupLeMask;6397 pub const SubgroupLeMaskKHR = BuiltIn.SubgroupLeMask;
2334 pub const SubgroupLtMaskKHR = BuiltIn.SubgroupLtMask;6398 pub const SubgroupLtMaskKHR = BuiltIn.SubgroupLtMask;
6399 pub const BaryCoordNV = BuiltIn.BaryCoordKHR;
6400 pub const BaryCoordNoPerspNV = BuiltIn.BaryCoordNoPerspKHR;
2335 pub const FragmentSizeNV = BuiltIn.FragSizeEXT;6401 pub const FragmentSizeNV = BuiltIn.FragSizeEXT;
2336 pub const InvocationsPerPixelNV = BuiltIn.FragInvocationCountEXT;6402 pub const InvocationsPerPixelNV = BuiltIn.FragInvocationCountEXT;
2337 pub const LaunchIdNV = BuiltIn.LaunchIdKHR;6403 pub const LaunchIdNV = BuiltIn.LaunchIdKHR;
...@@ -2443,6 +6509,7 @@ pub const Capability = enum(u32) {...@@ -2443,6 +6509,7 @@ pub const Capability = enum(u32) {
2443 GroupNonUniformQuad = 68,6509 GroupNonUniformQuad = 68,
2444 ShaderLayer = 69,6510 ShaderLayer = 69,
2445 ShaderViewportIndex = 70,6511 ShaderViewportIndex = 70,
6512 UniformDecoration = 71,
2446 FragmentShadingRateKHR = 4422,6513 FragmentShadingRateKHR = 4422,
2447 SubgroupBallotKHR = 4423,6514 SubgroupBallotKHR = 4423,
2448 DrawParameters = 4427,6515 DrawParameters = 4427,
...@@ -2488,7 +6555,7 @@ pub const Capability = enum(u32) {...@@ -2488,7 +6555,7 @@ pub const Capability = enum(u32) {
2488 FragmentFullyCoveredEXT = 5265,6555 FragmentFullyCoveredEXT = 5265,
2489 MeshShadingNV = 5266,6556 MeshShadingNV = 5266,
2490 ImageFootprintNV = 5282,6557 ImageFootprintNV = 5282,
2491 FragmentBarycentricNV = 5284,6558 FragmentBarycentricKHR = 5284,
2492 ComputeDerivativeGroupQuadsNV = 5288,6559 ComputeDerivativeGroupQuadsNV = 5288,
2493 FragmentDensityEXT = 5291,6560 FragmentDensityEXT = 5291,
2494 GroupNonUniformPartitionedNV = 5297,6561 GroupNonUniformPartitionedNV = 5297,
...@@ -2505,6 +6572,7 @@ pub const Capability = enum(u32) {...@@ -2505,6 +6572,7 @@ pub const Capability = enum(u32) {
2505 UniformTexelBufferArrayNonUniformIndexing = 5311,6572 UniformTexelBufferArrayNonUniformIndexing = 5311,
2506 StorageTexelBufferArrayNonUniformIndexing = 5312,6573 StorageTexelBufferArrayNonUniformIndexing = 5312,
2507 RayTracingNV = 5340,6574 RayTracingNV = 5340,
6575 RayTracingMotionBlurNV = 5341,
2508 VulkanMemoryModel = 5345,6576 VulkanMemoryModel = 5345,
2509 VulkanMemoryModelDeviceScope = 5346,6577 VulkanMemoryModelDeviceScope = 5346,
2510 PhysicalStorageBufferAddresses = 5347,6578 PhysicalStorageBufferAddresses = 5347,
...@@ -2515,7 +6583,8 @@ pub const Capability = enum(u32) {...@@ -2515,7 +6583,8 @@ pub const Capability = enum(u32) {
2515 FragmentShaderShadingRateInterlockEXT = 5372,6583 FragmentShaderShadingRateInterlockEXT = 5372,
2516 ShaderSMBuiltinsNV = 5373,6584 ShaderSMBuiltinsNV = 5373,
2517 FragmentShaderPixelInterlockEXT = 5378,6585 FragmentShaderPixelInterlockEXT = 5378,
2518 DemoteToHelperInvocationEXT = 5379,6586 DemoteToHelperInvocation = 5379,
6587 BindlessTextureNV = 5390,
2519 SubgroupShuffleINTEL = 5568,6588 SubgroupShuffleINTEL = 5568,
2520 SubgroupBufferBlockIOINTEL = 5569,6589 SubgroupBufferBlockIOINTEL = 5569,
2521 SubgroupImageBlockIOINTEL = 5570,6590 SubgroupImageBlockIOINTEL = 5570,
...@@ -2540,6 +6609,7 @@ pub const Capability = enum(u32) {...@@ -2540,6 +6609,7 @@ pub const Capability = enum(u32) {
2540 FPGAMemoryAttributesINTEL = 5824,6609 FPGAMemoryAttributesINTEL = 5824,
2541 FPFastMathModeINTEL = 5837,6610 FPFastMathModeINTEL = 5837,
2542 ArbitraryPrecisionIntegersINTEL = 5844,6611 ArbitraryPrecisionIntegersINTEL = 5844,
6612 ArbitraryPrecisionFloatingPointINTEL = 5845,
2543 UnstructuredLoopControlsINTEL = 5886,6613 UnstructuredLoopControlsINTEL = 5886,
2544 FPGALoopControlsINTEL = 5888,6614 FPGALoopControlsINTEL = 5888,
2545 KernelAttributesINTEL = 5892,6615 KernelAttributesINTEL = 5892,
...@@ -2548,17 +6618,27 @@ pub const Capability = enum(u32) {...@@ -2548,17 +6618,27 @@ pub const Capability = enum(u32) {
2548 FPGAClusterAttributesINTEL = 5904,6618 FPGAClusterAttributesINTEL = 5904,
2549 LoopFuseINTEL = 5906,6619 LoopFuseINTEL = 5906,
2550 FPGABufferLocationINTEL = 5920,6620 FPGABufferLocationINTEL = 5920,
6621 ArbitraryPrecisionFixedPointINTEL = 5922,
2551 USMStorageClassesINTEL = 5935,6622 USMStorageClassesINTEL = 5935,
2552 IOPipesINTEL = 5943,6623 IOPipesINTEL = 5943,
2553 BlockingPipesINTEL = 5945,6624 BlockingPipesINTEL = 5945,
2554 FPGARegINTEL = 5948,6625 FPGARegINTEL = 5948,
6626 DotProductInputAll = 6016,
6627 DotProductInput4x8Bit = 6017,
6628 DotProductInput4x8BitPacked = 6018,
6629 DotProduct = 6019,
6630 BitInstructions = 6025,
2555 AtomicFloat32AddEXT = 6033,6631 AtomicFloat32AddEXT = 6033,
2556 AtomicFloat64AddEXT = 6034,6632 AtomicFloat64AddEXT = 6034,
2557 LongConstantCompositeINTEL = 6089,6633 LongConstantCompositeINTEL = 6089,
6634 OptNoneINTEL = 6094,
6635 AtomicFloat16AddEXT = 6095,
6636 DebugInfoModuleINTEL = 6114,
25586637
2559 pub const StorageUniformBufferBlock16 = Capability.StorageBuffer16BitAccess;6638 pub const StorageUniformBufferBlock16 = Capability.StorageBuffer16BitAccess;
2560 pub const StorageUniform16 = Capability.UniformAndStorageBuffer16BitAccess;6639 pub const StorageUniform16 = Capability.UniformAndStorageBuffer16BitAccess;
2561 pub const ShaderViewportIndexLayerNV = Capability.ShaderViewportIndexLayerEXT;6640 pub const ShaderViewportIndexLayerNV = Capability.ShaderViewportIndexLayerEXT;
6641 pub const FragmentBarycentricNV = Capability.FragmentBarycentricKHR;
2562 pub const ShadingRateNV = Capability.FragmentDensityEXT;6642 pub const ShadingRateNV = Capability.FragmentDensityEXT;
2563 pub const ShaderNonUniformEXT = Capability.ShaderNonUniform;6643 pub const ShaderNonUniformEXT = Capability.ShaderNonUniform;
2564 pub const RuntimeDescriptorArrayEXT = Capability.RuntimeDescriptorArray;6644 pub const RuntimeDescriptorArrayEXT = Capability.RuntimeDescriptorArray;
...@@ -2575,6 +6655,11 @@ pub const Capability = enum(u32) {...@@ -2575,6 +6655,11 @@ pub const Capability = enum(u32) {
2575 pub const VulkanMemoryModelKHR = Capability.VulkanMemoryModel;6655 pub const VulkanMemoryModelKHR = Capability.VulkanMemoryModel;
2576 pub const VulkanMemoryModelDeviceScopeKHR = Capability.VulkanMemoryModelDeviceScope;6656 pub const VulkanMemoryModelDeviceScopeKHR = Capability.VulkanMemoryModelDeviceScope;
2577 pub const PhysicalStorageBufferAddressesEXT = Capability.PhysicalStorageBufferAddresses;6657 pub const PhysicalStorageBufferAddressesEXT = Capability.PhysicalStorageBufferAddresses;
6658 pub const DemoteToHelperInvocationEXT = Capability.DemoteToHelperInvocation;
6659 pub const DotProductInputAllKHR = Capability.DotProductInputAll;
6660 pub const DotProductInput4x8BitKHR = Capability.DotProductInput4x8Bit;
6661 pub const DotProductInput4x8BitPackedKHR = Capability.DotProductInput4x8BitPacked;
6662 pub const DotProductKHR = Capability.DotProduct;
2578};6663};
2579pub const RayQueryIntersection = enum(u32) {6664pub const RayQueryIntersection = enum(u32) {
2580 RayQueryCandidateIntersectionKHR = 0,6665 RayQueryCandidateIntersectionKHR = 0,
...@@ -2589,3 +6674,8 @@ pub const RayQueryCandidateIntersectionType = enum(u32) {...@@ -2589,3 +6674,8 @@ pub const RayQueryCandidateIntersectionType = enum(u32) {
2589 RayQueryCandidateIntersectionTriangleKHR = 0,6674 RayQueryCandidateIntersectionTriangleKHR = 0,
2590 RayQueryCandidateIntersectionAABBKHR = 1,6675 RayQueryCandidateIntersectionAABBKHR = 1,
2591};6676};
6677pub const PackedVectorFormat = enum(u32) {
6678 PackedVectorFormat4x8Bit = 0,
6679
6680 pub const PackedVectorFormat4x8BitKHR = PackedVectorFormat.PackedVectorFormat4x8Bit;
6681};
src/link/SpirV.zig+32-20
...@@ -58,13 +58,13 @@ decl_table: std.AutoArrayHashMapUnmanaged(Module.Decl.Index, DeclGenContext) = ....@@ -58,13 +58,13 @@ decl_table: std.AutoArrayHashMapUnmanaged(Module.Decl.Index, DeclGenContext) = .
5858
59const DeclGenContext = struct {59const DeclGenContext = struct {
60 air: Air,60 air: Air,
61 air_value_arena: ArenaAllocator.State,61 air_arena: ArenaAllocator.State,
62 liveness: Liveness,62 liveness: Liveness,
6363
64 fn deinit(self: *DeclGenContext, gpa: Allocator) void {64 fn deinit(self: *DeclGenContext, gpa: Allocator) void {
65 self.air.deinit(gpa);65 self.air.deinit(gpa);
66 self.liveness.deinit(gpa);66 self.liveness.deinit(gpa);
67 self.air_value_arena.promote(gpa).deinit();67 self.air_arena.promote(gpa).deinit();
68 self.* = undefined;68 self.* = undefined;
69 }69 }
70};70};
...@@ -140,7 +140,7 @@ pub fn updateFunc(self: *SpirV, module: *Module, func: *Module.Fn, air: Air, liv...@@ -140,7 +140,7 @@ pub fn updateFunc(self: *SpirV, module: *Module, func: *Module.Fn, air: Air, liv
140140
141 result.value_ptr.* = .{141 result.value_ptr.* = .{
142 .air = new_air,142 .air = new_air,
143 .air_value_arena = arena.state,143 .air_arena = arena.state,
144 .liveness = new_liveness,144 .liveness = new_liveness,
145 };145 };
146}146}
...@@ -167,13 +167,13 @@ pub fn updateDeclExports(...@@ -167,13 +167,13 @@ pub fn updateDeclExports(
167}167}
168168
169pub fn freeDecl(self: *SpirV, decl_index: Module.Decl.Index) void {169pub fn freeDecl(self: *SpirV, decl_index: Module.Decl.Index) void {
170 const index = self.decl_table.getIndex(decl_index).?;170 if (self.decl_table.getIndex(decl_index)) |index| {
171 const module = self.base.options.module.?;171 const module = self.base.options.module.?;
172 const decl = module.declPtr(decl_index);172 const decl = module.declPtr(decl_index);
173 if (decl.val.tag() == .function) {173 if (decl.val.tag() == .function) {
174 self.decl_table.values()[index].deinit(self.base.allocator);174 self.decl_table.values()[index].deinit(self.base.allocator);
175 }
175 }176 }
176 self.decl_table.swapRemoveAt(index);
177}177}
178178
179pub fn flush(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void {179pub fn flush(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.Node) link.File.FlushError!void {
...@@ -218,7 +218,7 @@ pub fn flushModule(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.No...@@ -218,7 +218,7 @@ pub fn flushModule(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.No
218 }218 }
219219
220 // Now, actually generate the code for all declarations.220 // Now, actually generate the code for all declarations.
221 var decl_gen = codegen.DeclGen.init(module, &spv);221 var decl_gen = codegen.DeclGen.init(self.base.allocator, module, &spv);
222 defer decl_gen.deinit();222 defer decl_gen.deinit();
223223
224 var it = self.decl_table.iterator();224 var it = self.decl_table.iterator();
...@@ -245,16 +245,18 @@ pub fn flushModule(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.No...@@ -245,16 +245,18 @@ pub fn flushModule(self: *SpirV, comp: *Compilation, prog_node: *std.Progress.No
245245
246fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {246fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {
247 // TODO: Integrate with a hypothetical feature system247 // TODO: Integrate with a hypothetical feature system
248 const cap: spec.Capability = switch (target.os.tag) {248 const caps: []const spec.Capability = switch (target.os.tag) {
249 .opencl => .Kernel,249 .opencl => &.{.Kernel},
250 .glsl450 => .Shader,250 .glsl450 => &.{.Shader},
251 .vulkan => .VulkanMemoryModel,251 .vulkan => &.{.Shader},
252 else => unreachable, // TODO252 else => unreachable, // TODO
253 };253 };
254254
255 try spv.sections.capabilities.emit(spv.gpa, .OpCapability, .{255 for (caps) |cap| {
256 .capability = cap,256 try spv.sections.capabilities.emit(spv.gpa, .OpCapability, .{
257 });257 .capability = cap,
258 });
259 }
258}260}
259261
260fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {262fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {
...@@ -271,7 +273,7 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {...@@ -271,7 +273,7 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {
271 const memory_model: spec.MemoryModel = switch (target.os.tag) {273 const memory_model: spec.MemoryModel = switch (target.os.tag) {
272 .opencl => .OpenCL,274 .opencl => .OpenCL,
273 .glsl450 => .GLSL450,275 .glsl450 => .GLSL450,
274 .vulkan => .Vulkan,276 .vulkan => .GLSL450,
275 else => unreachable,277 else => unreachable,
276 };278 };
277279
...@@ -296,17 +298,27 @@ fn cloneLiveness(l: Liveness, gpa: Allocator) !Liveness {...@@ -296,17 +298,27 @@ fn cloneLiveness(l: Liveness, gpa: Allocator) !Liveness {
296 };298 };
297}299}
298300
299fn cloneAir(air: Air, gpa: Allocator, value_arena: Allocator) !Air {301fn cloneAir(air: Air, gpa: Allocator, air_arena: Allocator) !Air {
300 const values = try gpa.alloc(Value, air.values.len);302 const values = try gpa.alloc(Value, air.values.len);
301 errdefer gpa.free(values);303 errdefer gpa.free(values);
302304
303 for (values) |*value, i| {305 for (values) |*value, i| {
304 value.* = try air.values[i].copy(value_arena);306 value.* = try air.values[i].copy(air_arena);
305 }307 }
306308
307 var instructions = try air.instructions.toMultiArrayList().clone(gpa);309 var instructions = try air.instructions.toMultiArrayList().clone(gpa);
308 errdefer instructions.deinit(gpa);310 errdefer instructions.deinit(gpa);
309311
312 const air_tags = instructions.items(.tag);
313 const air_datas = instructions.items(.data);
314
315 for (air_tags) |tag, i| {
316 switch (tag) {
317 .arg, .alloc, .ret_ptr, .const_ty => air_datas[i].ty = try air_datas[i].ty.copy(air_arena),
318 else => {},
319 }
320 }
321
310 return Air{322 return Air{
311 .instructions = instructions.slice(),323 .instructions = instructions.slice(),
312 .extra = try gpa.dupe(u32, air.extra),324 .extra = try gpa.dupe(u32, air.extra),
src/stage1/all_types.hpp+1-1
...@@ -99,7 +99,7 @@ enum AddressSpace {...@@ -99,7 +99,7 @@ enum AddressSpace {
99 AddressSpaceConstant,99 AddressSpaceConstant,
100 AddressSpaceParam,100 AddressSpaceParam,
101 AddressSpaceShared,101 AddressSpaceShared,
102 AddressSpaceLocal102 AddressSpaceLocal,
103};103};
104104
105// This one corresponds to the builtin.zig enum.105// This one corresponds to the builtin.zig enum.
tools/gen_spirv_spec.zig+174-1
...@@ -116,6 +116,31 @@ fn render(writer: anytype, allocator: Allocator, registry: g.CoreRegistry) !void...@@ -116,6 +116,31 @@ fn render(writer: anytype, allocator: Allocator, registry: g.CoreRegistry) !void
116 \\pub const PairIdRefLiteralInteger = struct { target: IdRef, member: LiteralInteger };116 \\pub const PairIdRefLiteralInteger = struct { target: IdRef, member: LiteralInteger };
117 \\pub const PairIdRefIdRef = [2]IdRef;117 \\pub const PairIdRefIdRef = [2]IdRef;
118 \\118 \\
119 \\pub const Quantifier = enum {
120 \\ required,
121 \\ optional,
122 \\ variadic,
123 \\};
124 \\
125 \\pub const Operand = struct {
126 \\ kind: OperandKind,
127 \\ quantifier: Quantifier,
128 \\};
129 \\
130 \\pub const OperandCategory = enum {
131 \\ bit_enum,
132 \\ value_enum,
133 \\ id,
134 \\ literal,
135 \\ composite,
136 \\};
137 \\
138 \\pub const Enumerant = struct {
139 \\ name: []const u8,
140 \\ value: Word,
141 \\ parameters: []const OperandKind,
142 \\};
143 \\
119 \\144 \\
120 );145 );
121146
...@@ -123,14 +148,118 @@ fn render(writer: anytype, allocator: Allocator, registry: g.CoreRegistry) !void...@@ -123,14 +148,118 @@ fn render(writer: anytype, allocator: Allocator, registry: g.CoreRegistry) !void
123 \\pub const version = Version{{ .major = {}, .minor = {}, .patch = {} }};148 \\pub const version = Version{{ .major = {}, .minor = {}, .patch = {} }};
124 \\pub const magic_number: Word = {s};149 \\pub const magic_number: Word = {s};
125 \\150 \\
151 \\
126 ,152 ,
127 .{ registry.major_version, registry.minor_version, registry.revision, registry.magic_number },153 .{ registry.major_version, registry.minor_version, registry.revision, registry.magic_number },
128 );154 );
155
129 const extended_structs = try extendedStructs(allocator, registry.operand_kinds);156 const extended_structs = try extendedStructs(allocator, registry.operand_kinds);
157 try renderClass(writer, allocator, registry.instructions);
158 try renderOperandKind(writer, registry.operand_kinds);
130 try renderOpcodes(writer, allocator, registry.instructions, extended_structs);159 try renderOpcodes(writer, allocator, registry.instructions, extended_structs);
131 try renderOperandKinds(writer, allocator, registry.operand_kinds, extended_structs);160 try renderOperandKinds(writer, allocator, registry.operand_kinds, extended_structs);
132}161}
133162
163fn renderClass(writer: anytype, allocator: Allocator, instructions: []const g.Instruction) !void {
164 var class_map = std.StringArrayHashMap(void).init(allocator);
165
166 for (instructions) |inst| {
167 if (std.mem.eql(u8, inst.class.?, "@exclude")) {
168 continue;
169 }
170 try class_map.put(inst.class.?, {});
171 }
172
173 try writer.writeAll("pub const Class = enum {\n");
174 for (class_map.keys()) |class| {
175 try renderInstructionClass(writer, class);
176 try writer.writeAll(",\n");
177 }
178 try writer.writeAll("};\n");
179}
180
181fn renderInstructionClass(writer: anytype, class: []const u8) !void {
182 // Just assume that these wont clobber zig builtin types.
183 var prev_was_sep = true;
184 for (class) |c| {
185 switch (c) {
186 '-', '_' => prev_was_sep = true,
187 else => if (prev_was_sep) {
188 try writer.writeByte(std.ascii.toUpper(c));
189 prev_was_sep = false;
190 } else {
191 try writer.writeByte(std.ascii.toLower(c));
192 },
193 }
194 }
195}
196
197fn renderOperandKind(writer: anytype, operands: []const g.OperandKind) !void {
198 try writer.writeAll("pub const OperandKind = enum {\n");
199 for (operands) |operand| {
200 try writer.print("{},\n", .{std.zig.fmtId(operand.kind)});
201 }
202 try writer.writeAll(
203 \\
204 \\pub fn category(self: OperandKind) OperandCategory {
205 \\return switch (self) {
206 \\
207 );
208 for (operands) |operand| {
209 const cat = switch (operand.category) {
210 .BitEnum => "bit_enum",
211 .ValueEnum => "value_enum",
212 .Id => "id",
213 .Literal => "literal",
214 .Composite => "composite",
215 };
216 try writer.print(".{} => .{s},\n", .{ std.zig.fmtId(operand.kind), cat });
217 }
218 try writer.writeAll(
219 \\};
220 \\}
221 \\pub fn enumerants(self: OperandKind) []const Enumerant {
222 \\return switch (self) {
223 \\
224 );
225 for (operands) |operand| {
226 switch (operand.category) {
227 .BitEnum, .ValueEnum => {},
228 else => {
229 try writer.print(".{} => unreachable,\n", .{std.zig.fmtId(operand.kind)});
230 continue;
231 },
232 }
233
234 try writer.print(".{} => &[_]Enumerant{{", .{std.zig.fmtId(operand.kind)});
235 for (operand.enumerants.?) |enumerant| {
236 if (enumerant.value == .bitflag and std.mem.eql(u8, enumerant.enumerant, "None")) {
237 continue;
238 }
239 try renderEnumerant(writer, enumerant);
240 try writer.writeAll(",");
241 }
242 try writer.writeAll("},\n");
243 }
244 try writer.writeAll("};\n}\n};\n");
245}
246
247fn renderEnumerant(writer: anytype, enumerant: g.Enumerant) !void {
248 try writer.print(".{{.name = \"{s}\", .value = ", .{enumerant.enumerant});
249 switch (enumerant.value) {
250 .bitflag => |flag| try writer.writeAll(flag),
251 .int => |int| try writer.print("{}", .{int}),
252 }
253 try writer.writeAll(", .parameters = &[_]OperandKind{");
254 for (enumerant.parameters) |param, i| {
255 if (i != 0)
256 try writer.writeAll(", ");
257 // Note, param.quantifier will always be one.
258 try writer.print(".{}", .{std.zig.fmtId(param.kind)});
259 }
260 try writer.writeAll("}}");
261}
262
134fn renderOpcodes(263fn renderOpcodes(
135 writer: anytype,264 writer: anytype,
136 allocator: Allocator,265 allocator: Allocator,
...@@ -144,6 +273,9 @@ fn renderOpcodes(...@@ -144,6 +273,9 @@ fn renderOpcodes(
144 try aliases.ensureTotalCapacity(instructions.len);273 try aliases.ensureTotalCapacity(instructions.len);
145274
146 for (instructions) |inst, i| {275 for (instructions) |inst, i| {
276 if (std.mem.eql(u8, inst.class.?, "@exclude")) {
277 continue;
278 }
147 const result = inst_map.getOrPutAssumeCapacity(inst.opcode);279 const result = inst_map.getOrPutAssumeCapacity(inst.opcode);
148 if (!result.found_existing) {280 if (!result.found_existing) {
149 result.value_ptr.* = i;281 result.value_ptr.* = i;
...@@ -192,6 +324,47 @@ fn renderOpcodes(...@@ -192,6 +324,47 @@ fn renderOpcodes(
192 const inst = instructions[i];324 const inst = instructions[i];
193 try renderOperand(writer, .instruction, inst.opname, inst.operands, extended_structs);325 try renderOperand(writer, .instruction, inst.opname, inst.operands, extended_structs);
194 }326 }
327
328 try writer.writeAll(
329 \\};
330 \\}
331 \\pub fn operands(self: Opcode) []const Operand {
332 \\return switch (self) {
333 \\
334 );
335
336 for (instructions_indices) |i| {
337 const inst = instructions[i];
338 try writer.print(".{} => &[_]Operand{{", .{std.zig.fmtId(inst.opname)});
339 for (inst.operands) |operand| {
340 const quantifier = if (operand.quantifier) |q|
341 switch (q) {
342 .@"?" => "optional",
343 .@"*" => "variadic",
344 }
345 else
346 "required";
347
348 try writer.print(".{{.kind = .{s}, .quantifier = .{s}}},", .{ operand.kind, quantifier });
349 }
350 try writer.writeAll("},\n");
351 }
352
353 try writer.writeAll(
354 \\};
355 \\}
356 \\pub fn class(self: Opcode) Class {
357 \\return switch (self) {
358 \\
359 );
360
361 for (instructions_indices) |i| {
362 const inst = instructions[i];
363 try writer.print(".{} => .", .{std.zig.fmtId(inst.opname)});
364 try renderInstructionClass(writer, inst.class.?);
365 try writer.writeAll(",\n");
366 }
367
195 try writer.writeAll("};\n}\n};\n");368 try writer.writeAll("};\n}\n};\n");
196}369}
197370
...@@ -298,7 +471,7 @@ fn renderBitEnum(...@@ -298,7 +471,7 @@ fn renderBitEnum(
298 for (enumerants) |enumerant, i| {471 for (enumerants) |enumerant, i| {
299 if (enumerant.value != .bitflag) return error.InvalidRegistry;472 if (enumerant.value != .bitflag) return error.InvalidRegistry;
300 const value = try parseHexInt(enumerant.value.bitflag);473 const value = try parseHexInt(enumerant.value.bitflag);
301 if (@popCount(value) == 0) {474 if (value == 0) {
302 continue; // Skip 'none' items475 continue; // Skip 'none' items
303 }476 }
304477
tools/update_spirv_features.zig+4-1
...@@ -117,7 +117,10 @@ pub fn main() !void {...@@ -117,7 +117,10 @@ pub fn main() !void {
117 try w.writeAll(117 try w.writeAll(
118 \\};118 \\};
119 \\119 \\
120 \\pub usingnamespace CpuFeature.feature_set_fns(Feature);120 \\pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
121 \\pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
122 \\pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
123 \\pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
121 \\124 \\
122 \\pub const all_features = blk: {125 \\pub const all_features = blk: {
123 \\ @setEvalBranchQuota(2000);126 \\ @setEvalBranchQuota(2000);