authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-03 13:16:35+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-03 13:16:49+03:30
log246e1de55485b0b4e9392529778b8f50275e204a
tree3a9095b18eec5012d2728f68bef452010497f419
parent58b9200106c0eb721a13aea13e4ce55c4c0e340b
signaturelock-open Commit is signed but in an unrecognized format.

Watch: do not fail when file is removed

before this we would get a crash

19 files changed, 26949 insertions(+), 26943 deletions(-)

lib/std/Build/Watch.zig+7-1
...@@ -171,7 +171,13 @@ const Os = switch (builtin.os.tag) {...@@ -171,7 +171,13 @@ const Os = switch (builtin.os.tag) {
171 const gop = try w.dir_table.getOrPut(gpa, path);171 const gop = try w.dir_table.getOrPut(gpa, path);
172 if (!gop.found_existing) {172 if (!gop.found_existing) {
173 var mount_id: MountId = undefined;173 var mount_id: MountId = undefined;
174 const dir_handle = try Os.getDirHandle(gpa, path, &mount_id);174 const dir_handle = Os.getDirHandle(gpa, path, &mount_id) catch |err| switch (err) {
175 error.FileNotFound => {
176 std.debug.assert(w.dir_table.swapRemove(path));
177 continue;
178 },
179 else => return err,
180 };
175 const fan_fd = blk: {181 const fan_fd = blk: {
176 const fd_gop = try w.os.poll_fds.getOrPut(gpa, mount_id);182 const fd_gop = try w.os.poll_fds.getOrPut(gpa, mount_id);
177 if (!fd_gop.found_existing) {183 if (!fd_gop.found_existing) {
src/Zcu.zig+1
...@@ -3646,6 +3646,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 {...@@ -3646,6 +3646,7 @@ pub fn errorSetBits(zcu: *const Zcu) u16 {
36463646
3647 if (zcu.error_limit == 0) return 0;3647 if (zcu.error_limit == 0) return 0;
3648 if (target.cpu.arch.isSpirV()) {3648 if (target.cpu.arch.isSpirV()) {
3649 // As expected by https://github.com/Snektron/zig-spirv-test-executor
3649 if (zcu.comp.config.is_test) return 32;3650 if (zcu.comp.config.is_test) return 32;
3650 }3651 }
36513652
src/arch/spirv/Assembler.zig deleted-1087
...@@ -1,1087 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const assert = std.debug.assert;
4
5const CodeGen = @import("CodeGen.zig");
6const Decl = @import("Module.zig").Decl;
7
8const spec = @import("spec.zig");
9const Opcode = spec.Opcode;
10const Word = spec.Word;
11const Id = spec.Id;
12const StorageClass = spec.StorageClass;
13
14const Assembler = @This();
15
16cg: *CodeGen,
17errors: std.ArrayListUnmanaged(ErrorMsg) = .empty,
18src: []const u8 = undefined,
19/// `self.src` tokenized.
20tokens: std.ArrayListUnmanaged(Token) = .empty,
21current_token: u32 = 0,
22/// The instruction that is currently being parsed or has just been parsed.
23inst: struct {
24 opcode: Opcode = undefined,
25 operands: std.ArrayListUnmanaged(Operand) = .empty,
26 string_bytes: std.ArrayListUnmanaged(u8) = .empty,
27
28 fn result(self: @This()) ?AsmValue.Ref {
29 for (self.operands.items[0..@min(self.operands.items.len, 2)]) |op| {
30 switch (op) {
31 .result_id => |index| return index,
32 else => {},
33 }
34 }
35 return null;
36 }
37} = .{},
38value_map: std.StringArrayHashMapUnmanaged(AsmValue) = .{},
39inst_map: std.StringArrayHashMapUnmanaged(void) = .empty,
40
41const Operand = union(enum) {
42 /// Any 'simple' 32-bit value. This could be a mask or
43 /// enumerant, etc, depending on the operands.
44 value: u32,
45 /// An int- or float literal encoded as 1 word.
46 literal32: u32,
47 /// An int- or float literal encoded as 2 words.
48 literal64: u64,
49 /// A result-id which is assigned to in this instruction.
50 /// If present, this is the first operand of the instruction.
51 result_id: AsmValue.Ref,
52 /// A result-id which referred to (not assigned to) in this instruction.
53 ref_id: AsmValue.Ref,
54 /// Offset into `inst.string_bytes`. The string ends at the next zero-terminator.
55 string: u32,
56};
57
58pub fn deinit(self: *Assembler) void {
59 const gpa = self.cg.module.gpa;
60 for (self.errors.items) |err| gpa.free(err.msg);
61 self.tokens.deinit(gpa);
62 self.errors.deinit(gpa);
63 self.inst.operands.deinit(gpa);
64 self.inst.string_bytes.deinit(gpa);
65 self.value_map.deinit(gpa);
66 self.inst_map.deinit(gpa);
67}
68
69const Error = error{ AssembleFail, OutOfMemory };
70
71pub fn assemble(self: *Assembler, src: []const u8) Error!void {
72 const gpa = self.cg.module.gpa;
73
74 self.src = src;
75 self.errors.clearRetainingCapacity();
76
77 // Populate the opcode map if it isn't already
78 if (self.inst_map.count() == 0) {
79 const instructions = spec.InstructionSet.core.instructions();
80 try self.inst_map.ensureUnusedCapacity(gpa, @intCast(instructions.len));
81 for (spec.InstructionSet.core.instructions(), 0..) |inst, i| {
82 const entry = try self.inst_map.getOrPut(gpa, inst.name);
83 assert(entry.index == i);
84 }
85 }
86
87 try self.tokenize();
88 while (!self.testToken(.eof)) {
89 try self.parseInstruction();
90 try self.processInstruction();
91 }
92
93 if (self.errors.items.len > 0) return error.AssembleFail;
94}
95
96const ErrorMsg = struct {
97 /// The offset in bytes from the start of `src` that this error occured.
98 byte_offset: u32,
99 msg: []const u8,
100};
101
102fn addError(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) !void {
103 const gpa = self.cg.module.gpa;
104 const msg = try std.fmt.allocPrint(gpa, fmt, args);
105 errdefer gpa.free(msg);
106 try self.errors.append(gpa, .{
107 .byte_offset = offset,
108 .msg = msg,
109 });
110}
111
112fn fail(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) Error {
113 try self.addError(offset, fmt, args);
114 return error.AssembleFail;
115}
116
117fn todo(self: *Assembler, comptime fmt: []const u8, args: anytype) Error {
118 return self.fail(0, "todo: " ++ fmt, args);
119}
120
121const AsmValue = union(enum) {
122 /// The results are stored in an array hash map, and can be referred
123 /// to either by name (without the %), or by values of this index type.
124 pub const Ref = u32;
125
126 /// The RHS of the current instruction.
127 just_declared,
128 /// A placeholder for ref-ids of which the result-id is not yet known.
129 /// It will be further resolved at a later stage to a more concrete forward reference.
130 unresolved_forward_reference,
131 /// A normal result produced by a different instruction.
132 value: Id,
133 /// A type registered into the module's type system.
134 ty: Id,
135 /// A pre-supplied constant integer value.
136 constant: u32,
137 string: []const u8,
138
139 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue
140 /// is of a variant that allows the result to be obtained (not an unresolved
141 /// forward declaration, not in the process of being declared, etc).
142 pub fn resultId(self: AsmValue) Id {
143 return switch (self) {
144 .just_declared,
145 .unresolved_forward_reference,
146 // TODO: Lower this value as constant?
147 .constant,
148 .string,
149 => unreachable,
150 .value => |result| result,
151 .ty => |result| result,
152 };
153 }
154};
155
156/// Attempt to process the instruction currently in `self.inst`.
157/// This for example emits the instruction in the module or function, or
158/// records type definitions.
159/// If this function returns `error.AssembleFail`, an explanatory
160/// error message has already been emitted into `self.errors`.
161fn processInstruction(self: *Assembler) !void {
162 const module = self.cg.module;
163 const result: AsmValue = switch (self.inst.opcode) {
164 .OpEntryPoint => {
165 return self.fail(self.currentToken().start, "cannot export entry points in assembly", .{});
166 },
167 .OpExecutionMode, .OpExecutionModeId => {
168 return self.fail(self.currentToken().start, "cannot set execution mode in assembly", .{});
169 },
170 .OpCapability => {
171 try module.addCapability(@enumFromInt(self.inst.operands.items[0].value));
172 return;
173 },
174 .OpExtension => {
175 const ext_name_offset = self.inst.operands.items[0].string;
176 const ext_name = std.mem.sliceTo(self.inst.string_bytes.items[ext_name_offset..], 0);
177 try module.addExtension(ext_name);
178 return;
179 },
180 .OpExtInstImport => blk: {
181 const set_name_offset = self.inst.operands.items[1].string;
182 const set_name = std.mem.sliceTo(self.inst.string_bytes.items[set_name_offset..], 0);
183 const set_tag = std.meta.stringToEnum(spec.InstructionSet, set_name) orelse {
184 return self.fail(set_name_offset, "unknown instruction set: {s}", .{set_name});
185 };
186 break :blk .{ .value = try module.importInstructionSet(set_tag) };
187 },
188 else => switch (self.inst.opcode.class()) {
189 .type_declaration => try self.processTypeInstruction(),
190 else => (try self.processGenericInstruction()) orelse return,
191 },
192 };
193
194 const result_ref = self.inst.result().?;
195 switch (self.value_map.values()[result_ref]) {
196 .just_declared => self.value_map.values()[result_ref] = result,
197 else => {
198 // TODO: Improve source location.
199 const name = self.value_map.keys()[result_ref];
200 return self.fail(0, "duplicate definition of %{s}", .{name});
201 },
202 }
203}
204
205fn processTypeInstruction(self: *Assembler) !AsmValue {
206 const gpa = self.cg.module.gpa;
207 const module = self.cg.module;
208 const operands = self.inst.operands.items;
209 const section = &module.sections.globals;
210 const id = switch (self.inst.opcode) {
211 .OpTypeVoid => try module.voidType(),
212 .OpTypeBool => try module.boolType(),
213 .OpTypeInt => blk: {
214 const signedness: std.builtin.Signedness = switch (operands[2].literal32) {
215 0 => .unsigned,
216 1 => .signed,
217 else => {
218 // TODO: Improve source location.
219 return self.fail(0, "{} is not a valid signedness (expected 0 or 1)", .{operands[2].literal32});
220 },
221 };
222 const width = std.math.cast(u16, operands[1].literal32) orelse {
223 return self.fail(0, "int type of {} bits is too large", .{operands[1].literal32});
224 };
225 break :blk try module.intType(signedness, width);
226 },
227 .OpTypeFloat => blk: {
228 const bits = operands[1].literal32;
229 switch (bits) {
230 16, 32, 64 => {},
231 else => {
232 return self.fail(0, "{} is not a valid bit count for floats (expected 16, 32 or 64)", .{bits});
233 },
234 }
235 break :blk try module.floatType(@intCast(bits));
236 },
237 .OpTypeVector => blk: {
238 const child_type = try self.resolveRefId(operands[1].ref_id);
239 break :blk try module.vectorType(operands[2].literal32, child_type);
240 },
241 .OpTypeArray => {
242 // TODO: The length of an OpTypeArray is determined by a constant (which may be a spec constant),
243 // and so some consideration must be taken when entering this in the type system.
244 return self.todo("process OpTypeArray", .{});
245 },
246 .OpTypeRuntimeArray => blk: {
247 const element_type = try self.resolveRefId(operands[1].ref_id);
248 const result_id = module.allocId();
249 try section.emit(module.gpa, .OpTypeRuntimeArray, .{
250 .id_result = result_id,
251 .element_type = element_type,
252 });
253 break :blk result_id;
254 },
255 .OpTypePointer => blk: {
256 const storage_class: StorageClass = @enumFromInt(operands[1].value);
257 const child_type = try self.resolveRefId(operands[2].ref_id);
258 const result_id = module.allocId();
259 try section.emit(module.gpa, .OpTypePointer, .{
260 .id_result = result_id,
261 .storage_class = storage_class,
262 .type = child_type,
263 });
264 break :blk result_id;
265 },
266 .OpTypeStruct => blk: {
267 const ids = try gpa.alloc(Id, operands[1..].len);
268 defer gpa.free(ids);
269 for (operands[1..], ids) |op, *id| id.* = try self.resolveRefId(op.ref_id);
270 break :blk try module.structType(ids, null, null, .none);
271 },
272 .OpTypeImage => blk: {
273 const sampled_type = try self.resolveRefId(operands[1].ref_id);
274 const result_id = module.allocId();
275 try section.emit(gpa, .OpTypeImage, .{
276 .id_result = result_id,
277 .sampled_type = sampled_type,
278 .dim = @enumFromInt(operands[2].value),
279 .depth = operands[3].literal32,
280 .arrayed = operands[4].literal32,
281 .ms = operands[5].literal32,
282 .sampled = operands[6].literal32,
283 .image_format = @enumFromInt(operands[7].value),
284 });
285 break :blk result_id;
286 },
287 .OpTypeSampler => blk: {
288 const result_id = module.allocId();
289 try section.emit(gpa, .OpTypeSampler, .{ .id_result = result_id });
290 break :blk result_id;
291 },
292 .OpTypeSampledImage => blk: {
293 const image_type = try self.resolveRefId(operands[1].ref_id);
294 const result_id = module.allocId();
295 try section.emit(gpa, .OpTypeSampledImage, .{ .id_result = result_id, .image_type = image_type });
296 break :blk result_id;
297 },
298 .OpTypeFunction => blk: {
299 const param_operands = operands[2..];
300 const return_type = try self.resolveRefId(operands[1].ref_id);
301
302 const param_types = try module.gpa.alloc(Id, param_operands.len);
303 defer module.gpa.free(param_types);
304 for (param_types, param_operands) |*param, operand| {
305 param.* = try self.resolveRefId(operand.ref_id);
306 }
307 const result_id = module.allocId();
308 try section.emit(module.gpa, .OpTypeFunction, .{
309 .id_result = result_id,
310 .return_type = return_type,
311 .id_ref_2 = param_types,
312 });
313 break :blk result_id;
314 },
315 else => return self.todo("process type instruction {s}", .{@tagName(self.inst.opcode)}),
316 };
317
318 return .{ .ty = id };
319}
320
321/// - No forward references are allowed in operands.
322/// - Target section is determined from instruction type.
323fn processGenericInstruction(self: *Assembler) !?AsmValue {
324 const module = self.cg.module;
325 const target = module.zcu.getTarget();
326 const operands = self.inst.operands.items;
327 var maybe_spv_decl_index: ?Decl.Index = null;
328 const section = switch (self.inst.opcode.class()) {
329 .constant_creation => &module.sections.globals,
330 .annotation => &module.sections.annotations,
331 .type_declaration => unreachable, // Handled elsewhere.
332 else => switch (self.inst.opcode) {
333 .OpEntryPoint => unreachable,
334 .OpExecutionMode, .OpExecutionModeId => &module.sections.execution_modes,
335 .OpVariable => section: {
336 const storage_class: spec.StorageClass = @enumFromInt(operands[2].value);
337 if (storage_class == .function) break :section &self.cg.prologue;
338 maybe_spv_decl_index = try module.allocDecl(.global);
339 if (!target.cpu.has(.spirv, .v1_4) and storage_class != .input and storage_class != .output) {
340 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
341 break :section &module.sections.globals;
342 }
343 try self.cg.decl_deps.put(module.gpa, maybe_spv_decl_index.?, {});
344 try module.declareDeclDeps(maybe_spv_decl_index.?, &.{});
345 break :section &module.sections.globals;
346 },
347 else => &self.cg.body,
348 },
349 };
350
351 var maybe_result_id: ?Id = null;
352 const first_word = section.instructions.items.len;
353 // At this point we're not quite sure how many operands this instruction is
354 // going to have, so insert 0 and patch up the actual opcode word later.
355 try section.ensureUnusedCapacity(module.gpa, 1);
356 section.writeWord(0);
357
358 for (operands) |operand| {
359 switch (operand) {
360 .value, .literal32 => |word| {
361 try section.ensureUnusedCapacity(module.gpa, 1);
362 section.writeWord(word);
363 },
364 .literal64 => |dword| {
365 try section.ensureUnusedCapacity(module.gpa, 2);
366 section.writeDoubleWord(dword);
367 },
368 .result_id => {
369 maybe_result_id = if (maybe_spv_decl_index) |spv_decl_index|
370 module.declPtr(spv_decl_index).result_id
371 else
372 module.allocId();
373 try section.ensureUnusedCapacity(module.gpa, 1);
374 section.writeOperand(Id, maybe_result_id.?);
375 },
376 .ref_id => |index| {
377 const result = try self.resolveRef(index);
378 try section.ensureUnusedCapacity(module.gpa, 1);
379 section.writeOperand(spec.Id, result.resultId());
380 },
381 .string => |offset| {
382 const text = std.mem.sliceTo(self.inst.string_bytes.items[offset..], 0);
383 const size = std.math.divCeil(usize, text.len + 1, @sizeOf(Word)) catch unreachable;
384 try section.ensureUnusedCapacity(module.gpa, size);
385 section.writeOperand(spec.LiteralString, text);
386 },
387 }
388 }
389
390 const actual_word_count = section.instructions.items.len - first_word;
391 section.instructions.items[first_word] |= @as(u32, @as(u16, @intCast(actual_word_count))) << 16 | @intFromEnum(self.inst.opcode);
392
393 if (maybe_result_id) |result| return .{ .value = result };
394 return null;
395}
396
397fn resolveMaybeForwardRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
398 const value = self.value_map.values()[ref];
399 switch (value) {
400 .just_declared => {
401 const name = self.value_map.keys()[ref];
402 // TODO: Improve source location.
403 return self.fail(0, "self-referential parameter %{s}", .{name});
404 },
405 else => return value,
406 }
407}
408
409fn resolveRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
410 const value = try self.resolveMaybeForwardRef(ref);
411 switch (value) {
412 .just_declared => unreachable,
413 .unresolved_forward_reference => {
414 const name = self.value_map.keys()[ref];
415 // TODO: Improve source location.
416 return self.fail(0, "reference to undeclared result-id %{s}", .{name});
417 },
418 else => return value,
419 }
420}
421
422fn resolveRefId(self: *Assembler, ref: AsmValue.Ref) !Id {
423 const value = try self.resolveRef(ref);
424 return value.resultId();
425}
426
427fn parseInstruction(self: *Assembler) !void {
428 const gpa = self.cg.module.gpa;
429
430 self.inst.opcode = undefined;
431 self.inst.operands.clearRetainingCapacity();
432 self.inst.string_bytes.clearRetainingCapacity();
433
434 const lhs_result_tok = self.currentToken();
435 const maybe_lhs_result: ?AsmValue.Ref = if (self.eatToken(.result_id_assign)) blk: {
436 const name = self.tokenText(lhs_result_tok)[1..];
437 const entry = try self.value_map.getOrPut(gpa, name);
438 try self.expectToken(.equals);
439 if (!entry.found_existing) {
440 entry.value_ptr.* = .just_declared;
441 }
442 break :blk @intCast(entry.index);
443 } else null;
444
445 const opcode_tok = self.currentToken();
446 if (maybe_lhs_result != null) {
447 try self.expectToken(.opcode);
448 } else if (!self.eatToken(.opcode)) {
449 return self.fail(opcode_tok.start, "expected start of instruction, found {s}", .{opcode_tok.tag.name()});
450 }
451
452 const opcode_text = self.tokenText(opcode_tok);
453 const index = self.inst_map.getIndex(opcode_text) orelse {
454 return self.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
455 };
456
457 const inst = spec.InstructionSet.core.instructions()[index];
458 self.inst.opcode = @enumFromInt(inst.opcode);
459
460 const expected_operands = inst.operands;
461 // This is a loop because the result-id is not always the first operand.
462 const requires_lhs_result = for (expected_operands) |op| {
463 if (op.kind == .id_result) break true;
464 } else false;
465
466 if (requires_lhs_result and maybe_lhs_result == null) {
467 return self.fail(opcode_tok.start, "opcode '{s}' expects result on left-hand side", .{@tagName(self.inst.opcode)});
468 } else if (!requires_lhs_result and maybe_lhs_result != null) {
469 return self.fail(
470 lhs_result_tok.start,
471 "opcode '{s}' does not expect a result-id on the left-hand side",
472 .{@tagName(self.inst.opcode)},
473 );
474 }
475
476 for (expected_operands) |operand| {
477 if (operand.kind == .id_result) {
478 try self.inst.operands.append(gpa, .{ .result_id = maybe_lhs_result.? });
479 continue;
480 }
481
482 switch (operand.quantifier) {
483 .required => if (self.isAtInstructionBoundary()) {
484 return self.fail(
485 self.currentToken().start,
486 "missing required operand", // TODO: Operand name?
487 .{},
488 );
489 } else {
490 try self.parseOperand(operand.kind);
491 },
492 .optional => if (!self.isAtInstructionBoundary()) {
493 try self.parseOperand(operand.kind);
494 },
495 .variadic => while (!self.isAtInstructionBoundary()) {
496 try self.parseOperand(operand.kind);
497 },
498 }
499 }
500}
501
502fn parseOperand(self: *Assembler, kind: spec.OperandKind) Error!void {
503 switch (kind.category()) {
504 .bit_enum => try self.parseBitEnum(kind),
505 .value_enum => try self.parseValueEnum(kind),
506 .id => try self.parseRefId(),
507 else => switch (kind) {
508 .literal_integer => try self.parseLiteralInteger(),
509 .literal_string => try self.parseString(),
510 .literal_context_dependent_number => try self.parseContextDependentNumber(),
511 .literal_ext_inst_integer => try self.parseLiteralExtInstInteger(),
512 .pair_id_ref_id_ref => try self.parsePhiSource(),
513 else => return self.todo("parse operand of type {s}", .{@tagName(kind)}),
514 },
515 }
516}
517
518/// Also handles parsing any required extra operands.
519fn parseBitEnum(self: *Assembler, kind: spec.OperandKind) !void {
520 const gpa = self.cg.module.gpa;
521
522 var tok = self.currentToken();
523 try self.expectToken(.value);
524
525 var text = self.tokenText(tok);
526 if (std.mem.eql(u8, text, "None")) {
527 try self.inst.operands.append(gpa, .{ .value = 0 });
528 return;
529 }
530
531 const enumerants = kind.enumerants();
532 var mask: u32 = 0;
533 while (true) {
534 const enumerant = for (enumerants) |enumerant| {
535 if (std.mem.eql(u8, enumerant.name, text))
536 break enumerant;
537 } else {
538 return self.fail(tok.start, "'{s}' is not a valid flag for bitmask {s}", .{ text, @tagName(kind) });
539 };
540 mask |= enumerant.value;
541 if (!self.eatToken(.pipe))
542 break;
543
544 tok = self.currentToken();
545 try self.expectToken(.value);
546 text = self.tokenText(tok);
547 }
548
549 try self.inst.operands.append(gpa, .{ .value = mask });
550
551 // Assume values are sorted.
552 // TODO: ensure in generator.
553 for (enumerants) |enumerant| {
554 if ((mask & enumerant.value) == 0)
555 continue;
556
557 for (enumerant.parameters) |param_kind| {
558 if (self.isAtInstructionBoundary()) {
559 return self.fail(self.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
560 }
561
562 try self.parseOperand(param_kind);
563 }
564 }
565}
566
567/// Also handles parsing any required extra operands.
568fn parseValueEnum(self: *Assembler, kind: spec.OperandKind) !void {
569 const gpa = self.cg.module.gpa;
570
571 const tok = self.currentToken();
572 if (self.eatToken(.placeholder)) {
573 const name = self.tokenText(tok)[1..];
574 const value = self.value_map.get(name) orelse {
575 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
576 };
577 switch (value) {
578 .constant => |literal32| {
579 try self.inst.operands.append(gpa, .{ .value = literal32 });
580 },
581 .string => |str| {
582 const enumerant = for (kind.enumerants()) |enumerant| {
583 if (std.mem.eql(u8, enumerant.name, str)) break enumerant;
584 } else {
585 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ str, @tagName(kind) });
586 };
587 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
588 },
589 else => return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name}),
590 }
591 return;
592 }
593
594 try self.expectToken(.value);
595
596 const text = self.tokenText(tok);
597 const int_value = std.fmt.parseInt(u32, text, 0) catch null;
598 const enumerant = for (kind.enumerants()) |enumerant| {
599 if (int_value) |v| {
600 if (v == enumerant.value) break enumerant;
601 } else {
602 if (std.mem.eql(u8, enumerant.name, text)) break enumerant;
603 }
604 } else {
605 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ text, @tagName(kind) });
606 };
607
608 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
609
610 for (enumerant.parameters) |param_kind| {
611 if (self.isAtInstructionBoundary()) {
612 return self.fail(self.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
613 }
614
615 try self.parseOperand(param_kind);
616 }
617}
618
619fn parseRefId(self: *Assembler) !void {
620 const gpa = self.cg.module.gpa;
621
622 const tok = self.currentToken();
623 try self.expectToken(.result_id);
624
625 const name = self.tokenText(tok)[1..];
626 const entry = try self.value_map.getOrPut(gpa, name);
627 if (!entry.found_existing) {
628 entry.value_ptr.* = .unresolved_forward_reference;
629 }
630
631 const index: AsmValue.Ref = @intCast(entry.index);
632 try self.inst.operands.append(gpa, .{ .ref_id = index });
633}
634
635fn parseLiteralInteger(self: *Assembler) !void {
636 const gpa = self.cg.module.gpa;
637
638 const tok = self.currentToken();
639 if (self.eatToken(.placeholder)) {
640 const name = self.tokenText(tok)[1..];
641 const value = self.value_map.get(name) orelse {
642 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
643 };
644 switch (value) {
645 .constant => |literal32| {
646 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
647 },
648 else => {
649 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
650 },
651 }
652 return;
653 }
654
655 try self.expectToken(.value);
656 // According to the SPIR-V machine readable grammar, a LiteralInteger
657 // may consist of one or more words. From the SPIR-V docs it seems like there
658 // only one instruction where multiple words are allowed, the literals that make up the
659 // switch cases of OpSwitch. This case is handled separately, and so we just assume
660 // everything is a 32-bit integer in this function.
661 const text = self.tokenText(tok);
662 const value = std.fmt.parseInt(u32, text, 0) catch {
663 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
664 };
665 try self.inst.operands.append(gpa, .{ .literal32 = value });
666}
667
668fn parseLiteralExtInstInteger(self: *Assembler) !void {
669 const gpa = self.cg.module.gpa;
670
671 const tok = self.currentToken();
672 if (self.eatToken(.placeholder)) {
673 const name = self.tokenText(tok)[1..];
674 const value = self.value_map.get(name) orelse {
675 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
676 };
677 switch (value) {
678 .constant => |literal32| {
679 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
680 },
681 else => {
682 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
683 },
684 }
685 return;
686 }
687
688 try self.expectToken(.value);
689 const text = self.tokenText(tok);
690 const value = std.fmt.parseInt(u32, text, 0) catch {
691 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
692 };
693 try self.inst.operands.append(gpa, .{ .literal32 = value });
694}
695
696fn parseString(self: *Assembler) !void {
697 const gpa = self.cg.module.gpa;
698
699 const tok = self.currentToken();
700 try self.expectToken(.string);
701 // Note, the string might not have a closing quote. In this case,
702 // an error is already emitted but we are trying to continue processing
703 // anyway, so in this function we have to deal with that situation.
704 const text = self.tokenText(tok);
705 assert(text.len > 0 and text[0] == '"');
706 const literal = if (text.len != 1 and text[text.len - 1] == '"')
707 text[1 .. text.len - 1]
708 else
709 text[1..];
710
711 const string_offset: u32 = @intCast(self.inst.string_bytes.items.len);
712 try self.inst.string_bytes.ensureUnusedCapacity(gpa, literal.len + 1);
713 self.inst.string_bytes.appendSliceAssumeCapacity(literal);
714 self.inst.string_bytes.appendAssumeCapacity(0);
715
716 try self.inst.operands.append(gpa, .{ .string = string_offset });
717}
718
719fn parseContextDependentNumber(self: *Assembler) !void {
720 const module = self.cg.module;
721
722 // For context dependent numbers, the actual type to parse is determined by the instruction.
723 // Currently, this operand appears in OpConstant and OpSpecConstant, where the too-be-parsed type
724 // is determined by the result type. That means that in this instructions we have to resolve the
725 // operand type early and look at the result to see how we need to proceed.
726 assert(self.inst.opcode == .OpConstant or self.inst.opcode == .OpSpecConstant);
727
728 const tok = self.currentToken();
729 const result = try self.resolveRef(self.inst.operands.items[0].ref_id);
730 const result_id = result.resultId();
731 // We are going to cheat a little bit: The types we are interested in, int and float,
732 // are added to the module and cached via module.intType and module.floatType. Therefore,
733 // we can determine the width of these types by directly checking the cache.
734 // This only works if the Assembler and codegen both use spv.intType and spv.floatType though.
735 // We don't expect there to be many of these types, so just look it up every time.
736 // TODO: Count be improved to be a little bit more efficent.
737
738 {
739 var it = module.cache.int_types.iterator();
740 while (it.next()) |entry| {
741 const id = entry.value_ptr.*;
742 if (id != result_id) continue;
743 const info = entry.key_ptr.*;
744 return try self.parseContextDependentInt(info.signedness, info.bits);
745 }
746 }
747
748 {
749 var it = module.cache.float_types.iterator();
750 while (it.next()) |entry| {
751 const id = entry.value_ptr.*;
752 if (id != result_id) continue;
753 const info = entry.key_ptr.*;
754 switch (info.bits) {
755 16 => try self.parseContextDependentFloat(16),
756 32 => try self.parseContextDependentFloat(32),
757 64 => try self.parseContextDependentFloat(64),
758 else => return self.fail(tok.start, "cannot parse {}-bit info literal", .{info.bits}),
759 }
760 }
761 }
762
763 return self.fail(tok.start, "cannot parse literal constant", .{});
764}
765
766fn parseContextDependentInt(self: *Assembler, signedness: std.builtin.Signedness, width: u32) !void {
767 const gpa = self.cg.module.gpa;
768
769 const tok = self.currentToken();
770 if (self.eatToken(.placeholder)) {
771 const name = self.tokenText(tok)[1..];
772 const value = self.value_map.get(name) orelse {
773 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
774 };
775 switch (value) {
776 .constant => |literal32| {
777 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
778 },
779 else => {
780 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
781 },
782 }
783 return;
784 }
785
786 try self.expectToken(.value);
787
788 if (width == 0 or width > 2 * @bitSizeOf(spec.Word)) {
789 return self.fail(tok.start, "cannot parse {}-bit integer literal", .{width});
790 }
791
792 const text = self.tokenText(tok);
793 invalid: {
794 // Just parse the integer as the next larger integer type, and check if it overflows afterwards.
795 const int = std.fmt.parseInt(i128, text, 0) catch break :invalid;
796 const min = switch (signedness) {
797 .unsigned => 0,
798 .signed => -(@as(i128, 1) << (@as(u7, @intCast(width)) - 1)),
799 };
800 const max = (@as(i128, 1) << (@as(u7, @intCast(width)) - @intFromBool(signedness == .signed))) - 1;
801 if (int < min or int > max) {
802 break :invalid;
803 }
804
805 // Note, we store the sign-extended version here.
806 if (width <= @bitSizeOf(spec.Word)) {
807 try self.inst.operands.append(gpa, .{ .literal32 = @truncate(@as(u128, @bitCast(int))) });
808 } else {
809 try self.inst.operands.append(gpa, .{ .literal64 = @truncate(@as(u128, @bitCast(int))) });
810 }
811 return;
812 }
813
814 return self.fail(tok.start, "'{s}' is not a valid {s} {}-bit int literal", .{ text, @tagName(signedness), width });
815}
816
817fn parseContextDependentFloat(self: *Assembler, comptime width: u16) !void {
818 const gpa = self.cg.module.gpa;
819
820 const Float = std.meta.Float(width);
821 const Int = std.meta.Int(.unsigned, width);
822
823 const tok = self.currentToken();
824 try self.expectToken(.value);
825
826 const text = self.tokenText(tok);
827
828 const value = std.fmt.parseFloat(Float, text) catch {
829 return self.fail(tok.start, "'{s}' is not a valid {}-bit float literal", .{ text, width });
830 };
831
832 const float_bits: Int = @bitCast(value);
833 if (width <= @bitSizeOf(spec.Word)) {
834 try self.inst.operands.append(gpa, .{ .literal32 = float_bits });
835 } else {
836 assert(width <= 2 * @bitSizeOf(spec.Word));
837 try self.inst.operands.append(gpa, .{ .literal64 = float_bits });
838 }
839}
840
841fn parsePhiSource(self: *Assembler) !void {
842 try self.parseRefId();
843 if (self.isAtInstructionBoundary()) {
844 return self.fail(self.currentToken().start, "missing phi block parent", .{});
845 }
846 try self.parseRefId();
847}
848
849/// Returns whether the `current_token` cursor
850/// is currently pointing at the start of a new instruction.
851fn isAtInstructionBoundary(self: Assembler) bool {
852 return switch (self.currentToken().tag) {
853 .opcode, .result_id_assign, .eof => true,
854 else => false,
855 };
856}
857
858fn expectToken(self: *Assembler, tag: Token.Tag) !void {
859 if (self.eatToken(tag))
860 return;
861
862 return self.fail(self.currentToken().start, "unexpected {s}, expected {s}", .{
863 self.currentToken().tag.name(),
864 tag.name(),
865 });
866}
867
868fn eatToken(self: *Assembler, tag: Token.Tag) bool {
869 if (self.testToken(tag)) {
870 self.current_token += 1;
871 return true;
872 }
873 return false;
874}
875
876fn testToken(self: Assembler, tag: Token.Tag) bool {
877 return self.currentToken().tag == tag;
878}
879
880fn currentToken(self: Assembler) Token {
881 return self.tokens.items[self.current_token];
882}
883
884fn tokenText(self: Assembler, tok: Token) []const u8 {
885 return self.src[tok.start..tok.end];
886}
887
888/// Tokenize `self.src` and put the tokens in `self.tokens`.
889/// Any errors encountered are appended to `self.errors`.
890fn tokenize(self: *Assembler) !void {
891 const gpa = self.cg.module.gpa;
892
893 self.tokens.clearRetainingCapacity();
894
895 var offset: u32 = 0;
896 while (true) {
897 const tok = try self.nextToken(offset);
898 // Resolve result-id assignment now.
899 // NOTE: If the previous token wasn't a result-id, just ignore it,
900 // we will catch it while parsing.
901 if (tok.tag == .equals and self.tokens.items[self.tokens.items.len - 1].tag == .result_id) {
902 self.tokens.items[self.tokens.items.len - 1].tag = .result_id_assign;
903 }
904 try self.tokens.append(gpa, tok);
905 if (tok.tag == .eof)
906 break;
907 offset = tok.end;
908 }
909}
910
911const Token = struct {
912 tag: Tag,
913 start: u32,
914 end: u32,
915
916 const Tag = enum {
917 /// Returned when there was no more input to match.
918 eof,
919 /// %identifier
920 result_id,
921 /// %identifier when appearing on the LHS of an equals sign.
922 /// While not technically a token, its relatively easy to resolve
923 /// this during lexical analysis and relieves a bunch of headaches
924 /// during parsing.
925 result_id_assign,
926 /// Mask, int, or float. These are grouped together as some
927 /// SPIR-V enumerants look a bit like integers as well (for example
928 /// "3D"), and so it is easier to just interpret them as the expected
929 /// type when resolving an instruction's operands.
930 value,
931 /// An enumerant that looks like an opcode, that is, OpXxxx.
932 /// Not necessarily a *valid* opcode.
933 opcode,
934 /// String literals.
935 /// Note, this token is also returned for unterminated
936 /// strings. In this case the closing " is not present.
937 string,
938 /// |.
939 pipe,
940 /// =.
941 equals,
942 /// $identifier. This is used (for now) for constant values, like integers.
943 /// These can be used in place of a normal `value`.
944 placeholder,
945
946 fn name(self: Tag) []const u8 {
947 return switch (self) {
948 .eof => "<end of input>",
949 .result_id => "<result-id>",
950 .result_id_assign => "<assigned result-id>",
951 .value => "<value>",
952 .opcode => "<opcode>",
953 .string => "<string literal>",
954 .pipe => "'|'",
955 .equals => "'='",
956 .placeholder => "<placeholder>",
957 };
958 }
959 };
960};
961
962/// Retrieve the next token from the input. This function will assert
963/// that the token is surrounded by whitespace if required, but will not
964/// interpret the token yet.
965/// NOTE: This function doesn't handle .result_id_assign - this is handled in tokenize().
966fn nextToken(self: *Assembler, start_offset: u32) !Token {
967 // We generally separate the input into the following types:
968 // - Whitespace. Generally ignored, but also used as delimiter for some
969 // tokens.
970 // - Values. This entails integers, floats, enums - anything that
971 // consists of alphanumeric characters, delimited by whitespace.
972 // - Result-IDs. This entails anything that consists of alphanumeric characters and _, and
973 // starts with a %. In contrast to values, this entity can be checked for complete correctness
974 // relatively easily here.
975 // - Strings. This entails quote-delimited text such as "abc".
976 // SPIR-V strings have only two escapes, \" and \\.
977 // - Sigils, = and |. In this assembler, these are not required to have whitespace
978 // around them (they act as delimiters) as they do in SPIRV-Tools.
979
980 var state: enum {
981 start,
982 value,
983 result_id,
984 string,
985 string_end,
986 escape,
987 placeholder,
988 } = .start;
989 var token_start = start_offset;
990 var offset = start_offset;
991 var tag = Token.Tag.eof;
992 while (offset < self.src.len) : (offset += 1) {
993 const c = self.src[offset];
994 switch (state) {
995 .start => switch (c) {
996 ' ', '\t', '\r', '\n' => token_start = offset + 1,
997 '"' => {
998 state = .string;
999 tag = .string;
1000 },
1001 '%' => {
1002 state = .result_id;
1003 tag = .result_id;
1004 },
1005 '|' => {
1006 tag = .pipe;
1007 offset += 1;
1008 break;
1009 },
1010 '=' => {
1011 tag = .equals;
1012 offset += 1;
1013 break;
1014 },
1015 '$' => {
1016 state = .placeholder;
1017 tag = .placeholder;
1018 },
1019 else => {
1020 state = .value;
1021 tag = .value;
1022 },
1023 },
1024 .value => switch (c) {
1025 '"' => {
1026 try self.addError(offset, "unexpected string literal", .{});
1027 // The user most likely just forgot a delimiter here - keep
1028 // the tag as value.
1029 break;
1030 },
1031 ' ', '\t', '\r', '\n', '=', '|' => break,
1032 else => {},
1033 },
1034 .result_id, .placeholder => switch (c) {
1035 '_', 'a'...'z', 'A'...'Z', '0'...'9' => {},
1036 ' ', '\t', '\r', '\n', '=', '|' => break,
1037 else => {
1038 try self.addError(offset, "illegal character in result-id or placeholder", .{});
1039 // Again, probably a forgotten delimiter here.
1040 break;
1041 },
1042 },
1043 .string => switch (c) {
1044 '\\' => state = .escape,
1045 '"' => state = .string_end,
1046 else => {}, // Note, strings may include newlines
1047 },
1048 .string_end => switch (c) {
1049 ' ', '\t', '\r', '\n', '=', '|' => break,
1050 else => {
1051 try self.addError(offset, "unexpected character after string literal", .{});
1052 // The token is still unmistakibly a string.
1053 break;
1054 },
1055 },
1056 // Escapes simply skip the next char.
1057 .escape => state = .string,
1058 }
1059 }
1060
1061 var tok: Token = .{
1062 .tag = tag,
1063 .start = token_start,
1064 .end = offset,
1065 };
1066
1067 switch (state) {
1068 .string, .escape => {
1069 try self.addError(token_start, "unterminated string", .{});
1070 },
1071 .result_id => if (offset - token_start == 1) {
1072 try self.addError(token_start, "result-id must have at least one name character", .{});
1073 },
1074 .value => {
1075 const text = self.tokenText(tok);
1076 const prefix = "Op";
1077 const looks_like_opcode = text.len > prefix.len and
1078 std.mem.startsWith(u8, text, prefix) and
1079 std.ascii.isUpper(text[prefix.len]);
1080 if (looks_like_opcode)
1081 tok.tag = .opcode;
1082 },
1083 else => {},
1084 }
1085
1086 return tok;
1087}
src/arch/spirv/CodeGen.zig deleted-6168
...@@ -1,6168 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Target = std.Target;
4const Signedness = std.builtin.Signedness;
5const assert = std.debug.assert;
6const log = std.log.scoped(.codegen);
7
8const Zcu = @import("../../Zcu.zig");
9const Type = @import("../../Type.zig");
10const Value = @import("../../Value.zig");
11const Air = @import("../../Air.zig");
12const InternPool = @import("../../InternPool.zig");
13const Section = @import("Section.zig");
14const Assembler = @import("Assembler.zig");
15
16const spec = @import("spec.zig");
17const Opcode = spec.Opcode;
18const Word = spec.Word;
19const Id = spec.Id;
20const IdRange = spec.IdRange;
21const StorageClass = spec.StorageClass;
22
23const Module = @import("Module.zig");
24const Decl = Module.Decl;
25const Repr = Module.Repr;
26const InternMap = Module.InternMap;
27const PtrTypeMap = Module.PtrTypeMap;
28
29const CodeGen = @This();
30
31pub fn legalizeFeatures(_: *const std.Target) *const Air.Legalize.Features {
32 return comptime &.initMany(&.{
33 .expand_intcast_safe,
34 .expand_int_from_float_safe,
35 .expand_int_from_float_optimized_safe,
36 .expand_add_safe,
37 .expand_sub_safe,
38 .expand_mul_safe,
39 });
40}
41
42pub const zig_call_abi_ver = 3;
43
44const ControlFlow = union(enum) {
45 const Structured = struct {
46 /// This type indicates the way that a block is terminated. The
47 /// state of a particular block is used to track how a jump from
48 /// inside the block must reach the outside.
49 const Block = union(enum) {
50 const Incoming = struct {
51 src_label: Id,
52 /// Instruction that returns an u32 value of the
53 /// `Air.Inst.Index` that control flow should jump to.
54 next_block: Id,
55 };
56
57 const SelectionMerge = struct {
58 /// Incoming block from the `then` label.
59 /// Note that hte incoming block from the `else` label is
60 /// either given by the next element in the stack.
61 incoming: Incoming,
62 /// The label id of the cond_br's merge block.
63 /// For the top-most element in the stack, this
64 /// value is undefined.
65 merge_block: Id,
66 };
67
68 /// For a `selection` type block, we cannot use early exits, and we
69 /// must generate a 'merge ladder' of OpSelection instructions. To that end,
70 /// we keep a stack of the merges that still must be closed at the end of
71 /// a block.
72 ///
73 /// This entire structure basically just resembles a tree like
74 /// a x
75 /// \ /
76 /// b o merge
77 /// \ /
78 /// c o merge
79 /// \ /
80 /// o merge
81 /// /
82 /// o jump to next block
83 selection: struct {
84 /// In order to know which merges we still need to do, we need to keep
85 /// a stack of those.
86 merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty,
87 },
88 /// For a `loop` type block, we can early-exit the block by
89 /// jumping to the loop exit node, and we don't need to generate
90 /// an entire stack of merges.
91 loop: struct {
92 /// The next block to jump to can be determined from any number
93 /// of conditions that jump to the loop exit.
94 merges: std.ArrayListUnmanaged(Incoming) = .empty,
95 /// The label id of the loop's merge block.
96 merge_block: Id,
97 },
98
99 fn deinit(block: *Structured.Block, gpa: Allocator) void {
100 switch (block.*) {
101 .selection => |*merge| merge.merge_stack.deinit(gpa),
102 .loop => |*merge| merge.merges.deinit(gpa),
103 }
104 block.* = undefined;
105 }
106 };
107 /// This determines how exits from the current block must be handled.
108 block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty,
109 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
110 };
111
112 const Unstructured = struct {
113 const Incoming = struct {
114 src_label: Id,
115 break_value_id: Id,
116 };
117
118 const Block = struct {
119 label: ?Id = null,
120 incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty,
121 };
122
123 /// We need to keep track of result ids for block labels, as well as the 'incoming'
124 /// blocks for a block.
125 blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, *Block) = .empty,
126 };
127
128 structured: Structured,
129 unstructured: Unstructured,
130
131 pub fn deinit(cg: *ControlFlow, gpa: Allocator) void {
132 switch (cg.*) {
133 .structured => |*cf| {
134 cf.block_stack.deinit(gpa);
135 cf.block_results.deinit(gpa);
136 },
137 .unstructured => |*cf| {
138 cf.blocks.deinit(gpa);
139 },
140 }
141 cg.* = undefined;
142 }
143};
144
145pt: Zcu.PerThread,
146air: Air,
147/// Note: If the declaration is not a function, this value will be undefined!
148liveness: Air.Liveness,
149owner_nav: InternPool.Nav.Index,
150module: *Module,
151control_flow: ControlFlow,
152base_line: u32,
153block_label: Id = .none,
154/// The base offset of the current decl, which is what `dbg_stmt` is relative to.
155/// An array of function argument result-ids. Each index corresponds with the
156/// function argument of the same index.
157args: std.ArrayListUnmanaged(Id) = .empty,
158/// A counter to keep track of how many `arg` instructions we've seen yet.
159next_arg_index: u32 = 0,
160/// A map keeping track of which instruction generated which result-id.
161inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
162file_path_id: Id = .none,
163prologue: Section = .{},
164body: Section = .{},
165decl_deps: std.AutoArrayHashMapUnmanaged(Decl.Index, void) = .empty,
166error_msg: ?*Zcu.ErrorMsg = null,
167
168/// Free resources owned by the CodeGen.
169pub fn deinit(cg: *CodeGen) void {
170 const gpa = cg.module.gpa;
171 cg.args.deinit(gpa);
172 cg.inst_results.deinit(gpa);
173 cg.control_flow.deinit(gpa);
174 cg.prologue.deinit(gpa);
175 cg.body.deinit(gpa);
176 cg.decl_deps.deinit(gpa);
177}
178
179const Error = error{ CodegenFail, OutOfMemory };
180
181pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void {
182 const gpa = cg.module.gpa;
183 const zcu = cg.module.zcu;
184 const ip = &zcu.intern_pool;
185 const target = zcu.getTarget();
186
187 const nav = ip.getNav(cg.owner_nav);
188 const val = zcu.navValue(cg.owner_nav);
189 const ty = val.typeOf(zcu);
190
191 if (!do_codegen and !ty.hasRuntimeBits(zcu)) return;
192
193 const spv_decl_index = try cg.module.resolveNav(ip, cg.owner_nav);
194 const result_id = cg.module.declPtr(spv_decl_index).result_id;
195
196 switch (cg.module.declPtr(spv_decl_index).kind) {
197 .func => {
198 const fn_info = zcu.typeToFunc(ty).?;
199 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
200 const is_test = zcu.test_functions.contains(cg.owner_nav);
201
202 const func_result_id = if (is_test) cg.module.allocId() else result_id;
203 const prototype_ty_id = try cg.resolveType(ty, .direct);
204 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
205 .id_result_type = return_ty_id,
206 .id_result = func_result_id,
207 .function_type = prototype_ty_id,
208 // Note: the backend will never be asked to generate an inline function
209 // (this is handled in sema), so we don't need to set function_control here.
210 .function_control = .{},
211 });
212
213 comptime assert(zig_call_abi_ver == 3);
214 try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len);
215 for (fn_info.param_types.get(ip)) |param_ty_index| {
216 const param_ty: Type = .fromInterned(param_ty_index);
217 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
218
219 const param_type_id = try cg.resolveType(param_ty, .direct);
220 const arg_result_id = cg.module.allocId();
221 try cg.prologue.emit(cg.module.gpa, .OpFunctionParameter, .{
222 .id_result_type = param_type_id,
223 .id_result = arg_result_id,
224 });
225 cg.args.appendAssumeCapacity(arg_result_id);
226 }
227
228 // TODO: This could probably be done in a better way...
229 const root_block_id = cg.module.allocId();
230
231 // The root block of a function declaration should appear before OpVariable instructions,
232 // so it is generated into the function's prologue.
233 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
234 .id_result = root_block_id,
235 });
236 cg.block_label = root_block_id;
237
238 const main_body = cg.air.getMainBody();
239 switch (cg.control_flow) {
240 .structured => {
241 _ = try cg.genStructuredBody(.selection, main_body);
242 // We always expect paths to here to end, but we still need the block
243 // to act as a dummy merge block.
244 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
245 },
246 .unstructured => {
247 try cg.genBody(main_body);
248 },
249 }
250 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
251 // Append the actual code into the functions section.
252 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
253 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
254
255 // Temporarily generate a test kernel declaration if this is a test function.
256 if (is_test) {
257 try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), spv_decl_index, func_result_id);
258 }
259
260 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
261 try cg.module.debugName(func_result_id, nav.fqn.toSlice(ip));
262 },
263 .global => {
264 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
265 .func => unreachable,
266 .variable => |variable| .fromInterned(variable.init),
267 .@"extern" => null,
268 else => val,
269 };
270 assert(maybe_init_val == null); // TODO
271
272 const storage_class = cg.module.storageClass(nav.getAddrspace());
273 assert(storage_class != .generic); // These should be instance globals
274
275 const ty_id = try cg.resolveType(ty, .indirect);
276 const ptr_ty_id = try cg.module.ptrType(ty_id, storage_class);
277
278 try cg.module.sections.globals.emit(cg.module.gpa, .OpVariable, .{
279 .id_result_type = ptr_ty_id,
280 .id_result = result_id,
281 .storage_class = storage_class,
282 });
283
284 switch (target.os.tag) {
285 .vulkan, .opengl => {
286 if (ty.zigTypeTag(zcu) == .@"struct") {
287 switch (storage_class) {
288 .uniform, .push_constant => try cg.module.decorate(ty_id, .block),
289 else => {},
290 }
291 }
292
293 switch (ip.indexToKey(ty.toIntern())) {
294 .func_type, .opaque_type => {},
295 else => {
296 try cg.module.decorate(ptr_ty_id, .{
297 .array_stride = .{ .array_stride = @intCast(ty.abiSize(zcu)) },
298 });
299 },
300 }
301 },
302 else => {},
303 }
304
305 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |builtin| {
306 try cg.module.decorate(result_id, .{ .built_in = .{ .built_in = builtin } });
307 }
308
309 try cg.module.debugName(result_id, nav.fqn.toSlice(ip));
310 try cg.module.declareDeclDeps(spv_decl_index, &.{});
311 },
312 .invocation_global => {
313 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
314 .func => unreachable,
315 .variable => |variable| .fromInterned(variable.init),
316 .@"extern" => null,
317 else => val,
318 };
319
320 try cg.module.declareDeclDeps(spv_decl_index, &.{});
321
322 const ty_id = try cg.resolveType(ty, .indirect);
323 const ptr_ty_id = try cg.module.ptrType(ty_id, .function);
324
325 if (maybe_init_val) |init_val| {
326 // TODO: Combine with resolveAnonDecl?
327 const void_ty_id = try cg.resolveType(.void, .direct);
328 const initializer_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
329
330 const initializer_id = cg.module.allocId();
331 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
332 .id_result_type = try cg.resolveType(.void, .direct),
333 .id_result = initializer_id,
334 .function_control = .{},
335 .function_type = initializer_proto_ty_id,
336 });
337
338 const root_block_id = cg.module.allocId();
339 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
340 .id_result = root_block_id,
341 });
342 cg.block_label = root_block_id;
343
344 const val_id = try cg.constant(ty, init_val, .indirect);
345 try cg.body.emit(cg.module.gpa, .OpStore, .{
346 .pointer = result_id,
347 .object = val_id,
348 });
349
350 try cg.body.emit(cg.module.gpa, .OpReturn, {});
351 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
352 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
353 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
354 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
355
356 try cg.module.debugNameFmt(initializer_id, "initializer of {f}", .{nav.fqn.fmt(ip)});
357
358 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
359 .id_result_type = ptr_ty_id,
360 .id_result = result_id,
361 .set = try cg.module.importInstructionSet(.zig),
362 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
363 .id_ref_4 = &.{initializer_id},
364 });
365 } else {
366 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
367 .id_result_type = ptr_ty_id,
368 .id_result = result_id,
369 .set = try cg.module.importInstructionSet(.zig),
370 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
371 .id_ref_4 = &.{},
372 });
373 }
374 },
375 }
376}
377
378pub fn fail(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
379 @branchHint(.cold);
380 const zcu = cg.module.zcu;
381 const src_loc = zcu.navSrcLoc(cg.owner_nav);
382 assert(cg.error_msg == null);
383 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, format, args);
384 return error.CodegenFail;
385}
386
387pub fn todo(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
388 return cg.fail("TODO (SPIR-V): " ++ format, args);
389}
390
391/// This imports the "default" extended instruction set for the target
392/// For OpenCL, OpenCL.std.100. For Vulkan and OpenGL, GLSL.std.450.
393fn importExtendedSet(cg: *CodeGen) !Id {
394 const target = cg.module.zcu.getTarget();
395 return switch (target.os.tag) {
396 .opencl, .amdhsa => try cg.module.importInstructionSet(.@"OpenCL.std"),
397 .vulkan, .opengl => try cg.module.importInstructionSet(.@"GLSL.std.450"),
398 else => unreachable,
399 };
400}
401
402/// Fetch the result-id for a previously generated instruction or constant.
403fn resolve(cg: *CodeGen, inst: Air.Inst.Ref) !Id {
404 const pt = cg.pt;
405 const zcu = cg.module.zcu;
406 const ip = &zcu.intern_pool;
407 if (try cg.air.value(inst, pt)) |val| {
408 const ty = cg.typeOf(inst);
409 if (ty.zigTypeTag(zcu) == .@"fn") {
410 const fn_nav = switch (zcu.intern_pool.indexToKey(val.ip_index)) {
411 .@"extern" => |@"extern"| @"extern".owner_nav,
412 .func => |func| func.owner_nav,
413 else => unreachable,
414 };
415 const spv_decl_index = try cg.module.resolveNav(ip, fn_nav);
416 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
417 return cg.module.declPtr(spv_decl_index).result_id;
418 }
419
420 return try cg.constant(ty, val, .direct);
421 }
422 const index = inst.toIndex().?;
423 return cg.inst_results.get(index).?; // Assertion means instruction does not dominate usage.
424}
425
426fn resolveUav(cg: *CodeGen, val: InternPool.Index) !Id {
427 const gpa = cg.module.gpa;
428
429 // TODO: This cannot be a function at this point, but it should probably be handled anyway.
430
431 const zcu = cg.module.zcu;
432 const ty: Type = .fromInterned(zcu.intern_pool.typeOf(val));
433 const ty_id = try cg.resolveType(ty, .indirect);
434
435 const spv_decl_index = blk: {
436 const entry = try cg.module.uav_link.getOrPut(cg.module.gpa, .{ val, .function });
437 if (entry.found_existing) {
438 try cg.addFunctionDep(entry.value_ptr.*, .function);
439 return cg.module.declPtr(entry.value_ptr.*).result_id;
440 }
441
442 const spv_decl_index = try cg.module.allocDecl(.invocation_global);
443 try cg.addFunctionDep(spv_decl_index, .function);
444 entry.value_ptr.* = spv_decl_index;
445 break :blk spv_decl_index;
446 };
447
448 // TODO: At some point we will be able to generate this all constant here, but then all of
449 // constant() will need to be implemented such that it doesn't generate any at-runtime code.
450 // NOTE: Because this is a global, we really only want to initialize it once. Therefore the
451 // constant lowering of this value will need to be deferred to an initializer similar to
452 // other globals.
453
454 const result_id = cg.module.declPtr(spv_decl_index).result_id;
455
456 {
457 // Save the current state so that we can temporarily generate into a different function.
458 // TODO: This should probably be made a little more robust.
459 const func_prologue = cg.prologue;
460 const func_body = cg.body;
461 const func_deps = cg.decl_deps;
462 const block_label = cg.block_label;
463 defer {
464 cg.prologue = func_prologue;
465 cg.body = func_body;
466 cg.decl_deps = func_deps;
467 cg.block_label = block_label;
468 }
469
470 cg.prologue = .{};
471 cg.body = .{};
472 cg.decl_deps = .{};
473 defer {
474 cg.prologue.deinit(gpa);
475 cg.body.deinit(gpa);
476 cg.decl_deps.deinit(gpa);
477 }
478
479 const void_ty_id = try cg.resolveType(.void, .direct);
480 const initializer_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
481
482 const initializer_id = cg.module.allocId();
483 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
484 .id_result_type = try cg.resolveType(.void, .direct),
485 .id_result = initializer_id,
486 .function_control = .{},
487 .function_type = initializer_proto_ty_id,
488 });
489 const root_block_id = cg.module.allocId();
490 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
491 .id_result = root_block_id,
492 });
493 cg.block_label = root_block_id;
494
495 const val_id = try cg.constant(ty, .fromInterned(val), .indirect);
496 try cg.body.emit(cg.module.gpa, .OpStore, .{
497 .pointer = result_id,
498 .object = val_id,
499 });
500
501 try cg.body.emit(cg.module.gpa, .OpReturn, {});
502 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
503
504 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
505 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
506 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
507
508 try cg.module.debugNameFmt(initializer_id, "initializer of __anon_{d}", .{@intFromEnum(val)});
509
510 const fn_decl_ptr_ty_id = try cg.module.ptrType(ty_id, .function);
511 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
512 .id_result_type = fn_decl_ptr_ty_id,
513 .id_result = result_id,
514 .set = try cg.module.importInstructionSet(.zig),
515 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
516 .id_ref_4 = &.{initializer_id},
517 });
518 }
519
520 return result_id;
521}
522
523fn addFunctionDep(cg: *CodeGen, decl_index: Module.Decl.Index, storage_class: StorageClass) !void {
524 const target = cg.module.zcu.getTarget();
525 if (target.cpu.has(.spirv, .v1_4)) {
526 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
527 } else {
528 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
529 if (storage_class == .input or storage_class == .output) {
530 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
531 }
532 }
533}
534
535/// Start a new SPIR-V block, Emits the label of the new block, and stores which
536/// block we are currently generating.
537/// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
538/// keep track of the previous block.
539fn beginSpvBlock(cg: *CodeGen, label: Id) !void {
540 try cg.body.emit(cg.module.gpa, .OpLabel, .{ .id_result = label });
541 cg.block_label = label;
542}
543
544/// Return the amount of bits in the largest supported integer type. This is either 32 (always supported), or 64 (if
545/// the Int64 capability is enabled).
546/// Note: The extension SPV_INTEL_arbitrary_precision_integers allows any integer size (at least up to 32 bits).
547/// In theory that could also be used, but since the spec says that it only guarantees support up to 32-bit ints there
548/// is no way of knowing whether those are actually supported.
549/// TODO: Maybe this should be cached?
550fn largestSupportedIntBits(cg: *CodeGen) u16 {
551 const target = cg.module.zcu.getTarget();
552 if (target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64) {
553 return 64;
554 }
555 return 32;
556}
557
558const ArithmeticTypeInfo = struct {
559 const Class = enum {
560 bool,
561 /// A regular, **native**, integer.
562 /// This is only returned when the backend supports this int as a native type (when
563 /// the relevant capability is enabled).
564 integer,
565 /// A regular float. These are all required to be natively supported. Floating points
566 /// for which the relevant capability is not enabled are not emulated.
567 float,
568 /// An integer of a 'strange' size (which' bit size is not the same as its backing
569 /// type. **Note**: this may **also** include power-of-2 integers for which the
570 /// relevant capability is not enabled), but still within the limits of the largest
571 /// natively supported integer type.
572 strange_integer,
573 /// An integer with more bits than the largest natively supported integer type.
574 composite_integer,
575 };
576
577 /// A classification of the inner type.
578 /// These scenarios will all have to be handled slightly different.
579 class: Class,
580 /// The number of bits in the inner type.
581 /// This is the actual number of bits of the type, not the size of the backing integer.
582 bits: u16,
583 /// The number of bits required to store the type.
584 /// For `integer` and `float`, this is equal to `bits`.
585 /// For `strange_integer` and `bool` this is the size of the backing integer.
586 /// For `composite_integer` this is the elements count.
587 backing_bits: u16,
588 /// Null if this type is a scalar, or the length of the vector otherwise.
589 vector_len: ?u32,
590 /// Whether the inner type is signed. Only relevant for integers.
591 signedness: std.builtin.Signedness,
592};
593
594fn arithmeticTypeInfo(cg: *CodeGen, ty: Type) ArithmeticTypeInfo {
595 const zcu = cg.module.zcu;
596 const target = cg.module.zcu.getTarget();
597 var scalar_ty = ty.scalarType(zcu);
598 if (scalar_ty.zigTypeTag(zcu) == .@"enum") {
599 scalar_ty = scalar_ty.intTagType(zcu);
600 }
601 const vector_len = if (ty.isVector(zcu)) ty.vectorLen(zcu) else null;
602 return switch (scalar_ty.zigTypeTag(zcu)) {
603 .bool => .{
604 .bits = 1, // Doesn't matter for this class.
605 .backing_bits = cg.module.backingIntBits(1).@"0",
606 .vector_len = vector_len,
607 .signedness = .unsigned, // Technically, but doesn't matter for this class.
608 .class = .bool,
609 },
610 .float => .{
611 .bits = scalar_ty.floatBits(target),
612 .backing_bits = scalar_ty.floatBits(target), // TODO: F80?
613 .vector_len = vector_len,
614 .signedness = .signed, // Technically, but doesn't matter for this class.
615 .class = .float,
616 },
617 .int => blk: {
618 const int_info = scalar_ty.intInfo(zcu);
619 // TODO: Maybe it's useful to also return this value.
620 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
621 break :blk .{
622 .bits = int_info.bits,
623 .backing_bits = backing_bits,
624 .vector_len = vector_len,
625 .signedness = int_info.signedness,
626 .class = class: {
627 if (big_int) break :class .composite_integer;
628 break :class if (backing_bits == int_info.bits) .integer else .strange_integer;
629 },
630 };
631 },
632 .@"enum" => unreachable,
633 .vector => unreachable,
634 else => unreachable, // Unhandled arithmetic type
635 };
636}
637
638/// Checks whether the type can be directly translated to SPIR-V vectors
639fn isSpvVector(cg: *CodeGen, ty: Type) bool {
640 const zcu = cg.module.zcu;
641 const target = cg.module.zcu.getTarget();
642 if (ty.zigTypeTag(zcu) != .vector) return false;
643
644 // TODO: This check must be expanded for types that can be represented
645 // as integers (enums / packed structs?) and types that are represented
646 // by multiple SPIR-V values.
647 const scalar_ty = ty.scalarType(zcu);
648 switch (scalar_ty.zigTypeTag(zcu)) {
649 .bool,
650 .int,
651 .float,
652 => {},
653 else => return false,
654 }
655
656 const elem_ty = ty.childType(zcu);
657 const len = ty.vectorLen(zcu);
658
659 if (elem_ty.isNumeric(zcu) or elem_ty.toIntern() == .bool_type) {
660 if (len > 1 and len <= 4) return true;
661 if (target.cpu.has(.spirv, .vector16)) return (len == 8 or len == 16);
662 }
663
664 return false;
665}
666
667/// Emits a bool constant in a particular representation.
668fn constBool(cg: *CodeGen, value: bool, repr: Repr) !Id {
669 return switch (repr) {
670 .indirect => cg.constInt(.u1, @intFromBool(value)),
671 .direct => cg.module.constBool(value),
672 };
673}
674
675/// Emits an integer constant.
676/// This function, unlike Module.constInt, takes care to bitcast
677/// the value to an unsigned int first for Kernels.
678fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {
679 const zcu = cg.module.zcu;
680 const target = cg.module.zcu.getTarget();
681 const scalar_ty = ty.scalarType(zcu);
682 const int_info = scalar_ty.intInfo(zcu);
683 // Use backing bits so that negatives are sign extended
684 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
685 assert(backing_bits != 0); // u0 is comptime
686
687 const result_ty_id = try cg.resolveType(scalar_ty, .indirect);
688 const signedness: Signedness = switch (@typeInfo(@TypeOf(value))) {
689 .int => |int| int.signedness,
690 .comptime_int => if (value < 0) .signed else .unsigned,
691 else => unreachable,
692 };
693 if (@sizeOf(@TypeOf(value)) >= 4 and big_int) {
694 const value64: u64 = switch (signedness) {
695 .signed => @bitCast(@as(i64, @intCast(value))),
696 .unsigned => @as(u64, @intCast(value)),
697 };
698 assert(backing_bits == 64);
699 return cg.constructComposite(result_ty_id, &.{
700 try cg.constInt(.u32, @as(u32, @truncate(value64))),
701 try cg.constInt(.u32, @as(u32, @truncate(value64 << 32))),
702 });
703 }
704
705 const final_value: spec.LiteralContextDependentNumber = switch (target.os.tag) {
706 .opencl, .amdhsa => blk: {
707 const value64: u64 = switch (signedness) {
708 .signed => @bitCast(@as(i64, @intCast(value))),
709 .unsigned => @as(u64, @intCast(value)),
710 };
711
712 // Manually truncate the value to the right amount of bits.
713 const truncated_value = if (backing_bits == 64)
714 value64
715 else
716 value64 & (@as(u64, 1) << @intCast(backing_bits)) - 1;
717
718 break :blk switch (backing_bits) {
719 1...32 => .{ .uint32 = @truncate(truncated_value) },
720 33...64 => .{ .uint64 = truncated_value },
721 else => unreachable,
722 };
723 },
724 else => switch (backing_bits) {
725 1...32 => if (signedness == .signed) .{ .int32 = @intCast(value) } else .{ .uint32 = @intCast(value) },
726 33...64 => if (signedness == .signed) .{ .int64 = value } else .{ .uint64 = value },
727 else => unreachable,
728 },
729 };
730
731 const result_id = try cg.module.constant(result_ty_id, final_value);
732
733 if (!ty.isVector(zcu)) return result_id;
734 return cg.constructCompositeSplat(ty, result_id);
735}
736
737pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const Id) !Id {
738 const gpa = cg.module.gpa;
739 const result_id = cg.module.allocId();
740 try cg.body.emit(gpa, .OpCompositeConstruct, .{
741 .id_result_type = result_ty_id,
742 .id_result = result_id,
743 .constituents = constituents,
744 });
745 return result_id;
746}
747
748/// Construct a composite at runtime with all lanes set to the same value.
749/// ty must be an aggregate type.
750fn constructCompositeSplat(cg: *CodeGen, ty: Type, constituent: Id) !Id {
751 const gpa = cg.module.gpa;
752 const zcu = cg.module.zcu;
753 const n: usize = @intCast(ty.arrayLen(zcu));
754
755 const constituents = try gpa.alloc(Id, n);
756 defer gpa.free(constituents);
757 @memset(constituents, constituent);
758
759 const result_ty_id = try cg.resolveType(ty, .direct);
760 return cg.constructComposite(result_ty_id, constituents);
761}
762
763/// This function generates a load for a constant in direct (ie, non-memory) representation.
764/// When the constant is simple, it can be generated directly using OpConstant instructions.
765/// When the constant is more complicated however, it needs to be constructed using multiple values. This
766/// is done by emitting a sequence of instructions that initialize the value.
767//
768/// This function should only be called during function code generation.
769fn constant(cg: *CodeGen, ty: Type, val: Value, repr: Repr) Error!Id {
770 const gpa = cg.module.gpa;
771
772 // Note: Using intern_map can only be used with constants that DO NOT generate any runtime code!!
773 // Ideally that should be all constants in the future, or it should be cleaned up somehow. For
774 // now, only use the intern_map on case-by-case basis by breaking to :cache.
775 if (cg.module.intern_map.get(.{ val.toIntern(), repr })) |id| {
776 return id;
777 }
778
779 const pt = cg.pt;
780 const zcu = cg.module.zcu;
781 const target = cg.module.zcu.getTarget();
782 const result_ty_id = try cg.resolveType(ty, repr);
783 const ip = &zcu.intern_pool;
784
785 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{ ty.fmt(pt), val.fmtValue(pt), @tagName(ip.indexToKey(val.toIntern())) });
786 if (val.isUndefDeep(zcu)) {
787 return cg.module.constUndef(result_ty_id);
788 }
789
790 const cacheable_id = cache: {
791 switch (ip.indexToKey(val.toIntern())) {
792 .int_type,
793 .ptr_type,
794 .array_type,
795 .vector_type,
796 .opt_type,
797 .anyframe_type,
798 .error_union_type,
799 .simple_type,
800 .struct_type,
801 .tuple_type,
802 .union_type,
803 .opaque_type,
804 .enum_type,
805 .func_type,
806 .error_set_type,
807 .inferred_error_set_type,
808 => unreachable, // types, not values
809
810 .undef => unreachable, // handled above
811
812 .variable,
813 .@"extern",
814 .func,
815 .enum_literal,
816 .empty_enum_value,
817 => unreachable, // non-runtime values
818
819 .simple_value => |simple_value| switch (simple_value) {
820 .undefined,
821 .void,
822 .null,
823 .empty_tuple,
824 .@"unreachable",
825 => unreachable, // non-runtime values
826
827 .false, .true => break :cache try cg.constBool(val.toBool(), repr),
828 },
829 .int => {
830 if (ty.isSignedInt(zcu)) {
831 break :cache try cg.constInt(ty, val.toSignedInt(zcu));
832 } else {
833 break :cache try cg.constInt(ty, val.toUnsignedInt(zcu));
834 }
835 },
836 .float => {
837 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
838 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
839 32 => .{ .float32 = val.toFloat(f32, zcu) },
840 64 => .{ .float64 = val.toFloat(f64, zcu) },
841 80, 128 => unreachable, // TODO
842 else => unreachable,
843 };
844 break :cache try cg.module.constant(result_ty_id, lit);
845 },
846 .err => |err| {
847 const value = try pt.getErrorValue(err.name);
848 break :cache try cg.constInt(ty, value);
849 },
850 .error_union => |error_union| {
851 // TODO: Error unions may be constructed with constant instructions if the payload type
852 // allows it. For now, just generate it here regardless.
853 const err_ty = ty.errorUnionSet(zcu);
854 const payload_ty = ty.errorUnionPayload(zcu);
855 const err_val_id = switch (error_union.val) {
856 .err_name => |err_name| try cg.constInt(
857 err_ty,
858 try pt.getErrorValue(err_name),
859 ),
860 .payload => try cg.constInt(err_ty, 0),
861 };
862 const eu_layout = cg.errorUnionLayout(payload_ty);
863 if (!eu_layout.payload_has_bits) {
864 // We use the error type directly as the type.
865 break :cache err_val_id;
866 }
867
868 const payload_val_id = switch (error_union.val) {
869 .err_name => try cg.constant(payload_ty, .undef, .indirect),
870 .payload => |p| try cg.constant(payload_ty, .fromInterned(p), .indirect),
871 };
872
873 var constituents: [2]Id = undefined;
874 var types: [2]Type = undefined;
875 if (eu_layout.error_first) {
876 constituents[0] = err_val_id;
877 constituents[1] = payload_val_id;
878 types = .{ err_ty, payload_ty };
879 } else {
880 constituents[0] = payload_val_id;
881 constituents[1] = err_val_id;
882 types = .{ payload_ty, err_ty };
883 }
884
885 const comp_ty_id = try cg.resolveType(ty, .direct);
886 return try cg.constructComposite(comp_ty_id, &constituents);
887 },
888 .enum_tag => {
889 const int_val = try val.intFromEnum(ty, pt);
890 const int_ty = ty.intTagType(zcu);
891 break :cache try cg.constant(int_ty, int_val, repr);
892 },
893 .ptr => return cg.constantPtr(val),
894 .slice => |slice| {
895 const ptr_id = try cg.constantPtr(.fromInterned(slice.ptr));
896 const len_id = try cg.constant(.usize, .fromInterned(slice.len), .indirect);
897 const comp_ty_id = try cg.resolveType(ty, .direct);
898 return try cg.constructComposite(comp_ty_id, &.{ ptr_id, len_id });
899 },
900 .opt => {
901 const payload_ty = ty.optionalChild(zcu);
902 const maybe_payload_val = val.optionalValue(zcu);
903
904 if (!payload_ty.hasRuntimeBits(zcu)) {
905 break :cache try cg.constBool(maybe_payload_val != null, .indirect);
906 } else if (ty.optionalReprIsPayload(zcu)) {
907 // Optional representation is a nullable pointer or slice.
908 if (maybe_payload_val) |payload_val| {
909 return try cg.constant(payload_ty, payload_val, .indirect);
910 } else {
911 break :cache try cg.module.constNull(result_ty_id);
912 }
913 }
914
915 // Optional representation is a structure.
916 // { Payload, Bool }
917
918 const has_pl_id = try cg.constBool(maybe_payload_val != null, .indirect);
919 const payload_id = if (maybe_payload_val) |payload_val|
920 try cg.constant(payload_ty, payload_val, .indirect)
921 else
922 try cg.module.constUndef(try cg.resolveType(payload_ty, .indirect));
923
924 const comp_ty_id = try cg.resolveType(ty, .direct);
925 return try cg.constructComposite(comp_ty_id, &.{ payload_id, has_pl_id });
926 },
927 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {
928 inline .array_type, .vector_type => |array_type, tag| {
929 const elem_ty: Type = .fromInterned(array_type.child);
930
931 const constituents = try gpa.alloc(Id, @intCast(ty.arrayLenIncludingSentinel(zcu)));
932 defer gpa.free(constituents);
933
934 const child_repr: Repr = switch (tag) {
935 .array_type => .indirect,
936 .vector_type => .direct,
937 else => unreachable,
938 };
939
940 switch (aggregate.storage) {
941 .bytes => |bytes| {
942 // TODO: This is really space inefficient, perhaps there is a better
943 // way to do it?
944 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
945 constituent.* = try cg.constInt(elem_ty, byte);
946 }
947 },
948 .elems => |elems| {
949 for (constituents, elems) |*constituent, elem| {
950 constituent.* = try cg.constant(elem_ty, .fromInterned(elem), child_repr);
951 }
952 },
953 .repeated_elem => |elem| {
954 @memset(constituents, try cg.constant(elem_ty, .fromInterned(elem), child_repr));
955 },
956 }
957
958 const comp_ty_id = try cg.resolveType(ty, .direct);
959 return cg.constructComposite(comp_ty_id, constituents);
960 },
961 .struct_type => {
962 const struct_type = zcu.typeToStruct(ty).?;
963
964 if (struct_type.layout == .@"packed") {
965 // TODO: composite int
966 // TODO: endianness
967 const bits: u16 = @intCast(ty.bitSize(zcu));
968 const bytes = std.mem.alignForward(u16, cg.module.backingIntBits(bits).@"0", 8) / 8;
969 var limbs: [8]u8 = undefined;
970 @memset(&limbs, 0);
971 val.writeToPackedMemory(ty, pt, limbs[0..bytes], 0) catch unreachable;
972 const backing_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
973 return try cg.constInt(backing_ty, @as(u64, @bitCast(limbs)));
974 }
975
976 var types = std.ArrayList(Type).init(gpa);
977 defer types.deinit();
978
979 var constituents = std.ArrayList(Id).init(gpa);
980 defer constituents.deinit();
981
982 var it = struct_type.iterateRuntimeOrder(ip);
983 while (it.next()) |field_index| {
984 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
985 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
986 // This is a zero-bit field - we only needed it for the alignment.
987 continue;
988 }
989
990 // TODO: Padding?
991 const field_val = try val.fieldValue(pt, field_index);
992 const field_id = try cg.constant(field_ty, field_val, .indirect);
993
994 try types.append(field_ty);
995 try constituents.append(field_id);
996 }
997
998 const comp_ty_id = try cg.resolveType(ty, .direct);
999 return try cg.constructComposite(comp_ty_id, constituents.items);
1000 },
1001 .tuple_type => return cg.todo("implement tuple types", .{}),
1002 else => unreachable,
1003 },
1004 .un => |un| {
1005 if (un.tag == .none) {
1006 assert(ty.containerLayout(zcu) == .@"packed"); // TODO
1007 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1008 return try cg.constInt(int_ty, Value.toUnsignedInt(.fromInterned(un.val), zcu));
1009 }
1010 const active_field = ty.unionTagFieldIndex(.fromInterned(un.tag), zcu).?;
1011 const union_obj = zcu.typeToUnion(ty).?;
1012 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[active_field]);
1013 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
1014 try cg.constant(field_ty, .fromInterned(un.val), .direct)
1015 else
1016 null;
1017 return try cg.unionInit(ty, active_field, payload);
1018 },
1019 .memoized_call => unreachable,
1020 }
1021 };
1022
1023 try cg.module.intern_map.putNoClobber(gpa, .{ val.toIntern(), repr }, cacheable_id);
1024
1025 return cacheable_id;
1026}
1027
1028fn constantPtr(cg: *CodeGen, ptr_val: Value) !Id {
1029 const pt = cg.pt;
1030 const zcu = cg.module.zcu;
1031 const gpa = cg.module.gpa;
1032
1033 if (ptr_val.isUndef(zcu)) {
1034 const result_ty = ptr_val.typeOf(zcu);
1035 const result_ty_id = try cg.resolveType(result_ty, .direct);
1036 return cg.module.constUndef(result_ty_id);
1037 }
1038
1039 var arena = std.heap.ArenaAllocator.init(gpa);
1040 defer arena.deinit();
1041
1042 const derivation = try ptr_val.pointerDerivation(arena.allocator(), pt);
1043 return cg.derivePtr(derivation);
1044}
1045
1046fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
1047 const pt = cg.pt;
1048 const zcu = cg.module.zcu;
1049 switch (derivation) {
1050 .comptime_alloc_ptr, .comptime_field_ptr => unreachable,
1051 .int => |int| {
1052 const result_ty_id = try cg.resolveType(int.ptr_ty, .direct);
1053 // TODO: This can probably be an OpSpecConstantOp Bitcast, but
1054 // that is not implemented by Mesa yet. Therefore, just generate it
1055 // as a runtime operation.
1056 const result_ptr_id = cg.module.allocId();
1057 const value_id = try cg.constInt(.usize, int.addr);
1058 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
1059 .id_result_type = result_ty_id,
1060 .id_result = result_ptr_id,
1061 .integer_value = value_id,
1062 });
1063 return result_ptr_id;
1064 },
1065 .nav_ptr => |nav| {
1066 const result_ptr_ty = try pt.navPtrType(nav);
1067 return cg.constantNavRef(result_ptr_ty, nav);
1068 },
1069 .uav_ptr => |uav| {
1070 const result_ptr_ty: Type = .fromInterned(uav.orig_ty);
1071 return cg.constantUavRef(result_ptr_ty, uav);
1072 },
1073 .eu_payload_ptr => @panic("TODO"),
1074 .opt_payload_ptr => @panic("TODO"),
1075 .field_ptr => |field| {
1076 const parent_ptr_id = try cg.derivePtr(field.parent.*);
1077 const parent_ptr_ty = try field.parent.ptrType(pt);
1078 return cg.structFieldPtr(field.result_ptr_ty, parent_ptr_ty, parent_ptr_id, field.field_idx);
1079 },
1080 .elem_ptr => |elem| {
1081 const parent_ptr_id = try cg.derivePtr(elem.parent.*);
1082 const parent_ptr_ty = try elem.parent.ptrType(pt);
1083 const index_id = try cg.constInt(.usize, elem.elem_idx);
1084 return cg.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id);
1085 },
1086 .offset_and_cast => |oac| {
1087 const parent_ptr_id = try cg.derivePtr(oac.parent.*);
1088 const parent_ptr_ty = try oac.parent.ptrType(pt);
1089 const result_ty_id = try cg.resolveType(oac.new_ptr_ty, .direct);
1090 const child_size = oac.new_ptr_ty.childType(zcu).abiSize(zcu);
1091
1092 if (parent_ptr_ty.childType(zcu).isVector(zcu) and oac.byte_offset % child_size == 0) {
1093 // Vector element ptr accesses are derived as offset_and_cast.
1094 // We can just use OpAccessChain.
1095 return cg.accessChain(
1096 result_ty_id,
1097 parent_ptr_id,
1098 &.{@intCast(@divExact(oac.byte_offset, child_size))},
1099 );
1100 }
1101
1102 if (oac.byte_offset == 0) {
1103 // Allow changing the pointer type child only to restructure arrays.
1104 // e.g. [3][2]T to T is fine, as is [2]T -> [2][1]T.
1105 const result_ptr_id = cg.module.allocId();
1106 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1107 .id_result_type = result_ty_id,
1108 .id_result = result_ptr_id,
1109 .operand = parent_ptr_id,
1110 });
1111 return result_ptr_id;
1112 }
1113
1114 return cg.fail("cannot perform pointer cast: '{f}' to '{f}'", .{
1115 parent_ptr_ty.fmt(pt),
1116 oac.new_ptr_ty.fmt(pt),
1117 });
1118 },
1119 }
1120}
1121
1122fn constantUavRef(
1123 cg: *CodeGen,
1124 ty: Type,
1125 uav: InternPool.Key.Ptr.BaseAddr.Uav,
1126) !Id {
1127 // TODO: Merge this function with constantDeclRef.
1128
1129 const zcu = cg.module.zcu;
1130 const ip = &zcu.intern_pool;
1131 const ty_id = try cg.resolveType(ty, .direct);
1132 const uav_ty: Type = .fromInterned(ip.typeOf(uav.val));
1133
1134 switch (ip.indexToKey(uav.val)) {
1135 .func => unreachable, // TODO
1136 .@"extern" => assert(!ip.isFunctionType(uav_ty.toIntern())),
1137 else => {},
1138 }
1139
1140 // const is_fn_body = decl_ty.zigTypeTag(zcu) == .@"fn";
1141 if (!uav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1142 // Pointer to nothing - return undefined
1143 return cg.module.constUndef(ty_id);
1144 }
1145
1146 // Uav refs are always generic.
1147 assert(ty.ptrAddressSpace(zcu) == .generic);
1148 const uav_ty_id = try cg.resolveType(uav_ty, .indirect);
1149 const decl_ptr_ty_id = try cg.module.ptrType(uav_ty_id, .generic);
1150 const ptr_id = try cg.resolveUav(uav.val);
1151
1152 if (decl_ptr_ty_id != ty_id) {
1153 // Differing pointer types, insert a cast.
1154 const casted_ptr_id = cg.module.allocId();
1155 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1156 .id_result_type = ty_id,
1157 .id_result = casted_ptr_id,
1158 .operand = ptr_id,
1159 });
1160 return casted_ptr_id;
1161 } else {
1162 return ptr_id;
1163 }
1164}
1165
1166fn constantNavRef(cg: *CodeGen, ty: Type, nav_index: InternPool.Nav.Index) !Id {
1167 const zcu = cg.module.zcu;
1168 const ip = &zcu.intern_pool;
1169 const ty_id = try cg.resolveType(ty, .direct);
1170 const nav = ip.getNav(nav_index);
1171 const nav_ty: Type = .fromInterned(nav.typeOf(ip));
1172
1173 switch (nav.status) {
1174 .unresolved => unreachable,
1175 .type_resolved => {}, // this is not a function or extern
1176 .fully_resolved => |r| switch (ip.indexToKey(r.val)) {
1177 .func => {
1178 // TODO: Properly lower function pointers. For now we are going to hack around it and
1179 // just generate an empty pointer. Function pointers are represented by a pointer to usize.
1180 return try cg.module.constUndef(ty_id);
1181 },
1182 .@"extern" => if (ip.isFunctionType(nav_ty.toIntern())) @panic("TODO"),
1183 else => {},
1184 },
1185 }
1186
1187 if (!nav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1188 // Pointer to nothing - return undefined.
1189 return cg.module.constUndef(ty_id);
1190 }
1191
1192 const spv_decl_index = try cg.module.resolveNav(ip, nav_index);
1193 const spv_decl = cg.module.declPtr(spv_decl_index);
1194 assert(spv_decl.kind != .func);
1195
1196 const storage_class = cg.module.storageClass(nav.getAddrspace());
1197 try cg.addFunctionDep(spv_decl_index, storage_class);
1198
1199 const nav_ty_id = try cg.resolveType(nav_ty, .indirect);
1200 const decl_ptr_ty_id = try cg.module.ptrType(nav_ty_id, storage_class);
1201
1202 if (decl_ptr_ty_id != ty_id) {
1203 // Differing pointer types, insert a cast.
1204 const casted_ptr_id = cg.module.allocId();
1205 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1206 .id_result_type = ty_id,
1207 .id_result = casted_ptr_id,
1208 .operand = spv_decl.result_id,
1209 });
1210 return casted_ptr_id;
1211 }
1212
1213 return spv_decl.result_id;
1214}
1215
1216// Turn a Zig type's name into a cache reference.
1217fn resolveTypeName(cg: *CodeGen, ty: Type) ![]const u8 {
1218 const gpa = cg.module.gpa;
1219 var aw: std.io.Writer.Allocating = .init(gpa);
1220 defer aw.deinit();
1221 ty.print(&aw.writer, cg.pt) catch |err| switch (err) {
1222 error.WriteFailed => return error.OutOfMemory,
1223 };
1224 return try aw.toOwnedSlice();
1225}
1226
1227/// Generate a union type. Union types are always generated with the
1228/// most aligned field active. If the tag alignment is greater
1229/// than that of the payload, a regular union (non-packed, with both tag and
1230/// payload), will be generated as follows:
1231/// struct {
1232/// tag: TagType,
1233/// payload: MostAlignedFieldType,
1234/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1235/// padding: [padding_size]u8,
1236/// }
1237/// If the payload alignment is greater than that of the tag:
1238/// struct {
1239/// payload: MostAlignedFieldType,
1240/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1241/// tag: TagType,
1242/// padding: [padding_size]u8,
1243/// }
1244/// If any of the fields' size is 0, it will be omitted.
1245fn resolveUnionType(cg: *CodeGen, ty: Type) !Id {
1246 const gpa = cg.module.gpa;
1247 const zcu = cg.module.zcu;
1248 const ip = &zcu.intern_pool;
1249 const union_obj = zcu.typeToUnion(ty).?;
1250
1251 if (union_obj.flagsUnordered(ip).layout == .@"packed") {
1252 return try cg.module.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1253 }
1254
1255 const layout = cg.unionLayout(ty);
1256 if (!layout.has_payload) {
1257 // No payload, so represent this as just the tag type.
1258 return try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1259 }
1260
1261 var member_types: [4]Id = undefined;
1262 var member_names: [4][]const u8 = undefined;
1263
1264 const u8_ty_id = try cg.resolveType(.u8, .direct);
1265
1266 if (layout.tag_size != 0) {
1267 const tag_ty_id = try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1268 member_types[layout.tag_index] = tag_ty_id;
1269 member_names[layout.tag_index] = "(tag)";
1270 }
1271
1272 if (layout.payload_size != 0) {
1273 const payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
1274 member_types[layout.payload_index] = payload_ty_id;
1275 member_names[layout.payload_index] = "(payload)";
1276 }
1277
1278 if (layout.payload_padding_size != 0) {
1279 const len_id = try cg.constInt(.u32, layout.payload_padding_size);
1280 const payload_padding_ty_id = try cg.module.arrayType(len_id, u8_ty_id);
1281 member_types[layout.payload_padding_index] = payload_padding_ty_id;
1282 member_names[layout.payload_padding_index] = "(payload padding)";
1283 }
1284
1285 if (layout.padding_size != 0) {
1286 const len_id = try cg.constInt(.u32, layout.padding_size);
1287 const padding_ty_id = try cg.module.arrayType(len_id, u8_ty_id);
1288 member_types[layout.padding_index] = padding_ty_id;
1289 member_names[layout.padding_index] = "(padding)";
1290 }
1291
1292 const result_id = try cg.module.structType(
1293 member_types[0..layout.total_fields],
1294 member_names[0..layout.total_fields],
1295 null,
1296 .none,
1297 );
1298
1299 const type_name = try cg.resolveTypeName(ty);
1300 defer gpa.free(type_name);
1301 try cg.module.debugName(result_id, type_name);
1302
1303 return result_id;
1304}
1305
1306fn resolveFnReturnType(cg: *CodeGen, ret_ty: Type) !Id {
1307 const zcu = cg.module.zcu;
1308 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1309 // If the return type is an error set or an error union, then we make this
1310 // anyerror return type instead, so that it can be coerced into a function
1311 // pointer type which has anyerror as the return type.
1312 if (ret_ty.isError(zcu)) {
1313 return cg.resolveType(.anyerror, .direct);
1314 } else {
1315 return cg.resolveType(.void, .direct);
1316 }
1317 }
1318
1319 return try cg.resolveType(ret_ty, .direct);
1320}
1321
1322fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
1323 const gpa = cg.module.gpa;
1324 const pt = cg.pt;
1325 const zcu = cg.module.zcu;
1326 const ip = &zcu.intern_pool;
1327 const target = cg.module.zcu.getTarget();
1328
1329 log.debug("resolveType: ty = {f}", .{ty.fmt(pt)});
1330
1331 switch (ty.zigTypeTag(zcu)) {
1332 .noreturn => {
1333 assert(repr == .direct);
1334 return try cg.module.voidType();
1335 },
1336 .void => switch (repr) {
1337 .direct => return try cg.module.voidType(),
1338 .indirect => return try cg.module.opaqueType("void"),
1339 },
1340 .bool => switch (repr) {
1341 .direct => return try cg.module.boolType(),
1342 .indirect => return try cg.resolveType(.u1, .indirect),
1343 },
1344 .int => {
1345 const int_info = ty.intInfo(zcu);
1346 if (int_info.bits == 0) {
1347 assert(repr == .indirect);
1348 return try cg.module.opaqueType("u0");
1349 }
1350 return try cg.module.intType(int_info.signedness, int_info.bits);
1351 },
1352 .@"enum" => return try cg.resolveType(ty.intTagType(zcu), repr),
1353 .float => {
1354 const bits = ty.floatBits(target);
1355 const supported = switch (bits) {
1356 16 => target.cpu.has(.spirv, .float16),
1357 32 => true,
1358 64 => target.cpu.has(.spirv, .float64),
1359 else => false,
1360 };
1361
1362 if (!supported) {
1363 return cg.fail(
1364 "floating point width of {} bits is not supported for the current SPIR-V feature set",
1365 .{bits},
1366 );
1367 }
1368
1369 return try cg.module.floatType(bits);
1370 },
1371 .array => {
1372 const elem_ty = ty.childType(zcu);
1373 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
1374 const total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(zcu)) orelse {
1375 return cg.fail("array type of {} elements is too large", .{ty.arrayLenIncludingSentinel(zcu)});
1376 };
1377
1378 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1379 assert(repr == .indirect);
1380 return try cg.module.opaqueType("zero-sized-array");
1381 } else if (total_len == 0) {
1382 // The size of the array would be 0, but that is not allowed in SPIR-V.
1383 // This path can be reached for example when there is a slicing of a pointer
1384 // that produces a zero-length array. In all cases where this type can be generated,
1385 // this should be an indirect path.
1386 assert(repr == .indirect);
1387 // In this case, we have an array of a non-zero sized type. In this case,
1388 // generate an array of 1 element instead, so that ptr_elem_ptr instructions
1389 // can be lowered to ptrAccessChain instead of manually performing the math.
1390 const len_id = try cg.constInt(.u32, 1);
1391 return try cg.module.arrayType(len_id, elem_ty_id);
1392 } else {
1393 const total_len_id = try cg.constInt(.u32, total_len);
1394 const result_id = try cg.module.arrayType(total_len_id, elem_ty_id);
1395 switch (target.os.tag) {
1396 .vulkan, .opengl => {
1397 try cg.module.decorate(result_id, .{
1398 .array_stride = .{
1399 .array_stride = @intCast(elem_ty.abiSize(zcu)),
1400 },
1401 });
1402 },
1403 else => {},
1404 }
1405 return result_id;
1406 }
1407 },
1408 .vector => {
1409 const elem_ty = ty.childType(zcu);
1410 const elem_ty_id = try cg.resolveType(elem_ty, repr);
1411 const len = ty.vectorLen(zcu);
1412 if (cg.isSpvVector(ty)) return try cg.module.vectorType(len, elem_ty_id);
1413 const len_id = try cg.constInt(.u32, len);
1414 return try cg.module.arrayType(len_id, elem_ty_id);
1415 },
1416 .@"fn" => switch (repr) {
1417 .direct => {
1418 const fn_info = zcu.typeToFunc(ty).?;
1419
1420 comptime assert(zig_call_abi_ver == 3);
1421 assert(!fn_info.is_var_args);
1422 switch (fn_info.cc) {
1423 .auto,
1424 .spirv_kernel,
1425 .spirv_fragment,
1426 .spirv_vertex,
1427 .spirv_device,
1428 => {},
1429 else => unreachable,
1430 }
1431
1432 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
1433 const param_ty_ids = try gpa.alloc(Id, fn_info.param_types.len);
1434 defer gpa.free(param_ty_ids);
1435 var param_index: usize = 0;
1436 for (fn_info.param_types.get(ip)) |param_ty_index| {
1437 const param_ty: Type = .fromInterned(param_ty_index);
1438 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1439
1440 param_ty_ids[param_index] = try cg.resolveType(param_ty, .direct);
1441 param_index += 1;
1442 }
1443
1444 return try cg.module.functionType(return_ty_id, param_ty_ids[0..param_index]);
1445 },
1446 .indirect => {
1447 // TODO: Represent function pointers properly.
1448 // For now, just use an usize type.
1449 return try cg.resolveType(.usize, .indirect);
1450 },
1451 },
1452 .pointer => {
1453 const ptr_info = ty.ptrInfo(zcu);
1454
1455 const child_ty: Type = .fromInterned(ptr_info.child);
1456 const child_ty_id = try cg.resolveType(child_ty, .indirect);
1457 const storage_class = cg.module.storageClass(ptr_info.flags.address_space);
1458 const ptr_ty_id = try cg.module.ptrType(child_ty_id, storage_class);
1459
1460 if (ptr_info.flags.size != .slice) {
1461 return ptr_ty_id;
1462 }
1463
1464 const size_ty_id = try cg.resolveType(.usize, .direct);
1465 return try cg.module.structType(
1466 &.{ ptr_ty_id, size_ty_id },
1467 &.{ "ptr", "len" },
1468 null,
1469 .none,
1470 );
1471 },
1472 .@"struct" => {
1473 const struct_type = switch (ip.indexToKey(ty.toIntern())) {
1474 .tuple_type => |tuple| {
1475 const member_types = try gpa.alloc(Id, tuple.values.len);
1476 defer gpa.free(member_types);
1477
1478 var member_index: usize = 0;
1479 for (tuple.types.get(ip), tuple.values.get(ip)) |field_ty, field_val| {
1480 if (field_val != .none or !Type.fromInterned(field_ty).hasRuntimeBits(zcu)) continue;
1481
1482 member_types[member_index] = try cg.resolveType(.fromInterned(field_ty), .indirect);
1483 member_index += 1;
1484 }
1485
1486 const result_id = try cg.module.structType(
1487 member_types[0..member_index],
1488 null,
1489 null,
1490 .none,
1491 );
1492 const type_name = try cg.resolveTypeName(ty);
1493 defer gpa.free(type_name);
1494 try cg.module.debugName(result_id, type_name);
1495 return result_id;
1496 },
1497 .struct_type => ip.loadStructType(ty.toIntern()),
1498 else => unreachable,
1499 };
1500
1501 if (struct_type.layout == .@"packed") {
1502 return try cg.resolveType(.fromInterned(struct_type.backingIntTypeUnordered(ip)), .direct);
1503 }
1504
1505 var member_types = std.ArrayList(Id).init(gpa);
1506 defer member_types.deinit();
1507
1508 var member_names = std.ArrayList([]const u8).init(gpa);
1509 defer member_names.deinit();
1510
1511 var member_offsets = std.ArrayList(u32).init(gpa);
1512 defer member_offsets.deinit();
1513
1514 var it = struct_type.iterateRuntimeOrder(ip);
1515 while (it.next()) |field_index| {
1516 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
1517 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1518
1519 const field_name = struct_type.fieldName(ip, field_index).unwrap() orelse
1520 try ip.getOrPutStringFmt(zcu.gpa, pt.tid, "{d}", .{field_index}, .no_embedded_nulls);
1521 try member_types.append(try cg.resolveType(field_ty, .indirect));
1522 try member_names.append(field_name.toSlice(ip));
1523 try member_offsets.append(@intCast(ty.structFieldOffset(field_index, zcu)));
1524 }
1525
1526 const result_id = try cg.module.structType(
1527 member_types.items,
1528 member_names.items,
1529 member_offsets.items,
1530 ty.toIntern(),
1531 );
1532
1533 const type_name = try cg.resolveTypeName(ty);
1534 defer gpa.free(type_name);
1535 try cg.module.debugName(result_id, type_name);
1536
1537 return result_id;
1538 },
1539 .optional => {
1540 const payload_ty = ty.optionalChild(zcu);
1541 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1542 // Just use a bool.
1543 // Note: Always generate the bool with indirect format, to save on some sanity
1544 // Perform the conversion to a direct bool when the field is extracted.
1545 return try cg.resolveType(.bool, .indirect);
1546 }
1547
1548 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1549 if (ty.optionalReprIsPayload(zcu)) {
1550 // Optional is actually a pointer or a slice.
1551 return payload_ty_id;
1552 }
1553
1554 const bool_ty_id = try cg.resolveType(.bool, .indirect);
1555
1556 return try cg.module.structType(
1557 &.{ payload_ty_id, bool_ty_id },
1558 &.{ "payload", "valid" },
1559 null,
1560 .none,
1561 );
1562 },
1563 .@"union" => return try cg.resolveUnionType(ty),
1564 .error_set => {
1565 const err_int_ty = try pt.errorIntType();
1566 return try cg.resolveType(err_int_ty, repr);
1567 },
1568 .error_union => {
1569 const payload_ty = ty.errorUnionPayload(zcu);
1570 const err_ty = ty.errorUnionSet(zcu);
1571 const error_ty_id = try cg.resolveType(err_ty, .indirect);
1572
1573 const eu_layout = cg.errorUnionLayout(payload_ty);
1574 if (!eu_layout.payload_has_bits) {
1575 return error_ty_id;
1576 }
1577
1578 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1579
1580 var member_types: [2]Id = undefined;
1581 var member_names: [2][]const u8 = undefined;
1582 if (eu_layout.error_first) {
1583 // Put the error first
1584 member_types = .{ error_ty_id, payload_ty_id };
1585 member_names = .{ "error", "payload" };
1586 // TODO: ABI padding?
1587 } else {
1588 // Put the payload first.
1589 member_types = .{ payload_ty_id, error_ty_id };
1590 member_names = .{ "payload", "error" };
1591 // TODO: ABI padding?
1592 }
1593
1594 return try cg.module.structType(&member_types, &member_names, null, .none);
1595 },
1596 .@"opaque" => {
1597 const type_name = try cg.resolveTypeName(ty);
1598 defer gpa.free(type_name);
1599 return try cg.module.opaqueType(type_name);
1600 },
1601
1602 .null,
1603 .undefined,
1604 .enum_literal,
1605 .comptime_float,
1606 .comptime_int,
1607 .type,
1608 => unreachable, // Must be comptime.
1609
1610 .frame, .@"anyframe" => unreachable, // TODO
1611 }
1612}
1613
1614const ErrorUnionLayout = struct {
1615 payload_has_bits: bool,
1616 error_first: bool,
1617
1618 fn errorFieldIndex(cg: @This()) u32 {
1619 assert(cg.payload_has_bits);
1620 return if (cg.error_first) 0 else 1;
1621 }
1622
1623 fn payloadFieldIndex(cg: @This()) u32 {
1624 assert(cg.payload_has_bits);
1625 return if (cg.error_first) 1 else 0;
1626 }
1627};
1628
1629fn errorUnionLayout(cg: *CodeGen, payload_ty: Type) ErrorUnionLayout {
1630 const zcu = cg.module.zcu;
1631
1632 const error_align = Type.abiAlignment(.anyerror, zcu);
1633 const payload_align = payload_ty.abiAlignment(zcu);
1634
1635 const error_first = error_align.compare(.gt, payload_align);
1636 return .{
1637 .payload_has_bits = payload_ty.hasRuntimeBitsIgnoreComptime(zcu),
1638 .error_first = error_first,
1639 };
1640}
1641
1642const UnionLayout = struct {
1643 /// If false, this union is represented
1644 /// by only an integer of the tag type.
1645 has_payload: bool,
1646 tag_size: u32,
1647 tag_index: u32,
1648 /// Note: This is the size of the payload type itcg, NOT the size of the ENTIRE payload.
1649 /// Use `has_payload` instead!!
1650 payload_ty: Type,
1651 payload_size: u32,
1652 payload_index: u32,
1653 payload_padding_size: u32,
1654 payload_padding_index: u32,
1655 padding_size: u32,
1656 padding_index: u32,
1657 total_fields: u32,
1658};
1659
1660fn unionLayout(cg: *CodeGen, ty: Type) UnionLayout {
1661 const zcu = cg.module.zcu;
1662 const ip = &zcu.intern_pool;
1663 const layout = ty.unionGetLayout(zcu);
1664 const union_obj = zcu.typeToUnion(ty).?;
1665
1666 var union_layout: UnionLayout = .{
1667 .has_payload = layout.payload_size != 0,
1668 .tag_size = @intCast(layout.tag_size),
1669 .tag_index = undefined,
1670 .payload_ty = undefined,
1671 .payload_size = undefined,
1672 .payload_index = undefined,
1673 .payload_padding_size = undefined,
1674 .payload_padding_index = undefined,
1675 .padding_size = @intCast(layout.padding),
1676 .padding_index = undefined,
1677 .total_fields = undefined,
1678 };
1679
1680 if (union_layout.has_payload) {
1681 const most_aligned_field = layout.most_aligned_field;
1682 const most_aligned_field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[most_aligned_field]);
1683 union_layout.payload_ty = most_aligned_field_ty;
1684 union_layout.payload_size = @intCast(most_aligned_field_ty.abiSize(zcu));
1685 } else {
1686 union_layout.payload_size = 0;
1687 }
1688
1689 union_layout.payload_padding_size = @intCast(layout.payload_size - union_layout.payload_size);
1690
1691 const tag_first = layout.tag_align.compare(.gte, layout.payload_align);
1692 var field_index: u32 = 0;
1693
1694 if (union_layout.tag_size != 0 and tag_first) {
1695 union_layout.tag_index = field_index;
1696 field_index += 1;
1697 }
1698
1699 if (union_layout.payload_size != 0) {
1700 union_layout.payload_index = field_index;
1701 field_index += 1;
1702 }
1703
1704 if (union_layout.payload_padding_size != 0) {
1705 union_layout.payload_padding_index = field_index;
1706 field_index += 1;
1707 }
1708
1709 if (union_layout.tag_size != 0 and !tag_first) {
1710 union_layout.tag_index = field_index;
1711 field_index += 1;
1712 }
1713
1714 if (union_layout.padding_size != 0) {
1715 union_layout.padding_index = field_index;
1716 field_index += 1;
1717 }
1718
1719 union_layout.total_fields = field_index;
1720
1721 return union_layout;
1722}
1723
1724/// This structure represents a "temporary" value: Something we are currently
1725/// operating on. It typically lives no longer than the function that
1726/// implements a particular AIR operation. These are used to easier
1727/// implement vectorizable operations (see Vectorization and the build*
1728/// functions), and typically are only used for vectors of primitive types.
1729const Temporary = struct {
1730 /// The type of the temporary. This is here mainly
1731 /// for easier bookkeeping. Because we will never really
1732 /// store Temporaries, they only cause extra stack space,
1733 /// therefore no real storage is wasted.
1734 ty: Type,
1735 /// The value that this temporary holds. This is not necessarily
1736 /// a value that is actually usable, or a single value: It is virtual
1737 /// until materialize() is called, at which point is turned into
1738 /// the usual SPIR-V representation of `cg.ty`.
1739 value: Temporary.Value,
1740
1741 const Value = union(enum) {
1742 singleton: Id,
1743 exploded_vector: IdRange,
1744 };
1745
1746 fn init(ty: Type, singleton: Id) Temporary {
1747 return .{ .ty = ty, .value = .{ .singleton = singleton } };
1748 }
1749
1750 fn materialize(temp: Temporary, cg: *CodeGen) !Id {
1751 const gpa = cg.module.gpa;
1752 const zcu = cg.module.zcu;
1753 switch (temp.value) {
1754 .singleton => |id| return id,
1755 .exploded_vector => |range| {
1756 assert(temp.ty.isVector(zcu));
1757 assert(temp.ty.vectorLen(zcu) == range.len);
1758 const constituents = try gpa.alloc(Id, range.len);
1759 defer gpa.free(constituents);
1760 for (constituents, 0..range.len) |*id, i| {
1761 id.* = range.at(i);
1762 }
1763 const result_ty_id = try cg.resolveType(temp.ty, .direct);
1764 return cg.constructComposite(result_ty_id, constituents);
1765 },
1766 }
1767 }
1768
1769 fn vectorization(temp: Temporary, cg: *CodeGen) Vectorization {
1770 return .fromType(temp.ty, cg);
1771 }
1772
1773 fn pun(temp: Temporary, new_ty: Type) Temporary {
1774 return .{
1775 .ty = new_ty,
1776 .value = temp.value,
1777 };
1778 }
1779
1780 /// 'Explode' a temporary into separate elements. This turns a vector
1781 /// into a bag of elements.
1782 fn explode(temp: Temporary, cg: *CodeGen) !IdRange {
1783 const zcu = cg.module.zcu;
1784
1785 // If the value is a scalar, then this is a no-op.
1786 if (!temp.ty.isVector(zcu)) {
1787 return switch (temp.value) {
1788 .singleton => |id| .{ .base = @intFromEnum(id), .len = 1 },
1789 .exploded_vector => |range| range,
1790 };
1791 }
1792
1793 const ty_id = try cg.resolveType(temp.ty.scalarType(zcu), .direct);
1794 const n = temp.ty.vectorLen(zcu);
1795 const results = cg.module.allocIds(n);
1796
1797 const id = switch (temp.value) {
1798 .singleton => |id| id,
1799 .exploded_vector => |range| return range,
1800 };
1801
1802 for (0..n) |i| {
1803 const indexes = [_]u32{@intCast(i)};
1804 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
1805 .id_result_type = ty_id,
1806 .id_result = results.at(i),
1807 .composite = id,
1808 .indexes = &indexes,
1809 });
1810 }
1811
1812 return results;
1813 }
1814};
1815
1816/// Initialize a `Temporary` from an AIR value.
1817fn temporary(cg: *CodeGen, inst: Air.Inst.Ref) !Temporary {
1818 return .{
1819 .ty = cg.typeOf(inst),
1820 .value = .{ .singleton = try cg.resolve(inst) },
1821 };
1822}
1823
1824/// This union describes how a particular operation should be vectorized.
1825/// That depends on the operation and number of components of the inputs.
1826const Vectorization = union(enum) {
1827 /// This is an operation between scalars.
1828 scalar,
1829 /// This operation is unrolled into separate operations.
1830 /// Inputs may still be SPIR-V vectors, for example,
1831 /// when the operation can't be vectorized in SPIR-V.
1832 /// Value is number of components.
1833 unrolled: u32,
1834
1835 /// Derive a vectorization from a particular type
1836 fn fromType(ty: Type, cg: *CodeGen) Vectorization {
1837 const zcu = cg.module.zcu;
1838 if (!ty.isVector(zcu)) return .scalar;
1839 return .{ .unrolled = ty.vectorLen(zcu) };
1840 }
1841
1842 /// Given two vectorization methods, compute a "unification": a fallback
1843 /// that works for both, according to the following rules:
1844 /// - Scalars may broadcast
1845 /// - SPIR-V vectorized operations will unroll
1846 /// - Prefer scalar > unrolled
1847 fn unify(a: Vectorization, b: Vectorization) Vectorization {
1848 if (a == .scalar and b == .scalar) return .scalar;
1849 if (a == .unrolled or b == .unrolled) {
1850 if (a == .unrolled and b == .unrolled) assert(a.components() == b.components());
1851 if (a == .unrolled) return .{ .unrolled = a.components() };
1852 return .{ .unrolled = b.components() };
1853 }
1854 unreachable;
1855 }
1856
1857 /// Query the number of components that inputs of this operation have.
1858 /// Note: for broadcasting scalars, this returns the number of elements
1859 /// that the broadcasted vector would have.
1860 fn components(vec: Vectorization) u32 {
1861 return switch (vec) {
1862 .scalar => 1,
1863 .unrolled => |n| n,
1864 };
1865 }
1866
1867 /// Turns `ty` into the result-type of the entire operation.
1868 /// `ty` may be a scalar or vector, it doesn't matter.
1869 fn resultType(vec: Vectorization, cg: *CodeGen, ty: Type) !Type {
1870 const pt = cg.pt;
1871 const zcu = cg.module.zcu;
1872 const scalar_ty = ty.scalarType(zcu);
1873 return switch (vec) {
1874 .scalar => scalar_ty,
1875 .unrolled => |n| try pt.vectorType(.{ .len = n, .child = scalar_ty.toIntern() }),
1876 };
1877 }
1878
1879 /// Before a temporary can be used, some setup may need to be one. This function implements
1880 /// this setup, and returns a new type that holds the relevant information on how to access
1881 /// elements of the input.
1882 fn prepare(vec: Vectorization, cg: *CodeGen, tmp: Temporary) !PreparedOperand {
1883 const zcu = cg.module.zcu;
1884 const is_vector = tmp.ty.isVector(zcu);
1885 const value: PreparedOperand.Value = switch (tmp.value) {
1886 .singleton => |id| switch (vec) {
1887 .scalar => blk: {
1888 assert(!is_vector);
1889 break :blk .{ .scalar = id };
1890 },
1891 .unrolled => blk: {
1892 if (is_vector) break :blk .{ .vector_exploded = try tmp.explode(cg) };
1893 break :blk .{ .scalar_broadcast = id };
1894 },
1895 },
1896 .exploded_vector => |range| switch (vec) {
1897 .scalar => unreachable,
1898 .unrolled => |n| blk: {
1899 assert(range.len == n);
1900 break :blk .{ .vector_exploded = range };
1901 },
1902 },
1903 };
1904
1905 return .{
1906 .ty = tmp.ty,
1907 .value = value,
1908 };
1909 }
1910
1911 /// Finalize the results of an operation back into a temporary. `results` is
1912 /// a list of result-ids of the operation.
1913 fn finalize(vec: Vectorization, ty: Type, results: IdRange) Temporary {
1914 assert(vec.components() == results.len);
1915 return .{
1916 .ty = ty,
1917 .value = switch (vec) {
1918 .scalar => .{ .singleton = results.at(0) },
1919 .unrolled => .{ .exploded_vector = results },
1920 },
1921 };
1922 }
1923
1924 /// This struct represents an operand that has gone through some setup, and is
1925 /// ready to be used as part of an operation.
1926 const PreparedOperand = struct {
1927 ty: Type,
1928 value: PreparedOperand.Value,
1929
1930 /// The types of value that a prepared operand can hold internally. Depends
1931 /// on the operation and input value.
1932 const Value = union(enum) {
1933 /// A single scalar value that is used by a scalar operation.
1934 scalar: Id,
1935 /// A single scalar that is broadcasted in an unrolled operation.
1936 scalar_broadcast: Id,
1937 /// A vector represented by a consecutive list of IDs that is used in an unrolled operation.
1938 vector_exploded: IdRange,
1939 };
1940
1941 /// Query the value at a particular index of the operation. Note that
1942 /// the index is *not* the component/lane, but the index of the *operation*.
1943 fn at(op: PreparedOperand, i: usize) Id {
1944 switch (op.value) {
1945 .scalar => |id| {
1946 assert(i == 0);
1947 return id;
1948 },
1949 .scalar_broadcast => |id| return id,
1950 .vector_exploded => |range| return range.at(i),
1951 }
1952 }
1953 };
1954};
1955
1956/// A utility function to compute the vectorization style of
1957/// a list of values. These values may be any of the following:
1958/// - A `Vectorization` instance
1959/// - A Type, in which case the vectorization is computed via `Vectorization.fromType`.
1960/// - A Temporary, in which case the vectorization is computed via `Temporary.vectorization`.
1961fn vectorization(cg: *CodeGen, args: anytype) Vectorization {
1962 var v: Vectorization = undefined;
1963 assert(args.len >= 1);
1964 inline for (args, 0..) |arg, i| {
1965 const iv: Vectorization = switch (@TypeOf(arg)) {
1966 Vectorization => arg,
1967 Type => Vectorization.fromType(arg, cg),
1968 Temporary => arg.vectorization(cg),
1969 else => @compileError("invalid type"),
1970 };
1971 if (i == 0) {
1972 v = iv;
1973 } else {
1974 v = v.unify(iv);
1975 }
1976 }
1977 return v;
1978}
1979
1980/// This function builds an OpSConvert of OpUConvert depending on the
1981/// signedness of the types.
1982fn buildConvert(cg: *CodeGen, dst_ty: Type, src: Temporary) !Temporary {
1983 const zcu = cg.module.zcu;
1984
1985 const dst_ty_id = try cg.resolveType(dst_ty.scalarType(zcu), .direct);
1986 const src_ty_id = try cg.resolveType(src.ty.scalarType(zcu), .direct);
1987
1988 const v = cg.vectorization(.{ dst_ty, src });
1989 const result_ty = try v.resultType(cg, dst_ty);
1990
1991 // We can directly compare integers, because those type-IDs are cached.
1992 if (dst_ty_id == src_ty_id) {
1993 // Nothing to do, type-pun to the right value.
1994 // Note, Caller guarantees that the types fit (or caller will normalize after),
1995 // so we don't have to normalize here.
1996 // Note, dst_ty may be a scalar type even if we expect a vector, so we have to
1997 // convert to the right type here.
1998 return src.pun(result_ty);
1999 }
2000
2001 const ops = v.components();
2002 const results = cg.module.allocIds(ops);
2003
2004 const op_result_ty = dst_ty.scalarType(zcu);
2005 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2006
2007 const opcode: Opcode = blk: {
2008 if (dst_ty.scalarType(zcu).isAnyFloat()) break :blk .OpFConvert;
2009 if (dst_ty.scalarType(zcu).isSignedInt(zcu)) break :blk .OpSConvert;
2010 break :blk .OpUConvert;
2011 };
2012
2013 const op_src = try v.prepare(cg, src);
2014
2015 for (0..ops) |i| {
2016 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2017 cg.body.writeOperand(Id, op_result_ty_id);
2018 cg.body.writeOperand(Id, results.at(i));
2019 cg.body.writeOperand(Id, op_src.at(i));
2020 }
2021
2022 return v.finalize(result_ty, results);
2023}
2024
2025fn buildFma(cg: *CodeGen, a: Temporary, b: Temporary, c: Temporary) !Temporary {
2026 const zcu = cg.module.zcu;
2027 const target = cg.module.zcu.getTarget();
2028
2029 const v = cg.vectorization(.{ a, b, c });
2030 const ops = v.components();
2031 const results = cg.module.allocIds(ops);
2032
2033 const op_result_ty = a.ty.scalarType(zcu);
2034 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2035 const result_ty = try v.resultType(cg, a.ty);
2036
2037 const op_a = try v.prepare(cg, a);
2038 const op_b = try v.prepare(cg, b);
2039 const op_c = try v.prepare(cg, c);
2040
2041 const set = try cg.importExtendedSet();
2042
2043 // TODO: Put these numbers in some definition
2044 const instruction: u32 = switch (target.os.tag) {
2045 .opencl => 26, // fma
2046 // NOTE: Vulkan's FMA instruction does *NOT* produce the right values!
2047 // its precision guarantees do NOT match zigs and it does NOT match OpenCLs!
2048 // it needs to be emulated!
2049 .vulkan, .opengl => return cg.todo("implement fma operation for {s} os", .{@tagName(target.os.tag)}),
2050 else => unreachable,
2051 };
2052
2053 for (0..ops) |i| {
2054 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2055 .id_result_type = op_result_ty_id,
2056 .id_result = results.at(i),
2057 .set = set,
2058 .instruction = .{ .inst = instruction },
2059 .id_ref_4 = &.{ op_a.at(i), op_b.at(i), op_c.at(i) },
2060 });
2061 }
2062
2063 return v.finalize(result_ty, results);
2064}
2065
2066fn buildSelect(cg: *CodeGen, condition: Temporary, lhs: Temporary, rhs: Temporary) !Temporary {
2067 const zcu = cg.module.zcu;
2068
2069 const v = cg.vectorization(.{ condition, lhs, rhs });
2070 const ops = v.components();
2071 const results = cg.module.allocIds(ops);
2072
2073 const op_result_ty = lhs.ty.scalarType(zcu);
2074 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2075 const result_ty = try v.resultType(cg, lhs.ty);
2076
2077 assert(condition.ty.scalarType(zcu).zigTypeTag(zcu) == .bool);
2078
2079 const cond = try v.prepare(cg, condition);
2080 const object_1 = try v.prepare(cg, lhs);
2081 const object_2 = try v.prepare(cg, rhs);
2082
2083 for (0..ops) |i| {
2084 try cg.body.emit(cg.module.gpa, .OpSelect, .{
2085 .id_result_type = op_result_ty_id,
2086 .id_result = results.at(i),
2087 .condition = cond.at(i),
2088 .object_1 = object_1.at(i),
2089 .object_2 = object_2.at(i),
2090 });
2091 }
2092
2093 return v.finalize(result_ty, results);
2094}
2095
2096fn buildCmp(cg: *CodeGen, opcode: Opcode, lhs: Temporary, rhs: Temporary) !Temporary {
2097 const v = cg.vectorization(.{ lhs, rhs });
2098 const ops = v.components();
2099 const results = cg.module.allocIds(ops);
2100
2101 const op_result_ty: Type = .bool;
2102 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2103 const result_ty = try v.resultType(cg, Type.bool);
2104
2105 const op_lhs = try v.prepare(cg, lhs);
2106 const op_rhs = try v.prepare(cg, rhs);
2107
2108 for (0..ops) |i| {
2109 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2110 cg.body.writeOperand(Id, op_result_ty_id);
2111 cg.body.writeOperand(Id, results.at(i));
2112 cg.body.writeOperand(Id, op_lhs.at(i));
2113 cg.body.writeOperand(Id, op_rhs.at(i));
2114 }
2115
2116 return v.finalize(result_ty, results);
2117}
2118
2119const UnaryOp = enum {
2120 l_not,
2121 bit_not,
2122 i_neg,
2123 f_neg,
2124 i_abs,
2125 f_abs,
2126 clz,
2127 ctz,
2128 floor,
2129 ceil,
2130 trunc,
2131 round,
2132 sqrt,
2133 sin,
2134 cos,
2135 tan,
2136 exp,
2137 exp2,
2138 log,
2139 log2,
2140 log10,
2141};
2142
2143fn buildUnary(cg: *CodeGen, op: UnaryOp, operand: Temporary) !Temporary {
2144 const zcu = cg.module.zcu;
2145 const target = cg.module.zcu.getTarget();
2146 const v = cg.vectorization(.{operand});
2147 const ops = v.components();
2148 const results = cg.module.allocIds(ops);
2149 const op_result_ty = operand.ty.scalarType(zcu);
2150 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2151 const result_ty = try v.resultType(cg, operand.ty);
2152
2153 const op_operand = try v.prepare(cg, operand);
2154
2155 if (switch (op) {
2156 .l_not => .OpLogicalNot,
2157 .bit_not => .OpNot,
2158 .i_neg => .OpSNegate,
2159 .f_neg => .OpFNegate,
2160 else => @as(?Opcode, null),
2161 }) |opcode| {
2162 for (0..ops) |i| {
2163 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2164 cg.body.writeOperand(Id, op_result_ty_id);
2165 cg.body.writeOperand(Id, results.at(i));
2166 cg.body.writeOperand(Id, op_operand.at(i));
2167 }
2168 } else {
2169 const set = try cg.importExtendedSet();
2170 const extinst: u32 = switch (target.os.tag) {
2171 .opencl => switch (op) {
2172 .i_abs => 141, // s_abs
2173 .f_abs => 23, // fabs
2174 .clz => 151, // clz
2175 .ctz => 152, // ctz
2176 .floor => 25, // floor
2177 .ceil => 12, // ceil
2178 .trunc => 66, // trunc
2179 .round => 55, // round
2180 .sqrt => 61, // sqrt
2181 .sin => 57, // sin
2182 .cos => 14, // cos
2183 .tan => 62, // tan
2184 .exp => 19, // exp
2185 .exp2 => 20, // exp2
2186 .log => 37, // log
2187 .log2 => 38, // log2
2188 .log10 => 39, // log10
2189 else => unreachable,
2190 },
2191 // Note: We'll need to check these for floating point accuracy
2192 // Vulkan does not put tight requirements on these, for correction
2193 // we might want to emulate them at some point.
2194 .vulkan, .opengl => switch (op) {
2195 .i_abs => 5, // SAbs
2196 .f_abs => 4, // FAbs
2197 .floor => 8, // Floor
2198 .ceil => 9, // Ceil
2199 .trunc => 3, // Trunc
2200 .round => 1, // Round
2201 .clz,
2202 .ctz,
2203 .sqrt,
2204 .sin,
2205 .cos,
2206 .tan,
2207 .exp,
2208 .exp2,
2209 .log,
2210 .log2,
2211 .log10,
2212 => return cg.todo(
2213 "implement unary operation '{s}' for {s} os",
2214 .{ @tagName(op), @tagName(target.os.tag) },
2215 ),
2216 else => unreachable,
2217 },
2218 else => unreachable,
2219 };
2220
2221 for (0..ops) |i| {
2222 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2223 .id_result_type = op_result_ty_id,
2224 .id_result = results.at(i),
2225 .set = set,
2226 .instruction = .{ .inst = extinst },
2227 .id_ref_4 = &.{op_operand.at(i)},
2228 });
2229 }
2230 }
2231
2232 return v.finalize(result_ty, results);
2233}
2234
2235fn buildBinary(cg: *CodeGen, opcode: Opcode, lhs: Temporary, rhs: Temporary) !Temporary {
2236 const zcu = cg.module.zcu;
2237
2238 const v = cg.vectorization(.{ lhs, rhs });
2239 const ops = v.components();
2240 const results = cg.module.allocIds(ops);
2241
2242 const op_result_ty = lhs.ty.scalarType(zcu);
2243 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2244 const result_ty = try v.resultType(cg, lhs.ty);
2245
2246 const op_lhs = try v.prepare(cg, lhs);
2247 const op_rhs = try v.prepare(cg, rhs);
2248
2249 for (0..ops) |i| {
2250 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2251 cg.body.writeOperand(Id, op_result_ty_id);
2252 cg.body.writeOperand(Id, results.at(i));
2253 cg.body.writeOperand(Id, op_lhs.at(i));
2254 cg.body.writeOperand(Id, op_rhs.at(i));
2255 }
2256
2257 return v.finalize(result_ty, results);
2258}
2259
2260/// This function builds an extended multiplication, either OpSMulExtended or OpUMulExtended on Vulkan,
2261/// or OpIMul and s_mul_hi or u_mul_hi on OpenCL.
2262fn buildWideMul(
2263 cg: *CodeGen,
2264 signedness: std.builtin.Signedness,
2265 lhs: Temporary,
2266 rhs: Temporary,
2267) !struct { Temporary, Temporary } {
2268 const pt = cg.pt;
2269 const zcu = cg.module.zcu;
2270 const target = cg.module.zcu.getTarget();
2271 const ip = &zcu.intern_pool;
2272
2273 const v = lhs.vectorization(cg).unify(rhs.vectorization(cg));
2274 const ops = v.components();
2275
2276 const arith_op_ty = lhs.ty.scalarType(zcu);
2277 const arith_op_ty_id = try cg.resolveType(arith_op_ty, .direct);
2278
2279 const lhs_op = try v.prepare(cg, lhs);
2280 const rhs_op = try v.prepare(cg, rhs);
2281
2282 const value_results = cg.module.allocIds(ops);
2283 const overflow_results = cg.module.allocIds(ops);
2284
2285 switch (target.os.tag) {
2286 .opencl => {
2287 // Currently, SPIRV-LLVM-Translator based backends cannot deal with OpSMulExtended and
2288 // OpUMulExtended. For these we will use the OpenCL s_mul_hi to compute the high-order bits
2289 // instead.
2290 const set = try cg.importExtendedSet();
2291 const overflow_inst: u32 = switch (signedness) {
2292 .signed => 160, // s_mul_hi
2293 .unsigned => 203, // u_mul_hi
2294 };
2295
2296 for (0..ops) |i| {
2297 try cg.body.emit(cg.module.gpa, .OpIMul, .{
2298 .id_result_type = arith_op_ty_id,
2299 .id_result = value_results.at(i),
2300 .operand_1 = lhs_op.at(i),
2301 .operand_2 = rhs_op.at(i),
2302 });
2303
2304 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2305 .id_result_type = arith_op_ty_id,
2306 .id_result = overflow_results.at(i),
2307 .set = set,
2308 .instruction = .{ .inst = overflow_inst },
2309 .id_ref_4 = &.{ lhs_op.at(i), rhs_op.at(i) },
2310 });
2311 }
2312 },
2313 .vulkan, .opengl => {
2314 // Operations return a struct{T, T}
2315 // where T is maybe vectorized.
2316 const op_result_ty: Type = .fromInterned(try ip.getTupleType(zcu.gpa, pt.tid, .{
2317 .types = &.{ arith_op_ty.toIntern(), arith_op_ty.toIntern() },
2318 .values = &.{ .none, .none },
2319 }));
2320 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2321
2322 const opcode: Opcode = switch (signedness) {
2323 .signed => .OpSMulExtended,
2324 .unsigned => .OpUMulExtended,
2325 };
2326
2327 for (0..ops) |i| {
2328 const op_result = cg.module.allocId();
2329
2330 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2331 cg.body.writeOperand(Id, op_result_ty_id);
2332 cg.body.writeOperand(Id, op_result);
2333 cg.body.writeOperand(Id, lhs_op.at(i));
2334 cg.body.writeOperand(Id, rhs_op.at(i));
2335
2336 // The above operation returns a struct. We might want to expand
2337 // Temporary to deal with the fact that these are structs eventually,
2338 // but for now, take the struct apart and return two separate vectors.
2339
2340 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2341 .id_result_type = arith_op_ty_id,
2342 .id_result = value_results.at(i),
2343 .composite = op_result,
2344 .indexes = &.{0},
2345 });
2346
2347 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2348 .id_result_type = arith_op_ty_id,
2349 .id_result = overflow_results.at(i),
2350 .composite = op_result,
2351 .indexes = &.{1},
2352 });
2353 }
2354 },
2355 else => unreachable,
2356 }
2357
2358 const result_ty = try v.resultType(cg, lhs.ty);
2359 return .{
2360 v.finalize(result_ty, value_results),
2361 v.finalize(result_ty, overflow_results),
2362 };
2363}
2364
2365/// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure.
2366/// In order to be able to run tests, we "temporarily" lower test kernels into separate entry-
2367/// points. The test executor will then be able to invoke these to run the tests.
2368/// Note that tests are lowered according to std.builtin.TestFn, which is `fn () anyerror!void`.
2369/// (anyerror!void has the same layout as anyerror).
2370/// Each test declaration generates a function like.
2371/// %anyerror = OpTypeInt 0 16
2372/// %p_invocation_globals_struct_ty = ...
2373/// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror
2374/// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror
2375///
2376/// %test = OpFunction %void %K
2377/// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty
2378/// %p_err = OpFunctionParameter %p_anyerror
2379/// %lbl = OpLabel
2380/// %result = OpFunctionCall %anyerror %func %p_invocation_globals
2381/// OpStore %p_err %result
2382/// OpFunctionEnd
2383/// TODO is to also write out the error as a function call parameter, and to somehow fetch
2384/// the name of an error in the text executor.
2385fn generateTestEntryPoint(
2386 cg: *CodeGen,
2387 name: []const u8,
2388 spv_decl_index: Module.Decl.Index,
2389 test_id: Id,
2390) !void {
2391 const gpa = cg.module.gpa;
2392 const zcu = cg.module.zcu;
2393 const target = cg.module.zcu.getTarget();
2394
2395 const anyerror_ty_id = try cg.resolveType(.anyerror, .direct);
2396 const ptr_anyerror_ty = try cg.pt.ptrType(.{
2397 .child = .anyerror_type,
2398 .flags = .{ .address_space = .global },
2399 });
2400 const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct);
2401
2402 const kernel_id = cg.module.declPtr(spv_decl_index).result_id;
2403
2404 const section = &cg.module.sections.functions;
2405
2406 const p_error_id = cg.module.allocId();
2407 switch (target.os.tag) {
2408 .opencl, .amdhsa => {
2409 const void_ty_id = try cg.resolveType(.void, .direct);
2410 const kernel_proto_ty_id = try cg.module.functionType(void_ty_id, &.{ptr_anyerror_ty_id});
2411
2412 try section.emit(gpa, .OpFunction, .{
2413 .id_result_type = try cg.resolveType(.void, .direct),
2414 .id_result = kernel_id,
2415 .function_control = .{},
2416 .function_type = kernel_proto_ty_id,
2417 });
2418
2419 try section.emit(gpa, .OpFunctionParameter, .{
2420 .id_result_type = ptr_anyerror_ty_id,
2421 .id_result = p_error_id,
2422 });
2423
2424 try section.emit(gpa, .OpLabel, .{
2425 .id_result = cg.module.allocId(),
2426 });
2427 },
2428 .vulkan, .opengl => {
2429 if (cg.module.error_buffer == null) {
2430 const spv_err_decl_index = try cg.module.allocDecl(.global);
2431 try cg.module.declareDeclDeps(spv_err_decl_index, &.{});
2432
2433 const buffer_struct_ty_id = try cg.module.structType(
2434 &.{anyerror_ty_id},
2435 &.{"error_out"},
2436 null,
2437 .none,
2438 );
2439 try cg.module.decorate(buffer_struct_ty_id, .block);
2440 try cg.module.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });
2441
2442 const ptr_buffer_struct_ty_id = cg.module.allocId();
2443 try cg.module.sections.globals.emit(gpa, .OpTypePointer, .{
2444 .id_result = ptr_buffer_struct_ty_id,
2445 .storage_class = cg.module.storageClass(.global),
2446 .type = buffer_struct_ty_id,
2447 });
2448
2449 const buffer_struct_id = cg.module.declPtr(spv_err_decl_index).result_id;
2450 try cg.module.sections.globals.emit(gpa, .OpVariable, .{
2451 .id_result_type = ptr_buffer_struct_ty_id,
2452 .id_result = buffer_struct_id,
2453 .storage_class = cg.module.storageClass(.global),
2454 });
2455 try cg.module.decorate(buffer_struct_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });
2456 try cg.module.decorate(buffer_struct_id, .{ .binding = .{ .binding_point = 0 } });
2457
2458 cg.module.error_buffer = spv_err_decl_index;
2459 }
2460
2461 try cg.module.sections.execution_modes.emit(gpa, .OpExecutionMode, .{
2462 .entry_point = kernel_id,
2463 .mode = .{ .local_size = .{
2464 .x_size = 1,
2465 .y_size = 1,
2466 .z_size = 1,
2467 } },
2468 });
2469
2470 const void_ty_id = try cg.resolveType(.void, .direct);
2471 const kernel_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
2472 try section.emit(gpa, .OpFunction, .{
2473 .id_result_type = try cg.resolveType(.void, .direct),
2474 .id_result = kernel_id,
2475 .function_control = .{},
2476 .function_type = kernel_proto_ty_id,
2477 });
2478 try section.emit(gpa, .OpLabel, .{
2479 .id_result = cg.module.allocId(),
2480 });
2481
2482 const spv_err_decl_index = cg.module.error_buffer.?;
2483 const buffer_id = cg.module.declPtr(spv_err_decl_index).result_id;
2484 try cg.decl_deps.put(gpa, spv_err_decl_index, {});
2485
2486 const zero_id = try cg.constInt(.u32, 0);
2487 try section.emit(gpa, .OpInBoundsAccessChain, .{
2488 .id_result_type = ptr_anyerror_ty_id,
2489 .id_result = p_error_id,
2490 .base = buffer_id,
2491 .indexes = &.{zero_id},
2492 });
2493 },
2494 else => unreachable,
2495 }
2496
2497 const error_id = cg.module.allocId();
2498 try section.emit(gpa, .OpFunctionCall, .{
2499 .id_result_type = anyerror_ty_id,
2500 .id_result = error_id,
2501 .function = test_id,
2502 });
2503 // Note: Convert to direct not required.
2504 try section.emit(gpa, .OpStore, .{
2505 .pointer = p_error_id,
2506 .object = error_id,
2507 .memory_access = .{
2508 .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) },
2509 },
2510 });
2511 try section.emit(gpa, .OpReturn, {});
2512 try section.emit(gpa, .OpFunctionEnd, {});
2513
2514 // Just generate a quick other name because the intel runtime crashes when the entry-
2515 // point name is the same as a different OpName.
2516 const test_name = try std.fmt.allocPrint(cg.module.arena, "test {s}", .{name});
2517
2518 const execution_mode: spec.ExecutionModel = switch (target.os.tag) {
2519 .vulkan, .opengl => .gl_compute,
2520 .opencl, .amdhsa => .kernel,
2521 else => unreachable,
2522 };
2523
2524 try cg.module.declareEntryPoint(spv_decl_index, test_name, execution_mode, null);
2525}
2526
2527fn intFromBool(cg: *CodeGen, value: Temporary) !Temporary {
2528 return try cg.intFromBool2(value, Type.u1);
2529}
2530
2531fn intFromBool2(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary {
2532 const zero_id = try cg.constInt(result_ty, 0);
2533 const one_id = try cg.constInt(result_ty, 1);
2534
2535 return try cg.buildSelect(
2536 value,
2537 Temporary.init(result_ty, one_id),
2538 Temporary.init(result_ty, zero_id),
2539 );
2540}
2541
2542/// Convert representation from indirect (in memory) to direct (in 'register')
2543/// This converts the argument type from resolveType(ty, .indirect) to resolveType(ty, .direct).
2544fn convertToDirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2545 const pt = cg.pt;
2546 const zcu = cg.module.zcu;
2547 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2548 .bool => {
2549 const false_id = try cg.constBool(false, .indirect);
2550 const operand_ty = blk: {
2551 if (!ty.isVector(zcu)) break :blk Type.u1;
2552 break :blk try pt.vectorType(.{
2553 .len = ty.vectorLen(zcu),
2554 .child = .u1_type,
2555 });
2556 };
2557
2558 const result = try cg.buildCmp(
2559 .OpINotEqual,
2560 Temporary.init(operand_ty, operand_id),
2561 Temporary.init(.u1, false_id),
2562 );
2563 return try result.materialize(cg);
2564 },
2565 else => return operand_id,
2566 }
2567}
2568
2569/// Convert representation from direct (in 'register) to direct (in memory)
2570/// This converts the argument type from resolveType(ty, .direct) to resolveType(ty, .indirect).
2571fn convertToIndirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2572 const zcu = cg.module.zcu;
2573 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2574 .bool => {
2575 const result = try cg.intFromBool(Temporary.init(ty, operand_id));
2576 return try result.materialize(cg);
2577 },
2578 else => return operand_id,
2579 }
2580}
2581
2582fn extractField(cg: *CodeGen, result_ty: Type, object: Id, field: u32) !Id {
2583 const result_ty_id = try cg.resolveType(result_ty, .indirect);
2584 const result_id = cg.module.allocId();
2585 const indexes = [_]u32{field};
2586 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2587 .id_result_type = result_ty_id,
2588 .id_result = result_id,
2589 .composite = object,
2590 .indexes = &indexes,
2591 });
2592 // Convert bools; direct structs have their field types as indirect values.
2593 return try cg.convertToDirect(result_ty, result_id);
2594}
2595
2596fn extractVectorComponent(cg: *CodeGen, result_ty: Type, vector_id: Id, field: u32) !Id {
2597 const result_ty_id = try cg.resolveType(result_ty, .direct);
2598 const result_id = cg.module.allocId();
2599 const indexes = [_]u32{field};
2600 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2601 .id_result_type = result_ty_id,
2602 .id_result = result_id,
2603 .composite = vector_id,
2604 .indexes = &indexes,
2605 });
2606 // Vector components are already stored in direct representation.
2607 return result_id;
2608}
2609
2610const MemoryOptions = struct {
2611 is_volatile: bool = false,
2612};
2613
2614fn load(cg: *CodeGen, value_ty: Type, ptr_id: Id, options: MemoryOptions) !Id {
2615 const zcu = cg.module.zcu;
2616 const alignment: u32 = @intCast(value_ty.abiAlignment(zcu).toByteUnits().?);
2617 const indirect_value_ty_id = try cg.resolveType(value_ty, .indirect);
2618 const result_id = cg.module.allocId();
2619 const access: spec.MemoryAccess.Extended = .{
2620 .@"volatile" = options.is_volatile,
2621 .aligned = .{ .literal_integer = alignment },
2622 };
2623 try cg.body.emit(cg.module.gpa, .OpLoad, .{
2624 .id_result_type = indirect_value_ty_id,
2625 .id_result = result_id,
2626 .pointer = ptr_id,
2627 .memory_access = access,
2628 });
2629 return try cg.convertToDirect(value_ty, result_id);
2630}
2631
2632fn store(cg: *CodeGen, value_ty: Type, ptr_id: Id, value_id: Id, options: MemoryOptions) !void {
2633 const indirect_value_id = try cg.convertToIndirect(value_ty, value_id);
2634 const access: spec.MemoryAccess.Extended = .{ .@"volatile" = options.is_volatile };
2635 try cg.body.emit(cg.module.gpa, .OpStore, .{
2636 .pointer = ptr_id,
2637 .object = indirect_value_id,
2638 .memory_access = access,
2639 });
2640}
2641
2642fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) !void {
2643 for (body) |inst| {
2644 try cg.genInst(inst);
2645 }
2646}
2647
2648fn genInst(cg: *CodeGen, inst: Air.Inst.Index) Error!void {
2649 const gpa = cg.module.gpa;
2650 const zcu = cg.module.zcu;
2651 const ip = &zcu.intern_pool;
2652 if (cg.liveness.isUnused(inst) and !cg.air.mustLower(inst, ip))
2653 return;
2654
2655 const air_tags = cg.air.instructions.items(.tag);
2656 const maybe_result_id: ?Id = switch (air_tags[@intFromEnum(inst)]) {
2657 // zig fmt: off
2658 .add, .add_wrap, .add_optimized => try cg.airArithOp(inst, .OpFAdd, .OpIAdd, .OpIAdd),
2659 .sub, .sub_wrap, .sub_optimized => try cg.airArithOp(inst, .OpFSub, .OpISub, .OpISub),
2660 .mul, .mul_wrap, .mul_optimized => try cg.airArithOp(inst, .OpFMul, .OpIMul, .OpIMul),
2661
2662 .sqrt => try cg.airUnOpSimple(inst, .sqrt),
2663 .sin => try cg.airUnOpSimple(inst, .sin),
2664 .cos => try cg.airUnOpSimple(inst, .cos),
2665 .tan => try cg.airUnOpSimple(inst, .tan),
2666 .exp => try cg.airUnOpSimple(inst, .exp),
2667 .exp2 => try cg.airUnOpSimple(inst, .exp2),
2668 .log => try cg.airUnOpSimple(inst, .log),
2669 .log2 => try cg.airUnOpSimple(inst, .log2),
2670 .log10 => try cg.airUnOpSimple(inst, .log10),
2671 .abs => try cg.airAbs(inst),
2672 .floor => try cg.airUnOpSimple(inst, .floor),
2673 .ceil => try cg.airUnOpSimple(inst, .ceil),
2674 .round => try cg.airUnOpSimple(inst, .round),
2675 .trunc_float => try cg.airUnOpSimple(inst, .trunc),
2676 .neg, .neg_optimized => try cg.airUnOpSimple(inst, .f_neg),
2677
2678 .div_float, .div_float_optimized => try cg.airArithOp(inst, .OpFDiv, .OpSDiv, .OpUDiv),
2679 .div_floor, .div_floor_optimized => try cg.airDivFloor(inst),
2680 .div_trunc, .div_trunc_optimized => try cg.airDivTrunc(inst),
2681
2682 .rem, .rem_optimized => try cg.airArithOp(inst, .OpFRem, .OpSRem, .OpUMod),
2683 .mod, .mod_optimized => try cg.airArithOp(inst, .OpFMod, .OpSMod, .OpUMod),
2684
2685 .add_with_overflow => try cg.airAddSubOverflow(inst, .OpIAdd, .OpULessThan, .OpSLessThan),
2686 .sub_with_overflow => try cg.airAddSubOverflow(inst, .OpISub, .OpUGreaterThan, .OpSGreaterThan),
2687 .mul_with_overflow => try cg.airMulOverflow(inst),
2688 .shl_with_overflow => try cg.airShlOverflow(inst),
2689
2690 .mul_add => try cg.airMulAdd(inst),
2691
2692 .ctz => try cg.airClzCtz(inst, .ctz),
2693 .clz => try cg.airClzCtz(inst, .clz),
2694
2695 .select => try cg.airSelect(inst),
2696
2697 .splat => try cg.airSplat(inst),
2698 .reduce, .reduce_optimized => try cg.airReduce(inst),
2699 .shuffle_one => try cg.airShuffleOne(inst),
2700 .shuffle_two => try cg.airShuffleTwo(inst),
2701
2702 .ptr_add => try cg.airPtrAdd(inst),
2703 .ptr_sub => try cg.airPtrSub(inst),
2704
2705 .bit_and => try cg.airBinOpSimple(inst, .OpBitwiseAnd),
2706 .bit_or => try cg.airBinOpSimple(inst, .OpBitwiseOr),
2707 .xor => try cg.airBinOpSimple(inst, .OpBitwiseXor),
2708 .bool_and => try cg.airBinOpSimple(inst, .OpLogicalAnd),
2709 .bool_or => try cg.airBinOpSimple(inst, .OpLogicalOr),
2710
2711 .shl, .shl_exact => try cg.airShift(inst, .OpShiftLeftLogical, .OpShiftLeftLogical),
2712 .shr, .shr_exact => try cg.airShift(inst, .OpShiftRightLogical, .OpShiftRightArithmetic),
2713
2714 .min => try cg.airMinMax(inst, .min),
2715 .max => try cg.airMinMax(inst, .max),
2716
2717 .bitcast => try cg.airBitCast(inst),
2718 .intcast, .trunc => try cg.airIntCast(inst),
2719 .float_from_int => try cg.airFloatFromInt(inst),
2720 .int_from_float => try cg.airIntFromFloat(inst),
2721 .fpext, .fptrunc => try cg.airFloatCast(inst),
2722 .not => try cg.airNot(inst),
2723
2724 .array_to_slice => try cg.airArrayToSlice(inst),
2725 .slice => try cg.airSlice(inst),
2726 .aggregate_init => try cg.airAggregateInit(inst),
2727 .memcpy => return cg.airMemcpy(inst),
2728 .memmove => return cg.airMemmove(inst),
2729
2730 .slice_ptr => try cg.airSliceField(inst, 0),
2731 .slice_len => try cg.airSliceField(inst, 1),
2732 .slice_elem_ptr => try cg.airSliceElemPtr(inst),
2733 .slice_elem_val => try cg.airSliceElemVal(inst),
2734 .ptr_elem_ptr => try cg.airPtrElemPtr(inst),
2735 .ptr_elem_val => try cg.airPtrElemVal(inst),
2736 .array_elem_val => try cg.airArrayElemVal(inst),
2737
2738 .vector_store_elem => return cg.airVectorStoreElem(inst),
2739
2740 .set_union_tag => return cg.airSetUnionTag(inst),
2741 .get_union_tag => try cg.airGetUnionTag(inst),
2742 .union_init => try cg.airUnionInit(inst),
2743
2744 .struct_field_val => try cg.airStructFieldVal(inst),
2745 .field_parent_ptr => try cg.airFieldParentPtr(inst),
2746
2747 .struct_field_ptr_index_0 => try cg.airStructFieldPtrIndex(inst, 0),
2748 .struct_field_ptr_index_1 => try cg.airStructFieldPtrIndex(inst, 1),
2749 .struct_field_ptr_index_2 => try cg.airStructFieldPtrIndex(inst, 2),
2750 .struct_field_ptr_index_3 => try cg.airStructFieldPtrIndex(inst, 3),
2751
2752 .cmp_eq => try cg.airCmp(inst, .eq),
2753 .cmp_neq => try cg.airCmp(inst, .neq),
2754 .cmp_gt => try cg.airCmp(inst, .gt),
2755 .cmp_gte => try cg.airCmp(inst, .gte),
2756 .cmp_lt => try cg.airCmp(inst, .lt),
2757 .cmp_lte => try cg.airCmp(inst, .lte),
2758 .cmp_vector => try cg.airVectorCmp(inst),
2759
2760 .arg => cg.airArg(),
2761 .alloc => try cg.airAlloc(inst),
2762 // TODO: We probably need to have a special implementation of this for the C abi.
2763 .ret_ptr => try cg.airAlloc(inst),
2764 .block => try cg.airBlock(inst),
2765
2766 .load => try cg.airLoad(inst),
2767 .store, .store_safe => return cg.airStore(inst),
2768
2769 .br => return cg.airBr(inst),
2770 // For now just ignore this instruction. This effectively falls back on the old implementation,
2771 // this doesn't change anything for us.
2772 .repeat => return,
2773 .breakpoint => return,
2774 .cond_br => return cg.airCondBr(inst),
2775 .loop => return cg.airLoop(inst),
2776 .ret => return cg.airRet(inst),
2777 .ret_safe => return cg.airRet(inst), // TODO
2778 .ret_load => return cg.airRetLoad(inst),
2779 .@"try" => try cg.airTry(inst),
2780 .switch_br => return cg.airSwitchBr(inst),
2781 .unreach, .trap => return cg.airUnreach(),
2782
2783 .dbg_empty_stmt => return,
2784 .dbg_stmt => return cg.airDbgStmt(inst),
2785 .dbg_inline_block => try cg.airDbgInlineBlock(inst),
2786 .dbg_var_ptr, .dbg_var_val, .dbg_arg_inline => return cg.airDbgVar(inst),
2787
2788 .unwrap_errunion_err => try cg.airErrUnionErr(inst),
2789 .unwrap_errunion_payload => try cg.airErrUnionPayload(inst),
2790 .wrap_errunion_err => try cg.airWrapErrUnionErr(inst),
2791 .wrap_errunion_payload => try cg.airWrapErrUnionPayload(inst),
2792
2793 .is_null => try cg.airIsNull(inst, false, .is_null),
2794 .is_non_null => try cg.airIsNull(inst, false, .is_non_null),
2795 .is_null_ptr => try cg.airIsNull(inst, true, .is_null),
2796 .is_non_null_ptr => try cg.airIsNull(inst, true, .is_non_null),
2797 .is_err => try cg.airIsErr(inst, .is_err),
2798 .is_non_err => try cg.airIsErr(inst, .is_non_err),
2799
2800 .optional_payload => try cg.airUnwrapOptional(inst),
2801 .optional_payload_ptr => try cg.airUnwrapOptionalPtr(inst),
2802 .wrap_optional => try cg.airWrapOptional(inst),
2803
2804 .assembly => try cg.airAssembly(inst),
2805
2806 .call => try cg.airCall(inst, .auto),
2807 .call_always_tail => try cg.airCall(inst, .always_tail),
2808 .call_never_tail => try cg.airCall(inst, .never_tail),
2809 .call_never_inline => try cg.airCall(inst, .never_inline),
2810
2811 .work_item_id => try cg.airWorkItemId(inst),
2812 .work_group_size => try cg.airWorkGroupSize(inst),
2813 .work_group_id => try cg.airWorkGroupId(inst),
2814
2815 // zig fmt: on
2816
2817 else => |tag| return cg.todo("implement AIR tag {s}", .{@tagName(tag)}),
2818 };
2819
2820 const result_id = maybe_result_id orelse return;
2821 try cg.inst_results.putNoClobber(gpa, inst, result_id);
2822}
2823
2824fn airBinOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: Opcode) !?Id {
2825 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2826 const lhs = try cg.temporary(bin_op.lhs);
2827 const rhs = try cg.temporary(bin_op.rhs);
2828
2829 const result = try cg.buildBinary(op, lhs, rhs);
2830 return try result.materialize(cg);
2831}
2832
2833fn airShift(cg: *CodeGen, inst: Air.Inst.Index, unsigned: Opcode, signed: Opcode) !?Id {
2834 const zcu = cg.module.zcu;
2835 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2836
2837 if (cg.typeOf(bin_op.lhs).isVector(zcu) and !cg.typeOf(bin_op.rhs).isVector(zcu)) {
2838 return cg.fail("vector shift with scalar rhs", .{});
2839 }
2840
2841 const base = try cg.temporary(bin_op.lhs);
2842 const shift = try cg.temporary(bin_op.rhs);
2843
2844 const result_ty = cg.typeOfIndex(inst);
2845
2846 const info = cg.arithmeticTypeInfo(result_ty);
2847 switch (info.class) {
2848 .composite_integer => return cg.todo("shift ops for composite integers", .{}),
2849 .integer, .strange_integer => {},
2850 .float, .bool => unreachable,
2851 }
2852
2853 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
2854 // so just manually upcast it if required.
2855
2856 // Note: The sign may differ here between the shift and the base type, in case
2857 // of an arithmetic right shift. SPIR-V still expects the same type,
2858 // so in that case we have to cast convert to signed.
2859 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
2860
2861 const shifted = switch (info.signedness) {
2862 .unsigned => try cg.buildBinary(unsigned, base, casted_shift),
2863 .signed => try cg.buildBinary(signed, base, casted_shift),
2864 };
2865
2866 const result = try cg.normalize(shifted, info);
2867 return try result.materialize(cg);
2868}
2869
2870const MinMax = enum { min, max };
2871
2872fn airMinMax(cg: *CodeGen, inst: Air.Inst.Index, op: MinMax) !?Id {
2873 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2874
2875 const lhs = try cg.temporary(bin_op.lhs);
2876 const rhs = try cg.temporary(bin_op.rhs);
2877
2878 const result = try cg.minMax(lhs, rhs, op);
2879 return try result.materialize(cg);
2880}
2881
2882fn minMax(cg: *CodeGen, lhs: Temporary, rhs: Temporary, op: MinMax) !Temporary {
2883 const zcu = cg.module.zcu;
2884 const target = zcu.getTarget();
2885 const info = cg.arithmeticTypeInfo(lhs.ty);
2886
2887 const v = cg.vectorization(.{ lhs, rhs });
2888 const ops = v.components();
2889 const results = cg.module.allocIds(ops);
2890
2891 const op_result_ty = lhs.ty.scalarType(zcu);
2892 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2893 const result_ty = try v.resultType(cg, lhs.ty);
2894
2895 const op_lhs = try v.prepare(cg, lhs);
2896 const op_rhs = try v.prepare(cg, rhs);
2897
2898 const ext_inst: u32 = switch (target.os.tag) {
2899 .opencl => switch (info.class) {
2900 .float => switch (op) {
2901 .min => 28, // fmin
2902 .max => 27, // fmax
2903 },
2904 .integer,
2905 .strange_integer,
2906 .composite_integer,
2907 => switch (info.signedness) {
2908 .signed => switch (op) {
2909 .min => 158, // s_min
2910 .max => 156, // s_max
2911 },
2912 .unsigned => switch (op) {
2913 .min => 159, // u_min
2914 .max => 157, // u_max
2915 },
2916 },
2917 .bool => unreachable,
2918 },
2919 .vulkan, .opengl => switch (info.class) {
2920 .float => switch (op) {
2921 .min => 37, // FMin
2922 .max => 40, // FMax
2923 },
2924 .integer,
2925 .strange_integer,
2926 .composite_integer,
2927 => switch (info.signedness) {
2928 .signed => switch (op) {
2929 .min => 39, // SMin
2930 .max => 42, // SMax
2931 },
2932 .unsigned => switch (op) {
2933 .min => 38, // UMin
2934 .max => 41, // UMax
2935 },
2936 },
2937 .bool => unreachable,
2938 },
2939 else => unreachable,
2940 };
2941
2942 const set = try cg.importExtendedSet();
2943 for (0..ops) |i| {
2944 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2945 .id_result_type = op_result_ty_id,
2946 .id_result = results.at(i),
2947 .set = set,
2948 .instruction = .{ .inst = ext_inst },
2949 .id_ref_4 = &.{ op_lhs.at(i), op_rhs.at(i) },
2950 });
2951 }
2952
2953 return v.finalize(result_ty, results);
2954}
2955
2956/// This function normalizes values to a canonical representation
2957/// after some arithmetic operation. This mostly consists of wrapping
2958/// behavior for strange integers:
2959/// - Unsigned integers are bitwise masked with a mask that only passes
2960/// the valid bits through.
2961/// - Signed integers are also sign extended if they are negative.
2962/// All other values are returned unmodified (this makes strange integer
2963/// wrapping easier to use in generic operations).
2964fn normalize(cg: *CodeGen, value: Temporary, info: ArithmeticTypeInfo) !Temporary {
2965 const zcu = cg.module.zcu;
2966 const ty = value.ty;
2967 switch (info.class) {
2968 .composite_integer, .integer, .bool, .float => return value,
2969 .strange_integer => switch (info.signedness) {
2970 .unsigned => {
2971 const mask_value = if (info.bits == 64) 0xFFFF_FFFF_FFFF_FFFF else (@as(u64, 1) << @as(u6, @intCast(info.bits))) - 1;
2972 const mask_id = try cg.constInt(ty.scalarType(zcu), mask_value);
2973 return try cg.buildBinary(.OpBitwiseAnd, value, Temporary.init(ty.scalarType(zcu), mask_id));
2974 },
2975 .signed => {
2976 // Shift left and right so that we can copy the sight bit that way.
2977 const shift_amt_id = try cg.constInt(ty.scalarType(zcu), info.backing_bits - info.bits);
2978 const shift_amt: Temporary = .init(ty.scalarType(zcu), shift_amt_id);
2979 const left = try cg.buildBinary(.OpShiftLeftLogical, value, shift_amt);
2980 return try cg.buildBinary(.OpShiftRightArithmetic, left, shift_amt);
2981 },
2982 },
2983 }
2984}
2985
2986fn airDivFloor(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
2987 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2988
2989 const lhs = try cg.temporary(bin_op.lhs);
2990 const rhs = try cg.temporary(bin_op.rhs);
2991
2992 const info = cg.arithmeticTypeInfo(lhs.ty);
2993 switch (info.class) {
2994 .composite_integer => unreachable, // TODO
2995 .integer, .strange_integer => {
2996 switch (info.signedness) {
2997 .unsigned => {
2998 const result = try cg.buildBinary(.OpUDiv, lhs, rhs);
2999 return try result.materialize(cg);
3000 },
3001 .signed => {},
3002 }
3003
3004 // For signed integers:
3005 // (a / b) - (a % b != 0 && a < 0 != b < 0);
3006 // There shouldn't be any overflow issues.
3007
3008 const div = try cg.buildBinary(.OpSDiv, lhs, rhs);
3009 const rem = try cg.buildBinary(.OpSRem, lhs, rhs);
3010
3011 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3012
3013 const rem_is_not_zero = try cg.buildCmp(.OpINotEqual, rem, zero);
3014
3015 const result_negative = try cg.buildCmp(
3016 .OpLogicalNotEqual,
3017 try cg.buildCmp(.OpSLessThan, lhs, zero),
3018 try cg.buildCmp(.OpSLessThan, rhs, zero),
3019 );
3020 const rem_is_not_zero_and_result_is_negative = try cg.buildBinary(
3021 .OpLogicalAnd,
3022 rem_is_not_zero,
3023 result_negative,
3024 );
3025
3026 const result = try cg.buildBinary(
3027 .OpISub,
3028 div,
3029 try cg.intFromBool2(rem_is_not_zero_and_result_is_negative, div.ty),
3030 );
3031
3032 return try result.materialize(cg);
3033 },
3034 .float => {
3035 const div = try cg.buildBinary(.OpFDiv, lhs, rhs);
3036 const result = try cg.buildUnary(.floor, div);
3037 return try result.materialize(cg);
3038 },
3039 .bool => unreachable,
3040 }
3041}
3042
3043fn airDivTrunc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3044 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3045
3046 const lhs = try cg.temporary(bin_op.lhs);
3047 const rhs = try cg.temporary(bin_op.rhs);
3048
3049 const info = cg.arithmeticTypeInfo(lhs.ty);
3050 switch (info.class) {
3051 .composite_integer => unreachable, // TODO
3052 .integer, .strange_integer => switch (info.signedness) {
3053 .unsigned => {
3054 const result = try cg.buildBinary(.OpUDiv, lhs, rhs);
3055 return try result.materialize(cg);
3056 },
3057 .signed => {
3058 const result = try cg.buildBinary(.OpSDiv, lhs, rhs);
3059 return try result.materialize(cg);
3060 },
3061 },
3062 .float => {
3063 const div = try cg.buildBinary(.OpFDiv, lhs, rhs);
3064 const result = try cg.buildUnary(.trunc, div);
3065 return try result.materialize(cg);
3066 },
3067 .bool => unreachable,
3068 }
3069}
3070
3071fn airUnOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3072 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
3073 const operand = try cg.temporary(un_op);
3074 const result = try cg.buildUnary(op, operand);
3075 return try result.materialize(cg);
3076}
3077
3078fn airArithOp(
3079 cg: *CodeGen,
3080 inst: Air.Inst.Index,
3081 comptime fop: Opcode,
3082 comptime sop: Opcode,
3083 comptime uop: Opcode,
3084) !?Id {
3085 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3086
3087 const lhs = try cg.temporary(bin_op.lhs);
3088 const rhs = try cg.temporary(bin_op.rhs);
3089
3090 const info = cg.arithmeticTypeInfo(lhs.ty);
3091
3092 const result = switch (info.class) {
3093 .composite_integer => unreachable, // TODO
3094 .integer, .strange_integer => switch (info.signedness) {
3095 .signed => try cg.buildBinary(sop, lhs, rhs),
3096 .unsigned => try cg.buildBinary(uop, lhs, rhs),
3097 },
3098 .float => try cg.buildBinary(fop, lhs, rhs),
3099 .bool => unreachable,
3100 };
3101
3102 return try result.materialize(cg);
3103}
3104
3105fn airAbs(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3106 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3107 const operand = try cg.temporary(ty_op.operand);
3108 // Note: operand_ty may be signed, while ty is always unsigned!
3109 const result_ty = cg.typeOfIndex(inst);
3110 const result = try cg.abs(result_ty, operand);
3111 return try result.materialize(cg);
3112}
3113
3114fn abs(cg: *CodeGen, result_ty: Type, value: Temporary) !Temporary {
3115 const zcu = cg.module.zcu;
3116 const target = cg.module.zcu.getTarget();
3117 const operand_info = cg.arithmeticTypeInfo(value.ty);
3118
3119 switch (operand_info.class) {
3120 .float => return try cg.buildUnary(.f_abs, value),
3121 .integer, .strange_integer => {
3122 const abs_value = try cg.buildUnary(.i_abs, value);
3123
3124 switch (target.os.tag) {
3125 .vulkan, .opengl => {
3126 if (value.ty.intInfo(zcu).signedness == .signed) {
3127 return cg.todo("perform bitcast after @abs", .{});
3128 }
3129 },
3130 else => {},
3131 }
3132
3133 return try cg.normalize(abs_value, cg.arithmeticTypeInfo(result_ty));
3134 },
3135 .composite_integer => unreachable, // TODO
3136 .bool => unreachable,
3137 }
3138}
3139
3140fn airAddSubOverflow(
3141 cg: *CodeGen,
3142 inst: Air.Inst.Index,
3143 comptime add: Opcode,
3144 u_opcode: Opcode,
3145 s_opcode: Opcode,
3146) !?Id {
3147 _ = s_opcode;
3148 // Note: OpIAddCarry and OpISubBorrow are not really useful here: For unsigned numbers,
3149 // there is in both cases only one extra operation required. For signed operations,
3150 // the overflow bit is set then going from 0x80.. to 0x00.., but this doesn't actually
3151 // normally set a carry bit. So the SPIR-V overflow operations are not particularly
3152 // useful here.
3153
3154 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3155 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3156
3157 const lhs = try cg.temporary(extra.lhs);
3158 const rhs = try cg.temporary(extra.rhs);
3159
3160 const result_ty = cg.typeOfIndex(inst);
3161
3162 const info = cg.arithmeticTypeInfo(lhs.ty);
3163 switch (info.class) {
3164 .composite_integer => unreachable, // TODO
3165 .strange_integer, .integer => {},
3166 .float, .bool => unreachable,
3167 }
3168
3169 const sum = try cg.buildBinary(add, lhs, rhs);
3170 const result = try cg.normalize(sum, info);
3171
3172 const overflowed = switch (info.signedness) {
3173 // Overflow happened if the result is smaller than either of the operands. It doesn't matter which.
3174 // For subtraction the conditions need to be swapped.
3175 .unsigned => try cg.buildCmp(u_opcode, result, lhs),
3176 // For signed operations, we check the signs of the operands and the result.
3177 .signed => blk: {
3178 // Signed overflow detection using the sign bits of the operands and the result.
3179 // For addition (a + b), overflow occurs if the operands have the same sign
3180 // and the result's sign is different from the operands' sign.
3181 // (sign(a) == sign(b)) && (sign(a) != sign(result))
3182 // For subtraction (a - b), overflow occurs if the operands have different signs
3183 // and the result's sign is different from the minuend's (a's) sign.
3184 // (sign(a) != sign(b)) && (sign(a) != sign(result))
3185 const zero: Temporary = .init(rhs.ty, try cg.constInt(rhs.ty, 0));
3186
3187 const lhs_is_neg = try cg.buildCmp(.OpSLessThan, lhs, zero);
3188 const rhs_is_neg = try cg.buildCmp(.OpSLessThan, rhs, zero);
3189 const result_is_neg = try cg.buildCmp(.OpSLessThan, result, zero);
3190
3191 const signs_match = try cg.buildCmp(.OpLogicalEqual, lhs_is_neg, rhs_is_neg);
3192 const result_sign_differs = try cg.buildCmp(.OpLogicalNotEqual, lhs_is_neg, result_is_neg);
3193
3194 const overflow_condition = if (add == .OpIAdd)
3195 signs_match
3196 else // .OpISub
3197 try cg.buildUnary(.l_not, signs_match);
3198
3199 break :blk try cg.buildCmp(.OpLogicalAnd, overflow_condition, result_sign_differs);
3200 },
3201 };
3202
3203 const ov = try cg.intFromBool(overflowed);
3204
3205 const result_ty_id = try cg.resolveType(result_ty, .direct);
3206 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3207}
3208
3209fn airMulOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3210 const pt = cg.pt;
3211
3212 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3213 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3214
3215 const lhs = try cg.temporary(extra.lhs);
3216 const rhs = try cg.temporary(extra.rhs);
3217
3218 const result_ty = cg.typeOfIndex(inst);
3219
3220 const info = cg.arithmeticTypeInfo(lhs.ty);
3221 switch (info.class) {
3222 .composite_integer => unreachable, // TODO
3223 .strange_integer, .integer => {},
3224 .float, .bool => unreachable,
3225 }
3226
3227 // There are 3 cases which we have to deal with:
3228 // - If info.bits < 32 / 2, we will upcast to 32 and check the higher bits
3229 // - If info.bits > 32 / 2, we have to use extended multiplication
3230 // - Additionally, if info.bits != 32, we'll have to check the high bits
3231 // of the result too.
3232
3233 const largest_int_bits = cg.largestSupportedIntBits();
3234 // If non-null, the number of bits that the multiplication should be performed in. If
3235 // null, we have to use wide multiplication.
3236 const maybe_op_ty_bits: ?u16 = switch (info.bits) {
3237 0 => unreachable,
3238 1...16 => 32,
3239 17...32 => if (largest_int_bits > 32) 64 else null, // Upcast if we can.
3240 33...64 => null, // Always use wide multiplication.
3241 else => unreachable, // TODO: Composite integers
3242 };
3243
3244 const result, const overflowed = switch (info.signedness) {
3245 .unsigned => blk: {
3246 if (maybe_op_ty_bits) |op_ty_bits| {
3247 const op_ty = try pt.intType(.unsigned, op_ty_bits);
3248 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3249 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3250
3251 const full_result = try cg.buildBinary(.OpIMul, casted_lhs, casted_rhs);
3252
3253 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3254 const result = try cg.normalize(low_bits, info);
3255
3256 // Shift the result bits away to get the overflow bits.
3257 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits));
3258 const overflow = try cg.buildBinary(.OpShiftRightLogical, full_result, shift);
3259
3260 // Directly check if its zero in the op_ty without converting first.
3261 const zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3262 const overflowed = try cg.buildCmp(.OpINotEqual, zero, overflow);
3263
3264 break :blk .{ result, overflowed };
3265 }
3266
3267 const low_bits, const high_bits = try cg.buildWideMul(.unsigned, lhs, rhs);
3268
3269 // Truncate the result, if required.
3270 const result = try cg.normalize(low_bits, info);
3271
3272 // Overflow happened if the high-bits of the result are non-zero OR if the
3273 // high bits of the low word of the result (those outside the range of the
3274 // int) are nonzero.
3275 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3276 const high_overflowed = try cg.buildCmp(.OpINotEqual, zero, high_bits);
3277
3278 // If no overflow bits in low_bits, no extra work needs to be done.
3279 if (info.backing_bits == info.bits) break :blk .{ result, high_overflowed };
3280
3281 // Shift the result bits away to get the overflow bits.
3282 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits));
3283 const low_overflow = try cg.buildBinary(.OpShiftRightLogical, low_bits, shift);
3284 const low_overflowed = try cg.buildCmp(.OpINotEqual, zero, low_overflow);
3285
3286 const overflowed = try cg.buildCmp(.OpLogicalOr, low_overflowed, high_overflowed);
3287
3288 break :blk .{ result, overflowed };
3289 },
3290 .signed => blk: {
3291 // - lhs >= 0, rhxs >= 0: expect positive; overflow should be 0
3292 // - lhs == 0 : expect positive; overflow should be 0
3293 // - rhs == 0: expect positive; overflow should be 0
3294 // - lhs > 0, rhs < 0: expect negative; overflow should be -1
3295 // - lhs < 0, rhs > 0: expect negative; overflow should be -1
3296 // - lhs <= 0, rhs <= 0: expect positive; overflow should be 0
3297 // ------
3298 // overflow should be -1 when
3299 // (lhs > 0 && rhs < 0) || (lhs < 0 && rhs > 0)
3300
3301 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3302 const lhs_negative = try cg.buildCmp(.OpSLessThan, lhs, zero);
3303 const rhs_negative = try cg.buildCmp(.OpSLessThan, rhs, zero);
3304 const lhs_positive = try cg.buildCmp(.OpSGreaterThan, lhs, zero);
3305 const rhs_positive = try cg.buildCmp(.OpSGreaterThan, rhs, zero);
3306
3307 // Set to `true` if we expect -1.
3308 const expected_overflow_bit = try cg.buildBinary(
3309 .OpLogicalOr,
3310 try cg.buildCmp(.OpLogicalAnd, lhs_positive, rhs_negative),
3311 try cg.buildCmp(.OpLogicalAnd, lhs_negative, rhs_positive),
3312 );
3313
3314 if (maybe_op_ty_bits) |op_ty_bits| {
3315 const op_ty = try pt.intType(.signed, op_ty_bits);
3316 // Assume normalized; sign bit is set. We want a sign extend.
3317 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3318 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3319
3320 const full_result = try cg.buildBinary(.OpIMul, casted_lhs, casted_rhs);
3321
3322 // Truncate to the result type.
3323 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3324 const result = try cg.normalize(low_bits, info);
3325
3326 // Now, we need to check the overflow bits AND the sign
3327 // bit for the expected overflow bits.
3328 // To do that, shift out everything bit the sign bit and
3329 // then check what remains.
3330 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits - 1));
3331 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3332 // for negative cases.
3333 const overflow = try cg.buildBinary(.OpShiftRightArithmetic, full_result, shift);
3334
3335 const long_all_set: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, -1));
3336 const long_zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3337 const mask = try cg.buildSelect(expected_overflow_bit, long_all_set, long_zero);
3338
3339 const overflowed = try cg.buildCmp(.OpINotEqual, mask, overflow);
3340
3341 break :blk .{ result, overflowed };
3342 }
3343
3344 const low_bits, const high_bits = try cg.buildWideMul(.signed, lhs, rhs);
3345
3346 // Truncate result if required.
3347 const result = try cg.normalize(low_bits, info);
3348
3349 const all_set: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, -1));
3350 const mask = try cg.buildSelect(expected_overflow_bit, all_set, zero);
3351
3352 // Like with unsigned, overflow happened if high_bits are not the ones we expect,
3353 // and we also need to check some ones from the low bits.
3354
3355 const high_overflowed = try cg.buildCmp(.OpINotEqual, mask, high_bits);
3356
3357 // If no overflow bits in low_bits, no extra work needs to be done.
3358 // Careful, we still have to check the sign bit, so this branch
3359 // only goes for i33 and such.
3360 if (info.backing_bits == info.bits + 1) break :blk .{ result, high_overflowed };
3361
3362 // Shift the result bits away to get the overflow bits.
3363 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits - 1));
3364 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3365 // for negative cases.
3366 const low_overflow = try cg.buildBinary(.OpShiftRightArithmetic, low_bits, shift);
3367 const low_overflowed = try cg.buildCmp(.OpINotEqual, mask, low_overflow);
3368
3369 const overflowed = try cg.buildCmp(.OpLogicalOr, low_overflowed, high_overflowed);
3370
3371 break :blk .{ result, overflowed };
3372 },
3373 };
3374
3375 const ov = try cg.intFromBool(overflowed);
3376
3377 const result_ty_id = try cg.resolveType(result_ty, .direct);
3378 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3379}
3380
3381fn airShlOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3382 const zcu = cg.module.zcu;
3383
3384 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3385 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3386
3387 if (cg.typeOf(extra.lhs).isVector(zcu) and !cg.typeOf(extra.rhs).isVector(zcu)) {
3388 return cg.fail("vector shift with scalar rhs", .{});
3389 }
3390
3391 const base = try cg.temporary(extra.lhs);
3392 const shift = try cg.temporary(extra.rhs);
3393
3394 const result_ty = cg.typeOfIndex(inst);
3395
3396 const info = cg.arithmeticTypeInfo(base.ty);
3397 switch (info.class) {
3398 .composite_integer => unreachable, // TODO
3399 .integer, .strange_integer => {},
3400 .float, .bool => unreachable,
3401 }
3402
3403 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3404 // so just manually upcast it if required.
3405 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
3406
3407 const left = try cg.buildBinary(.OpShiftLeftLogical, base, casted_shift);
3408 const result = try cg.normalize(left, info);
3409
3410 const right = switch (info.signedness) {
3411 .unsigned => try cg.buildBinary(.OpShiftRightLogical, result, casted_shift),
3412 .signed => try cg.buildBinary(.OpShiftRightArithmetic, result, casted_shift),
3413 };
3414
3415 const overflowed = try cg.buildCmp(.OpINotEqual, base, right);
3416 const ov = try cg.intFromBool(overflowed);
3417
3418 const result_ty_id = try cg.resolveType(result_ty, .direct);
3419 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3420}
3421
3422fn airMulAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3423 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3424 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3425
3426 const a = try cg.temporary(extra.lhs);
3427 const b = try cg.temporary(extra.rhs);
3428 const c = try cg.temporary(pl_op.operand);
3429
3430 const result_ty = cg.typeOfIndex(inst);
3431 const info = cg.arithmeticTypeInfo(result_ty);
3432 assert(info.class == .float); // .mul_add is only emitted for floats
3433
3434 const result = try cg.buildFma(a, b, c);
3435 return try result.materialize(cg);
3436}
3437
3438fn airClzCtz(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3439 if (cg.liveness.isUnused(inst)) return null;
3440
3441 const zcu = cg.module.zcu;
3442 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3443 const operand = try cg.temporary(ty_op.operand);
3444
3445 const scalar_result_ty = cg.typeOfIndex(inst).scalarType(zcu);
3446
3447 const info = cg.arithmeticTypeInfo(operand.ty);
3448 switch (info.class) {
3449 .composite_integer => unreachable, // TODO
3450 .integer, .strange_integer => {},
3451 .float, .bool => unreachable,
3452 }
3453
3454 const count = try cg.buildUnary(op, operand);
3455
3456 // Result of OpenCL ctz/clz returns operand.ty, and we want result_ty.
3457 // result_ty is always large enough to hold the result, so we might have to down
3458 // cast it.
3459 const result = try cg.buildConvert(scalar_result_ty, count);
3460 return try result.materialize(cg);
3461}
3462
3463fn airSelect(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3464 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3465 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3466 const pred = try cg.temporary(pl_op.operand);
3467 const a = try cg.temporary(extra.lhs);
3468 const b = try cg.temporary(extra.rhs);
3469
3470 const result = try cg.buildSelect(pred, a, b);
3471 return try result.materialize(cg);
3472}
3473
3474fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3475 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3476
3477 const operand_id = try cg.resolve(ty_op.operand);
3478 const result_ty = cg.typeOfIndex(inst);
3479
3480 return try cg.constructCompositeSplat(result_ty, operand_id);
3481}
3482
3483fn airReduce(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3484 const zcu = cg.module.zcu;
3485 const reduce = cg.air.instructions.items(.data)[@intFromEnum(inst)].reduce;
3486 const operand = try cg.resolve(reduce.operand);
3487 const operand_ty = cg.typeOf(reduce.operand);
3488 const scalar_ty = operand_ty.scalarType(zcu);
3489 const scalar_ty_id = try cg.resolveType(scalar_ty, .direct);
3490 const info = cg.arithmeticTypeInfo(operand_ty);
3491 const len = operand_ty.vectorLen(zcu);
3492 const first = try cg.extractVectorComponent(scalar_ty, operand, 0);
3493
3494 switch (reduce.operation) {
3495 .Min, .Max => |op| {
3496 var result: Temporary = .init(scalar_ty, first);
3497 const cmp_op: MinMax = switch (op) {
3498 .Max => .max,
3499 .Min => .min,
3500 else => unreachable,
3501 };
3502 for (1..len) |i| {
3503 const lhs = result;
3504 const rhs_id = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3505 const rhs: Temporary = .init(scalar_ty, rhs_id);
3506
3507 result = try cg.minMax(lhs, rhs, cmp_op);
3508 }
3509
3510 return try result.materialize(cg);
3511 },
3512 else => {},
3513 }
3514
3515 var result_id = first;
3516
3517 const opcode: Opcode = switch (info.class) {
3518 .bool => switch (reduce.operation) {
3519 .And => .OpLogicalAnd,
3520 .Or => .OpLogicalOr,
3521 .Xor => .OpLogicalNotEqual,
3522 else => unreachable,
3523 },
3524 .strange_integer, .integer => switch (reduce.operation) {
3525 .And => .OpBitwiseAnd,
3526 .Or => .OpBitwiseOr,
3527 .Xor => .OpBitwiseXor,
3528 .Add => .OpIAdd,
3529 .Mul => .OpIMul,
3530 else => unreachable,
3531 },
3532 .float => switch (reduce.operation) {
3533 .Add => .OpFAdd,
3534 .Mul => .OpFMul,
3535 else => unreachable,
3536 },
3537 .composite_integer => unreachable, // TODO
3538 };
3539
3540 for (1..len) |i| {
3541 const lhs = result_id;
3542 const rhs = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3543 result_id = cg.module.allocId();
3544
3545 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
3546 cg.body.writeOperand(Id, scalar_ty_id);
3547 cg.body.writeOperand(Id, result_id);
3548 cg.body.writeOperand(Id, lhs);
3549 cg.body.writeOperand(Id, rhs);
3550 }
3551
3552 return result_id;
3553}
3554
3555fn airShuffleOne(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3556 const zcu = cg.module.zcu;
3557 const gpa = zcu.gpa;
3558
3559 const unwrapped = cg.air.unwrapShuffleOne(zcu, inst);
3560 const mask = unwrapped.mask;
3561 const result_ty = unwrapped.result_ty;
3562 const elem_ty = result_ty.childType(zcu);
3563 const operand = try cg.resolve(unwrapped.operand);
3564
3565 const constituents = try gpa.alloc(Id, mask.len);
3566 defer gpa.free(constituents);
3567
3568 for (constituents, mask) |*id, mask_elem| {
3569 id.* = switch (mask_elem.unwrap()) {
3570 .elem => |idx| try cg.extractVectorComponent(elem_ty, operand, idx),
3571 .value => |val| try cg.constant(elem_ty, .fromInterned(val), .direct),
3572 };
3573 }
3574
3575 const result_ty_id = try cg.resolveType(result_ty, .direct);
3576 return try cg.constructComposite(result_ty_id, constituents);
3577}
3578
3579fn airShuffleTwo(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3580 const zcu = cg.module.zcu;
3581 const gpa = zcu.gpa;
3582
3583 const unwrapped = cg.air.unwrapShuffleTwo(zcu, inst);
3584 const mask = unwrapped.mask;
3585 const result_ty = unwrapped.result_ty;
3586 const elem_ty = result_ty.childType(zcu);
3587 const elem_ty_id = try cg.resolveType(elem_ty, .direct);
3588 const operand_a = try cg.resolve(unwrapped.operand_a);
3589 const operand_b = try cg.resolve(unwrapped.operand_b);
3590
3591 const constituents = try gpa.alloc(Id, mask.len);
3592 defer gpa.free(constituents);
3593
3594 for (constituents, mask) |*id, mask_elem| {
3595 id.* = switch (mask_elem.unwrap()) {
3596 .a_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_a, idx),
3597 .b_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_b, idx),
3598 .undef => try cg.module.constUndef(elem_ty_id),
3599 };
3600 }
3601
3602 const result_ty_id = try cg.resolveType(result_ty, .direct);
3603 return try cg.constructComposite(result_ty_id, constituents);
3604}
3605
3606fn indicesToIds(cg: *CodeGen, indices: []const u32) ![]Id {
3607 const gpa = cg.module.gpa;
3608 const ids = try gpa.alloc(Id, indices.len);
3609 errdefer gpa.free(ids);
3610 for (indices, ids) |index, *id| {
3611 id.* = try cg.constInt(.u32, index);
3612 }
3613
3614 return ids;
3615}
3616
3617fn accessChainId(
3618 cg: *CodeGen,
3619 result_ty_id: Id,
3620 base: Id,
3621 indices: []const Id,
3622) !Id {
3623 const result_id = cg.module.allocId();
3624 try cg.body.emit(cg.module.gpa, .OpInBoundsAccessChain, .{
3625 .id_result_type = result_ty_id,
3626 .id_result = result_id,
3627 .base = base,
3628 .indexes = indices,
3629 });
3630 return result_id;
3631}
3632
3633/// AccessChain is essentially PtrAccessChain with 0 as initial argument. The effective
3634/// difference lies in whether the resulting type of the first dereference will be the
3635/// same as that of the base pointer, or that of a dereferenced base pointer. AccessChain
3636/// is the latter and PtrAccessChain is the former.
3637fn accessChain(
3638 cg: *CodeGen,
3639 result_ty_id: Id,
3640 base: Id,
3641 indices: []const u32,
3642) !Id {
3643 const gpa = cg.module.gpa;
3644 const ids = try cg.indicesToIds(indices);
3645 defer gpa.free(ids);
3646 return try cg.accessChainId(result_ty_id, base, ids);
3647}
3648
3649fn ptrAccessChain(
3650 cg: *CodeGen,
3651 result_ty_id: Id,
3652 base: Id,
3653 element: Id,
3654 indices: []const u32,
3655) !Id {
3656 const gpa = cg.module.gpa;
3657 const target = cg.module.zcu.getTarget();
3658 const ids = try cg.indicesToIds(indices);
3659 defer gpa.free(ids);
3660
3661 const result_id = cg.module.allocId();
3662 switch (target.os.tag) {
3663 .opencl, .amdhsa => {
3664 try cg.body.emit(cg.module.gpa, .OpInBoundsPtrAccessChain, .{
3665 .id_result_type = result_ty_id,
3666 .id_result = result_id,
3667 .base = base,
3668 .element = element,
3669 .indexes = ids,
3670 });
3671 },
3672 else => {
3673 try cg.body.emit(cg.module.gpa, .OpPtrAccessChain, .{
3674 .id_result_type = result_ty_id,
3675 .id_result = result_id,
3676 .base = base,
3677 .element = element,
3678 .indexes = ids,
3679 });
3680 },
3681 }
3682 return result_id;
3683}
3684
3685fn ptrAdd(cg: *CodeGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id) !Id {
3686 const zcu = cg.module.zcu;
3687 const result_ty_id = try cg.resolveType(result_ty, .direct);
3688
3689 switch (ptr_ty.ptrSize(zcu)) {
3690 .one => {
3691 // Pointer to array
3692 // TODO: Is this correct?
3693 return try cg.accessChainId(result_ty_id, ptr_id, &.{offset_id});
3694 },
3695 .c, .many => {
3696 return try cg.ptrAccessChain(result_ty_id, ptr_id, offset_id, &.{});
3697 },
3698 .slice => {
3699 // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does.
3700 const slice_ptr_id = try cg.extractField(result_ty, ptr_id, 0);
3701 return try cg.ptrAccessChain(result_ty_id, slice_ptr_id, offset_id, &.{});
3702 },
3703 }
3704}
3705
3706fn airPtrAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3707 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3708 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3709 const ptr_id = try cg.resolve(bin_op.lhs);
3710 const offset_id = try cg.resolve(bin_op.rhs);
3711 const ptr_ty = cg.typeOf(bin_op.lhs);
3712 const result_ty = cg.typeOfIndex(inst);
3713
3714 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, offset_id);
3715}
3716
3717fn airPtrSub(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3718 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3719 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3720 const ptr_id = try cg.resolve(bin_op.lhs);
3721 const ptr_ty = cg.typeOf(bin_op.lhs);
3722 const offset_id = try cg.resolve(bin_op.rhs);
3723 const offset_ty = cg.typeOf(bin_op.rhs);
3724 const offset_ty_id = try cg.resolveType(offset_ty, .direct);
3725 const result_ty = cg.typeOfIndex(inst);
3726
3727 const negative_offset_id = cg.module.allocId();
3728 try cg.body.emit(cg.module.gpa, .OpSNegate, .{
3729 .id_result_type = offset_ty_id,
3730 .id_result = negative_offset_id,
3731 .operand = offset_id,
3732 });
3733 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, negative_offset_id);
3734}
3735
3736fn cmp(
3737 cg: *CodeGen,
3738 op: std.math.CompareOperator,
3739 lhs: Temporary,
3740 rhs: Temporary,
3741) !Temporary {
3742 const pt = cg.pt;
3743 const zcu = cg.module.zcu;
3744 const ip = &zcu.intern_pool;
3745 const scalar_ty = lhs.ty.scalarType(zcu);
3746 const is_vector = lhs.ty.isVector(zcu);
3747
3748 switch (scalar_ty.zigTypeTag(zcu)) {
3749 .int, .bool, .float => {},
3750 .@"enum" => {
3751 assert(!is_vector);
3752 const ty = lhs.ty.intTagType(zcu);
3753 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
3754 },
3755 .@"struct" => {
3756 const struct_ty = zcu.typeToPackedStruct(scalar_ty).?;
3757 const ty: Type = .fromInterned(struct_ty.backingIntTypeUnordered(ip));
3758 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
3759 },
3760 .error_set => {
3761 assert(!is_vector);
3762 const err_int_ty = try pt.errorIntType();
3763 return try cg.cmp(op, lhs.pun(err_int_ty), rhs.pun(err_int_ty));
3764 },
3765 .pointer => {
3766 assert(!is_vector);
3767 // Note that while SPIR-V offers OpPtrEqual and OpPtrNotEqual, they are
3768 // currently not implemented in the SPIR-V LLVM translator. Thus, we emit these using
3769 // OpConvertPtrToU...
3770
3771 const usize_ty_id = try cg.resolveType(.usize, .direct);
3772
3773 const lhs_int_id = cg.module.allocId();
3774 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
3775 .id_result_type = usize_ty_id,
3776 .id_result = lhs_int_id,
3777 .pointer = try lhs.materialize(cg),
3778 });
3779
3780 const rhs_int_id = cg.module.allocId();
3781 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
3782 .id_result_type = usize_ty_id,
3783 .id_result = rhs_int_id,
3784 .pointer = try rhs.materialize(cg),
3785 });
3786
3787 const lhs_int: Temporary = .init(.usize, lhs_int_id);
3788 const rhs_int: Temporary = .init(.usize, rhs_int_id);
3789 return try cg.cmp(op, lhs_int, rhs_int);
3790 },
3791 .optional => {
3792 assert(!is_vector);
3793
3794 const ty = lhs.ty;
3795
3796 const payload_ty = ty.optionalChild(zcu);
3797 if (ty.optionalReprIsPayload(zcu)) {
3798 assert(payload_ty.hasRuntimeBitsIgnoreComptime(zcu));
3799 assert(!payload_ty.isSlice(zcu));
3800
3801 return try cg.cmp(op, lhs.pun(payload_ty), rhs.pun(payload_ty));
3802 }
3803
3804 const lhs_id = try lhs.materialize(cg);
3805 const rhs_id = try rhs.materialize(cg);
3806
3807 const lhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
3808 try cg.extractField(.bool, lhs_id, 1)
3809 else
3810 try cg.convertToDirect(.bool, lhs_id);
3811
3812 const rhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
3813 try cg.extractField(.bool, rhs_id, 1)
3814 else
3815 try cg.convertToDirect(.bool, rhs_id);
3816
3817 const lhs_valid: Temporary = .init(.bool, lhs_valid_id);
3818 const rhs_valid: Temporary = .init(.bool, rhs_valid_id);
3819
3820 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
3821 return try cg.cmp(op, lhs_valid, rhs_valid);
3822 }
3823
3824 // a = lhs_valid
3825 // b = rhs_valid
3826 // c = lhs_pl == rhs_pl
3827 //
3828 // For op == .eq we have:
3829 // a == b && a -> c
3830 // = a == b && (!a || c)
3831 //
3832 // For op == .neq we have
3833 // a == b && a -> c
3834 // = !(a == b && a -> c)
3835 // = a != b || !(a -> c
3836 // = a != b || !(!a || c)
3837 // = a != b || a && !c
3838
3839 const lhs_pl_id = try cg.extractField(payload_ty, lhs_id, 0);
3840 const rhs_pl_id = try cg.extractField(payload_ty, rhs_id, 0);
3841
3842 const lhs_pl: Temporary = .init(payload_ty, lhs_pl_id);
3843 const rhs_pl: Temporary = .init(payload_ty, rhs_pl_id);
3844
3845 return switch (op) {
3846 .eq => try cg.buildBinary(
3847 .OpLogicalAnd,
3848 try cg.cmp(.eq, lhs_valid, rhs_valid),
3849 try cg.buildBinary(
3850 .OpLogicalOr,
3851 try cg.buildUnary(.l_not, lhs_valid),
3852 try cg.cmp(.eq, lhs_pl, rhs_pl),
3853 ),
3854 ),
3855 .neq => try cg.buildBinary(
3856 .OpLogicalOr,
3857 try cg.cmp(.neq, lhs_valid, rhs_valid),
3858 try cg.buildBinary(
3859 .OpLogicalAnd,
3860 lhs_valid,
3861 try cg.cmp(.neq, lhs_pl, rhs_pl),
3862 ),
3863 ),
3864 else => unreachable,
3865 };
3866 },
3867 else => |ty| return cg.todo("implement cmp operation for '{s}' type", .{@tagName(ty)}),
3868 }
3869
3870 const info = cg.arithmeticTypeInfo(scalar_ty);
3871 const pred: Opcode = switch (info.class) {
3872 .composite_integer => unreachable, // TODO
3873 .float => switch (op) {
3874 .eq => .OpFOrdEqual,
3875 .neq => .OpFUnordNotEqual,
3876 .lt => .OpFOrdLessThan,
3877 .lte => .OpFOrdLessThanEqual,
3878 .gt => .OpFOrdGreaterThan,
3879 .gte => .OpFOrdGreaterThanEqual,
3880 },
3881 .bool => switch (op) {
3882 .eq => .OpLogicalEqual,
3883 .neq => .OpLogicalNotEqual,
3884 else => unreachable,
3885 },
3886 .integer, .strange_integer => switch (info.signedness) {
3887 .signed => switch (op) {
3888 .eq => .OpIEqual,
3889 .neq => .OpINotEqual,
3890 .lt => .OpSLessThan,
3891 .lte => .OpSLessThanEqual,
3892 .gt => .OpSGreaterThan,
3893 .gte => .OpSGreaterThanEqual,
3894 },
3895 .unsigned => switch (op) {
3896 .eq => .OpIEqual,
3897 .neq => .OpINotEqual,
3898 .lt => .OpULessThan,
3899 .lte => .OpULessThanEqual,
3900 .gt => .OpUGreaterThan,
3901 .gte => .OpUGreaterThanEqual,
3902 },
3903 },
3904 };
3905
3906 return try cg.buildCmp(pred, lhs, rhs);
3907}
3908
3909fn airCmp(
3910 cg: *CodeGen,
3911 inst: Air.Inst.Index,
3912 comptime op: std.math.CompareOperator,
3913) !?Id {
3914 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3915 const lhs = try cg.temporary(bin_op.lhs);
3916 const rhs = try cg.temporary(bin_op.rhs);
3917
3918 const result = try cg.cmp(op, lhs, rhs);
3919 return try result.materialize(cg);
3920}
3921
3922fn airVectorCmp(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3923 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3924 const vec_cmp = cg.air.extraData(Air.VectorCmp, ty_pl.payload).data;
3925 const lhs = try cg.temporary(vec_cmp.lhs);
3926 const rhs = try cg.temporary(vec_cmp.rhs);
3927 const op = vec_cmp.compareOperator();
3928
3929 const result = try cg.cmp(op, lhs, rhs);
3930 return try result.materialize(cg);
3931}
3932
3933/// Bitcast one type to another. Note: both types, input, output are expected in **direct** representation.
3934fn bitCast(
3935 cg: *CodeGen,
3936 dst_ty: Type,
3937 src_ty: Type,
3938 src_id: Id,
3939) !Id {
3940 const zcu = cg.module.zcu;
3941 const src_ty_id = try cg.resolveType(src_ty, .direct);
3942 const dst_ty_id = try cg.resolveType(dst_ty, .direct);
3943
3944 const result_id = blk: {
3945 if (src_ty_id == dst_ty_id) break :blk src_id;
3946
3947 // TODO: Some more cases are missing here
3948 // See fn bitCast in llvm.zig
3949
3950 if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) {
3951 const result_id = cg.module.allocId();
3952 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
3953 .id_result_type = dst_ty_id,
3954 .id_result = result_id,
3955 .integer_value = src_id,
3956 });
3957 break :blk result_id;
3958 }
3959
3960 // We can only use OpBitcast for specific conversions: between numerical types, and
3961 // between pointers. If the resolved spir-v types fall into this category then emit OpBitcast,
3962 // otherwise use a temporary and perform a pointer cast.
3963 const can_bitcast = (src_ty.isNumeric(zcu) and dst_ty.isNumeric(zcu)) or (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu));
3964 if (can_bitcast) {
3965 const result_id = cg.module.allocId();
3966 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
3967 .id_result_type = dst_ty_id,
3968 .id_result = result_id,
3969 .operand = src_id,
3970 });
3971
3972 break :blk result_id;
3973 }
3974
3975 const dst_ptr_ty_id = try cg.module.ptrType(dst_ty_id, .function);
3976
3977 const tmp_id = try cg.alloc(src_ty, .{ .storage_class = .function });
3978 try cg.store(src_ty, tmp_id, src_id, .{});
3979 const casted_ptr_id = cg.module.allocId();
3980 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
3981 .id_result_type = dst_ptr_ty_id,
3982 .id_result = casted_ptr_id,
3983 .operand = tmp_id,
3984 });
3985 break :blk try cg.load(dst_ty, casted_ptr_id, .{});
3986 };
3987
3988 // Because strange integers use sign-extended representation, we may need to normalize
3989 // the result here.
3990 // TODO: This detail could cause stuff like @as(*const i1, @ptrCast(&@as(u1, 1))) to break
3991 // should we change the representation of strange integers?
3992 if (dst_ty.zigTypeTag(zcu) == .int) {
3993 const info = cg.arithmeticTypeInfo(dst_ty);
3994 const result = try cg.normalize(Temporary.init(dst_ty, result_id), info);
3995 return try result.materialize(cg);
3996 }
3997
3998 return result_id;
3999}
4000
4001fn airBitCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4002 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4003 const operand_ty = cg.typeOf(ty_op.operand);
4004 const result_ty = cg.typeOfIndex(inst);
4005 if (operand_ty.toIntern() == .bool_type) {
4006 const operand = try cg.temporary(ty_op.operand);
4007 const result = try cg.intFromBool(operand);
4008 return try result.materialize(cg);
4009 }
4010 const operand_id = try cg.resolve(ty_op.operand);
4011 return try cg.bitCast(result_ty, operand_ty, operand_id);
4012}
4013
4014fn airIntCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4015 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4016 const src = try cg.temporary(ty_op.operand);
4017 const dst_ty = cg.typeOfIndex(inst);
4018
4019 const src_info = cg.arithmeticTypeInfo(src.ty);
4020 const dst_info = cg.arithmeticTypeInfo(dst_ty);
4021
4022 if (src_info.backing_bits == dst_info.backing_bits) {
4023 return try src.materialize(cg);
4024 }
4025
4026 const converted = try cg.buildConvert(dst_ty, src);
4027
4028 // Make sure to normalize the result if shrinking.
4029 // Because strange ints are sign extended in their backing
4030 // type, we don't need to normalize when growing the type. The
4031 // representation is already the same.
4032 const result = if (dst_info.bits < src_info.bits)
4033 try cg.normalize(converted, dst_info)
4034 else
4035 converted;
4036
4037 return try result.materialize(cg);
4038}
4039
4040fn intFromPtr(cg: *CodeGen, operand_id: Id) !Id {
4041 const result_type_id = try cg.resolveType(.usize, .direct);
4042 const result_id = cg.module.allocId();
4043 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
4044 .id_result_type = result_type_id,
4045 .id_result = result_id,
4046 .pointer = operand_id,
4047 });
4048 return result_id;
4049}
4050
4051fn airFloatFromInt(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4052 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4053 const operand_ty = cg.typeOf(ty_op.operand);
4054 const operand_id = try cg.resolve(ty_op.operand);
4055 const result_ty = cg.typeOfIndex(inst);
4056 return try cg.floatFromInt(result_ty, operand_ty, operand_id);
4057}
4058
4059fn floatFromInt(cg: *CodeGen, result_ty: Type, operand_ty: Type, operand_id: Id) !Id {
4060 const operand_info = cg.arithmeticTypeInfo(operand_ty);
4061 const result_id = cg.module.allocId();
4062 const result_ty_id = try cg.resolveType(result_ty, .direct);
4063 switch (operand_info.signedness) {
4064 .signed => try cg.body.emit(cg.module.gpa, .OpConvertSToF, .{
4065 .id_result_type = result_ty_id,
4066 .id_result = result_id,
4067 .signed_value = operand_id,
4068 }),
4069 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertUToF, .{
4070 .id_result_type = result_ty_id,
4071 .id_result = result_id,
4072 .unsigned_value = operand_id,
4073 }),
4074 }
4075 return result_id;
4076}
4077
4078fn airIntFromFloat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4079 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4080 const operand_id = try cg.resolve(ty_op.operand);
4081 const result_ty = cg.typeOfIndex(inst);
4082 return try cg.intFromFloat(result_ty, operand_id);
4083}
4084
4085fn intFromFloat(cg: *CodeGen, result_ty: Type, operand_id: Id) !Id {
4086 const result_info = cg.arithmeticTypeInfo(result_ty);
4087 const result_ty_id = try cg.resolveType(result_ty, .direct);
4088 const result_id = cg.module.allocId();
4089 switch (result_info.signedness) {
4090 .signed => try cg.body.emit(cg.module.gpa, .OpConvertFToS, .{
4091 .id_result_type = result_ty_id,
4092 .id_result = result_id,
4093 .float_value = operand_id,
4094 }),
4095 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertFToU, .{
4096 .id_result_type = result_ty_id,
4097 .id_result = result_id,
4098 .float_value = operand_id,
4099 }),
4100 }
4101 return result_id;
4102}
4103
4104fn airFloatCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4105 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4106 const operand = try cg.temporary(ty_op.operand);
4107 const dest_ty = cg.typeOfIndex(inst);
4108 const result = try cg.buildConvert(dest_ty, operand);
4109 return try result.materialize(cg);
4110}
4111
4112fn airNot(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4113 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4114 const operand = try cg.temporary(ty_op.operand);
4115 const result_ty = cg.typeOfIndex(inst);
4116 const info = cg.arithmeticTypeInfo(result_ty);
4117
4118 const result = switch (info.class) {
4119 .bool => try cg.buildUnary(.l_not, operand),
4120 .float => unreachable,
4121 .composite_integer => unreachable, // TODO
4122 .strange_integer, .integer => blk: {
4123 const complement = try cg.buildUnary(.bit_not, operand);
4124 break :blk try cg.normalize(complement, info);
4125 },
4126 };
4127
4128 return try result.materialize(cg);
4129}
4130
4131fn airArrayToSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4132 const zcu = cg.module.zcu;
4133 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4134 const array_ptr_ty = cg.typeOf(ty_op.operand);
4135 const array_ty = array_ptr_ty.childType(zcu);
4136 const slice_ty = cg.typeOfIndex(inst);
4137 const elem_ptr_ty = slice_ty.slicePtrFieldType(zcu);
4138
4139 const elem_ptr_ty_id = try cg.resolveType(elem_ptr_ty, .direct);
4140
4141 const array_ptr_id = try cg.resolve(ty_op.operand);
4142 const len_id = try cg.constInt(.usize, array_ty.arrayLen(zcu));
4143
4144 const elem_ptr_id = if (!array_ty.hasRuntimeBitsIgnoreComptime(zcu))
4145 // Note: The pointer is something like *opaque{}, so we need to bitcast it to the element type.
4146 try cg.bitCast(elem_ptr_ty, array_ptr_ty, array_ptr_id)
4147 else
4148 // Convert the pointer-to-array to a pointer to the first element.
4149 try cg.accessChain(elem_ptr_ty_id, array_ptr_id, &.{0});
4150
4151 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4152 return try cg.constructComposite(slice_ty_id, &.{ elem_ptr_id, len_id });
4153}
4154
4155fn airSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4156 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4157 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4158 const ptr_id = try cg.resolve(bin_op.lhs);
4159 const len_id = try cg.resolve(bin_op.rhs);
4160 const slice_ty = cg.typeOfIndex(inst);
4161 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4162 return try cg.constructComposite(slice_ty_id, &.{ ptr_id, len_id });
4163}
4164
4165fn airAggregateInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4166 const gpa = cg.module.gpa;
4167 const pt = cg.pt;
4168 const zcu = cg.module.zcu;
4169 const ip = &zcu.intern_pool;
4170 const target = cg.module.zcu.getTarget();
4171 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4172 const result_ty = cg.typeOfIndex(inst);
4173 const len: usize = @intCast(result_ty.arrayLen(zcu));
4174 const elements: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[ty_pl.payload..][0..len]);
4175
4176 switch (result_ty.zigTypeTag(zcu)) {
4177 .@"struct" => {
4178 if (zcu.typeToPackedStruct(result_ty)) |struct_type| {
4179 comptime assert(Type.packed_struct_layout_version == 2);
4180 const backing_int_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
4181 var running_int_id = try cg.constInt(backing_int_ty, 0);
4182 var running_bits: u16 = 0;
4183 for (struct_type.field_types.get(ip), elements) |field_ty_ip, element| {
4184 const field_ty: Type = .fromInterned(field_ty_ip);
4185 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
4186 const field_id = try cg.resolve(element);
4187 const ty_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4188 const field_int_ty = try cg.pt.intType(.unsigned, ty_bit_size);
4189 const field_int_id = blk: {
4190 if (field_ty.isPtrAtRuntime(zcu)) {
4191 assert(target.cpu.arch == .spirv64 and
4192 field_ty.ptrAddressSpace(zcu) == .storage_buffer);
4193 break :blk try cg.intFromPtr(field_id);
4194 }
4195 break :blk try cg.bitCast(field_int_ty, field_ty, field_id);
4196 };
4197 const shift_rhs = try cg.constInt(backing_int_ty, running_bits);
4198 const extended_int_conv = try cg.buildConvert(backing_int_ty, .{
4199 .ty = field_int_ty,
4200 .value = .{ .singleton = field_int_id },
4201 });
4202 const shifted = try cg.buildBinary(.OpShiftLeftLogical, extended_int_conv, .{
4203 .ty = backing_int_ty,
4204 .value = .{ .singleton = shift_rhs },
4205 });
4206 const running_int_tmp = try cg.buildBinary(
4207 .OpBitwiseOr,
4208 .{ .ty = backing_int_ty, .value = .{ .singleton = running_int_id } },
4209 shifted,
4210 );
4211 running_int_id = try running_int_tmp.materialize(cg);
4212 running_bits += ty_bit_size;
4213 }
4214 return running_int_id;
4215 }
4216
4217 const types = try gpa.alloc(Type, elements.len);
4218 defer gpa.free(types);
4219 const constituents = try gpa.alloc(Id, elements.len);
4220 defer gpa.free(constituents);
4221 var index: usize = 0;
4222
4223 switch (ip.indexToKey(result_ty.toIntern())) {
4224 .tuple_type => |tuple| {
4225 for (tuple.types.get(ip), elements, 0..) |field_ty, element, i| {
4226 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4227 assert(Type.fromInterned(field_ty).hasRuntimeBits(zcu));
4228
4229 const id = try cg.resolve(element);
4230 types[index] = .fromInterned(field_ty);
4231 constituents[index] = try cg.convertToIndirect(.fromInterned(field_ty), id);
4232 index += 1;
4233 }
4234 },
4235 .struct_type => {
4236 const struct_type = ip.loadStructType(result_ty.toIntern());
4237 var it = struct_type.iterateRuntimeOrder(ip);
4238 for (elements, 0..) |element, i| {
4239 const field_index = it.next().?;
4240 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4241 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
4242 assert(field_ty.hasRuntimeBitsIgnoreComptime(zcu));
4243
4244 const id = try cg.resolve(element);
4245 types[index] = field_ty;
4246 constituents[index] = try cg.convertToIndirect(field_ty, id);
4247 index += 1;
4248 }
4249 },
4250 else => unreachable,
4251 }
4252
4253 const result_ty_id = try cg.resolveType(result_ty, .direct);
4254 return try cg.constructComposite(result_ty_id, constituents[0..index]);
4255 },
4256 .vector => {
4257 const n_elems = result_ty.vectorLen(zcu);
4258 const elem_ids = try gpa.alloc(Id, n_elems);
4259 defer gpa.free(elem_ids);
4260
4261 for (elements, 0..) |element, i| {
4262 elem_ids[i] = try cg.resolve(element);
4263 }
4264
4265 const result_ty_id = try cg.resolveType(result_ty, .direct);
4266 return try cg.constructComposite(result_ty_id, elem_ids);
4267 },
4268 .array => {
4269 const array_info = result_ty.arrayInfo(zcu);
4270 const n_elems: usize = @intCast(result_ty.arrayLenIncludingSentinel(zcu));
4271 const elem_ids = try gpa.alloc(Id, n_elems);
4272 defer gpa.free(elem_ids);
4273
4274 for (elements, 0..) |element, i| {
4275 const id = try cg.resolve(element);
4276 elem_ids[i] = try cg.convertToIndirect(array_info.elem_type, id);
4277 }
4278
4279 if (array_info.sentinel) |sentinel_val| {
4280 elem_ids[n_elems - 1] = try cg.constant(array_info.elem_type, sentinel_val, .indirect);
4281 }
4282
4283 const result_ty_id = try cg.resolveType(result_ty, .direct);
4284 return try cg.constructComposite(result_ty_id, elem_ids);
4285 },
4286 else => unreachable,
4287 }
4288}
4289
4290fn sliceOrArrayLen(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4291 const zcu = cg.module.zcu;
4292 switch (ty.ptrSize(zcu)) {
4293 .slice => return cg.extractField(.usize, operand_id, 1),
4294 .one => {
4295 const array_ty = ty.childType(zcu);
4296 const elem_ty = array_ty.childType(zcu);
4297 const abi_size = elem_ty.abiSize(zcu);
4298 const size = array_ty.arrayLenIncludingSentinel(zcu) * abi_size;
4299 return try cg.constInt(.usize, size);
4300 },
4301 .many, .c => unreachable,
4302 }
4303}
4304
4305fn sliceOrArrayPtr(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4306 const zcu = cg.module.zcu;
4307 if (ty.isSlice(zcu)) {
4308 const ptr_ty = ty.slicePtrFieldType(zcu);
4309 return cg.extractField(ptr_ty, operand_id, 0);
4310 }
4311 return operand_id;
4312}
4313
4314fn airMemcpy(cg: *CodeGen, inst: Air.Inst.Index) !void {
4315 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4316 const dest_slice = try cg.resolve(bin_op.lhs);
4317 const src_slice = try cg.resolve(bin_op.rhs);
4318 const dest_ty = cg.typeOf(bin_op.lhs);
4319 const src_ty = cg.typeOf(bin_op.rhs);
4320 const dest_ptr = try cg.sliceOrArrayPtr(dest_slice, dest_ty);
4321 const src_ptr = try cg.sliceOrArrayPtr(src_slice, src_ty);
4322 const len = try cg.sliceOrArrayLen(dest_slice, dest_ty);
4323 try cg.body.emit(cg.module.gpa, .OpCopyMemorySized, .{
4324 .target = dest_ptr,
4325 .source = src_ptr,
4326 .size = len,
4327 });
4328}
4329
4330fn airMemmove(cg: *CodeGen, inst: Air.Inst.Index) !void {
4331 _ = inst;
4332 return cg.fail("TODO implement airMemcpy for spirv", .{});
4333}
4334
4335fn airSliceField(cg: *CodeGen, inst: Air.Inst.Index, field: u32) !?Id {
4336 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4337 const field_ty = cg.typeOfIndex(inst);
4338 const operand_id = try cg.resolve(ty_op.operand);
4339 return try cg.extractField(field_ty, operand_id, field);
4340}
4341
4342fn airSliceElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4343 const zcu = cg.module.zcu;
4344 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4345 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4346 const slice_ty = cg.typeOf(bin_op.lhs);
4347 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4348
4349 const slice_id = try cg.resolve(bin_op.lhs);
4350 const index_id = try cg.resolve(bin_op.rhs);
4351
4352 const ptr_ty = cg.typeOfIndex(inst);
4353 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4354
4355 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4356 return try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4357}
4358
4359fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4360 const zcu = cg.module.zcu;
4361 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4362 const slice_ty = cg.typeOf(bin_op.lhs);
4363 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4364
4365 const slice_id = try cg.resolve(bin_op.lhs);
4366 const index_id = try cg.resolve(bin_op.rhs);
4367
4368 const ptr_ty = slice_ty.slicePtrFieldType(zcu);
4369 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4370
4371 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4372 const elem_ptr = try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4373 return try cg.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) });
4374}
4375
4376fn ptrElemPtr(cg: *CodeGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {
4377 const zcu = cg.module.zcu;
4378 // Construct new pointer type for the resulting pointer
4379 const elem_ty = ptr_ty.elemType2(zcu); // use elemType() so that we get T for *[N]T.
4380 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
4381 const elem_ptr_ty_id = try cg.module.ptrType(elem_ty_id, cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)));
4382 if (ptr_ty.isSinglePointer(zcu)) {
4383 // Pointer-to-array. In this case, the resulting pointer is not of the same type
4384 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.
4385 return try cg.accessChainId(elem_ptr_ty_id, ptr_id, &.{index_id});
4386 } else {
4387 // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain
4388 return try cg.ptrAccessChain(elem_ptr_ty_id, ptr_id, index_id, &.{});
4389 }
4390}
4391
4392fn airPtrElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4393 const zcu = cg.module.zcu;
4394 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4395 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4396 const src_ptr_ty = cg.typeOf(bin_op.lhs);
4397 const elem_ty = src_ptr_ty.childType(zcu);
4398 const ptr_id = try cg.resolve(bin_op.lhs);
4399
4400 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4401 const dst_ptr_ty = cg.typeOfIndex(inst);
4402 return try cg.bitCast(dst_ptr_ty, src_ptr_ty, ptr_id);
4403 }
4404
4405 const index_id = try cg.resolve(bin_op.rhs);
4406 return try cg.ptrElemPtr(src_ptr_ty, ptr_id, index_id);
4407}
4408
4409fn airArrayElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4410 const zcu = cg.module.zcu;
4411 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4412 const array_ty = cg.typeOf(bin_op.lhs);
4413 const elem_ty = array_ty.childType(zcu);
4414 const array_id = try cg.resolve(bin_op.lhs);
4415 const index_id = try cg.resolve(bin_op.rhs);
4416
4417 // SPIR-V doesn't have an array indexing function for some damn reason.
4418 // For now, just generate a temporary and use that.
4419 // TODO: This backend probably also should use isByRef from llvm...
4420
4421 const is_vector = array_ty.isVector(zcu);
4422
4423 const elem_repr: Repr = if (is_vector) .direct else .indirect;
4424 const array_ty_id = try cg.resolveType(array_ty, .direct);
4425 const elem_ty_id = try cg.resolveType(elem_ty, elem_repr);
4426 const ptr_array_ty_id = try cg.module.ptrType(array_ty_id, .function);
4427 const ptr_elem_ty_id = try cg.module.ptrType(elem_ty_id, .function);
4428
4429 const tmp_id = cg.module.allocId();
4430 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
4431 .id_result_type = ptr_array_ty_id,
4432 .id_result = tmp_id,
4433 .storage_class = .function,
4434 });
4435
4436 try cg.body.emit(cg.module.gpa, .OpStore, .{
4437 .pointer = tmp_id,
4438 .object = array_id,
4439 });
4440
4441 const elem_ptr_id = try cg.accessChainId(ptr_elem_ty_id, tmp_id, &.{index_id});
4442
4443 const result_id = cg.module.allocId();
4444 try cg.body.emit(cg.module.gpa, .OpLoad, .{
4445 .id_result_type = try cg.resolveType(elem_ty, elem_repr),
4446 .id_result = result_id,
4447 .pointer = elem_ptr_id,
4448 });
4449
4450 if (is_vector) {
4451 // Result is already in direct representation
4452 return result_id;
4453 }
4454
4455 // This is an array type; the elements are stored in indirect representation.
4456 // We have to convert the type to direct.
4457
4458 return try cg.convertToDirect(elem_ty, result_id);
4459}
4460
4461fn airPtrElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4462 const zcu = cg.module.zcu;
4463 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4464 const ptr_ty = cg.typeOf(bin_op.lhs);
4465 const elem_ty = cg.typeOfIndex(inst);
4466 const ptr_id = try cg.resolve(bin_op.lhs);
4467 const index_id = try cg.resolve(bin_op.rhs);
4468 const elem_ptr_id = try cg.ptrElemPtr(ptr_ty, ptr_id, index_id);
4469 return try cg.load(elem_ty, elem_ptr_id, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
4470}
4471
4472fn airVectorStoreElem(cg: *CodeGen, inst: Air.Inst.Index) !void {
4473 const zcu = cg.module.zcu;
4474 const data = cg.air.instructions.items(.data)[@intFromEnum(inst)].vector_store_elem;
4475 const extra = cg.air.extraData(Air.Bin, data.payload).data;
4476
4477 const vector_ptr_ty = cg.typeOf(data.vector_ptr);
4478 const vector_ty = vector_ptr_ty.childType(zcu);
4479 const scalar_ty = vector_ty.scalarType(zcu);
4480
4481 const scalar_ty_id = try cg.resolveType(scalar_ty, .indirect);
4482 const storage_class = cg.module.storageClass(vector_ptr_ty.ptrAddressSpace(zcu));
4483 const scalar_ptr_ty_id = try cg.module.ptrType(scalar_ty_id, storage_class);
4484
4485 const vector_ptr = try cg.resolve(data.vector_ptr);
4486 const index = try cg.resolve(extra.lhs);
4487 const operand = try cg.resolve(extra.rhs);
4488
4489 const elem_ptr_id = try cg.accessChainId(scalar_ptr_ty_id, vector_ptr, &.{index});
4490 try cg.store(scalar_ty, elem_ptr_id, operand, .{
4491 .is_volatile = vector_ptr_ty.isVolatilePtr(zcu),
4492 });
4493}
4494
4495fn airSetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !void {
4496 const zcu = cg.module.zcu;
4497 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4498 const un_ptr_ty = cg.typeOf(bin_op.lhs);
4499 const un_ty = un_ptr_ty.childType(zcu);
4500 const layout = cg.unionLayout(un_ty);
4501
4502 if (layout.tag_size == 0) return;
4503
4504 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4505 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);
4506 const tag_ptr_ty_id = try cg.module.ptrType(tag_ty_id, cg.module.storageClass(un_ptr_ty.ptrAddressSpace(zcu)));
4507
4508 const union_ptr_id = try cg.resolve(bin_op.lhs);
4509 const new_tag_id = try cg.resolve(bin_op.rhs);
4510
4511 if (!layout.has_payload) {
4512 try cg.store(tag_ty, union_ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4513 } else {
4514 const ptr_id = try cg.accessChain(tag_ptr_ty_id, union_ptr_id, &.{layout.tag_index});
4515 try cg.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4516 }
4517}
4518
4519fn airGetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4520 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4521 const un_ty = cg.typeOf(ty_op.operand);
4522
4523 const zcu = cg.module.zcu;
4524 const layout = cg.unionLayout(un_ty);
4525 if (layout.tag_size == 0) return null;
4526
4527 const union_handle = try cg.resolve(ty_op.operand);
4528 if (!layout.has_payload) return union_handle;
4529
4530 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4531 return try cg.extractField(tag_ty, union_handle, layout.tag_index);
4532}
4533
4534fn unionInit(
4535 cg: *CodeGen,
4536 ty: Type,
4537 active_field: u32,
4538 payload: ?Id,
4539) !Id {
4540 // To initialize a union, generate a temporary variable with the
4541 // union type, then get the field pointer and pointer-cast it to the
4542 // right type to store it. Finally load the entire union.
4543
4544 // Note: The result here is not cached, because it generates runtime code.
4545
4546 const pt = cg.pt;
4547 const zcu = cg.module.zcu;
4548 const ip = &zcu.intern_pool;
4549 const union_ty = zcu.typeToUnion(ty).?;
4550 const tag_ty: Type = .fromInterned(union_ty.enum_tag_ty);
4551
4552 const layout = cg.unionLayout(ty);
4553 const payload_ty: Type = .fromInterned(union_ty.field_types.get(ip)[active_field]);
4554
4555 if (union_ty.flagsUnordered(ip).layout == .@"packed") {
4556 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4557 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
4558 return cg.constInt(int_ty, 0);
4559 }
4560
4561 assert(payload != null);
4562 if (payload_ty.isInt(zcu)) {
4563 if (ty.bitSize(zcu) == payload_ty.bitSize(zcu)) {
4564 return cg.bitCast(ty, payload_ty, payload.?);
4565 }
4566
4567 const trunc = try cg.buildConvert(ty, .{ .ty = payload_ty, .value = .{ .singleton = payload.? } });
4568 return try trunc.materialize(cg);
4569 }
4570
4571 const payload_int_ty = try pt.intType(.unsigned, @intCast(payload_ty.bitSize(zcu)));
4572 const payload_int = if (payload_ty.ip_index == .bool_type)
4573 try cg.convertToIndirect(payload_ty, payload.?)
4574 else
4575 try cg.bitCast(payload_int_ty, payload_ty, payload.?);
4576 const trunc = try cg.buildConvert(ty, .{ .ty = payload_int_ty, .value = .{ .singleton = payload_int } });
4577 return try trunc.materialize(cg);
4578 }
4579
4580 const tag_int = if (layout.tag_size != 0) blk: {
4581 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);
4582 const tag_int_val = try tag_val.intFromEnum(tag_ty, pt);
4583 break :blk tag_int_val.toUnsignedInt(zcu);
4584 } else 0;
4585
4586 if (!layout.has_payload) {
4587 return try cg.constInt(tag_ty, tag_int);
4588 }
4589
4590 const tmp_id = try cg.alloc(ty, .{ .storage_class = .function });
4591
4592 if (layout.tag_size != 0) {
4593 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);
4594 const tag_ptr_ty_id = try cg.module.ptrType(tag_ty_id, .function);
4595 const ptr_id = try cg.accessChain(tag_ptr_ty_id, tmp_id, &.{@as(u32, @intCast(layout.tag_index))});
4596 const tag_id = try cg.constInt(tag_ty, tag_int);
4597 try cg.store(tag_ty, ptr_id, tag_id, .{});
4598 }
4599
4600 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4601 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4602 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, .function);
4603 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4604 const active_pl_ptr_id = if (!layout.payload_ty.eql(payload_ty, zcu)) blk: {
4605 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
4606 const active_pl_ptr_ty_id = try cg.module.ptrType(payload_ty_id, .function);
4607 const active_pl_ptr_id = cg.module.allocId();
4608 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4609 .id_result_type = active_pl_ptr_ty_id,
4610 .id_result = active_pl_ptr_id,
4611 .operand = pl_ptr_id,
4612 });
4613 break :blk active_pl_ptr_id;
4614 } else pl_ptr_id;
4615
4616 try cg.store(payload_ty, active_pl_ptr_id, payload.?, .{});
4617 } else {
4618 assert(payload == null);
4619 }
4620
4621 // Just leave the padding fields uninitialized...
4622 // TODO: Or should we initialize them with undef explicitly?
4623
4624 return try cg.load(ty, tmp_id, .{});
4625}
4626
4627fn airUnionInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4628 const zcu = cg.module.zcu;
4629 const ip = &zcu.intern_pool;
4630 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4631 const extra = cg.air.extraData(Air.UnionInit, ty_pl.payload).data;
4632 const ty = cg.typeOfIndex(inst);
4633
4634 const union_obj = zcu.typeToUnion(ty).?;
4635 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[extra.field_index]);
4636 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
4637 try cg.resolve(extra.init)
4638 else
4639 null;
4640 return try cg.unionInit(ty, extra.field_index, payload);
4641}
4642
4643fn airStructFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4644 const pt = cg.pt;
4645 const zcu = cg.module.zcu;
4646 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4647 const struct_field = cg.air.extraData(Air.StructField, ty_pl.payload).data;
4648
4649 const object_ty = cg.typeOf(struct_field.struct_operand);
4650 const object_id = try cg.resolve(struct_field.struct_operand);
4651 const field_index = struct_field.field_index;
4652 const field_ty = object_ty.fieldType(field_index, zcu);
4653
4654 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
4655
4656 switch (object_ty.zigTypeTag(zcu)) {
4657 .@"struct" => switch (object_ty.containerLayout(zcu)) {
4658 .@"packed" => {
4659 const struct_ty = zcu.typeToPackedStruct(object_ty).?;
4660 const struct_backing_int_bits = cg.module.backingIntBits(@intCast(object_ty.bitSize(zcu))).@"0";
4661 const bit_offset = zcu.structPackedFieldBitOffset(struct_ty, field_index);
4662 // We use the same int type the packed struct is backed by, because even though it would
4663 // be valid SPIR-V to use an smaller type like u16, some implementations like PoCL will complain.
4664 const bit_offset_id = try cg.constInt(object_ty, bit_offset);
4665 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4666 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4667 const field_int_ty = try pt.intType(signedness, field_bit_size);
4668 const shift_lhs: Temporary = .{ .ty = object_ty, .value = .{ .singleton = object_id } };
4669 const shift = try cg.buildBinary(.OpShiftRightLogical, shift_lhs, .{ .ty = object_ty, .value = .{ .singleton = bit_offset_id } });
4670 const mask_id = try cg.constInt(object_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4671 const masked = try cg.buildBinary(.OpBitwiseAnd, shift, .{ .ty = object_ty, .value = .{ .singleton = mask_id } });
4672 const result_id = blk: {
4673 if (cg.module.backingIntBits(field_bit_size).@"0" == struct_backing_int_bits)
4674 break :blk try cg.bitCast(field_int_ty, object_ty, try masked.materialize(cg));
4675 const trunc = try cg.buildConvert(field_int_ty, masked);
4676 break :blk try trunc.materialize(cg);
4677 };
4678 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4679 if (field_ty.isInt(zcu)) return result_id;
4680 return try cg.bitCast(field_ty, field_int_ty, result_id);
4681 },
4682 else => return try cg.extractField(field_ty, object_id, field_index),
4683 },
4684 .@"union" => switch (object_ty.containerLayout(zcu)) {
4685 .@"packed" => {
4686 const backing_int_ty = try pt.intType(.unsigned, @intCast(object_ty.bitSize(zcu)));
4687 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4688 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4689 const int_ty = try pt.intType(signedness, field_bit_size);
4690 const mask_id = try cg.constInt(backing_int_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4691 const masked = try cg.buildBinary(
4692 .OpBitwiseAnd,
4693 .{ .ty = backing_int_ty, .value = .{ .singleton = object_id } },
4694 .{ .ty = backing_int_ty, .value = .{ .singleton = mask_id } },
4695 );
4696 const result_id = blk: {
4697 if (cg.module.backingIntBits(field_bit_size).@"0" == cg.module.backingIntBits(@intCast(backing_int_ty.bitSize(zcu))).@"0")
4698 break :blk try cg.bitCast(int_ty, backing_int_ty, try masked.materialize(cg));
4699 const trunc = try cg.buildConvert(int_ty, masked);
4700 break :blk try trunc.materialize(cg);
4701 };
4702 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4703 if (field_ty.isInt(zcu)) return result_id;
4704 return try cg.bitCast(field_ty, int_ty, result_id);
4705 },
4706 else => {
4707 // Store, ptr-elem-ptr, pointer-cast, load
4708 const layout = cg.unionLayout(object_ty);
4709 assert(layout.has_payload);
4710
4711 const tmp_id = try cg.alloc(object_ty, .{ .storage_class = .function });
4712 try cg.store(object_ty, tmp_id, object_id, .{});
4713
4714 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4715 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, .function);
4716 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4717
4718 const field_ty_id = try cg.resolveType(field_ty, .indirect);
4719 const active_pl_ptr_ty_id = try cg.module.ptrType(field_ty_id, .function);
4720 const active_pl_ptr_id = cg.module.allocId();
4721 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4722 .id_result_type = active_pl_ptr_ty_id,
4723 .id_result = active_pl_ptr_id,
4724 .operand = pl_ptr_id,
4725 });
4726 return try cg.load(field_ty, active_pl_ptr_id, .{});
4727 },
4728 },
4729 else => unreachable,
4730 }
4731}
4732
4733fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4734 const zcu = cg.module.zcu;
4735 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4736 const extra = cg.air.extraData(Air.FieldParentPtr, ty_pl.payload).data;
4737
4738 const parent_ty = ty_pl.ty.toType().childType(zcu);
4739 const result_ty_id = try cg.resolveType(ty_pl.ty.toType(), .indirect);
4740
4741 const field_ptr = try cg.resolve(extra.field_ptr);
4742 const field_ptr_int = try cg.intFromPtr(field_ptr);
4743 const field_offset = parent_ty.structFieldOffset(extra.field_index, zcu);
4744
4745 const base_ptr_int = base_ptr_int: {
4746 if (field_offset == 0) break :base_ptr_int field_ptr_int;
4747
4748 const field_offset_id = try cg.constInt(.usize, field_offset);
4749 const field_ptr_tmp: Temporary = .init(.usize, field_ptr_int);
4750 const field_offset_tmp: Temporary = .init(.usize, field_offset_id);
4751 const result = try cg.buildBinary(.OpISub, field_ptr_tmp, field_offset_tmp);
4752 break :base_ptr_int try result.materialize(cg);
4753 };
4754
4755 const base_ptr = cg.module.allocId();
4756 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
4757 .id_result_type = result_ty_id,
4758 .id_result = base_ptr,
4759 .integer_value = base_ptr_int,
4760 });
4761
4762 return base_ptr;
4763}
4764
4765fn structFieldPtr(
4766 cg: *CodeGen,
4767 result_ptr_ty: Type,
4768 object_ptr_ty: Type,
4769 object_ptr: Id,
4770 field_index: u32,
4771) !Id {
4772 const result_ty_id = try cg.resolveType(result_ptr_ty, .direct);
4773
4774 const zcu = cg.module.zcu;
4775 const object_ty = object_ptr_ty.childType(zcu);
4776 switch (object_ty.zigTypeTag(zcu)) {
4777 .pointer => {
4778 assert(object_ty.isSlice(zcu));
4779 return cg.accessChain(result_ty_id, object_ptr, &.{field_index});
4780 },
4781 .@"struct" => switch (object_ty.containerLayout(zcu)) {
4782 .@"packed" => return cg.todo("implement field access for packed structs", .{}),
4783 else => {
4784 return try cg.accessChain(result_ty_id, object_ptr, &.{field_index});
4785 },
4786 },
4787 .@"union" => {
4788 const layout = cg.unionLayout(object_ty);
4789 if (!layout.has_payload) {
4790 // Asked to get a pointer to a zero-sized field. Just lower this
4791 // to undefined, there is no reason to make it be a valid pointer.
4792 return try cg.module.constUndef(result_ty_id);
4793 }
4794
4795 const storage_class = cg.module.storageClass(object_ptr_ty.ptrAddressSpace(zcu));
4796 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4797 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, storage_class);
4798 const pl_ptr_id = blk: {
4799 if (object_ty.containerLayout(zcu) == .@"packed") break :blk object_ptr;
4800 break :blk try cg.accessChain(pl_ptr_ty_id, object_ptr, &.{layout.payload_index});
4801 };
4802
4803 const active_pl_ptr_id = cg.module.allocId();
4804 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4805 .id_result_type = result_ty_id,
4806 .id_result = active_pl_ptr_id,
4807 .operand = pl_ptr_id,
4808 });
4809 return active_pl_ptr_id;
4810 },
4811 else => unreachable,
4812 }
4813}
4814
4815fn airStructFieldPtrIndex(cg: *CodeGen, inst: Air.Inst.Index, field_index: u32) !?Id {
4816 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4817 const struct_ptr = try cg.resolve(ty_op.operand);
4818 const struct_ptr_ty = cg.typeOf(ty_op.operand);
4819 const result_ptr_ty = cg.typeOfIndex(inst);
4820 return try cg.structFieldPtr(result_ptr_ty, struct_ptr_ty, struct_ptr, field_index);
4821}
4822
4823const AllocOptions = struct {
4824 initializer: ?Id = null,
4825 /// The final storage class of the pointer. This may be either `.Generic` or `.Function`.
4826 /// In either case, the local is allocated in the `.Function` storage class, and optionally
4827 /// cast back to `.Generic`.
4828 storage_class: StorageClass,
4829};
4830
4831// Allocate a function-local variable, with possible initializer.
4832// This function returns a pointer to a variable of type `ty`,
4833// which is in the Generic address space. The variable is actually
4834// placed in the Function address space.
4835fn alloc(
4836 cg: *CodeGen,
4837 ty: Type,
4838 options: AllocOptions,
4839) !Id {
4840 const ty_id = try cg.resolveType(ty, .indirect);
4841 const ptr_fn_ty_id = try cg.module.ptrType(ty_id, .function);
4842
4843 // SPIR-V requires that OpVariable declarations for locals go into the first block, so we are just going to
4844 // directly generate them into func.prologue instead of the body.
4845 const var_id = cg.module.allocId();
4846 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
4847 .id_result_type = ptr_fn_ty_id,
4848 .id_result = var_id,
4849 .storage_class = .function,
4850 .initializer = options.initializer,
4851 });
4852
4853 return var_id;
4854}
4855
4856fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4857 const zcu = cg.module.zcu;
4858 const ptr_ty = cg.typeOfIndex(inst);
4859 const child_ty = ptr_ty.childType(zcu);
4860 return try cg.alloc(child_ty, .{
4861 .storage_class = cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)),
4862 });
4863}
4864
4865fn airArg(cg: *CodeGen) Id {
4866 defer cg.next_arg_index += 1;
4867 return cg.args.items[cg.next_arg_index];
4868}
4869
4870/// Given a slice of incoming block connections, returns the block-id of the next
4871/// block to jump to. This function emits instructions, so it should be emitted
4872/// inside the merge block of the block.
4873/// This function should only be called with structured control flow generation.
4874fn structuredNextBlock(cg: *CodeGen, incoming: []const ControlFlow.Structured.Block.Incoming) !Id {
4875 assert(cg.control_flow == .structured);
4876
4877 const result_id = cg.module.allocId();
4878 const block_id_ty_id = try cg.resolveType(.u32, .direct);
4879 try cg.body.emitRaw(cg.module.gpa, .OpPhi, @intCast(2 + incoming.len * 2)); // result type + result + variable/parent...
4880 cg.body.writeOperand(Id, block_id_ty_id);
4881 cg.body.writeOperand(Id, result_id);
4882
4883 for (incoming) |incoming_block| {
4884 cg.body.writeOperand(spec.PairIdRefIdRef, .{ incoming_block.next_block, incoming_block.src_label });
4885 }
4886
4887 return result_id;
4888}
4889
4890/// Jumps to the block with the target block-id. This function must only be called when
4891/// terminating a body, there should be no instructions after it.
4892/// This function should only be called with structured control flow generation.
4893fn structuredBreak(cg: *CodeGen, target_block: Id) !void {
4894 assert(cg.control_flow == .structured);
4895
4896 const gpa = cg.module.gpa;
4897 const sblock = cg.control_flow.structured.block_stack.getLast();
4898 const merge_block = switch (sblock.*) {
4899 .selection => |*merge| blk: {
4900 const merge_label = cg.module.allocId();
4901 try merge.merge_stack.append(gpa, .{
4902 .incoming = .{
4903 .src_label = cg.block_label,
4904 .next_block = target_block,
4905 },
4906 .merge_block = merge_label,
4907 });
4908 break :blk merge_label;
4909 },
4910 // Loop blocks do not end in a break. Not through a direct break,
4911 // and also not through another instruction like cond_br or unreachable (these
4912 // situations are replaced by `cond_br` in sema, or there is a `block` instruction
4913 // placed around them).
4914 .loop => unreachable,
4915 };
4916
4917 try cg.body.emitBranch(cg.module.gpa, merge_block);
4918}
4919
4920/// Generate a body in a way that exits the body using only structured constructs.
4921/// Returns the block-id of the next block to jump to. After this function, a jump
4922/// should still be emitted to the block that should follow this structured body.
4923/// This function should only be called with structured control flow generation.
4924fn genStructuredBody(
4925 cg: *CodeGen,
4926 /// This parameter defines the method that this structured body is exited with.
4927 block_merge_type: union(enum) {
4928 /// Using selection; early exits from this body are surrounded with
4929 /// if() statements.
4930 selection,
4931 /// Using loops; loops can be early exited by jumping to the merge block at
4932 /// any time.
4933 loop: struct {
4934 merge_label: Id,
4935 continue_label: Id,
4936 },
4937 },
4938 body: []const Air.Inst.Index,
4939) !Id {
4940 assert(cg.control_flow == .structured);
4941
4942 const gpa = cg.module.gpa;
4943
4944 var sblock: ControlFlow.Structured.Block = switch (block_merge_type) {
4945 .loop => |merge| .{ .loop = .{
4946 .merge_block = merge.merge_label,
4947 } },
4948 .selection => .{ .selection = .{} },
4949 };
4950 defer sblock.deinit(gpa);
4951
4952 {
4953 try cg.control_flow.structured.block_stack.append(gpa, &sblock);
4954 defer _ = cg.control_flow.structured.block_stack.pop();
4955
4956 try cg.genBody(body);
4957 }
4958
4959 switch (sblock) {
4960 .selection => |merge| {
4961 // Now generate the merge block for all merges that
4962 // still need to be performed.
4963 const merge_stack = merge.merge_stack.items;
4964
4965 // If no merges on the stack, this block didn't generate any jumps (all paths
4966 // ended with a return or an unreachable). In that case, we don't need to do
4967 // any merging.
4968 if (merge_stack.len == 0) {
4969 // We still need to return a value of a next block to jump to.
4970 // For example, if we have code like
4971 // if (x) {
4972 // if (y) return else return;
4973 // } else {}
4974 // then we still need the outer to have an OpSelectionMerge and consequently
4975 // a phi node. In that case we can just return bogus, since we know that its
4976 // path will never be taken.
4977
4978 // Make sure that we are still in a block when exiting the function.
4979 // TODO: Can we get rid of that?
4980 try cg.beginSpvBlock(cg.module.allocId());
4981 const block_id_ty_id = try cg.resolveType(.u32, .direct);
4982 return try cg.module.constUndef(block_id_ty_id);
4983 }
4984
4985 // The top-most merge actually only has a single source, the
4986 // final jump of the block, or the merge block of a sub-block, cond_br,
4987 // or loop. Therefore we just need to generate a block with a jump to the
4988 // next merge block.
4989 try cg.beginSpvBlock(merge_stack[merge_stack.len - 1].merge_block);
4990
4991 // Now generate a merge ladder for the remaining merges in the stack.
4992 var incoming: ControlFlow.Structured.Block.Incoming = .{
4993 .src_label = cg.block_label,
4994 .next_block = merge_stack[merge_stack.len - 1].incoming.next_block,
4995 };
4996 var i = merge_stack.len - 1;
4997 while (i > 0) {
4998 i -= 1;
4999 const step = merge_stack[i];
5000 try cg.body.emitBranch(cg.module.gpa, step.merge_block);
5001 try cg.beginSpvBlock(step.merge_block);
5002 const next_block = try cg.structuredNextBlock(&.{ incoming, step.incoming });
5003 incoming = .{
5004 .src_label = step.merge_block,
5005 .next_block = next_block,
5006 };
5007 }
5008
5009 return incoming.next_block;
5010 },
5011 .loop => |merge| {
5012 // Close the loop by jumping to the continue label
5013 try cg.body.emitBranch(cg.module.gpa, block_merge_type.loop.continue_label);
5014 // For blocks we must simple merge all the incoming blocks to get the next block.
5015 try cg.beginSpvBlock(merge.merge_block);
5016 return try cg.structuredNextBlock(merge.merges.items);
5017 },
5018 }
5019}
5020
5021fn airBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5022 const inst_datas = cg.air.instructions.items(.data);
5023 const extra = cg.air.extraData(Air.Block, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5024 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
5025}
5026
5027fn lowerBlock(cg: *CodeGen, inst: Air.Inst.Index, body: []const Air.Inst.Index) !?Id {
5028 // In AIR, a block doesn't really define an entry point like a block, but
5029 // more like a scope that breaks can jump out of and "return" a value from.
5030 // This cannot be directly modelled in SPIR-V, so in a block instruction,
5031 // we're going to split up the current block by first generating the code
5032 // of the block, then a label, and then generate the rest of the current
5033 // ir.Block in a different SPIR-V block.
5034
5035 const gpa = cg.module.gpa;
5036 const zcu = cg.module.zcu;
5037 const ty = cg.typeOfIndex(inst);
5038 const have_block_result = ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu);
5039
5040 const cf = switch (cg.control_flow) {
5041 .structured => |*cf| cf,
5042 .unstructured => |*cf| {
5043 var block: ControlFlow.Unstructured.Block = .{};
5044 defer block.incoming_blocks.deinit(gpa);
5045
5046 // 4 chosen as arbitrary initial capacity.
5047 try block.incoming_blocks.ensureUnusedCapacity(gpa, 4);
5048
5049 try cf.blocks.putNoClobber(gpa, inst, &block);
5050 defer assert(cf.blocks.remove(inst));
5051
5052 try cg.genBody(body);
5053
5054 // Only begin a new block if there were actually any breaks towards it.
5055 if (block.label) |label| {
5056 try cg.beginSpvBlock(label);
5057 }
5058
5059 if (!have_block_result)
5060 return null;
5061
5062 assert(block.label != null);
5063 const result_id = cg.module.allocId();
5064 const result_type_id = try cg.resolveType(ty, .direct);
5065
5066 try cg.body.emitRaw(
5067 cg.module.gpa,
5068 .OpPhi,
5069 // result type + result + variable/parent...
5070 2 + @as(u16, @intCast(block.incoming_blocks.items.len * 2)),
5071 );
5072 cg.body.writeOperand(Id, result_type_id);
5073 cg.body.writeOperand(Id, result_id);
5074
5075 for (block.incoming_blocks.items) |incoming| {
5076 cg.body.writeOperand(
5077 spec.PairIdRefIdRef,
5078 .{ incoming.break_value_id, incoming.src_label },
5079 );
5080 }
5081
5082 return result_id;
5083 },
5084 };
5085
5086 const maybe_block_result_var_id = if (have_block_result) blk: {
5087 const block_result_var_id = try cg.alloc(ty, .{ .storage_class = .function });
5088 try cf.block_results.putNoClobber(gpa, inst, block_result_var_id);
5089 break :blk block_result_var_id;
5090 } else null;
5091 defer if (have_block_result) assert(cf.block_results.remove(inst));
5092
5093 const next_block = try cg.genStructuredBody(.selection, body);
5094
5095 // When encountering a block instruction, we are always at least in the function's scope,
5096 // so there always has to be another entry.
5097 assert(cf.block_stack.items.len > 0);
5098
5099 // Check if the target of the branch was this current block.
5100 const this_block = try cg.constInt(.u32, @intFromEnum(inst));
5101 const jump_to_this_block_id = cg.module.allocId();
5102 const bool_ty_id = try cg.resolveType(.bool, .direct);
5103 try cg.body.emit(cg.module.gpa, .OpIEqual, .{
5104 .id_result_type = bool_ty_id,
5105 .id_result = jump_to_this_block_id,
5106 .operand_1 = next_block,
5107 .operand_2 = this_block,
5108 });
5109
5110 const sblock = cf.block_stack.getLast();
5111
5112 if (ty.isNoReturn(zcu)) {
5113 // If this block is noreturn, this instruction is the last of a block,
5114 // and we must simply jump to the block's merge unconditionally.
5115 try cg.structuredBreak(next_block);
5116 } else {
5117 switch (sblock.*) {
5118 .selection => |*merge| {
5119 // To jump out of a selection block, push a new entry onto its merge stack and
5120 // generate a conditional branch to there and to the instructions following this block.
5121 const merge_label = cg.module.allocId();
5122 const then_label = cg.module.allocId();
5123 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5124 .merge_block = merge_label,
5125 .selection_control = .{},
5126 });
5127 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5128 .condition = jump_to_this_block_id,
5129 .true_label = then_label,
5130 .false_label = merge_label,
5131 });
5132 try merge.merge_stack.append(gpa, .{
5133 .incoming = .{
5134 .src_label = cg.block_label,
5135 .next_block = next_block,
5136 },
5137 .merge_block = merge_label,
5138 });
5139
5140 try cg.beginSpvBlock(then_label);
5141 },
5142 .loop => |*merge| {
5143 // To jump out of a loop block, generate a conditional that exits the block
5144 // to the loop merge if the target ID is not the one of this block.
5145 const continue_label = cg.module.allocId();
5146 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5147 .condition = jump_to_this_block_id,
5148 .true_label = continue_label,
5149 .false_label = merge.merge_block,
5150 });
5151 try merge.merges.append(gpa, .{
5152 .src_label = cg.block_label,
5153 .next_block = next_block,
5154 });
5155 try cg.beginSpvBlock(continue_label);
5156 },
5157 }
5158 }
5159
5160 if (maybe_block_result_var_id) |block_result_var_id| {
5161 return try cg.load(ty, block_result_var_id, .{});
5162 }
5163
5164 return null;
5165}
5166
5167fn airBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5168 const gpa = cg.module.gpa;
5169 const zcu = cg.module.zcu;
5170 const br = cg.air.instructions.items(.data)[@intFromEnum(inst)].br;
5171 const operand_ty = cg.typeOf(br.operand);
5172
5173 switch (cg.control_flow) {
5174 .structured => |*cf| {
5175 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5176 const operand_id = try cg.resolve(br.operand);
5177 const block_result_var_id = cf.block_results.get(br.block_inst).?;
5178 try cg.store(operand_ty, block_result_var_id, operand_id, .{});
5179 }
5180
5181 const next_block = try cg.constInt(.u32, @intFromEnum(br.block_inst));
5182 try cg.structuredBreak(next_block);
5183 },
5184 .unstructured => |cf| {
5185 const block = cf.blocks.get(br.block_inst).?;
5186 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5187 const operand_id = try cg.resolve(br.operand);
5188 // block_label should not be undefined here, lest there
5189 // is a br or br_void in the function's body.
5190 try block.incoming_blocks.append(gpa, .{
5191 .src_label = cg.block_label,
5192 .break_value_id = operand_id,
5193 });
5194 }
5195
5196 if (block.label == null) {
5197 block.label = cg.module.allocId();
5198 }
5199
5200 try cg.body.emitBranch(cg.module.gpa, block.label.?);
5201 },
5202 }
5203}
5204
5205fn airCondBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5206 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5207 const cond_br = cg.air.extraData(Air.CondBr, pl_op.payload);
5208 const then_body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[cond_br.end..][0..cond_br.data.then_body_len]);
5209 const else_body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[cond_br.end + then_body.len ..][0..cond_br.data.else_body_len]);
5210 const condition_id = try cg.resolve(pl_op.operand);
5211
5212 const then_label = cg.module.allocId();
5213 const else_label = cg.module.allocId();
5214
5215 switch (cg.control_flow) {
5216 .structured => {
5217 const merge_label = cg.module.allocId();
5218
5219 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5220 .merge_block = merge_label,
5221 .selection_control = .{},
5222 });
5223 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5224 .condition = condition_id,
5225 .true_label = then_label,
5226 .false_label = else_label,
5227 });
5228
5229 try cg.beginSpvBlock(then_label);
5230 const then_next = try cg.genStructuredBody(.selection, then_body);
5231 const then_incoming: ControlFlow.Structured.Block.Incoming = .{
5232 .src_label = cg.block_label,
5233 .next_block = then_next,
5234 };
5235 try cg.body.emitBranch(cg.module.gpa, merge_label);
5236
5237 try cg.beginSpvBlock(else_label);
5238 const else_next = try cg.genStructuredBody(.selection, else_body);
5239 const else_incoming: ControlFlow.Structured.Block.Incoming = .{
5240 .src_label = cg.block_label,
5241 .next_block = else_next,
5242 };
5243 try cg.body.emitBranch(cg.module.gpa, merge_label);
5244
5245 try cg.beginSpvBlock(merge_label);
5246 const next_block = try cg.structuredNextBlock(&.{ then_incoming, else_incoming });
5247
5248 try cg.structuredBreak(next_block);
5249 },
5250 .unstructured => {
5251 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5252 .condition = condition_id,
5253 .true_label = then_label,
5254 .false_label = else_label,
5255 });
5256
5257 try cg.beginSpvBlock(then_label);
5258 try cg.genBody(then_body);
5259 try cg.beginSpvBlock(else_label);
5260 try cg.genBody(else_body);
5261 },
5262 }
5263}
5264
5265fn airLoop(cg: *CodeGen, inst: Air.Inst.Index) !void {
5266 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5267 const loop = cg.air.extraData(Air.Block, ty_pl.payload);
5268 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[loop.end..][0..loop.data.body_len]);
5269
5270 const body_label = cg.module.allocId();
5271
5272 switch (cg.control_flow) {
5273 .structured => {
5274 const header_label = cg.module.allocId();
5275 const merge_label = cg.module.allocId();
5276 const continue_label = cg.module.allocId();
5277
5278 // The back-edge must point to the loop header, so generate a separate block for the
5279 // loop header so that we don't accidentally include some instructions from there
5280 // in the loop.
5281 try cg.body.emitBranch(cg.module.gpa, header_label);
5282 try cg.beginSpvBlock(header_label);
5283
5284 // Emit loop header and jump to loop body
5285 try cg.body.emit(cg.module.gpa, .OpLoopMerge, .{
5286 .merge_block = merge_label,
5287 .continue_target = continue_label,
5288 .loop_control = .{},
5289 });
5290 try cg.body.emitBranch(cg.module.gpa, body_label);
5291
5292 try cg.beginSpvBlock(body_label);
5293
5294 const next_block = try cg.genStructuredBody(.{ .loop = .{
5295 .merge_label = merge_label,
5296 .continue_label = continue_label,
5297 } }, body);
5298 try cg.structuredBreak(next_block);
5299
5300 try cg.beginSpvBlock(continue_label);
5301 try cg.body.emitBranch(cg.module.gpa, header_label);
5302 },
5303 .unstructured => {
5304 try cg.body.emitBranch(cg.module.gpa, body_label);
5305 try cg.beginSpvBlock(body_label);
5306 try cg.genBody(body);
5307 try cg.body.emitBranch(cg.module.gpa, body_label);
5308 },
5309 }
5310}
5311
5312fn airLoad(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5313 const zcu = cg.module.zcu;
5314 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5315 const ptr_ty = cg.typeOf(ty_op.operand);
5316 const elem_ty = cg.typeOfIndex(inst);
5317 const operand = try cg.resolve(ty_op.operand);
5318 if (!ptr_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
5319
5320 return try cg.load(elem_ty, operand, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5321}
5322
5323fn airStore(cg: *CodeGen, inst: Air.Inst.Index) !void {
5324 const zcu = cg.module.zcu;
5325 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
5326 const ptr_ty = cg.typeOf(bin_op.lhs);
5327 const elem_ty = ptr_ty.childType(zcu);
5328 const ptr = try cg.resolve(bin_op.lhs);
5329 const value = try cg.resolve(bin_op.rhs);
5330
5331 try cg.store(elem_ty, ptr, value, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5332}
5333
5334fn airRet(cg: *CodeGen, inst: Air.Inst.Index) !void {
5335 const zcu = cg.module.zcu;
5336 const operand = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5337 const ret_ty = cg.typeOf(operand);
5338 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5339 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5340 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5341 // Functions with an empty error set are emitted with an error code
5342 // return type and return zero so they can be function pointers coerced
5343 // to functions that return anyerror.
5344 const no_err_id = try cg.constInt(.anyerror, 0);
5345 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5346 } else {
5347 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5348 }
5349 }
5350
5351 const operand_id = try cg.resolve(operand);
5352 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = operand_id });
5353}
5354
5355fn airRetLoad(cg: *CodeGen, inst: Air.Inst.Index) !void {
5356 const zcu = cg.module.zcu;
5357 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5358 const ptr_ty = cg.typeOf(un_op);
5359 const ret_ty = ptr_ty.childType(zcu);
5360
5361 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5362 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5363 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5364 // Functions with an empty error set are emitted with an error code
5365 // return type and return zero so they can be function pointers coerced
5366 // to functions that return anyerror.
5367 const no_err_id = try cg.constInt(.anyerror, 0);
5368 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5369 } else {
5370 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5371 }
5372 }
5373
5374 const ptr = try cg.resolve(un_op);
5375 const value = try cg.load(ret_ty, ptr, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5376 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{
5377 .value = value,
5378 });
5379}
5380
5381fn airTry(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5382 const zcu = cg.module.zcu;
5383 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5384 const err_union_id = try cg.resolve(pl_op.operand);
5385 const extra = cg.air.extraData(Air.Try, pl_op.payload);
5386 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]);
5387
5388 const err_union_ty = cg.typeOf(pl_op.operand);
5389 const payload_ty = cg.typeOfIndex(inst);
5390
5391 const bool_ty_id = try cg.resolveType(.bool, .direct);
5392
5393 const eu_layout = cg.errorUnionLayout(payload_ty);
5394
5395 if (!err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5396 const err_id = if (eu_layout.payload_has_bits)
5397 try cg.extractField(.anyerror, err_union_id, eu_layout.errorFieldIndex())
5398 else
5399 err_union_id;
5400
5401 const zero_id = try cg.constInt(.anyerror, 0);
5402 const is_err_id = cg.module.allocId();
5403 try cg.body.emit(cg.module.gpa, .OpINotEqual, .{
5404 .id_result_type = bool_ty_id,
5405 .id_result = is_err_id,
5406 .operand_1 = err_id,
5407 .operand_2 = zero_id,
5408 });
5409
5410 // When there is an error, we must evaluate `body`. Otherwise we must continue
5411 // with the current body.
5412 // Just generate a new block here, then generate a new block inline for the remainder of the body.
5413
5414 const err_block = cg.module.allocId();
5415 const ok_block = cg.module.allocId();
5416
5417 switch (cg.control_flow) {
5418 .structured => {
5419 // According to AIR documentation, this block is guaranteed
5420 // to not break and end in a return instruction. Thus,
5421 // for structured control flow, we can just naively use
5422 // the ok block as the merge block here.
5423 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5424 .merge_block = ok_block,
5425 .selection_control = .{},
5426 });
5427 },
5428 .unstructured => {},
5429 }
5430
5431 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5432 .condition = is_err_id,
5433 .true_label = err_block,
5434 .false_label = ok_block,
5435 });
5436
5437 try cg.beginSpvBlock(err_block);
5438 try cg.genBody(body);
5439
5440 try cg.beginSpvBlock(ok_block);
5441 }
5442
5443 if (!eu_layout.payload_has_bits) {
5444 return null;
5445 }
5446
5447 // Now just extract the payload, if required.
5448 return try cg.extractField(payload_ty, err_union_id, eu_layout.payloadFieldIndex());
5449}
5450
5451fn airErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5452 const zcu = cg.module.zcu;
5453 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5454 const operand_id = try cg.resolve(ty_op.operand);
5455 const err_union_ty = cg.typeOf(ty_op.operand);
5456 const err_ty_id = try cg.resolveType(.anyerror, .direct);
5457
5458 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5459 // No error possible, so just return undefined.
5460 return try cg.module.constUndef(err_ty_id);
5461 }
5462
5463 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5464 const eu_layout = cg.errorUnionLayout(payload_ty);
5465
5466 if (!eu_layout.payload_has_bits) {
5467 // If no payload, error union is represented by error set.
5468 return operand_id;
5469 }
5470
5471 return try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5472}
5473
5474fn airErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5475 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5476 const operand_id = try cg.resolve(ty_op.operand);
5477 const payload_ty = cg.typeOfIndex(inst);
5478 const eu_layout = cg.errorUnionLayout(payload_ty);
5479
5480 if (!eu_layout.payload_has_bits) {
5481 return null; // No error possible.
5482 }
5483
5484 return try cg.extractField(payload_ty, operand_id, eu_layout.payloadFieldIndex());
5485}
5486
5487fn airWrapErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5488 const zcu = cg.module.zcu;
5489 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5490 const err_union_ty = cg.typeOfIndex(inst);
5491 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5492 const operand_id = try cg.resolve(ty_op.operand);
5493 const eu_layout = cg.errorUnionLayout(payload_ty);
5494
5495 if (!eu_layout.payload_has_bits) {
5496 return operand_id;
5497 }
5498
5499 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
5500
5501 var members: [2]Id = undefined;
5502 members[eu_layout.errorFieldIndex()] = operand_id;
5503 members[eu_layout.payloadFieldIndex()] = try cg.module.constUndef(payload_ty_id);
5504
5505 var types: [2]Type = undefined;
5506 types[eu_layout.errorFieldIndex()] = .anyerror;
5507 types[eu_layout.payloadFieldIndex()] = payload_ty;
5508
5509 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5510 return try cg.constructComposite(err_union_ty_id, &members);
5511}
5512
5513fn airWrapErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5514 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5515 const err_union_ty = cg.typeOfIndex(inst);
5516 const operand_id = try cg.resolve(ty_op.operand);
5517 const payload_ty = cg.typeOf(ty_op.operand);
5518 const eu_layout = cg.errorUnionLayout(payload_ty);
5519
5520 if (!eu_layout.payload_has_bits) {
5521 return try cg.constInt(.anyerror, 0);
5522 }
5523
5524 var members: [2]Id = undefined;
5525 members[eu_layout.errorFieldIndex()] = try cg.constInt(.anyerror, 0);
5526 members[eu_layout.payloadFieldIndex()] = try cg.convertToIndirect(payload_ty, operand_id);
5527
5528 var types: [2]Type = undefined;
5529 types[eu_layout.errorFieldIndex()] = .anyerror;
5530 types[eu_layout.payloadFieldIndex()] = payload_ty;
5531
5532 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5533 return try cg.constructComposite(err_union_ty_id, &members);
5534}
5535
5536fn airIsNull(cg: *CodeGen, inst: Air.Inst.Index, is_pointer: bool, pred: enum { is_null, is_non_null }) !?Id {
5537 const zcu = cg.module.zcu;
5538 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5539 const operand_id = try cg.resolve(un_op);
5540 const operand_ty = cg.typeOf(un_op);
5541 const optional_ty = if (is_pointer) operand_ty.childType(zcu) else operand_ty;
5542 const payload_ty = optional_ty.optionalChild(zcu);
5543
5544 const bool_ty_id = try cg.resolveType(.bool, .direct);
5545
5546 if (optional_ty.optionalReprIsPayload(zcu)) {
5547 // Pointer payload represents nullability: pointer or slice.
5548 const loaded_id = if (is_pointer)
5549 try cg.load(optional_ty, operand_id, .{})
5550 else
5551 operand_id;
5552
5553 const ptr_ty = if (payload_ty.isSlice(zcu))
5554 payload_ty.slicePtrFieldType(zcu)
5555 else
5556 payload_ty;
5557
5558 const ptr_id = if (payload_ty.isSlice(zcu))
5559 try cg.extractField(ptr_ty, loaded_id, 0)
5560 else
5561 loaded_id;
5562
5563 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
5564 const null_id = try cg.module.constNull(ptr_ty_id);
5565 const null_tmp: Temporary = .init(ptr_ty, null_id);
5566 const ptr: Temporary = .init(ptr_ty, ptr_id);
5567
5568 const op: std.math.CompareOperator = switch (pred) {
5569 .is_null => .eq,
5570 .is_non_null => .neq,
5571 };
5572 const result = try cg.cmp(op, ptr, null_tmp);
5573 return try result.materialize(cg);
5574 }
5575
5576 const is_non_null_id = blk: {
5577 if (is_pointer) {
5578 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5579 const storage_class = cg.module.storageClass(operand_ty.ptrAddressSpace(zcu));
5580 const bool_indirect_ty_id = try cg.resolveType(.bool, .indirect);
5581 const bool_ptr_ty_id = try cg.module.ptrType(bool_indirect_ty_id, storage_class);
5582 const tag_ptr_id = try cg.accessChain(bool_ptr_ty_id, operand_id, &.{1});
5583 break :blk try cg.load(.bool, tag_ptr_id, .{});
5584 }
5585
5586 break :blk try cg.load(.bool, operand_id, .{});
5587 }
5588
5589 break :blk if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
5590 try cg.extractField(.bool, operand_id, 1)
5591 else
5592 // Optional representation is bool indicating whether the optional is set
5593 // Optionals with no payload are represented as an (indirect) bool, so convert
5594 // it back to the direct bool here.
5595 try cg.convertToDirect(.bool, operand_id);
5596 };
5597
5598 return switch (pred) {
5599 .is_null => blk: {
5600 // Invert condition
5601 const result_id = cg.module.allocId();
5602 try cg.body.emit(cg.module.gpa, .OpLogicalNot, .{
5603 .id_result_type = bool_ty_id,
5604 .id_result = result_id,
5605 .operand = is_non_null_id,
5606 });
5607 break :blk result_id;
5608 },
5609 .is_non_null => is_non_null_id,
5610 };
5611}
5612
5613fn airIsErr(cg: *CodeGen, inst: Air.Inst.Index, pred: enum { is_err, is_non_err }) !?Id {
5614 const zcu = cg.module.zcu;
5615 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5616 const operand_id = try cg.resolve(un_op);
5617 const err_union_ty = cg.typeOf(un_op);
5618
5619 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5620 return try cg.constBool(pred == .is_non_err, .direct);
5621 }
5622
5623 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5624 const eu_layout = cg.errorUnionLayout(payload_ty);
5625 const bool_ty_id = try cg.resolveType(.bool, .direct);
5626
5627 const error_id = if (!eu_layout.payload_has_bits)
5628 operand_id
5629 else
5630 try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5631
5632 const result_id = cg.module.allocId();
5633 switch (pred) {
5634 inline else => |pred_ct| try cg.body.emit(
5635 cg.module.gpa,
5636 switch (pred_ct) {
5637 .is_err => .OpINotEqual,
5638 .is_non_err => .OpIEqual,
5639 },
5640 .{
5641 .id_result_type = bool_ty_id,
5642 .id_result = result_id,
5643 .operand_1 = error_id,
5644 .operand_2 = try cg.constInt(.anyerror, 0),
5645 },
5646 ),
5647 }
5648 return result_id;
5649}
5650
5651fn airUnwrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5652 const zcu = cg.module.zcu;
5653 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5654 const operand_id = try cg.resolve(ty_op.operand);
5655 const optional_ty = cg.typeOf(ty_op.operand);
5656 const payload_ty = cg.typeOfIndex(inst);
5657
5658 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
5659
5660 if (optional_ty.optionalReprIsPayload(zcu)) {
5661 return operand_id;
5662 }
5663
5664 return try cg.extractField(payload_ty, operand_id, 0);
5665}
5666
5667fn airUnwrapOptionalPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5668 const zcu = cg.module.zcu;
5669 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5670 const operand_id = try cg.resolve(ty_op.operand);
5671 const operand_ty = cg.typeOf(ty_op.operand);
5672 const optional_ty = operand_ty.childType(zcu);
5673 const payload_ty = optional_ty.optionalChild(zcu);
5674 const result_ty = cg.typeOfIndex(inst);
5675 const result_ty_id = try cg.resolveType(result_ty, .direct);
5676
5677 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5678 // There is no payload, but we still need to return a valid pointer.
5679 // We can just return anything here, so just return a pointer to the operand.
5680 return try cg.bitCast(result_ty, operand_ty, operand_id);
5681 }
5682
5683 if (optional_ty.optionalReprIsPayload(zcu)) {
5684 // They are the same value.
5685 return try cg.bitCast(result_ty, operand_ty, operand_id);
5686 }
5687
5688 return try cg.accessChain(result_ty_id, operand_id, &.{0});
5689}
5690
5691fn airWrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5692 const zcu = cg.module.zcu;
5693 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5694 const payload_ty = cg.typeOf(ty_op.operand);
5695
5696 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5697 return try cg.constBool(true, .indirect);
5698 }
5699
5700 const operand_id = try cg.resolve(ty_op.operand);
5701
5702 const optional_ty = cg.typeOfIndex(inst);
5703 if (optional_ty.optionalReprIsPayload(zcu)) {
5704 return operand_id;
5705 }
5706
5707 const payload_id = try cg.convertToIndirect(payload_ty, operand_id);
5708 const members = [_]Id{ payload_id, try cg.constBool(true, .indirect) };
5709 const optional_ty_id = try cg.resolveType(optional_ty, .direct);
5710 return try cg.constructComposite(optional_ty_id, &members);
5711}
5712
5713fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5714 const gpa = cg.module.gpa;
5715 const pt = cg.pt;
5716 const zcu = cg.module.zcu;
5717 const target = cg.module.zcu.getTarget();
5718 const switch_br = cg.air.unwrapSwitch(inst);
5719 const cond_ty = cg.typeOf(switch_br.operand);
5720 const cond = try cg.resolve(switch_br.operand);
5721 var cond_indirect = try cg.convertToIndirect(cond_ty, cond);
5722
5723 const cond_words: u32 = switch (cond_ty.zigTypeTag(zcu)) {
5724 .bool, .error_set => 1,
5725 .int => blk: {
5726 const bits = cond_ty.intInfo(zcu).bits;
5727 const backing_bits, const big_int = cg.module.backingIntBits(bits);
5728 if (big_int) return cg.todo("implement composite int switch", .{});
5729 break :blk if (backing_bits <= 32) 1 else 2;
5730 },
5731 .@"enum" => blk: {
5732 const int_ty = cond_ty.intTagType(zcu);
5733 const int_info = int_ty.intInfo(zcu);
5734 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
5735 if (big_int) return cg.todo("implement composite int switch", .{});
5736 break :blk if (backing_bits <= 32) 1 else 2;
5737 },
5738 .pointer => blk: {
5739 cond_indirect = try cg.intFromPtr(cond_indirect);
5740 break :blk target.ptrBitWidth() / 32;
5741 },
5742 // TODO: Figure out which types apply here, and work around them as we can only do integers.
5743 else => return cg.todo("implement switch for type {s}", .{@tagName(cond_ty.zigTypeTag(zcu))}),
5744 };
5745
5746 const num_cases = switch_br.cases_len;
5747
5748 // Compute the total number of arms that we need.
5749 // Zig switches are grouped by condition, so we need to loop through all of them
5750 const num_conditions = blk: {
5751 var num_conditions: u32 = 0;
5752 var it = switch_br.iterateCases();
5753 while (it.next()) |case| {
5754 if (case.ranges.len > 0) return cg.todo("switch with ranges", .{});
5755 num_conditions += @intCast(case.items.len);
5756 }
5757 break :blk num_conditions;
5758 };
5759
5760 // First, pre-allocate the labels for the cases.
5761 const case_labels = cg.module.allocIds(num_cases);
5762 // We always need the default case - if zig has none, we will generate unreachable there.
5763 const default = cg.module.allocId();
5764
5765 const merge_label = switch (cg.control_flow) {
5766 .structured => cg.module.allocId(),
5767 .unstructured => null,
5768 };
5769
5770 if (cg.control_flow == .structured) {
5771 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5772 .merge_block = merge_label.?,
5773 .selection_control = .{},
5774 });
5775 }
5776
5777 // Emit the instruction before generating the blocks.
5778 try cg.body.emitRaw(cg.module.gpa, .OpSwitch, 2 + (cond_words + 1) * num_conditions);
5779 cg.body.writeOperand(Id, cond_indirect);
5780 cg.body.writeOperand(Id, default);
5781
5782 // Emit each of the cases
5783 {
5784 var it = switch_br.iterateCases();
5785 while (it.next()) |case| {
5786 // SPIR-V needs a literal here, which' width depends on the case condition.
5787 const label = case_labels.at(case.idx);
5788
5789 for (case.items) |item| {
5790 const value = (try cg.air.value(item, pt)) orelse unreachable;
5791 const int_val: u64 = switch (cond_ty.zigTypeTag(zcu)) {
5792 .bool, .int => if (cond_ty.isSignedInt(zcu)) @bitCast(value.toSignedInt(zcu)) else value.toUnsignedInt(zcu),
5793 .@"enum" => blk: {
5794 // TODO: figure out of cond_ty is correct (something with enum literals)
5795 break :blk (try value.intFromEnum(cond_ty, pt)).toUnsignedInt(zcu); // TODO: composite integer constants
5796 },
5797 .error_set => value.getErrorInt(zcu),
5798 .pointer => value.toUnsignedInt(zcu),
5799 else => unreachable,
5800 };
5801 const int_lit: spec.LiteralContextDependentNumber = switch (cond_words) {
5802 1 => .{ .uint32 = @intCast(int_val) },
5803 2 => .{ .uint64 = int_val },
5804 else => unreachable,
5805 };
5806 cg.body.writeOperand(spec.LiteralContextDependentNumber, int_lit);
5807 cg.body.writeOperand(Id, label);
5808 }
5809 }
5810 }
5811
5812 var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty;
5813 defer incoming_structured_blocks.deinit(gpa);
5814
5815 if (cg.control_flow == .structured) {
5816 try incoming_structured_blocks.ensureUnusedCapacity(gpa, num_cases + 1);
5817 }
5818
5819 // Now, finally, we can start emitting each of the cases.
5820 var it = switch_br.iterateCases();
5821 while (it.next()) |case| {
5822 const label = case_labels.at(case.idx);
5823
5824 try cg.beginSpvBlock(label);
5825
5826 switch (cg.control_flow) {
5827 .structured => {
5828 const next_block = try cg.genStructuredBody(.selection, case.body);
5829 incoming_structured_blocks.appendAssumeCapacity(.{
5830 .src_label = cg.block_label,
5831 .next_block = next_block,
5832 });
5833 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
5834 },
5835 .unstructured => {
5836 try cg.genBody(case.body);
5837 },
5838 }
5839 }
5840
5841 const else_body = it.elseBody();
5842 try cg.beginSpvBlock(default);
5843 if (else_body.len != 0) {
5844 switch (cg.control_flow) {
5845 .structured => {
5846 const next_block = try cg.genStructuredBody(.selection, else_body);
5847 incoming_structured_blocks.appendAssumeCapacity(.{
5848 .src_label = cg.block_label,
5849 .next_block = next_block,
5850 });
5851 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
5852 },
5853 .unstructured => {
5854 try cg.genBody(else_body);
5855 },
5856 }
5857 } else {
5858 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
5859 }
5860
5861 if (cg.control_flow == .structured) {
5862 try cg.beginSpvBlock(merge_label.?);
5863 const next_block = try cg.structuredNextBlock(incoming_structured_blocks.items);
5864 try cg.structuredBreak(next_block);
5865 }
5866}
5867
5868fn airUnreach(cg: *CodeGen) !void {
5869 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
5870}
5871
5872fn airDbgStmt(cg: *CodeGen, inst: Air.Inst.Index) !void {
5873 const zcu = cg.module.zcu;
5874 const dbg_stmt = cg.air.instructions.items(.data)[@intFromEnum(inst)].dbg_stmt;
5875 const path = zcu.navFileScope(cg.owner_nav).sub_file_path;
5876
5877 if (zcu.comp.config.root_strip) return;
5878
5879 try cg.body.emit(cg.module.gpa, .OpLine, .{
5880 .file = try cg.module.debugString(path),
5881 .line = cg.base_line + dbg_stmt.line + 1,
5882 .column = dbg_stmt.column + 1,
5883 });
5884}
5885
5886fn airDbgInlineBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5887 const zcu = cg.module.zcu;
5888 const inst_datas = cg.air.instructions.items(.data);
5889 const extra = cg.air.extraData(Air.DbgInlineBlock, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5890 const old_base_line = cg.base_line;
5891 defer cg.base_line = old_base_line;
5892 cg.base_line = zcu.navSrcLine(zcu.funcInfo(extra.data.func).owner_nav);
5893 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
5894}
5895
5896fn airDbgVar(cg: *CodeGen, inst: Air.Inst.Index) !void {
5897 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5898 const target_id = try cg.resolve(pl_op.operand);
5899 const name: Air.NullTerminatedString = @enumFromInt(pl_op.payload);
5900 try cg.module.debugName(target_id, name.toSlice(cg.air));
5901}
5902
5903fn airAssembly(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5904 const gpa = cg.module.gpa;
5905 const zcu = cg.module.zcu;
5906 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5907 const extra = cg.air.extraData(Air.Asm, ty_pl.payload);
5908
5909 const is_volatile = extra.data.flags.is_volatile;
5910 const outputs_len = extra.data.flags.outputs_len;
5911
5912 if (!is_volatile and cg.liveness.isUnused(inst)) return null;
5913
5914 var extra_i: usize = extra.end;
5915 const outputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..outputs_len]);
5916 extra_i += outputs.len;
5917 const inputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..extra.data.inputs_len]);
5918 extra_i += inputs.len;
5919
5920 if (outputs.len > 1) {
5921 return cg.todo("implement inline asm with more than 1 output", .{});
5922 }
5923
5924 var as: Assembler = .{ .cg = cg };
5925 defer as.deinit();
5926
5927 var output_extra_i = extra_i;
5928 for (outputs) |output| {
5929 if (output != .none) {
5930 return cg.todo("implement inline asm with non-returned output", .{});
5931 }
5932 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
5933 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]), 0);
5934 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
5935 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
5936 // TODO: Record output and use it somewhere.
5937 }
5938
5939 for (inputs) |input| {
5940 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
5941 const constraint = std.mem.sliceTo(extra_bytes, 0);
5942 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
5943 // This equation accounts for the fact that even if we have exactly 4 bytes
5944 // for the string, we still use the next u32 for the null terminator.
5945 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
5946
5947 const input_ty = cg.typeOf(input);
5948
5949 if (std.mem.eql(u8, constraint, "c")) {
5950 // constant
5951 const val = (try cg.air.value(input, cg.pt)) orelse {
5952 return cg.fail("assembly inputs with 'c' constraint have to be compile-time known", .{});
5953 };
5954
5955 // TODO: This entire function should be handled a bit better...
5956 const ip = &zcu.intern_pool;
5957 switch (ip.indexToKey(val.toIntern())) {
5958 .int_type,
5959 .ptr_type,
5960 .array_type,
5961 .vector_type,
5962 .opt_type,
5963 .anyframe_type,
5964 .error_union_type,
5965 .simple_type,
5966 .struct_type,
5967 .union_type,
5968 .opaque_type,
5969 .enum_type,
5970 .func_type,
5971 .error_set_type,
5972 .inferred_error_set_type,
5973 => unreachable, // types, not values
5974
5975 .undef => return cg.fail("assembly input with 'c' constraint cannot be undefined", .{}),
5976
5977 .int => try as.value_map.put(gpa, name, .{ .constant = @intCast(val.toUnsignedInt(zcu)) }),
5978 .enum_literal => |str| try as.value_map.put(gpa, name, .{ .string = str.toSlice(ip) }),
5979
5980 else => unreachable, // TODO
5981 }
5982 } else if (std.mem.eql(u8, constraint, "t")) {
5983 // type
5984 if (input_ty.zigTypeTag(zcu) == .type) {
5985 // This assembly input is a type instead of a value.
5986 // That's fine for now, just make sure to resolve it as such.
5987 const val = (try cg.air.value(input, cg.pt)).?;
5988 const ty_id = try cg.resolveType(val.toType(), .direct);
5989 try as.value_map.put(gpa, name, .{ .ty = ty_id });
5990 } else {
5991 const ty_id = try cg.resolveType(input_ty, .direct);
5992 try as.value_map.put(gpa, name, .{ .ty = ty_id });
5993 }
5994 } else {
5995 if (input_ty.zigTypeTag(zcu) == .type) {
5996 return cg.fail("use the 't' constraint to supply types to SPIR-V inline assembly", .{});
5997 }
5998
5999 const val_id = try cg.resolve(input);
6000 try as.value_map.put(gpa, name, .{ .value = val_id });
6001 }
6002 }
6003
6004 // TODO: do something with clobbers
6005 _ = extra.data.clobbers;
6006
6007 const asm_source = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..])[0..extra.data.source_len];
6008
6009 as.assemble(asm_source) catch |err| switch (err) {
6010 error.AssembleFail => {
6011 // TODO: For now the compiler only supports a single error message per decl,
6012 // so to translate the possible multiple errors from the assembler, emit
6013 // them as notes here.
6014 // TODO: Translate proper error locations.
6015 assert(as.errors.items.len != 0);
6016 assert(cg.error_msg == null);
6017 const src_loc = zcu.navSrcLoc(cg.owner_nav);
6018 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
6019 const notes = try zcu.gpa.alloc(Zcu.ErrorMsg, as.errors.items.len);
6020
6021 // Sub-scope to prevent `return error.CodegenFail` from running the errdefers.
6022 {
6023 errdefer zcu.gpa.free(notes);
6024 var i: usize = 0;
6025 errdefer for (notes[0..i]) |*note| {
6026 note.deinit(zcu.gpa);
6027 };
6028
6029 while (i < as.errors.items.len) : (i += 1) {
6030 notes[i] = try Zcu.ErrorMsg.init(zcu.gpa, src_loc, "{s}", .{as.errors.items[i].msg});
6031 }
6032 }
6033 cg.error_msg.?.notes = notes;
6034 return error.CodegenFail;
6035 },
6036 else => |others| return others,
6037 };
6038
6039 for (outputs) |output| {
6040 _ = output;
6041 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]);
6042 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]), 0);
6043 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6044 output_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6045
6046 const result = as.value_map.get(name) orelse return {
6047 return cg.fail("invalid asm output '{s}'", .{name});
6048 };
6049
6050 switch (result) {
6051 .just_declared, .unresolved_forward_reference => unreachable,
6052 .ty => return cg.fail("cannot return spir-v type as value from assembly", .{}),
6053 .value => |ref| return ref,
6054 .constant, .string => return cg.fail("cannot return constant from assembly", .{}),
6055 }
6056
6057 // TODO: Multiple results
6058 // TODO: Check that the output type from assembly is the same as the type actually expected by Zig.
6059 }
6060
6061 return null;
6062}
6063
6064fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !?Id {
6065 _ = modifier;
6066
6067 const gpa = cg.module.gpa;
6068 const zcu = cg.module.zcu;
6069 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6070 const extra = cg.air.extraData(Air.Call, pl_op.payload);
6071 const args: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.args_len]);
6072 const callee_ty = cg.typeOf(pl_op.operand);
6073 const zig_fn_ty = switch (callee_ty.zigTypeTag(zcu)) {
6074 .@"fn" => callee_ty,
6075 .pointer => return cg.fail("cannot call function pointers", .{}),
6076 else => unreachable,
6077 };
6078 const fn_info = zcu.typeToFunc(zig_fn_ty).?;
6079 const return_type = fn_info.return_type;
6080
6081 const result_type_id = try cg.resolveFnReturnType(.fromInterned(return_type));
6082 const result_id = cg.module.allocId();
6083 const callee_id = try cg.resolve(pl_op.operand);
6084
6085 comptime assert(zig_call_abi_ver == 3);
6086 const params = try gpa.alloc(Id, args.len);
6087 defer gpa.free(params);
6088 var n_params: usize = 0;
6089 for (args) |arg| {
6090 // Note: resolve() might emit instructions, so we need to call it
6091 // before starting to emit OpFunctionCall instructions. Hence the
6092 // temporary params buffer.
6093 const arg_ty = cg.typeOf(arg);
6094 if (!arg_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
6095 const arg_id = try cg.resolve(arg);
6096
6097 params[n_params] = arg_id;
6098 n_params += 1;
6099 }
6100
6101 try cg.body.emit(cg.module.gpa, .OpFunctionCall, .{
6102 .id_result_type = result_type_id,
6103 .id_result = result_id,
6104 .function = callee_id,
6105 .id_ref_3 = params[0..n_params],
6106 });
6107
6108 if (cg.liveness.isUnused(inst) or !Type.fromInterned(return_type).hasRuntimeBitsIgnoreComptime(zcu)) {
6109 return null;
6110 }
6111
6112 return result_id;
6113}
6114
6115fn builtin3D(
6116 cg: *CodeGen,
6117 result_ty: Type,
6118 builtin: spec.BuiltIn,
6119 dimension: u32,
6120 out_of_range_value: anytype,
6121) !Id {
6122 if (dimension >= 3) return try cg.constInt(result_ty, out_of_range_value);
6123 const u32_ty_id = try cg.module.intType(.unsigned, 32);
6124 const vec_ty_id = try cg.module.vectorType(3, u32_ty_id);
6125 const ptr_ty_id = try cg.module.ptrType(vec_ty_id, .input);
6126 const spv_decl_index = try cg.module.builtin(ptr_ty_id, builtin, .input);
6127 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
6128 const ptr_id = cg.module.declPtr(spv_decl_index).result_id;
6129 const vec_id = cg.module.allocId();
6130 try cg.body.emit(cg.module.gpa, .OpLoad, .{
6131 .id_result_type = vec_ty_id,
6132 .id_result = vec_id,
6133 .pointer = ptr_id,
6134 });
6135 return try cg.extractVectorComponent(result_ty, vec_id, dimension);
6136}
6137
6138fn airWorkItemId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6139 if (cg.liveness.isUnused(inst)) return null;
6140 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6141 const dimension = pl_op.payload;
6142 return try cg.builtin3D(.u32, .local_invocation_id, dimension, 0);
6143}
6144
6145// TODO: this must be an OpConstant/OpSpec but even then the driver crashes.
6146fn airWorkGroupSize(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6147 if (cg.liveness.isUnused(inst)) return null;
6148 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6149 const dimension = pl_op.payload;
6150 return try cg.builtin3D(.u32, .workgroup_id, dimension, 0);
6151}
6152
6153fn airWorkGroupId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6154 if (cg.liveness.isUnused(inst)) return null;
6155 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6156 const dimension = pl_op.payload;
6157 return try cg.builtin3D(.u32, .workgroup_id, dimension, 0);
6158}
6159
6160fn typeOf(cg: *CodeGen, inst: Air.Inst.Ref) Type {
6161 const zcu = cg.module.zcu;
6162 return cg.air.typeOf(inst, &zcu.intern_pool);
6163}
6164
6165fn typeOfIndex(cg: *CodeGen, inst: Air.Inst.Index) Type {
6166 const zcu = cg.module.zcu;
6167 return cg.air.typeOfIndex(inst, &zcu.intern_pool);
6168}
src/arch/spirv/Module.zig deleted-955
...@@ -1,955 +0,0 @@
1//! This structure represents a SPIR-V (sections) module being compiled, and keeps
2//! track of all relevant information. That includes the actual instructions, the
3//! current result-id bound, and data structures for querying result-id's of data
4//! which needs to be persistent over different calls to Decl code generation.
5//!
6//! A SPIR-V binary module supports both little- and big endian layout. The layout
7//! is detected by the magic word in the header. Therefore, we can ignore any byte
8//! order throughout the implementation, and just use the host byte order, and make
9//! this a problem for the consumer.
10const std = @import("std");
11const Allocator = std.mem.Allocator;
12const assert = std.debug.assert;
13
14const Zcu = @import("../../Zcu.zig");
15const InternPool = @import("../../InternPool.zig");
16const Section = @import("Section.zig");
17const spec = @import("spec.zig");
18const Word = spec.Word;
19const Id = spec.Id;
20
21const Module = @This();
22
23gpa: Allocator,
24arena: Allocator,
25zcu: *Zcu,
26nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,
27uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,
28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
29decls: std.ArrayListUnmanaged(Decl) = .empty,
30decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty,
31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
32/// This map serves a dual purpose:
33/// - It keeps track of pointers that are currently being emitted, so that we can tell
34/// if they are recursive and need an OpTypeForwardPointer.
35/// - It caches pointers by child-type. This is required because sometimes we rely on
36/// ID-equality for pointers, and pointers constructed via `ptrType()` aren't interned
37/// via the usual `intern_map` mechanism.
38ptr_types: std.AutoHashMapUnmanaged(struct { Id, spec.StorageClass }, Id) = .{},
39/// For test declarations compiled for Vulkan target, we have to add a buffer.
40/// We only need to generate this once, this holds the link information related to that.
41error_buffer: ?Decl.Index = null,
42/// SPIR-V instructions return result-ids.
43/// This variable holds the module-wide counter for these.
44next_result_id: Word = 1,
45/// Some types shouldn't be emitted more than one time, but cannot be caught by
46/// the `intern_map` during codegen. Sometimes, IDs are compared to check if
47/// types are the same, so we can't delay until the dedup pass. Therefore,
48/// this is an ad-hoc structure to cache types where required.
49/// According to the SPIR-V specification, section 2.8, this includes all non-aggregate
50/// non-pointer types.
51/// Additionally, this is used for other values which can be cached, for example,
52/// built-in variables.
53cache: struct {
54 bool_type: ?Id = null,
55 void_type: ?Id = null,
56 opaque_types: std.StringHashMapUnmanaged(Id) = .empty,
57 int_types: std.AutoHashMapUnmanaged(std.builtin.Type.Int, Id) = .empty,
58 float_types: std.AutoHashMapUnmanaged(std.builtin.Type.Float, Id) = .empty,
59 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
60 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
61 struct_types: std.ArrayHashMapUnmanaged(StructType, Id, StructType.HashContext, true) = .empty,
62 fn_types: std.ArrayHashMapUnmanaged(FnType, Id, FnType.HashContext, true) = .empty,
63
64 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
65 extensions: std.StringHashMapUnmanaged(void) = .empty,
66 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
67 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
68 builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Decl.Index) = .empty,
69 strings: std.StringArrayHashMapUnmanaged(Id) = .empty,
70
71 bool_const: [2]?Id = .{ null, null },
72 constants: std.ArrayHashMapUnmanaged(Constant, Id, Constant.HashContext, true) = .empty,
73} = .{},
74/// Module layout, according to SPIR-V Spec section 2.4, "Logical Layout of a Module".
75sections: struct {
76 capabilities: Section = .{},
77 extensions: Section = .{},
78 extended_instruction_set: Section = .{},
79 memory_model: Section = .{},
80 execution_modes: Section = .{},
81 debug_strings: Section = .{},
82 debug_names: Section = .{},
83 annotations: Section = .{},
84 globals: Section = .{},
85 functions: Section = .{},
86} = .{},
87
88pub const big_int_bits = 32;
89
90/// Data can be lowered into in two basic representations: indirect, which is when
91/// a type is stored in memory, and direct, which is how a type is stored when its
92/// a direct SPIR-V value.
93pub const Repr = enum {
94 /// A SPIR-V value as it would be used in operations.
95 direct,
96 /// A SPIR-V value as it is stored in memory.
97 indirect,
98};
99
100/// Declarations, both functions and globals, can have dependencies. These are used for 2 things:
101/// - Globals must be declared before they are used, also between globals. The compiler processes
102/// globals unordered, so we must use the dependencies here to figure out how to order the globals
103/// in the final module. The Globals structure is also used for that.
104/// - Entry points must declare the complete list of OpVariable instructions that they access.
105/// For these we use the same dependency structure.
106/// In this mechanism, globals will only depend on other globals, while functions may depend on
107/// globals or other functions.
108pub const Decl = struct {
109 /// Index to refer to a Decl by.
110 pub const Index = enum(u32) { _ };
111
112 /// Useful to tell what kind of decl this is, and hold the result-id or field index
113 /// to be used for this decl.
114 pub const Kind = enum {
115 func,
116 global,
117 invocation_global,
118 };
119
120 /// See comment on Kind
121 kind: Kind,
122 /// The result-id associated to this decl. The specific meaning of this depends on `kind`:
123 /// - For `func`, this is the result-id of the associated OpFunction instruction.
124 /// - For `global`, this is the result-id of the associated OpVariable instruction.
125 /// - For `invocation_global`, this is the result-id of the associated InvocationGlobal instruction.
126 result_id: Id,
127 /// The offset of the first dependency of this decl in the `decl_deps` array.
128 begin_dep: u32,
129 /// The past-end offset of the dependencies of this decl in the `decl_deps` array.
130 end_dep: u32,
131};
132
133/// This models a kernel entry point.
134pub const EntryPoint = struct {
135 /// The declaration that should be exported.
136 decl_index: Decl.Index,
137 /// The name of the kernel to be exported.
138 name: []const u8,
139 /// Calling Convention
140 exec_model: spec.ExecutionModel,
141 exec_mode: ?spec.ExecutionMode = null,
142};
143
144const StructType = struct {
145 fields: []const Id,
146 ip_index: InternPool.Index,
147
148 const HashContext = struct {
149 pub fn hash(_: @This(), ty: StructType) u32 {
150 var hasher = std.hash.Wyhash.init(0);
151 hasher.update(std.mem.sliceAsBytes(ty.fields));
152 hasher.update(std.mem.asBytes(&ty.ip_index));
153 return @truncate(hasher.final());
154 }
155
156 pub fn eql(_: @This(), a: StructType, b: StructType, _: usize) bool {
157 return a.ip_index == b.ip_index and std.mem.eql(Id, a.fields, b.fields);
158 }
159 };
160};
161
162const FnType = struct {
163 return_ty: Id,
164 params: []const Id,
165
166 const HashContext = struct {
167 pub fn hash(_: @This(), ty: FnType) u32 {
168 var hasher = std.hash.Wyhash.init(0);
169 hasher.update(std.mem.asBytes(&ty.return_ty));
170 hasher.update(std.mem.sliceAsBytes(ty.params));
171 return @truncate(hasher.final());
172 }
173
174 pub fn eql(_: @This(), a: FnType, b: FnType, _: usize) bool {
175 return a.return_ty == b.return_ty and
176 std.mem.eql(Id, a.params, b.params);
177 }
178 };
179};
180
181const Constant = struct {
182 ty: Id,
183 value: spec.LiteralContextDependentNumber,
184
185 const HashContext = struct {
186 pub fn hash(_: @This(), value: Constant) u32 {
187 const Tag = @typeInfo(spec.LiteralContextDependentNumber).@"union".tag_type.?;
188 var hasher = std.hash.Wyhash.init(0);
189 hasher.update(std.mem.asBytes(&value.ty));
190 hasher.update(std.mem.asBytes(&@as(Tag, value.value)));
191 switch (value.value) {
192 inline else => |v| hasher.update(std.mem.asBytes(&v)),
193 }
194 return @truncate(hasher.final());
195 }
196
197 pub fn eql(_: @This(), a: Constant, b: Constant, _: usize) bool {
198 if (a.ty != b.ty) return false;
199 const Tag = @typeInfo(spec.LiteralContextDependentNumber).@"union".tag_type.?;
200 if (@as(Tag, a.value) != @as(Tag, b.value)) return false;
201 return switch (a.value) {
202 inline else => |v, tag| v == @field(b.value, @tagName(tag)),
203 };
204 }
205 };
206};
207
208pub fn deinit(module: *Module) void {
209 module.nav_link.deinit(module.gpa);
210 module.uav_link.deinit(module.gpa);
211 module.intern_map.deinit(module.gpa);
212 module.ptr_types.deinit(module.gpa);
213
214 module.sections.capabilities.deinit(module.gpa);
215 module.sections.extensions.deinit(module.gpa);
216 module.sections.extended_instruction_set.deinit(module.gpa);
217 module.sections.memory_model.deinit(module.gpa);
218 module.sections.execution_modes.deinit(module.gpa);
219 module.sections.debug_strings.deinit(module.gpa);
220 module.sections.debug_names.deinit(module.gpa);
221 module.sections.annotations.deinit(module.gpa);
222 module.sections.globals.deinit(module.gpa);
223 module.sections.functions.deinit(module.gpa);
224
225 module.cache.opaque_types.deinit(module.gpa);
226 module.cache.int_types.deinit(module.gpa);
227 module.cache.float_types.deinit(module.gpa);
228 module.cache.vector_types.deinit(module.gpa);
229 module.cache.array_types.deinit(module.gpa);
230 module.cache.struct_types.deinit(module.gpa);
231 module.cache.fn_types.deinit(module.gpa);
232 module.cache.capabilities.deinit(module.gpa);
233 module.cache.extensions.deinit(module.gpa);
234 module.cache.extended_instruction_set.deinit(module.gpa);
235 module.cache.decorations.deinit(module.gpa);
236 module.cache.builtins.deinit(module.gpa);
237 module.cache.strings.deinit(module.gpa);
238
239 module.cache.constants.deinit(module.gpa);
240
241 module.decls.deinit(module.gpa);
242 module.decl_deps.deinit(module.gpa);
243 module.entry_points.deinit(module.gpa);
244
245 module.* = undefined;
246}
247
248/// Fetch or allocate a result id for nav index. This function also marks the nav as alive.
249/// Note: Function does not actually generate the nav, it just allocates an index.
250pub fn resolveNav(module: *Module, ip: *InternPool, nav_index: InternPool.Nav.Index) !Decl.Index {
251 const entry = try module.nav_link.getOrPut(module.gpa, nav_index);
252 if (!entry.found_existing) {
253 const nav = ip.getNav(nav_index);
254 // TODO: Extern fn?
255 const kind: Decl.Kind = if (ip.isFunctionType(nav.typeOf(ip)))
256 .func
257 else switch (nav.getAddrspace()) {
258 .generic => .invocation_global,
259 else => .global,
260 };
261
262 entry.value_ptr.* = try module.allocDecl(kind);
263 }
264
265 return entry.value_ptr.*;
266}
267
268pub fn allocIds(module: *Module, n: u32) spec.IdRange {
269 defer module.next_result_id += n;
270 return .{ .base = module.next_result_id, .len = n };
271}
272
273pub fn allocId(module: *Module) Id {
274 return module.allocIds(1).at(0);
275}
276
277pub fn idBound(module: Module) Word {
278 return module.next_result_id;
279}
280
281pub fn addEntryPointDeps(
282 module: *Module,
283 decl_index: Decl.Index,
284 seen: *std.DynamicBitSetUnmanaged,
285 interface: *std.ArrayList(Id),
286) !void {
287 const decl = module.declPtr(decl_index);
288 const deps = module.decl_deps.items[decl.begin_dep..decl.end_dep];
289
290 if (seen.isSet(@intFromEnum(decl_index))) {
291 return;
292 }
293
294 seen.set(@intFromEnum(decl_index));
295
296 if (decl.kind == .global) {
297 try interface.append(decl.result_id);
298 }
299
300 for (deps) |dep| {
301 try module.addEntryPointDeps(dep, seen, interface);
302 }
303}
304
305fn entryPoints(module: *Module) !Section {
306 const target = module.zcu.getTarget();
307
308 var entry_points = Section{};
309 errdefer entry_points.deinit(module.gpa);
310
311 var interface = std.ArrayList(Id).init(module.gpa);
312 defer interface.deinit();
313
314 var seen = try std.DynamicBitSetUnmanaged.initEmpty(module.gpa, module.decls.items.len);
315 defer seen.deinit(module.gpa);
316
317 for (module.entry_points.keys(), module.entry_points.values()) |entry_point_id, entry_point| {
318 interface.items.len = 0;
319 seen.setRangeValue(.{ .start = 0, .end = module.decls.items.len }, false);
320
321 try module.addEntryPointDeps(entry_point.decl_index, &seen, &interface);
322 try entry_points.emit(module.gpa, .OpEntryPoint, .{
323 .execution_model = entry_point.exec_model,
324 .entry_point = entry_point_id,
325 .name = entry_point.name,
326 .interface = interface.items,
327 });
328
329 if (entry_point.exec_mode == null and entry_point.exec_model == .fragment) {
330 switch (target.os.tag) {
331 .vulkan, .opengl => |tag| {
332 try module.sections.execution_modes.emit(module.gpa, .OpExecutionMode, .{
333 .entry_point = entry_point_id,
334 .mode = if (tag == .vulkan) .origin_upper_left else .origin_lower_left,
335 });
336 },
337 .opencl => {},
338 else => unreachable,
339 }
340 }
341 }
342
343 return entry_points;
344}
345
346pub fn finalize(module: *Module, gpa: Allocator) ![]Word {
347 const target = module.zcu.getTarget();
348
349 // Emit capabilities and extensions
350 switch (target.os.tag) {
351 .opengl => {
352 try module.addCapability(.shader);
353 try module.addCapability(.matrix);
354 },
355 .vulkan => {
356 try module.addCapability(.shader);
357 try module.addCapability(.matrix);
358 if (target.cpu.arch == .spirv64) {
359 try module.addExtension("SPV_KHR_physical_storage_buffer");
360 try module.addCapability(.physical_storage_buffer_addresses);
361 }
362 },
363 .opencl, .amdhsa => {
364 try module.addCapability(.kernel);
365 try module.addCapability(.addresses);
366 },
367 else => unreachable,
368 }
369 if (target.cpu.arch == .spirv64) try module.addCapability(.int64);
370 if (target.cpu.has(.spirv, .int64)) try module.addCapability(.int64);
371 if (target.cpu.has(.spirv, .float16)) {
372 if (target.os.tag == .opencl) try module.addExtension("cl_khr_fp16");
373 try module.addCapability(.float16);
374 }
375 if (target.cpu.has(.spirv, .float64)) try module.addCapability(.float64);
376 if (target.cpu.has(.spirv, .generic_pointer)) try module.addCapability(.generic_pointer);
377 if (target.cpu.has(.spirv, .vector16)) try module.addCapability(.vector16);
378 if (target.cpu.has(.spirv, .storage_push_constant16)) {
379 try module.addExtension("SPV_KHR_16bit_storage");
380 try module.addCapability(.storage_push_constant16);
381 }
382 if (target.cpu.has(.spirv, .arbitrary_precision_integers)) {
383 try module.addExtension("SPV_INTEL_arbitrary_precision_integers");
384 try module.addCapability(.arbitrary_precision_integers_intel);
385 }
386 if (target.cpu.has(.spirv, .variable_pointers)) {
387 try module.addExtension("SPV_KHR_variable_pointers");
388 try module.addCapability(.variable_pointers_storage_buffer);
389 try module.addCapability(.variable_pointers);
390 }
391 // These are well supported
392 try module.addCapability(.int8);
393 try module.addCapability(.int16);
394
395 // Emit memory model
396 const addressing_model: spec.AddressingModel = switch (target.os.tag) {
397 .opengl => .logical,
398 .vulkan => if (target.cpu.arch == .spirv32) .logical else .physical_storage_buffer64,
399 .opencl => if (target.cpu.arch == .spirv32) .physical32 else .physical64,
400 .amdhsa => .physical64,
401 else => unreachable,
402 };
403 try module.sections.memory_model.emit(module.gpa, .OpMemoryModel, .{
404 .addressing_model = addressing_model,
405 .memory_model = switch (target.os.tag) {
406 .opencl => .open_cl,
407 .vulkan, .opengl => .glsl450,
408 else => unreachable,
409 },
410 });
411
412 var entry_points = try module.entryPoints();
413 defer entry_points.deinit(module.gpa);
414
415 const version: spec.Version = .{
416 .major = 1,
417 .minor = blk: {
418 // Prefer higher versions
419 if (target.cpu.has(.spirv, .v1_6)) break :blk 6;
420 if (target.cpu.has(.spirv, .v1_5)) break :blk 5;
421 if (target.cpu.has(.spirv, .v1_4)) break :blk 4;
422 if (target.cpu.has(.spirv, .v1_3)) break :blk 3;
423 if (target.cpu.has(.spirv, .v1_2)) break :blk 2;
424 if (target.cpu.has(.spirv, .v1_1)) break :blk 1;
425 break :blk 0;
426 },
427 };
428
429 const header = [_]Word{
430 spec.magic_number,
431 version.toWord(),
432 spec.zig_generator_id,
433 module.idBound(),
434 0, // Schema (currently reserved for future use)
435 };
436
437 var source = Section{};
438 defer source.deinit(module.gpa);
439 try module.sections.debug_strings.emit(module.gpa, .OpSource, .{
440 .source_language = .zig,
441 .version = 0,
442 // We cannot emit these because the Khronos translator does not parse this instruction
443 // correctly.
444 // See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2188
445 .file = null,
446 .source = null,
447 });
448
449 // Note: needs to be kept in order according to section 2.3!
450 const buffers = &[_][]const Word{
451 &header,
452 module.sections.capabilities.toWords(),
453 module.sections.extensions.toWords(),
454 module.sections.extended_instruction_set.toWords(),
455 module.sections.memory_model.toWords(),
456 entry_points.toWords(),
457 module.sections.execution_modes.toWords(),
458 source.toWords(),
459 module.sections.debug_strings.toWords(),
460 module.sections.debug_names.toWords(),
461 module.sections.annotations.toWords(),
462 module.sections.globals.toWords(),
463 module.sections.functions.toWords(),
464 };
465
466 var total_result_size: usize = 0;
467 for (buffers) |buffer| {
468 total_result_size += buffer.len;
469 }
470 const result = try gpa.alloc(Word, total_result_size);
471 errdefer comptime unreachable;
472
473 var offset: usize = 0;
474 for (buffers) |buffer| {
475 @memcpy(result[offset..][0..buffer.len], buffer);
476 offset += buffer.len;
477 }
478
479 return result;
480}
481
482pub fn addCapability(module: *Module, cap: spec.Capability) !void {
483 const entry = try module.cache.capabilities.getOrPut(module.gpa, cap);
484 if (entry.found_existing) return;
485 try module.sections.capabilities.emit(module.gpa, .OpCapability, .{ .capability = cap });
486}
487
488pub fn addExtension(module: *Module, ext: []const u8) !void {
489 const entry = try module.cache.extensions.getOrPut(module.gpa, ext);
490 if (entry.found_existing) return;
491 try module.sections.extensions.emit(module.gpa, .OpExtension, .{ .name = ext });
492}
493
494/// Imports or returns the existing id of an extended instruction set
495pub fn importInstructionSet(module: *Module, set: spec.InstructionSet) !Id {
496 assert(set != .core);
497
498 const gop = try module.cache.extended_instruction_set.getOrPut(module.gpa, set);
499 if (gop.found_existing) return gop.value_ptr.*;
500
501 const result_id = module.allocId();
502 try module.sections.extended_instruction_set.emit(module.gpa, .OpExtInstImport, .{
503 .id_result = result_id,
504 .name = @tagName(set),
505 });
506 gop.value_ptr.* = result_id;
507
508 return result_id;
509}
510
511pub fn boolType(module: *Module) !Id {
512 if (module.cache.bool_type) |id| return id;
513
514 const result_id = module.allocId();
515 try module.sections.globals.emit(module.gpa, .OpTypeBool, .{
516 .id_result = result_id,
517 });
518 module.cache.bool_type = result_id;
519 return result_id;
520}
521
522pub fn voidType(module: *Module) !Id {
523 if (module.cache.void_type) |id| return id;
524
525 const result_id = module.allocId();
526 try module.sections.globals.emit(module.gpa, .OpTypeVoid, .{
527 .id_result = result_id,
528 });
529 module.cache.void_type = result_id;
530 try module.debugName(result_id, "void");
531 return result_id;
532}
533
534pub fn opaqueType(module: *Module, name: []const u8) !Id {
535 if (module.cache.opaque_types.get(name)) |id| return id;
536 const result_id = module.allocId();
537 const name_dup = try module.arena.dupe(u8, name);
538 try module.sections.globals.emit(module.gpa, .OpTypeOpaque, .{
539 .id_result = result_id,
540 .literal_string = name_dup,
541 });
542 try module.debugName(result_id, name_dup);
543 try module.cache.opaque_types.put(module.gpa, name_dup, result_id);
544 return result_id;
545}
546
547pub fn backingIntBits(module: *Module, bits: u16) struct { u16, bool } {
548 assert(bits != 0);
549 const target = module.zcu.getTarget();
550
551 if (target.cpu.has(.spirv, .arbitrary_precision_integers) and bits <= 32) {
552 return .{ bits, false };
553 }
554
555 // We require Int8 and Int16 capabilities and benefit Int64 when available.
556 // 32-bit integers are always supported (see spec, 2.16.1, Data rules).
557 const ints = [_]struct { bits: u16, enabled: bool }{
558 .{ .bits = 8, .enabled = true },
559 .{ .bits = 16, .enabled = true },
560 .{ .bits = 32, .enabled = true },
561 .{
562 .bits = 64,
563 .enabled = target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64,
564 },
565 };
566
567 for (ints) |int| {
568 if (bits <= int.bits and int.enabled) return .{ int.bits, false };
569 }
570
571 // Big int
572 return .{ std.mem.alignForward(u16, bits, big_int_bits), true };
573}
574
575pub fn intType(module: *Module, signedness: std.builtin.Signedness, bits: u16) !Id {
576 assert(bits > 0);
577
578 const target = module.zcu.getTarget();
579 const actual_signedness = switch (target.os.tag) {
580 // Kernel only supports unsigned ints.
581 .opencl, .amdhsa => .unsigned,
582 else => signedness,
583 };
584 const backing_bits, const big_int = module.backingIntBits(bits);
585 if (big_int) {
586 // TODO: support composite integers larger than 64 bit
587 assert(backing_bits <= 64);
588 const u32_ty = try module.intType(.unsigned, 32);
589 const len_id = try module.constant(u32_ty, .{ .uint32 = backing_bits / big_int_bits });
590 return module.arrayType(len_id, u32_ty);
591 }
592
593 const entry = try module.cache.int_types.getOrPut(module.gpa, .{ .signedness = actual_signedness, .bits = backing_bits });
594 if (!entry.found_existing) {
595 const result_id = module.allocId();
596 entry.value_ptr.* = result_id;
597 try module.sections.globals.emit(module.gpa, .OpTypeInt, .{
598 .id_result = result_id,
599 .width = backing_bits,
600 .signedness = switch (actual_signedness) {
601 .signed => 1,
602 .unsigned => 0,
603 },
604 });
605
606 switch (actual_signedness) {
607 .signed => try module.debugNameFmt(result_id, "i{}", .{backing_bits}),
608 .unsigned => try module.debugNameFmt(result_id, "u{}", .{backing_bits}),
609 }
610 }
611 return entry.value_ptr.*;
612}
613
614pub fn floatType(module: *Module, bits: u16) !Id {
615 assert(bits > 0);
616 const entry = try module.cache.float_types.getOrPut(module.gpa, .{ .bits = bits });
617 if (!entry.found_existing) {
618 const result_id = module.allocId();
619 entry.value_ptr.* = result_id;
620 try module.sections.globals.emit(module.gpa, .OpTypeFloat, .{
621 .id_result = result_id,
622 .width = bits,
623 });
624 try module.debugNameFmt(result_id, "f{}", .{bits});
625 }
626 return entry.value_ptr.*;
627}
628
629pub fn vectorType(module: *Module, len: u32, child_ty_id: Id) !Id {
630 const entry = try module.cache.vector_types.getOrPut(module.gpa, .{ child_ty_id, len });
631 if (!entry.found_existing) {
632 const result_id = module.allocId();
633 entry.value_ptr.* = result_id;
634 try module.sections.globals.emit(module.gpa, .OpTypeVector, .{
635 .id_result = result_id,
636 .component_type = child_ty_id,
637 .component_count = len,
638 });
639 }
640 return entry.value_ptr.*;
641}
642
643pub fn arrayType(module: *Module, len_id: Id, child_ty_id: Id) !Id {
644 const entry = try module.cache.array_types.getOrPut(module.gpa, .{ child_ty_id, len_id });
645 if (!entry.found_existing) {
646 const result_id = module.allocId();
647 entry.value_ptr.* = result_id;
648 try module.sections.globals.emit(module.gpa, .OpTypeArray, .{
649 .id_result = result_id,
650 .element_type = child_ty_id,
651 .length = len_id,
652 });
653 }
654 return entry.value_ptr.*;
655}
656
657pub fn ptrType(module: *Module, child_ty_id: Id, storage_class: spec.StorageClass) !Id {
658 const key = .{ child_ty_id, storage_class };
659 const gop = try module.ptr_types.getOrPut(module.gpa, key);
660 if (!gop.found_existing) {
661 gop.value_ptr.* = module.allocId();
662 try module.sections.globals.emit(module.gpa, .OpTypePointer, .{
663 .id_result = gop.value_ptr.*,
664 .storage_class = storage_class,
665 .type = child_ty_id,
666 });
667 return gop.value_ptr.*;
668 }
669 return gop.value_ptr.*;
670}
671
672pub fn structType(
673 module: *Module,
674 types: []const Id,
675 maybe_names: ?[]const []const u8,
676 maybe_offsets: ?[]const u32,
677 ip_index: InternPool.Index,
678) !Id {
679 const target = module.zcu.getTarget();
680
681 if (module.cache.struct_types.get(.{ .fields = types, .ip_index = ip_index })) |id| return id;
682 const result_id = module.allocId();
683 const types_dup = try module.arena.dupe(Id, types);
684 try module.sections.globals.emit(module.gpa, .OpTypeStruct, .{
685 .id_result = result_id,
686 .id_ref = types_dup,
687 });
688
689 if (maybe_names) |names| {
690 assert(names.len == types.len);
691 for (names, 0..) |name, i| {
692 try module.memberDebugName(result_id, @intCast(i), name);
693 }
694 }
695
696 switch (target.os.tag) {
697 .vulkan, .opengl => {
698 if (maybe_offsets) |offsets| {
699 assert(offsets.len == types.len);
700 for (offsets, 0..) |offset, i| {
701 try module.decorateMember(
702 result_id,
703 @intCast(i),
704 .{ .offset = .{ .byte_offset = offset } },
705 );
706 }
707 }
708 },
709 else => {},
710 }
711
712 try module.cache.struct_types.put(
713 module.gpa,
714 .{
715 .fields = types_dup,
716 .ip_index = if (module.zcu.comp.config.root_strip) .none else ip_index,
717 },
718 result_id,
719 );
720 return result_id;
721}
722
723pub fn functionType(module: *Module, return_ty_id: Id, param_type_ids: []const Id) !Id {
724 if (module.cache.fn_types.get(.{
725 .return_ty = return_ty_id,
726 .params = param_type_ids,
727 })) |id| return id;
728 const result_id = module.allocId();
729 const params_dup = try module.arena.dupe(Id, param_type_ids);
730 try module.sections.globals.emit(module.gpa, .OpTypeFunction, .{
731 .id_result = result_id,
732 .return_type = return_ty_id,
733 .id_ref_2 = params_dup,
734 });
735 try module.cache.fn_types.put(module.gpa, .{
736 .return_ty = return_ty_id,
737 .params = params_dup,
738 }, result_id);
739 return result_id;
740}
741
742pub fn constant(module: *Module, ty_id: Id, value: spec.LiteralContextDependentNumber) !Id {
743 const gop = try module.cache.constants.getOrPut(module.gpa, .{ .ty = ty_id, .value = value });
744 if (!gop.found_existing) {
745 gop.value_ptr.* = module.allocId();
746 try module.sections.globals.emit(module.gpa, .OpConstant, .{
747 .id_result_type = ty_id,
748 .id_result = gop.value_ptr.*,
749 .value = value,
750 });
751 }
752 return gop.value_ptr.*;
753}
754
755pub fn constBool(module: *Module, value: bool) !Id {
756 if (module.cache.bool_const[@intFromBool(value)]) |b| return b;
757
758 const result_ty_id = try module.boolType();
759 const result_id = module.allocId();
760 module.cache.bool_const[@intFromBool(value)] = result_id;
761
762 switch (value) {
763 inline else => |value_ct| try module.sections.globals.emit(
764 module.gpa,
765 if (value_ct) .OpConstantTrue else .OpConstantFalse,
766 .{
767 .id_result_type = result_ty_id,
768 .id_result = result_id,
769 },
770 ),
771 }
772
773 return result_id;
774}
775
776pub fn builtin(
777 module: *Module,
778 result_ty_id: Id,
779 spirv_builtin: spec.BuiltIn,
780 storage_class: spec.StorageClass,
781) !Decl.Index {
782 const gop = try module.cache.builtins.getOrPut(module.gpa, .{ spirv_builtin, storage_class });
783 if (!gop.found_existing) {
784 const decl_index = try module.allocDecl(.global);
785 const result_id = module.declPtr(decl_index).result_id;
786 gop.value_ptr.* = decl_index;
787 try module.sections.globals.emit(module.gpa, .OpVariable, .{
788 .id_result_type = result_ty_id,
789 .id_result = result_id,
790 .storage_class = storage_class,
791 });
792 try module.decorate(result_id, .{ .built_in = .{ .built_in = spirv_builtin } });
793 try module.declareDeclDeps(decl_index, &.{});
794 }
795 return gop.value_ptr.*;
796}
797
798pub fn constUndef(module: *Module, ty_id: Id) !Id {
799 const result_id = module.allocId();
800 try module.sections.globals.emit(module.gpa, .OpUndef, .{
801 .id_result_type = ty_id,
802 .id_result = result_id,
803 });
804 return result_id;
805}
806
807pub fn constNull(module: *Module, ty_id: Id) !Id {
808 const result_id = module.allocId();
809 try module.sections.globals.emit(module.gpa, .OpConstantNull, .{
810 .id_result_type = ty_id,
811 .id_result = result_id,
812 });
813 return result_id;
814}
815
816/// Decorate a result-id.
817pub fn decorate(
818 module: *Module,
819 target: Id,
820 decoration: spec.Decoration.Extended,
821) !void {
822 const gop = try module.cache.decorations.getOrPut(module.gpa, .{ target, decoration });
823 if (!gop.found_existing) {
824 try module.sections.annotations.emit(module.gpa, .OpDecorate, .{
825 .target = target,
826 .decoration = decoration,
827 });
828 }
829}
830
831/// Decorate a result-id which is a member of some struct.
832/// We really don't have to and shouldn't need to cache this.
833pub fn decorateMember(
834 module: *Module,
835 structure_type: Id,
836 member: u32,
837 decoration: spec.Decoration.Extended,
838) !void {
839 try module.sections.annotations.emit(module.gpa, .OpMemberDecorate, .{
840 .structure_type = structure_type,
841 .member = member,
842 .decoration = decoration,
843 });
844}
845
846pub fn allocDecl(module: *Module, kind: Decl.Kind) !Decl.Index {
847 try module.decls.append(module.gpa, .{
848 .kind = kind,
849 .result_id = module.allocId(),
850 .begin_dep = undefined,
851 .end_dep = undefined,
852 });
853
854 return @as(Decl.Index, @enumFromInt(@as(u32, @intCast(module.decls.items.len - 1))));
855}
856
857pub fn declPtr(module: *Module, index: Decl.Index) *Decl {
858 return &module.decls.items[@intFromEnum(index)];
859}
860
861/// Declare ALL dependencies for a decl.
862pub fn declareDeclDeps(module: *Module, decl_index: Decl.Index, deps: []const Decl.Index) !void {
863 const begin_dep: u32 = @intCast(module.decl_deps.items.len);
864 try module.decl_deps.appendSlice(module.gpa, deps);
865 const end_dep: u32 = @intCast(module.decl_deps.items.len);
866
867 const decl = module.declPtr(decl_index);
868 decl.begin_dep = begin_dep;
869 decl.end_dep = end_dep;
870}
871
872/// Declare a SPIR-V function as an entry point. This causes an extra wrapper
873/// function to be generated, which is then exported as the real entry point. The purpose of this
874/// wrapper is to allocate and initialize the structure holding the instance globals.
875pub fn declareEntryPoint(
876 module: *Module,
877 decl_index: Decl.Index,
878 name: []const u8,
879 exec_model: spec.ExecutionModel,
880 exec_mode: ?spec.ExecutionMode,
881) !void {
882 const gop = try module.entry_points.getOrPut(module.gpa, module.declPtr(decl_index).result_id);
883 gop.value_ptr.decl_index = decl_index;
884 gop.value_ptr.name = name;
885 gop.value_ptr.exec_model = exec_model;
886 // Might've been set by assembler
887 if (!gop.found_existing) gop.value_ptr.exec_mode = exec_mode;
888}
889
890pub fn debugName(module: *Module, target: Id, name: []const u8) !void {
891 try module.sections.debug_names.emit(module.gpa, .OpName, .{
892 .target = target,
893 .name = name,
894 });
895}
896
897pub fn debugNameFmt(module: *Module, target: Id, comptime fmt: []const u8, args: anytype) !void {
898 const name = try std.fmt.allocPrint(module.gpa, fmt, args);
899 defer module.gpa.free(name);
900 try module.debugName(target, name);
901}
902
903pub fn memberDebugName(module: *Module, target: Id, member: u32, name: []const u8) !void {
904 try module.sections.debug_names.emit(module.gpa, .OpMemberName, .{
905 .type = target,
906 .member = member,
907 .name = name,
908 });
909}
910
911pub fn debugString(module: *Module, string: []const u8) !Id {
912 const entry = try module.cache.strings.getOrPut(module.gpa, string);
913 if (!entry.found_existing) {
914 entry.value_ptr.* = module.allocId();
915 try module.sections.debug_strings.emit(module.gpa, .OpString, .{
916 .id_result = entry.value_ptr.*,
917 .string = string,
918 });
919 }
920 return entry.value_ptr.*;
921}
922
923pub fn storageClass(module: *Module, as: std.builtin.AddressSpace) spec.StorageClass {
924 const target = module.zcu.getTarget();
925 return switch (as) {
926 .generic => .function,
927 .global => switch (target.os.tag) {
928 .opencl, .amdhsa => .cross_workgroup,
929 else => .storage_buffer,
930 },
931 .push_constant => .push_constant,
932 .output => .output,
933 .uniform => .uniform,
934 .storage_buffer => .storage_buffer,
935 .physical_storage_buffer => .physical_storage_buffer,
936 .constant => .uniform_constant,
937 .shared => .workgroup,
938 .local => .function,
939 .input => .input,
940 .gs,
941 .fs,
942 .ss,
943 .param,
944 .flash,
945 .flash1,
946 .flash2,
947 .flash3,
948 .flash4,
949 .flash5,
950 .cog,
951 .lut,
952 .hub,
953 => unreachable,
954 };
955}
src/arch/spirv/Section.zig deleted-282
...@@ -1,282 +0,0 @@
1//! Represents a section or subsection of instructions in a SPIR-V binary. Instructions can be append
2//! to separate sections, which can then later be merged into the final binary.
3const Section = @This();
4
5const std = @import("std");
6const Allocator = std.mem.Allocator;
7const testing = std.testing;
8
9const spec = @import("spec.zig");
10const Word = spec.Word;
11const DoubleWord = std.meta.Int(.unsigned, @bitSizeOf(Word) * 2);
12const Log2Word = std.math.Log2Int(Word);
13
14const Opcode = spec.Opcode;
15
16instructions: std.ArrayListUnmanaged(Word) = .empty,
17
18pub fn deinit(section: *Section, allocator: Allocator) void {
19 section.instructions.deinit(allocator);
20 section.* = undefined;
21}
22
23pub fn reset(section: *Section) void {
24 section.instructions.items.len = 0;
25}
26
27pub fn toWords(section: Section) []Word {
28 return section.instructions.items;
29}
30
31/// Append the instructions from another section into this section.
32pub fn append(section: *Section, allocator: Allocator, other_section: Section) !void {
33 try section.instructions.appendSlice(allocator, other_section.instructions.items);
34}
35
36pub fn ensureUnusedCapacity(
37 section: *Section,
38 allocator: Allocator,
39 words: usize,
40) !void {
41 try section.instructions.ensureUnusedCapacity(allocator, words);
42}
43
44/// Write an instruction and size, operands are to be inserted manually.
45pub fn emitRaw(
46 section: *Section,
47 allocator: Allocator,
48 opcode: Opcode,
49 operand_words: usize,
50) !void {
51 const word_count = 1 + operand_words;
52 try section.instructions.ensureUnusedCapacity(allocator, word_count);
53 section.writeWord((@as(Word, @intCast(word_count << 16))) | @intFromEnum(opcode));
54}
55
56/// Write an entire instruction, including all operands
57pub fn emitRawInstruction(
58 section: *Section,
59 allocator: Allocator,
60 opcode: Opcode,
61 operands: []const Word,
62) !void {
63 try section.emitRaw(allocator, opcode, operands.len);
64 section.writeWords(operands);
65}
66
67pub fn emitAssumeCapacity(
68 section: *Section,
69 comptime opcode: spec.Opcode,
70 operands: opcode.Operands(),
71) !void {
72 const word_count = instructionSize(opcode, operands);
73 section.writeWord(@as(Word, @intCast(word_count << 16)) | @intFromEnum(opcode));
74 section.writeOperands(opcode.Operands(), operands);
75}
76
77pub fn emit(
78 section: *Section,
79 allocator: Allocator,
80 comptime opcode: spec.Opcode,
81 operands: opcode.Operands(),
82) !void {
83 const word_count = instructionSize(opcode, operands);
84 try section.instructions.ensureUnusedCapacity(allocator, word_count);
85 section.writeWord(@as(Word, @intCast(word_count << 16)) | @intFromEnum(opcode));
86 section.writeOperands(opcode.Operands(), operands);
87}
88
89pub fn emitBranch(
90 section: *Section,
91 allocator: Allocator,
92 target_label: spec.Id,
93) !void {
94 try section.emit(allocator, .OpBranch, .{
95 .target_label = target_label,
96 });
97}
98
99pub fn writeWord(section: *Section, word: Word) void {
100 section.instructions.appendAssumeCapacity(word);
101}
102
103pub fn writeWords(section: *Section, words: []const Word) void {
104 section.instructions.appendSliceAssumeCapacity(words);
105}
106
107pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {
108 section.writeWords(&.{
109 @truncate(dword),
110 @truncate(dword >> @bitSizeOf(Word)),
111 });
112}
113
114fn writeOperands(section: *Section, comptime Operands: type, operands: Operands) void {
115 const fields = switch (@typeInfo(Operands)) {
116 .@"struct" => |info| info.fields,
117 .void => return,
118 else => unreachable,
119 };
120 inline for (fields) |field| {
121 section.writeOperand(field.type, @field(operands, field.name));
122 }
123}
124
125pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand) void {
126 switch (Operand) {
127 spec.LiteralSpecConstantOpInteger => unreachable,
128 spec.Id => section.writeWord(@intFromEnum(operand)),
129 spec.LiteralInteger => section.writeWord(operand),
130 spec.LiteralString => section.writeString(operand),
131 spec.LiteralContextDependentNumber => section.writeContextDependentNumber(operand),
132 spec.LiteralExtInstInteger => section.writeWord(operand.inst),
133 spec.PairLiteralIntegerIdRef => section.writeWords(&.{ operand.value, @enumFromInt(operand.label) }),
134 spec.PairIdRefLiteralInteger => section.writeWords(&.{ @intFromEnum(operand.target), operand.member }),
135 spec.PairIdRefIdRef => section.writeWords(&.{ @intFromEnum(operand[0]), @intFromEnum(operand[1]) }),
136 else => switch (@typeInfo(Operand)) {
137 .@"enum" => section.writeWord(@intFromEnum(operand)),
138 .optional => |info| if (operand) |child| section.writeOperand(info.child, child),
139 .pointer => |info| {
140 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
141 for (operand) |item| {
142 section.writeOperand(info.child, item);
143 }
144 },
145 .@"struct" => |info| {
146 if (info.layout == .@"packed") {
147 section.writeWord(@as(Word, @bitCast(operand)));
148 } else {
149 section.writeExtendedMask(Operand, operand);
150 }
151 },
152 .@"union" => section.writeExtendedUnion(Operand, operand),
153 else => unreachable,
154 },
155 }
156}
157
158fn writeString(section: *Section, str: []const u8) void {
159 const zero_terminated_len = str.len + 1;
160 var i: usize = 0;
161 while (i < zero_terminated_len) : (i += @sizeOf(Word)) {
162 var word: Word = 0;
163 var j: usize = 0;
164 while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) {
165 word |= @as(Word, str[i + j]) << @as(Log2Word, @intCast(j * @bitSizeOf(u8)));
166 }
167 section.instructions.appendAssumeCapacity(word);
168 }
169}
170
171fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDependentNumber) void {
172 switch (operand) {
173 .int32 => |int| section.writeWord(@bitCast(int)),
174 .uint32 => |int| section.writeWord(@bitCast(int)),
175 .int64 => |int| section.writeDoubleWord(@bitCast(int)),
176 .uint64 => |int| section.writeDoubleWord(@bitCast(int)),
177 .float32 => |float| section.writeWord(@bitCast(float)),
178 .float64 => |float| section.writeDoubleWord(@bitCast(float)),
179 }
180}
181
182fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {
183 var mask: Word = 0;
184 inline for (@typeInfo(Operand).@"struct".fields, 0..) |field, bit| {
185 switch (@typeInfo(field.type)) {
186 .optional => if (@field(operand, field.name) != null) {
187 mask |= 1 << @as(u5, @intCast(bit));
188 },
189 .bool => if (@field(operand, field.name)) {
190 mask |= 1 << @as(u5, @intCast(bit));
191 },
192 else => unreachable,
193 }
194 }
195
196 section.writeWord(mask);
197
198 inline for (@typeInfo(Operand).@"struct".fields) |field| {
199 switch (@typeInfo(field.type)) {
200 .optional => |info| if (@field(operand, field.name)) |child| {
201 section.writeOperands(info.child, child);
202 },
203 .bool => {},
204 else => unreachable,
205 }
206 }
207}
208
209fn writeExtendedUnion(section: *Section, comptime Operand: type, operand: Operand) void {
210 return switch (operand) {
211 inline else => |op, tag| {
212 section.writeWord(@intFromEnum(tag));
213 section.writeOperands(
214 @FieldType(Operand, @tagName(tag)),
215 op,
216 );
217 },
218 };
219}
220
221fn instructionSize(comptime opcode: spec.Opcode, operands: opcode.Operands()) usize {
222 return operandsSize(opcode.Operands(), operands) + 1;
223}
224
225fn operandsSize(comptime Operands: type, operands: Operands) usize {
226 const fields = switch (@typeInfo(Operands)) {
227 .@"struct" => |info| info.fields,
228 .void => return 0,
229 else => unreachable,
230 };
231
232 var total: usize = 0;
233 inline for (fields) |field| {
234 total += operandSize(field.type, @field(operands, field.name));
235 }
236
237 return total;
238}
239
240fn operandSize(comptime Operand: type, operand: Operand) usize {
241 return switch (Operand) {
242 spec.LiteralSpecConstantOpInteger => unreachable,
243 spec.Id, spec.LiteralInteger, spec.LiteralExtInstInteger => 1,
244 spec.LiteralString => std.math.divCeil(usize, operand.len + 1, @sizeOf(Word)) catch unreachable,
245 spec.LiteralContextDependentNumber => switch (operand) {
246 .int32, .uint32, .float32 => 1,
247 .int64, .uint64, .float64 => 2,
248 },
249 spec.PairLiteralIntegerIdRef, spec.PairIdRefLiteralInteger, spec.PairIdRefIdRef => 2,
250 else => switch (@typeInfo(Operand)) {
251 .@"enum" => 1,
252 .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
253 .pointer => |info| blk: {
254 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
255 var total: usize = 0;
256 for (operand) |item| {
257 total += operandSize(info.child, item);
258 }
259 break :blk total;
260 },
261 .@"struct" => |struct_info| {
262 if (struct_info.layout == .@"packed") return 1;
263
264 var total: usize = 0;
265 inline for (@typeInfo(Operand).@"struct".fields) |field| {
266 switch (@typeInfo(field.type)) {
267 .optional => |info| if (@field(operand, field.name)) |child| {
268 total += operandsSize(info.child, child);
269 },
270 .bool => {},
271 else => unreachable,
272 }
273 }
274 return total + 1; // Add one for the mask itself.
275 },
276 .@"union" => switch (operand) {
277 inline else => |op, tag| operandsSize(@FieldType(Operand, @tagName(tag)), op) + 1,
278 },
279 else => unreachable,
280 },
281 };
282}
src/arch/spirv/extinst.zig.grammar.json deleted-11
...@@ -1,11 +0,0 @@
1{
2 "version": 0,
3 "revision": 0,
4 "instructions": [
5 {
6 "opname": "InvocationGlobal",
7 "opcode": 0,
8 "operands": [{ "kind": "IdRef", "name": "initializer function" }]
9 }
10 ]
11}
src/arch/spirv/spec.zig deleted-18428
...@@ -1,18428 +0,0 @@
1//! This file is auto-generated by tools/gen_spirv_spec.zig.
2
3const std = @import("std");
4
5pub const Version = packed struct(Word) {
6 padding: u8 = 0,
7 minor: u8,
8 major: u8,
9 padding0: u8 = 0,
10
11 pub fn toWord(self: @This()) Word {
12 return @bitCast(self);
13 }
14};
15
16pub const Word = u32;
17pub const Id = enum(Word) {
18 none,
19 _,
20
21 pub fn format(self: Id, writer: *std.io.Writer) std.io.Writer.Error!void {
22 switch (self) {
23 .none => try writer.writeAll("(none)"),
24 else => try writer.print("%{d}", .{@intFromEnum(self)}),
25 }
26 }
27};
28
29pub const IdRange = struct {
30 base: u32,
31 len: u32,
32
33 pub fn at(range: IdRange, i: usize) Id {
34 std.debug.assert(i < range.len);
35 return @enumFromInt(range.base + i);
36 }
37};
38
39pub const LiteralInteger = Word;
40pub const LiteralFloat = Word;
41pub const LiteralString = []const u8;
42pub const LiteralContextDependentNumber = union(enum) {
43 int32: i32,
44 uint32: u32,
45 int64: i64,
46 uint64: u64,
47 float32: f32,
48 float64: f64,
49};
50pub const LiteralExtInstInteger = struct { inst: Word };
51pub const LiteralSpecConstantOpInteger = struct { opcode: Opcode };
52pub const PairLiteralIntegerIdRef = struct { value: LiteralInteger, label: Id };
53pub const PairIdRefLiteralInteger = struct { target: Id, member: LiteralInteger };
54pub const PairIdRefIdRef = [2]Id;
55
56pub const Quantifier = enum {
57 required,
58 optional,
59 variadic,
60};
61
62pub const Operand = struct {
63 kind: OperandKind,
64 quantifier: Quantifier,
65};
66
67pub const OperandCategory = enum {
68 bit_enum,
69 value_enum,
70 id,
71 literal,
72 composite,
73};
74
75pub const Enumerant = struct {
76 name: []const u8,
77 value: Word,
78 parameters: []const OperandKind,
79};
80
81pub const Instruction = struct {
82 name: []const u8,
83 opcode: Word,
84 operands: []const Operand,
85};
86
87pub const zig_generator_id: Word = 41;
88pub const version: Version = .{ .major = 1, .minor = 6, .patch = 4 };
89pub const magic_number: Word = 0x07230203;
90
91pub const Class = enum {
92 miscellaneous,
93 debug,
94 extension,
95 mode_setting,
96 type_declaration,
97 constant_creation,
98 function,
99 memory,
100 annotation,
101 composite,
102 image,
103 conversion,
104 arithmetic,
105 relational_and_logical,
106 bit,
107 derivative,
108 primitive,
109 barrier,
110 atomic,
111 control_flow,
112 group,
113 pipe,
114 device_side_enqueue,
115 non_uniform,
116 tensor,
117 graph,
118 reserved,
119};
120
121pub const OperandKind = enum {
122 opcode,
123 image_operands,
124 fp_fast_math_mode,
125 selection_control,
126 loop_control,
127 function_control,
128 memory_semantics,
129 memory_access,
130 kernel_profiling_info,
131 ray_flags,
132 fragment_shading_rate,
133 raw_access_chain_operands,
134 source_language,
135 execution_model,
136 addressing_model,
137 memory_model,
138 execution_mode,
139 storage_class,
140 dim,
141 sampler_addressing_mode,
142 sampler_filter_mode,
143 image_format,
144 image_channel_order,
145 image_channel_data_type,
146 fp_rounding_mode,
147 fp_denorm_mode,
148 quantization_modes,
149 fp_operation_mode,
150 overflow_modes,
151 linkage_type,
152 access_qualifier,
153 host_access_qualifier,
154 function_parameter_attribute,
155 decoration,
156 built_in,
157 scope,
158 group_operation,
159 kernel_enqueue_flags,
160 capability,
161 ray_query_intersection,
162 ray_query_committed_intersection_type,
163 ray_query_candidate_intersection_type,
164 packed_vector_format,
165 cooperative_matrix_operands,
166 cooperative_matrix_layout,
167 cooperative_matrix_use,
168 cooperative_matrix_reduce,
169 tensor_clamp_mode,
170 tensor_addressing_operands,
171 initialization_mode_qualifier,
172 load_cache_control,
173 store_cache_control,
174 named_maximum_number_of_registers,
175 matrix_multiply_accumulate_operands,
176 fp_encoding,
177 cooperative_vector_matrix_layout,
178 component_type,
179 id_result_type,
180 id_result,
181 id_memory_semantics,
182 id_scope,
183 id_ref,
184 literal_integer,
185 literal_string,
186 literal_float,
187 literal_context_dependent_number,
188 literal_ext_inst_integer,
189 literal_spec_constant_op_integer,
190 pair_literal_integer_id_ref,
191 pair_id_ref_literal_integer,
192 pair_id_ref_id_ref,
193 tensor_operands,
194 debug_info_debug_info_flags,
195 debug_info_debug_base_type_attribute_encoding,
196 debug_info_debug_composite_type,
197 debug_info_debug_type_qualifier,
198 debug_info_debug_operation,
199 open_cl_debug_info_100_debug_info_flags,
200 open_cl_debug_info_100_debug_base_type_attribute_encoding,
201 open_cl_debug_info_100_debug_composite_type,
202 open_cl_debug_info_100_debug_type_qualifier,
203 open_cl_debug_info_100_debug_operation,
204 open_cl_debug_info_100_debug_imported_entity,
205 non_semantic_clspv_reflection_6_kernel_property_flags,
206 non_semantic_shader_debug_info_100_debug_info_flags,
207 non_semantic_shader_debug_info_100_build_identifier_flags,
208 non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding,
209 non_semantic_shader_debug_info_100_debug_composite_type,
210 non_semantic_shader_debug_info_100_debug_type_qualifier,
211 non_semantic_shader_debug_info_100_debug_operation,
212 non_semantic_shader_debug_info_100_debug_imported_entity,
213
214 pub fn category(self: OperandKind) OperandCategory {
215 return switch (self) {
216 .opcode => .literal,
217 .image_operands => .bit_enum,
218 .fp_fast_math_mode => .bit_enum,
219 .selection_control => .bit_enum,
220 .loop_control => .bit_enum,
221 .function_control => .bit_enum,
222 .memory_semantics => .bit_enum,
223 .memory_access => .bit_enum,
224 .kernel_profiling_info => .bit_enum,
225 .ray_flags => .bit_enum,
226 .fragment_shading_rate => .bit_enum,
227 .raw_access_chain_operands => .bit_enum,
228 .source_language => .value_enum,
229 .execution_model => .value_enum,
230 .addressing_model => .value_enum,
231 .memory_model => .value_enum,
232 .execution_mode => .value_enum,
233 .storage_class => .value_enum,
234 .dim => .value_enum,
235 .sampler_addressing_mode => .value_enum,
236 .sampler_filter_mode => .value_enum,
237 .image_format => .value_enum,
238 .image_channel_order => .value_enum,
239 .image_channel_data_type => .value_enum,
240 .fp_rounding_mode => .value_enum,
241 .fp_denorm_mode => .value_enum,
242 .quantization_modes => .value_enum,
243 .fp_operation_mode => .value_enum,
244 .overflow_modes => .value_enum,
245 .linkage_type => .value_enum,
246 .access_qualifier => .value_enum,
247 .host_access_qualifier => .value_enum,
248 .function_parameter_attribute => .value_enum,
249 .decoration => .value_enum,
250 .built_in => .value_enum,
251 .scope => .value_enum,
252 .group_operation => .value_enum,
253 .kernel_enqueue_flags => .value_enum,
254 .capability => .value_enum,
255 .ray_query_intersection => .value_enum,
256 .ray_query_committed_intersection_type => .value_enum,
257 .ray_query_candidate_intersection_type => .value_enum,
258 .packed_vector_format => .value_enum,
259 .cooperative_matrix_operands => .bit_enum,
260 .cooperative_matrix_layout => .value_enum,
261 .cooperative_matrix_use => .value_enum,
262 .cooperative_matrix_reduce => .bit_enum,
263 .tensor_clamp_mode => .value_enum,
264 .tensor_addressing_operands => .bit_enum,
265 .initialization_mode_qualifier => .value_enum,
266 .load_cache_control => .value_enum,
267 .store_cache_control => .value_enum,
268 .named_maximum_number_of_registers => .value_enum,
269 .matrix_multiply_accumulate_operands => .bit_enum,
270 .fp_encoding => .value_enum,
271 .cooperative_vector_matrix_layout => .value_enum,
272 .component_type => .value_enum,
273 .id_result_type => .id,
274 .id_result => .id,
275 .id_memory_semantics => .id,
276 .id_scope => .id,
277 .id_ref => .id,
278 .literal_integer => .literal,
279 .literal_string => .literal,
280 .literal_float => .literal,
281 .literal_context_dependent_number => .literal,
282 .literal_ext_inst_integer => .literal,
283 .literal_spec_constant_op_integer => .literal,
284 .pair_literal_integer_id_ref => .composite,
285 .pair_id_ref_literal_integer => .composite,
286 .pair_id_ref_id_ref => .composite,
287 .tensor_operands => .bit_enum,
288 .debug_info_debug_info_flags => .bit_enum,
289 .debug_info_debug_base_type_attribute_encoding => .value_enum,
290 .debug_info_debug_composite_type => .value_enum,
291 .debug_info_debug_type_qualifier => .value_enum,
292 .debug_info_debug_operation => .value_enum,
293 .open_cl_debug_info_100_debug_info_flags => .bit_enum,
294 .open_cl_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
295 .open_cl_debug_info_100_debug_composite_type => .value_enum,
296 .open_cl_debug_info_100_debug_type_qualifier => .value_enum,
297 .open_cl_debug_info_100_debug_operation => .value_enum,
298 .open_cl_debug_info_100_debug_imported_entity => .value_enum,
299 .non_semantic_clspv_reflection_6_kernel_property_flags => .bit_enum,
300 .non_semantic_shader_debug_info_100_debug_info_flags => .bit_enum,
301 .non_semantic_shader_debug_info_100_build_identifier_flags => .bit_enum,
302 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
303 .non_semantic_shader_debug_info_100_debug_composite_type => .value_enum,
304 .non_semantic_shader_debug_info_100_debug_type_qualifier => .value_enum,
305 .non_semantic_shader_debug_info_100_debug_operation => .value_enum,
306 .non_semantic_shader_debug_info_100_debug_imported_entity => .value_enum,
307 };
308 }
309 pub fn enumerants(self: OperandKind) []const Enumerant {
310 return switch (self) {
311 .opcode => unreachable,
312 .image_operands => &.{
313 .{ .name = "Bias", .value = 0x0001, .parameters = &.{.id_ref} },
314 .{ .name = "Lod", .value = 0x0002, .parameters = &.{.id_ref} },
315 .{ .name = "Grad", .value = 0x0004, .parameters = &.{ .id_ref, .id_ref } },
316 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &.{.id_ref} },
317 .{ .name = "Offset", .value = 0x0010, .parameters = &.{.id_ref} },
318 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &.{.id_ref} },
319 .{ .name = "Sample", .value = 0x0040, .parameters = &.{.id_ref} },
320 .{ .name = "MinLod", .value = 0x0080, .parameters = &.{.id_ref} },
321 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &.{.id_scope} },
322 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &.{.id_scope} },
323 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &.{} },
324 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &.{} },
325 .{ .name = "SignExtend", .value = 0x1000, .parameters = &.{} },
326 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &.{} },
327 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &.{} },
328 .{ .name = "Offsets", .value = 0x10000, .parameters = &.{.id_ref} },
329 },
330 .fp_fast_math_mode => &.{
331 .{ .name = "NotNaN", .value = 0x0001, .parameters = &.{} },
332 .{ .name = "NotInf", .value = 0x0002, .parameters = &.{} },
333 .{ .name = "NSZ", .value = 0x0004, .parameters = &.{} },
334 .{ .name = "AllowRecip", .value = 0x0008, .parameters = &.{} },
335 .{ .name = "Fast", .value = 0x0010, .parameters = &.{} },
336 .{ .name = "AllowContract", .value = 0x10000, .parameters = &.{} },
337 .{ .name = "AllowReassoc", .value = 0x20000, .parameters = &.{} },
338 .{ .name = "AllowTransform", .value = 0x40000, .parameters = &.{} },
339 },
340 .selection_control => &.{
341 .{ .name = "Flatten", .value = 0x0001, .parameters = &.{} },
342 .{ .name = "DontFlatten", .value = 0x0002, .parameters = &.{} },
343 },
344 .loop_control => &.{
345 .{ .name = "Unroll", .value = 0x0001, .parameters = &.{} },
346 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &.{} },
347 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &.{} },
348 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &.{.literal_integer} },
349 .{ .name = "MinIterations", .value = 0x0010, .parameters = &.{.literal_integer} },
350 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &.{.literal_integer} },
351 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &.{.literal_integer} },
352 .{ .name = "PeelCount", .value = 0x0080, .parameters = &.{.literal_integer} },
353 .{ .name = "PartialCount", .value = 0x0100, .parameters = &.{.literal_integer} },
354 .{ .name = "InitiationIntervalINTEL", .value = 0x10000, .parameters = &.{.literal_integer} },
355 .{ .name = "MaxConcurrencyINTEL", .value = 0x20000, .parameters = &.{.literal_integer} },
356 .{ .name = "DependencyArrayINTEL", .value = 0x40000, .parameters = &.{.literal_integer} },
357 .{ .name = "PipelineEnableINTEL", .value = 0x80000, .parameters = &.{.literal_integer} },
358 .{ .name = "LoopCoalesceINTEL", .value = 0x100000, .parameters = &.{.literal_integer} },
359 .{ .name = "MaxInterleavingINTEL", .value = 0x200000, .parameters = &.{.literal_integer} },
360 .{ .name = "SpeculatedIterationsINTEL", .value = 0x400000, .parameters = &.{.literal_integer} },
361 .{ .name = "NoFusionINTEL", .value = 0x800000, .parameters = &.{} },
362 .{ .name = "LoopCountINTEL", .value = 0x1000000, .parameters = &.{.literal_integer} },
363 .{ .name = "MaxReinvocationDelayINTEL", .value = 0x2000000, .parameters = &.{.literal_integer} },
364 },
365 .function_control => &.{
366 .{ .name = "Inline", .value = 0x0001, .parameters = &.{} },
367 .{ .name = "DontInline", .value = 0x0002, .parameters = &.{} },
368 .{ .name = "Pure", .value = 0x0004, .parameters = &.{} },
369 .{ .name = "Const", .value = 0x0008, .parameters = &.{} },
370 .{ .name = "OptNoneEXT", .value = 0x10000, .parameters = &.{} },
371 },
372 .memory_semantics => &.{
373 .{ .name = "Relaxed", .value = 0x0000, .parameters = &.{} },
374 .{ .name = "Acquire", .value = 0x0002, .parameters = &.{} },
375 .{ .name = "Release", .value = 0x0004, .parameters = &.{} },
376 .{ .name = "AcquireRelease", .value = 0x0008, .parameters = &.{} },
377 .{ .name = "SequentiallyConsistent", .value = 0x0010, .parameters = &.{} },
378 .{ .name = "UniformMemory", .value = 0x0040, .parameters = &.{} },
379 .{ .name = "SubgroupMemory", .value = 0x0080, .parameters = &.{} },
380 .{ .name = "WorkgroupMemory", .value = 0x0100, .parameters = &.{} },
381 .{ .name = "CrossWorkgroupMemory", .value = 0x0200, .parameters = &.{} },
382 .{ .name = "AtomicCounterMemory", .value = 0x0400, .parameters = &.{} },
383 .{ .name = "ImageMemory", .value = 0x0800, .parameters = &.{} },
384 .{ .name = "OutputMemory", .value = 0x1000, .parameters = &.{} },
385 .{ .name = "MakeAvailable", .value = 0x2000, .parameters = &.{} },
386 .{ .name = "MakeVisible", .value = 0x4000, .parameters = &.{} },
387 .{ .name = "Volatile", .value = 0x8000, .parameters = &.{} },
388 },
389 .memory_access => &.{
390 .{ .name = "Volatile", .value = 0x0001, .parameters = &.{} },
391 .{ .name = "Aligned", .value = 0x0002, .parameters = &.{.literal_integer} },
392 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &.{} },
393 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &.{.id_scope} },
394 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &.{.id_scope} },
395 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &.{} },
396 .{ .name = "AliasScopeINTELMask", .value = 0x10000, .parameters = &.{.id_ref} },
397 .{ .name = "NoAliasINTELMask", .value = 0x20000, .parameters = &.{.id_ref} },
398 },
399 .kernel_profiling_info => &.{
400 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &.{} },
401 },
402 .ray_flags => &.{
403 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
404 .{ .name = "OpaqueKHR", .value = 0x0001, .parameters = &.{} },
405 .{ .name = "NoOpaqueKHR", .value = 0x0002, .parameters = &.{} },
406 .{ .name = "TerminateOnFirstHitKHR", .value = 0x0004, .parameters = &.{} },
407 .{ .name = "SkipClosestHitShaderKHR", .value = 0x0008, .parameters = &.{} },
408 .{ .name = "CullBackFacingTrianglesKHR", .value = 0x0010, .parameters = &.{} },
409 .{ .name = "CullFrontFacingTrianglesKHR", .value = 0x0020, .parameters = &.{} },
410 .{ .name = "CullOpaqueKHR", .value = 0x0040, .parameters = &.{} },
411 .{ .name = "CullNoOpaqueKHR", .value = 0x0080, .parameters = &.{} },
412 .{ .name = "SkipTrianglesKHR", .value = 0x0100, .parameters = &.{} },
413 .{ .name = "SkipAABBsKHR", .value = 0x0200, .parameters = &.{} },
414 .{ .name = "ForceOpacityMicromap2StateEXT", .value = 0x0400, .parameters = &.{} },
415 },
416 .fragment_shading_rate => &.{
417 .{ .name = "Vertical2Pixels", .value = 0x0001, .parameters = &.{} },
418 .{ .name = "Vertical4Pixels", .value = 0x0002, .parameters = &.{} },
419 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &.{} },
420 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &.{} },
421 },
422 .raw_access_chain_operands => &.{
423 .{ .name = "RobustnessPerComponentNV", .value = 0x0001, .parameters = &.{} },
424 .{ .name = "RobustnessPerElementNV", .value = 0x0002, .parameters = &.{} },
425 },
426 .source_language => &.{
427 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
428 .{ .name = "ESSL", .value = 1, .parameters = &.{} },
429 .{ .name = "GLSL", .value = 2, .parameters = &.{} },
430 .{ .name = "OpenCL_C", .value = 3, .parameters = &.{} },
431 .{ .name = "OpenCL_CPP", .value = 4, .parameters = &.{} },
432 .{ .name = "HLSL", .value = 5, .parameters = &.{} },
433 .{ .name = "CPP_for_OpenCL", .value = 6, .parameters = &.{} },
434 .{ .name = "SYCL", .value = 7, .parameters = &.{} },
435 .{ .name = "HERO_C", .value = 8, .parameters = &.{} },
436 .{ .name = "NZSL", .value = 9, .parameters = &.{} },
437 .{ .name = "WGSL", .value = 10, .parameters = &.{} },
438 .{ .name = "Slang", .value = 11, .parameters = &.{} },
439 .{ .name = "Zig", .value = 12, .parameters = &.{} },
440 .{ .name = "Rust", .value = 13, .parameters = &.{} },
441 },
442 .execution_model => &.{
443 .{ .name = "Vertex", .value = 0, .parameters = &.{} },
444 .{ .name = "TessellationControl", .value = 1, .parameters = &.{} },
445 .{ .name = "TessellationEvaluation", .value = 2, .parameters = &.{} },
446 .{ .name = "Geometry", .value = 3, .parameters = &.{} },
447 .{ .name = "Fragment", .value = 4, .parameters = &.{} },
448 .{ .name = "GLCompute", .value = 5, .parameters = &.{} },
449 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
450 .{ .name = "TaskNV", .value = 5267, .parameters = &.{} },
451 .{ .name = "MeshNV", .value = 5268, .parameters = &.{} },
452 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &.{} },
453 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &.{} },
454 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &.{} },
455 .{ .name = "ClosestHitKHR", .value = 5316, .parameters = &.{} },
456 .{ .name = "MissKHR", .value = 5317, .parameters = &.{} },
457 .{ .name = "CallableKHR", .value = 5318, .parameters = &.{} },
458 .{ .name = "TaskEXT", .value = 5364, .parameters = &.{} },
459 .{ .name = "MeshEXT", .value = 5365, .parameters = &.{} },
460 },
461 .addressing_model => &.{
462 .{ .name = "Logical", .value = 0, .parameters = &.{} },
463 .{ .name = "Physical32", .value = 1, .parameters = &.{} },
464 .{ .name = "Physical64", .value = 2, .parameters = &.{} },
465 .{ .name = "PhysicalStorageBuffer64", .value = 5348, .parameters = &.{} },
466 },
467 .memory_model => &.{
468 .{ .name = "Simple", .value = 0, .parameters = &.{} },
469 .{ .name = "GLSL450", .value = 1, .parameters = &.{} },
470 .{ .name = "OpenCL", .value = 2, .parameters = &.{} },
471 .{ .name = "Vulkan", .value = 3, .parameters = &.{} },
472 },
473 .execution_mode => &.{
474 .{ .name = "Invocations", .value = 0, .parameters = &.{.literal_integer} },
475 .{ .name = "SpacingEqual", .value = 1, .parameters = &.{} },
476 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &.{} },
477 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &.{} },
478 .{ .name = "VertexOrderCw", .value = 4, .parameters = &.{} },
479 .{ .name = "VertexOrderCcw", .value = 5, .parameters = &.{} },
480 .{ .name = "PixelCenterInteger", .value = 6, .parameters = &.{} },
481 .{ .name = "OriginUpperLeft", .value = 7, .parameters = &.{} },
482 .{ .name = "OriginLowerLeft", .value = 8, .parameters = &.{} },
483 .{ .name = "EarlyFragmentTests", .value = 9, .parameters = &.{} },
484 .{ .name = "PointMode", .value = 10, .parameters = &.{} },
485 .{ .name = "Xfb", .value = 11, .parameters = &.{} },
486 .{ .name = "DepthReplacing", .value = 12, .parameters = &.{} },
487 .{ .name = "DepthGreater", .value = 14, .parameters = &.{} },
488 .{ .name = "DepthLess", .value = 15, .parameters = &.{} },
489 .{ .name = "DepthUnchanged", .value = 16, .parameters = &.{} },
490 .{ .name = "LocalSize", .value = 17, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
491 .{ .name = "LocalSizeHint", .value = 18, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
492 .{ .name = "InputPoints", .value = 19, .parameters = &.{} },
493 .{ .name = "InputLines", .value = 20, .parameters = &.{} },
494 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &.{} },
495 .{ .name = "Triangles", .value = 22, .parameters = &.{} },
496 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &.{} },
497 .{ .name = "Quads", .value = 24, .parameters = &.{} },
498 .{ .name = "Isolines", .value = 25, .parameters = &.{} },
499 .{ .name = "OutputVertices", .value = 26, .parameters = &.{.literal_integer} },
500 .{ .name = "OutputPoints", .value = 27, .parameters = &.{} },
501 .{ .name = "OutputLineStrip", .value = 28, .parameters = &.{} },
502 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &.{} },
503 .{ .name = "VecTypeHint", .value = 30, .parameters = &.{.literal_integer} },
504 .{ .name = "ContractionOff", .value = 31, .parameters = &.{} },
505 .{ .name = "Initializer", .value = 33, .parameters = &.{} },
506 .{ .name = "Finalizer", .value = 34, .parameters = &.{} },
507 .{ .name = "SubgroupSize", .value = 35, .parameters = &.{.literal_integer} },
508 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &.{.literal_integer} },
509 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &.{.id_ref} },
510 .{ .name = "LocalSizeId", .value = 38, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
511 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
512 .{ .name = "NonCoherentColorAttachmentReadEXT", .value = 4169, .parameters = &.{} },
513 .{ .name = "NonCoherentDepthAttachmentReadEXT", .value = 4170, .parameters = &.{} },
514 .{ .name = "NonCoherentStencilAttachmentReadEXT", .value = 4171, .parameters = &.{} },
515 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &.{} },
516 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &.{} },
517 .{ .name = "DenormPreserve", .value = 4459, .parameters = &.{.literal_integer} },
518 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &.{.literal_integer} },
519 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &.{.literal_integer} },
520 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &.{.literal_integer} },
521 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &.{.literal_integer} },
522 .{ .name = "NonCoherentTileAttachmentReadQCOM", .value = 4489, .parameters = &.{} },
523 .{ .name = "TileShadingRateQCOM", .value = 4490, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
524 .{ .name = "EarlyAndLateFragmentTestsAMD", .value = 5017, .parameters = &.{} },
525 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &.{} },
526 .{ .name = "CoalescingAMDX", .value = 5069, .parameters = &.{} },
527 .{ .name = "IsApiEntryAMDX", .value = 5070, .parameters = &.{.id_ref} },
528 .{ .name = "MaxNodeRecursionAMDX", .value = 5071, .parameters = &.{.id_ref} },
529 .{ .name = "StaticNumWorkgroupsAMDX", .value = 5072, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
530 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{.id_ref} },
531 .{ .name = "MaxNumWorkgroupsAMDX", .value = 5077, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
532 .{ .name = "StencilRefUnchangedFrontAMD", .value = 5079, .parameters = &.{} },
533 .{ .name = "StencilRefGreaterFrontAMD", .value = 5080, .parameters = &.{} },
534 .{ .name = "StencilRefLessFrontAMD", .value = 5081, .parameters = &.{} },
535 .{ .name = "StencilRefUnchangedBackAMD", .value = 5082, .parameters = &.{} },
536 .{ .name = "StencilRefGreaterBackAMD", .value = 5083, .parameters = &.{} },
537 .{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },
538 .{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },
539 .{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },
540 .{ .name = "SharesInputWithAMDX", .value = 5102, .parameters = &.{ .id_ref, .id_ref } },
541 .{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },
542 .{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.literal_integer} },
543 .{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },
544 .{ .name = "DerivativeGroupLinearKHR", .value = 5290, .parameters = &.{} },
545 .{ .name = "OutputTrianglesEXT", .value = 5298, .parameters = &.{} },
546 .{ .name = "PixelInterlockOrderedEXT", .value = 5366, .parameters = &.{} },
547 .{ .name = "PixelInterlockUnorderedEXT", .value = 5367, .parameters = &.{} },
548 .{ .name = "SampleInterlockOrderedEXT", .value = 5368, .parameters = &.{} },
549 .{ .name = "SampleInterlockUnorderedEXT", .value = 5369, .parameters = &.{} },
550 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &.{} },
551 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &.{} },
552 .{ .name = "SharedLocalMemorySizeINTEL", .value = 5618, .parameters = &.{.literal_integer} },
553 .{ .name = "RoundingModeRTPINTEL", .value = 5620, .parameters = &.{.literal_integer} },
554 .{ .name = "RoundingModeRTNINTEL", .value = 5621, .parameters = &.{.literal_integer} },
555 .{ .name = "FloatingPointModeALTINTEL", .value = 5622, .parameters = &.{.literal_integer} },
556 .{ .name = "FloatingPointModeIEEEINTEL", .value = 5623, .parameters = &.{.literal_integer} },
557 .{ .name = "MaxWorkgroupSizeINTEL", .value = 5893, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
558 .{ .name = "MaxWorkDimINTEL", .value = 5894, .parameters = &.{.literal_integer} },
559 .{ .name = "NoGlobalOffsetINTEL", .value = 5895, .parameters = &.{} },
560 .{ .name = "NumSIMDWorkitemsINTEL", .value = 5896, .parameters = &.{.literal_integer} },
561 .{ .name = "SchedulerTargetFmaxMhzINTEL", .value = 5903, .parameters = &.{.literal_integer} },
562 .{ .name = "MaximallyReconvergesKHR", .value = 6023, .parameters = &.{} },
563 .{ .name = "FPFastMathDefault", .value = 6028, .parameters = &.{ .id_ref, .id_ref } },
564 .{ .name = "StreamingInterfaceINTEL", .value = 6154, .parameters = &.{.literal_integer} },
565 .{ .name = "RegisterMapInterfaceINTEL", .value = 6160, .parameters = &.{.literal_integer} },
566 .{ .name = "NamedBarrierCountINTEL", .value = 6417, .parameters = &.{.literal_integer} },
567 .{ .name = "MaximumRegistersINTEL", .value = 6461, .parameters = &.{.literal_integer} },
568 .{ .name = "MaximumRegistersIdINTEL", .value = 6462, .parameters = &.{.id_ref} },
569 .{ .name = "NamedMaximumRegistersINTEL", .value = 6463, .parameters = &.{.named_maximum_number_of_registers} },
570 },
571 .storage_class => &.{
572 .{ .name = "UniformConstant", .value = 0, .parameters = &.{} },
573 .{ .name = "Input", .value = 1, .parameters = &.{} },
574 .{ .name = "Uniform", .value = 2, .parameters = &.{} },
575 .{ .name = "Output", .value = 3, .parameters = &.{} },
576 .{ .name = "Workgroup", .value = 4, .parameters = &.{} },
577 .{ .name = "CrossWorkgroup", .value = 5, .parameters = &.{} },
578 .{ .name = "Private", .value = 6, .parameters = &.{} },
579 .{ .name = "Function", .value = 7, .parameters = &.{} },
580 .{ .name = "Generic", .value = 8, .parameters = &.{} },
581 .{ .name = "PushConstant", .value = 9, .parameters = &.{} },
582 .{ .name = "AtomicCounter", .value = 10, .parameters = &.{} },
583 .{ .name = "Image", .value = 11, .parameters = &.{} },
584 .{ .name = "StorageBuffer", .value = 12, .parameters = &.{} },
585 .{ .name = "TileImageEXT", .value = 4172, .parameters = &.{} },
586 .{ .name = "TileAttachmentQCOM", .value = 4491, .parameters = &.{} },
587 .{ .name = "NodePayloadAMDX", .value = 5068, .parameters = &.{} },
588 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &.{} },
589 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &.{} },
590 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &.{} },
591 .{ .name = "HitAttributeKHR", .value = 5339, .parameters = &.{} },
592 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &.{} },
593 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &.{} },
594 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &.{} },
595 .{ .name = "HitObjectAttributeNV", .value = 5385, .parameters = &.{} },
596 .{ .name = "TaskPayloadWorkgroupEXT", .value = 5402, .parameters = &.{} },
597 .{ .name = "CodeSectionINTEL", .value = 5605, .parameters = &.{} },
598 .{ .name = "DeviceOnlyINTEL", .value = 5936, .parameters = &.{} },
599 .{ .name = "HostOnlyINTEL", .value = 5937, .parameters = &.{} },
600 },
601 .dim => &.{
602 .{ .name = "1D", .value = 0, .parameters = &.{} },
603 .{ .name = "2D", .value = 1, .parameters = &.{} },
604 .{ .name = "3D", .value = 2, .parameters = &.{} },
605 .{ .name = "Cube", .value = 3, .parameters = &.{} },
606 .{ .name = "Rect", .value = 4, .parameters = &.{} },
607 .{ .name = "Buffer", .value = 5, .parameters = &.{} },
608 .{ .name = "SubpassData", .value = 6, .parameters = &.{} },
609 .{ .name = "TileImageDataEXT", .value = 4173, .parameters = &.{} },
610 },
611 .sampler_addressing_mode => &.{
612 .{ .name = "None", .value = 0, .parameters = &.{} },
613 .{ .name = "ClampToEdge", .value = 1, .parameters = &.{} },
614 .{ .name = "Clamp", .value = 2, .parameters = &.{} },
615 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
616 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
617 },
618 .sampler_filter_mode => &.{
619 .{ .name = "Nearest", .value = 0, .parameters = &.{} },
620 .{ .name = "Linear", .value = 1, .parameters = &.{} },
621 },
622 .image_format => &.{
623 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
624 .{ .name = "Rgba32f", .value = 1, .parameters = &.{} },
625 .{ .name = "Rgba16f", .value = 2, .parameters = &.{} },
626 .{ .name = "R32f", .value = 3, .parameters = &.{} },
627 .{ .name = "Rgba8", .value = 4, .parameters = &.{} },
628 .{ .name = "Rgba8Snorm", .value = 5, .parameters = &.{} },
629 .{ .name = "Rg32f", .value = 6, .parameters = &.{} },
630 .{ .name = "Rg16f", .value = 7, .parameters = &.{} },
631 .{ .name = "R11fG11fB10f", .value = 8, .parameters = &.{} },
632 .{ .name = "R16f", .value = 9, .parameters = &.{} },
633 .{ .name = "Rgba16", .value = 10, .parameters = &.{} },
634 .{ .name = "Rgb10A2", .value = 11, .parameters = &.{} },
635 .{ .name = "Rg16", .value = 12, .parameters = &.{} },
636 .{ .name = "Rg8", .value = 13, .parameters = &.{} },
637 .{ .name = "R16", .value = 14, .parameters = &.{} },
638 .{ .name = "R8", .value = 15, .parameters = &.{} },
639 .{ .name = "Rgba16Snorm", .value = 16, .parameters = &.{} },
640 .{ .name = "Rg16Snorm", .value = 17, .parameters = &.{} },
641 .{ .name = "Rg8Snorm", .value = 18, .parameters = &.{} },
642 .{ .name = "R16Snorm", .value = 19, .parameters = &.{} },
643 .{ .name = "R8Snorm", .value = 20, .parameters = &.{} },
644 .{ .name = "Rgba32i", .value = 21, .parameters = &.{} },
645 .{ .name = "Rgba16i", .value = 22, .parameters = &.{} },
646 .{ .name = "Rgba8i", .value = 23, .parameters = &.{} },
647 .{ .name = "R32i", .value = 24, .parameters = &.{} },
648 .{ .name = "Rg32i", .value = 25, .parameters = &.{} },
649 .{ .name = "Rg16i", .value = 26, .parameters = &.{} },
650 .{ .name = "Rg8i", .value = 27, .parameters = &.{} },
651 .{ .name = "R16i", .value = 28, .parameters = &.{} },
652 .{ .name = "R8i", .value = 29, .parameters = &.{} },
653 .{ .name = "Rgba32ui", .value = 30, .parameters = &.{} },
654 .{ .name = "Rgba16ui", .value = 31, .parameters = &.{} },
655 .{ .name = "Rgba8ui", .value = 32, .parameters = &.{} },
656 .{ .name = "R32ui", .value = 33, .parameters = &.{} },
657 .{ .name = "Rgb10a2ui", .value = 34, .parameters = &.{} },
658 .{ .name = "Rg32ui", .value = 35, .parameters = &.{} },
659 .{ .name = "Rg16ui", .value = 36, .parameters = &.{} },
660 .{ .name = "Rg8ui", .value = 37, .parameters = &.{} },
661 .{ .name = "R16ui", .value = 38, .parameters = &.{} },
662 .{ .name = "R8ui", .value = 39, .parameters = &.{} },
663 .{ .name = "R64ui", .value = 40, .parameters = &.{} },
664 .{ .name = "R64i", .value = 41, .parameters = &.{} },
665 },
666 .image_channel_order => &.{
667 .{ .name = "R", .value = 0, .parameters = &.{} },
668 .{ .name = "A", .value = 1, .parameters = &.{} },
669 .{ .name = "RG", .value = 2, .parameters = &.{} },
670 .{ .name = "RA", .value = 3, .parameters = &.{} },
671 .{ .name = "RGB", .value = 4, .parameters = &.{} },
672 .{ .name = "RGBA", .value = 5, .parameters = &.{} },
673 .{ .name = "BGRA", .value = 6, .parameters = &.{} },
674 .{ .name = "ARGB", .value = 7, .parameters = &.{} },
675 .{ .name = "Intensity", .value = 8, .parameters = &.{} },
676 .{ .name = "Luminance", .value = 9, .parameters = &.{} },
677 .{ .name = "Rx", .value = 10, .parameters = &.{} },
678 .{ .name = "RGx", .value = 11, .parameters = &.{} },
679 .{ .name = "RGBx", .value = 12, .parameters = &.{} },
680 .{ .name = "Depth", .value = 13, .parameters = &.{} },
681 .{ .name = "DepthStencil", .value = 14, .parameters = &.{} },
682 .{ .name = "sRGB", .value = 15, .parameters = &.{} },
683 .{ .name = "sRGBx", .value = 16, .parameters = &.{} },
684 .{ .name = "sRGBA", .value = 17, .parameters = &.{} },
685 .{ .name = "sBGRA", .value = 18, .parameters = &.{} },
686 .{ .name = "ABGR", .value = 19, .parameters = &.{} },
687 },
688 .image_channel_data_type => &.{
689 .{ .name = "SnormInt8", .value = 0, .parameters = &.{} },
690 .{ .name = "SnormInt16", .value = 1, .parameters = &.{} },
691 .{ .name = "UnormInt8", .value = 2, .parameters = &.{} },
692 .{ .name = "UnormInt16", .value = 3, .parameters = &.{} },
693 .{ .name = "UnormShort565", .value = 4, .parameters = &.{} },
694 .{ .name = "UnormShort555", .value = 5, .parameters = &.{} },
695 .{ .name = "UnormInt101010", .value = 6, .parameters = &.{} },
696 .{ .name = "SignedInt8", .value = 7, .parameters = &.{} },
697 .{ .name = "SignedInt16", .value = 8, .parameters = &.{} },
698 .{ .name = "SignedInt32", .value = 9, .parameters = &.{} },
699 .{ .name = "UnsignedInt8", .value = 10, .parameters = &.{} },
700 .{ .name = "UnsignedInt16", .value = 11, .parameters = &.{} },
701 .{ .name = "UnsignedInt32", .value = 12, .parameters = &.{} },
702 .{ .name = "HalfFloat", .value = 13, .parameters = &.{} },
703 .{ .name = "Float", .value = 14, .parameters = &.{} },
704 .{ .name = "UnormInt24", .value = 15, .parameters = &.{} },
705 .{ .name = "UnormInt101010_2", .value = 16, .parameters = &.{} },
706 .{ .name = "UnormInt10X6EXT", .value = 17, .parameters = &.{} },
707 .{ .name = "UnsignedIntRaw10EXT", .value = 19, .parameters = &.{} },
708 .{ .name = "UnsignedIntRaw12EXT", .value = 20, .parameters = &.{} },
709 .{ .name = "UnormInt2_101010EXT", .value = 21, .parameters = &.{} },
710 .{ .name = "UnsignedInt10X6EXT", .value = 22, .parameters = &.{} },
711 .{ .name = "UnsignedInt12X4EXT", .value = 23, .parameters = &.{} },
712 .{ .name = "UnsignedInt14X2EXT", .value = 24, .parameters = &.{} },
713 .{ .name = "UnormInt12X4EXT", .value = 25, .parameters = &.{} },
714 .{ .name = "UnormInt14X2EXT", .value = 26, .parameters = &.{} },
715 },
716 .fp_rounding_mode => &.{
717 .{ .name = "RTE", .value = 0, .parameters = &.{} },
718 .{ .name = "RTZ", .value = 1, .parameters = &.{} },
719 .{ .name = "RTP", .value = 2, .parameters = &.{} },
720 .{ .name = "RTN", .value = 3, .parameters = &.{} },
721 },
722 .fp_denorm_mode => &.{
723 .{ .name = "Preserve", .value = 0, .parameters = &.{} },
724 .{ .name = "FlushToZero", .value = 1, .parameters = &.{} },
725 },
726 .quantization_modes => &.{
727 .{ .name = "TRN", .value = 0, .parameters = &.{} },
728 .{ .name = "TRN_ZERO", .value = 1, .parameters = &.{} },
729 .{ .name = "RND", .value = 2, .parameters = &.{} },
730 .{ .name = "RND_ZERO", .value = 3, .parameters = &.{} },
731 .{ .name = "RND_INF", .value = 4, .parameters = &.{} },
732 .{ .name = "RND_MIN_INF", .value = 5, .parameters = &.{} },
733 .{ .name = "RND_CONV", .value = 6, .parameters = &.{} },
734 .{ .name = "RND_CONV_ODD", .value = 7, .parameters = &.{} },
735 },
736 .fp_operation_mode => &.{
737 .{ .name = "IEEE", .value = 0, .parameters = &.{} },
738 .{ .name = "ALT", .value = 1, .parameters = &.{} },
739 },
740 .overflow_modes => &.{
741 .{ .name = "WRAP", .value = 0, .parameters = &.{} },
742 .{ .name = "SAT", .value = 1, .parameters = &.{} },
743 .{ .name = "SAT_ZERO", .value = 2, .parameters = &.{} },
744 .{ .name = "SAT_SYM", .value = 3, .parameters = &.{} },
745 },
746 .linkage_type => &.{
747 .{ .name = "Export", .value = 0, .parameters = &.{} },
748 .{ .name = "Import", .value = 1, .parameters = &.{} },
749 .{ .name = "LinkOnceODR", .value = 2, .parameters = &.{} },
750 },
751 .access_qualifier => &.{
752 .{ .name = "ReadOnly", .value = 0, .parameters = &.{} },
753 .{ .name = "WriteOnly", .value = 1, .parameters = &.{} },
754 .{ .name = "ReadWrite", .value = 2, .parameters = &.{} },
755 },
756 .host_access_qualifier => &.{
757 .{ .name = "NoneINTEL", .value = 0, .parameters = &.{} },
758 .{ .name = "ReadINTEL", .value = 1, .parameters = &.{} },
759 .{ .name = "WriteINTEL", .value = 2, .parameters = &.{} },
760 .{ .name = "ReadWriteINTEL", .value = 3, .parameters = &.{} },
761 },
762 .function_parameter_attribute => &.{
763 .{ .name = "Zext", .value = 0, .parameters = &.{} },
764 .{ .name = "Sext", .value = 1, .parameters = &.{} },
765 .{ .name = "ByVal", .value = 2, .parameters = &.{} },
766 .{ .name = "Sret", .value = 3, .parameters = &.{} },
767 .{ .name = "NoAlias", .value = 4, .parameters = &.{} },
768 .{ .name = "NoCapture", .value = 5, .parameters = &.{} },
769 .{ .name = "NoWrite", .value = 6, .parameters = &.{} },
770 .{ .name = "NoReadWrite", .value = 7, .parameters = &.{} },
771 .{ .name = "RuntimeAlignedINTEL", .value = 5940, .parameters = &.{} },
772 },
773 .decoration => &.{
774 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &.{} },
775 .{ .name = "SpecId", .value = 1, .parameters = &.{.literal_integer} },
776 .{ .name = "Block", .value = 2, .parameters = &.{} },
777 .{ .name = "BufferBlock", .value = 3, .parameters = &.{} },
778 .{ .name = "RowMajor", .value = 4, .parameters = &.{} },
779 .{ .name = "ColMajor", .value = 5, .parameters = &.{} },
780 .{ .name = "ArrayStride", .value = 6, .parameters = &.{.literal_integer} },
781 .{ .name = "MatrixStride", .value = 7, .parameters = &.{.literal_integer} },
782 .{ .name = "GLSLShared", .value = 8, .parameters = &.{} },
783 .{ .name = "GLSLPacked", .value = 9, .parameters = &.{} },
784 .{ .name = "CPacked", .value = 10, .parameters = &.{} },
785 .{ .name = "BuiltIn", .value = 11, .parameters = &.{.built_in} },
786 .{ .name = "NoPerspective", .value = 13, .parameters = &.{} },
787 .{ .name = "Flat", .value = 14, .parameters = &.{} },
788 .{ .name = "Patch", .value = 15, .parameters = &.{} },
789 .{ .name = "Centroid", .value = 16, .parameters = &.{} },
790 .{ .name = "Sample", .value = 17, .parameters = &.{} },
791 .{ .name = "Invariant", .value = 18, .parameters = &.{} },
792 .{ .name = "Restrict", .value = 19, .parameters = &.{} },
793 .{ .name = "Aliased", .value = 20, .parameters = &.{} },
794 .{ .name = "Volatile", .value = 21, .parameters = &.{} },
795 .{ .name = "Constant", .value = 22, .parameters = &.{} },
796 .{ .name = "Coherent", .value = 23, .parameters = &.{} },
797 .{ .name = "NonWritable", .value = 24, .parameters = &.{} },
798 .{ .name = "NonReadable", .value = 25, .parameters = &.{} },
799 .{ .name = "Uniform", .value = 26, .parameters = &.{} },
800 .{ .name = "UniformId", .value = 27, .parameters = &.{.id_scope} },
801 .{ .name = "SaturatedConversion", .value = 28, .parameters = &.{} },
802 .{ .name = "Stream", .value = 29, .parameters = &.{.literal_integer} },
803 .{ .name = "Location", .value = 30, .parameters = &.{.literal_integer} },
804 .{ .name = "Component", .value = 31, .parameters = &.{.literal_integer} },
805 .{ .name = "Index", .value = 32, .parameters = &.{.literal_integer} },
806 .{ .name = "Binding", .value = 33, .parameters = &.{.literal_integer} },
807 .{ .name = "DescriptorSet", .value = 34, .parameters = &.{.literal_integer} },
808 .{ .name = "Offset", .value = 35, .parameters = &.{.literal_integer} },
809 .{ .name = "XfbBuffer", .value = 36, .parameters = &.{.literal_integer} },
810 .{ .name = "XfbStride", .value = 37, .parameters = &.{.literal_integer} },
811 .{ .name = "FuncParamAttr", .value = 38, .parameters = &.{.function_parameter_attribute} },
812 .{ .name = "FPRoundingMode", .value = 39, .parameters = &.{.fp_rounding_mode} },
813 .{ .name = "FPFastMathMode", .value = 40, .parameters = &.{.fp_fast_math_mode} },
814 .{ .name = "LinkageAttributes", .value = 41, .parameters = &.{ .literal_string, .linkage_type } },
815 .{ .name = "NoContraction", .value = 42, .parameters = &.{} },
816 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &.{.literal_integer} },
817 .{ .name = "Alignment", .value = 44, .parameters = &.{.literal_integer} },
818 .{ .name = "MaxByteOffset", .value = 45, .parameters = &.{.literal_integer} },
819 .{ .name = "AlignmentId", .value = 46, .parameters = &.{.id_ref} },
820 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &.{.id_ref} },
821 .{ .name = "SaturatedToLargestFloat8NormalConversionEXT", .value = 4216, .parameters = &.{} },
822 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &.{} },
823 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &.{} },
824 .{ .name = "WeightTextureQCOM", .value = 4487, .parameters = &.{} },
825 .{ .name = "BlockMatchTextureQCOM", .value = 4488, .parameters = &.{} },
826 .{ .name = "BlockMatchSamplerQCOM", .value = 4499, .parameters = &.{} },
827 .{ .name = "ExplicitInterpAMD", .value = 4999, .parameters = &.{} },
828 .{ .name = "NodeSharesPayloadLimitsWithAMDX", .value = 5019, .parameters = &.{.id_ref} },
829 .{ .name = "NodeMaxPayloadsAMDX", .value = 5020, .parameters = &.{.id_ref} },
830 .{ .name = "TrackFinishWritingAMDX", .value = 5078, .parameters = &.{} },
831 .{ .name = "PayloadNodeNameAMDX", .value = 5091, .parameters = &.{.id_ref} },
832 .{ .name = "PayloadNodeBaseIndexAMDX", .value = 5098, .parameters = &.{.id_ref} },
833 .{ .name = "PayloadNodeSparseArrayAMDX", .value = 5099, .parameters = &.{} },
834 .{ .name = "PayloadNodeArraySizeAMDX", .value = 5100, .parameters = &.{.id_ref} },
835 .{ .name = "PayloadDispatchIndirectAMDX", .value = 5105, .parameters = &.{} },
836 .{ .name = "OverrideCoverageNV", .value = 5248, .parameters = &.{} },
837 .{ .name = "PassthroughNV", .value = 5250, .parameters = &.{} },
838 .{ .name = "ViewportRelativeNV", .value = 5252, .parameters = &.{} },
839 .{ .name = "SecondaryViewportRelativeNV", .value = 5256, .parameters = &.{.literal_integer} },
840 .{ .name = "PerPrimitiveEXT", .value = 5271, .parameters = &.{} },
841 .{ .name = "PerViewNV", .value = 5272, .parameters = &.{} },
842 .{ .name = "PerTaskNV", .value = 5273, .parameters = &.{} },
843 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &.{} },
844 .{ .name = "NonUniform", .value = 5300, .parameters = &.{} },
845 .{ .name = "RestrictPointer", .value = 5355, .parameters = &.{} },
846 .{ .name = "AliasedPointer", .value = 5356, .parameters = &.{} },
847 .{ .name = "HitObjectShaderRecordBufferNV", .value = 5386, .parameters = &.{} },
848 .{ .name = "BindlessSamplerNV", .value = 5398, .parameters = &.{} },
849 .{ .name = "BindlessImageNV", .value = 5399, .parameters = &.{} },
850 .{ .name = "BoundSamplerNV", .value = 5400, .parameters = &.{} },
851 .{ .name = "BoundImageNV", .value = 5401, .parameters = &.{} },
852 .{ .name = "SIMTCallINTEL", .value = 5599, .parameters = &.{.literal_integer} },
853 .{ .name = "ReferencedIndirectlyINTEL", .value = 5602, .parameters = &.{} },
854 .{ .name = "ClobberINTEL", .value = 5607, .parameters = &.{.literal_string} },
855 .{ .name = "SideEffectsINTEL", .value = 5608, .parameters = &.{} },
856 .{ .name = "VectorComputeVariableINTEL", .value = 5624, .parameters = &.{} },
857 .{ .name = "FuncParamIOKindINTEL", .value = 5625, .parameters = &.{.literal_integer} },
858 .{ .name = "VectorComputeFunctionINTEL", .value = 5626, .parameters = &.{} },
859 .{ .name = "StackCallINTEL", .value = 5627, .parameters = &.{} },
860 .{ .name = "GlobalVariableOffsetINTEL", .value = 5628, .parameters = &.{.literal_integer} },
861 .{ .name = "CounterBuffer", .value = 5634, .parameters = &.{.id_ref} },
862 .{ .name = "UserSemantic", .value = 5635, .parameters = &.{.literal_string} },
863 .{ .name = "UserTypeGOOGLE", .value = 5636, .parameters = &.{.literal_string} },
864 .{ .name = "FunctionRoundingModeINTEL", .value = 5822, .parameters = &.{ .literal_integer, .fp_rounding_mode } },
865 .{ .name = "FunctionDenormModeINTEL", .value = 5823, .parameters = &.{ .literal_integer, .fp_denorm_mode } },
866 .{ .name = "RegisterINTEL", .value = 5825, .parameters = &.{} },
867 .{ .name = "MemoryINTEL", .value = 5826, .parameters = &.{.literal_string} },
868 .{ .name = "NumbanksINTEL", .value = 5827, .parameters = &.{.literal_integer} },
869 .{ .name = "BankwidthINTEL", .value = 5828, .parameters = &.{.literal_integer} },
870 .{ .name = "MaxPrivateCopiesINTEL", .value = 5829, .parameters = &.{.literal_integer} },
871 .{ .name = "SinglepumpINTEL", .value = 5830, .parameters = &.{} },
872 .{ .name = "DoublepumpINTEL", .value = 5831, .parameters = &.{} },
873 .{ .name = "MaxReplicatesINTEL", .value = 5832, .parameters = &.{.literal_integer} },
874 .{ .name = "SimpleDualPortINTEL", .value = 5833, .parameters = &.{} },
875 .{ .name = "MergeINTEL", .value = 5834, .parameters = &.{ .literal_string, .literal_string } },
876 .{ .name = "BankBitsINTEL", .value = 5835, .parameters = &.{.literal_integer} },
877 .{ .name = "ForcePow2DepthINTEL", .value = 5836, .parameters = &.{.literal_integer} },
878 .{ .name = "StridesizeINTEL", .value = 5883, .parameters = &.{.literal_integer} },
879 .{ .name = "WordsizeINTEL", .value = 5884, .parameters = &.{.literal_integer} },
880 .{ .name = "TrueDualPortINTEL", .value = 5885, .parameters = &.{} },
881 .{ .name = "BurstCoalesceINTEL", .value = 5899, .parameters = &.{} },
882 .{ .name = "CacheSizeINTEL", .value = 5900, .parameters = &.{.literal_integer} },
883 .{ .name = "DontStaticallyCoalesceINTEL", .value = 5901, .parameters = &.{} },
884 .{ .name = "PrefetchINTEL", .value = 5902, .parameters = &.{.literal_integer} },
885 .{ .name = "StallEnableINTEL", .value = 5905, .parameters = &.{} },
886 .{ .name = "FuseLoopsInFunctionINTEL", .value = 5907, .parameters = &.{} },
887 .{ .name = "MathOpDSPModeINTEL", .value = 5909, .parameters = &.{ .literal_integer, .literal_integer } },
888 .{ .name = "AliasScopeINTEL", .value = 5914, .parameters = &.{.id_ref} },
889 .{ .name = "NoAliasINTEL", .value = 5915, .parameters = &.{.id_ref} },
890 .{ .name = "InitiationIntervalINTEL", .value = 5917, .parameters = &.{.literal_integer} },
891 .{ .name = "MaxConcurrencyINTEL", .value = 5918, .parameters = &.{.literal_integer} },
892 .{ .name = "PipelineEnableINTEL", .value = 5919, .parameters = &.{.literal_integer} },
893 .{ .name = "BufferLocationINTEL", .value = 5921, .parameters = &.{.literal_integer} },
894 .{ .name = "IOPipeStorageINTEL", .value = 5944, .parameters = &.{.literal_integer} },
895 .{ .name = "FunctionFloatingPointModeINTEL", .value = 6080, .parameters = &.{ .literal_integer, .fp_operation_mode } },
896 .{ .name = "SingleElementVectorINTEL", .value = 6085, .parameters = &.{} },
897 .{ .name = "VectorComputeCallableFunctionINTEL", .value = 6087, .parameters = &.{} },
898 .{ .name = "MediaBlockIOINTEL", .value = 6140, .parameters = &.{} },
899 .{ .name = "StallFreeINTEL", .value = 6151, .parameters = &.{} },
900 .{ .name = "FPMaxErrorDecorationINTEL", .value = 6170, .parameters = &.{.literal_float} },
901 .{ .name = "LatencyControlLabelINTEL", .value = 6172, .parameters = &.{.literal_integer} },
902 .{ .name = "LatencyControlConstraintINTEL", .value = 6173, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
903 .{ .name = "ConduitKernelArgumentINTEL", .value = 6175, .parameters = &.{} },
904 .{ .name = "RegisterMapKernelArgumentINTEL", .value = 6176, .parameters = &.{} },
905 .{ .name = "MMHostInterfaceAddressWidthINTEL", .value = 6177, .parameters = &.{.literal_integer} },
906 .{ .name = "MMHostInterfaceDataWidthINTEL", .value = 6178, .parameters = &.{.literal_integer} },
907 .{ .name = "MMHostInterfaceLatencyINTEL", .value = 6179, .parameters = &.{.literal_integer} },
908 .{ .name = "MMHostInterfaceReadWriteModeINTEL", .value = 6180, .parameters = &.{.access_qualifier} },
909 .{ .name = "MMHostInterfaceMaxBurstINTEL", .value = 6181, .parameters = &.{.literal_integer} },
910 .{ .name = "MMHostInterfaceWaitRequestINTEL", .value = 6182, .parameters = &.{.literal_integer} },
911 .{ .name = "StableKernelArgumentINTEL", .value = 6183, .parameters = &.{} },
912 .{ .name = "HostAccessINTEL", .value = 6188, .parameters = &.{ .host_access_qualifier, .literal_string } },
913 .{ .name = "InitModeINTEL", .value = 6190, .parameters = &.{.initialization_mode_qualifier} },
914 .{ .name = "ImplementInRegisterMapINTEL", .value = 6191, .parameters = &.{.literal_integer} },
915 .{ .name = "CacheControlLoadINTEL", .value = 6442, .parameters = &.{ .literal_integer, .load_cache_control } },
916 .{ .name = "CacheControlStoreINTEL", .value = 6443, .parameters = &.{ .literal_integer, .store_cache_control } },
917 },
918 .built_in => &.{
919 .{ .name = "Position", .value = 0, .parameters = &.{} },
920 .{ .name = "PointSize", .value = 1, .parameters = &.{} },
921 .{ .name = "ClipDistance", .value = 3, .parameters = &.{} },
922 .{ .name = "CullDistance", .value = 4, .parameters = &.{} },
923 .{ .name = "VertexId", .value = 5, .parameters = &.{} },
924 .{ .name = "InstanceId", .value = 6, .parameters = &.{} },
925 .{ .name = "PrimitiveId", .value = 7, .parameters = &.{} },
926 .{ .name = "InvocationId", .value = 8, .parameters = &.{} },
927 .{ .name = "Layer", .value = 9, .parameters = &.{} },
928 .{ .name = "ViewportIndex", .value = 10, .parameters = &.{} },
929 .{ .name = "TessLevelOuter", .value = 11, .parameters = &.{} },
930 .{ .name = "TessLevelInner", .value = 12, .parameters = &.{} },
931 .{ .name = "TessCoord", .value = 13, .parameters = &.{} },
932 .{ .name = "PatchVertices", .value = 14, .parameters = &.{} },
933 .{ .name = "FragCoord", .value = 15, .parameters = &.{} },
934 .{ .name = "PointCoord", .value = 16, .parameters = &.{} },
935 .{ .name = "FrontFacing", .value = 17, .parameters = &.{} },
936 .{ .name = "SampleId", .value = 18, .parameters = &.{} },
937 .{ .name = "SamplePosition", .value = 19, .parameters = &.{} },
938 .{ .name = "SampleMask", .value = 20, .parameters = &.{} },
939 .{ .name = "FragDepth", .value = 22, .parameters = &.{} },
940 .{ .name = "HelperInvocation", .value = 23, .parameters = &.{} },
941 .{ .name = "NumWorkgroups", .value = 24, .parameters = &.{} },
942 .{ .name = "WorkgroupSize", .value = 25, .parameters = &.{} },
943 .{ .name = "WorkgroupId", .value = 26, .parameters = &.{} },
944 .{ .name = "LocalInvocationId", .value = 27, .parameters = &.{} },
945 .{ .name = "GlobalInvocationId", .value = 28, .parameters = &.{} },
946 .{ .name = "LocalInvocationIndex", .value = 29, .parameters = &.{} },
947 .{ .name = "WorkDim", .value = 30, .parameters = &.{} },
948 .{ .name = "GlobalSize", .value = 31, .parameters = &.{} },
949 .{ .name = "EnqueuedWorkgroupSize", .value = 32, .parameters = &.{} },
950 .{ .name = "GlobalOffset", .value = 33, .parameters = &.{} },
951 .{ .name = "GlobalLinearId", .value = 34, .parameters = &.{} },
952 .{ .name = "SubgroupSize", .value = 36, .parameters = &.{} },
953 .{ .name = "SubgroupMaxSize", .value = 37, .parameters = &.{} },
954 .{ .name = "NumSubgroups", .value = 38, .parameters = &.{} },
955 .{ .name = "NumEnqueuedSubgroups", .value = 39, .parameters = &.{} },
956 .{ .name = "SubgroupId", .value = 40, .parameters = &.{} },
957 .{ .name = "SubgroupLocalInvocationId", .value = 41, .parameters = &.{} },
958 .{ .name = "VertexIndex", .value = 42, .parameters = &.{} },
959 .{ .name = "InstanceIndex", .value = 43, .parameters = &.{} },
960 .{ .name = "CoreIDARM", .value = 4160, .parameters = &.{} },
961 .{ .name = "CoreCountARM", .value = 4161, .parameters = &.{} },
962 .{ .name = "CoreMaxIDARM", .value = 4162, .parameters = &.{} },
963 .{ .name = "WarpIDARM", .value = 4163, .parameters = &.{} },
964 .{ .name = "WarpMaxIDARM", .value = 4164, .parameters = &.{} },
965 .{ .name = "SubgroupEqMask", .value = 4416, .parameters = &.{} },
966 .{ .name = "SubgroupGeMask", .value = 4417, .parameters = &.{} },
967 .{ .name = "SubgroupGtMask", .value = 4418, .parameters = &.{} },
968 .{ .name = "SubgroupLeMask", .value = 4419, .parameters = &.{} },
969 .{ .name = "SubgroupLtMask", .value = 4420, .parameters = &.{} },
970 .{ .name = "BaseVertex", .value = 4424, .parameters = &.{} },
971 .{ .name = "BaseInstance", .value = 4425, .parameters = &.{} },
972 .{ .name = "DrawIndex", .value = 4426, .parameters = &.{} },
973 .{ .name = "PrimitiveShadingRateKHR", .value = 4432, .parameters = &.{} },
974 .{ .name = "DeviceIndex", .value = 4438, .parameters = &.{} },
975 .{ .name = "ViewIndex", .value = 4440, .parameters = &.{} },
976 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &.{} },
977 .{ .name = "TileOffsetQCOM", .value = 4492, .parameters = &.{} },
978 .{ .name = "TileDimensionQCOM", .value = 4493, .parameters = &.{} },
979 .{ .name = "TileApronSizeQCOM", .value = 4494, .parameters = &.{} },
980 .{ .name = "BaryCoordNoPerspAMD", .value = 4992, .parameters = &.{} },
981 .{ .name = "BaryCoordNoPerspCentroidAMD", .value = 4993, .parameters = &.{} },
982 .{ .name = "BaryCoordNoPerspSampleAMD", .value = 4994, .parameters = &.{} },
983 .{ .name = "BaryCoordSmoothAMD", .value = 4995, .parameters = &.{} },
984 .{ .name = "BaryCoordSmoothCentroidAMD", .value = 4996, .parameters = &.{} },
985 .{ .name = "BaryCoordSmoothSampleAMD", .value = 4997, .parameters = &.{} },
986 .{ .name = "BaryCoordPullModelAMD", .value = 4998, .parameters = &.{} },
987 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &.{} },
988 .{ .name = "RemainingRecursionLevelsAMDX", .value = 5021, .parameters = &.{} },
989 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{} },
990 .{ .name = "ViewportMaskNV", .value = 5253, .parameters = &.{} },
991 .{ .name = "SecondaryPositionNV", .value = 5257, .parameters = &.{} },
992 .{ .name = "SecondaryViewportMaskNV", .value = 5258, .parameters = &.{} },
993 .{ .name = "PositionPerViewNV", .value = 5261, .parameters = &.{} },
994 .{ .name = "ViewportMaskPerViewNV", .value = 5262, .parameters = &.{} },
995 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &.{} },
996 .{ .name = "TaskCountNV", .value = 5274, .parameters = &.{} },
997 .{ .name = "PrimitiveCountNV", .value = 5275, .parameters = &.{} },
998 .{ .name = "PrimitiveIndicesNV", .value = 5276, .parameters = &.{} },
999 .{ .name = "ClipDistancePerViewNV", .value = 5277, .parameters = &.{} },
1000 .{ .name = "CullDistancePerViewNV", .value = 5278, .parameters = &.{} },
1001 .{ .name = "LayerPerViewNV", .value = 5279, .parameters = &.{} },
1002 .{ .name = "MeshViewCountNV", .value = 5280, .parameters = &.{} },
1003 .{ .name = "MeshViewIndicesNV", .value = 5281, .parameters = &.{} },
1004 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &.{} },
1005 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &.{} },
1006 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &.{} },
1007 .{ .name = "FragInvocationCountEXT", .value = 5293, .parameters = &.{} },
1008 .{ .name = "PrimitivePointIndicesEXT", .value = 5294, .parameters = &.{} },
1009 .{ .name = "PrimitiveLineIndicesEXT", .value = 5295, .parameters = &.{} },
1010 .{ .name = "PrimitiveTriangleIndicesEXT", .value = 5296, .parameters = &.{} },
1011 .{ .name = "CullPrimitiveEXT", .value = 5299, .parameters = &.{} },
1012 .{ .name = "LaunchIdKHR", .value = 5319, .parameters = &.{} },
1013 .{ .name = "LaunchSizeKHR", .value = 5320, .parameters = &.{} },
1014 .{ .name = "WorldRayOriginKHR", .value = 5321, .parameters = &.{} },
1015 .{ .name = "WorldRayDirectionKHR", .value = 5322, .parameters = &.{} },
1016 .{ .name = "ObjectRayOriginKHR", .value = 5323, .parameters = &.{} },
1017 .{ .name = "ObjectRayDirectionKHR", .value = 5324, .parameters = &.{} },
1018 .{ .name = "RayTminKHR", .value = 5325, .parameters = &.{} },
1019 .{ .name = "RayTmaxKHR", .value = 5326, .parameters = &.{} },
1020 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &.{} },
1021 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &.{} },
1022 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &.{} },
1023 .{ .name = "HitTNV", .value = 5332, .parameters = &.{} },
1024 .{ .name = "HitKindKHR", .value = 5333, .parameters = &.{} },
1025 .{ .name = "CurrentRayTimeNV", .value = 5334, .parameters = &.{} },
1026 .{ .name = "HitTriangleVertexPositionsKHR", .value = 5335, .parameters = &.{} },
1027 .{ .name = "HitMicroTriangleVertexPositionsNV", .value = 5337, .parameters = &.{} },
1028 .{ .name = "HitMicroTriangleVertexBarycentricsNV", .value = 5344, .parameters = &.{} },
1029 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &.{} },
1030 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &.{} },
1031 .{ .name = "HitIsSphereNV", .value = 5359, .parameters = &.{} },
1032 .{ .name = "HitIsLSSNV", .value = 5360, .parameters = &.{} },
1033 .{ .name = "HitSpherePositionNV", .value = 5361, .parameters = &.{} },
1034 .{ .name = "WarpsPerSMNV", .value = 5374, .parameters = &.{} },
1035 .{ .name = "SMCountNV", .value = 5375, .parameters = &.{} },
1036 .{ .name = "WarpIDNV", .value = 5376, .parameters = &.{} },
1037 .{ .name = "SMIDNV", .value = 5377, .parameters = &.{} },
1038 .{ .name = "HitLSSPositionsNV", .value = 5396, .parameters = &.{} },
1039 .{ .name = "HitKindFrontFacingMicroTriangleNV", .value = 5405, .parameters = &.{} },
1040 .{ .name = "HitKindBackFacingMicroTriangleNV", .value = 5406, .parameters = &.{} },
1041 .{ .name = "HitSphereRadiusNV", .value = 5420, .parameters = &.{} },
1042 .{ .name = "HitLSSRadiiNV", .value = 5421, .parameters = &.{} },
1043 .{ .name = "ClusterIDNV", .value = 5436, .parameters = &.{} },
1044 .{ .name = "CullMaskKHR", .value = 6021, .parameters = &.{} },
1045 },
1046 .scope => &.{
1047 .{ .name = "CrossDevice", .value = 0, .parameters = &.{} },
1048 .{ .name = "Device", .value = 1, .parameters = &.{} },
1049 .{ .name = "Workgroup", .value = 2, .parameters = &.{} },
1050 .{ .name = "Subgroup", .value = 3, .parameters = &.{} },
1051 .{ .name = "Invocation", .value = 4, .parameters = &.{} },
1052 .{ .name = "QueueFamily", .value = 5, .parameters = &.{} },
1053 .{ .name = "ShaderCallKHR", .value = 6, .parameters = &.{} },
1054 },
1055 .group_operation => &.{
1056 .{ .name = "Reduce", .value = 0, .parameters = &.{} },
1057 .{ .name = "InclusiveScan", .value = 1, .parameters = &.{} },
1058 .{ .name = "ExclusiveScan", .value = 2, .parameters = &.{} },
1059 .{ .name = "ClusteredReduce", .value = 3, .parameters = &.{} },
1060 .{ .name = "PartitionedReduceNV", .value = 6, .parameters = &.{} },
1061 .{ .name = "PartitionedInclusiveScanNV", .value = 7, .parameters = &.{} },
1062 .{ .name = "PartitionedExclusiveScanNV", .value = 8, .parameters = &.{} },
1063 },
1064 .kernel_enqueue_flags => &.{
1065 .{ .name = "NoWait", .value = 0, .parameters = &.{} },
1066 .{ .name = "WaitKernel", .value = 1, .parameters = &.{} },
1067 .{ .name = "WaitWorkGroup", .value = 2, .parameters = &.{} },
1068 },
1069 .capability => &.{
1070 .{ .name = "Matrix", .value = 0, .parameters = &.{} },
1071 .{ .name = "Shader", .value = 1, .parameters = &.{} },
1072 .{ .name = "Geometry", .value = 2, .parameters = &.{} },
1073 .{ .name = "Tessellation", .value = 3, .parameters = &.{} },
1074 .{ .name = "Addresses", .value = 4, .parameters = &.{} },
1075 .{ .name = "Linkage", .value = 5, .parameters = &.{} },
1076 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
1077 .{ .name = "Vector16", .value = 7, .parameters = &.{} },
1078 .{ .name = "Float16Buffer", .value = 8, .parameters = &.{} },
1079 .{ .name = "Float16", .value = 9, .parameters = &.{} },
1080 .{ .name = "Float64", .value = 10, .parameters = &.{} },
1081 .{ .name = "Int64", .value = 11, .parameters = &.{} },
1082 .{ .name = "Int64Atomics", .value = 12, .parameters = &.{} },
1083 .{ .name = "ImageBasic", .value = 13, .parameters = &.{} },
1084 .{ .name = "ImageReadWrite", .value = 14, .parameters = &.{} },
1085 .{ .name = "ImageMipmap", .value = 15, .parameters = &.{} },
1086 .{ .name = "Pipes", .value = 17, .parameters = &.{} },
1087 .{ .name = "Groups", .value = 18, .parameters = &.{} },
1088 .{ .name = "DeviceEnqueue", .value = 19, .parameters = &.{} },
1089 .{ .name = "LiteralSampler", .value = 20, .parameters = &.{} },
1090 .{ .name = "AtomicStorage", .value = 21, .parameters = &.{} },
1091 .{ .name = "Int16", .value = 22, .parameters = &.{} },
1092 .{ .name = "TessellationPointSize", .value = 23, .parameters = &.{} },
1093 .{ .name = "GeometryPointSize", .value = 24, .parameters = &.{} },
1094 .{ .name = "ImageGatherExtended", .value = 25, .parameters = &.{} },
1095 .{ .name = "StorageImageMultisample", .value = 27, .parameters = &.{} },
1096 .{ .name = "UniformBufferArrayDynamicIndexing", .value = 28, .parameters = &.{} },
1097 .{ .name = "SampledImageArrayDynamicIndexing", .value = 29, .parameters = &.{} },
1098 .{ .name = "StorageBufferArrayDynamicIndexing", .value = 30, .parameters = &.{} },
1099 .{ .name = "StorageImageArrayDynamicIndexing", .value = 31, .parameters = &.{} },
1100 .{ .name = "ClipDistance", .value = 32, .parameters = &.{} },
1101 .{ .name = "CullDistance", .value = 33, .parameters = &.{} },
1102 .{ .name = "ImageCubeArray", .value = 34, .parameters = &.{} },
1103 .{ .name = "SampleRateShading", .value = 35, .parameters = &.{} },
1104 .{ .name = "ImageRect", .value = 36, .parameters = &.{} },
1105 .{ .name = "SampledRect", .value = 37, .parameters = &.{} },
1106 .{ .name = "GenericPointer", .value = 38, .parameters = &.{} },
1107 .{ .name = "Int8", .value = 39, .parameters = &.{} },
1108 .{ .name = "InputAttachment", .value = 40, .parameters = &.{} },
1109 .{ .name = "SparseResidency", .value = 41, .parameters = &.{} },
1110 .{ .name = "MinLod", .value = 42, .parameters = &.{} },
1111 .{ .name = "Sampled1D", .value = 43, .parameters = &.{} },
1112 .{ .name = "Image1D", .value = 44, .parameters = &.{} },
1113 .{ .name = "SampledCubeArray", .value = 45, .parameters = &.{} },
1114 .{ .name = "SampledBuffer", .value = 46, .parameters = &.{} },
1115 .{ .name = "ImageBuffer", .value = 47, .parameters = &.{} },
1116 .{ .name = "ImageMSArray", .value = 48, .parameters = &.{} },
1117 .{ .name = "StorageImageExtendedFormats", .value = 49, .parameters = &.{} },
1118 .{ .name = "ImageQuery", .value = 50, .parameters = &.{} },
1119 .{ .name = "DerivativeControl", .value = 51, .parameters = &.{} },
1120 .{ .name = "InterpolationFunction", .value = 52, .parameters = &.{} },
1121 .{ .name = "TransformFeedback", .value = 53, .parameters = &.{} },
1122 .{ .name = "GeometryStreams", .value = 54, .parameters = &.{} },
1123 .{ .name = "StorageImageReadWithoutFormat", .value = 55, .parameters = &.{} },
1124 .{ .name = "StorageImageWriteWithoutFormat", .value = 56, .parameters = &.{} },
1125 .{ .name = "MultiViewport", .value = 57, .parameters = &.{} },
1126 .{ .name = "SubgroupDispatch", .value = 58, .parameters = &.{} },
1127 .{ .name = "NamedBarrier", .value = 59, .parameters = &.{} },
1128 .{ .name = "PipeStorage", .value = 60, .parameters = &.{} },
1129 .{ .name = "GroupNonUniform", .value = 61, .parameters = &.{} },
1130 .{ .name = "GroupNonUniformVote", .value = 62, .parameters = &.{} },
1131 .{ .name = "GroupNonUniformArithmetic", .value = 63, .parameters = &.{} },
1132 .{ .name = "GroupNonUniformBallot", .value = 64, .parameters = &.{} },
1133 .{ .name = "GroupNonUniformShuffle", .value = 65, .parameters = &.{} },
1134 .{ .name = "GroupNonUniformShuffleRelative", .value = 66, .parameters = &.{} },
1135 .{ .name = "GroupNonUniformClustered", .value = 67, .parameters = &.{} },
1136 .{ .name = "GroupNonUniformQuad", .value = 68, .parameters = &.{} },
1137 .{ .name = "ShaderLayer", .value = 69, .parameters = &.{} },
1138 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &.{} },
1139 .{ .name = "UniformDecoration", .value = 71, .parameters = &.{} },
1140 .{ .name = "CoreBuiltinsARM", .value = 4165, .parameters = &.{} },
1141 .{ .name = "TileImageColorReadAccessEXT", .value = 4166, .parameters = &.{} },
1142 .{ .name = "TileImageDepthReadAccessEXT", .value = 4167, .parameters = &.{} },
1143 .{ .name = "TileImageStencilReadAccessEXT", .value = 4168, .parameters = &.{} },
1144 .{ .name = "TensorsARM", .value = 4174, .parameters = &.{} },
1145 .{ .name = "StorageTensorArrayDynamicIndexingARM", .value = 4175, .parameters = &.{} },
1146 .{ .name = "StorageTensorArrayNonUniformIndexingARM", .value = 4176, .parameters = &.{} },
1147 .{ .name = "GraphARM", .value = 4191, .parameters = &.{} },
1148 .{ .name = "CooperativeMatrixLayoutsARM", .value = 4201, .parameters = &.{} },
1149 .{ .name = "Float8EXT", .value = 4212, .parameters = &.{} },
1150 .{ .name = "Float8CooperativeMatrixEXT", .value = 4213, .parameters = &.{} },
1151 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &.{} },
1152 .{ .name = "SubgroupBallotKHR", .value = 4423, .parameters = &.{} },
1153 .{ .name = "DrawParameters", .value = 4427, .parameters = &.{} },
1154 .{ .name = "WorkgroupMemoryExplicitLayoutKHR", .value = 4428, .parameters = &.{} },
1155 .{ .name = "WorkgroupMemoryExplicitLayout8BitAccessKHR", .value = 4429, .parameters = &.{} },
1156 .{ .name = "WorkgroupMemoryExplicitLayout16BitAccessKHR", .value = 4430, .parameters = &.{} },
1157 .{ .name = "SubgroupVoteKHR", .value = 4431, .parameters = &.{} },
1158 .{ .name = "StorageBuffer16BitAccess", .value = 4433, .parameters = &.{} },
1159 .{ .name = "UniformAndStorageBuffer16BitAccess", .value = 4434, .parameters = &.{} },
1160 .{ .name = "StoragePushConstant16", .value = 4435, .parameters = &.{} },
1161 .{ .name = "StorageInputOutput16", .value = 4436, .parameters = &.{} },
1162 .{ .name = "DeviceGroup", .value = 4437, .parameters = &.{} },
1163 .{ .name = "MultiView", .value = 4439, .parameters = &.{} },
1164 .{ .name = "VariablePointersStorageBuffer", .value = 4441, .parameters = &.{} },
1165 .{ .name = "VariablePointers", .value = 4442, .parameters = &.{} },
1166 .{ .name = "AtomicStorageOps", .value = 4445, .parameters = &.{} },
1167 .{ .name = "SampleMaskPostDepthCoverage", .value = 4447, .parameters = &.{} },
1168 .{ .name = "StorageBuffer8BitAccess", .value = 4448, .parameters = &.{} },
1169 .{ .name = "UniformAndStorageBuffer8BitAccess", .value = 4449, .parameters = &.{} },
1170 .{ .name = "StoragePushConstant8", .value = 4450, .parameters = &.{} },
1171 .{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },
1172 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },
1173 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },
1174 .{ .name = "RoundingModeRTE", .value = 4467, .parameters = &.{} },
1175 .{ .name = "RoundingModeRTZ", .value = 4468, .parameters = &.{} },
1176 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },
1177 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },
1178 .{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },
1179 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },
1180 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &.{} },
1181 .{ .name = "TextureSampleWeightedQCOM", .value = 4484, .parameters = &.{} },
1182 .{ .name = "TextureBoxFilterQCOM", .value = 4485, .parameters = &.{} },
1183 .{ .name = "TextureBlockMatchQCOM", .value = 4486, .parameters = &.{} },
1184 .{ .name = "TileShadingQCOM", .value = 4495, .parameters = &.{} },
1185 .{ .name = "TextureBlockMatch2QCOM", .value = 4498, .parameters = &.{} },
1186 .{ .name = "Float16ImageAMD", .value = 5008, .parameters = &.{} },
1187 .{ .name = "ImageGatherBiasLodAMD", .value = 5009, .parameters = &.{} },
1188 .{ .name = "FragmentMaskAMD", .value = 5010, .parameters = &.{} },
1189 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &.{} },
1190 .{ .name = "ImageReadWriteLodAMD", .value = 5015, .parameters = &.{} },
1191 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &.{} },
1192 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &.{} },
1193 .{ .name = "ShaderEnqueueAMDX", .value = 5067, .parameters = &.{} },
1194 .{ .name = "QuadControlKHR", .value = 5087, .parameters = &.{} },
1195 .{ .name = "Int4TypeINTEL", .value = 5112, .parameters = &.{} },
1196 .{ .name = "Int4CooperativeMatrixINTEL", .value = 5114, .parameters = &.{} },
1197 .{ .name = "BFloat16TypeKHR", .value = 5116, .parameters = &.{} },
1198 .{ .name = "BFloat16DotProductKHR", .value = 5117, .parameters = &.{} },
1199 .{ .name = "BFloat16CooperativeMatrixKHR", .value = 5118, .parameters = &.{} },
1200 .{ .name = "SampleMaskOverrideCoverageNV", .value = 5249, .parameters = &.{} },
1201 .{ .name = "GeometryShaderPassthroughNV", .value = 5251, .parameters = &.{} },
1202 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },
1203 .{ .name = "ShaderViewportMaskNV", .value = 5255, .parameters = &.{} },
1204 .{ .name = "ShaderStereoViewNV", .value = 5259, .parameters = &.{} },
1205 .{ .name = "PerViewAttributesNV", .value = 5260, .parameters = &.{} },
1206 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },
1207 .{ .name = "MeshShadingNV", .value = 5266, .parameters = &.{} },
1208 .{ .name = "ImageFootprintNV", .value = 5282, .parameters = &.{} },
1209 .{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },
1210 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &.{} },
1211 .{ .name = "ComputeDerivativeGroupQuadsKHR", .value = 5288, .parameters = &.{} },
1212 .{ .name = "FragmentDensityEXT", .value = 5291, .parameters = &.{} },
1213 .{ .name = "GroupNonUniformPartitionedNV", .value = 5297, .parameters = &.{} },
1214 .{ .name = "ShaderNonUniform", .value = 5301, .parameters = &.{} },
1215 .{ .name = "RuntimeDescriptorArray", .value = 5302, .parameters = &.{} },
1216 .{ .name = "InputAttachmentArrayDynamicIndexing", .value = 5303, .parameters = &.{} },
1217 .{ .name = "UniformTexelBufferArrayDynamicIndexing", .value = 5304, .parameters = &.{} },
1218 .{ .name = "StorageTexelBufferArrayDynamicIndexing", .value = 5305, .parameters = &.{} },
1219 .{ .name = "UniformBufferArrayNonUniformIndexing", .value = 5306, .parameters = &.{} },
1220 .{ .name = "SampledImageArrayNonUniformIndexing", .value = 5307, .parameters = &.{} },
1221 .{ .name = "StorageBufferArrayNonUniformIndexing", .value = 5308, .parameters = &.{} },
1222 .{ .name = "StorageImageArrayNonUniformIndexing", .value = 5309, .parameters = &.{} },
1223 .{ .name = "InputAttachmentArrayNonUniformIndexing", .value = 5310, .parameters = &.{} },
1224 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &.{} },
1225 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &.{} },
1226 .{ .name = "RayTracingPositionFetchKHR", .value = 5336, .parameters = &.{} },
1227 .{ .name = "RayTracingNV", .value = 5340, .parameters = &.{} },
1228 .{ .name = "RayTracingMotionBlurNV", .value = 5341, .parameters = &.{} },
1229 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &.{} },
1230 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },
1231 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },
1232 .{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },
1233 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },
1234 .{ .name = "CooperativeMatrixNV", .value = 5357, .parameters = &.{} },
1235 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },
1236 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },
1237 .{ .name = "ShaderSMBuiltinsNV", .value = 5373, .parameters = &.{} },
1238 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },
1239 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &.{} },
1240 .{ .name = "DisplacementMicromapNV", .value = 5380, .parameters = &.{} },
1241 .{ .name = "RayTracingOpacityMicromapEXT", .value = 5381, .parameters = &.{} },
1242 .{ .name = "ShaderInvocationReorderNV", .value = 5383, .parameters = &.{} },
1243 .{ .name = "BindlessTextureNV", .value = 5390, .parameters = &.{} },
1244 .{ .name = "RayQueryPositionFetchKHR", .value = 5391, .parameters = &.{} },
1245 .{ .name = "CooperativeVectorNV", .value = 5394, .parameters = &.{} },
1246 .{ .name = "AtomicFloat16VectorNV", .value = 5404, .parameters = &.{} },
1247 .{ .name = "RayTracingDisplacementMicromapNV", .value = 5409, .parameters = &.{} },
1248 .{ .name = "RawAccessChainsNV", .value = 5414, .parameters = &.{} },
1249 .{ .name = "RayTracingSpheresGeometryNV", .value = 5418, .parameters = &.{} },
1250 .{ .name = "RayTracingLinearSweptSpheresGeometryNV", .value = 5419, .parameters = &.{} },
1251 .{ .name = "CooperativeMatrixReductionsNV", .value = 5430, .parameters = &.{} },
1252 .{ .name = "CooperativeMatrixConversionsNV", .value = 5431, .parameters = &.{} },
1253 .{ .name = "CooperativeMatrixPerElementOperationsNV", .value = 5432, .parameters = &.{} },
1254 .{ .name = "CooperativeMatrixTensorAddressingNV", .value = 5433, .parameters = &.{} },
1255 .{ .name = "CooperativeMatrixBlockLoadsNV", .value = 5434, .parameters = &.{} },
1256 .{ .name = "CooperativeVectorTrainingNV", .value = 5435, .parameters = &.{} },
1257 .{ .name = "RayTracingClusterAccelerationStructureNV", .value = 5437, .parameters = &.{} },
1258 .{ .name = "TensorAddressingNV", .value = 5439, .parameters = &.{} },
1259 .{ .name = "SubgroupShuffleINTEL", .value = 5568, .parameters = &.{} },
1260 .{ .name = "SubgroupBufferBlockIOINTEL", .value = 5569, .parameters = &.{} },
1261 .{ .name = "SubgroupImageBlockIOINTEL", .value = 5570, .parameters = &.{} },
1262 .{ .name = "SubgroupImageMediaBlockIOINTEL", .value = 5579, .parameters = &.{} },
1263 .{ .name = "RoundToInfinityINTEL", .value = 5582, .parameters = &.{} },
1264 .{ .name = "FloatingPointModeINTEL", .value = 5583, .parameters = &.{} },
1265 .{ .name = "IntegerFunctions2INTEL", .value = 5584, .parameters = &.{} },
1266 .{ .name = "FunctionPointersINTEL", .value = 5603, .parameters = &.{} },
1267 .{ .name = "IndirectReferencesINTEL", .value = 5604, .parameters = &.{} },
1268 .{ .name = "AsmINTEL", .value = 5606, .parameters = &.{} },
1269 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &.{} },
1270 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &.{} },
1271 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &.{} },
1272 .{ .name = "VectorComputeINTEL", .value = 5617, .parameters = &.{} },
1273 .{ .name = "VectorAnyINTEL", .value = 5619, .parameters = &.{} },
1274 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &.{} },
1275 .{ .name = "SubgroupAvcMotionEstimationINTEL", .value = 5696, .parameters = &.{} },
1276 .{ .name = "SubgroupAvcMotionEstimationIntraINTEL", .value = 5697, .parameters = &.{} },
1277 .{ .name = "SubgroupAvcMotionEstimationChromaINTEL", .value = 5698, .parameters = &.{} },
1278 .{ .name = "VariableLengthArrayINTEL", .value = 5817, .parameters = &.{} },
1279 .{ .name = "FunctionFloatControlINTEL", .value = 5821, .parameters = &.{} },
1280 .{ .name = "FPGAMemoryAttributesINTEL", .value = 5824, .parameters = &.{} },
1281 .{ .name = "FPFastMathModeINTEL", .value = 5837, .parameters = &.{} },
1282 .{ .name = "ArbitraryPrecisionIntegersINTEL", .value = 5844, .parameters = &.{} },
1283 .{ .name = "ArbitraryPrecisionFloatingPointINTEL", .value = 5845, .parameters = &.{} },
1284 .{ .name = "UnstructuredLoopControlsINTEL", .value = 5886, .parameters = &.{} },
1285 .{ .name = "FPGALoopControlsINTEL", .value = 5888, .parameters = &.{} },
1286 .{ .name = "KernelAttributesINTEL", .value = 5892, .parameters = &.{} },
1287 .{ .name = "FPGAKernelAttributesINTEL", .value = 5897, .parameters = &.{} },
1288 .{ .name = "FPGAMemoryAccessesINTEL", .value = 5898, .parameters = &.{} },
1289 .{ .name = "FPGAClusterAttributesINTEL", .value = 5904, .parameters = &.{} },
1290 .{ .name = "LoopFuseINTEL", .value = 5906, .parameters = &.{} },
1291 .{ .name = "FPGADSPControlINTEL", .value = 5908, .parameters = &.{} },
1292 .{ .name = "MemoryAccessAliasingINTEL", .value = 5910, .parameters = &.{} },
1293 .{ .name = "FPGAInvocationPipeliningAttributesINTEL", .value = 5916, .parameters = &.{} },
1294 .{ .name = "FPGABufferLocationINTEL", .value = 5920, .parameters = &.{} },
1295 .{ .name = "ArbitraryPrecisionFixedPointINTEL", .value = 5922, .parameters = &.{} },
1296 .{ .name = "USMStorageClassesINTEL", .value = 5935, .parameters = &.{} },
1297 .{ .name = "RuntimeAlignedAttributeINTEL", .value = 5939, .parameters = &.{} },
1298 .{ .name = "IOPipesINTEL", .value = 5943, .parameters = &.{} },
1299 .{ .name = "BlockingPipesINTEL", .value = 5945, .parameters = &.{} },
1300 .{ .name = "FPGARegINTEL", .value = 5948, .parameters = &.{} },
1301 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &.{} },
1302 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &.{} },
1303 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &.{} },
1304 .{ .name = "DotProduct", .value = 6019, .parameters = &.{} },
1305 .{ .name = "RayCullMaskKHR", .value = 6020, .parameters = &.{} },
1306 .{ .name = "CooperativeMatrixKHR", .value = 6022, .parameters = &.{} },
1307 .{ .name = "ReplicatedCompositesEXT", .value = 6024, .parameters = &.{} },
1308 .{ .name = "BitInstructions", .value = 6025, .parameters = &.{} },
1309 .{ .name = "GroupNonUniformRotateKHR", .value = 6026, .parameters = &.{} },
1310 .{ .name = "FloatControls2", .value = 6029, .parameters = &.{} },
1311 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &.{} },
1312 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &.{} },
1313 .{ .name = "LongCompositesINTEL", .value = 6089, .parameters = &.{} },
1314 .{ .name = "OptNoneEXT", .value = 6094, .parameters = &.{} },
1315 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &.{} },
1316 .{ .name = "DebugInfoModuleINTEL", .value = 6114, .parameters = &.{} },
1317 .{ .name = "BFloat16ConversionINTEL", .value = 6115, .parameters = &.{} },
1318 .{ .name = "SplitBarrierINTEL", .value = 6141, .parameters = &.{} },
1319 .{ .name = "ArithmeticFenceEXT", .value = 6144, .parameters = &.{} },
1320 .{ .name = "FPGAClusterAttributesV2INTEL", .value = 6150, .parameters = &.{} },
1321 .{ .name = "FPGAKernelAttributesv2INTEL", .value = 6161, .parameters = &.{} },
1322 .{ .name = "TaskSequenceINTEL", .value = 6162, .parameters = &.{} },
1323 .{ .name = "FPMaxErrorINTEL", .value = 6169, .parameters = &.{} },
1324 .{ .name = "FPGALatencyControlINTEL", .value = 6171, .parameters = &.{} },
1325 .{ .name = "FPGAArgumentInterfacesINTEL", .value = 6174, .parameters = &.{} },
1326 .{ .name = "GlobalVariableHostAccessINTEL", .value = 6187, .parameters = &.{} },
1327 .{ .name = "GlobalVariableFPGADecorationsINTEL", .value = 6189, .parameters = &.{} },
1328 .{ .name = "SubgroupBufferPrefetchINTEL", .value = 6220, .parameters = &.{} },
1329 .{ .name = "Subgroup2DBlockIOINTEL", .value = 6228, .parameters = &.{} },
1330 .{ .name = "Subgroup2DBlockTransformINTEL", .value = 6229, .parameters = &.{} },
1331 .{ .name = "Subgroup2DBlockTransposeINTEL", .value = 6230, .parameters = &.{} },
1332 .{ .name = "SubgroupMatrixMultiplyAccumulateINTEL", .value = 6236, .parameters = &.{} },
1333 .{ .name = "TernaryBitwiseFunctionINTEL", .value = 6241, .parameters = &.{} },
1334 .{ .name = "GroupUniformArithmeticKHR", .value = 6400, .parameters = &.{} },
1335 .{ .name = "TensorFloat32RoundingINTEL", .value = 6425, .parameters = &.{} },
1336 .{ .name = "MaskedGatherScatterINTEL", .value = 6427, .parameters = &.{} },
1337 .{ .name = "CacheControlsINTEL", .value = 6441, .parameters = &.{} },
1338 .{ .name = "RegisterLimitsINTEL", .value = 6460, .parameters = &.{} },
1339 .{ .name = "BindlessImagesINTEL", .value = 6528, .parameters = &.{} },
1340 },
1341 .ray_query_intersection => &.{
1342 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &.{} },
1343 .{ .name = "RayQueryCommittedIntersectionKHR", .value = 1, .parameters = &.{} },
1344 },
1345 .ray_query_committed_intersection_type => &.{
1346 .{ .name = "RayQueryCommittedIntersectionNoneKHR", .value = 0, .parameters = &.{} },
1347 .{ .name = "RayQueryCommittedIntersectionTriangleKHR", .value = 1, .parameters = &.{} },
1348 .{ .name = "RayQueryCommittedIntersectionGeneratedKHR", .value = 2, .parameters = &.{} },
1349 },
1350 .ray_query_candidate_intersection_type => &.{
1351 .{ .name = "RayQueryCandidateIntersectionTriangleKHR", .value = 0, .parameters = &.{} },
1352 .{ .name = "RayQueryCandidateIntersectionAABBKHR", .value = 1, .parameters = &.{} },
1353 },
1354 .packed_vector_format => &.{
1355 .{ .name = "PackedVectorFormat4x8Bit", .value = 0, .parameters = &.{} },
1356 },
1357 .cooperative_matrix_operands => &.{
1358 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
1359 .{ .name = "MatrixASignedComponentsKHR", .value = 0x0001, .parameters = &.{} },
1360 .{ .name = "MatrixBSignedComponentsKHR", .value = 0x0002, .parameters = &.{} },
1361 .{ .name = "MatrixCSignedComponentsKHR", .value = 0x0004, .parameters = &.{} },
1362 .{ .name = "MatrixResultSignedComponentsKHR", .value = 0x0008, .parameters = &.{} },
1363 .{ .name = "SaturatingAccumulationKHR", .value = 0x0010, .parameters = &.{} },
1364 },
1365 .cooperative_matrix_layout => &.{
1366 .{ .name = "RowMajorKHR", .value = 0, .parameters = &.{} },
1367 .{ .name = "ColumnMajorKHR", .value = 1, .parameters = &.{} },
1368 .{ .name = "RowBlockedInterleavedARM", .value = 4202, .parameters = &.{} },
1369 .{ .name = "ColumnBlockedInterleavedARM", .value = 4203, .parameters = &.{} },
1370 },
1371 .cooperative_matrix_use => &.{
1372 .{ .name = "MatrixAKHR", .value = 0, .parameters = &.{} },
1373 .{ .name = "MatrixBKHR", .value = 1, .parameters = &.{} },
1374 .{ .name = "MatrixAccumulatorKHR", .value = 2, .parameters = &.{} },
1375 },
1376 .cooperative_matrix_reduce => &.{
1377 .{ .name = "Row", .value = 0x0001, .parameters = &.{} },
1378 .{ .name = "Column", .value = 0x0002, .parameters = &.{} },
1379 .{ .name = "2x2", .value = 0x0004, .parameters = &.{} },
1380 },
1381 .tensor_clamp_mode => &.{
1382 .{ .name = "Undefined", .value = 0, .parameters = &.{} },
1383 .{ .name = "Constant", .value = 1, .parameters = &.{} },
1384 .{ .name = "ClampToEdge", .value = 2, .parameters = &.{} },
1385 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
1386 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
1387 },
1388 .tensor_addressing_operands => &.{
1389 .{ .name = "TensorView", .value = 0x0001, .parameters = &.{.id_ref} },
1390 .{ .name = "DecodeFunc", .value = 0x0002, .parameters = &.{.id_ref} },
1391 },
1392 .initialization_mode_qualifier => &.{
1393 .{ .name = "InitOnDeviceReprogramINTEL", .value = 0, .parameters = &.{} },
1394 .{ .name = "InitOnDeviceResetINTEL", .value = 1, .parameters = &.{} },
1395 },
1396 .load_cache_control => &.{
1397 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1398 .{ .name = "CachedINTEL", .value = 1, .parameters = &.{} },
1399 .{ .name = "StreamingINTEL", .value = 2, .parameters = &.{} },
1400 .{ .name = "InvalidateAfterReadINTEL", .value = 3, .parameters = &.{} },
1401 .{ .name = "ConstCachedINTEL", .value = 4, .parameters = &.{} },
1402 },
1403 .store_cache_control => &.{
1404 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1405 .{ .name = "WriteThroughINTEL", .value = 1, .parameters = &.{} },
1406 .{ .name = "WriteBackINTEL", .value = 2, .parameters = &.{} },
1407 .{ .name = "StreamingINTEL", .value = 3, .parameters = &.{} },
1408 },
1409 .named_maximum_number_of_registers => &.{
1410 .{ .name = "AutoINTEL", .value = 0, .parameters = &.{} },
1411 },
1412 .matrix_multiply_accumulate_operands => &.{
1413 .{ .name = "MatrixASignedComponentsINTEL", .value = 0x1, .parameters = &.{} },
1414 .{ .name = "MatrixBSignedComponentsINTEL", .value = 0x2, .parameters = &.{} },
1415 .{ .name = "MatrixCBFloat16INTEL", .value = 0x4, .parameters = &.{} },
1416 .{ .name = "MatrixResultBFloat16INTEL", .value = 0x8, .parameters = &.{} },
1417 .{ .name = "MatrixAPackedInt8INTEL", .value = 0x10, .parameters = &.{} },
1418 .{ .name = "MatrixBPackedInt8INTEL", .value = 0x20, .parameters = &.{} },
1419 .{ .name = "MatrixAPackedInt4INTEL", .value = 0x40, .parameters = &.{} },
1420 .{ .name = "MatrixBPackedInt4INTEL", .value = 0x80, .parameters = &.{} },
1421 .{ .name = "MatrixATF32INTEL", .value = 0x100, .parameters = &.{} },
1422 .{ .name = "MatrixBTF32INTEL", .value = 0x200, .parameters = &.{} },
1423 .{ .name = "MatrixAPackedFloat16INTEL", .value = 0x400, .parameters = &.{} },
1424 .{ .name = "MatrixBPackedFloat16INTEL", .value = 0x800, .parameters = &.{} },
1425 .{ .name = "MatrixAPackedBFloat16INTEL", .value = 0x1000, .parameters = &.{} },
1426 .{ .name = "MatrixBPackedBFloat16INTEL", .value = 0x2000, .parameters = &.{} },
1427 },
1428 .fp_encoding => &.{
1429 .{ .name = "BFloat16KHR", .value = 0, .parameters = &.{} },
1430 .{ .name = "Float8E4M3EXT", .value = 4214, .parameters = &.{} },
1431 .{ .name = "Float8E5M2EXT", .value = 4215, .parameters = &.{} },
1432 },
1433 .cooperative_vector_matrix_layout => &.{
1434 .{ .name = "RowMajorNV", .value = 0, .parameters = &.{} },
1435 .{ .name = "ColumnMajorNV", .value = 1, .parameters = &.{} },
1436 .{ .name = "InferencingOptimalNV", .value = 2, .parameters = &.{} },
1437 .{ .name = "TrainingOptimalNV", .value = 3, .parameters = &.{} },
1438 },
1439 .component_type => &.{
1440 .{ .name = "Float16NV", .value = 0, .parameters = &.{} },
1441 .{ .name = "Float32NV", .value = 1, .parameters = &.{} },
1442 .{ .name = "Float64NV", .value = 2, .parameters = &.{} },
1443 .{ .name = "SignedInt8NV", .value = 3, .parameters = &.{} },
1444 .{ .name = "SignedInt16NV", .value = 4, .parameters = &.{} },
1445 .{ .name = "SignedInt32NV", .value = 5, .parameters = &.{} },
1446 .{ .name = "SignedInt64NV", .value = 6, .parameters = &.{} },
1447 .{ .name = "UnsignedInt8NV", .value = 7, .parameters = &.{} },
1448 .{ .name = "UnsignedInt16NV", .value = 8, .parameters = &.{} },
1449 .{ .name = "UnsignedInt32NV", .value = 9, .parameters = &.{} },
1450 .{ .name = "UnsignedInt64NV", .value = 10, .parameters = &.{} },
1451 .{ .name = "SignedInt8PackedNV", .value = 1000491000, .parameters = &.{} },
1452 .{ .name = "UnsignedInt8PackedNV", .value = 1000491001, .parameters = &.{} },
1453 .{ .name = "FloatE4M3NV", .value = 1000491002, .parameters = &.{} },
1454 .{ .name = "FloatE5M2NV", .value = 1000491003, .parameters = &.{} },
1455 },
1456 .id_result_type => unreachable,
1457 .id_result => unreachable,
1458 .id_memory_semantics => unreachable,
1459 .id_scope => unreachable,
1460 .id_ref => unreachable,
1461 .literal_integer => unreachable,
1462 .literal_string => unreachable,
1463 .literal_float => unreachable,
1464 .literal_context_dependent_number => unreachable,
1465 .literal_ext_inst_integer => unreachable,
1466 .literal_spec_constant_op_integer => unreachable,
1467 .pair_literal_integer_id_ref => unreachable,
1468 .pair_id_ref_literal_integer => unreachable,
1469 .pair_id_ref_id_ref => unreachable,
1470 .tensor_operands => &.{
1471 .{ .name = "NoneARM", .value = 0x0000, .parameters = &.{} },
1472 .{ .name = "NontemporalARM", .value = 0x0001, .parameters = &.{} },
1473 .{ .name = "OutOfBoundsValueARM", .value = 0x0002, .parameters = &.{.id_ref} },
1474 .{ .name = "MakeElementAvailableARM", .value = 0x0004, .parameters = &.{.id_ref} },
1475 .{ .name = "MakeElementVisibleARM", .value = 0x0008, .parameters = &.{.id_ref} },
1476 .{ .name = "NonPrivateElementARM", .value = 0x0010, .parameters = &.{} },
1477 },
1478 .debug_info_debug_info_flags => &.{
1479 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1480 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1481 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1482 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1483 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1484 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1485 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1486 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1487 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1488 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1489 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1490 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1491 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1492 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1493 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1494 },
1495 .debug_info_debug_base_type_attribute_encoding => &.{
1496 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1497 .{ .name = "Address", .value = 1, .parameters = &.{} },
1498 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1499 .{ .name = "Float", .value = 4, .parameters = &.{} },
1500 .{ .name = "Signed", .value = 5, .parameters = &.{} },
1501 .{ .name = "SignedChar", .value = 6, .parameters = &.{} },
1502 .{ .name = "Unsigned", .value = 7, .parameters = &.{} },
1503 .{ .name = "UnsignedChar", .value = 8, .parameters = &.{} },
1504 },
1505 .debug_info_debug_composite_type => &.{
1506 .{ .name = "Class", .value = 0, .parameters = &.{} },
1507 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1508 .{ .name = "Union", .value = 2, .parameters = &.{} },
1509 },
1510 .debug_info_debug_type_qualifier => &.{
1511 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1512 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1513 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1514 },
1515 .debug_info_debug_operation => &.{
1516 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1517 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1518 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1519 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1520 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1521 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1522 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1523 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1524 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1525 },
1526 .open_cl_debug_info_100_debug_info_flags => &.{
1527 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1528 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1529 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1530 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1531 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1532 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1533 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1534 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1535 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1536 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1537 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1538 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1539 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1540 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1541 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1542 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1543 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1544 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1545 },
1546 .open_cl_debug_info_100_debug_base_type_attribute_encoding => &.{
1547 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1548 .{ .name = "Address", .value = 1, .parameters = &.{} },
1549 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1550 .{ .name = "Float", .value = 3, .parameters = &.{} },
1551 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1552 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1553 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1554 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1555 },
1556 .open_cl_debug_info_100_debug_composite_type => &.{
1557 .{ .name = "Class", .value = 0, .parameters = &.{} },
1558 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1559 .{ .name = "Union", .value = 2, .parameters = &.{} },
1560 },
1561 .open_cl_debug_info_100_debug_type_qualifier => &.{
1562 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1563 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1564 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1565 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1566 },
1567 .open_cl_debug_info_100_debug_operation => &.{
1568 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1569 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1570 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1571 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1572 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1573 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1574 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1575 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1576 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1577 .{ .name = "Fragment", .value = 9, .parameters = &.{ .literal_integer, .literal_integer } },
1578 },
1579 .open_cl_debug_info_100_debug_imported_entity => &.{
1580 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1581 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1582 },
1583 .non_semantic_clspv_reflection_6_kernel_property_flags => &.{
1584 .{ .name = "MayUsePrintf", .value = 0x1, .parameters = &.{} },
1585 },
1586 .non_semantic_shader_debug_info_100_debug_info_flags => &.{
1587 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1588 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1589 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1590 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1591 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1592 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1593 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1594 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1595 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1596 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1597 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1598 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1599 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1600 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1601 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1602 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1603 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1604 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1605 .{ .name = "FlagUnknownPhysicalLayout", .value = 0x20000, .parameters = &.{} },
1606 },
1607 .non_semantic_shader_debug_info_100_build_identifier_flags => &.{
1608 .{ .name = "IdentifierPossibleDuplicates", .value = 0x01, .parameters = &.{} },
1609 },
1610 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => &.{
1611 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1612 .{ .name = "Address", .value = 1, .parameters = &.{} },
1613 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1614 .{ .name = "Float", .value = 3, .parameters = &.{} },
1615 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1616 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1617 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1618 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1619 },
1620 .non_semantic_shader_debug_info_100_debug_composite_type => &.{
1621 .{ .name = "Class", .value = 0, .parameters = &.{} },
1622 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1623 .{ .name = "Union", .value = 2, .parameters = &.{} },
1624 },
1625 .non_semantic_shader_debug_info_100_debug_type_qualifier => &.{
1626 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1627 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1628 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1629 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1630 },
1631 .non_semantic_shader_debug_info_100_debug_operation => &.{
1632 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1633 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1634 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1635 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.id_ref} },
1636 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .id_ref, .id_ref } },
1637 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1638 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1639 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1640 .{ .name = "Constu", .value = 8, .parameters = &.{.id_ref} },
1641 .{ .name = "Fragment", .value = 9, .parameters = &.{ .id_ref, .id_ref } },
1642 },
1643 .non_semantic_shader_debug_info_100_debug_imported_entity => &.{
1644 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1645 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1646 },
1647 };
1648 }
1649};
1650pub const Opcode = enum(u16) {
1651 OpNop = 0,
1652 OpUndef = 1,
1653 OpSourceContinued = 2,
1654 OpSource = 3,
1655 OpSourceExtension = 4,
1656 OpName = 5,
1657 OpMemberName = 6,
1658 OpString = 7,
1659 OpLine = 8,
1660 OpExtension = 10,
1661 OpExtInstImport = 11,
1662 OpExtInst = 12,
1663 OpMemoryModel = 14,
1664 OpEntryPoint = 15,
1665 OpExecutionMode = 16,
1666 OpCapability = 17,
1667 OpTypeVoid = 19,
1668 OpTypeBool = 20,
1669 OpTypeInt = 21,
1670 OpTypeFloat = 22,
1671 OpTypeVector = 23,
1672 OpTypeMatrix = 24,
1673 OpTypeImage = 25,
1674 OpTypeSampler = 26,
1675 OpTypeSampledImage = 27,
1676 OpTypeArray = 28,
1677 OpTypeRuntimeArray = 29,
1678 OpTypeStruct = 30,
1679 OpTypeOpaque = 31,
1680 OpTypePointer = 32,
1681 OpTypeFunction = 33,
1682 OpTypeEvent = 34,
1683 OpTypeDeviceEvent = 35,
1684 OpTypeReserveId = 36,
1685 OpTypeQueue = 37,
1686 OpTypePipe = 38,
1687 OpTypeForwardPointer = 39,
1688 OpConstantTrue = 41,
1689 OpConstantFalse = 42,
1690 OpConstant = 43,
1691 OpConstantComposite = 44,
1692 OpConstantSampler = 45,
1693 OpConstantNull = 46,
1694 OpSpecConstantTrue = 48,
1695 OpSpecConstantFalse = 49,
1696 OpSpecConstant = 50,
1697 OpSpecConstantComposite = 51,
1698 OpSpecConstantOp = 52,
1699 OpFunction = 54,
1700 OpFunctionParameter = 55,
1701 OpFunctionEnd = 56,
1702 OpFunctionCall = 57,
1703 OpVariable = 59,
1704 OpImageTexelPointer = 60,
1705 OpLoad = 61,
1706 OpStore = 62,
1707 OpCopyMemory = 63,
1708 OpCopyMemorySized = 64,
1709 OpAccessChain = 65,
1710 OpInBoundsAccessChain = 66,
1711 OpPtrAccessChain = 67,
1712 OpArrayLength = 68,
1713 OpGenericPtrMemSemantics = 69,
1714 OpInBoundsPtrAccessChain = 70,
1715 OpDecorate = 71,
1716 OpMemberDecorate = 72,
1717 OpDecorationGroup = 73,
1718 OpGroupDecorate = 74,
1719 OpGroupMemberDecorate = 75,
1720 OpVectorExtractDynamic = 77,
1721 OpVectorInsertDynamic = 78,
1722 OpVectorShuffle = 79,
1723 OpCompositeConstruct = 80,
1724 OpCompositeExtract = 81,
1725 OpCompositeInsert = 82,
1726 OpCopyObject = 83,
1727 OpTranspose = 84,
1728 OpSampledImage = 86,
1729 OpImageSampleImplicitLod = 87,
1730 OpImageSampleExplicitLod = 88,
1731 OpImageSampleDrefImplicitLod = 89,
1732 OpImageSampleDrefExplicitLod = 90,
1733 OpImageSampleProjImplicitLod = 91,
1734 OpImageSampleProjExplicitLod = 92,
1735 OpImageSampleProjDrefImplicitLod = 93,
1736 OpImageSampleProjDrefExplicitLod = 94,
1737 OpImageFetch = 95,
1738 OpImageGather = 96,
1739 OpImageDrefGather = 97,
1740 OpImageRead = 98,
1741 OpImageWrite = 99,
1742 OpImage = 100,
1743 OpImageQueryFormat = 101,
1744 OpImageQueryOrder = 102,
1745 OpImageQuerySizeLod = 103,
1746 OpImageQuerySize = 104,
1747 OpImageQueryLod = 105,
1748 OpImageQueryLevels = 106,
1749 OpImageQuerySamples = 107,
1750 OpConvertFToU = 109,
1751 OpConvertFToS = 110,
1752 OpConvertSToF = 111,
1753 OpConvertUToF = 112,
1754 OpUConvert = 113,
1755 OpSConvert = 114,
1756 OpFConvert = 115,
1757 OpQuantizeToF16 = 116,
1758 OpConvertPtrToU = 117,
1759 OpSatConvertSToU = 118,
1760 OpSatConvertUToS = 119,
1761 OpConvertUToPtr = 120,
1762 OpPtrCastToGeneric = 121,
1763 OpGenericCastToPtr = 122,
1764 OpGenericCastToPtrExplicit = 123,
1765 OpBitcast = 124,
1766 OpSNegate = 126,
1767 OpFNegate = 127,
1768 OpIAdd = 128,
1769 OpFAdd = 129,
1770 OpISub = 130,
1771 OpFSub = 131,
1772 OpIMul = 132,
1773 OpFMul = 133,
1774 OpUDiv = 134,
1775 OpSDiv = 135,
1776 OpFDiv = 136,
1777 OpUMod = 137,
1778 OpSRem = 138,
1779 OpSMod = 139,
1780 OpFRem = 140,
1781 OpFMod = 141,
1782 OpVectorTimesScalar = 142,
1783 OpMatrixTimesScalar = 143,
1784 OpVectorTimesMatrix = 144,
1785 OpMatrixTimesVector = 145,
1786 OpMatrixTimesMatrix = 146,
1787 OpOuterProduct = 147,
1788 OpDot = 148,
1789 OpIAddCarry = 149,
1790 OpISubBorrow = 150,
1791 OpUMulExtended = 151,
1792 OpSMulExtended = 152,
1793 OpAny = 154,
1794 OpAll = 155,
1795 OpIsNan = 156,
1796 OpIsInf = 157,
1797 OpIsFinite = 158,
1798 OpIsNormal = 159,
1799 OpSignBitSet = 160,
1800 OpLessOrGreater = 161,
1801 OpOrdered = 162,
1802 OpUnordered = 163,
1803 OpLogicalEqual = 164,
1804 OpLogicalNotEqual = 165,
1805 OpLogicalOr = 166,
1806 OpLogicalAnd = 167,
1807 OpLogicalNot = 168,
1808 OpSelect = 169,
1809 OpIEqual = 170,
1810 OpINotEqual = 171,
1811 OpUGreaterThan = 172,
1812 OpSGreaterThan = 173,
1813 OpUGreaterThanEqual = 174,
1814 OpSGreaterThanEqual = 175,
1815 OpULessThan = 176,
1816 OpSLessThan = 177,
1817 OpULessThanEqual = 178,
1818 OpSLessThanEqual = 179,
1819 OpFOrdEqual = 180,
1820 OpFUnordEqual = 181,
1821 OpFOrdNotEqual = 182,
1822 OpFUnordNotEqual = 183,
1823 OpFOrdLessThan = 184,
1824 OpFUnordLessThan = 185,
1825 OpFOrdGreaterThan = 186,
1826 OpFUnordGreaterThan = 187,
1827 OpFOrdLessThanEqual = 188,
1828 OpFUnordLessThanEqual = 189,
1829 OpFOrdGreaterThanEqual = 190,
1830 OpFUnordGreaterThanEqual = 191,
1831 OpShiftRightLogical = 194,
1832 OpShiftRightArithmetic = 195,
1833 OpShiftLeftLogical = 196,
1834 OpBitwiseOr = 197,
1835 OpBitwiseXor = 198,
1836 OpBitwiseAnd = 199,
1837 OpNot = 200,
1838 OpBitFieldInsert = 201,
1839 OpBitFieldSExtract = 202,
1840 OpBitFieldUExtract = 203,
1841 OpBitReverse = 204,
1842 OpBitCount = 205,
1843 OpDPdx = 207,
1844 OpDPdy = 208,
1845 OpFwidth = 209,
1846 OpDPdxFine = 210,
1847 OpDPdyFine = 211,
1848 OpFwidthFine = 212,
1849 OpDPdxCoarse = 213,
1850 OpDPdyCoarse = 214,
1851 OpFwidthCoarse = 215,
1852 OpEmitVertex = 218,
1853 OpEndPrimitive = 219,
1854 OpEmitStreamVertex = 220,
1855 OpEndStreamPrimitive = 221,
1856 OpControlBarrier = 224,
1857 OpMemoryBarrier = 225,
1858 OpAtomicLoad = 227,
1859 OpAtomicStore = 228,
1860 OpAtomicExchange = 229,
1861 OpAtomicCompareExchange = 230,
1862 OpAtomicCompareExchangeWeak = 231,
1863 OpAtomicIIncrement = 232,
1864 OpAtomicIDecrement = 233,
1865 OpAtomicIAdd = 234,
1866 OpAtomicISub = 235,
1867 OpAtomicSMin = 236,
1868 OpAtomicUMin = 237,
1869 OpAtomicSMax = 238,
1870 OpAtomicUMax = 239,
1871 OpAtomicAnd = 240,
1872 OpAtomicOr = 241,
1873 OpAtomicXor = 242,
1874 OpPhi = 245,
1875 OpLoopMerge = 246,
1876 OpSelectionMerge = 247,
1877 OpLabel = 248,
1878 OpBranch = 249,
1879 OpBranchConditional = 250,
1880 OpSwitch = 251,
1881 OpKill = 252,
1882 OpReturn = 253,
1883 OpReturnValue = 254,
1884 OpUnreachable = 255,
1885 OpLifetimeStart = 256,
1886 OpLifetimeStop = 257,
1887 OpGroupAsyncCopy = 259,
1888 OpGroupWaitEvents = 260,
1889 OpGroupAll = 261,
1890 OpGroupAny = 262,
1891 OpGroupBroadcast = 263,
1892 OpGroupIAdd = 264,
1893 OpGroupFAdd = 265,
1894 OpGroupFMin = 266,
1895 OpGroupUMin = 267,
1896 OpGroupSMin = 268,
1897 OpGroupFMax = 269,
1898 OpGroupUMax = 270,
1899 OpGroupSMax = 271,
1900 OpReadPipe = 274,
1901 OpWritePipe = 275,
1902 OpReservedReadPipe = 276,
1903 OpReservedWritePipe = 277,
1904 OpReserveReadPipePackets = 278,
1905 OpReserveWritePipePackets = 279,
1906 OpCommitReadPipe = 280,
1907 OpCommitWritePipe = 281,
1908 OpIsValidReserveId = 282,
1909 OpGetNumPipePackets = 283,
1910 OpGetMaxPipePackets = 284,
1911 OpGroupReserveReadPipePackets = 285,
1912 OpGroupReserveWritePipePackets = 286,
1913 OpGroupCommitReadPipe = 287,
1914 OpGroupCommitWritePipe = 288,
1915 OpEnqueueMarker = 291,
1916 OpEnqueueKernel = 292,
1917 OpGetKernelNDrangeSubGroupCount = 293,
1918 OpGetKernelNDrangeMaxSubGroupSize = 294,
1919 OpGetKernelWorkGroupSize = 295,
1920 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
1921 OpRetainEvent = 297,
1922 OpReleaseEvent = 298,
1923 OpCreateUserEvent = 299,
1924 OpIsValidEvent = 300,
1925 OpSetUserEventStatus = 301,
1926 OpCaptureEventProfilingInfo = 302,
1927 OpGetDefaultQueue = 303,
1928 OpBuildNDRange = 304,
1929 OpImageSparseSampleImplicitLod = 305,
1930 OpImageSparseSampleExplicitLod = 306,
1931 OpImageSparseSampleDrefImplicitLod = 307,
1932 OpImageSparseSampleDrefExplicitLod = 308,
1933 OpImageSparseSampleProjImplicitLod = 309,
1934 OpImageSparseSampleProjExplicitLod = 310,
1935 OpImageSparseSampleProjDrefImplicitLod = 311,
1936 OpImageSparseSampleProjDrefExplicitLod = 312,
1937 OpImageSparseFetch = 313,
1938 OpImageSparseGather = 314,
1939 OpImageSparseDrefGather = 315,
1940 OpImageSparseTexelsResident = 316,
1941 OpNoLine = 317,
1942 OpAtomicFlagTestAndSet = 318,
1943 OpAtomicFlagClear = 319,
1944 OpImageSparseRead = 320,
1945 OpSizeOf = 321,
1946 OpTypePipeStorage = 322,
1947 OpConstantPipeStorage = 323,
1948 OpCreatePipeFromPipeStorage = 324,
1949 OpGetKernelLocalSizeForSubgroupCount = 325,
1950 OpGetKernelMaxNumSubgroups = 326,
1951 OpTypeNamedBarrier = 327,
1952 OpNamedBarrierInitialize = 328,
1953 OpMemoryNamedBarrier = 329,
1954 OpModuleProcessed = 330,
1955 OpExecutionModeId = 331,
1956 OpDecorateId = 332,
1957 OpGroupNonUniformElect = 333,
1958 OpGroupNonUniformAll = 334,
1959 OpGroupNonUniformAny = 335,
1960 OpGroupNonUniformAllEqual = 336,
1961 OpGroupNonUniformBroadcast = 337,
1962 OpGroupNonUniformBroadcastFirst = 338,
1963 OpGroupNonUniformBallot = 339,
1964 OpGroupNonUniformInverseBallot = 340,
1965 OpGroupNonUniformBallotBitExtract = 341,
1966 OpGroupNonUniformBallotBitCount = 342,
1967 OpGroupNonUniformBallotFindLSB = 343,
1968 OpGroupNonUniformBallotFindMSB = 344,
1969 OpGroupNonUniformShuffle = 345,
1970 OpGroupNonUniformShuffleXor = 346,
1971 OpGroupNonUniformShuffleUp = 347,
1972 OpGroupNonUniformShuffleDown = 348,
1973 OpGroupNonUniformIAdd = 349,
1974 OpGroupNonUniformFAdd = 350,
1975 OpGroupNonUniformIMul = 351,
1976 OpGroupNonUniformFMul = 352,
1977 OpGroupNonUniformSMin = 353,
1978 OpGroupNonUniformUMin = 354,
1979 OpGroupNonUniformFMin = 355,
1980 OpGroupNonUniformSMax = 356,
1981 OpGroupNonUniformUMax = 357,
1982 OpGroupNonUniformFMax = 358,
1983 OpGroupNonUniformBitwiseAnd = 359,
1984 OpGroupNonUniformBitwiseOr = 360,
1985 OpGroupNonUniformBitwiseXor = 361,
1986 OpGroupNonUniformLogicalAnd = 362,
1987 OpGroupNonUniformLogicalOr = 363,
1988 OpGroupNonUniformLogicalXor = 364,
1989 OpGroupNonUniformQuadBroadcast = 365,
1990 OpGroupNonUniformQuadSwap = 366,
1991 OpCopyLogical = 400,
1992 OpPtrEqual = 401,
1993 OpPtrNotEqual = 402,
1994 OpPtrDiff = 403,
1995 OpColorAttachmentReadEXT = 4160,
1996 OpDepthAttachmentReadEXT = 4161,
1997 OpStencilAttachmentReadEXT = 4162,
1998 OpTypeTensorARM = 4163,
1999 OpTensorReadARM = 4164,
2000 OpTensorWriteARM = 4165,
2001 OpTensorQuerySizeARM = 4166,
2002 OpGraphConstantARM = 4181,
2003 OpGraphEntryPointARM = 4182,
2004 OpGraphARM = 4183,
2005 OpGraphInputARM = 4184,
2006 OpGraphSetOutputARM = 4185,
2007 OpGraphEndARM = 4186,
2008 OpTypeGraphARM = 4190,
2009 OpTerminateInvocation = 4416,
2010 OpTypeUntypedPointerKHR = 4417,
2011 OpUntypedVariableKHR = 4418,
2012 OpUntypedAccessChainKHR = 4419,
2013 OpUntypedInBoundsAccessChainKHR = 4420,
2014 OpSubgroupBallotKHR = 4421,
2015 OpSubgroupFirstInvocationKHR = 4422,
2016 OpUntypedPtrAccessChainKHR = 4423,
2017 OpUntypedInBoundsPtrAccessChainKHR = 4424,
2018 OpUntypedArrayLengthKHR = 4425,
2019 OpUntypedPrefetchKHR = 4426,
2020 OpSubgroupAllKHR = 4428,
2021 OpSubgroupAnyKHR = 4429,
2022 OpSubgroupAllEqualKHR = 4430,
2023 OpGroupNonUniformRotateKHR = 4431,
2024 OpSubgroupReadInvocationKHR = 4432,
2025 OpExtInstWithForwardRefsKHR = 4433,
2026 OpTraceRayKHR = 4445,
2027 OpExecuteCallableKHR = 4446,
2028 OpConvertUToAccelerationStructureKHR = 4447,
2029 OpIgnoreIntersectionKHR = 4448,
2030 OpTerminateRayKHR = 4449,
2031 OpSDot = 4450,
2032 OpUDot = 4451,
2033 OpSUDot = 4452,
2034 OpSDotAccSat = 4453,
2035 OpUDotAccSat = 4454,
2036 OpSUDotAccSat = 4455,
2037 OpTypeCooperativeMatrixKHR = 4456,
2038 OpCooperativeMatrixLoadKHR = 4457,
2039 OpCooperativeMatrixStoreKHR = 4458,
2040 OpCooperativeMatrixMulAddKHR = 4459,
2041 OpCooperativeMatrixLengthKHR = 4460,
2042 OpConstantCompositeReplicateEXT = 4461,
2043 OpSpecConstantCompositeReplicateEXT = 4462,
2044 OpCompositeConstructReplicateEXT = 4463,
2045 OpTypeRayQueryKHR = 4472,
2046 OpRayQueryInitializeKHR = 4473,
2047 OpRayQueryTerminateKHR = 4474,
2048 OpRayQueryGenerateIntersectionKHR = 4475,
2049 OpRayQueryConfirmIntersectionKHR = 4476,
2050 OpRayQueryProceedKHR = 4477,
2051 OpRayQueryGetIntersectionTypeKHR = 4479,
2052 OpImageSampleWeightedQCOM = 4480,
2053 OpImageBoxFilterQCOM = 4481,
2054 OpImageBlockMatchSSDQCOM = 4482,
2055 OpImageBlockMatchSADQCOM = 4483,
2056 OpImageBlockMatchWindowSSDQCOM = 4500,
2057 OpImageBlockMatchWindowSADQCOM = 4501,
2058 OpImageBlockMatchGatherSSDQCOM = 4502,
2059 OpImageBlockMatchGatherSADQCOM = 4503,
2060 OpGroupIAddNonUniformAMD = 5000,
2061 OpGroupFAddNonUniformAMD = 5001,
2062 OpGroupFMinNonUniformAMD = 5002,
2063 OpGroupUMinNonUniformAMD = 5003,
2064 OpGroupSMinNonUniformAMD = 5004,
2065 OpGroupFMaxNonUniformAMD = 5005,
2066 OpGroupUMaxNonUniformAMD = 5006,
2067 OpGroupSMaxNonUniformAMD = 5007,
2068 OpFragmentMaskFetchAMD = 5011,
2069 OpFragmentFetchAMD = 5012,
2070 OpReadClockKHR = 5056,
2071 OpAllocateNodePayloadsAMDX = 5074,
2072 OpEnqueueNodePayloadsAMDX = 5075,
2073 OpTypeNodePayloadArrayAMDX = 5076,
2074 OpFinishWritingNodePayloadAMDX = 5078,
2075 OpNodePayloadArrayLengthAMDX = 5090,
2076 OpIsNodePayloadValidAMDX = 5101,
2077 OpConstantStringAMDX = 5103,
2078 OpSpecConstantStringAMDX = 5104,
2079 OpGroupNonUniformQuadAllKHR = 5110,
2080 OpGroupNonUniformQuadAnyKHR = 5111,
2081 OpHitObjectRecordHitMotionNV = 5249,
2082 OpHitObjectRecordHitWithIndexMotionNV = 5250,
2083 OpHitObjectRecordMissMotionNV = 5251,
2084 OpHitObjectGetWorldToObjectNV = 5252,
2085 OpHitObjectGetObjectToWorldNV = 5253,
2086 OpHitObjectGetObjectRayDirectionNV = 5254,
2087 OpHitObjectGetObjectRayOriginNV = 5255,
2088 OpHitObjectTraceRayMotionNV = 5256,
2089 OpHitObjectGetShaderRecordBufferHandleNV = 5257,
2090 OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
2091 OpHitObjectRecordEmptyNV = 5259,
2092 OpHitObjectTraceRayNV = 5260,
2093 OpHitObjectRecordHitNV = 5261,
2094 OpHitObjectRecordHitWithIndexNV = 5262,
2095 OpHitObjectRecordMissNV = 5263,
2096 OpHitObjectExecuteShaderNV = 5264,
2097 OpHitObjectGetCurrentTimeNV = 5265,
2098 OpHitObjectGetAttributesNV = 5266,
2099 OpHitObjectGetHitKindNV = 5267,
2100 OpHitObjectGetPrimitiveIndexNV = 5268,
2101 OpHitObjectGetGeometryIndexNV = 5269,
2102 OpHitObjectGetInstanceIdNV = 5270,
2103 OpHitObjectGetInstanceCustomIndexNV = 5271,
2104 OpHitObjectGetWorldRayDirectionNV = 5272,
2105 OpHitObjectGetWorldRayOriginNV = 5273,
2106 OpHitObjectGetRayTMaxNV = 5274,
2107 OpHitObjectGetRayTMinNV = 5275,
2108 OpHitObjectIsEmptyNV = 5276,
2109 OpHitObjectIsHitNV = 5277,
2110 OpHitObjectIsMissNV = 5278,
2111 OpReorderThreadWithHitObjectNV = 5279,
2112 OpReorderThreadWithHintNV = 5280,
2113 OpTypeHitObjectNV = 5281,
2114 OpImageSampleFootprintNV = 5283,
2115 OpTypeCooperativeVectorNV = 5288,
2116 OpCooperativeVectorMatrixMulNV = 5289,
2117 OpCooperativeVectorOuterProductAccumulateNV = 5290,
2118 OpCooperativeVectorReduceSumAccumulateNV = 5291,
2119 OpCooperativeVectorMatrixMulAddNV = 5292,
2120 OpCooperativeMatrixConvertNV = 5293,
2121 OpEmitMeshTasksEXT = 5294,
2122 OpSetMeshOutputsEXT = 5295,
2123 OpGroupNonUniformPartitionNV = 5296,
2124 OpWritePackedPrimitiveIndices4x8NV = 5299,
2125 OpFetchMicroTriangleVertexPositionNV = 5300,
2126 OpFetchMicroTriangleVertexBarycentricNV = 5301,
2127 OpCooperativeVectorLoadNV = 5302,
2128 OpCooperativeVectorStoreNV = 5303,
2129 OpReportIntersectionKHR = 5334,
2130 OpIgnoreIntersectionNV = 5335,
2131 OpTerminateRayNV = 5336,
2132 OpTraceNV = 5337,
2133 OpTraceMotionNV = 5338,
2134 OpTraceRayMotionNV = 5339,
2135 OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,
2136 OpTypeAccelerationStructureKHR = 5341,
2137 OpExecuteCallableNV = 5344,
2138 OpRayQueryGetClusterIdNV = 5345,
2139 OpHitObjectGetClusterIdNV = 5346,
2140 OpTypeCooperativeMatrixNV = 5358,
2141 OpCooperativeMatrixLoadNV = 5359,
2142 OpCooperativeMatrixStoreNV = 5360,
2143 OpCooperativeMatrixMulAddNV = 5361,
2144 OpCooperativeMatrixLengthNV = 5362,
2145 OpBeginInvocationInterlockEXT = 5364,
2146 OpEndInvocationInterlockEXT = 5365,
2147 OpCooperativeMatrixReduceNV = 5366,
2148 OpCooperativeMatrixLoadTensorNV = 5367,
2149 OpCooperativeMatrixStoreTensorNV = 5368,
2150 OpCooperativeMatrixPerElementOpNV = 5369,
2151 OpTypeTensorLayoutNV = 5370,
2152 OpTypeTensorViewNV = 5371,
2153 OpCreateTensorLayoutNV = 5372,
2154 OpTensorLayoutSetDimensionNV = 5373,
2155 OpTensorLayoutSetStrideNV = 5374,
2156 OpTensorLayoutSliceNV = 5375,
2157 OpTensorLayoutSetClampValueNV = 5376,
2158 OpCreateTensorViewNV = 5377,
2159 OpTensorViewSetDimensionNV = 5378,
2160 OpTensorViewSetStrideNV = 5379,
2161 OpDemoteToHelperInvocation = 5380,
2162 OpIsHelperInvocationEXT = 5381,
2163 OpTensorViewSetClipNV = 5382,
2164 OpTensorLayoutSetBlockSizeNV = 5384,
2165 OpCooperativeMatrixTransposeNV = 5390,
2166 OpConvertUToImageNV = 5391,
2167 OpConvertUToSamplerNV = 5392,
2168 OpConvertImageToUNV = 5393,
2169 OpConvertSamplerToUNV = 5394,
2170 OpConvertUToSampledImageNV = 5395,
2171 OpConvertSampledImageToUNV = 5396,
2172 OpSamplerImageAddressingModeNV = 5397,
2173 OpRawAccessChainNV = 5398,
2174 OpRayQueryGetIntersectionSpherePositionNV = 5427,
2175 OpRayQueryGetIntersectionSphereRadiusNV = 5428,
2176 OpRayQueryGetIntersectionLSSPositionsNV = 5429,
2177 OpRayQueryGetIntersectionLSSRadiiNV = 5430,
2178 OpRayQueryGetIntersectionLSSHitValueNV = 5431,
2179 OpHitObjectGetSpherePositionNV = 5432,
2180 OpHitObjectGetSphereRadiusNV = 5433,
2181 OpHitObjectGetLSSPositionsNV = 5434,
2182 OpHitObjectGetLSSRadiiNV = 5435,
2183 OpHitObjectIsSphereHitNV = 5436,
2184 OpHitObjectIsLSSHitNV = 5437,
2185 OpRayQueryIsSphereHitNV = 5438,
2186 OpRayQueryIsLSSHitNV = 5439,
2187 OpSubgroupShuffleINTEL = 5571,
2188 OpSubgroupShuffleDownINTEL = 5572,
2189 OpSubgroupShuffleUpINTEL = 5573,
2190 OpSubgroupShuffleXorINTEL = 5574,
2191 OpSubgroupBlockReadINTEL = 5575,
2192 OpSubgroupBlockWriteINTEL = 5576,
2193 OpSubgroupImageBlockReadINTEL = 5577,
2194 OpSubgroupImageBlockWriteINTEL = 5578,
2195 OpSubgroupImageMediaBlockReadINTEL = 5580,
2196 OpSubgroupImageMediaBlockWriteINTEL = 5581,
2197 OpUCountLeadingZerosINTEL = 5585,
2198 OpUCountTrailingZerosINTEL = 5586,
2199 OpAbsISubINTEL = 5587,
2200 OpAbsUSubINTEL = 5588,
2201 OpIAddSatINTEL = 5589,
2202 OpUAddSatINTEL = 5590,
2203 OpIAverageINTEL = 5591,
2204 OpUAverageINTEL = 5592,
2205 OpIAverageRoundedINTEL = 5593,
2206 OpUAverageRoundedINTEL = 5594,
2207 OpISubSatINTEL = 5595,
2208 OpUSubSatINTEL = 5596,
2209 OpIMul32x16INTEL = 5597,
2210 OpUMul32x16INTEL = 5598,
2211 OpAtomicFMinEXT = 5614,
2212 OpAtomicFMaxEXT = 5615,
2213 OpAssumeTrueKHR = 5630,
2214 OpExpectKHR = 5631,
2215 OpDecorateString = 5632,
2216 OpMemberDecorateString = 5633,
2217 OpLoopControlINTEL = 5887,
2218 OpReadPipeBlockingINTEL = 5946,
2219 OpWritePipeBlockingINTEL = 5947,
2220 OpFPGARegINTEL = 5949,
2221 OpRayQueryGetRayTMinKHR = 6016,
2222 OpRayQueryGetRayFlagsKHR = 6017,
2223 OpRayQueryGetIntersectionTKHR = 6018,
2224 OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
2225 OpRayQueryGetIntersectionInstanceIdKHR = 6020,
2226 OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
2227 OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
2228 OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
2229 OpRayQueryGetIntersectionBarycentricsKHR = 6024,
2230 OpRayQueryGetIntersectionFrontFaceKHR = 6025,
2231 OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
2232 OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
2233 OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
2234 OpRayQueryGetWorldRayDirectionKHR = 6029,
2235 OpRayQueryGetWorldRayOriginKHR = 6030,
2236 OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
2237 OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
2238 OpAtomicFAddEXT = 6035,
2239 OpTypeBufferSurfaceINTEL = 6086,
2240 OpTypeStructContinuedINTEL = 6090,
2241 OpConstantCompositeContinuedINTEL = 6091,
2242 OpSpecConstantCompositeContinuedINTEL = 6092,
2243 OpCompositeConstructContinuedINTEL = 6096,
2244 OpConvertFToBF16INTEL = 6116,
2245 OpConvertBF16ToFINTEL = 6117,
2246 OpControlBarrierArriveINTEL = 6142,
2247 OpControlBarrierWaitINTEL = 6143,
2248 OpArithmeticFenceEXT = 6145,
2249 OpTaskSequenceCreateINTEL = 6163,
2250 OpTaskSequenceAsyncINTEL = 6164,
2251 OpTaskSequenceGetINTEL = 6165,
2252 OpTaskSequenceReleaseINTEL = 6166,
2253 OpTypeTaskSequenceINTEL = 6199,
2254 OpSubgroupBlockPrefetchINTEL = 6221,
2255 OpSubgroup2DBlockLoadINTEL = 6231,
2256 OpSubgroup2DBlockLoadTransformINTEL = 6232,
2257 OpSubgroup2DBlockLoadTransposeINTEL = 6233,
2258 OpSubgroup2DBlockPrefetchINTEL = 6234,
2259 OpSubgroup2DBlockStoreINTEL = 6235,
2260 OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
2261 OpBitwiseFunctionINTEL = 6242,
2262 OpGroupIMulKHR = 6401,
2263 OpGroupFMulKHR = 6402,
2264 OpGroupBitwiseAndKHR = 6403,
2265 OpGroupBitwiseOrKHR = 6404,
2266 OpGroupBitwiseXorKHR = 6405,
2267 OpGroupLogicalAndKHR = 6406,
2268 OpGroupLogicalOrKHR = 6407,
2269 OpGroupLogicalXorKHR = 6408,
2270 OpRoundFToTF32INTEL = 6426,
2271 OpMaskedGatherINTEL = 6428,
2272 OpMaskedScatterINTEL = 6429,
2273 OpConvertHandleToImageINTEL = 6529,
2274 OpConvertHandleToSamplerINTEL = 6530,
2275 OpConvertHandleToSampledImageINTEL = 6531,
2276
2277 pub fn Operands(comptime self: Opcode) type {
2278 return switch (self) {
2279 .OpNop => void,
2280 .OpUndef => struct { id_result_type: Id, id_result: Id },
2281 .OpSourceContinued => struct { continued_source: LiteralString },
2282 .OpSource => struct { source_language: SourceLanguage, version: LiteralInteger, file: ?Id = null, source: ?LiteralString = null },
2283 .OpSourceExtension => struct { extension: LiteralString },
2284 .OpName => struct { target: Id, name: LiteralString },
2285 .OpMemberName => struct { type: Id, member: LiteralInteger, name: LiteralString },
2286 .OpString => struct { id_result: Id, string: LiteralString },
2287 .OpLine => struct { file: Id, line: LiteralInteger, column: LiteralInteger },
2288 .OpExtension => struct { name: LiteralString },
2289 .OpExtInstImport => struct { id_result: Id, name: LiteralString },
2290 .OpExtInst => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2291 .OpMemoryModel => struct { addressing_model: AddressingModel, memory_model: MemoryModel },
2292 .OpEntryPoint => struct { execution_model: ExecutionModel, entry_point: Id, name: LiteralString, interface: []const Id = &.{} },
2293 .OpExecutionMode => struct { entry_point: Id, mode: ExecutionMode.Extended },
2294 .OpCapability => struct { capability: Capability },
2295 .OpTypeVoid => struct { id_result: Id },
2296 .OpTypeBool => struct { id_result: Id },
2297 .OpTypeInt => struct { id_result: Id, width: LiteralInteger, signedness: LiteralInteger },
2298 .OpTypeFloat => struct { id_result: Id, width: LiteralInteger, floating_point_encoding: ?FPEncoding = null },
2299 .OpTypeVector => struct { id_result: Id, component_type: Id, component_count: LiteralInteger },
2300 .OpTypeMatrix => struct { id_result: Id, column_type: Id, column_count: LiteralInteger },
2301 .OpTypeImage => struct { id_result: Id, sampled_type: Id, dim: Dim, depth: LiteralInteger, arrayed: LiteralInteger, ms: LiteralInteger, sampled: LiteralInteger, image_format: ImageFormat, access_qualifier: ?AccessQualifier = null },
2302 .OpTypeSampler => struct { id_result: Id },
2303 .OpTypeSampledImage => struct { id_result: Id, image_type: Id },
2304 .OpTypeArray => struct { id_result: Id, element_type: Id, length: Id },
2305 .OpTypeRuntimeArray => struct { id_result: Id, element_type: Id },
2306 .OpTypeStruct => struct { id_result: Id, id_ref: []const Id = &.{} },
2307 .OpTypeOpaque => struct { id_result: Id, literal_string: LiteralString },
2308 .OpTypePointer => struct { id_result: Id, storage_class: StorageClass, type: Id },
2309 .OpTypeFunction => struct { id_result: Id, return_type: Id, id_ref_2: []const Id = &.{} },
2310 .OpTypeEvent => struct { id_result: Id },
2311 .OpTypeDeviceEvent => struct { id_result: Id },
2312 .OpTypeReserveId => struct { id_result: Id },
2313 .OpTypeQueue => struct { id_result: Id },
2314 .OpTypePipe => struct { id_result: Id, qualifier: AccessQualifier },
2315 .OpTypeForwardPointer => struct { pointer_type: Id, storage_class: StorageClass },
2316 .OpConstantTrue => struct { id_result_type: Id, id_result: Id },
2317 .OpConstantFalse => struct { id_result_type: Id, id_result: Id },
2318 .OpConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2319 .OpConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2320 .OpConstantSampler => struct { id_result_type: Id, id_result: Id, sampler_addressing_mode: SamplerAddressingMode, param: LiteralInteger, sampler_filter_mode: SamplerFilterMode },
2321 .OpConstantNull => struct { id_result_type: Id, id_result: Id },
2322 .OpSpecConstantTrue => struct { id_result_type: Id, id_result: Id },
2323 .OpSpecConstantFalse => struct { id_result_type: Id, id_result: Id },
2324 .OpSpecConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2325 .OpSpecConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2326 .OpSpecConstantOp => struct { id_result_type: Id, id_result: Id, opcode: LiteralSpecConstantOpInteger },
2327 .OpFunction => struct { id_result_type: Id, id_result: Id, function_control: FunctionControl, function_type: Id },
2328 .OpFunctionParameter => struct { id_result_type: Id, id_result: Id },
2329 .OpFunctionEnd => void,
2330 .OpFunctionCall => struct { id_result_type: Id, id_result: Id, function: Id, id_ref_3: []const Id = &.{} },
2331 .OpVariable => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, initializer: ?Id = null },
2332 .OpImageTexelPointer => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, sample: Id },
2333 .OpLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_access: ?MemoryAccess.Extended = null },
2334 .OpStore => struct { pointer: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2335 .OpCopyMemory => struct { target: Id, source: Id, memory_access_2: ?MemoryAccess.Extended = null, memory_access_3: ?MemoryAccess.Extended = null },
2336 .OpCopyMemorySized => struct { target: Id, source: Id, size: Id, memory_access_3: ?MemoryAccess.Extended = null, memory_access_4: ?MemoryAccess.Extended = null },
2337 .OpAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2338 .OpInBoundsAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2339 .OpPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2340 .OpArrayLength => struct { id_result_type: Id, id_result: Id, structure: Id, array_member: LiteralInteger },
2341 .OpGenericPtrMemSemantics => struct { id_result_type: Id, id_result: Id, pointer: Id },
2342 .OpInBoundsPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2343 .OpDecorate => struct { target: Id, decoration: Decoration.Extended },
2344 .OpMemberDecorate => struct { structure_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2345 .OpDecorationGroup => struct { id_result: Id },
2346 .OpGroupDecorate => struct { decoration_group: Id, targets: []const Id = &.{} },
2347 .OpGroupMemberDecorate => struct { decoration_group: Id, targets: []const PairIdRefLiteralInteger = &.{} },
2348 .OpVectorExtractDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, index: Id },
2349 .OpVectorInsertDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, component: Id, index: Id },
2350 .OpVectorShuffle => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, components: []const LiteralInteger = &.{} },
2351 .OpCompositeConstruct => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2352 .OpCompositeExtract => struct { id_result_type: Id, id_result: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2353 .OpCompositeInsert => struct { id_result_type: Id, id_result: Id, object: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2354 .OpCopyObject => struct { id_result_type: Id, id_result: Id, operand: Id },
2355 .OpTranspose => struct { id_result_type: Id, id_result: Id, matrix: Id },
2356 .OpSampledImage => struct { id_result_type: Id, id_result: Id, image: Id, sampler: Id },
2357 .OpImageSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2358 .OpImageSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2359 .OpImageSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2360 .OpImageSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2361 .OpImageSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2362 .OpImageSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2363 .OpImageSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2364 .OpImageSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2365 .OpImageFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2366 .OpImageGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2367 .OpImageDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2368 .OpImageRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2369 .OpImageWrite => struct { image: Id, coordinate: Id, texel: Id, image_operands: ?ImageOperands.Extended = null },
2370 .OpImage => struct { id_result_type: Id, id_result: Id, sampled_image: Id },
2371 .OpImageQueryFormat => struct { id_result_type: Id, id_result: Id, image: Id },
2372 .OpImageQueryOrder => struct { id_result_type: Id, id_result: Id, image: Id },
2373 .OpImageQuerySizeLod => struct { id_result_type: Id, id_result: Id, image: Id, level_of_detail: Id },
2374 .OpImageQuerySize => struct { id_result_type: Id, id_result: Id, image: Id },
2375 .OpImageQueryLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id },
2376 .OpImageQueryLevels => struct { id_result_type: Id, id_result: Id, image: Id },
2377 .OpImageQuerySamples => struct { id_result_type: Id, id_result: Id, image: Id },
2378 .OpConvertFToU => struct { id_result_type: Id, id_result: Id, float_value: Id },
2379 .OpConvertFToS => struct { id_result_type: Id, id_result: Id, float_value: Id },
2380 .OpConvertSToF => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2381 .OpConvertUToF => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2382 .OpUConvert => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2383 .OpSConvert => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2384 .OpFConvert => struct { id_result_type: Id, id_result: Id, float_value: Id },
2385 .OpQuantizeToF16 => struct { id_result_type: Id, id_result: Id, value: Id },
2386 .OpConvertPtrToU => struct { id_result_type: Id, id_result: Id, pointer: Id },
2387 .OpSatConvertSToU => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2388 .OpSatConvertUToS => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2389 .OpConvertUToPtr => struct { id_result_type: Id, id_result: Id, integer_value: Id },
2390 .OpPtrCastToGeneric => struct { id_result_type: Id, id_result: Id, pointer: Id },
2391 .OpGenericCastToPtr => struct { id_result_type: Id, id_result: Id, pointer: Id },
2392 .OpGenericCastToPtrExplicit => struct { id_result_type: Id, id_result: Id, pointer: Id, storage: StorageClass },
2393 .OpBitcast => struct { id_result_type: Id, id_result: Id, operand: Id },
2394 .OpSNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2395 .OpFNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2396 .OpIAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2397 .OpFAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2398 .OpISub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2399 .OpFSub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2400 .OpIMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2401 .OpFMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2402 .OpUDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2403 .OpSDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2404 .OpFDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2405 .OpUMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2406 .OpSRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2407 .OpSMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2408 .OpFRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2409 .OpFMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2410 .OpVectorTimesScalar => struct { id_result_type: Id, id_result: Id, vector: Id, scalar: Id },
2411 .OpMatrixTimesScalar => struct { id_result_type: Id, id_result: Id, matrix: Id, scalar: Id },
2412 .OpVectorTimesMatrix => struct { id_result_type: Id, id_result: Id, vector: Id, matrix: Id },
2413 .OpMatrixTimesVector => struct { id_result_type: Id, id_result: Id, matrix: Id, vector: Id },
2414 .OpMatrixTimesMatrix => struct { id_result_type: Id, id_result: Id, left_matrix: Id, right_matrix: Id },
2415 .OpOuterProduct => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2416 .OpDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2417 .OpIAddCarry => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2418 .OpISubBorrow => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2419 .OpUMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2420 .OpSMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2421 .OpAny => struct { id_result_type: Id, id_result: Id, vector: Id },
2422 .OpAll => struct { id_result_type: Id, id_result: Id, vector: Id },
2423 .OpIsNan => struct { id_result_type: Id, id_result: Id, x: Id },
2424 .OpIsInf => struct { id_result_type: Id, id_result: Id, x: Id },
2425 .OpIsFinite => struct { id_result_type: Id, id_result: Id, x: Id },
2426 .OpIsNormal => struct { id_result_type: Id, id_result: Id, x: Id },
2427 .OpSignBitSet => struct { id_result_type: Id, id_result: Id, x: Id },
2428 .OpLessOrGreater => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2429 .OpOrdered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2430 .OpUnordered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2431 .OpLogicalEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2432 .OpLogicalNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2433 .OpLogicalOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2434 .OpLogicalAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2435 .OpLogicalNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2436 .OpSelect => struct { id_result_type: Id, id_result: Id, condition: Id, object_1: Id, object_2: Id },
2437 .OpIEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2438 .OpINotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2439 .OpUGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2440 .OpSGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2441 .OpUGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2442 .OpSGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2443 .OpULessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2444 .OpSLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2445 .OpULessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2446 .OpSLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2447 .OpFOrdEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2448 .OpFUnordEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2449 .OpFOrdNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2450 .OpFUnordNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2451 .OpFOrdLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2452 .OpFUnordLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2453 .OpFOrdGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2454 .OpFUnordGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2455 .OpFOrdLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2456 .OpFUnordLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2457 .OpFOrdGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2458 .OpFUnordGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2459 .OpShiftRightLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2460 .OpShiftRightArithmetic => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2461 .OpShiftLeftLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2462 .OpBitwiseOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2463 .OpBitwiseXor => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2464 .OpBitwiseAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2465 .OpNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2466 .OpBitFieldInsert => struct { id_result_type: Id, id_result: Id, base: Id, insert: Id, offset: Id, count: Id },
2467 .OpBitFieldSExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2468 .OpBitFieldUExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2469 .OpBitReverse => struct { id_result_type: Id, id_result: Id, base: Id },
2470 .OpBitCount => struct { id_result_type: Id, id_result: Id, base: Id },
2471 .OpDPdx => struct { id_result_type: Id, id_result: Id, p: Id },
2472 .OpDPdy => struct { id_result_type: Id, id_result: Id, p: Id },
2473 .OpFwidth => struct { id_result_type: Id, id_result: Id, p: Id },
2474 .OpDPdxFine => struct { id_result_type: Id, id_result: Id, p: Id },
2475 .OpDPdyFine => struct { id_result_type: Id, id_result: Id, p: Id },
2476 .OpFwidthFine => struct { id_result_type: Id, id_result: Id, p: Id },
2477 .OpDPdxCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2478 .OpDPdyCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2479 .OpFwidthCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2480 .OpEmitVertex => void,
2481 .OpEndPrimitive => void,
2482 .OpEmitStreamVertex => struct { stream: Id },
2483 .OpEndStreamPrimitive => struct { stream: Id },
2484 .OpControlBarrier => struct { execution: Id, memory: Id, semantics: Id },
2485 .OpMemoryBarrier => struct { memory: Id, semantics: Id },
2486 .OpAtomicLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2487 .OpAtomicStore => struct { pointer: Id, memory: Id, semantics: Id, value: Id },
2488 .OpAtomicExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2489 .OpAtomicCompareExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2490 .OpAtomicCompareExchangeWeak => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2491 .OpAtomicIIncrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2492 .OpAtomicIDecrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2493 .OpAtomicIAdd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2494 .OpAtomicISub => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2495 .OpAtomicSMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2496 .OpAtomicUMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2497 .OpAtomicSMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2498 .OpAtomicUMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2499 .OpAtomicAnd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2500 .OpAtomicOr => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2501 .OpAtomicXor => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2502 .OpPhi => struct { id_result_type: Id, id_result: Id, pair_id_ref_id_ref: []const PairIdRefIdRef = &.{} },
2503 .OpLoopMerge => struct { merge_block: Id, continue_target: Id, loop_control: LoopControl.Extended },
2504 .OpSelectionMerge => struct { merge_block: Id, selection_control: SelectionControl },
2505 .OpLabel => struct { id_result: Id },
2506 .OpBranch => struct { target_label: Id },
2507 .OpBranchConditional => struct { condition: Id, true_label: Id, false_label: Id, branch_weights: []const LiteralInteger = &.{} },
2508 .OpSwitch => struct { selector: Id, default: Id, target: []const PairLiteralIntegerIdRef = &.{} },
2509 .OpKill => void,
2510 .OpReturn => void,
2511 .OpReturnValue => struct { value: Id },
2512 .OpUnreachable => void,
2513 .OpLifetimeStart => struct { pointer: Id, size: LiteralInteger },
2514 .OpLifetimeStop => struct { pointer: Id, size: LiteralInteger },
2515 .OpGroupAsyncCopy => struct { id_result_type: Id, id_result: Id, execution: Id, destination: Id, source: Id, num_elements: Id, stride: Id, event: Id },
2516 .OpGroupWaitEvents => struct { execution: Id, num_events: Id, events_list: Id },
2517 .OpGroupAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2518 .OpGroupAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2519 .OpGroupBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, local_id: Id },
2520 .OpGroupIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2521 .OpGroupFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2522 .OpGroupFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2523 .OpGroupUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2524 .OpGroupSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2525 .OpGroupFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2526 .OpGroupUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2527 .OpGroupSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2528 .OpReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2529 .OpWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2530 .OpReservedReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2531 .OpReservedWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2532 .OpReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2533 .OpReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2534 .OpCommitReadPipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2535 .OpCommitWritePipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2536 .OpIsValidReserveId => struct { id_result_type: Id, id_result: Id, reserve_id: Id },
2537 .OpGetNumPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2538 .OpGetMaxPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2539 .OpGroupReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2540 .OpGroupReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2541 .OpGroupCommitReadPipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2542 .OpGroupCommitWritePipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2543 .OpEnqueueMarker => struct { id_result_type: Id, id_result: Id, queue: Id, num_events: Id, wait_events: Id, ret_event: Id },
2544 .OpEnqueueKernel => struct { id_result_type: Id, id_result: Id, queue: Id, flags: Id, nd_range: Id, num_events: Id, wait_events: Id, ret_event: Id, invoke: Id, param: Id, param_size: Id, param_align: Id, local_size: []const Id = &.{} },
2545 .OpGetKernelNDrangeSubGroupCount => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2546 .OpGetKernelNDrangeMaxSubGroupSize => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2547 .OpGetKernelWorkGroupSize => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2548 .OpGetKernelPreferredWorkGroupSizeMultiple => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2549 .OpRetainEvent => struct { event: Id },
2550 .OpReleaseEvent => struct { event: Id },
2551 .OpCreateUserEvent => struct { id_result_type: Id, id_result: Id },
2552 .OpIsValidEvent => struct { id_result_type: Id, id_result: Id, event: Id },
2553 .OpSetUserEventStatus => struct { event: Id, status: Id },
2554 .OpCaptureEventProfilingInfo => struct { event: Id, profiling_info: Id, value: Id },
2555 .OpGetDefaultQueue => struct { id_result_type: Id, id_result: Id },
2556 .OpBuildNDRange => struct { id_result_type: Id, id_result: Id, global_work_size: Id, local_work_size: Id, global_work_offset: Id },
2557 .OpImageSparseSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2558 .OpImageSparseSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2559 .OpImageSparseSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2560 .OpImageSparseSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2561 .OpImageSparseSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2562 .OpImageSparseSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2563 .OpImageSparseSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2564 .OpImageSparseSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2565 .OpImageSparseFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2566 .OpImageSparseGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2567 .OpImageSparseDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2568 .OpImageSparseTexelsResident => struct { id_result_type: Id, id_result: Id, resident_code: Id },
2569 .OpNoLine => void,
2570 .OpAtomicFlagTestAndSet => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2571 .OpAtomicFlagClear => struct { pointer: Id, memory: Id, semantics: Id },
2572 .OpImageSparseRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2573 .OpSizeOf => struct { id_result_type: Id, id_result: Id, pointer: Id },
2574 .OpTypePipeStorage => struct { id_result: Id },
2575 .OpConstantPipeStorage => struct { id_result_type: Id, id_result: Id, packet_size: LiteralInteger, packet_alignment: LiteralInteger, capacity: LiteralInteger },
2576 .OpCreatePipeFromPipeStorage => struct { id_result_type: Id, id_result: Id, pipe_storage: Id },
2577 .OpGetKernelLocalSizeForSubgroupCount => struct { id_result_type: Id, id_result: Id, subgroup_count: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2578 .OpGetKernelMaxNumSubgroups => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2579 .OpTypeNamedBarrier => struct { id_result: Id },
2580 .OpNamedBarrierInitialize => struct { id_result_type: Id, id_result: Id, subgroup_count: Id },
2581 .OpMemoryNamedBarrier => struct { named_barrier: Id, memory: Id, semantics: Id },
2582 .OpModuleProcessed => struct { process: LiteralString },
2583 .OpExecutionModeId => struct { entry_point: Id, mode: ExecutionMode.Extended },
2584 .OpDecorateId => struct { target: Id, decoration: Decoration.Extended },
2585 .OpGroupNonUniformElect => struct { id_result_type: Id, id_result: Id, execution: Id },
2586 .OpGroupNonUniformAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2587 .OpGroupNonUniformAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2588 .OpGroupNonUniformAllEqual => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2589 .OpGroupNonUniformBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2590 .OpGroupNonUniformBroadcastFirst => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2591 .OpGroupNonUniformBallot => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2592 .OpGroupNonUniformInverseBallot => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2593 .OpGroupNonUniformBallotBitExtract => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2594 .OpGroupNonUniformBallotBitCount => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id },
2595 .OpGroupNonUniformBallotFindLSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2596 .OpGroupNonUniformBallotFindMSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2597 .OpGroupNonUniformShuffle => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2598 .OpGroupNonUniformShuffleXor => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, mask: Id },
2599 .OpGroupNonUniformShuffleUp => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2600 .OpGroupNonUniformShuffleDown => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2601 .OpGroupNonUniformIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2602 .OpGroupNonUniformFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2603 .OpGroupNonUniformIMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2604 .OpGroupNonUniformFMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2605 .OpGroupNonUniformSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2606 .OpGroupNonUniformUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2607 .OpGroupNonUniformFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2608 .OpGroupNonUniformSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2609 .OpGroupNonUniformUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2610 .OpGroupNonUniformFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2611 .OpGroupNonUniformBitwiseAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2612 .OpGroupNonUniformBitwiseOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2613 .OpGroupNonUniformBitwiseXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2614 .OpGroupNonUniformLogicalAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2615 .OpGroupNonUniformLogicalOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2616 .OpGroupNonUniformLogicalXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2617 .OpGroupNonUniformQuadBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2618 .OpGroupNonUniformQuadSwap => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, direction: Id },
2619 .OpCopyLogical => struct { id_result_type: Id, id_result: Id, operand: Id },
2620 .OpPtrEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2621 .OpPtrNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2622 .OpPtrDiff => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2623 .OpColorAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, attachment: Id, sample: ?Id = null },
2624 .OpDepthAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2625 .OpStencilAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2626 .OpTypeTensorARM => struct { id_result: Id, element_type: Id, rank: ?Id = null, shape: ?Id = null },
2627 .OpTensorReadARM => struct { id_result_type: Id, id_result: Id, tensor: Id, coordinates: Id, tensor_operands: ?TensorOperands.Extended = null },
2628 .OpTensorWriteARM => struct { tensor: Id, coordinates: Id, object: Id, tensor_operands: ?TensorOperands.Extended = null },
2629 .OpTensorQuerySizeARM => struct { id_result_type: Id, id_result: Id, tensor: Id, dimension: Id },
2630 .OpGraphConstantARM => struct { id_result_type: Id, id_result: Id, graph_constant_id: LiteralInteger },
2631 .OpGraphEntryPointARM => struct { graph: Id, name: LiteralString, interface: []const Id = &.{} },
2632 .OpGraphARM => struct { id_result_type: Id, id_result: Id },
2633 .OpGraphInputARM => struct { id_result_type: Id, id_result: Id, input_index: Id, element_index: []const Id = &.{} },
2634 .OpGraphSetOutputARM => struct { value: Id, output_index: Id, element_index: []const Id = &.{} },
2635 .OpGraphEndARM => void,
2636 .OpTypeGraphARM => struct { id_result: Id, num_inputs: LiteralInteger, in_out_types: []const Id = &.{} },
2637 .OpTerminateInvocation => void,
2638 .OpTypeUntypedPointerKHR => struct { id_result: Id, storage_class: StorageClass },
2639 .OpUntypedVariableKHR => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, data_type: ?Id = null, initializer: ?Id = null },
2640 .OpUntypedAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2641 .OpUntypedInBoundsAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2642 .OpSubgroupBallotKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2643 .OpSubgroupFirstInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id },
2644 .OpUntypedPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2645 .OpUntypedInBoundsPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2646 .OpUntypedArrayLengthKHR => struct { id_result_type: Id, id_result: Id, structure: Id, pointer: Id, array_member: LiteralInteger },
2647 .OpUntypedPrefetchKHR => struct { pointer_type: Id, num_bytes: Id, rw: ?Id = null, locality: ?Id = null, cache_type: ?Id = null },
2648 .OpSubgroupAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2649 .OpSubgroupAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2650 .OpSubgroupAllEqualKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2651 .OpGroupNonUniformRotateKHR => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id, cluster_size: ?Id = null },
2652 .OpSubgroupReadInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id, index: Id },
2653 .OpExtInstWithForwardRefsKHR => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2654 .OpTraceRayKHR => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, payload: Id },
2655 .OpExecuteCallableKHR => struct { sbt_index: Id, callable_data: Id },
2656 .OpConvertUToAccelerationStructureKHR => struct { id_result_type: Id, id_result: Id, accel: Id },
2657 .OpIgnoreIntersectionKHR => void,
2658 .OpTerminateRayKHR => void,
2659 .OpSDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2660 .OpUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2661 .OpSUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2662 .OpSDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2663 .OpUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2664 .OpSUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2665 .OpTypeCooperativeMatrixKHR => struct { id_result: Id, component_type: Id, scope: Id, rows: Id, columns: Id, use: Id },
2666 .OpCooperativeMatrixLoadKHR => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2667 .OpCooperativeMatrixStoreKHR => struct { pointer: Id, object: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2668 .OpCooperativeMatrixMulAddKHR => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2669 .OpCooperativeMatrixLengthKHR => struct { id_result_type: Id, id_result: Id, type: Id },
2670 .OpConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2671 .OpSpecConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2672 .OpCompositeConstructReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2673 .OpTypeRayQueryKHR => struct { id_result: Id },
2674 .OpRayQueryInitializeKHR => struct { ray_query: Id, accel: Id, ray_flags: Id, cull_mask: Id, ray_origin: Id, ray_t_min: Id, ray_direction: Id, ray_t_max: Id },
2675 .OpRayQueryTerminateKHR => struct { ray_query: Id },
2676 .OpRayQueryGenerateIntersectionKHR => struct { ray_query: Id, hit_t: Id },
2677 .OpRayQueryConfirmIntersectionKHR => struct { ray_query: Id },
2678 .OpRayQueryProceedKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2679 .OpRayQueryGetIntersectionTypeKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2680 .OpImageSampleWeightedQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, weights: Id },
2681 .OpImageBoxFilterQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, box_size: Id },
2682 .OpImageBlockMatchSSDQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2683 .OpImageBlockMatchSADQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2684 .OpImageBlockMatchWindowSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2685 .OpImageBlockMatchWindowSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2686 .OpImageBlockMatchGatherSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2687 .OpImageBlockMatchGatherSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2688 .OpGroupIAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2689 .OpGroupFAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2690 .OpGroupFMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2691 .OpGroupUMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2692 .OpGroupSMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2693 .OpGroupFMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2694 .OpGroupUMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2695 .OpGroupSMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2696 .OpFragmentMaskFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2697 .OpFragmentFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, fragment_index: Id },
2698 .OpReadClockKHR => struct { id_result_type: Id, id_result: Id, scope: Id },
2699 .OpAllocateNodePayloadsAMDX => struct { id_result_type: Id, id_result: Id, visibility: Id, payload_count: Id, node_index: Id },
2700 .OpEnqueueNodePayloadsAMDX => struct { payload_array: Id },
2701 .OpTypeNodePayloadArrayAMDX => struct { id_result: Id, payload_type: Id },
2702 .OpFinishWritingNodePayloadAMDX => struct { id_result_type: Id, id_result: Id, payload: Id },
2703 .OpNodePayloadArrayLengthAMDX => struct { id_result_type: Id, id_result: Id, payload_array: Id },
2704 .OpIsNodePayloadValidAMDX => struct { id_result_type: Id, id_result: Id, payload_type: Id, node_index: Id },
2705 .OpConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2706 .OpSpecConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2707 .OpGroupNonUniformQuadAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2708 .OpGroupNonUniformQuadAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2709 .OpHitObjectRecordHitMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2710 .OpHitObjectRecordHitWithIndexMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2711 .OpHitObjectRecordMissMotionNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id },
2712 .OpHitObjectGetWorldToObjectNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2713 .OpHitObjectGetObjectToWorldNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2714 .OpHitObjectGetObjectRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2715 .OpHitObjectGetObjectRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2716 .OpHitObjectTraceRayMotionNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, time: Id, payload: Id },
2717 .OpHitObjectGetShaderRecordBufferHandleNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2718 .OpHitObjectGetShaderBindingTableRecordIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2719 .OpHitObjectRecordEmptyNV => struct { hit_object: Id },
2720 .OpHitObjectTraceRayNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, payload: Id },
2721 .OpHitObjectRecordHitNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2722 .OpHitObjectRecordHitWithIndexNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2723 .OpHitObjectRecordMissNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id },
2724 .OpHitObjectExecuteShaderNV => struct { hit_object: Id, payload: Id },
2725 .OpHitObjectGetCurrentTimeNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2726 .OpHitObjectGetAttributesNV => struct { hit_object: Id, hit_object_attribute: Id },
2727 .OpHitObjectGetHitKindNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2728 .OpHitObjectGetPrimitiveIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2729 .OpHitObjectGetGeometryIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2730 .OpHitObjectGetInstanceIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2731 .OpHitObjectGetInstanceCustomIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2732 .OpHitObjectGetWorldRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2733 .OpHitObjectGetWorldRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2734 .OpHitObjectGetRayTMaxNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2735 .OpHitObjectGetRayTMinNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2736 .OpHitObjectIsEmptyNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2737 .OpHitObjectIsHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2738 .OpHitObjectIsMissNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2739 .OpReorderThreadWithHitObjectNV => struct { hit_object: Id, hint: ?Id = null, bits: ?Id = null },
2740 .OpReorderThreadWithHintNV => struct { hint: Id, bits: Id },
2741 .OpTypeHitObjectNV => struct { id_result: Id },
2742 .OpImageSampleFootprintNV => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, granularity: Id, coarse: Id, image_operands: ?ImageOperands.Extended = null },
2743 .OpTypeCooperativeVectorNV => struct { id_result: Id, component_type: Id, component_count: Id },
2744 .OpCooperativeVectorMatrixMulNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2745 .OpCooperativeVectorOuterProductAccumulateNV => struct { pointer: Id, offset: Id, a: Id, b: Id, memory_layout: Id, matrix_interpretation: Id, matrix_stride: ?Id = null },
2746 .OpCooperativeVectorReduceSumAccumulateNV => struct { pointer: Id, offset: Id, v: Id },
2747 .OpCooperativeVectorMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, bias: Id, bias_offset: Id, bias_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2748 .OpCooperativeMatrixConvertNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2749 .OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },
2750 .OpSetMeshOutputsEXT => struct { vertex_count: Id, primitive_count: Id },
2751 .OpGroupNonUniformPartitionNV => struct { id_result_type: Id, id_result: Id, value: Id },
2752 .OpWritePackedPrimitiveIndices4x8NV => struct { index_offset: Id, packed_indices: Id },
2753 .OpFetchMicroTriangleVertexPositionNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2754 .OpFetchMicroTriangleVertexBarycentricNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2755 .OpCooperativeVectorLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, offset: Id, memory_access: ?MemoryAccess.Extended = null },
2756 .OpCooperativeVectorStoreNV => struct { pointer: Id, offset: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2757 .OpReportIntersectionKHR => struct { id_result_type: Id, id_result: Id, hit: Id, hit_kind: Id },
2758 .OpIgnoreIntersectionNV => void,
2759 .OpTerminateRayNV => void,
2760 .OpTraceNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, payload_id: Id },
2761 .OpTraceMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload_id: Id },
2762 .OpTraceRayMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload: Id },
2763 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2764 .OpTypeAccelerationStructureKHR => struct { id_result: Id },
2765 .OpExecuteCallableNV => struct { sbt_index: Id, callable_data_id: Id },
2766 .OpRayQueryGetClusterIdNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2767 .OpHitObjectGetClusterIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2768 .OpTypeCooperativeMatrixNV => struct { id_result: Id, component_type: Id, execution: Id, rows: Id, columns: Id },
2769 .OpCooperativeMatrixLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2770 .OpCooperativeMatrixStoreNV => struct { pointer: Id, object: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2771 .OpCooperativeMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id },
2772 .OpCooperativeMatrixLengthNV => struct { id_result_type: Id, id_result: Id, type: Id },
2773 .OpBeginInvocationInterlockEXT => void,
2774 .OpEndInvocationInterlockEXT => void,
2775 .OpCooperativeMatrixReduceNV => struct { id_result_type: Id, id_result: Id, matrix: Id, reduce: CooperativeMatrixReduce, combine_func: Id },
2776 .OpCooperativeMatrixLoadTensorNV => struct { id_result_type: Id, id_result: Id, pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2777 .OpCooperativeMatrixStoreTensorNV => struct { pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2778 .OpCooperativeMatrixPerElementOpNV => struct { id_result_type: Id, id_result: Id, matrix: Id, func: Id, operands: []const Id = &.{} },
2779 .OpTypeTensorLayoutNV => struct { id_result: Id, dim: Id, clamp_mode: Id },
2780 .OpTypeTensorViewNV => struct { id_result: Id, dim: Id, has_dimensions: Id, p: []const Id = &.{} },
2781 .OpCreateTensorLayoutNV => struct { id_result_type: Id, id_result: Id },
2782 .OpTensorLayoutSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, dim: []const Id = &.{} },
2783 .OpTensorLayoutSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, stride: []const Id = &.{} },
2784 .OpTensorLayoutSliceNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, operands: []const Id = &.{} },
2785 .OpTensorLayoutSetClampValueNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, value: Id },
2786 .OpCreateTensorViewNV => struct { id_result_type: Id, id_result: Id },
2787 .OpTensorViewSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, dim: []const Id = &.{} },
2788 .OpTensorViewSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, stride: []const Id = &.{} },
2789 .OpDemoteToHelperInvocation => void,
2790 .OpIsHelperInvocationEXT => struct { id_result_type: Id, id_result: Id },
2791 .OpTensorViewSetClipNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, clip_row_offset: Id, clip_row_span: Id, clip_col_offset: Id, clip_col_span: Id },
2792 .OpTensorLayoutSetBlockSizeNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, block_size: []const Id = &.{} },
2793 .OpCooperativeMatrixTransposeNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2794 .OpConvertUToImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2795 .OpConvertUToSamplerNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2796 .OpConvertImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2797 .OpConvertSamplerToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2798 .OpConvertUToSampledImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2799 .OpConvertSampledImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2800 .OpSamplerImageAddressingModeNV => struct { bit_width: LiteralInteger },
2801 .OpRawAccessChainNV => struct { id_result_type: Id, id_result: Id, base: Id, byte_stride: Id, element_index: Id, byte_offset: Id, raw_access_chain_operands: ?RawAccessChainOperands = null },
2802 .OpRayQueryGetIntersectionSpherePositionNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2803 .OpRayQueryGetIntersectionSphereRadiusNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2804 .OpRayQueryGetIntersectionLSSPositionsNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2805 .OpRayQueryGetIntersectionLSSRadiiNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2806 .OpRayQueryGetIntersectionLSSHitValueNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2807 .OpHitObjectGetSpherePositionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2808 .OpHitObjectGetSphereRadiusNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2809 .OpHitObjectGetLSSPositionsNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2810 .OpHitObjectGetLSSRadiiNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2811 .OpHitObjectIsSphereHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2812 .OpHitObjectIsLSSHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2813 .OpRayQueryIsSphereHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2814 .OpRayQueryIsLSSHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2815 .OpSubgroupShuffleINTEL => struct { id_result_type: Id, id_result: Id, data: Id, invocation_id: Id },
2816 .OpSubgroupShuffleDownINTEL => struct { id_result_type: Id, id_result: Id, current: Id, next: Id, delta: Id },
2817 .OpSubgroupShuffleUpINTEL => struct { id_result_type: Id, id_result: Id, previous: Id, current: Id, delta: Id },
2818 .OpSubgroupShuffleXorINTEL => struct { id_result_type: Id, id_result: Id, data: Id, value: Id },
2819 .OpSubgroupBlockReadINTEL => struct { id_result_type: Id, id_result: Id, ptr: Id },
2820 .OpSubgroupBlockWriteINTEL => struct { ptr: Id, data: Id },
2821 .OpSubgroupImageBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2822 .OpSubgroupImageBlockWriteINTEL => struct { image: Id, coordinate: Id, data: Id },
2823 .OpSubgroupImageMediaBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, width: Id, height: Id },
2824 .OpSubgroupImageMediaBlockWriteINTEL => struct { image: Id, coordinate: Id, width: Id, height: Id, data: Id },
2825 .OpUCountLeadingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2826 .OpUCountTrailingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2827 .OpAbsISubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2828 .OpAbsUSubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2829 .OpIAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2830 .OpUAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2831 .OpIAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2832 .OpUAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2833 .OpIAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2834 .OpUAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2835 .OpISubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2836 .OpUSubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2837 .OpIMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2838 .OpUMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2839 .OpAtomicFMinEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2840 .OpAtomicFMaxEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2841 .OpAssumeTrueKHR => struct { condition: Id },
2842 .OpExpectKHR => struct { id_result_type: Id, id_result: Id, value: Id, expected_value: Id },
2843 .OpDecorateString => struct { target: Id, decoration: Decoration.Extended },
2844 .OpMemberDecorateString => struct { struct_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2845 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },
2846 .OpReadPipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2847 .OpWritePipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2848 .OpFPGARegINTEL => struct { id_result_type: Id, id_result: Id, input: Id },
2849 .OpRayQueryGetRayTMinKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2850 .OpRayQueryGetRayFlagsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2851 .OpRayQueryGetIntersectionTKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2852 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2853 .OpRayQueryGetIntersectionInstanceIdKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2854 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2855 .OpRayQueryGetIntersectionGeometryIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2856 .OpRayQueryGetIntersectionPrimitiveIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2857 .OpRayQueryGetIntersectionBarycentricsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2858 .OpRayQueryGetIntersectionFrontFaceKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2859 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2860 .OpRayQueryGetIntersectionObjectRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2861 .OpRayQueryGetIntersectionObjectRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2862 .OpRayQueryGetWorldRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2863 .OpRayQueryGetWorldRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2864 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2865 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2866 .OpAtomicFAddEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2867 .OpTypeBufferSurfaceINTEL => struct { id_result: Id, access_qualifier: AccessQualifier },
2868 .OpTypeStructContinuedINTEL => struct { id_ref: []const Id = &.{} },
2869 .OpConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2870 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2871 .OpCompositeConstructContinuedINTEL => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2872 .OpConvertFToBF16INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2873 .OpConvertBF16ToFINTEL => struct { id_result_type: Id, id_result: Id, b_float16_value: Id },
2874 .OpControlBarrierArriveINTEL => struct { execution: Id, memory: Id, semantics: Id },
2875 .OpControlBarrierWaitINTEL => struct { execution: Id, memory: Id, semantics: Id },
2876 .OpArithmeticFenceEXT => struct { id_result_type: Id, id_result: Id, target: Id },
2877 .OpTaskSequenceCreateINTEL => struct { id_result_type: Id, id_result: Id, function: Id, pipelined: LiteralInteger, use_stall_enable_clusters: LiteralInteger, get_capacity: LiteralInteger, async_capacity: LiteralInteger },
2878 .OpTaskSequenceAsyncINTEL => struct { sequence: Id, arguments: []const Id = &.{} },
2879 .OpTaskSequenceGetINTEL => struct { id_result_type: Id, id_result: Id, sequence: Id },
2880 .OpTaskSequenceReleaseINTEL => struct { sequence: Id },
2881 .OpTypeTaskSequenceINTEL => struct { id_result: Id },
2882 .OpSubgroupBlockPrefetchINTEL => struct { ptr: Id, num_bytes: Id, memory_access: ?MemoryAccess.Extended = null },
2883 .OpSubgroup2DBlockLoadINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2884 .OpSubgroup2DBlockLoadTransformINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2885 .OpSubgroup2DBlockLoadTransposeINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2886 .OpSubgroup2DBlockPrefetchINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2887 .OpSubgroup2DBlockStoreINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_pointer: Id, dst_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2888 .OpSubgroupMatrixMultiplyAccumulateINTEL => struct { id_result_type: Id, id_result: Id, k_dim: Id, matrix_a: Id, matrix_b: Id, matrix_c: Id, matrix_multiply_accumulate_operands: ?MatrixMultiplyAccumulateOperands = null },
2889 .OpBitwiseFunctionINTEL => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, lut_index: Id },
2890 .OpGroupIMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2891 .OpGroupFMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2892 .OpGroupBitwiseAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2893 .OpGroupBitwiseOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2894 .OpGroupBitwiseXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2895 .OpGroupLogicalAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2896 .OpGroupLogicalOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2897 .OpGroupLogicalXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2898 .OpRoundFToTF32INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2899 .OpMaskedGatherINTEL => struct { id_result_type: Id, id_result: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id, fill_empty: Id },
2900 .OpMaskedScatterINTEL => struct { input_vector: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id },
2901 .OpConvertHandleToImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2902 .OpConvertHandleToSamplerINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2903 .OpConvertHandleToSampledImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2904 };
2905 }
2906 pub fn class(self: Opcode) Class {
2907 return switch (self) {
2908 .OpNop => .miscellaneous,
2909 .OpUndef => .miscellaneous,
2910 .OpSourceContinued => .debug,
2911 .OpSource => .debug,
2912 .OpSourceExtension => .debug,
2913 .OpName => .debug,
2914 .OpMemberName => .debug,
2915 .OpString => .debug,
2916 .OpLine => .debug,
2917 .OpExtension => .extension,
2918 .OpExtInstImport => .extension,
2919 .OpExtInst => .extension,
2920 .OpMemoryModel => .mode_setting,
2921 .OpEntryPoint => .mode_setting,
2922 .OpExecutionMode => .mode_setting,
2923 .OpCapability => .mode_setting,
2924 .OpTypeVoid => .type_declaration,
2925 .OpTypeBool => .type_declaration,
2926 .OpTypeInt => .type_declaration,
2927 .OpTypeFloat => .type_declaration,
2928 .OpTypeVector => .type_declaration,
2929 .OpTypeMatrix => .type_declaration,
2930 .OpTypeImage => .type_declaration,
2931 .OpTypeSampler => .type_declaration,
2932 .OpTypeSampledImage => .type_declaration,
2933 .OpTypeArray => .type_declaration,
2934 .OpTypeRuntimeArray => .type_declaration,
2935 .OpTypeStruct => .type_declaration,
2936 .OpTypeOpaque => .type_declaration,
2937 .OpTypePointer => .type_declaration,
2938 .OpTypeFunction => .type_declaration,
2939 .OpTypeEvent => .type_declaration,
2940 .OpTypeDeviceEvent => .type_declaration,
2941 .OpTypeReserveId => .type_declaration,
2942 .OpTypeQueue => .type_declaration,
2943 .OpTypePipe => .type_declaration,
2944 .OpTypeForwardPointer => .type_declaration,
2945 .OpConstantTrue => .constant_creation,
2946 .OpConstantFalse => .constant_creation,
2947 .OpConstant => .constant_creation,
2948 .OpConstantComposite => .constant_creation,
2949 .OpConstantSampler => .constant_creation,
2950 .OpConstantNull => .constant_creation,
2951 .OpSpecConstantTrue => .constant_creation,
2952 .OpSpecConstantFalse => .constant_creation,
2953 .OpSpecConstant => .constant_creation,
2954 .OpSpecConstantComposite => .constant_creation,
2955 .OpSpecConstantOp => .constant_creation,
2956 .OpFunction => .function,
2957 .OpFunctionParameter => .function,
2958 .OpFunctionEnd => .function,
2959 .OpFunctionCall => .function,
2960 .OpVariable => .memory,
2961 .OpImageTexelPointer => .memory,
2962 .OpLoad => .memory,
2963 .OpStore => .memory,
2964 .OpCopyMemory => .memory,
2965 .OpCopyMemorySized => .memory,
2966 .OpAccessChain => .memory,
2967 .OpInBoundsAccessChain => .memory,
2968 .OpPtrAccessChain => .memory,
2969 .OpArrayLength => .memory,
2970 .OpGenericPtrMemSemantics => .memory,
2971 .OpInBoundsPtrAccessChain => .memory,
2972 .OpDecorate => .annotation,
2973 .OpMemberDecorate => .annotation,
2974 .OpDecorationGroup => .annotation,
2975 .OpGroupDecorate => .annotation,
2976 .OpGroupMemberDecorate => .annotation,
2977 .OpVectorExtractDynamic => .composite,
2978 .OpVectorInsertDynamic => .composite,
2979 .OpVectorShuffle => .composite,
2980 .OpCompositeConstruct => .composite,
2981 .OpCompositeExtract => .composite,
2982 .OpCompositeInsert => .composite,
2983 .OpCopyObject => .composite,
2984 .OpTranspose => .composite,
2985 .OpSampledImage => .image,
2986 .OpImageSampleImplicitLod => .image,
2987 .OpImageSampleExplicitLod => .image,
2988 .OpImageSampleDrefImplicitLod => .image,
2989 .OpImageSampleDrefExplicitLod => .image,
2990 .OpImageSampleProjImplicitLod => .image,
2991 .OpImageSampleProjExplicitLod => .image,
2992 .OpImageSampleProjDrefImplicitLod => .image,
2993 .OpImageSampleProjDrefExplicitLod => .image,
2994 .OpImageFetch => .image,
2995 .OpImageGather => .image,
2996 .OpImageDrefGather => .image,
2997 .OpImageRead => .image,
2998 .OpImageWrite => .image,
2999 .OpImage => .image,
3000 .OpImageQueryFormat => .image,
3001 .OpImageQueryOrder => .image,
3002 .OpImageQuerySizeLod => .image,
3003 .OpImageQuerySize => .image,
3004 .OpImageQueryLod => .image,
3005 .OpImageQueryLevels => .image,
3006 .OpImageQuerySamples => .image,
3007 .OpConvertFToU => .conversion,
3008 .OpConvertFToS => .conversion,
3009 .OpConvertSToF => .conversion,
3010 .OpConvertUToF => .conversion,
3011 .OpUConvert => .conversion,
3012 .OpSConvert => .conversion,
3013 .OpFConvert => .conversion,
3014 .OpQuantizeToF16 => .conversion,
3015 .OpConvertPtrToU => .conversion,
3016 .OpSatConvertSToU => .conversion,
3017 .OpSatConvertUToS => .conversion,
3018 .OpConvertUToPtr => .conversion,
3019 .OpPtrCastToGeneric => .conversion,
3020 .OpGenericCastToPtr => .conversion,
3021 .OpGenericCastToPtrExplicit => .conversion,
3022 .OpBitcast => .conversion,
3023 .OpSNegate => .arithmetic,
3024 .OpFNegate => .arithmetic,
3025 .OpIAdd => .arithmetic,
3026 .OpFAdd => .arithmetic,
3027 .OpISub => .arithmetic,
3028 .OpFSub => .arithmetic,
3029 .OpIMul => .arithmetic,
3030 .OpFMul => .arithmetic,
3031 .OpUDiv => .arithmetic,
3032 .OpSDiv => .arithmetic,
3033 .OpFDiv => .arithmetic,
3034 .OpUMod => .arithmetic,
3035 .OpSRem => .arithmetic,
3036 .OpSMod => .arithmetic,
3037 .OpFRem => .arithmetic,
3038 .OpFMod => .arithmetic,
3039 .OpVectorTimesScalar => .arithmetic,
3040 .OpMatrixTimesScalar => .arithmetic,
3041 .OpVectorTimesMatrix => .arithmetic,
3042 .OpMatrixTimesVector => .arithmetic,
3043 .OpMatrixTimesMatrix => .arithmetic,
3044 .OpOuterProduct => .arithmetic,
3045 .OpDot => .arithmetic,
3046 .OpIAddCarry => .arithmetic,
3047 .OpISubBorrow => .arithmetic,
3048 .OpUMulExtended => .arithmetic,
3049 .OpSMulExtended => .arithmetic,
3050 .OpAny => .relational_and_logical,
3051 .OpAll => .relational_and_logical,
3052 .OpIsNan => .relational_and_logical,
3053 .OpIsInf => .relational_and_logical,
3054 .OpIsFinite => .relational_and_logical,
3055 .OpIsNormal => .relational_and_logical,
3056 .OpSignBitSet => .relational_and_logical,
3057 .OpLessOrGreater => .relational_and_logical,
3058 .OpOrdered => .relational_and_logical,
3059 .OpUnordered => .relational_and_logical,
3060 .OpLogicalEqual => .relational_and_logical,
3061 .OpLogicalNotEqual => .relational_and_logical,
3062 .OpLogicalOr => .relational_and_logical,
3063 .OpLogicalAnd => .relational_and_logical,
3064 .OpLogicalNot => .relational_and_logical,
3065 .OpSelect => .relational_and_logical,
3066 .OpIEqual => .relational_and_logical,
3067 .OpINotEqual => .relational_and_logical,
3068 .OpUGreaterThan => .relational_and_logical,
3069 .OpSGreaterThan => .relational_and_logical,
3070 .OpUGreaterThanEqual => .relational_and_logical,
3071 .OpSGreaterThanEqual => .relational_and_logical,
3072 .OpULessThan => .relational_and_logical,
3073 .OpSLessThan => .relational_and_logical,
3074 .OpULessThanEqual => .relational_and_logical,
3075 .OpSLessThanEqual => .relational_and_logical,
3076 .OpFOrdEqual => .relational_and_logical,
3077 .OpFUnordEqual => .relational_and_logical,
3078 .OpFOrdNotEqual => .relational_and_logical,
3079 .OpFUnordNotEqual => .relational_and_logical,
3080 .OpFOrdLessThan => .relational_and_logical,
3081 .OpFUnordLessThan => .relational_and_logical,
3082 .OpFOrdGreaterThan => .relational_and_logical,
3083 .OpFUnordGreaterThan => .relational_and_logical,
3084 .OpFOrdLessThanEqual => .relational_and_logical,
3085 .OpFUnordLessThanEqual => .relational_and_logical,
3086 .OpFOrdGreaterThanEqual => .relational_and_logical,
3087 .OpFUnordGreaterThanEqual => .relational_and_logical,
3088 .OpShiftRightLogical => .bit,
3089 .OpShiftRightArithmetic => .bit,
3090 .OpShiftLeftLogical => .bit,
3091 .OpBitwiseOr => .bit,
3092 .OpBitwiseXor => .bit,
3093 .OpBitwiseAnd => .bit,
3094 .OpNot => .bit,
3095 .OpBitFieldInsert => .bit,
3096 .OpBitFieldSExtract => .bit,
3097 .OpBitFieldUExtract => .bit,
3098 .OpBitReverse => .bit,
3099 .OpBitCount => .bit,
3100 .OpDPdx => .derivative,
3101 .OpDPdy => .derivative,
3102 .OpFwidth => .derivative,
3103 .OpDPdxFine => .derivative,
3104 .OpDPdyFine => .derivative,
3105 .OpFwidthFine => .derivative,
3106 .OpDPdxCoarse => .derivative,
3107 .OpDPdyCoarse => .derivative,
3108 .OpFwidthCoarse => .derivative,
3109 .OpEmitVertex => .primitive,
3110 .OpEndPrimitive => .primitive,
3111 .OpEmitStreamVertex => .primitive,
3112 .OpEndStreamPrimitive => .primitive,
3113 .OpControlBarrier => .barrier,
3114 .OpMemoryBarrier => .barrier,
3115 .OpAtomicLoad => .atomic,
3116 .OpAtomicStore => .atomic,
3117 .OpAtomicExchange => .atomic,
3118 .OpAtomicCompareExchange => .atomic,
3119 .OpAtomicCompareExchangeWeak => .atomic,
3120 .OpAtomicIIncrement => .atomic,
3121 .OpAtomicIDecrement => .atomic,
3122 .OpAtomicIAdd => .atomic,
3123 .OpAtomicISub => .atomic,
3124 .OpAtomicSMin => .atomic,
3125 .OpAtomicUMin => .atomic,
3126 .OpAtomicSMax => .atomic,
3127 .OpAtomicUMax => .atomic,
3128 .OpAtomicAnd => .atomic,
3129 .OpAtomicOr => .atomic,
3130 .OpAtomicXor => .atomic,
3131 .OpPhi => .control_flow,
3132 .OpLoopMerge => .control_flow,
3133 .OpSelectionMerge => .control_flow,
3134 .OpLabel => .control_flow,
3135 .OpBranch => .control_flow,
3136 .OpBranchConditional => .control_flow,
3137 .OpSwitch => .control_flow,
3138 .OpKill => .control_flow,
3139 .OpReturn => .control_flow,
3140 .OpReturnValue => .control_flow,
3141 .OpUnreachable => .control_flow,
3142 .OpLifetimeStart => .control_flow,
3143 .OpLifetimeStop => .control_flow,
3144 .OpGroupAsyncCopy => .group,
3145 .OpGroupWaitEvents => .group,
3146 .OpGroupAll => .group,
3147 .OpGroupAny => .group,
3148 .OpGroupBroadcast => .group,
3149 .OpGroupIAdd => .group,
3150 .OpGroupFAdd => .group,
3151 .OpGroupFMin => .group,
3152 .OpGroupUMin => .group,
3153 .OpGroupSMin => .group,
3154 .OpGroupFMax => .group,
3155 .OpGroupUMax => .group,
3156 .OpGroupSMax => .group,
3157 .OpReadPipe => .pipe,
3158 .OpWritePipe => .pipe,
3159 .OpReservedReadPipe => .pipe,
3160 .OpReservedWritePipe => .pipe,
3161 .OpReserveReadPipePackets => .pipe,
3162 .OpReserveWritePipePackets => .pipe,
3163 .OpCommitReadPipe => .pipe,
3164 .OpCommitWritePipe => .pipe,
3165 .OpIsValidReserveId => .pipe,
3166 .OpGetNumPipePackets => .pipe,
3167 .OpGetMaxPipePackets => .pipe,
3168 .OpGroupReserveReadPipePackets => .pipe,
3169 .OpGroupReserveWritePipePackets => .pipe,
3170 .OpGroupCommitReadPipe => .pipe,
3171 .OpGroupCommitWritePipe => .pipe,
3172 .OpEnqueueMarker => .device_side_enqueue,
3173 .OpEnqueueKernel => .device_side_enqueue,
3174 .OpGetKernelNDrangeSubGroupCount => .device_side_enqueue,
3175 .OpGetKernelNDrangeMaxSubGroupSize => .device_side_enqueue,
3176 .OpGetKernelWorkGroupSize => .device_side_enqueue,
3177 .OpGetKernelPreferredWorkGroupSizeMultiple => .device_side_enqueue,
3178 .OpRetainEvent => .device_side_enqueue,
3179 .OpReleaseEvent => .device_side_enqueue,
3180 .OpCreateUserEvent => .device_side_enqueue,
3181 .OpIsValidEvent => .device_side_enqueue,
3182 .OpSetUserEventStatus => .device_side_enqueue,
3183 .OpCaptureEventProfilingInfo => .device_side_enqueue,
3184 .OpGetDefaultQueue => .device_side_enqueue,
3185 .OpBuildNDRange => .device_side_enqueue,
3186 .OpImageSparseSampleImplicitLod => .image,
3187 .OpImageSparseSampleExplicitLod => .image,
3188 .OpImageSparseSampleDrefImplicitLod => .image,
3189 .OpImageSparseSampleDrefExplicitLod => .image,
3190 .OpImageSparseSampleProjImplicitLod => .image,
3191 .OpImageSparseSampleProjExplicitLod => .image,
3192 .OpImageSparseSampleProjDrefImplicitLod => .image,
3193 .OpImageSparseSampleProjDrefExplicitLod => .image,
3194 .OpImageSparseFetch => .image,
3195 .OpImageSparseGather => .image,
3196 .OpImageSparseDrefGather => .image,
3197 .OpImageSparseTexelsResident => .image,
3198 .OpNoLine => .debug,
3199 .OpAtomicFlagTestAndSet => .atomic,
3200 .OpAtomicFlagClear => .atomic,
3201 .OpImageSparseRead => .image,
3202 .OpSizeOf => .miscellaneous,
3203 .OpTypePipeStorage => .type_declaration,
3204 .OpConstantPipeStorage => .pipe,
3205 .OpCreatePipeFromPipeStorage => .pipe,
3206 .OpGetKernelLocalSizeForSubgroupCount => .device_side_enqueue,
3207 .OpGetKernelMaxNumSubgroups => .device_side_enqueue,
3208 .OpTypeNamedBarrier => .type_declaration,
3209 .OpNamedBarrierInitialize => .barrier,
3210 .OpMemoryNamedBarrier => .barrier,
3211 .OpModuleProcessed => .debug,
3212 .OpExecutionModeId => .mode_setting,
3213 .OpDecorateId => .annotation,
3214 .OpGroupNonUniformElect => .non_uniform,
3215 .OpGroupNonUniformAll => .non_uniform,
3216 .OpGroupNonUniformAny => .non_uniform,
3217 .OpGroupNonUniformAllEqual => .non_uniform,
3218 .OpGroupNonUniformBroadcast => .non_uniform,
3219 .OpGroupNonUniformBroadcastFirst => .non_uniform,
3220 .OpGroupNonUniformBallot => .non_uniform,
3221 .OpGroupNonUniformInverseBallot => .non_uniform,
3222 .OpGroupNonUniformBallotBitExtract => .non_uniform,
3223 .OpGroupNonUniformBallotBitCount => .non_uniform,
3224 .OpGroupNonUniformBallotFindLSB => .non_uniform,
3225 .OpGroupNonUniformBallotFindMSB => .non_uniform,
3226 .OpGroupNonUniformShuffle => .non_uniform,
3227 .OpGroupNonUniformShuffleXor => .non_uniform,
3228 .OpGroupNonUniformShuffleUp => .non_uniform,
3229 .OpGroupNonUniformShuffleDown => .non_uniform,
3230 .OpGroupNonUniformIAdd => .non_uniform,
3231 .OpGroupNonUniformFAdd => .non_uniform,
3232 .OpGroupNonUniformIMul => .non_uniform,
3233 .OpGroupNonUniformFMul => .non_uniform,
3234 .OpGroupNonUniformSMin => .non_uniform,
3235 .OpGroupNonUniformUMin => .non_uniform,
3236 .OpGroupNonUniformFMin => .non_uniform,
3237 .OpGroupNonUniformSMax => .non_uniform,
3238 .OpGroupNonUniformUMax => .non_uniform,
3239 .OpGroupNonUniformFMax => .non_uniform,
3240 .OpGroupNonUniformBitwiseAnd => .non_uniform,
3241 .OpGroupNonUniformBitwiseOr => .non_uniform,
3242 .OpGroupNonUniformBitwiseXor => .non_uniform,
3243 .OpGroupNonUniformLogicalAnd => .non_uniform,
3244 .OpGroupNonUniformLogicalOr => .non_uniform,
3245 .OpGroupNonUniformLogicalXor => .non_uniform,
3246 .OpGroupNonUniformQuadBroadcast => .non_uniform,
3247 .OpGroupNonUniformQuadSwap => .non_uniform,
3248 .OpCopyLogical => .composite,
3249 .OpPtrEqual => .memory,
3250 .OpPtrNotEqual => .memory,
3251 .OpPtrDiff => .memory,
3252 .OpColorAttachmentReadEXT => .image,
3253 .OpDepthAttachmentReadEXT => .image,
3254 .OpStencilAttachmentReadEXT => .image,
3255 .OpTypeTensorARM => .type_declaration,
3256 .OpTensorReadARM => .tensor,
3257 .OpTensorWriteARM => .tensor,
3258 .OpTensorQuerySizeARM => .tensor,
3259 .OpGraphConstantARM => .graph,
3260 .OpGraphEntryPointARM => .graph,
3261 .OpGraphARM => .graph,
3262 .OpGraphInputARM => .graph,
3263 .OpGraphSetOutputARM => .graph,
3264 .OpGraphEndARM => .graph,
3265 .OpTypeGraphARM => .type_declaration,
3266 .OpTerminateInvocation => .control_flow,
3267 .OpTypeUntypedPointerKHR => .type_declaration,
3268 .OpUntypedVariableKHR => .memory,
3269 .OpUntypedAccessChainKHR => .memory,
3270 .OpUntypedInBoundsAccessChainKHR => .memory,
3271 .OpSubgroupBallotKHR => .group,
3272 .OpSubgroupFirstInvocationKHR => .group,
3273 .OpUntypedPtrAccessChainKHR => .memory,
3274 .OpUntypedInBoundsPtrAccessChainKHR => .memory,
3275 .OpUntypedArrayLengthKHR => .memory,
3276 .OpUntypedPrefetchKHR => .memory,
3277 .OpSubgroupAllKHR => .group,
3278 .OpSubgroupAnyKHR => .group,
3279 .OpSubgroupAllEqualKHR => .group,
3280 .OpGroupNonUniformRotateKHR => .group,
3281 .OpSubgroupReadInvocationKHR => .group,
3282 .OpExtInstWithForwardRefsKHR => .extension,
3283 .OpTraceRayKHR => .reserved,
3284 .OpExecuteCallableKHR => .reserved,
3285 .OpConvertUToAccelerationStructureKHR => .reserved,
3286 .OpIgnoreIntersectionKHR => .reserved,
3287 .OpTerminateRayKHR => .reserved,
3288 .OpSDot => .arithmetic,
3289 .OpUDot => .arithmetic,
3290 .OpSUDot => .arithmetic,
3291 .OpSDotAccSat => .arithmetic,
3292 .OpUDotAccSat => .arithmetic,
3293 .OpSUDotAccSat => .arithmetic,
3294 .OpTypeCooperativeMatrixKHR => .type_declaration,
3295 .OpCooperativeMatrixLoadKHR => .memory,
3296 .OpCooperativeMatrixStoreKHR => .memory,
3297 .OpCooperativeMatrixMulAddKHR => .arithmetic,
3298 .OpCooperativeMatrixLengthKHR => .miscellaneous,
3299 .OpConstantCompositeReplicateEXT => .constant_creation,
3300 .OpSpecConstantCompositeReplicateEXT => .constant_creation,
3301 .OpCompositeConstructReplicateEXT => .composite,
3302 .OpTypeRayQueryKHR => .type_declaration,
3303 .OpRayQueryInitializeKHR => .reserved,
3304 .OpRayQueryTerminateKHR => .reserved,
3305 .OpRayQueryGenerateIntersectionKHR => .reserved,
3306 .OpRayQueryConfirmIntersectionKHR => .reserved,
3307 .OpRayQueryProceedKHR => .reserved,
3308 .OpRayQueryGetIntersectionTypeKHR => .reserved,
3309 .OpImageSampleWeightedQCOM => .image,
3310 .OpImageBoxFilterQCOM => .image,
3311 .OpImageBlockMatchSSDQCOM => .image,
3312 .OpImageBlockMatchSADQCOM => .image,
3313 .OpImageBlockMatchWindowSSDQCOM => .image,
3314 .OpImageBlockMatchWindowSADQCOM => .image,
3315 .OpImageBlockMatchGatherSSDQCOM => .image,
3316 .OpImageBlockMatchGatherSADQCOM => .image,
3317 .OpGroupIAddNonUniformAMD => .group,
3318 .OpGroupFAddNonUniformAMD => .group,
3319 .OpGroupFMinNonUniformAMD => .group,
3320 .OpGroupUMinNonUniformAMD => .group,
3321 .OpGroupSMinNonUniformAMD => .group,
3322 .OpGroupFMaxNonUniformAMD => .group,
3323 .OpGroupUMaxNonUniformAMD => .group,
3324 .OpGroupSMaxNonUniformAMD => .group,
3325 .OpFragmentMaskFetchAMD => .reserved,
3326 .OpFragmentFetchAMD => .reserved,
3327 .OpReadClockKHR => .reserved,
3328 .OpAllocateNodePayloadsAMDX => .reserved,
3329 .OpEnqueueNodePayloadsAMDX => .reserved,
3330 .OpTypeNodePayloadArrayAMDX => .reserved,
3331 .OpFinishWritingNodePayloadAMDX => .reserved,
3332 .OpNodePayloadArrayLengthAMDX => .reserved,
3333 .OpIsNodePayloadValidAMDX => .reserved,
3334 .OpConstantStringAMDX => .reserved,
3335 .OpSpecConstantStringAMDX => .reserved,
3336 .OpGroupNonUniformQuadAllKHR => .non_uniform,
3337 .OpGroupNonUniformQuadAnyKHR => .non_uniform,
3338 .OpHitObjectRecordHitMotionNV => .reserved,
3339 .OpHitObjectRecordHitWithIndexMotionNV => .reserved,
3340 .OpHitObjectRecordMissMotionNV => .reserved,
3341 .OpHitObjectGetWorldToObjectNV => .reserved,
3342 .OpHitObjectGetObjectToWorldNV => .reserved,
3343 .OpHitObjectGetObjectRayDirectionNV => .reserved,
3344 .OpHitObjectGetObjectRayOriginNV => .reserved,
3345 .OpHitObjectTraceRayMotionNV => .reserved,
3346 .OpHitObjectGetShaderRecordBufferHandleNV => .reserved,
3347 .OpHitObjectGetShaderBindingTableRecordIndexNV => .reserved,
3348 .OpHitObjectRecordEmptyNV => .reserved,
3349 .OpHitObjectTraceRayNV => .reserved,
3350 .OpHitObjectRecordHitNV => .reserved,
3351 .OpHitObjectRecordHitWithIndexNV => .reserved,
3352 .OpHitObjectRecordMissNV => .reserved,
3353 .OpHitObjectExecuteShaderNV => .reserved,
3354 .OpHitObjectGetCurrentTimeNV => .reserved,
3355 .OpHitObjectGetAttributesNV => .reserved,
3356 .OpHitObjectGetHitKindNV => .reserved,
3357 .OpHitObjectGetPrimitiveIndexNV => .reserved,
3358 .OpHitObjectGetGeometryIndexNV => .reserved,
3359 .OpHitObjectGetInstanceIdNV => .reserved,
3360 .OpHitObjectGetInstanceCustomIndexNV => .reserved,
3361 .OpHitObjectGetWorldRayDirectionNV => .reserved,
3362 .OpHitObjectGetWorldRayOriginNV => .reserved,
3363 .OpHitObjectGetRayTMaxNV => .reserved,
3364 .OpHitObjectGetRayTMinNV => .reserved,
3365 .OpHitObjectIsEmptyNV => .reserved,
3366 .OpHitObjectIsHitNV => .reserved,
3367 .OpHitObjectIsMissNV => .reserved,
3368 .OpReorderThreadWithHitObjectNV => .reserved,
3369 .OpReorderThreadWithHintNV => .reserved,
3370 .OpTypeHitObjectNV => .type_declaration,
3371 .OpImageSampleFootprintNV => .image,
3372 .OpTypeCooperativeVectorNV => .type_declaration,
3373 .OpCooperativeVectorMatrixMulNV => .reserved,
3374 .OpCooperativeVectorOuterProductAccumulateNV => .reserved,
3375 .OpCooperativeVectorReduceSumAccumulateNV => .reserved,
3376 .OpCooperativeVectorMatrixMulAddNV => .reserved,
3377 .OpCooperativeMatrixConvertNV => .conversion,
3378 .OpEmitMeshTasksEXT => .reserved,
3379 .OpSetMeshOutputsEXT => .reserved,
3380 .OpGroupNonUniformPartitionNV => .non_uniform,
3381 .OpWritePackedPrimitiveIndices4x8NV => .reserved,
3382 .OpFetchMicroTriangleVertexPositionNV => .reserved,
3383 .OpFetchMicroTriangleVertexBarycentricNV => .reserved,
3384 .OpCooperativeVectorLoadNV => .memory,
3385 .OpCooperativeVectorStoreNV => .memory,
3386 .OpReportIntersectionKHR => .reserved,
3387 .OpIgnoreIntersectionNV => .reserved,
3388 .OpTerminateRayNV => .reserved,
3389 .OpTraceNV => .reserved,
3390 .OpTraceMotionNV => .reserved,
3391 .OpTraceRayMotionNV => .reserved,
3392 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => .reserved,
3393 .OpTypeAccelerationStructureKHR => .type_declaration,
3394 .OpExecuteCallableNV => .reserved,
3395 .OpRayQueryGetClusterIdNV => .reserved,
3396 .OpHitObjectGetClusterIdNV => .reserved,
3397 .OpTypeCooperativeMatrixNV => .type_declaration,
3398 .OpCooperativeMatrixLoadNV => .reserved,
3399 .OpCooperativeMatrixStoreNV => .reserved,
3400 .OpCooperativeMatrixMulAddNV => .reserved,
3401 .OpCooperativeMatrixLengthNV => .reserved,
3402 .OpBeginInvocationInterlockEXT => .reserved,
3403 .OpEndInvocationInterlockEXT => .reserved,
3404 .OpCooperativeMatrixReduceNV => .arithmetic,
3405 .OpCooperativeMatrixLoadTensorNV => .memory,
3406 .OpCooperativeMatrixStoreTensorNV => .memory,
3407 .OpCooperativeMatrixPerElementOpNV => .function,
3408 .OpTypeTensorLayoutNV => .type_declaration,
3409 .OpTypeTensorViewNV => .type_declaration,
3410 .OpCreateTensorLayoutNV => .reserved,
3411 .OpTensorLayoutSetDimensionNV => .reserved,
3412 .OpTensorLayoutSetStrideNV => .reserved,
3413 .OpTensorLayoutSliceNV => .reserved,
3414 .OpTensorLayoutSetClampValueNV => .reserved,
3415 .OpCreateTensorViewNV => .reserved,
3416 .OpTensorViewSetDimensionNV => .reserved,
3417 .OpTensorViewSetStrideNV => .reserved,
3418 .OpDemoteToHelperInvocation => .control_flow,
3419 .OpIsHelperInvocationEXT => .reserved,
3420 .OpTensorViewSetClipNV => .reserved,
3421 .OpTensorLayoutSetBlockSizeNV => .reserved,
3422 .OpCooperativeMatrixTransposeNV => .conversion,
3423 .OpConvertUToImageNV => .reserved,
3424 .OpConvertUToSamplerNV => .reserved,
3425 .OpConvertImageToUNV => .reserved,
3426 .OpConvertSamplerToUNV => .reserved,
3427 .OpConvertUToSampledImageNV => .reserved,
3428 .OpConvertSampledImageToUNV => .reserved,
3429 .OpSamplerImageAddressingModeNV => .reserved,
3430 .OpRawAccessChainNV => .memory,
3431 .OpRayQueryGetIntersectionSpherePositionNV => .reserved,
3432 .OpRayQueryGetIntersectionSphereRadiusNV => .reserved,
3433 .OpRayQueryGetIntersectionLSSPositionsNV => .reserved,
3434 .OpRayQueryGetIntersectionLSSRadiiNV => .reserved,
3435 .OpRayQueryGetIntersectionLSSHitValueNV => .reserved,
3436 .OpHitObjectGetSpherePositionNV => .reserved,
3437 .OpHitObjectGetSphereRadiusNV => .reserved,
3438 .OpHitObjectGetLSSPositionsNV => .reserved,
3439 .OpHitObjectGetLSSRadiiNV => .reserved,
3440 .OpHitObjectIsSphereHitNV => .reserved,
3441 .OpHitObjectIsLSSHitNV => .reserved,
3442 .OpRayQueryIsSphereHitNV => .reserved,
3443 .OpRayQueryIsLSSHitNV => .reserved,
3444 .OpSubgroupShuffleINTEL => .group,
3445 .OpSubgroupShuffleDownINTEL => .group,
3446 .OpSubgroupShuffleUpINTEL => .group,
3447 .OpSubgroupShuffleXorINTEL => .group,
3448 .OpSubgroupBlockReadINTEL => .group,
3449 .OpSubgroupBlockWriteINTEL => .group,
3450 .OpSubgroupImageBlockReadINTEL => .group,
3451 .OpSubgroupImageBlockWriteINTEL => .group,
3452 .OpSubgroupImageMediaBlockReadINTEL => .group,
3453 .OpSubgroupImageMediaBlockWriteINTEL => .group,
3454 .OpUCountLeadingZerosINTEL => .reserved,
3455 .OpUCountTrailingZerosINTEL => .reserved,
3456 .OpAbsISubINTEL => .reserved,
3457 .OpAbsUSubINTEL => .reserved,
3458 .OpIAddSatINTEL => .reserved,
3459 .OpUAddSatINTEL => .reserved,
3460 .OpIAverageINTEL => .reserved,
3461 .OpUAverageINTEL => .reserved,
3462 .OpIAverageRoundedINTEL => .reserved,
3463 .OpUAverageRoundedINTEL => .reserved,
3464 .OpISubSatINTEL => .reserved,
3465 .OpUSubSatINTEL => .reserved,
3466 .OpIMul32x16INTEL => .reserved,
3467 .OpUMul32x16INTEL => .reserved,
3468 .OpAtomicFMinEXT => .atomic,
3469 .OpAtomicFMaxEXT => .atomic,
3470 .OpAssumeTrueKHR => .miscellaneous,
3471 .OpExpectKHR => .miscellaneous,
3472 .OpDecorateString => .annotation,
3473 .OpMemberDecorateString => .annotation,
3474 .OpLoopControlINTEL => .reserved,
3475 .OpReadPipeBlockingINTEL => .pipe,
3476 .OpWritePipeBlockingINTEL => .pipe,
3477 .OpFPGARegINTEL => .reserved,
3478 .OpRayQueryGetRayTMinKHR => .reserved,
3479 .OpRayQueryGetRayFlagsKHR => .reserved,
3480 .OpRayQueryGetIntersectionTKHR => .reserved,
3481 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => .reserved,
3482 .OpRayQueryGetIntersectionInstanceIdKHR => .reserved,
3483 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => .reserved,
3484 .OpRayQueryGetIntersectionGeometryIndexKHR => .reserved,
3485 .OpRayQueryGetIntersectionPrimitiveIndexKHR => .reserved,
3486 .OpRayQueryGetIntersectionBarycentricsKHR => .reserved,
3487 .OpRayQueryGetIntersectionFrontFaceKHR => .reserved,
3488 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => .reserved,
3489 .OpRayQueryGetIntersectionObjectRayDirectionKHR => .reserved,
3490 .OpRayQueryGetIntersectionObjectRayOriginKHR => .reserved,
3491 .OpRayQueryGetWorldRayDirectionKHR => .reserved,
3492 .OpRayQueryGetWorldRayOriginKHR => .reserved,
3493 .OpRayQueryGetIntersectionObjectToWorldKHR => .reserved,
3494 .OpRayQueryGetIntersectionWorldToObjectKHR => .reserved,
3495 .OpAtomicFAddEXT => .atomic,
3496 .OpTypeBufferSurfaceINTEL => .type_declaration,
3497 .OpTypeStructContinuedINTEL => .type_declaration,
3498 .OpConstantCompositeContinuedINTEL => .constant_creation,
3499 .OpSpecConstantCompositeContinuedINTEL => .constant_creation,
3500 .OpCompositeConstructContinuedINTEL => .composite,
3501 .OpConvertFToBF16INTEL => .conversion,
3502 .OpConvertBF16ToFINTEL => .conversion,
3503 .OpControlBarrierArriveINTEL => .barrier,
3504 .OpControlBarrierWaitINTEL => .barrier,
3505 .OpArithmeticFenceEXT => .miscellaneous,
3506 .OpTaskSequenceCreateINTEL => .reserved,
3507 .OpTaskSequenceAsyncINTEL => .reserved,
3508 .OpTaskSequenceGetINTEL => .reserved,
3509 .OpTaskSequenceReleaseINTEL => .reserved,
3510 .OpTypeTaskSequenceINTEL => .type_declaration,
3511 .OpSubgroupBlockPrefetchINTEL => .group,
3512 .OpSubgroup2DBlockLoadINTEL => .group,
3513 .OpSubgroup2DBlockLoadTransformINTEL => .group,
3514 .OpSubgroup2DBlockLoadTransposeINTEL => .group,
3515 .OpSubgroup2DBlockPrefetchINTEL => .group,
3516 .OpSubgroup2DBlockStoreINTEL => .group,
3517 .OpSubgroupMatrixMultiplyAccumulateINTEL => .group,
3518 .OpBitwiseFunctionINTEL => .bit,
3519 .OpGroupIMulKHR => .group,
3520 .OpGroupFMulKHR => .group,
3521 .OpGroupBitwiseAndKHR => .group,
3522 .OpGroupBitwiseOrKHR => .group,
3523 .OpGroupBitwiseXorKHR => .group,
3524 .OpGroupLogicalAndKHR => .group,
3525 .OpGroupLogicalOrKHR => .group,
3526 .OpGroupLogicalXorKHR => .group,
3527 .OpRoundFToTF32INTEL => .conversion,
3528 .OpMaskedGatherINTEL => .memory,
3529 .OpMaskedScatterINTEL => .memory,
3530 .OpConvertHandleToImageINTEL => .image,
3531 .OpConvertHandleToSamplerINTEL => .image,
3532 .OpConvertHandleToSampledImageINTEL => .image,
3533 };
3534 }
3535};
3536pub const ImageOperands = packed struct {
3537 bias: bool = false,
3538 lod: bool = false,
3539 grad: bool = false,
3540 const_offset: bool = false,
3541 offset: bool = false,
3542 const_offsets: bool = false,
3543 sample: bool = false,
3544 min_lod: bool = false,
3545 make_texel_available: bool = false,
3546 make_texel_visible: bool = false,
3547 non_private_texel: bool = false,
3548 volatile_texel: bool = false,
3549 sign_extend: bool = false,
3550 zero_extend: bool = false,
3551 nontemporal: bool = false,
3552 _reserved_bit_15: bool = false,
3553 offsets: bool = false,
3554 _reserved_bit_17: bool = false,
3555 _reserved_bit_18: bool = false,
3556 _reserved_bit_19: bool = false,
3557 _reserved_bit_20: bool = false,
3558 _reserved_bit_21: bool = false,
3559 _reserved_bit_22: bool = false,
3560 _reserved_bit_23: bool = false,
3561 _reserved_bit_24: bool = false,
3562 _reserved_bit_25: bool = false,
3563 _reserved_bit_26: bool = false,
3564 _reserved_bit_27: bool = false,
3565 _reserved_bit_28: bool = false,
3566 _reserved_bit_29: bool = false,
3567 _reserved_bit_30: bool = false,
3568 _reserved_bit_31: bool = false,
3569
3570 pub const Extended = struct {
3571 bias: ?struct { id_ref: Id } = null,
3572 lod: ?struct { id_ref: Id } = null,
3573 grad: ?struct { id_ref_0: Id, id_ref_1: Id } = null,
3574 const_offset: ?struct { id_ref: Id } = null,
3575 offset: ?struct { id_ref: Id } = null,
3576 const_offsets: ?struct { id_ref: Id } = null,
3577 sample: ?struct { id_ref: Id } = null,
3578 min_lod: ?struct { id_ref: Id } = null,
3579 make_texel_available: ?struct { id_scope: Id } = null,
3580 make_texel_visible: ?struct { id_scope: Id } = null,
3581 non_private_texel: bool = false,
3582 volatile_texel: bool = false,
3583 sign_extend: bool = false,
3584 zero_extend: bool = false,
3585 nontemporal: bool = false,
3586 _reserved_bit_15: bool = false,
3587 offsets: ?struct { id_ref: Id } = null,
3588 _reserved_bit_17: bool = false,
3589 _reserved_bit_18: bool = false,
3590 _reserved_bit_19: bool = false,
3591 _reserved_bit_20: bool = false,
3592 _reserved_bit_21: bool = false,
3593 _reserved_bit_22: bool = false,
3594 _reserved_bit_23: bool = false,
3595 _reserved_bit_24: bool = false,
3596 _reserved_bit_25: bool = false,
3597 _reserved_bit_26: bool = false,
3598 _reserved_bit_27: bool = false,
3599 _reserved_bit_28: bool = false,
3600 _reserved_bit_29: bool = false,
3601 _reserved_bit_30: bool = false,
3602 _reserved_bit_31: bool = false,
3603 };
3604};
3605pub const FPFastMathMode = packed struct {
3606 not_na_n: bool = false,
3607 not_inf: bool = false,
3608 nsz: bool = false,
3609 allow_recip: bool = false,
3610 fast: bool = false,
3611 _reserved_bit_5: bool = false,
3612 _reserved_bit_6: bool = false,
3613 _reserved_bit_7: bool = false,
3614 _reserved_bit_8: bool = false,
3615 _reserved_bit_9: bool = false,
3616 _reserved_bit_10: bool = false,
3617 _reserved_bit_11: bool = false,
3618 _reserved_bit_12: bool = false,
3619 _reserved_bit_13: bool = false,
3620 _reserved_bit_14: bool = false,
3621 _reserved_bit_15: bool = false,
3622 allow_contract: bool = false,
3623 allow_reassoc: bool = false,
3624 allow_transform: bool = false,
3625 _reserved_bit_19: bool = false,
3626 _reserved_bit_20: bool = false,
3627 _reserved_bit_21: bool = false,
3628 _reserved_bit_22: bool = false,
3629 _reserved_bit_23: bool = false,
3630 _reserved_bit_24: bool = false,
3631 _reserved_bit_25: bool = false,
3632 _reserved_bit_26: bool = false,
3633 _reserved_bit_27: bool = false,
3634 _reserved_bit_28: bool = false,
3635 _reserved_bit_29: bool = false,
3636 _reserved_bit_30: bool = false,
3637 _reserved_bit_31: bool = false,
3638};
3639pub const SelectionControl = packed struct {
3640 flatten: bool = false,
3641 dont_flatten: bool = false,
3642 _reserved_bit_2: bool = false,
3643 _reserved_bit_3: bool = false,
3644 _reserved_bit_4: bool = false,
3645 _reserved_bit_5: bool = false,
3646 _reserved_bit_6: bool = false,
3647 _reserved_bit_7: bool = false,
3648 _reserved_bit_8: bool = false,
3649 _reserved_bit_9: bool = false,
3650 _reserved_bit_10: bool = false,
3651 _reserved_bit_11: bool = false,
3652 _reserved_bit_12: bool = false,
3653 _reserved_bit_13: bool = false,
3654 _reserved_bit_14: bool = false,
3655 _reserved_bit_15: bool = false,
3656 _reserved_bit_16: bool = false,
3657 _reserved_bit_17: bool = false,
3658 _reserved_bit_18: bool = false,
3659 _reserved_bit_19: bool = false,
3660 _reserved_bit_20: bool = false,
3661 _reserved_bit_21: bool = false,
3662 _reserved_bit_22: bool = false,
3663 _reserved_bit_23: bool = false,
3664 _reserved_bit_24: bool = false,
3665 _reserved_bit_25: bool = false,
3666 _reserved_bit_26: bool = false,
3667 _reserved_bit_27: bool = false,
3668 _reserved_bit_28: bool = false,
3669 _reserved_bit_29: bool = false,
3670 _reserved_bit_30: bool = false,
3671 _reserved_bit_31: bool = false,
3672};
3673pub const LoopControl = packed struct {
3674 unroll: bool = false,
3675 dont_unroll: bool = false,
3676 dependency_infinite: bool = false,
3677 dependency_length: bool = false,
3678 min_iterations: bool = false,
3679 max_iterations: bool = false,
3680 iteration_multiple: bool = false,
3681 peel_count: bool = false,
3682 partial_count: bool = false,
3683 _reserved_bit_9: bool = false,
3684 _reserved_bit_10: bool = false,
3685 _reserved_bit_11: bool = false,
3686 _reserved_bit_12: bool = false,
3687 _reserved_bit_13: bool = false,
3688 _reserved_bit_14: bool = false,
3689 _reserved_bit_15: bool = false,
3690 initiation_interval_intel: bool = false,
3691 max_concurrency_intel: bool = false,
3692 dependency_array_intel: bool = false,
3693 pipeline_enable_intel: bool = false,
3694 loop_coalesce_intel: bool = false,
3695 max_interleaving_intel: bool = false,
3696 speculated_iterations_intel: bool = false,
3697 no_fusion_intel: bool = false,
3698 loop_count_intel: bool = false,
3699 max_reinvocation_delay_intel: bool = false,
3700 _reserved_bit_26: bool = false,
3701 _reserved_bit_27: bool = false,
3702 _reserved_bit_28: bool = false,
3703 _reserved_bit_29: bool = false,
3704 _reserved_bit_30: bool = false,
3705 _reserved_bit_31: bool = false,
3706
3707 pub const Extended = struct {
3708 unroll: bool = false,
3709 dont_unroll: bool = false,
3710 dependency_infinite: bool = false,
3711 dependency_length: ?struct { literal_integer: LiteralInteger } = null,
3712 min_iterations: ?struct { literal_integer: LiteralInteger } = null,
3713 max_iterations: ?struct { literal_integer: LiteralInteger } = null,
3714 iteration_multiple: ?struct { literal_integer: LiteralInteger } = null,
3715 peel_count: ?struct { literal_integer: LiteralInteger } = null,
3716 partial_count: ?struct { literal_integer: LiteralInteger } = null,
3717 _reserved_bit_9: bool = false,
3718 _reserved_bit_10: bool = false,
3719 _reserved_bit_11: bool = false,
3720 _reserved_bit_12: bool = false,
3721 _reserved_bit_13: bool = false,
3722 _reserved_bit_14: bool = false,
3723 _reserved_bit_15: bool = false,
3724 initiation_interval_intel: ?struct { literal_integer: LiteralInteger } = null,
3725 max_concurrency_intel: ?struct { literal_integer: LiteralInteger } = null,
3726 dependency_array_intel: ?struct { literal_integer: LiteralInteger } = null,
3727 pipeline_enable_intel: ?struct { literal_integer: LiteralInteger } = null,
3728 loop_coalesce_intel: ?struct { literal_integer: LiteralInteger } = null,
3729 max_interleaving_intel: ?struct { literal_integer: LiteralInteger } = null,
3730 speculated_iterations_intel: ?struct { literal_integer: LiteralInteger } = null,
3731 no_fusion_intel: bool = false,
3732 loop_count_intel: ?struct { literal_integer: LiteralInteger } = null,
3733 max_reinvocation_delay_intel: ?struct { literal_integer: LiteralInteger } = null,
3734 _reserved_bit_26: bool = false,
3735 _reserved_bit_27: bool = false,
3736 _reserved_bit_28: bool = false,
3737 _reserved_bit_29: bool = false,
3738 _reserved_bit_30: bool = false,
3739 _reserved_bit_31: bool = false,
3740 };
3741};
3742pub const FunctionControl = packed struct {
3743 @"inline": bool = false,
3744 dont_inline: bool = false,
3745 pure: bool = false,
3746 @"const": bool = false,
3747 _reserved_bit_4: bool = false,
3748 _reserved_bit_5: bool = false,
3749 _reserved_bit_6: bool = false,
3750 _reserved_bit_7: bool = false,
3751 _reserved_bit_8: bool = false,
3752 _reserved_bit_9: bool = false,
3753 _reserved_bit_10: bool = false,
3754 _reserved_bit_11: bool = false,
3755 _reserved_bit_12: bool = false,
3756 _reserved_bit_13: bool = false,
3757 _reserved_bit_14: bool = false,
3758 _reserved_bit_15: bool = false,
3759 opt_none_ext: bool = false,
3760 _reserved_bit_17: bool = false,
3761 _reserved_bit_18: bool = false,
3762 _reserved_bit_19: bool = false,
3763 _reserved_bit_20: bool = false,
3764 _reserved_bit_21: bool = false,
3765 _reserved_bit_22: bool = false,
3766 _reserved_bit_23: bool = false,
3767 _reserved_bit_24: bool = false,
3768 _reserved_bit_25: bool = false,
3769 _reserved_bit_26: bool = false,
3770 _reserved_bit_27: bool = false,
3771 _reserved_bit_28: bool = false,
3772 _reserved_bit_29: bool = false,
3773 _reserved_bit_30: bool = false,
3774 _reserved_bit_31: bool = false,
3775};
3776pub const MemorySemantics = packed struct {
3777 _reserved_bit_0: bool = false,
3778 acquire: bool = false,
3779 release: bool = false,
3780 acquire_release: bool = false,
3781 sequentially_consistent: bool = false,
3782 _reserved_bit_5: bool = false,
3783 uniform_memory: bool = false,
3784 subgroup_memory: bool = false,
3785 workgroup_memory: bool = false,
3786 cross_workgroup_memory: bool = false,
3787 atomic_counter_memory: bool = false,
3788 image_memory: bool = false,
3789 output_memory: bool = false,
3790 make_available: bool = false,
3791 make_visible: bool = false,
3792 @"volatile": bool = false,
3793 _reserved_bit_16: bool = false,
3794 _reserved_bit_17: bool = false,
3795 _reserved_bit_18: bool = false,
3796 _reserved_bit_19: bool = false,
3797 _reserved_bit_20: bool = false,
3798 _reserved_bit_21: bool = false,
3799 _reserved_bit_22: bool = false,
3800 _reserved_bit_23: bool = false,
3801 _reserved_bit_24: bool = false,
3802 _reserved_bit_25: bool = false,
3803 _reserved_bit_26: bool = false,
3804 _reserved_bit_27: bool = false,
3805 _reserved_bit_28: bool = false,
3806 _reserved_bit_29: bool = false,
3807 _reserved_bit_30: bool = false,
3808 _reserved_bit_31: bool = false,
3809};
3810pub const MemoryAccess = packed struct {
3811 @"volatile": bool = false,
3812 aligned: bool = false,
3813 nontemporal: bool = false,
3814 make_pointer_available: bool = false,
3815 make_pointer_visible: bool = false,
3816 non_private_pointer: bool = false,
3817 _reserved_bit_6: bool = false,
3818 _reserved_bit_7: bool = false,
3819 _reserved_bit_8: bool = false,
3820 _reserved_bit_9: bool = false,
3821 _reserved_bit_10: bool = false,
3822 _reserved_bit_11: bool = false,
3823 _reserved_bit_12: bool = false,
3824 _reserved_bit_13: bool = false,
3825 _reserved_bit_14: bool = false,
3826 _reserved_bit_15: bool = false,
3827 alias_scope_intel_mask: bool = false,
3828 no_alias_intel_mask: bool = false,
3829 _reserved_bit_18: bool = false,
3830 _reserved_bit_19: bool = false,
3831 _reserved_bit_20: bool = false,
3832 _reserved_bit_21: bool = false,
3833 _reserved_bit_22: bool = false,
3834 _reserved_bit_23: bool = false,
3835 _reserved_bit_24: bool = false,
3836 _reserved_bit_25: bool = false,
3837 _reserved_bit_26: bool = false,
3838 _reserved_bit_27: bool = false,
3839 _reserved_bit_28: bool = false,
3840 _reserved_bit_29: bool = false,
3841 _reserved_bit_30: bool = false,
3842 _reserved_bit_31: bool = false,
3843
3844 pub const Extended = struct {
3845 @"volatile": bool = false,
3846 aligned: ?struct { literal_integer: LiteralInteger } = null,
3847 nontemporal: bool = false,
3848 make_pointer_available: ?struct { id_scope: Id } = null,
3849 make_pointer_visible: ?struct { id_scope: Id } = null,
3850 non_private_pointer: bool = false,
3851 _reserved_bit_6: bool = false,
3852 _reserved_bit_7: bool = false,
3853 _reserved_bit_8: bool = false,
3854 _reserved_bit_9: bool = false,
3855 _reserved_bit_10: bool = false,
3856 _reserved_bit_11: bool = false,
3857 _reserved_bit_12: bool = false,
3858 _reserved_bit_13: bool = false,
3859 _reserved_bit_14: bool = false,
3860 _reserved_bit_15: bool = false,
3861 alias_scope_intel_mask: ?struct { id_ref: Id } = null,
3862 no_alias_intel_mask: ?struct { id_ref: Id } = null,
3863 _reserved_bit_18: bool = false,
3864 _reserved_bit_19: bool = false,
3865 _reserved_bit_20: bool = false,
3866 _reserved_bit_21: bool = false,
3867 _reserved_bit_22: bool = false,
3868 _reserved_bit_23: bool = false,
3869 _reserved_bit_24: bool = false,
3870 _reserved_bit_25: bool = false,
3871 _reserved_bit_26: bool = false,
3872 _reserved_bit_27: bool = false,
3873 _reserved_bit_28: bool = false,
3874 _reserved_bit_29: bool = false,
3875 _reserved_bit_30: bool = false,
3876 _reserved_bit_31: bool = false,
3877 };
3878};
3879pub const KernelProfilingInfo = packed struct {
3880 cmd_exec_time: bool = false,
3881 _reserved_bit_1: bool = false,
3882 _reserved_bit_2: bool = false,
3883 _reserved_bit_3: bool = false,
3884 _reserved_bit_4: bool = false,
3885 _reserved_bit_5: bool = false,
3886 _reserved_bit_6: bool = false,
3887 _reserved_bit_7: bool = false,
3888 _reserved_bit_8: bool = false,
3889 _reserved_bit_9: bool = false,
3890 _reserved_bit_10: bool = false,
3891 _reserved_bit_11: bool = false,
3892 _reserved_bit_12: bool = false,
3893 _reserved_bit_13: bool = false,
3894 _reserved_bit_14: bool = false,
3895 _reserved_bit_15: bool = false,
3896 _reserved_bit_16: bool = false,
3897 _reserved_bit_17: bool = false,
3898 _reserved_bit_18: bool = false,
3899 _reserved_bit_19: bool = false,
3900 _reserved_bit_20: bool = false,
3901 _reserved_bit_21: bool = false,
3902 _reserved_bit_22: bool = false,
3903 _reserved_bit_23: bool = false,
3904 _reserved_bit_24: bool = false,
3905 _reserved_bit_25: bool = false,
3906 _reserved_bit_26: bool = false,
3907 _reserved_bit_27: bool = false,
3908 _reserved_bit_28: bool = false,
3909 _reserved_bit_29: bool = false,
3910 _reserved_bit_30: bool = false,
3911 _reserved_bit_31: bool = false,
3912};
3913pub const RayFlags = packed struct {
3914 opaque_khr: bool = false,
3915 no_opaque_khr: bool = false,
3916 terminate_on_first_hit_khr: bool = false,
3917 skip_closest_hit_shader_khr: bool = false,
3918 cull_back_facing_triangles_khr: bool = false,
3919 cull_front_facing_triangles_khr: bool = false,
3920 cull_opaque_khr: bool = false,
3921 cull_no_opaque_khr: bool = false,
3922 skip_triangles_khr: bool = false,
3923 skip_aab_bs_khr: bool = false,
3924 force_opacity_micromap2state_ext: bool = false,
3925 _reserved_bit_11: bool = false,
3926 _reserved_bit_12: bool = false,
3927 _reserved_bit_13: bool = false,
3928 _reserved_bit_14: bool = false,
3929 _reserved_bit_15: bool = false,
3930 _reserved_bit_16: bool = false,
3931 _reserved_bit_17: bool = false,
3932 _reserved_bit_18: bool = false,
3933 _reserved_bit_19: bool = false,
3934 _reserved_bit_20: bool = false,
3935 _reserved_bit_21: bool = false,
3936 _reserved_bit_22: bool = false,
3937 _reserved_bit_23: bool = false,
3938 _reserved_bit_24: bool = false,
3939 _reserved_bit_25: bool = false,
3940 _reserved_bit_26: bool = false,
3941 _reserved_bit_27: bool = false,
3942 _reserved_bit_28: bool = false,
3943 _reserved_bit_29: bool = false,
3944 _reserved_bit_30: bool = false,
3945 _reserved_bit_31: bool = false,
3946};
3947pub const FragmentShadingRate = packed struct {
3948 vertical2pixels: bool = false,
3949 vertical4pixels: bool = false,
3950 horizontal2pixels: bool = false,
3951 horizontal4pixels: bool = false,
3952 _reserved_bit_4: bool = false,
3953 _reserved_bit_5: bool = false,
3954 _reserved_bit_6: bool = false,
3955 _reserved_bit_7: bool = false,
3956 _reserved_bit_8: bool = false,
3957 _reserved_bit_9: bool = false,
3958 _reserved_bit_10: bool = false,
3959 _reserved_bit_11: bool = false,
3960 _reserved_bit_12: bool = false,
3961 _reserved_bit_13: bool = false,
3962 _reserved_bit_14: bool = false,
3963 _reserved_bit_15: bool = false,
3964 _reserved_bit_16: bool = false,
3965 _reserved_bit_17: bool = false,
3966 _reserved_bit_18: bool = false,
3967 _reserved_bit_19: bool = false,
3968 _reserved_bit_20: bool = false,
3969 _reserved_bit_21: bool = false,
3970 _reserved_bit_22: bool = false,
3971 _reserved_bit_23: bool = false,
3972 _reserved_bit_24: bool = false,
3973 _reserved_bit_25: bool = false,
3974 _reserved_bit_26: bool = false,
3975 _reserved_bit_27: bool = false,
3976 _reserved_bit_28: bool = false,
3977 _reserved_bit_29: bool = false,
3978 _reserved_bit_30: bool = false,
3979 _reserved_bit_31: bool = false,
3980};
3981pub const RawAccessChainOperands = packed struct {
3982 robustness_per_component_nv: bool = false,
3983 robustness_per_element_nv: bool = false,
3984 _reserved_bit_2: bool = false,
3985 _reserved_bit_3: bool = false,
3986 _reserved_bit_4: bool = false,
3987 _reserved_bit_5: bool = false,
3988 _reserved_bit_6: bool = false,
3989 _reserved_bit_7: bool = false,
3990 _reserved_bit_8: bool = false,
3991 _reserved_bit_9: bool = false,
3992 _reserved_bit_10: bool = false,
3993 _reserved_bit_11: bool = false,
3994 _reserved_bit_12: bool = false,
3995 _reserved_bit_13: bool = false,
3996 _reserved_bit_14: bool = false,
3997 _reserved_bit_15: bool = false,
3998 _reserved_bit_16: bool = false,
3999 _reserved_bit_17: bool = false,
4000 _reserved_bit_18: bool = false,
4001 _reserved_bit_19: bool = false,
4002 _reserved_bit_20: bool = false,
4003 _reserved_bit_21: bool = false,
4004 _reserved_bit_22: bool = false,
4005 _reserved_bit_23: bool = false,
4006 _reserved_bit_24: bool = false,
4007 _reserved_bit_25: bool = false,
4008 _reserved_bit_26: bool = false,
4009 _reserved_bit_27: bool = false,
4010 _reserved_bit_28: bool = false,
4011 _reserved_bit_29: bool = false,
4012 _reserved_bit_30: bool = false,
4013 _reserved_bit_31: bool = false,
4014};
4015pub const SourceLanguage = enum(u32) {
4016 unknown = 0,
4017 essl = 1,
4018 glsl = 2,
4019 open_cl_c = 3,
4020 open_cl_cpp = 4,
4021 hlsl = 5,
4022 cpp_for_open_cl = 6,
4023 sycl = 7,
4024 hero_c = 8,
4025 nzsl = 9,
4026 wgsl = 10,
4027 slang = 11,
4028 zig = 12,
4029 rust = 13,
4030};
4031pub const ExecutionModel = enum(u32) {
4032 vertex = 0,
4033 tessellation_control = 1,
4034 tessellation_evaluation = 2,
4035 geometry = 3,
4036 fragment = 4,
4037 gl_compute = 5,
4038 kernel = 6,
4039 task_nv = 5267,
4040 mesh_nv = 5268,
4041 ray_generation_khr = 5313,
4042 intersection_khr = 5314,
4043 any_hit_khr = 5315,
4044 closest_hit_khr = 5316,
4045 miss_khr = 5317,
4046 callable_khr = 5318,
4047 task_ext = 5364,
4048 mesh_ext = 5365,
4049};
4050pub const AddressingModel = enum(u32) {
4051 logical = 0,
4052 physical32 = 1,
4053 physical64 = 2,
4054 physical_storage_buffer64 = 5348,
4055};
4056pub const MemoryModel = enum(u32) {
4057 simple = 0,
4058 glsl450 = 1,
4059 open_cl = 2,
4060 vulkan = 3,
4061};
4062pub const ExecutionMode = enum(u32) {
4063 invocations = 0,
4064 spacing_equal = 1,
4065 spacing_fractional_even = 2,
4066 spacing_fractional_odd = 3,
4067 vertex_order_cw = 4,
4068 vertex_order_ccw = 5,
4069 pixel_center_integer = 6,
4070 origin_upper_left = 7,
4071 origin_lower_left = 8,
4072 early_fragment_tests = 9,
4073 point_mode = 10,
4074 xfb = 11,
4075 depth_replacing = 12,
4076 depth_greater = 14,
4077 depth_less = 15,
4078 depth_unchanged = 16,
4079 local_size = 17,
4080 local_size_hint = 18,
4081 input_points = 19,
4082 input_lines = 20,
4083 input_lines_adjacency = 21,
4084 triangles = 22,
4085 input_triangles_adjacency = 23,
4086 quads = 24,
4087 isolines = 25,
4088 output_vertices = 26,
4089 output_points = 27,
4090 output_line_strip = 28,
4091 output_triangle_strip = 29,
4092 vec_type_hint = 30,
4093 contraction_off = 31,
4094 initializer = 33,
4095 finalizer = 34,
4096 subgroup_size = 35,
4097 subgroups_per_workgroup = 36,
4098 subgroups_per_workgroup_id = 37,
4099 local_size_id = 38,
4100 local_size_hint_id = 39,
4101 non_coherent_color_attachment_read_ext = 4169,
4102 non_coherent_depth_attachment_read_ext = 4170,
4103 non_coherent_stencil_attachment_read_ext = 4171,
4104 subgroup_uniform_control_flow_khr = 4421,
4105 post_depth_coverage = 4446,
4106 denorm_preserve = 4459,
4107 denorm_flush_to_zero = 4460,
4108 signed_zero_inf_nan_preserve = 4461,
4109 rounding_mode_rte = 4462,
4110 rounding_mode_rtz = 4463,
4111 non_coherent_tile_attachment_read_qcom = 4489,
4112 tile_shading_rate_qcom = 4490,
4113 early_and_late_fragment_tests_amd = 5017,
4114 stencil_ref_replacing_ext = 5027,
4115 coalescing_amdx = 5069,
4116 is_api_entry_amdx = 5070,
4117 max_node_recursion_amdx = 5071,
4118 static_num_workgroups_amdx = 5072,
4119 shader_index_amdx = 5073,
4120 max_num_workgroups_amdx = 5077,
4121 stencil_ref_unchanged_front_amd = 5079,
4122 stencil_ref_greater_front_amd = 5080,
4123 stencil_ref_less_front_amd = 5081,
4124 stencil_ref_unchanged_back_amd = 5082,
4125 stencil_ref_greater_back_amd = 5083,
4126 stencil_ref_less_back_amd = 5084,
4127 quad_derivatives_khr = 5088,
4128 require_full_quads_khr = 5089,
4129 shares_input_with_amdx = 5102,
4130 output_lines_ext = 5269,
4131 output_primitives_ext = 5270,
4132 derivative_group_quads_khr = 5289,
4133 derivative_group_linear_khr = 5290,
4134 output_triangles_ext = 5298,
4135 pixel_interlock_ordered_ext = 5366,
4136 pixel_interlock_unordered_ext = 5367,
4137 sample_interlock_ordered_ext = 5368,
4138 sample_interlock_unordered_ext = 5369,
4139 shading_rate_interlock_ordered_ext = 5370,
4140 shading_rate_interlock_unordered_ext = 5371,
4141 shared_local_memory_size_intel = 5618,
4142 rounding_mode_rtpintel = 5620,
4143 rounding_mode_rtnintel = 5621,
4144 floating_point_mode_altintel = 5622,
4145 floating_point_mode_ieeeintel = 5623,
4146 max_workgroup_size_intel = 5893,
4147 max_work_dim_intel = 5894,
4148 no_global_offset_intel = 5895,
4149 num_simd_workitems_intel = 5896,
4150 scheduler_target_fmax_mhz_intel = 5903,
4151 maximally_reconverges_khr = 6023,
4152 fp_fast_math_default = 6028,
4153 streaming_interface_intel = 6154,
4154 register_map_interface_intel = 6160,
4155 named_barrier_count_intel = 6417,
4156 maximum_registers_intel = 6461,
4157 maximum_registers_id_intel = 6462,
4158 named_maximum_registers_intel = 6463,
4159
4160 pub const Extended = union(ExecutionMode) {
4161 invocations: struct { literal_integer: LiteralInteger },
4162 spacing_equal,
4163 spacing_fractional_even,
4164 spacing_fractional_odd,
4165 vertex_order_cw,
4166 vertex_order_ccw,
4167 pixel_center_integer,
4168 origin_upper_left,
4169 origin_lower_left,
4170 early_fragment_tests,
4171 point_mode,
4172 xfb,
4173 depth_replacing,
4174 depth_greater,
4175 depth_less,
4176 depth_unchanged,
4177 local_size: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4178 local_size_hint: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4179 input_points,
4180 input_lines,
4181 input_lines_adjacency,
4182 triangles,
4183 input_triangles_adjacency,
4184 quads,
4185 isolines,
4186 output_vertices: struct { vertex_count: LiteralInteger },
4187 output_points,
4188 output_line_strip,
4189 output_triangle_strip,
4190 vec_type_hint: struct { vector_type: LiteralInteger },
4191 contraction_off,
4192 initializer,
4193 finalizer,
4194 subgroup_size: struct { subgroup_size: LiteralInteger },
4195 subgroups_per_workgroup: struct { subgroups_per_workgroup: LiteralInteger },
4196 subgroups_per_workgroup_id: struct { subgroups_per_workgroup: Id },
4197 local_size_id: struct { x_size: Id, y_size: Id, z_size: Id },
4198 local_size_hint_id: struct { x_size_hint: Id, y_size_hint: Id, z_size_hint: Id },
4199 non_coherent_color_attachment_read_ext,
4200 non_coherent_depth_attachment_read_ext,
4201 non_coherent_stencil_attachment_read_ext,
4202 subgroup_uniform_control_flow_khr,
4203 post_depth_coverage,
4204 denorm_preserve: struct { target_width: LiteralInteger },
4205 denorm_flush_to_zero: struct { target_width: LiteralInteger },
4206 signed_zero_inf_nan_preserve: struct { target_width: LiteralInteger },
4207 rounding_mode_rte: struct { target_width: LiteralInteger },
4208 rounding_mode_rtz: struct { target_width: LiteralInteger },
4209 non_coherent_tile_attachment_read_qcom,
4210 tile_shading_rate_qcom: struct { x_rate: LiteralInteger, y_rate: LiteralInteger, z_rate: LiteralInteger },
4211 early_and_late_fragment_tests_amd,
4212 stencil_ref_replacing_ext,
4213 coalescing_amdx,
4214 is_api_entry_amdx: struct { is_entry: Id },
4215 max_node_recursion_amdx: struct { number_of_recursions: Id },
4216 static_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4217 shader_index_amdx: struct { shader_index: Id },
4218 max_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4219 stencil_ref_unchanged_front_amd,
4220 stencil_ref_greater_front_amd,
4221 stencil_ref_less_front_amd,
4222 stencil_ref_unchanged_back_amd,
4223 stencil_ref_greater_back_amd,
4224 stencil_ref_less_back_amd,
4225 quad_derivatives_khr,
4226 require_full_quads_khr,
4227 shares_input_with_amdx: struct { node_name: Id, shader_index: Id },
4228 output_lines_ext,
4229 output_primitives_ext: struct { primitive_count: LiteralInteger },
4230 derivative_group_quads_khr,
4231 derivative_group_linear_khr,
4232 output_triangles_ext,
4233 pixel_interlock_ordered_ext,
4234 pixel_interlock_unordered_ext,
4235 sample_interlock_ordered_ext,
4236 sample_interlock_unordered_ext,
4237 shading_rate_interlock_ordered_ext,
4238 shading_rate_interlock_unordered_ext,
4239 shared_local_memory_size_intel: struct { size: LiteralInteger },
4240 rounding_mode_rtpintel: struct { target_width: LiteralInteger },
4241 rounding_mode_rtnintel: struct { target_width: LiteralInteger },
4242 floating_point_mode_altintel: struct { target_width: LiteralInteger },
4243 floating_point_mode_ieeeintel: struct { target_width: LiteralInteger },
4244 max_workgroup_size_intel: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger, literal_integer_2: LiteralInteger },
4245 max_work_dim_intel: struct { literal_integer: LiteralInteger },
4246 no_global_offset_intel,
4247 num_simd_workitems_intel: struct { literal_integer: LiteralInteger },
4248 scheduler_target_fmax_mhz_intel: struct { literal_integer: LiteralInteger },
4249 maximally_reconverges_khr,
4250 fp_fast_math_default: struct { target_type: Id, id_ref_1: Id },
4251 streaming_interface_intel: struct { stall_free_return: LiteralInteger },
4252 register_map_interface_intel: struct { wait_for_done_write: LiteralInteger },
4253 named_barrier_count_intel: struct { barrier_count: LiteralInteger },
4254 maximum_registers_intel: struct { number_of_registers: LiteralInteger },
4255 maximum_registers_id_intel: struct { number_of_registers: Id },
4256 named_maximum_registers_intel: struct { named_maximum_number_of_registers: NamedMaximumNumberOfRegisters },
4257 };
4258};
4259pub const StorageClass = enum(u32) {
4260 uniform_constant = 0,
4261 input = 1,
4262 uniform = 2,
4263 output = 3,
4264 workgroup = 4,
4265 cross_workgroup = 5,
4266 private = 6,
4267 function = 7,
4268 generic = 8,
4269 push_constant = 9,
4270 atomic_counter = 10,
4271 image = 11,
4272 storage_buffer = 12,
4273 tile_image_ext = 4172,
4274 tile_attachment_qcom = 4491,
4275 node_payload_amdx = 5068,
4276 callable_data_khr = 5328,
4277 incoming_callable_data_khr = 5329,
4278 ray_payload_khr = 5338,
4279 hit_attribute_khr = 5339,
4280 incoming_ray_payload_khr = 5342,
4281 shader_record_buffer_khr = 5343,
4282 physical_storage_buffer = 5349,
4283 hit_object_attribute_nv = 5385,
4284 task_payload_workgroup_ext = 5402,
4285 code_section_intel = 5605,
4286 device_only_intel = 5936,
4287 host_only_intel = 5937,
4288};
4289pub const Dim = enum(u32) {
4290 @"1d" = 0,
4291 @"2d" = 1,
4292 @"3d" = 2,
4293 cube = 3,
4294 rect = 4,
4295 buffer = 5,
4296 subpass_data = 6,
4297 tile_image_data_ext = 4173,
4298};
4299pub const SamplerAddressingMode = enum(u32) {
4300 none = 0,
4301 clamp_to_edge = 1,
4302 clamp = 2,
4303 repeat = 3,
4304 repeat_mirrored = 4,
4305};
4306pub const SamplerFilterMode = enum(u32) {
4307 nearest = 0,
4308 linear = 1,
4309};
4310pub const ImageFormat = enum(u32) {
4311 unknown = 0,
4312 rgba32f = 1,
4313 rgba16f = 2,
4314 r32f = 3,
4315 rgba8 = 4,
4316 rgba8snorm = 5,
4317 rg32f = 6,
4318 rg16f = 7,
4319 r11f_g11f_b10f = 8,
4320 r16f = 9,
4321 rgba16 = 10,
4322 rgb10a2 = 11,
4323 rg16 = 12,
4324 rg8 = 13,
4325 r16 = 14,
4326 r8 = 15,
4327 rgba16snorm = 16,
4328 rg16snorm = 17,
4329 rg8snorm = 18,
4330 r16snorm = 19,
4331 r8snorm = 20,
4332 rgba32i = 21,
4333 rgba16i = 22,
4334 rgba8i = 23,
4335 r32i = 24,
4336 rg32i = 25,
4337 rg16i = 26,
4338 rg8i = 27,
4339 r16i = 28,
4340 r8i = 29,
4341 rgba32ui = 30,
4342 rgba16ui = 31,
4343 rgba8ui = 32,
4344 r32ui = 33,
4345 rgb10a2ui = 34,
4346 rg32ui = 35,
4347 rg16ui = 36,
4348 rg8ui = 37,
4349 r16ui = 38,
4350 r8ui = 39,
4351 r64ui = 40,
4352 r64i = 41,
4353};
4354pub const ImageChannelOrder = enum(u32) {
4355 r = 0,
4356 a = 1,
4357 rg = 2,
4358 ra = 3,
4359 rgb = 4,
4360 rgba = 5,
4361 bgra = 6,
4362 argb = 7,
4363 intensity = 8,
4364 luminance = 9,
4365 rx = 10,
4366 r_gx = 11,
4367 rg_bx = 12,
4368 depth = 13,
4369 depth_stencil = 14,
4370 s_rgb = 15,
4371 s_rg_bx = 16,
4372 s_rgba = 17,
4373 s_bgra = 18,
4374 abgr = 19,
4375};
4376pub const ImageChannelDataType = enum(u32) {
4377 snorm_int8 = 0,
4378 snorm_int16 = 1,
4379 unorm_int8 = 2,
4380 unorm_int16 = 3,
4381 unorm_short565 = 4,
4382 unorm_short555 = 5,
4383 unorm_int101010 = 6,
4384 signed_int8 = 7,
4385 signed_int16 = 8,
4386 signed_int32 = 9,
4387 unsigned_int8 = 10,
4388 unsigned_int16 = 11,
4389 unsigned_int32 = 12,
4390 half_float = 13,
4391 float = 14,
4392 unorm_int24 = 15,
4393 unorm_int101010_2 = 16,
4394 unorm_int10x6ext = 17,
4395 unsigned_int_raw10ext = 19,
4396 unsigned_int_raw12ext = 20,
4397 unorm_int2_101010ext = 21,
4398 unsigned_int10x6ext = 22,
4399 unsigned_int12x4ext = 23,
4400 unsigned_int14x2ext = 24,
4401 unorm_int12x4ext = 25,
4402 unorm_int14x2ext = 26,
4403};
4404pub const FPRoundingMode = enum(u32) {
4405 rte = 0,
4406 rtz = 1,
4407 rtp = 2,
4408 rtn = 3,
4409};
4410pub const FPDenormMode = enum(u32) {
4411 preserve = 0,
4412 flush_to_zero = 1,
4413};
4414pub const QuantizationModes = enum(u32) {
4415 trn = 0,
4416 trn_zero = 1,
4417 rnd = 2,
4418 rnd_zero = 3,
4419 rnd_inf = 4,
4420 rnd_min_inf = 5,
4421 rnd_conv = 6,
4422 rnd_conv_odd = 7,
4423};
4424pub const FPOperationMode = enum(u32) {
4425 ieee = 0,
4426 alt = 1,
4427};
4428pub const OverflowModes = enum(u32) {
4429 wrap = 0,
4430 sat = 1,
4431 sat_zero = 2,
4432 sat_sym = 3,
4433};
4434pub const LinkageType = enum(u32) {
4435 @"export" = 0,
4436 import = 1,
4437 link_once_odr = 2,
4438};
4439pub const AccessQualifier = enum(u32) {
4440 read_only = 0,
4441 write_only = 1,
4442 read_write = 2,
4443};
4444pub const HostAccessQualifier = enum(u32) {
4445 none_intel = 0,
4446 read_intel = 1,
4447 write_intel = 2,
4448 read_write_intel = 3,
4449};
4450pub const FunctionParameterAttribute = enum(u32) {
4451 zext = 0,
4452 sext = 1,
4453 by_val = 2,
4454 sret = 3,
4455 no_alias = 4,
4456 no_capture = 5,
4457 no_write = 6,
4458 no_read_write = 7,
4459 runtime_aligned_intel = 5940,
4460};
4461pub const Decoration = enum(u32) {
4462 relaxed_precision = 0,
4463 spec_id = 1,
4464 block = 2,
4465 buffer_block = 3,
4466 row_major = 4,
4467 col_major = 5,
4468 array_stride = 6,
4469 matrix_stride = 7,
4470 glsl_shared = 8,
4471 glsl_packed = 9,
4472 c_packed = 10,
4473 built_in = 11,
4474 no_perspective = 13,
4475 flat = 14,
4476 patch = 15,
4477 centroid = 16,
4478 sample = 17,
4479 invariant = 18,
4480 restrict = 19,
4481 aliased = 20,
4482 @"volatile" = 21,
4483 constant = 22,
4484 coherent = 23,
4485 non_writable = 24,
4486 non_readable = 25,
4487 uniform = 26,
4488 uniform_id = 27,
4489 saturated_conversion = 28,
4490 stream = 29,
4491 location = 30,
4492 component = 31,
4493 index = 32,
4494 binding = 33,
4495 descriptor_set = 34,
4496 offset = 35,
4497 xfb_buffer = 36,
4498 xfb_stride = 37,
4499 func_param_attr = 38,
4500 fp_rounding_mode = 39,
4501 fp_fast_math_mode = 40,
4502 linkage_attributes = 41,
4503 no_contraction = 42,
4504 input_attachment_index = 43,
4505 alignment = 44,
4506 max_byte_offset = 45,
4507 alignment_id = 46,
4508 max_byte_offset_id = 47,
4509 saturated_to_largest_float8normal_conversion_ext = 4216,
4510 no_signed_wrap = 4469,
4511 no_unsigned_wrap = 4470,
4512 weight_texture_qcom = 4487,
4513 block_match_texture_qcom = 4488,
4514 block_match_sampler_qcom = 4499,
4515 explicit_interp_amd = 4999,
4516 node_shares_payload_limits_with_amdx = 5019,
4517 node_max_payloads_amdx = 5020,
4518 track_finish_writing_amdx = 5078,
4519 payload_node_name_amdx = 5091,
4520 payload_node_base_index_amdx = 5098,
4521 payload_node_sparse_array_amdx = 5099,
4522 payload_node_array_size_amdx = 5100,
4523 payload_dispatch_indirect_amdx = 5105,
4524 override_coverage_nv = 5248,
4525 passthrough_nv = 5250,
4526 viewport_relative_nv = 5252,
4527 secondary_viewport_relative_nv = 5256,
4528 per_primitive_ext = 5271,
4529 per_view_nv = 5272,
4530 per_task_nv = 5273,
4531 per_vertex_khr = 5285,
4532 non_uniform = 5300,
4533 restrict_pointer = 5355,
4534 aliased_pointer = 5356,
4535 hit_object_shader_record_buffer_nv = 5386,
4536 bindless_sampler_nv = 5398,
4537 bindless_image_nv = 5399,
4538 bound_sampler_nv = 5400,
4539 bound_image_nv = 5401,
4540 simt_call_intel = 5599,
4541 referenced_indirectly_intel = 5602,
4542 clobber_intel = 5607,
4543 side_effects_intel = 5608,
4544 vector_compute_variable_intel = 5624,
4545 func_param_io_kind_intel = 5625,
4546 vector_compute_function_intel = 5626,
4547 stack_call_intel = 5627,
4548 global_variable_offset_intel = 5628,
4549 counter_buffer = 5634,
4550 user_semantic = 5635,
4551 user_type_google = 5636,
4552 function_rounding_mode_intel = 5822,
4553 function_denorm_mode_intel = 5823,
4554 register_intel = 5825,
4555 memory_intel = 5826,
4556 numbanks_intel = 5827,
4557 bankwidth_intel = 5828,
4558 max_private_copies_intel = 5829,
4559 singlepump_intel = 5830,
4560 doublepump_intel = 5831,
4561 max_replicates_intel = 5832,
4562 simple_dual_port_intel = 5833,
4563 merge_intel = 5834,
4564 bank_bits_intel = 5835,
4565 force_pow2depth_intel = 5836,
4566 stridesize_intel = 5883,
4567 wordsize_intel = 5884,
4568 true_dual_port_intel = 5885,
4569 burst_coalesce_intel = 5899,
4570 cache_size_intel = 5900,
4571 dont_statically_coalesce_intel = 5901,
4572 prefetch_intel = 5902,
4573 stall_enable_intel = 5905,
4574 fuse_loops_in_function_intel = 5907,
4575 math_op_dsp_mode_intel = 5909,
4576 alias_scope_intel = 5914,
4577 no_alias_intel = 5915,
4578 initiation_interval_intel = 5917,
4579 max_concurrency_intel = 5918,
4580 pipeline_enable_intel = 5919,
4581 buffer_location_intel = 5921,
4582 io_pipe_storage_intel = 5944,
4583 function_floating_point_mode_intel = 6080,
4584 single_element_vector_intel = 6085,
4585 vector_compute_callable_function_intel = 6087,
4586 media_block_iointel = 6140,
4587 stall_free_intel = 6151,
4588 fp_max_error_decoration_intel = 6170,
4589 latency_control_label_intel = 6172,
4590 latency_control_constraint_intel = 6173,
4591 conduit_kernel_argument_intel = 6175,
4592 register_map_kernel_argument_intel = 6176,
4593 mm_host_interface_address_width_intel = 6177,
4594 mm_host_interface_data_width_intel = 6178,
4595 mm_host_interface_latency_intel = 6179,
4596 mm_host_interface_read_write_mode_intel = 6180,
4597 mm_host_interface_max_burst_intel = 6181,
4598 mm_host_interface_wait_request_intel = 6182,
4599 stable_kernel_argument_intel = 6183,
4600 host_access_intel = 6188,
4601 init_mode_intel = 6190,
4602 implement_in_register_map_intel = 6191,
4603 cache_control_load_intel = 6442,
4604 cache_control_store_intel = 6443,
4605
4606 pub const Extended = union(Decoration) {
4607 relaxed_precision,
4608 spec_id: struct { specialization_constant_id: LiteralInteger },
4609 block,
4610 buffer_block,
4611 row_major,
4612 col_major,
4613 array_stride: struct { array_stride: LiteralInteger },
4614 matrix_stride: struct { matrix_stride: LiteralInteger },
4615 glsl_shared,
4616 glsl_packed,
4617 c_packed,
4618 built_in: struct { built_in: BuiltIn },
4619 no_perspective,
4620 flat,
4621 patch,
4622 centroid,
4623 sample,
4624 invariant,
4625 restrict,
4626 aliased,
4627 @"volatile",
4628 constant,
4629 coherent,
4630 non_writable,
4631 non_readable,
4632 uniform,
4633 uniform_id: struct { execution: Id },
4634 saturated_conversion,
4635 stream: struct { stream_number: LiteralInteger },
4636 location: struct { location: LiteralInteger },
4637 component: struct { component: LiteralInteger },
4638 index: struct { index: LiteralInteger },
4639 binding: struct { binding_point: LiteralInteger },
4640 descriptor_set: struct { descriptor_set: LiteralInteger },
4641 offset: struct { byte_offset: LiteralInteger },
4642 xfb_buffer: struct { xfb_buffer_number: LiteralInteger },
4643 xfb_stride: struct { xfb_stride: LiteralInteger },
4644 func_param_attr: struct { function_parameter_attribute: FunctionParameterAttribute },
4645 fp_rounding_mode: struct { fp_rounding_mode: FPRoundingMode },
4646 fp_fast_math_mode: struct { fp_fast_math_mode: FPFastMathMode },
4647 linkage_attributes: struct { name: LiteralString, linkage_type: LinkageType },
4648 no_contraction,
4649 input_attachment_index: struct { attachment_index: LiteralInteger },
4650 alignment: struct { alignment: LiteralInteger },
4651 max_byte_offset: struct { max_byte_offset: LiteralInteger },
4652 alignment_id: struct { alignment: Id },
4653 max_byte_offset_id: struct { max_byte_offset: Id },
4654 saturated_to_largest_float8normal_conversion_ext,
4655 no_signed_wrap,
4656 no_unsigned_wrap,
4657 weight_texture_qcom,
4658 block_match_texture_qcom,
4659 block_match_sampler_qcom,
4660 explicit_interp_amd,
4661 node_shares_payload_limits_with_amdx: struct { payload_type: Id },
4662 node_max_payloads_amdx: struct { max_number_of_payloads: Id },
4663 track_finish_writing_amdx,
4664 payload_node_name_amdx: struct { node_name: Id },
4665 payload_node_base_index_amdx: struct { base_index: Id },
4666 payload_node_sparse_array_amdx,
4667 payload_node_array_size_amdx: struct { array_size: Id },
4668 payload_dispatch_indirect_amdx,
4669 override_coverage_nv,
4670 passthrough_nv,
4671 viewport_relative_nv,
4672 secondary_viewport_relative_nv: struct { offset: LiteralInteger },
4673 per_primitive_ext,
4674 per_view_nv,
4675 per_task_nv,
4676 per_vertex_khr,
4677 non_uniform,
4678 restrict_pointer,
4679 aliased_pointer,
4680 hit_object_shader_record_buffer_nv,
4681 bindless_sampler_nv,
4682 bindless_image_nv,
4683 bound_sampler_nv,
4684 bound_image_nv,
4685 simt_call_intel: struct { n: LiteralInteger },
4686 referenced_indirectly_intel,
4687 clobber_intel: struct { register: LiteralString },
4688 side_effects_intel,
4689 vector_compute_variable_intel,
4690 func_param_io_kind_intel: struct { kind: LiteralInteger },
4691 vector_compute_function_intel,
4692 stack_call_intel,
4693 global_variable_offset_intel: struct { offset: LiteralInteger },
4694 counter_buffer: struct { counter_buffer: Id },
4695 user_semantic: struct { semantic: LiteralString },
4696 user_type_google: struct { user_type: LiteralString },
4697 function_rounding_mode_intel: struct { target_width: LiteralInteger, fp_rounding_mode: FPRoundingMode },
4698 function_denorm_mode_intel: struct { target_width: LiteralInteger, fp_denorm_mode: FPDenormMode },
4699 register_intel,
4700 memory_intel: struct { memory_type: LiteralString },
4701 numbanks_intel: struct { banks: LiteralInteger },
4702 bankwidth_intel: struct { bank_width: LiteralInteger },
4703 max_private_copies_intel: struct { maximum_copies: LiteralInteger },
4704 singlepump_intel,
4705 doublepump_intel,
4706 max_replicates_intel: struct { maximum_replicates: LiteralInteger },
4707 simple_dual_port_intel,
4708 merge_intel: struct { merge_key: LiteralString, merge_type: LiteralString },
4709 bank_bits_intel: struct { bank_bits: []const LiteralInteger = &.{} },
4710 force_pow2depth_intel: struct { force_key: LiteralInteger },
4711 stridesize_intel: struct { stride_size: LiteralInteger },
4712 wordsize_intel: struct { word_size: LiteralInteger },
4713 true_dual_port_intel,
4714 burst_coalesce_intel,
4715 cache_size_intel: struct { cache_size_in_bytes: LiteralInteger },
4716 dont_statically_coalesce_intel,
4717 prefetch_intel: struct { prefetcher_size_in_bytes: LiteralInteger },
4718 stall_enable_intel,
4719 fuse_loops_in_function_intel,
4720 math_op_dsp_mode_intel: struct { mode: LiteralInteger, propagate: LiteralInteger },
4721 alias_scope_intel: struct { aliasing_scopes_list: Id },
4722 no_alias_intel: struct { aliasing_scopes_list: Id },
4723 initiation_interval_intel: struct { cycles: LiteralInteger },
4724 max_concurrency_intel: struct { invocations: LiteralInteger },
4725 pipeline_enable_intel: struct { enable: LiteralInteger },
4726 buffer_location_intel: struct { buffer_location_id: LiteralInteger },
4727 io_pipe_storage_intel: struct { io_pipe_id: LiteralInteger },
4728 function_floating_point_mode_intel: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },
4729 single_element_vector_intel,
4730 vector_compute_callable_function_intel,
4731 media_block_iointel,
4732 stall_free_intel,
4733 fp_max_error_decoration_intel: struct { max_error: LiteralFloat },
4734 latency_control_label_intel: struct { latency_label: LiteralInteger },
4735 latency_control_constraint_intel: struct { relative_to: LiteralInteger, control_type: LiteralInteger, relative_cycle: LiteralInteger },
4736 conduit_kernel_argument_intel,
4737 register_map_kernel_argument_intel,
4738 mm_host_interface_address_width_intel: struct { address_width: LiteralInteger },
4739 mm_host_interface_data_width_intel: struct { data_width: LiteralInteger },
4740 mm_host_interface_latency_intel: struct { latency: LiteralInteger },
4741 mm_host_interface_read_write_mode_intel: struct { read_write_mode: AccessQualifier },
4742 mm_host_interface_max_burst_intel: struct { max_burst_count: LiteralInteger },
4743 mm_host_interface_wait_request_intel: struct { waitrequest: LiteralInteger },
4744 stable_kernel_argument_intel,
4745 host_access_intel: struct { access: HostAccessQualifier, name: LiteralString },
4746 init_mode_intel: struct { trigger: InitializationModeQualifier },
4747 implement_in_register_map_intel: struct { value: LiteralInteger },
4748 cache_control_load_intel: struct { cache_level: LiteralInteger, cache_control: LoadCacheControl },
4749 cache_control_store_intel: struct { cache_level: LiteralInteger, cache_control: StoreCacheControl },
4750 };
4751};
4752pub const BuiltIn = enum(u32) {
4753 position = 0,
4754 point_size = 1,
4755 clip_distance = 3,
4756 cull_distance = 4,
4757 vertex_id = 5,
4758 instance_id = 6,
4759 primitive_id = 7,
4760 invocation_id = 8,
4761 layer = 9,
4762 viewport_index = 10,
4763 tess_level_outer = 11,
4764 tess_level_inner = 12,
4765 tess_coord = 13,
4766 patch_vertices = 14,
4767 frag_coord = 15,
4768 point_coord = 16,
4769 front_facing = 17,
4770 sample_id = 18,
4771 sample_position = 19,
4772 sample_mask = 20,
4773 frag_depth = 22,
4774 helper_invocation = 23,
4775 num_workgroups = 24,
4776 workgroup_size = 25,
4777 workgroup_id = 26,
4778 local_invocation_id = 27,
4779 global_invocation_id = 28,
4780 local_invocation_index = 29,
4781 work_dim = 30,
4782 global_size = 31,
4783 enqueued_workgroup_size = 32,
4784 global_offset = 33,
4785 global_linear_id = 34,
4786 subgroup_size = 36,
4787 subgroup_max_size = 37,
4788 num_subgroups = 38,
4789 num_enqueued_subgroups = 39,
4790 subgroup_id = 40,
4791 subgroup_local_invocation_id = 41,
4792 vertex_index = 42,
4793 instance_index = 43,
4794 core_idarm = 4160,
4795 core_count_arm = 4161,
4796 core_max_idarm = 4162,
4797 warp_idarm = 4163,
4798 warp_max_idarm = 4164,
4799 subgroup_eq_mask = 4416,
4800 subgroup_ge_mask = 4417,
4801 subgroup_gt_mask = 4418,
4802 subgroup_le_mask = 4419,
4803 subgroup_lt_mask = 4420,
4804 base_vertex = 4424,
4805 base_instance = 4425,
4806 draw_index = 4426,
4807 primitive_shading_rate_khr = 4432,
4808 device_index = 4438,
4809 view_index = 4440,
4810 shading_rate_khr = 4444,
4811 tile_offset_qcom = 4492,
4812 tile_dimension_qcom = 4493,
4813 tile_apron_size_qcom = 4494,
4814 bary_coord_no_persp_amd = 4992,
4815 bary_coord_no_persp_centroid_amd = 4993,
4816 bary_coord_no_persp_sample_amd = 4994,
4817 bary_coord_smooth_amd = 4995,
4818 bary_coord_smooth_centroid_amd = 4996,
4819 bary_coord_smooth_sample_amd = 4997,
4820 bary_coord_pull_model_amd = 4998,
4821 frag_stencil_ref_ext = 5014,
4822 remaining_recursion_levels_amdx = 5021,
4823 shader_index_amdx = 5073,
4824 viewport_mask_nv = 5253,
4825 secondary_position_nv = 5257,
4826 secondary_viewport_mask_nv = 5258,
4827 position_per_view_nv = 5261,
4828 viewport_mask_per_view_nv = 5262,
4829 fully_covered_ext = 5264,
4830 task_count_nv = 5274,
4831 primitive_count_nv = 5275,
4832 primitive_indices_nv = 5276,
4833 clip_distance_per_view_nv = 5277,
4834 cull_distance_per_view_nv = 5278,
4835 layer_per_view_nv = 5279,
4836 mesh_view_count_nv = 5280,
4837 mesh_view_indices_nv = 5281,
4838 bary_coord_khr = 5286,
4839 bary_coord_no_persp_khr = 5287,
4840 frag_size_ext = 5292,
4841 frag_invocation_count_ext = 5293,
4842 primitive_point_indices_ext = 5294,
4843 primitive_line_indices_ext = 5295,
4844 primitive_triangle_indices_ext = 5296,
4845 cull_primitive_ext = 5299,
4846 launch_id_khr = 5319,
4847 launch_size_khr = 5320,
4848 world_ray_origin_khr = 5321,
4849 world_ray_direction_khr = 5322,
4850 object_ray_origin_khr = 5323,
4851 object_ray_direction_khr = 5324,
4852 ray_tmin_khr = 5325,
4853 ray_tmax_khr = 5326,
4854 instance_custom_index_khr = 5327,
4855 object_to_world_khr = 5330,
4856 world_to_object_khr = 5331,
4857 hit_tnv = 5332,
4858 hit_kind_khr = 5333,
4859 current_ray_time_nv = 5334,
4860 hit_triangle_vertex_positions_khr = 5335,
4861 hit_micro_triangle_vertex_positions_nv = 5337,
4862 hit_micro_triangle_vertex_barycentrics_nv = 5344,
4863 incoming_ray_flags_khr = 5351,
4864 ray_geometry_index_khr = 5352,
4865 hit_is_sphere_nv = 5359,
4866 hit_is_lssnv = 5360,
4867 hit_sphere_position_nv = 5361,
4868 warps_per_smnv = 5374,
4869 sm_count_nv = 5375,
4870 warp_idnv = 5376,
4871 smidnv = 5377,
4872 hit_lss_positions_nv = 5396,
4873 hit_kind_front_facing_micro_triangle_nv = 5405,
4874 hit_kind_back_facing_micro_triangle_nv = 5406,
4875 hit_sphere_radius_nv = 5420,
4876 hit_lss_radii_nv = 5421,
4877 cluster_idnv = 5436,
4878 cull_mask_khr = 6021,
4879};
4880pub const Scope = enum(u32) {
4881 cross_device = 0,
4882 device = 1,
4883 workgroup = 2,
4884 subgroup = 3,
4885 invocation = 4,
4886 queue_family = 5,
4887 shader_call_khr = 6,
4888};
4889pub const GroupOperation = enum(u32) {
4890 reduce = 0,
4891 inclusive_scan = 1,
4892 exclusive_scan = 2,
4893 clustered_reduce = 3,
4894 partitioned_reduce_nv = 6,
4895 partitioned_inclusive_scan_nv = 7,
4896 partitioned_exclusive_scan_nv = 8,
4897};
4898pub const KernelEnqueueFlags = enum(u32) {
4899 no_wait = 0,
4900 wait_kernel = 1,
4901 wait_work_group = 2,
4902};
4903pub const Capability = enum(u32) {
4904 matrix = 0,
4905 shader = 1,
4906 geometry = 2,
4907 tessellation = 3,
4908 addresses = 4,
4909 linkage = 5,
4910 kernel = 6,
4911 vector16 = 7,
4912 float16buffer = 8,
4913 float16 = 9,
4914 float64 = 10,
4915 int64 = 11,
4916 int64atomics = 12,
4917 image_basic = 13,
4918 image_read_write = 14,
4919 image_mipmap = 15,
4920 pipes = 17,
4921 groups = 18,
4922 device_enqueue = 19,
4923 literal_sampler = 20,
4924 atomic_storage = 21,
4925 int16 = 22,
4926 tessellation_point_size = 23,
4927 geometry_point_size = 24,
4928 image_gather_extended = 25,
4929 storage_image_multisample = 27,
4930 uniform_buffer_array_dynamic_indexing = 28,
4931 sampled_image_array_dynamic_indexing = 29,
4932 storage_buffer_array_dynamic_indexing = 30,
4933 storage_image_array_dynamic_indexing = 31,
4934 clip_distance = 32,
4935 cull_distance = 33,
4936 image_cube_array = 34,
4937 sample_rate_shading = 35,
4938 image_rect = 36,
4939 sampled_rect = 37,
4940 generic_pointer = 38,
4941 int8 = 39,
4942 input_attachment = 40,
4943 sparse_residency = 41,
4944 min_lod = 42,
4945 sampled1d = 43,
4946 image1d = 44,
4947 sampled_cube_array = 45,
4948 sampled_buffer = 46,
4949 image_buffer = 47,
4950 image_ms_array = 48,
4951 storage_image_extended_formats = 49,
4952 image_query = 50,
4953 derivative_control = 51,
4954 interpolation_function = 52,
4955 transform_feedback = 53,
4956 geometry_streams = 54,
4957 storage_image_read_without_format = 55,
4958 storage_image_write_without_format = 56,
4959 multi_viewport = 57,
4960 subgroup_dispatch = 58,
4961 named_barrier = 59,
4962 pipe_storage = 60,
4963 group_non_uniform = 61,
4964 group_non_uniform_vote = 62,
4965 group_non_uniform_arithmetic = 63,
4966 group_non_uniform_ballot = 64,
4967 group_non_uniform_shuffle = 65,
4968 group_non_uniform_shuffle_relative = 66,
4969 group_non_uniform_clustered = 67,
4970 group_non_uniform_quad = 68,
4971 shader_layer = 69,
4972 shader_viewport_index = 70,
4973 uniform_decoration = 71,
4974 core_builtins_arm = 4165,
4975 tile_image_color_read_access_ext = 4166,
4976 tile_image_depth_read_access_ext = 4167,
4977 tile_image_stencil_read_access_ext = 4168,
4978 tensors_arm = 4174,
4979 storage_tensor_array_dynamic_indexing_arm = 4175,
4980 storage_tensor_array_non_uniform_indexing_arm = 4176,
4981 graph_arm = 4191,
4982 cooperative_matrix_layouts_arm = 4201,
4983 float8ext = 4212,
4984 float8cooperative_matrix_ext = 4213,
4985 fragment_shading_rate_khr = 4422,
4986 subgroup_ballot_khr = 4423,
4987 draw_parameters = 4427,
4988 workgroup_memory_explicit_layout_khr = 4428,
4989 workgroup_memory_explicit_layout8bit_access_khr = 4429,
4990 workgroup_memory_explicit_layout16bit_access_khr = 4430,
4991 subgroup_vote_khr = 4431,
4992 storage_buffer16bit_access = 4433,
4993 uniform_and_storage_buffer16bit_access = 4434,
4994 storage_push_constant16 = 4435,
4995 storage_input_output16 = 4436,
4996 device_group = 4437,
4997 multi_view = 4439,
4998 variable_pointers_storage_buffer = 4441,
4999 variable_pointers = 4442,
5000 atomic_storage_ops = 4445,
5001 sample_mask_post_depth_coverage = 4447,
5002 storage_buffer8bit_access = 4448,
5003 uniform_and_storage_buffer8bit_access = 4449,
5004 storage_push_constant8 = 4450,
5005 denorm_preserve = 4464,
5006 denorm_flush_to_zero = 4465,
5007 signed_zero_inf_nan_preserve = 4466,
5008 rounding_mode_rte = 4467,
5009 rounding_mode_rtz = 4468,
5010 ray_query_provisional_khr = 4471,
5011 ray_query_khr = 4472,
5012 untyped_pointers_khr = 4473,
5013 ray_traversal_primitive_culling_khr = 4478,
5014 ray_tracing_khr = 4479,
5015 texture_sample_weighted_qcom = 4484,
5016 texture_box_filter_qcom = 4485,
5017 texture_block_match_qcom = 4486,
5018 tile_shading_qcom = 4495,
5019 texture_block_match2qcom = 4498,
5020 float16image_amd = 5008,
5021 image_gather_bias_lod_amd = 5009,
5022 fragment_mask_amd = 5010,
5023 stencil_export_ext = 5013,
5024 image_read_write_lod_amd = 5015,
5025 int64image_ext = 5016,
5026 shader_clock_khr = 5055,
5027 shader_enqueue_amdx = 5067,
5028 quad_control_khr = 5087,
5029 int4type_intel = 5112,
5030 int4cooperative_matrix_intel = 5114,
5031 b_float16type_khr = 5116,
5032 b_float16dot_product_khr = 5117,
5033 b_float16cooperative_matrix_khr = 5118,
5034 sample_mask_override_coverage_nv = 5249,
5035 geometry_shader_passthrough_nv = 5251,
5036 shader_viewport_index_layer_ext = 5254,
5037 shader_viewport_mask_nv = 5255,
5038 shader_stereo_view_nv = 5259,
5039 per_view_attributes_nv = 5260,
5040 fragment_fully_covered_ext = 5265,
5041 mesh_shading_nv = 5266,
5042 image_footprint_nv = 5282,
5043 mesh_shading_ext = 5283,
5044 fragment_barycentric_khr = 5284,
5045 compute_derivative_group_quads_khr = 5288,
5046 fragment_density_ext = 5291,
5047 group_non_uniform_partitioned_nv = 5297,
5048 shader_non_uniform = 5301,
5049 runtime_descriptor_array = 5302,
5050 input_attachment_array_dynamic_indexing = 5303,
5051 uniform_texel_buffer_array_dynamic_indexing = 5304,
5052 storage_texel_buffer_array_dynamic_indexing = 5305,
5053 uniform_buffer_array_non_uniform_indexing = 5306,
5054 sampled_image_array_non_uniform_indexing = 5307,
5055 storage_buffer_array_non_uniform_indexing = 5308,
5056 storage_image_array_non_uniform_indexing = 5309,
5057 input_attachment_array_non_uniform_indexing = 5310,
5058 uniform_texel_buffer_array_non_uniform_indexing = 5311,
5059 storage_texel_buffer_array_non_uniform_indexing = 5312,
5060 ray_tracing_position_fetch_khr = 5336,
5061 ray_tracing_nv = 5340,
5062 ray_tracing_motion_blur_nv = 5341,
5063 vulkan_memory_model = 5345,
5064 vulkan_memory_model_device_scope = 5346,
5065 physical_storage_buffer_addresses = 5347,
5066 compute_derivative_group_linear_khr = 5350,
5067 ray_tracing_provisional_khr = 5353,
5068 cooperative_matrix_nv = 5357,
5069 fragment_shader_sample_interlock_ext = 5363,
5070 fragment_shader_shading_rate_interlock_ext = 5372,
5071 shader_sm_builtins_nv = 5373,
5072 fragment_shader_pixel_interlock_ext = 5378,
5073 demote_to_helper_invocation = 5379,
5074 displacement_micromap_nv = 5380,
5075 ray_tracing_opacity_micromap_ext = 5381,
5076 shader_invocation_reorder_nv = 5383,
5077 bindless_texture_nv = 5390,
5078 ray_query_position_fetch_khr = 5391,
5079 cooperative_vector_nv = 5394,
5080 atomic_float16vector_nv = 5404,
5081 ray_tracing_displacement_micromap_nv = 5409,
5082 raw_access_chains_nv = 5414,
5083 ray_tracing_spheres_geometry_nv = 5418,
5084 ray_tracing_linear_swept_spheres_geometry_nv = 5419,
5085 cooperative_matrix_reductions_nv = 5430,
5086 cooperative_matrix_conversions_nv = 5431,
5087 cooperative_matrix_per_element_operations_nv = 5432,
5088 cooperative_matrix_tensor_addressing_nv = 5433,
5089 cooperative_matrix_block_loads_nv = 5434,
5090 cooperative_vector_training_nv = 5435,
5091 ray_tracing_cluster_acceleration_structure_nv = 5437,
5092 tensor_addressing_nv = 5439,
5093 subgroup_shuffle_intel = 5568,
5094 subgroup_buffer_block_iointel = 5569,
5095 subgroup_image_block_iointel = 5570,
5096 subgroup_image_media_block_iointel = 5579,
5097 round_to_infinity_intel = 5582,
5098 floating_point_mode_intel = 5583,
5099 integer_functions2intel = 5584,
5100 function_pointers_intel = 5603,
5101 indirect_references_intel = 5604,
5102 asm_intel = 5606,
5103 atomic_float32min_max_ext = 5612,
5104 atomic_float64min_max_ext = 5613,
5105 atomic_float16min_max_ext = 5616,
5106 vector_compute_intel = 5617,
5107 vector_any_intel = 5619,
5108 expect_assume_khr = 5629,
5109 subgroup_avc_motion_estimation_intel = 5696,
5110 subgroup_avc_motion_estimation_intra_intel = 5697,
5111 subgroup_avc_motion_estimation_chroma_intel = 5698,
5112 variable_length_array_intel = 5817,
5113 function_float_control_intel = 5821,
5114 fpga_memory_attributes_intel = 5824,
5115 fp_fast_math_mode_intel = 5837,
5116 arbitrary_precision_integers_intel = 5844,
5117 arbitrary_precision_floating_point_intel = 5845,
5118 unstructured_loop_controls_intel = 5886,
5119 fpga_loop_controls_intel = 5888,
5120 kernel_attributes_intel = 5892,
5121 fpga_kernel_attributes_intel = 5897,
5122 fpga_memory_accesses_intel = 5898,
5123 fpga_cluster_attributes_intel = 5904,
5124 loop_fuse_intel = 5906,
5125 fpgadsp_control_intel = 5908,
5126 memory_access_aliasing_intel = 5910,
5127 fpga_invocation_pipelining_attributes_intel = 5916,
5128 fpga_buffer_location_intel = 5920,
5129 arbitrary_precision_fixed_point_intel = 5922,
5130 usm_storage_classes_intel = 5935,
5131 runtime_aligned_attribute_intel = 5939,
5132 io_pipes_intel = 5943,
5133 blocking_pipes_intel = 5945,
5134 fpga_reg_intel = 5948,
5135 dot_product_input_all = 6016,
5136 dot_product_input4x8bit = 6017,
5137 dot_product_input4x8bit_packed = 6018,
5138 dot_product = 6019,
5139 ray_cull_mask_khr = 6020,
5140 cooperative_matrix_khr = 6022,
5141 replicated_composites_ext = 6024,
5142 bit_instructions = 6025,
5143 group_non_uniform_rotate_khr = 6026,
5144 float_controls2 = 6029,
5145 atomic_float32add_ext = 6033,
5146 atomic_float64add_ext = 6034,
5147 long_composites_intel = 6089,
5148 opt_none_ext = 6094,
5149 atomic_float16add_ext = 6095,
5150 debug_info_module_intel = 6114,
5151 b_float16conversion_intel = 6115,
5152 split_barrier_intel = 6141,
5153 arithmetic_fence_ext = 6144,
5154 fpga_cluster_attributes_v2intel = 6150,
5155 fpga_kernel_attributesv2intel = 6161,
5156 task_sequence_intel = 6162,
5157 fp_max_error_intel = 6169,
5158 fpga_latency_control_intel = 6171,
5159 fpga_argument_interfaces_intel = 6174,
5160 global_variable_host_access_intel = 6187,
5161 global_variable_fpga_decorations_intel = 6189,
5162 subgroup_buffer_prefetch_intel = 6220,
5163 subgroup2d_block_iointel = 6228,
5164 subgroup2d_block_transform_intel = 6229,
5165 subgroup2d_block_transpose_intel = 6230,
5166 subgroup_matrix_multiply_accumulate_intel = 6236,
5167 ternary_bitwise_function_intel = 6241,
5168 group_uniform_arithmetic_khr = 6400,
5169 tensor_float32rounding_intel = 6425,
5170 masked_gather_scatter_intel = 6427,
5171 cache_controls_intel = 6441,
5172 register_limits_intel = 6460,
5173 bindless_images_intel = 6528,
5174};
5175pub const RayQueryIntersection = enum(u32) {
5176 ray_query_candidate_intersection_khr = 0,
5177 ray_query_committed_intersection_khr = 1,
5178};
5179pub const RayQueryCommittedIntersectionType = enum(u32) {
5180 ray_query_committed_intersection_none_khr = 0,
5181 ray_query_committed_intersection_triangle_khr = 1,
5182 ray_query_committed_intersection_generated_khr = 2,
5183};
5184pub const RayQueryCandidateIntersectionType = enum(u32) {
5185 ray_query_candidate_intersection_triangle_khr = 0,
5186 ray_query_candidate_intersection_aabbkhr = 1,
5187};
5188pub const PackedVectorFormat = enum(u32) {
5189 packed_vector_format4x8bit = 0,
5190};
5191pub const CooperativeMatrixOperands = packed struct {
5192 matrix_a_signed_components_khr: bool = false,
5193 matrix_b_signed_components_khr: bool = false,
5194 matrix_c_signed_components_khr: bool = false,
5195 matrix_result_signed_components_khr: bool = false,
5196 saturating_accumulation_khr: bool = false,
5197 _reserved_bit_5: bool = false,
5198 _reserved_bit_6: bool = false,
5199 _reserved_bit_7: bool = false,
5200 _reserved_bit_8: bool = false,
5201 _reserved_bit_9: bool = false,
5202 _reserved_bit_10: bool = false,
5203 _reserved_bit_11: bool = false,
5204 _reserved_bit_12: bool = false,
5205 _reserved_bit_13: bool = false,
5206 _reserved_bit_14: bool = false,
5207 _reserved_bit_15: bool = false,
5208 _reserved_bit_16: bool = false,
5209 _reserved_bit_17: bool = false,
5210 _reserved_bit_18: bool = false,
5211 _reserved_bit_19: bool = false,
5212 _reserved_bit_20: bool = false,
5213 _reserved_bit_21: bool = false,
5214 _reserved_bit_22: bool = false,
5215 _reserved_bit_23: bool = false,
5216 _reserved_bit_24: bool = false,
5217 _reserved_bit_25: bool = false,
5218 _reserved_bit_26: bool = false,
5219 _reserved_bit_27: bool = false,
5220 _reserved_bit_28: bool = false,
5221 _reserved_bit_29: bool = false,
5222 _reserved_bit_30: bool = false,
5223 _reserved_bit_31: bool = false,
5224};
5225pub const CooperativeMatrixLayout = enum(u32) {
5226 row_major_khr = 0,
5227 column_major_khr = 1,
5228 row_blocked_interleaved_arm = 4202,
5229 column_blocked_interleaved_arm = 4203,
5230};
5231pub const CooperativeMatrixUse = enum(u32) {
5232 matrix_akhr = 0,
5233 matrix_bkhr = 1,
5234 matrix_accumulator_khr = 2,
5235};
5236pub const CooperativeMatrixReduce = packed struct {
5237 row: bool = false,
5238 column: bool = false,
5239 @"2x2": bool = false,
5240 _reserved_bit_3: bool = false,
5241 _reserved_bit_4: bool = false,
5242 _reserved_bit_5: bool = false,
5243 _reserved_bit_6: bool = false,
5244 _reserved_bit_7: bool = false,
5245 _reserved_bit_8: bool = false,
5246 _reserved_bit_9: bool = false,
5247 _reserved_bit_10: bool = false,
5248 _reserved_bit_11: bool = false,
5249 _reserved_bit_12: bool = false,
5250 _reserved_bit_13: bool = false,
5251 _reserved_bit_14: bool = false,
5252 _reserved_bit_15: bool = false,
5253 _reserved_bit_16: bool = false,
5254 _reserved_bit_17: bool = false,
5255 _reserved_bit_18: bool = false,
5256 _reserved_bit_19: bool = false,
5257 _reserved_bit_20: bool = false,
5258 _reserved_bit_21: bool = false,
5259 _reserved_bit_22: bool = false,
5260 _reserved_bit_23: bool = false,
5261 _reserved_bit_24: bool = false,
5262 _reserved_bit_25: bool = false,
5263 _reserved_bit_26: bool = false,
5264 _reserved_bit_27: bool = false,
5265 _reserved_bit_28: bool = false,
5266 _reserved_bit_29: bool = false,
5267 _reserved_bit_30: bool = false,
5268 _reserved_bit_31: bool = false,
5269};
5270pub const TensorClampMode = enum(u32) {
5271 undefined = 0,
5272 constant = 1,
5273 clamp_to_edge = 2,
5274 repeat = 3,
5275 repeat_mirrored = 4,
5276};
5277pub const TensorAddressingOperands = packed struct {
5278 tensor_view: bool = false,
5279 decode_func: bool = false,
5280 _reserved_bit_2: bool = false,
5281 _reserved_bit_3: bool = false,
5282 _reserved_bit_4: bool = false,
5283 _reserved_bit_5: bool = false,
5284 _reserved_bit_6: bool = false,
5285 _reserved_bit_7: bool = false,
5286 _reserved_bit_8: bool = false,
5287 _reserved_bit_9: bool = false,
5288 _reserved_bit_10: bool = false,
5289 _reserved_bit_11: bool = false,
5290 _reserved_bit_12: bool = false,
5291 _reserved_bit_13: bool = false,
5292 _reserved_bit_14: bool = false,
5293 _reserved_bit_15: bool = false,
5294 _reserved_bit_16: bool = false,
5295 _reserved_bit_17: bool = false,
5296 _reserved_bit_18: bool = false,
5297 _reserved_bit_19: bool = false,
5298 _reserved_bit_20: bool = false,
5299 _reserved_bit_21: bool = false,
5300 _reserved_bit_22: bool = false,
5301 _reserved_bit_23: bool = false,
5302 _reserved_bit_24: bool = false,
5303 _reserved_bit_25: bool = false,
5304 _reserved_bit_26: bool = false,
5305 _reserved_bit_27: bool = false,
5306 _reserved_bit_28: bool = false,
5307 _reserved_bit_29: bool = false,
5308 _reserved_bit_30: bool = false,
5309 _reserved_bit_31: bool = false,
5310
5311 pub const Extended = struct {
5312 tensor_view: ?struct { id_ref: Id } = null,
5313 decode_func: ?struct { id_ref: Id } = null,
5314 _reserved_bit_2: bool = false,
5315 _reserved_bit_3: bool = false,
5316 _reserved_bit_4: bool = false,
5317 _reserved_bit_5: bool = false,
5318 _reserved_bit_6: bool = false,
5319 _reserved_bit_7: bool = false,
5320 _reserved_bit_8: bool = false,
5321 _reserved_bit_9: bool = false,
5322 _reserved_bit_10: bool = false,
5323 _reserved_bit_11: bool = false,
5324 _reserved_bit_12: bool = false,
5325 _reserved_bit_13: bool = false,
5326 _reserved_bit_14: bool = false,
5327 _reserved_bit_15: bool = false,
5328 _reserved_bit_16: bool = false,
5329 _reserved_bit_17: bool = false,
5330 _reserved_bit_18: bool = false,
5331 _reserved_bit_19: bool = false,
5332 _reserved_bit_20: bool = false,
5333 _reserved_bit_21: bool = false,
5334 _reserved_bit_22: bool = false,
5335 _reserved_bit_23: bool = false,
5336 _reserved_bit_24: bool = false,
5337 _reserved_bit_25: bool = false,
5338 _reserved_bit_26: bool = false,
5339 _reserved_bit_27: bool = false,
5340 _reserved_bit_28: bool = false,
5341 _reserved_bit_29: bool = false,
5342 _reserved_bit_30: bool = false,
5343 _reserved_bit_31: bool = false,
5344 };
5345};
5346pub const InitializationModeQualifier = enum(u32) {
5347 init_on_device_reprogram_intel = 0,
5348 init_on_device_reset_intel = 1,
5349};
5350pub const LoadCacheControl = enum(u32) {
5351 uncached_intel = 0,
5352 cached_intel = 1,
5353 streaming_intel = 2,
5354 invalidate_after_read_intel = 3,
5355 const_cached_intel = 4,
5356};
5357pub const StoreCacheControl = enum(u32) {
5358 uncached_intel = 0,
5359 write_through_intel = 1,
5360 write_back_intel = 2,
5361 streaming_intel = 3,
5362};
5363pub const NamedMaximumNumberOfRegisters = enum(u32) {
5364 auto_intel = 0,
5365};
5366pub const MatrixMultiplyAccumulateOperands = packed struct {
5367 matrix_a_signed_components_intel: bool = false,
5368 matrix_b_signed_components_intel: bool = false,
5369 matrix_cb_float16intel: bool = false,
5370 matrix_result_b_float16intel: bool = false,
5371 matrix_a_packed_int8intel: bool = false,
5372 matrix_b_packed_int8intel: bool = false,
5373 matrix_a_packed_int4intel: bool = false,
5374 matrix_b_packed_int4intel: bool = false,
5375 matrix_atf32intel: bool = false,
5376 matrix_btf32intel: bool = false,
5377 matrix_a_packed_float16intel: bool = false,
5378 matrix_b_packed_float16intel: bool = false,
5379 matrix_a_packed_b_float16intel: bool = false,
5380 matrix_b_packed_b_float16intel: bool = false,
5381 _reserved_bit_14: bool = false,
5382 _reserved_bit_15: bool = false,
5383 _reserved_bit_16: bool = false,
5384 _reserved_bit_17: bool = false,
5385 _reserved_bit_18: bool = false,
5386 _reserved_bit_19: bool = false,
5387 _reserved_bit_20: bool = false,
5388 _reserved_bit_21: bool = false,
5389 _reserved_bit_22: bool = false,
5390 _reserved_bit_23: bool = false,
5391 _reserved_bit_24: bool = false,
5392 _reserved_bit_25: bool = false,
5393 _reserved_bit_26: bool = false,
5394 _reserved_bit_27: bool = false,
5395 _reserved_bit_28: bool = false,
5396 _reserved_bit_29: bool = false,
5397 _reserved_bit_30: bool = false,
5398 _reserved_bit_31: bool = false,
5399};
5400pub const FPEncoding = enum(u32) {
5401 b_float16khr = 0,
5402 float8e4m3ext = 4214,
5403 float8e5m2ext = 4215,
5404};
5405pub const CooperativeVectorMatrixLayout = enum(u32) {
5406 row_major_nv = 0,
5407 column_major_nv = 1,
5408 inferencing_optimal_nv = 2,
5409 training_optimal_nv = 3,
5410};
5411pub const ComponentType = enum(u32) {
5412 float16nv = 0,
5413 float32nv = 1,
5414 float64nv = 2,
5415 signed_int8nv = 3,
5416 signed_int16nv = 4,
5417 signed_int32nv = 5,
5418 signed_int64nv = 6,
5419 unsigned_int8nv = 7,
5420 unsigned_int16nv = 8,
5421 unsigned_int32nv = 9,
5422 unsigned_int64nv = 10,
5423 signed_int8packed_nv = 1000491000,
5424 unsigned_int8packed_nv = 1000491001,
5425 float_e4m3nv = 1000491002,
5426 float_e5m2nv = 1000491003,
5427};
5428pub const TensorOperands = packed struct {
5429 nontemporal_arm: bool = false,
5430 out_of_bounds_value_arm: bool = false,
5431 make_element_available_arm: bool = false,
5432 make_element_visible_arm: bool = false,
5433 non_private_element_arm: bool = false,
5434 _reserved_bit_5: bool = false,
5435 _reserved_bit_6: bool = false,
5436 _reserved_bit_7: bool = false,
5437 _reserved_bit_8: bool = false,
5438 _reserved_bit_9: bool = false,
5439 _reserved_bit_10: bool = false,
5440 _reserved_bit_11: bool = false,
5441 _reserved_bit_12: bool = false,
5442 _reserved_bit_13: bool = false,
5443 _reserved_bit_14: bool = false,
5444 _reserved_bit_15: bool = false,
5445 _reserved_bit_16: bool = false,
5446 _reserved_bit_17: bool = false,
5447 _reserved_bit_18: bool = false,
5448 _reserved_bit_19: bool = false,
5449 _reserved_bit_20: bool = false,
5450 _reserved_bit_21: bool = false,
5451 _reserved_bit_22: bool = false,
5452 _reserved_bit_23: bool = false,
5453 _reserved_bit_24: bool = false,
5454 _reserved_bit_25: bool = false,
5455 _reserved_bit_26: bool = false,
5456 _reserved_bit_27: bool = false,
5457 _reserved_bit_28: bool = false,
5458 _reserved_bit_29: bool = false,
5459 _reserved_bit_30: bool = false,
5460 _reserved_bit_31: bool = false,
5461
5462 pub const Extended = struct {
5463 nontemporal_arm: bool = false,
5464 out_of_bounds_value_arm: ?struct { id_ref: Id } = null,
5465 make_element_available_arm: ?struct { id_ref: Id } = null,
5466 make_element_visible_arm: ?struct { id_ref: Id } = null,
5467 non_private_element_arm: bool = false,
5468 _reserved_bit_5: bool = false,
5469 _reserved_bit_6: bool = false,
5470 _reserved_bit_7: bool = false,
5471 _reserved_bit_8: bool = false,
5472 _reserved_bit_9: bool = false,
5473 _reserved_bit_10: bool = false,
5474 _reserved_bit_11: bool = false,
5475 _reserved_bit_12: bool = false,
5476 _reserved_bit_13: bool = false,
5477 _reserved_bit_14: bool = false,
5478 _reserved_bit_15: bool = false,
5479 _reserved_bit_16: bool = false,
5480 _reserved_bit_17: bool = false,
5481 _reserved_bit_18: bool = false,
5482 _reserved_bit_19: bool = false,
5483 _reserved_bit_20: bool = false,
5484 _reserved_bit_21: bool = false,
5485 _reserved_bit_22: bool = false,
5486 _reserved_bit_23: bool = false,
5487 _reserved_bit_24: bool = false,
5488 _reserved_bit_25: bool = false,
5489 _reserved_bit_26: bool = false,
5490 _reserved_bit_27: bool = false,
5491 _reserved_bit_28: bool = false,
5492 _reserved_bit_29: bool = false,
5493 _reserved_bit_30: bool = false,
5494 _reserved_bit_31: bool = false,
5495 };
5496};
5497pub const @"DebugInfo.DebugInfoFlags" = packed struct {
5498 flag_is_protected: bool = false,
5499 flag_is_private: bool = false,
5500 flag_is_local: bool = false,
5501 flag_is_definition: bool = false,
5502 flag_fwd_decl: bool = false,
5503 flag_artificial: bool = false,
5504 flag_explicit: bool = false,
5505 flag_prototyped: bool = false,
5506 flag_object_pointer: bool = false,
5507 flag_static_member: bool = false,
5508 flag_indirect_variable: bool = false,
5509 flag_l_value_reference: bool = false,
5510 flag_r_value_reference: bool = false,
5511 flag_is_optimized: bool = false,
5512 _reserved_bit_14: bool = false,
5513 _reserved_bit_15: bool = false,
5514 _reserved_bit_16: bool = false,
5515 _reserved_bit_17: bool = false,
5516 _reserved_bit_18: bool = false,
5517 _reserved_bit_19: bool = false,
5518 _reserved_bit_20: bool = false,
5519 _reserved_bit_21: bool = false,
5520 _reserved_bit_22: bool = false,
5521 _reserved_bit_23: bool = false,
5522 _reserved_bit_24: bool = false,
5523 _reserved_bit_25: bool = false,
5524 _reserved_bit_26: bool = false,
5525 _reserved_bit_27: bool = false,
5526 _reserved_bit_28: bool = false,
5527 _reserved_bit_29: bool = false,
5528 _reserved_bit_30: bool = false,
5529 _reserved_bit_31: bool = false,
5530};
5531pub const @"DebugInfo.DebugBaseTypeAttributeEncoding" = enum(u32) {
5532 unspecified = 0,
5533 address = 1,
5534 boolean = 2,
5535 float = 4,
5536 signed = 5,
5537 signed_char = 6,
5538 unsigned = 7,
5539 unsigned_char = 8,
5540};
5541pub const @"DebugInfo.DebugCompositeType" = enum(u32) {
5542 class = 0,
5543 structure = 1,
5544 @"union" = 2,
5545};
5546pub const @"DebugInfo.DebugTypeQualifier" = enum(u32) {
5547 const_type = 0,
5548 volatile_type = 1,
5549 restrict_type = 2,
5550};
5551pub const @"DebugInfo.DebugOperation" = enum(u32) {
5552 deref = 0,
5553 plus = 1,
5554 minus = 2,
5555 plus_uconst = 3,
5556 bit_piece = 4,
5557 swap = 5,
5558 xderef = 6,
5559 stack_value = 7,
5560 constu = 8,
5561
5562 pub const Extended = union(@"DebugInfo.DebugOperation") {
5563 deref,
5564 plus,
5565 minus,
5566 plus_uconst: struct { literal_integer: LiteralInteger },
5567 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5568 swap,
5569 xderef,
5570 stack_value,
5571 constu: struct { literal_integer: LiteralInteger },
5572 };
5573};
5574pub const @"OpenCL.DebugInfo.100.DebugInfoFlags" = packed struct {
5575 flag_is_protected: bool = false,
5576 flag_is_private: bool = false,
5577 flag_is_local: bool = false,
5578 flag_is_definition: bool = false,
5579 flag_fwd_decl: bool = false,
5580 flag_artificial: bool = false,
5581 flag_explicit: bool = false,
5582 flag_prototyped: bool = false,
5583 flag_object_pointer: bool = false,
5584 flag_static_member: bool = false,
5585 flag_indirect_variable: bool = false,
5586 flag_l_value_reference: bool = false,
5587 flag_r_value_reference: bool = false,
5588 flag_is_optimized: bool = false,
5589 flag_is_enum_class: bool = false,
5590 flag_type_pass_by_value: bool = false,
5591 flag_type_pass_by_reference: bool = false,
5592 _reserved_bit_17: bool = false,
5593 _reserved_bit_18: bool = false,
5594 _reserved_bit_19: bool = false,
5595 _reserved_bit_20: bool = false,
5596 _reserved_bit_21: bool = false,
5597 _reserved_bit_22: bool = false,
5598 _reserved_bit_23: bool = false,
5599 _reserved_bit_24: bool = false,
5600 _reserved_bit_25: bool = false,
5601 _reserved_bit_26: bool = false,
5602 _reserved_bit_27: bool = false,
5603 _reserved_bit_28: bool = false,
5604 _reserved_bit_29: bool = false,
5605 _reserved_bit_30: bool = false,
5606 _reserved_bit_31: bool = false,
5607};
5608pub const @"OpenCL.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5609 unspecified = 0,
5610 address = 1,
5611 boolean = 2,
5612 float = 3,
5613 signed = 4,
5614 signed_char = 5,
5615 unsigned = 6,
5616 unsigned_char = 7,
5617};
5618pub const @"OpenCL.DebugInfo.100.DebugCompositeType" = enum(u32) {
5619 class = 0,
5620 structure = 1,
5621 @"union" = 2,
5622};
5623pub const @"OpenCL.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5624 const_type = 0,
5625 volatile_type = 1,
5626 restrict_type = 2,
5627 atomic_type = 3,
5628};
5629pub const @"OpenCL.DebugInfo.100.DebugOperation" = enum(u32) {
5630 deref = 0,
5631 plus = 1,
5632 minus = 2,
5633 plus_uconst = 3,
5634 bit_piece = 4,
5635 swap = 5,
5636 xderef = 6,
5637 stack_value = 7,
5638 constu = 8,
5639 fragment = 9,
5640
5641 pub const Extended = union(@"OpenCL.DebugInfo.100.DebugOperation") {
5642 deref,
5643 plus,
5644 minus,
5645 plus_uconst: struct { literal_integer: LiteralInteger },
5646 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5647 swap,
5648 xderef,
5649 stack_value,
5650 constu: struct { literal_integer: LiteralInteger },
5651 fragment: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5652 };
5653};
5654pub const @"OpenCL.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5655 imported_module = 0,
5656 imported_declaration = 1,
5657};
5658pub const @"NonSemantic.ClspvReflection.6.KernelPropertyFlags" = packed struct {
5659 may_use_printf: bool = false,
5660 _reserved_bit_1: bool = false,
5661 _reserved_bit_2: bool = false,
5662 _reserved_bit_3: bool = false,
5663 _reserved_bit_4: bool = false,
5664 _reserved_bit_5: bool = false,
5665 _reserved_bit_6: bool = false,
5666 _reserved_bit_7: bool = false,
5667 _reserved_bit_8: bool = false,
5668 _reserved_bit_9: bool = false,
5669 _reserved_bit_10: bool = false,
5670 _reserved_bit_11: bool = false,
5671 _reserved_bit_12: bool = false,
5672 _reserved_bit_13: bool = false,
5673 _reserved_bit_14: bool = false,
5674 _reserved_bit_15: bool = false,
5675 _reserved_bit_16: bool = false,
5676 _reserved_bit_17: bool = false,
5677 _reserved_bit_18: bool = false,
5678 _reserved_bit_19: bool = false,
5679 _reserved_bit_20: bool = false,
5680 _reserved_bit_21: bool = false,
5681 _reserved_bit_22: bool = false,
5682 _reserved_bit_23: bool = false,
5683 _reserved_bit_24: bool = false,
5684 _reserved_bit_25: bool = false,
5685 _reserved_bit_26: bool = false,
5686 _reserved_bit_27: bool = false,
5687 _reserved_bit_28: bool = false,
5688 _reserved_bit_29: bool = false,
5689 _reserved_bit_30: bool = false,
5690 _reserved_bit_31: bool = false,
5691};
5692pub const @"NonSemantic.Shader.DebugInfo.100.DebugInfoFlags" = packed struct {
5693 flag_is_protected: bool = false,
5694 flag_is_private: bool = false,
5695 flag_is_local: bool = false,
5696 flag_is_definition: bool = false,
5697 flag_fwd_decl: bool = false,
5698 flag_artificial: bool = false,
5699 flag_explicit: bool = false,
5700 flag_prototyped: bool = false,
5701 flag_object_pointer: bool = false,
5702 flag_static_member: bool = false,
5703 flag_indirect_variable: bool = false,
5704 flag_l_value_reference: bool = false,
5705 flag_r_value_reference: bool = false,
5706 flag_is_optimized: bool = false,
5707 flag_is_enum_class: bool = false,
5708 flag_type_pass_by_value: bool = false,
5709 flag_type_pass_by_reference: bool = false,
5710 flag_unknown_physical_layout: bool = false,
5711 _reserved_bit_18: bool = false,
5712 _reserved_bit_19: bool = false,
5713 _reserved_bit_20: bool = false,
5714 _reserved_bit_21: bool = false,
5715 _reserved_bit_22: bool = false,
5716 _reserved_bit_23: bool = false,
5717 _reserved_bit_24: bool = false,
5718 _reserved_bit_25: bool = false,
5719 _reserved_bit_26: bool = false,
5720 _reserved_bit_27: bool = false,
5721 _reserved_bit_28: bool = false,
5722 _reserved_bit_29: bool = false,
5723 _reserved_bit_30: bool = false,
5724 _reserved_bit_31: bool = false,
5725};
5726pub const @"NonSemantic.Shader.DebugInfo.100.BuildIdentifierFlags" = packed struct {
5727 identifier_possible_duplicates: bool = false,
5728 _reserved_bit_1: bool = false,
5729 _reserved_bit_2: bool = false,
5730 _reserved_bit_3: bool = false,
5731 _reserved_bit_4: bool = false,
5732 _reserved_bit_5: bool = false,
5733 _reserved_bit_6: bool = false,
5734 _reserved_bit_7: bool = false,
5735 _reserved_bit_8: bool = false,
5736 _reserved_bit_9: bool = false,
5737 _reserved_bit_10: bool = false,
5738 _reserved_bit_11: bool = false,
5739 _reserved_bit_12: bool = false,
5740 _reserved_bit_13: bool = false,
5741 _reserved_bit_14: bool = false,
5742 _reserved_bit_15: bool = false,
5743 _reserved_bit_16: bool = false,
5744 _reserved_bit_17: bool = false,
5745 _reserved_bit_18: bool = false,
5746 _reserved_bit_19: bool = false,
5747 _reserved_bit_20: bool = false,
5748 _reserved_bit_21: bool = false,
5749 _reserved_bit_22: bool = false,
5750 _reserved_bit_23: bool = false,
5751 _reserved_bit_24: bool = false,
5752 _reserved_bit_25: bool = false,
5753 _reserved_bit_26: bool = false,
5754 _reserved_bit_27: bool = false,
5755 _reserved_bit_28: bool = false,
5756 _reserved_bit_29: bool = false,
5757 _reserved_bit_30: bool = false,
5758 _reserved_bit_31: bool = false,
5759};
5760pub const @"NonSemantic.Shader.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5761 unspecified = 0,
5762 address = 1,
5763 boolean = 2,
5764 float = 3,
5765 signed = 4,
5766 signed_char = 5,
5767 unsigned = 6,
5768 unsigned_char = 7,
5769};
5770pub const @"NonSemantic.Shader.DebugInfo.100.DebugCompositeType" = enum(u32) {
5771 class = 0,
5772 structure = 1,
5773 @"union" = 2,
5774};
5775pub const @"NonSemantic.Shader.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5776 const_type = 0,
5777 volatile_type = 1,
5778 restrict_type = 2,
5779 atomic_type = 3,
5780};
5781pub const @"NonSemantic.Shader.DebugInfo.100.DebugOperation" = enum(u32) {
5782 deref = 0,
5783 plus = 1,
5784 minus = 2,
5785 plus_uconst = 3,
5786 bit_piece = 4,
5787 swap = 5,
5788 xderef = 6,
5789 stack_value = 7,
5790 constu = 8,
5791 fragment = 9,
5792
5793 pub const Extended = union(@"NonSemantic.Shader.DebugInfo.100.DebugOperation") {
5794 deref,
5795 plus,
5796 minus,
5797 plus_uconst: struct { id_ref: Id },
5798 bit_piece: struct { id_ref_0: Id, id_ref_1: Id },
5799 swap,
5800 xderef,
5801 stack_value,
5802 constu: struct { id_ref: Id },
5803 fragment: struct { id_ref_0: Id, id_ref_1: Id },
5804 };
5805};
5806pub const @"NonSemantic.Shader.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5807 imported_module = 0,
5808 imported_declaration = 1,
5809};
5810pub const InstructionSet = enum {
5811 core,
5812 SPV_AMD_shader_trinary_minmax,
5813 SPV_EXT_INST_TYPE_TOSA_001000_1,
5814 @"NonSemantic.VkspReflection",
5815 SPV_AMD_shader_explicit_vertex_parameter,
5816 DebugInfo,
5817 @"NonSemantic.DebugBreak",
5818 @"OpenCL.DebugInfo.100",
5819 @"NonSemantic.ClspvReflection.6",
5820 @"GLSL.std.450",
5821 SPV_AMD_shader_ballot,
5822 @"NonSemantic.DebugPrintf",
5823 SPV_AMD_gcn_shader,
5824 @"OpenCL.std",
5825 @"NonSemantic.Shader.DebugInfo.100",
5826 zig,
5827
5828 pub fn instructions(self: InstructionSet) []const Instruction {
5829 return switch (self) {
5830 .core => &.{
5831 .{
5832 .name = "OpNop",
5833 .opcode = 0,
5834 .operands = &.{},
5835 },
5836 .{
5837 .name = "OpUndef",
5838 .opcode = 1,
5839 .operands = &.{
5840 .{ .kind = .id_result_type, .quantifier = .required },
5841 .{ .kind = .id_result, .quantifier = .required },
5842 },
5843 },
5844 .{
5845 .name = "OpSourceContinued",
5846 .opcode = 2,
5847 .operands = &.{
5848 .{ .kind = .literal_string, .quantifier = .required },
5849 },
5850 },
5851 .{
5852 .name = "OpSource",
5853 .opcode = 3,
5854 .operands = &.{
5855 .{ .kind = .source_language, .quantifier = .required },
5856 .{ .kind = .literal_integer, .quantifier = .required },
5857 .{ .kind = .id_ref, .quantifier = .optional },
5858 .{ .kind = .literal_string, .quantifier = .optional },
5859 },
5860 },
5861 .{
5862 .name = "OpSourceExtension",
5863 .opcode = 4,
5864 .operands = &.{
5865 .{ .kind = .literal_string, .quantifier = .required },
5866 },
5867 },
5868 .{
5869 .name = "OpName",
5870 .opcode = 5,
5871 .operands = &.{
5872 .{ .kind = .id_ref, .quantifier = .required },
5873 .{ .kind = .literal_string, .quantifier = .required },
5874 },
5875 },
5876 .{
5877 .name = "OpMemberName",
5878 .opcode = 6,
5879 .operands = &.{
5880 .{ .kind = .id_ref, .quantifier = .required },
5881 .{ .kind = .literal_integer, .quantifier = .required },
5882 .{ .kind = .literal_string, .quantifier = .required },
5883 },
5884 },
5885 .{
5886 .name = "OpString",
5887 .opcode = 7,
5888 .operands = &.{
5889 .{ .kind = .id_result, .quantifier = .required },
5890 .{ .kind = .literal_string, .quantifier = .required },
5891 },
5892 },
5893 .{
5894 .name = "OpLine",
5895 .opcode = 8,
5896 .operands = &.{
5897 .{ .kind = .id_ref, .quantifier = .required },
5898 .{ .kind = .literal_integer, .quantifier = .required },
5899 .{ .kind = .literal_integer, .quantifier = .required },
5900 },
5901 },
5902 .{
5903 .name = "OpExtension",
5904 .opcode = 10,
5905 .operands = &.{
5906 .{ .kind = .literal_string, .quantifier = .required },
5907 },
5908 },
5909 .{
5910 .name = "OpExtInstImport",
5911 .opcode = 11,
5912 .operands = &.{
5913 .{ .kind = .id_result, .quantifier = .required },
5914 .{ .kind = .literal_string, .quantifier = .required },
5915 },
5916 },
5917 .{
5918 .name = "OpExtInst",
5919 .opcode = 12,
5920 .operands = &.{
5921 .{ .kind = .id_result_type, .quantifier = .required },
5922 .{ .kind = .id_result, .quantifier = .required },
5923 .{ .kind = .id_ref, .quantifier = .required },
5924 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
5925 .{ .kind = .id_ref, .quantifier = .variadic },
5926 },
5927 },
5928 .{
5929 .name = "OpMemoryModel",
5930 .opcode = 14,
5931 .operands = &.{
5932 .{ .kind = .addressing_model, .quantifier = .required },
5933 .{ .kind = .memory_model, .quantifier = .required },
5934 },
5935 },
5936 .{
5937 .name = "OpEntryPoint",
5938 .opcode = 15,
5939 .operands = &.{
5940 .{ .kind = .execution_model, .quantifier = .required },
5941 .{ .kind = .id_ref, .quantifier = .required },
5942 .{ .kind = .literal_string, .quantifier = .required },
5943 .{ .kind = .id_ref, .quantifier = .variadic },
5944 },
5945 },
5946 .{
5947 .name = "OpExecutionMode",
5948 .opcode = 16,
5949 .operands = &.{
5950 .{ .kind = .id_ref, .quantifier = .required },
5951 .{ .kind = .execution_mode, .quantifier = .required },
5952 },
5953 },
5954 .{
5955 .name = "OpCapability",
5956 .opcode = 17,
5957 .operands = &.{
5958 .{ .kind = .capability, .quantifier = .required },
5959 },
5960 },
5961 .{
5962 .name = "OpTypeVoid",
5963 .opcode = 19,
5964 .operands = &.{
5965 .{ .kind = .id_result, .quantifier = .required },
5966 },
5967 },
5968 .{
5969 .name = "OpTypeBool",
5970 .opcode = 20,
5971 .operands = &.{
5972 .{ .kind = .id_result, .quantifier = .required },
5973 },
5974 },
5975 .{
5976 .name = "OpTypeInt",
5977 .opcode = 21,
5978 .operands = &.{
5979 .{ .kind = .id_result, .quantifier = .required },
5980 .{ .kind = .literal_integer, .quantifier = .required },
5981 .{ .kind = .literal_integer, .quantifier = .required },
5982 },
5983 },
5984 .{
5985 .name = "OpTypeFloat",
5986 .opcode = 22,
5987 .operands = &.{
5988 .{ .kind = .id_result, .quantifier = .required },
5989 .{ .kind = .literal_integer, .quantifier = .required },
5990 .{ .kind = .fp_encoding, .quantifier = .optional },
5991 },
5992 },
5993 .{
5994 .name = "OpTypeVector",
5995 .opcode = 23,
5996 .operands = &.{
5997 .{ .kind = .id_result, .quantifier = .required },
5998 .{ .kind = .id_ref, .quantifier = .required },
5999 .{ .kind = .literal_integer, .quantifier = .required },
6000 },
6001 },
6002 .{
6003 .name = "OpTypeMatrix",
6004 .opcode = 24,
6005 .operands = &.{
6006 .{ .kind = .id_result, .quantifier = .required },
6007 .{ .kind = .id_ref, .quantifier = .required },
6008 .{ .kind = .literal_integer, .quantifier = .required },
6009 },
6010 },
6011 .{
6012 .name = "OpTypeImage",
6013 .opcode = 25,
6014 .operands = &.{
6015 .{ .kind = .id_result, .quantifier = .required },
6016 .{ .kind = .id_ref, .quantifier = .required },
6017 .{ .kind = .dim, .quantifier = .required },
6018 .{ .kind = .literal_integer, .quantifier = .required },
6019 .{ .kind = .literal_integer, .quantifier = .required },
6020 .{ .kind = .literal_integer, .quantifier = .required },
6021 .{ .kind = .literal_integer, .quantifier = .required },
6022 .{ .kind = .image_format, .quantifier = .required },
6023 .{ .kind = .access_qualifier, .quantifier = .optional },
6024 },
6025 },
6026 .{
6027 .name = "OpTypeSampler",
6028 .opcode = 26,
6029 .operands = &.{
6030 .{ .kind = .id_result, .quantifier = .required },
6031 },
6032 },
6033 .{
6034 .name = "OpTypeSampledImage",
6035 .opcode = 27,
6036 .operands = &.{
6037 .{ .kind = .id_result, .quantifier = .required },
6038 .{ .kind = .id_ref, .quantifier = .required },
6039 },
6040 },
6041 .{
6042 .name = "OpTypeArray",
6043 .opcode = 28,
6044 .operands = &.{
6045 .{ .kind = .id_result, .quantifier = .required },
6046 .{ .kind = .id_ref, .quantifier = .required },
6047 .{ .kind = .id_ref, .quantifier = .required },
6048 },
6049 },
6050 .{
6051 .name = "OpTypeRuntimeArray",
6052 .opcode = 29,
6053 .operands = &.{
6054 .{ .kind = .id_result, .quantifier = .required },
6055 .{ .kind = .id_ref, .quantifier = .required },
6056 },
6057 },
6058 .{
6059 .name = "OpTypeStruct",
6060 .opcode = 30,
6061 .operands = &.{
6062 .{ .kind = .id_result, .quantifier = .required },
6063 .{ .kind = .id_ref, .quantifier = .variadic },
6064 },
6065 },
6066 .{
6067 .name = "OpTypeOpaque",
6068 .opcode = 31,
6069 .operands = &.{
6070 .{ .kind = .id_result, .quantifier = .required },
6071 .{ .kind = .literal_string, .quantifier = .required },
6072 },
6073 },
6074 .{
6075 .name = "OpTypePointer",
6076 .opcode = 32,
6077 .operands = &.{
6078 .{ .kind = .id_result, .quantifier = .required },
6079 .{ .kind = .storage_class, .quantifier = .required },
6080 .{ .kind = .id_ref, .quantifier = .required },
6081 },
6082 },
6083 .{
6084 .name = "OpTypeFunction",
6085 .opcode = 33,
6086 .operands = &.{
6087 .{ .kind = .id_result, .quantifier = .required },
6088 .{ .kind = .id_ref, .quantifier = .required },
6089 .{ .kind = .id_ref, .quantifier = .variadic },
6090 },
6091 },
6092 .{
6093 .name = "OpTypeEvent",
6094 .opcode = 34,
6095 .operands = &.{
6096 .{ .kind = .id_result, .quantifier = .required },
6097 },
6098 },
6099 .{
6100 .name = "OpTypeDeviceEvent",
6101 .opcode = 35,
6102 .operands = &.{
6103 .{ .kind = .id_result, .quantifier = .required },
6104 },
6105 },
6106 .{
6107 .name = "OpTypeReserveId",
6108 .opcode = 36,
6109 .operands = &.{
6110 .{ .kind = .id_result, .quantifier = .required },
6111 },
6112 },
6113 .{
6114 .name = "OpTypeQueue",
6115 .opcode = 37,
6116 .operands = &.{
6117 .{ .kind = .id_result, .quantifier = .required },
6118 },
6119 },
6120 .{
6121 .name = "OpTypePipe",
6122 .opcode = 38,
6123 .operands = &.{
6124 .{ .kind = .id_result, .quantifier = .required },
6125 .{ .kind = .access_qualifier, .quantifier = .required },
6126 },
6127 },
6128 .{
6129 .name = "OpTypeForwardPointer",
6130 .opcode = 39,
6131 .operands = &.{
6132 .{ .kind = .id_ref, .quantifier = .required },
6133 .{ .kind = .storage_class, .quantifier = .required },
6134 },
6135 },
6136 .{
6137 .name = "OpConstantTrue",
6138 .opcode = 41,
6139 .operands = &.{
6140 .{ .kind = .id_result_type, .quantifier = .required },
6141 .{ .kind = .id_result, .quantifier = .required },
6142 },
6143 },
6144 .{
6145 .name = "OpConstantFalse",
6146 .opcode = 42,
6147 .operands = &.{
6148 .{ .kind = .id_result_type, .quantifier = .required },
6149 .{ .kind = .id_result, .quantifier = .required },
6150 },
6151 },
6152 .{
6153 .name = "OpConstant",
6154 .opcode = 43,
6155 .operands = &.{
6156 .{ .kind = .id_result_type, .quantifier = .required },
6157 .{ .kind = .id_result, .quantifier = .required },
6158 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6159 },
6160 },
6161 .{
6162 .name = "OpConstantComposite",
6163 .opcode = 44,
6164 .operands = &.{
6165 .{ .kind = .id_result_type, .quantifier = .required },
6166 .{ .kind = .id_result, .quantifier = .required },
6167 .{ .kind = .id_ref, .quantifier = .variadic },
6168 },
6169 },
6170 .{
6171 .name = "OpConstantSampler",
6172 .opcode = 45,
6173 .operands = &.{
6174 .{ .kind = .id_result_type, .quantifier = .required },
6175 .{ .kind = .id_result, .quantifier = .required },
6176 .{ .kind = .sampler_addressing_mode, .quantifier = .required },
6177 .{ .kind = .literal_integer, .quantifier = .required },
6178 .{ .kind = .sampler_filter_mode, .quantifier = .required },
6179 },
6180 },
6181 .{
6182 .name = "OpConstantNull",
6183 .opcode = 46,
6184 .operands = &.{
6185 .{ .kind = .id_result_type, .quantifier = .required },
6186 .{ .kind = .id_result, .quantifier = .required },
6187 },
6188 },
6189 .{
6190 .name = "OpSpecConstantTrue",
6191 .opcode = 48,
6192 .operands = &.{
6193 .{ .kind = .id_result_type, .quantifier = .required },
6194 .{ .kind = .id_result, .quantifier = .required },
6195 },
6196 },
6197 .{
6198 .name = "OpSpecConstantFalse",
6199 .opcode = 49,
6200 .operands = &.{
6201 .{ .kind = .id_result_type, .quantifier = .required },
6202 .{ .kind = .id_result, .quantifier = .required },
6203 },
6204 },
6205 .{
6206 .name = "OpSpecConstant",
6207 .opcode = 50,
6208 .operands = &.{
6209 .{ .kind = .id_result_type, .quantifier = .required },
6210 .{ .kind = .id_result, .quantifier = .required },
6211 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6212 },
6213 },
6214 .{
6215 .name = "OpSpecConstantComposite",
6216 .opcode = 51,
6217 .operands = &.{
6218 .{ .kind = .id_result_type, .quantifier = .required },
6219 .{ .kind = .id_result, .quantifier = .required },
6220 .{ .kind = .id_ref, .quantifier = .variadic },
6221 },
6222 },
6223 .{
6224 .name = "OpSpecConstantOp",
6225 .opcode = 52,
6226 .operands = &.{
6227 .{ .kind = .id_result_type, .quantifier = .required },
6228 .{ .kind = .id_result, .quantifier = .required },
6229 .{ .kind = .literal_spec_constant_op_integer, .quantifier = .required },
6230 },
6231 },
6232 .{
6233 .name = "OpFunction",
6234 .opcode = 54,
6235 .operands = &.{
6236 .{ .kind = .id_result_type, .quantifier = .required },
6237 .{ .kind = .id_result, .quantifier = .required },
6238 .{ .kind = .function_control, .quantifier = .required },
6239 .{ .kind = .id_ref, .quantifier = .required },
6240 },
6241 },
6242 .{
6243 .name = "OpFunctionParameter",
6244 .opcode = 55,
6245 .operands = &.{
6246 .{ .kind = .id_result_type, .quantifier = .required },
6247 .{ .kind = .id_result, .quantifier = .required },
6248 },
6249 },
6250 .{
6251 .name = "OpFunctionEnd",
6252 .opcode = 56,
6253 .operands = &.{},
6254 },
6255 .{
6256 .name = "OpFunctionCall",
6257 .opcode = 57,
6258 .operands = &.{
6259 .{ .kind = .id_result_type, .quantifier = .required },
6260 .{ .kind = .id_result, .quantifier = .required },
6261 .{ .kind = .id_ref, .quantifier = .required },
6262 .{ .kind = .id_ref, .quantifier = .variadic },
6263 },
6264 },
6265 .{
6266 .name = "OpVariable",
6267 .opcode = 59,
6268 .operands = &.{
6269 .{ .kind = .id_result_type, .quantifier = .required },
6270 .{ .kind = .id_result, .quantifier = .required },
6271 .{ .kind = .storage_class, .quantifier = .required },
6272 .{ .kind = .id_ref, .quantifier = .optional },
6273 },
6274 },
6275 .{
6276 .name = "OpImageTexelPointer",
6277 .opcode = 60,
6278 .operands = &.{
6279 .{ .kind = .id_result_type, .quantifier = .required },
6280 .{ .kind = .id_result, .quantifier = .required },
6281 .{ .kind = .id_ref, .quantifier = .required },
6282 .{ .kind = .id_ref, .quantifier = .required },
6283 .{ .kind = .id_ref, .quantifier = .required },
6284 },
6285 },
6286 .{
6287 .name = "OpLoad",
6288 .opcode = 61,
6289 .operands = &.{
6290 .{ .kind = .id_result_type, .quantifier = .required },
6291 .{ .kind = .id_result, .quantifier = .required },
6292 .{ .kind = .id_ref, .quantifier = .required },
6293 .{ .kind = .memory_access, .quantifier = .optional },
6294 },
6295 },
6296 .{
6297 .name = "OpStore",
6298 .opcode = 62,
6299 .operands = &.{
6300 .{ .kind = .id_ref, .quantifier = .required },
6301 .{ .kind = .id_ref, .quantifier = .required },
6302 .{ .kind = .memory_access, .quantifier = .optional },
6303 },
6304 },
6305 .{
6306 .name = "OpCopyMemory",
6307 .opcode = 63,
6308 .operands = &.{
6309 .{ .kind = .id_ref, .quantifier = .required },
6310 .{ .kind = .id_ref, .quantifier = .required },
6311 .{ .kind = .memory_access, .quantifier = .optional },
6312 .{ .kind = .memory_access, .quantifier = .optional },
6313 },
6314 },
6315 .{
6316 .name = "OpCopyMemorySized",
6317 .opcode = 64,
6318 .operands = &.{
6319 .{ .kind = .id_ref, .quantifier = .required },
6320 .{ .kind = .id_ref, .quantifier = .required },
6321 .{ .kind = .id_ref, .quantifier = .required },
6322 .{ .kind = .memory_access, .quantifier = .optional },
6323 .{ .kind = .memory_access, .quantifier = .optional },
6324 },
6325 },
6326 .{
6327 .name = "OpAccessChain",
6328 .opcode = 65,
6329 .operands = &.{
6330 .{ .kind = .id_result_type, .quantifier = .required },
6331 .{ .kind = .id_result, .quantifier = .required },
6332 .{ .kind = .id_ref, .quantifier = .required },
6333 .{ .kind = .id_ref, .quantifier = .variadic },
6334 },
6335 },
6336 .{
6337 .name = "OpInBoundsAccessChain",
6338 .opcode = 66,
6339 .operands = &.{
6340 .{ .kind = .id_result_type, .quantifier = .required },
6341 .{ .kind = .id_result, .quantifier = .required },
6342 .{ .kind = .id_ref, .quantifier = .required },
6343 .{ .kind = .id_ref, .quantifier = .variadic },
6344 },
6345 },
6346 .{
6347 .name = "OpPtrAccessChain",
6348 .opcode = 67,
6349 .operands = &.{
6350 .{ .kind = .id_result_type, .quantifier = .required },
6351 .{ .kind = .id_result, .quantifier = .required },
6352 .{ .kind = .id_ref, .quantifier = .required },
6353 .{ .kind = .id_ref, .quantifier = .required },
6354 .{ .kind = .id_ref, .quantifier = .variadic },
6355 },
6356 },
6357 .{
6358 .name = "OpArrayLength",
6359 .opcode = 68,
6360 .operands = &.{
6361 .{ .kind = .id_result_type, .quantifier = .required },
6362 .{ .kind = .id_result, .quantifier = .required },
6363 .{ .kind = .id_ref, .quantifier = .required },
6364 .{ .kind = .literal_integer, .quantifier = .required },
6365 },
6366 },
6367 .{
6368 .name = "OpGenericPtrMemSemantics",
6369 .opcode = 69,
6370 .operands = &.{
6371 .{ .kind = .id_result_type, .quantifier = .required },
6372 .{ .kind = .id_result, .quantifier = .required },
6373 .{ .kind = .id_ref, .quantifier = .required },
6374 },
6375 },
6376 .{
6377 .name = "OpInBoundsPtrAccessChain",
6378 .opcode = 70,
6379 .operands = &.{
6380 .{ .kind = .id_result_type, .quantifier = .required },
6381 .{ .kind = .id_result, .quantifier = .required },
6382 .{ .kind = .id_ref, .quantifier = .required },
6383 .{ .kind = .id_ref, .quantifier = .required },
6384 .{ .kind = .id_ref, .quantifier = .variadic },
6385 },
6386 },
6387 .{
6388 .name = "OpDecorate",
6389 .opcode = 71,
6390 .operands = &.{
6391 .{ .kind = .id_ref, .quantifier = .required },
6392 .{ .kind = .decoration, .quantifier = .required },
6393 },
6394 },
6395 .{
6396 .name = "OpMemberDecorate",
6397 .opcode = 72,
6398 .operands = &.{
6399 .{ .kind = .id_ref, .quantifier = .required },
6400 .{ .kind = .literal_integer, .quantifier = .required },
6401 .{ .kind = .decoration, .quantifier = .required },
6402 },
6403 },
6404 .{
6405 .name = "OpDecorationGroup",
6406 .opcode = 73,
6407 .operands = &.{
6408 .{ .kind = .id_result, .quantifier = .required },
6409 },
6410 },
6411 .{
6412 .name = "OpGroupDecorate",
6413 .opcode = 74,
6414 .operands = &.{
6415 .{ .kind = .id_ref, .quantifier = .required },
6416 .{ .kind = .id_ref, .quantifier = .variadic },
6417 },
6418 },
6419 .{
6420 .name = "OpGroupMemberDecorate",
6421 .opcode = 75,
6422 .operands = &.{
6423 .{ .kind = .id_ref, .quantifier = .required },
6424 .{ .kind = .pair_id_ref_literal_integer, .quantifier = .variadic },
6425 },
6426 },
6427 .{
6428 .name = "OpVectorExtractDynamic",
6429 .opcode = 77,
6430 .operands = &.{
6431 .{ .kind = .id_result_type, .quantifier = .required },
6432 .{ .kind = .id_result, .quantifier = .required },
6433 .{ .kind = .id_ref, .quantifier = .required },
6434 .{ .kind = .id_ref, .quantifier = .required },
6435 },
6436 },
6437 .{
6438 .name = "OpVectorInsertDynamic",
6439 .opcode = 78,
6440 .operands = &.{
6441 .{ .kind = .id_result_type, .quantifier = .required },
6442 .{ .kind = .id_result, .quantifier = .required },
6443 .{ .kind = .id_ref, .quantifier = .required },
6444 .{ .kind = .id_ref, .quantifier = .required },
6445 .{ .kind = .id_ref, .quantifier = .required },
6446 },
6447 },
6448 .{
6449 .name = "OpVectorShuffle",
6450 .opcode = 79,
6451 .operands = &.{
6452 .{ .kind = .id_result_type, .quantifier = .required },
6453 .{ .kind = .id_result, .quantifier = .required },
6454 .{ .kind = .id_ref, .quantifier = .required },
6455 .{ .kind = .id_ref, .quantifier = .required },
6456 .{ .kind = .literal_integer, .quantifier = .variadic },
6457 },
6458 },
6459 .{
6460 .name = "OpCompositeConstruct",
6461 .opcode = 80,
6462 .operands = &.{
6463 .{ .kind = .id_result_type, .quantifier = .required },
6464 .{ .kind = .id_result, .quantifier = .required },
6465 .{ .kind = .id_ref, .quantifier = .variadic },
6466 },
6467 },
6468 .{
6469 .name = "OpCompositeExtract",
6470 .opcode = 81,
6471 .operands = &.{
6472 .{ .kind = .id_result_type, .quantifier = .required },
6473 .{ .kind = .id_result, .quantifier = .required },
6474 .{ .kind = .id_ref, .quantifier = .required },
6475 .{ .kind = .literal_integer, .quantifier = .variadic },
6476 },
6477 },
6478 .{
6479 .name = "OpCompositeInsert",
6480 .opcode = 82,
6481 .operands = &.{
6482 .{ .kind = .id_result_type, .quantifier = .required },
6483 .{ .kind = .id_result, .quantifier = .required },
6484 .{ .kind = .id_ref, .quantifier = .required },
6485 .{ .kind = .id_ref, .quantifier = .required },
6486 .{ .kind = .literal_integer, .quantifier = .variadic },
6487 },
6488 },
6489 .{
6490 .name = "OpCopyObject",
6491 .opcode = 83,
6492 .operands = &.{
6493 .{ .kind = .id_result_type, .quantifier = .required },
6494 .{ .kind = .id_result, .quantifier = .required },
6495 .{ .kind = .id_ref, .quantifier = .required },
6496 },
6497 },
6498 .{
6499 .name = "OpTranspose",
6500 .opcode = 84,
6501 .operands = &.{
6502 .{ .kind = .id_result_type, .quantifier = .required },
6503 .{ .kind = .id_result, .quantifier = .required },
6504 .{ .kind = .id_ref, .quantifier = .required },
6505 },
6506 },
6507 .{
6508 .name = "OpSampledImage",
6509 .opcode = 86,
6510 .operands = &.{
6511 .{ .kind = .id_result_type, .quantifier = .required },
6512 .{ .kind = .id_result, .quantifier = .required },
6513 .{ .kind = .id_ref, .quantifier = .required },
6514 .{ .kind = .id_ref, .quantifier = .required },
6515 },
6516 },
6517 .{
6518 .name = "OpImageSampleImplicitLod",
6519 .opcode = 87,
6520 .operands = &.{
6521 .{ .kind = .id_result_type, .quantifier = .required },
6522 .{ .kind = .id_result, .quantifier = .required },
6523 .{ .kind = .id_ref, .quantifier = .required },
6524 .{ .kind = .id_ref, .quantifier = .required },
6525 .{ .kind = .image_operands, .quantifier = .optional },
6526 },
6527 },
6528 .{
6529 .name = "OpImageSampleExplicitLod",
6530 .opcode = 88,
6531 .operands = &.{
6532 .{ .kind = .id_result_type, .quantifier = .required },
6533 .{ .kind = .id_result, .quantifier = .required },
6534 .{ .kind = .id_ref, .quantifier = .required },
6535 .{ .kind = .id_ref, .quantifier = .required },
6536 .{ .kind = .image_operands, .quantifier = .required },
6537 },
6538 },
6539 .{
6540 .name = "OpImageSampleDrefImplicitLod",
6541 .opcode = 89,
6542 .operands = &.{
6543 .{ .kind = .id_result_type, .quantifier = .required },
6544 .{ .kind = .id_result, .quantifier = .required },
6545 .{ .kind = .id_ref, .quantifier = .required },
6546 .{ .kind = .id_ref, .quantifier = .required },
6547 .{ .kind = .id_ref, .quantifier = .required },
6548 .{ .kind = .image_operands, .quantifier = .optional },
6549 },
6550 },
6551 .{
6552 .name = "OpImageSampleDrefExplicitLod",
6553 .opcode = 90,
6554 .operands = &.{
6555 .{ .kind = .id_result_type, .quantifier = .required },
6556 .{ .kind = .id_result, .quantifier = .required },
6557 .{ .kind = .id_ref, .quantifier = .required },
6558 .{ .kind = .id_ref, .quantifier = .required },
6559 .{ .kind = .id_ref, .quantifier = .required },
6560 .{ .kind = .image_operands, .quantifier = .required },
6561 },
6562 },
6563 .{
6564 .name = "OpImageSampleProjImplicitLod",
6565 .opcode = 91,
6566 .operands = &.{
6567 .{ .kind = .id_result_type, .quantifier = .required },
6568 .{ .kind = .id_result, .quantifier = .required },
6569 .{ .kind = .id_ref, .quantifier = .required },
6570 .{ .kind = .id_ref, .quantifier = .required },
6571 .{ .kind = .image_operands, .quantifier = .optional },
6572 },
6573 },
6574 .{
6575 .name = "OpImageSampleProjExplicitLod",
6576 .opcode = 92,
6577 .operands = &.{
6578 .{ .kind = .id_result_type, .quantifier = .required },
6579 .{ .kind = .id_result, .quantifier = .required },
6580 .{ .kind = .id_ref, .quantifier = .required },
6581 .{ .kind = .id_ref, .quantifier = .required },
6582 .{ .kind = .image_operands, .quantifier = .required },
6583 },
6584 },
6585 .{
6586 .name = "OpImageSampleProjDrefImplicitLod",
6587 .opcode = 93,
6588 .operands = &.{
6589 .{ .kind = .id_result_type, .quantifier = .required },
6590 .{ .kind = .id_result, .quantifier = .required },
6591 .{ .kind = .id_ref, .quantifier = .required },
6592 .{ .kind = .id_ref, .quantifier = .required },
6593 .{ .kind = .id_ref, .quantifier = .required },
6594 .{ .kind = .image_operands, .quantifier = .optional },
6595 },
6596 },
6597 .{
6598 .name = "OpImageSampleProjDrefExplicitLod",
6599 .opcode = 94,
6600 .operands = &.{
6601 .{ .kind = .id_result_type, .quantifier = .required },
6602 .{ .kind = .id_result, .quantifier = .required },
6603 .{ .kind = .id_ref, .quantifier = .required },
6604 .{ .kind = .id_ref, .quantifier = .required },
6605 .{ .kind = .id_ref, .quantifier = .required },
6606 .{ .kind = .image_operands, .quantifier = .required },
6607 },
6608 },
6609 .{
6610 .name = "OpImageFetch",
6611 .opcode = 95,
6612 .operands = &.{
6613 .{ .kind = .id_result_type, .quantifier = .required },
6614 .{ .kind = .id_result, .quantifier = .required },
6615 .{ .kind = .id_ref, .quantifier = .required },
6616 .{ .kind = .id_ref, .quantifier = .required },
6617 .{ .kind = .image_operands, .quantifier = .optional },
6618 },
6619 },
6620 .{
6621 .name = "OpImageGather",
6622 .opcode = 96,
6623 .operands = &.{
6624 .{ .kind = .id_result_type, .quantifier = .required },
6625 .{ .kind = .id_result, .quantifier = .required },
6626 .{ .kind = .id_ref, .quantifier = .required },
6627 .{ .kind = .id_ref, .quantifier = .required },
6628 .{ .kind = .id_ref, .quantifier = .required },
6629 .{ .kind = .image_operands, .quantifier = .optional },
6630 },
6631 },
6632 .{
6633 .name = "OpImageDrefGather",
6634 .opcode = 97,
6635 .operands = &.{
6636 .{ .kind = .id_result_type, .quantifier = .required },
6637 .{ .kind = .id_result, .quantifier = .required },
6638 .{ .kind = .id_ref, .quantifier = .required },
6639 .{ .kind = .id_ref, .quantifier = .required },
6640 .{ .kind = .id_ref, .quantifier = .required },
6641 .{ .kind = .image_operands, .quantifier = .optional },
6642 },
6643 },
6644 .{
6645 .name = "OpImageRead",
6646 .opcode = 98,
6647 .operands = &.{
6648 .{ .kind = .id_result_type, .quantifier = .required },
6649 .{ .kind = .id_result, .quantifier = .required },
6650 .{ .kind = .id_ref, .quantifier = .required },
6651 .{ .kind = .id_ref, .quantifier = .required },
6652 .{ .kind = .image_operands, .quantifier = .optional },
6653 },
6654 },
6655 .{
6656 .name = "OpImageWrite",
6657 .opcode = 99,
6658 .operands = &.{
6659 .{ .kind = .id_ref, .quantifier = .required },
6660 .{ .kind = .id_ref, .quantifier = .required },
6661 .{ .kind = .id_ref, .quantifier = .required },
6662 .{ .kind = .image_operands, .quantifier = .optional },
6663 },
6664 },
6665 .{
6666 .name = "OpImage",
6667 .opcode = 100,
6668 .operands = &.{
6669 .{ .kind = .id_result_type, .quantifier = .required },
6670 .{ .kind = .id_result, .quantifier = .required },
6671 .{ .kind = .id_ref, .quantifier = .required },
6672 },
6673 },
6674 .{
6675 .name = "OpImageQueryFormat",
6676 .opcode = 101,
6677 .operands = &.{
6678 .{ .kind = .id_result_type, .quantifier = .required },
6679 .{ .kind = .id_result, .quantifier = .required },
6680 .{ .kind = .id_ref, .quantifier = .required },
6681 },
6682 },
6683 .{
6684 .name = "OpImageQueryOrder",
6685 .opcode = 102,
6686 .operands = &.{
6687 .{ .kind = .id_result_type, .quantifier = .required },
6688 .{ .kind = .id_result, .quantifier = .required },
6689 .{ .kind = .id_ref, .quantifier = .required },
6690 },
6691 },
6692 .{
6693 .name = "OpImageQuerySizeLod",
6694 .opcode = 103,
6695 .operands = &.{
6696 .{ .kind = .id_result_type, .quantifier = .required },
6697 .{ .kind = .id_result, .quantifier = .required },
6698 .{ .kind = .id_ref, .quantifier = .required },
6699 .{ .kind = .id_ref, .quantifier = .required },
6700 },
6701 },
6702 .{
6703 .name = "OpImageQuerySize",
6704 .opcode = 104,
6705 .operands = &.{
6706 .{ .kind = .id_result_type, .quantifier = .required },
6707 .{ .kind = .id_result, .quantifier = .required },
6708 .{ .kind = .id_ref, .quantifier = .required },
6709 },
6710 },
6711 .{
6712 .name = "OpImageQueryLod",
6713 .opcode = 105,
6714 .operands = &.{
6715 .{ .kind = .id_result_type, .quantifier = .required },
6716 .{ .kind = .id_result, .quantifier = .required },
6717 .{ .kind = .id_ref, .quantifier = .required },
6718 .{ .kind = .id_ref, .quantifier = .required },
6719 },
6720 },
6721 .{
6722 .name = "OpImageQueryLevels",
6723 .opcode = 106,
6724 .operands = &.{
6725 .{ .kind = .id_result_type, .quantifier = .required },
6726 .{ .kind = .id_result, .quantifier = .required },
6727 .{ .kind = .id_ref, .quantifier = .required },
6728 },
6729 },
6730 .{
6731 .name = "OpImageQuerySamples",
6732 .opcode = 107,
6733 .operands = &.{
6734 .{ .kind = .id_result_type, .quantifier = .required },
6735 .{ .kind = .id_result, .quantifier = .required },
6736 .{ .kind = .id_ref, .quantifier = .required },
6737 },
6738 },
6739 .{
6740 .name = "OpConvertFToU",
6741 .opcode = 109,
6742 .operands = &.{
6743 .{ .kind = .id_result_type, .quantifier = .required },
6744 .{ .kind = .id_result, .quantifier = .required },
6745 .{ .kind = .id_ref, .quantifier = .required },
6746 },
6747 },
6748 .{
6749 .name = "OpConvertFToS",
6750 .opcode = 110,
6751 .operands = &.{
6752 .{ .kind = .id_result_type, .quantifier = .required },
6753 .{ .kind = .id_result, .quantifier = .required },
6754 .{ .kind = .id_ref, .quantifier = .required },
6755 },
6756 },
6757 .{
6758 .name = "OpConvertSToF",
6759 .opcode = 111,
6760 .operands = &.{
6761 .{ .kind = .id_result_type, .quantifier = .required },
6762 .{ .kind = .id_result, .quantifier = .required },
6763 .{ .kind = .id_ref, .quantifier = .required },
6764 },
6765 },
6766 .{
6767 .name = "OpConvertUToF",
6768 .opcode = 112,
6769 .operands = &.{
6770 .{ .kind = .id_result_type, .quantifier = .required },
6771 .{ .kind = .id_result, .quantifier = .required },
6772 .{ .kind = .id_ref, .quantifier = .required },
6773 },
6774 },
6775 .{
6776 .name = "OpUConvert",
6777 .opcode = 113,
6778 .operands = &.{
6779 .{ .kind = .id_result_type, .quantifier = .required },
6780 .{ .kind = .id_result, .quantifier = .required },
6781 .{ .kind = .id_ref, .quantifier = .required },
6782 },
6783 },
6784 .{
6785 .name = "OpSConvert",
6786 .opcode = 114,
6787 .operands = &.{
6788 .{ .kind = .id_result_type, .quantifier = .required },
6789 .{ .kind = .id_result, .quantifier = .required },
6790 .{ .kind = .id_ref, .quantifier = .required },
6791 },
6792 },
6793 .{
6794 .name = "OpFConvert",
6795 .opcode = 115,
6796 .operands = &.{
6797 .{ .kind = .id_result_type, .quantifier = .required },
6798 .{ .kind = .id_result, .quantifier = .required },
6799 .{ .kind = .id_ref, .quantifier = .required },
6800 },
6801 },
6802 .{
6803 .name = "OpQuantizeToF16",
6804 .opcode = 116,
6805 .operands = &.{
6806 .{ .kind = .id_result_type, .quantifier = .required },
6807 .{ .kind = .id_result, .quantifier = .required },
6808 .{ .kind = .id_ref, .quantifier = .required },
6809 },
6810 },
6811 .{
6812 .name = "OpConvertPtrToU",
6813 .opcode = 117,
6814 .operands = &.{
6815 .{ .kind = .id_result_type, .quantifier = .required },
6816 .{ .kind = .id_result, .quantifier = .required },
6817 .{ .kind = .id_ref, .quantifier = .required },
6818 },
6819 },
6820 .{
6821 .name = "OpSatConvertSToU",
6822 .opcode = 118,
6823 .operands = &.{
6824 .{ .kind = .id_result_type, .quantifier = .required },
6825 .{ .kind = .id_result, .quantifier = .required },
6826 .{ .kind = .id_ref, .quantifier = .required },
6827 },
6828 },
6829 .{
6830 .name = "OpSatConvertUToS",
6831 .opcode = 119,
6832 .operands = &.{
6833 .{ .kind = .id_result_type, .quantifier = .required },
6834 .{ .kind = .id_result, .quantifier = .required },
6835 .{ .kind = .id_ref, .quantifier = .required },
6836 },
6837 },
6838 .{
6839 .name = "OpConvertUToPtr",
6840 .opcode = 120,
6841 .operands = &.{
6842 .{ .kind = .id_result_type, .quantifier = .required },
6843 .{ .kind = .id_result, .quantifier = .required },
6844 .{ .kind = .id_ref, .quantifier = .required },
6845 },
6846 },
6847 .{
6848 .name = "OpPtrCastToGeneric",
6849 .opcode = 121,
6850 .operands = &.{
6851 .{ .kind = .id_result_type, .quantifier = .required },
6852 .{ .kind = .id_result, .quantifier = .required },
6853 .{ .kind = .id_ref, .quantifier = .required },
6854 },
6855 },
6856 .{
6857 .name = "OpGenericCastToPtr",
6858 .opcode = 122,
6859 .operands = &.{
6860 .{ .kind = .id_result_type, .quantifier = .required },
6861 .{ .kind = .id_result, .quantifier = .required },
6862 .{ .kind = .id_ref, .quantifier = .required },
6863 },
6864 },
6865 .{
6866 .name = "OpGenericCastToPtrExplicit",
6867 .opcode = 123,
6868 .operands = &.{
6869 .{ .kind = .id_result_type, .quantifier = .required },
6870 .{ .kind = .id_result, .quantifier = .required },
6871 .{ .kind = .id_ref, .quantifier = .required },
6872 .{ .kind = .storage_class, .quantifier = .required },
6873 },
6874 },
6875 .{
6876 .name = "OpBitcast",
6877 .opcode = 124,
6878 .operands = &.{
6879 .{ .kind = .id_result_type, .quantifier = .required },
6880 .{ .kind = .id_result, .quantifier = .required },
6881 .{ .kind = .id_ref, .quantifier = .required },
6882 },
6883 },
6884 .{
6885 .name = "OpSNegate",
6886 .opcode = 126,
6887 .operands = &.{
6888 .{ .kind = .id_result_type, .quantifier = .required },
6889 .{ .kind = .id_result, .quantifier = .required },
6890 .{ .kind = .id_ref, .quantifier = .required },
6891 },
6892 },
6893 .{
6894 .name = "OpFNegate",
6895 .opcode = 127,
6896 .operands = &.{
6897 .{ .kind = .id_result_type, .quantifier = .required },
6898 .{ .kind = .id_result, .quantifier = .required },
6899 .{ .kind = .id_ref, .quantifier = .required },
6900 },
6901 },
6902 .{
6903 .name = "OpIAdd",
6904 .opcode = 128,
6905 .operands = &.{
6906 .{ .kind = .id_result_type, .quantifier = .required },
6907 .{ .kind = .id_result, .quantifier = .required },
6908 .{ .kind = .id_ref, .quantifier = .required },
6909 .{ .kind = .id_ref, .quantifier = .required },
6910 },
6911 },
6912 .{
6913 .name = "OpFAdd",
6914 .opcode = 129,
6915 .operands = &.{
6916 .{ .kind = .id_result_type, .quantifier = .required },
6917 .{ .kind = .id_result, .quantifier = .required },
6918 .{ .kind = .id_ref, .quantifier = .required },
6919 .{ .kind = .id_ref, .quantifier = .required },
6920 },
6921 },
6922 .{
6923 .name = "OpISub",
6924 .opcode = 130,
6925 .operands = &.{
6926 .{ .kind = .id_result_type, .quantifier = .required },
6927 .{ .kind = .id_result, .quantifier = .required },
6928 .{ .kind = .id_ref, .quantifier = .required },
6929 .{ .kind = .id_ref, .quantifier = .required },
6930 },
6931 },
6932 .{
6933 .name = "OpFSub",
6934 .opcode = 131,
6935 .operands = &.{
6936 .{ .kind = .id_result_type, .quantifier = .required },
6937 .{ .kind = .id_result, .quantifier = .required },
6938 .{ .kind = .id_ref, .quantifier = .required },
6939 .{ .kind = .id_ref, .quantifier = .required },
6940 },
6941 },
6942 .{
6943 .name = "OpIMul",
6944 .opcode = 132,
6945 .operands = &.{
6946 .{ .kind = .id_result_type, .quantifier = .required },
6947 .{ .kind = .id_result, .quantifier = .required },
6948 .{ .kind = .id_ref, .quantifier = .required },
6949 .{ .kind = .id_ref, .quantifier = .required },
6950 },
6951 },
6952 .{
6953 .name = "OpFMul",
6954 .opcode = 133,
6955 .operands = &.{
6956 .{ .kind = .id_result_type, .quantifier = .required },
6957 .{ .kind = .id_result, .quantifier = .required },
6958 .{ .kind = .id_ref, .quantifier = .required },
6959 .{ .kind = .id_ref, .quantifier = .required },
6960 },
6961 },
6962 .{
6963 .name = "OpUDiv",
6964 .opcode = 134,
6965 .operands = &.{
6966 .{ .kind = .id_result_type, .quantifier = .required },
6967 .{ .kind = .id_result, .quantifier = .required },
6968 .{ .kind = .id_ref, .quantifier = .required },
6969 .{ .kind = .id_ref, .quantifier = .required },
6970 },
6971 },
6972 .{
6973 .name = "OpSDiv",
6974 .opcode = 135,
6975 .operands = &.{
6976 .{ .kind = .id_result_type, .quantifier = .required },
6977 .{ .kind = .id_result, .quantifier = .required },
6978 .{ .kind = .id_ref, .quantifier = .required },
6979 .{ .kind = .id_ref, .quantifier = .required },
6980 },
6981 },
6982 .{
6983 .name = "OpFDiv",
6984 .opcode = 136,
6985 .operands = &.{
6986 .{ .kind = .id_result_type, .quantifier = .required },
6987 .{ .kind = .id_result, .quantifier = .required },
6988 .{ .kind = .id_ref, .quantifier = .required },
6989 .{ .kind = .id_ref, .quantifier = .required },
6990 },
6991 },
6992 .{
6993 .name = "OpUMod",
6994 .opcode = 137,
6995 .operands = &.{
6996 .{ .kind = .id_result_type, .quantifier = .required },
6997 .{ .kind = .id_result, .quantifier = .required },
6998 .{ .kind = .id_ref, .quantifier = .required },
6999 .{ .kind = .id_ref, .quantifier = .required },
7000 },
7001 },
7002 .{
7003 .name = "OpSRem",
7004 .opcode = 138,
7005 .operands = &.{
7006 .{ .kind = .id_result_type, .quantifier = .required },
7007 .{ .kind = .id_result, .quantifier = .required },
7008 .{ .kind = .id_ref, .quantifier = .required },
7009 .{ .kind = .id_ref, .quantifier = .required },
7010 },
7011 },
7012 .{
7013 .name = "OpSMod",
7014 .opcode = 139,
7015 .operands = &.{
7016 .{ .kind = .id_result_type, .quantifier = .required },
7017 .{ .kind = .id_result, .quantifier = .required },
7018 .{ .kind = .id_ref, .quantifier = .required },
7019 .{ .kind = .id_ref, .quantifier = .required },
7020 },
7021 },
7022 .{
7023 .name = "OpFRem",
7024 .opcode = 140,
7025 .operands = &.{
7026 .{ .kind = .id_result_type, .quantifier = .required },
7027 .{ .kind = .id_result, .quantifier = .required },
7028 .{ .kind = .id_ref, .quantifier = .required },
7029 .{ .kind = .id_ref, .quantifier = .required },
7030 },
7031 },
7032 .{
7033 .name = "OpFMod",
7034 .opcode = 141,
7035 .operands = &.{
7036 .{ .kind = .id_result_type, .quantifier = .required },
7037 .{ .kind = .id_result, .quantifier = .required },
7038 .{ .kind = .id_ref, .quantifier = .required },
7039 .{ .kind = .id_ref, .quantifier = .required },
7040 },
7041 },
7042 .{
7043 .name = "OpVectorTimesScalar",
7044 .opcode = 142,
7045 .operands = &.{
7046 .{ .kind = .id_result_type, .quantifier = .required },
7047 .{ .kind = .id_result, .quantifier = .required },
7048 .{ .kind = .id_ref, .quantifier = .required },
7049 .{ .kind = .id_ref, .quantifier = .required },
7050 },
7051 },
7052 .{
7053 .name = "OpMatrixTimesScalar",
7054 .opcode = 143,
7055 .operands = &.{
7056 .{ .kind = .id_result_type, .quantifier = .required },
7057 .{ .kind = .id_result, .quantifier = .required },
7058 .{ .kind = .id_ref, .quantifier = .required },
7059 .{ .kind = .id_ref, .quantifier = .required },
7060 },
7061 },
7062 .{
7063 .name = "OpVectorTimesMatrix",
7064 .opcode = 144,
7065 .operands = &.{
7066 .{ .kind = .id_result_type, .quantifier = .required },
7067 .{ .kind = .id_result, .quantifier = .required },
7068 .{ .kind = .id_ref, .quantifier = .required },
7069 .{ .kind = .id_ref, .quantifier = .required },
7070 },
7071 },
7072 .{
7073 .name = "OpMatrixTimesVector",
7074 .opcode = 145,
7075 .operands = &.{
7076 .{ .kind = .id_result_type, .quantifier = .required },
7077 .{ .kind = .id_result, .quantifier = .required },
7078 .{ .kind = .id_ref, .quantifier = .required },
7079 .{ .kind = .id_ref, .quantifier = .required },
7080 },
7081 },
7082 .{
7083 .name = "OpMatrixTimesMatrix",
7084 .opcode = 146,
7085 .operands = &.{
7086 .{ .kind = .id_result_type, .quantifier = .required },
7087 .{ .kind = .id_result, .quantifier = .required },
7088 .{ .kind = .id_ref, .quantifier = .required },
7089 .{ .kind = .id_ref, .quantifier = .required },
7090 },
7091 },
7092 .{
7093 .name = "OpOuterProduct",
7094 .opcode = 147,
7095 .operands = &.{
7096 .{ .kind = .id_result_type, .quantifier = .required },
7097 .{ .kind = .id_result, .quantifier = .required },
7098 .{ .kind = .id_ref, .quantifier = .required },
7099 .{ .kind = .id_ref, .quantifier = .required },
7100 },
7101 },
7102 .{
7103 .name = "OpDot",
7104 .opcode = 148,
7105 .operands = &.{
7106 .{ .kind = .id_result_type, .quantifier = .required },
7107 .{ .kind = .id_result, .quantifier = .required },
7108 .{ .kind = .id_ref, .quantifier = .required },
7109 .{ .kind = .id_ref, .quantifier = .required },
7110 },
7111 },
7112 .{
7113 .name = "OpIAddCarry",
7114 .opcode = 149,
7115 .operands = &.{
7116 .{ .kind = .id_result_type, .quantifier = .required },
7117 .{ .kind = .id_result, .quantifier = .required },
7118 .{ .kind = .id_ref, .quantifier = .required },
7119 .{ .kind = .id_ref, .quantifier = .required },
7120 },
7121 },
7122 .{
7123 .name = "OpISubBorrow",
7124 .opcode = 150,
7125 .operands = &.{
7126 .{ .kind = .id_result_type, .quantifier = .required },
7127 .{ .kind = .id_result, .quantifier = .required },
7128 .{ .kind = .id_ref, .quantifier = .required },
7129 .{ .kind = .id_ref, .quantifier = .required },
7130 },
7131 },
7132 .{
7133 .name = "OpUMulExtended",
7134 .opcode = 151,
7135 .operands = &.{
7136 .{ .kind = .id_result_type, .quantifier = .required },
7137 .{ .kind = .id_result, .quantifier = .required },
7138 .{ .kind = .id_ref, .quantifier = .required },
7139 .{ .kind = .id_ref, .quantifier = .required },
7140 },
7141 },
7142 .{
7143 .name = "OpSMulExtended",
7144 .opcode = 152,
7145 .operands = &.{
7146 .{ .kind = .id_result_type, .quantifier = .required },
7147 .{ .kind = .id_result, .quantifier = .required },
7148 .{ .kind = .id_ref, .quantifier = .required },
7149 .{ .kind = .id_ref, .quantifier = .required },
7150 },
7151 },
7152 .{
7153 .name = "OpAny",
7154 .opcode = 154,
7155 .operands = &.{
7156 .{ .kind = .id_result_type, .quantifier = .required },
7157 .{ .kind = .id_result, .quantifier = .required },
7158 .{ .kind = .id_ref, .quantifier = .required },
7159 },
7160 },
7161 .{
7162 .name = "OpAll",
7163 .opcode = 155,
7164 .operands = &.{
7165 .{ .kind = .id_result_type, .quantifier = .required },
7166 .{ .kind = .id_result, .quantifier = .required },
7167 .{ .kind = .id_ref, .quantifier = .required },
7168 },
7169 },
7170 .{
7171 .name = "OpIsNan",
7172 .opcode = 156,
7173 .operands = &.{
7174 .{ .kind = .id_result_type, .quantifier = .required },
7175 .{ .kind = .id_result, .quantifier = .required },
7176 .{ .kind = .id_ref, .quantifier = .required },
7177 },
7178 },
7179 .{
7180 .name = "OpIsInf",
7181 .opcode = 157,
7182 .operands = &.{
7183 .{ .kind = .id_result_type, .quantifier = .required },
7184 .{ .kind = .id_result, .quantifier = .required },
7185 .{ .kind = .id_ref, .quantifier = .required },
7186 },
7187 },
7188 .{
7189 .name = "OpIsFinite",
7190 .opcode = 158,
7191 .operands = &.{
7192 .{ .kind = .id_result_type, .quantifier = .required },
7193 .{ .kind = .id_result, .quantifier = .required },
7194 .{ .kind = .id_ref, .quantifier = .required },
7195 },
7196 },
7197 .{
7198 .name = "OpIsNormal",
7199 .opcode = 159,
7200 .operands = &.{
7201 .{ .kind = .id_result_type, .quantifier = .required },
7202 .{ .kind = .id_result, .quantifier = .required },
7203 .{ .kind = .id_ref, .quantifier = .required },
7204 },
7205 },
7206 .{
7207 .name = "OpSignBitSet",
7208 .opcode = 160,
7209 .operands = &.{
7210 .{ .kind = .id_result_type, .quantifier = .required },
7211 .{ .kind = .id_result, .quantifier = .required },
7212 .{ .kind = .id_ref, .quantifier = .required },
7213 },
7214 },
7215 .{
7216 .name = "OpLessOrGreater",
7217 .opcode = 161,
7218 .operands = &.{
7219 .{ .kind = .id_result_type, .quantifier = .required },
7220 .{ .kind = .id_result, .quantifier = .required },
7221 .{ .kind = .id_ref, .quantifier = .required },
7222 .{ .kind = .id_ref, .quantifier = .required },
7223 },
7224 },
7225 .{
7226 .name = "OpOrdered",
7227 .opcode = 162,
7228 .operands = &.{
7229 .{ .kind = .id_result_type, .quantifier = .required },
7230 .{ .kind = .id_result, .quantifier = .required },
7231 .{ .kind = .id_ref, .quantifier = .required },
7232 .{ .kind = .id_ref, .quantifier = .required },
7233 },
7234 },
7235 .{
7236 .name = "OpUnordered",
7237 .opcode = 163,
7238 .operands = &.{
7239 .{ .kind = .id_result_type, .quantifier = .required },
7240 .{ .kind = .id_result, .quantifier = .required },
7241 .{ .kind = .id_ref, .quantifier = .required },
7242 .{ .kind = .id_ref, .quantifier = .required },
7243 },
7244 },
7245 .{
7246 .name = "OpLogicalEqual",
7247 .opcode = 164,
7248 .operands = &.{
7249 .{ .kind = .id_result_type, .quantifier = .required },
7250 .{ .kind = .id_result, .quantifier = .required },
7251 .{ .kind = .id_ref, .quantifier = .required },
7252 .{ .kind = .id_ref, .quantifier = .required },
7253 },
7254 },
7255 .{
7256 .name = "OpLogicalNotEqual",
7257 .opcode = 165,
7258 .operands = &.{
7259 .{ .kind = .id_result_type, .quantifier = .required },
7260 .{ .kind = .id_result, .quantifier = .required },
7261 .{ .kind = .id_ref, .quantifier = .required },
7262 .{ .kind = .id_ref, .quantifier = .required },
7263 },
7264 },
7265 .{
7266 .name = "OpLogicalOr",
7267 .opcode = 166,
7268 .operands = &.{
7269 .{ .kind = .id_result_type, .quantifier = .required },
7270 .{ .kind = .id_result, .quantifier = .required },
7271 .{ .kind = .id_ref, .quantifier = .required },
7272 .{ .kind = .id_ref, .quantifier = .required },
7273 },
7274 },
7275 .{
7276 .name = "OpLogicalAnd",
7277 .opcode = 167,
7278 .operands = &.{
7279 .{ .kind = .id_result_type, .quantifier = .required },
7280 .{ .kind = .id_result, .quantifier = .required },
7281 .{ .kind = .id_ref, .quantifier = .required },
7282 .{ .kind = .id_ref, .quantifier = .required },
7283 },
7284 },
7285 .{
7286 .name = "OpLogicalNot",
7287 .opcode = 168,
7288 .operands = &.{
7289 .{ .kind = .id_result_type, .quantifier = .required },
7290 .{ .kind = .id_result, .quantifier = .required },
7291 .{ .kind = .id_ref, .quantifier = .required },
7292 },
7293 },
7294 .{
7295 .name = "OpSelect",
7296 .opcode = 169,
7297 .operands = &.{
7298 .{ .kind = .id_result_type, .quantifier = .required },
7299 .{ .kind = .id_result, .quantifier = .required },
7300 .{ .kind = .id_ref, .quantifier = .required },
7301 .{ .kind = .id_ref, .quantifier = .required },
7302 .{ .kind = .id_ref, .quantifier = .required },
7303 },
7304 },
7305 .{
7306 .name = "OpIEqual",
7307 .opcode = 170,
7308 .operands = &.{
7309 .{ .kind = .id_result_type, .quantifier = .required },
7310 .{ .kind = .id_result, .quantifier = .required },
7311 .{ .kind = .id_ref, .quantifier = .required },
7312 .{ .kind = .id_ref, .quantifier = .required },
7313 },
7314 },
7315 .{
7316 .name = "OpINotEqual",
7317 .opcode = 171,
7318 .operands = &.{
7319 .{ .kind = .id_result_type, .quantifier = .required },
7320 .{ .kind = .id_result, .quantifier = .required },
7321 .{ .kind = .id_ref, .quantifier = .required },
7322 .{ .kind = .id_ref, .quantifier = .required },
7323 },
7324 },
7325 .{
7326 .name = "OpUGreaterThan",
7327 .opcode = 172,
7328 .operands = &.{
7329 .{ .kind = .id_result_type, .quantifier = .required },
7330 .{ .kind = .id_result, .quantifier = .required },
7331 .{ .kind = .id_ref, .quantifier = .required },
7332 .{ .kind = .id_ref, .quantifier = .required },
7333 },
7334 },
7335 .{
7336 .name = "OpSGreaterThan",
7337 .opcode = 173,
7338 .operands = &.{
7339 .{ .kind = .id_result_type, .quantifier = .required },
7340 .{ .kind = .id_result, .quantifier = .required },
7341 .{ .kind = .id_ref, .quantifier = .required },
7342 .{ .kind = .id_ref, .quantifier = .required },
7343 },
7344 },
7345 .{
7346 .name = "OpUGreaterThanEqual",
7347 .opcode = 174,
7348 .operands = &.{
7349 .{ .kind = .id_result_type, .quantifier = .required },
7350 .{ .kind = .id_result, .quantifier = .required },
7351 .{ .kind = .id_ref, .quantifier = .required },
7352 .{ .kind = .id_ref, .quantifier = .required },
7353 },
7354 },
7355 .{
7356 .name = "OpSGreaterThanEqual",
7357 .opcode = 175,
7358 .operands = &.{
7359 .{ .kind = .id_result_type, .quantifier = .required },
7360 .{ .kind = .id_result, .quantifier = .required },
7361 .{ .kind = .id_ref, .quantifier = .required },
7362 .{ .kind = .id_ref, .quantifier = .required },
7363 },
7364 },
7365 .{
7366 .name = "OpULessThan",
7367 .opcode = 176,
7368 .operands = &.{
7369 .{ .kind = .id_result_type, .quantifier = .required },
7370 .{ .kind = .id_result, .quantifier = .required },
7371 .{ .kind = .id_ref, .quantifier = .required },
7372 .{ .kind = .id_ref, .quantifier = .required },
7373 },
7374 },
7375 .{
7376 .name = "OpSLessThan",
7377 .opcode = 177,
7378 .operands = &.{
7379 .{ .kind = .id_result_type, .quantifier = .required },
7380 .{ .kind = .id_result, .quantifier = .required },
7381 .{ .kind = .id_ref, .quantifier = .required },
7382 .{ .kind = .id_ref, .quantifier = .required },
7383 },
7384 },
7385 .{
7386 .name = "OpULessThanEqual",
7387 .opcode = 178,
7388 .operands = &.{
7389 .{ .kind = .id_result_type, .quantifier = .required },
7390 .{ .kind = .id_result, .quantifier = .required },
7391 .{ .kind = .id_ref, .quantifier = .required },
7392 .{ .kind = .id_ref, .quantifier = .required },
7393 },
7394 },
7395 .{
7396 .name = "OpSLessThanEqual",
7397 .opcode = 179,
7398 .operands = &.{
7399 .{ .kind = .id_result_type, .quantifier = .required },
7400 .{ .kind = .id_result, .quantifier = .required },
7401 .{ .kind = .id_ref, .quantifier = .required },
7402 .{ .kind = .id_ref, .quantifier = .required },
7403 },
7404 },
7405 .{
7406 .name = "OpFOrdEqual",
7407 .opcode = 180,
7408 .operands = &.{
7409 .{ .kind = .id_result_type, .quantifier = .required },
7410 .{ .kind = .id_result, .quantifier = .required },
7411 .{ .kind = .id_ref, .quantifier = .required },
7412 .{ .kind = .id_ref, .quantifier = .required },
7413 },
7414 },
7415 .{
7416 .name = "OpFUnordEqual",
7417 .opcode = 181,
7418 .operands = &.{
7419 .{ .kind = .id_result_type, .quantifier = .required },
7420 .{ .kind = .id_result, .quantifier = .required },
7421 .{ .kind = .id_ref, .quantifier = .required },
7422 .{ .kind = .id_ref, .quantifier = .required },
7423 },
7424 },
7425 .{
7426 .name = "OpFOrdNotEqual",
7427 .opcode = 182,
7428 .operands = &.{
7429 .{ .kind = .id_result_type, .quantifier = .required },
7430 .{ .kind = .id_result, .quantifier = .required },
7431 .{ .kind = .id_ref, .quantifier = .required },
7432 .{ .kind = .id_ref, .quantifier = .required },
7433 },
7434 },
7435 .{
7436 .name = "OpFUnordNotEqual",
7437 .opcode = 183,
7438 .operands = &.{
7439 .{ .kind = .id_result_type, .quantifier = .required },
7440 .{ .kind = .id_result, .quantifier = .required },
7441 .{ .kind = .id_ref, .quantifier = .required },
7442 .{ .kind = .id_ref, .quantifier = .required },
7443 },
7444 },
7445 .{
7446 .name = "OpFOrdLessThan",
7447 .opcode = 184,
7448 .operands = &.{
7449 .{ .kind = .id_result_type, .quantifier = .required },
7450 .{ .kind = .id_result, .quantifier = .required },
7451 .{ .kind = .id_ref, .quantifier = .required },
7452 .{ .kind = .id_ref, .quantifier = .required },
7453 },
7454 },
7455 .{
7456 .name = "OpFUnordLessThan",
7457 .opcode = 185,
7458 .operands = &.{
7459 .{ .kind = .id_result_type, .quantifier = .required },
7460 .{ .kind = .id_result, .quantifier = .required },
7461 .{ .kind = .id_ref, .quantifier = .required },
7462 .{ .kind = .id_ref, .quantifier = .required },
7463 },
7464 },
7465 .{
7466 .name = "OpFOrdGreaterThan",
7467 .opcode = 186,
7468 .operands = &.{
7469 .{ .kind = .id_result_type, .quantifier = .required },
7470 .{ .kind = .id_result, .quantifier = .required },
7471 .{ .kind = .id_ref, .quantifier = .required },
7472 .{ .kind = .id_ref, .quantifier = .required },
7473 },
7474 },
7475 .{
7476 .name = "OpFUnordGreaterThan",
7477 .opcode = 187,
7478 .operands = &.{
7479 .{ .kind = .id_result_type, .quantifier = .required },
7480 .{ .kind = .id_result, .quantifier = .required },
7481 .{ .kind = .id_ref, .quantifier = .required },
7482 .{ .kind = .id_ref, .quantifier = .required },
7483 },
7484 },
7485 .{
7486 .name = "OpFOrdLessThanEqual",
7487 .opcode = 188,
7488 .operands = &.{
7489 .{ .kind = .id_result_type, .quantifier = .required },
7490 .{ .kind = .id_result, .quantifier = .required },
7491 .{ .kind = .id_ref, .quantifier = .required },
7492 .{ .kind = .id_ref, .quantifier = .required },
7493 },
7494 },
7495 .{
7496 .name = "OpFUnordLessThanEqual",
7497 .opcode = 189,
7498 .operands = &.{
7499 .{ .kind = .id_result_type, .quantifier = .required },
7500 .{ .kind = .id_result, .quantifier = .required },
7501 .{ .kind = .id_ref, .quantifier = .required },
7502 .{ .kind = .id_ref, .quantifier = .required },
7503 },
7504 },
7505 .{
7506 .name = "OpFOrdGreaterThanEqual",
7507 .opcode = 190,
7508 .operands = &.{
7509 .{ .kind = .id_result_type, .quantifier = .required },
7510 .{ .kind = .id_result, .quantifier = .required },
7511 .{ .kind = .id_ref, .quantifier = .required },
7512 .{ .kind = .id_ref, .quantifier = .required },
7513 },
7514 },
7515 .{
7516 .name = "OpFUnordGreaterThanEqual",
7517 .opcode = 191,
7518 .operands = &.{
7519 .{ .kind = .id_result_type, .quantifier = .required },
7520 .{ .kind = .id_result, .quantifier = .required },
7521 .{ .kind = .id_ref, .quantifier = .required },
7522 .{ .kind = .id_ref, .quantifier = .required },
7523 },
7524 },
7525 .{
7526 .name = "OpShiftRightLogical",
7527 .opcode = 194,
7528 .operands = &.{
7529 .{ .kind = .id_result_type, .quantifier = .required },
7530 .{ .kind = .id_result, .quantifier = .required },
7531 .{ .kind = .id_ref, .quantifier = .required },
7532 .{ .kind = .id_ref, .quantifier = .required },
7533 },
7534 },
7535 .{
7536 .name = "OpShiftRightArithmetic",
7537 .opcode = 195,
7538 .operands = &.{
7539 .{ .kind = .id_result_type, .quantifier = .required },
7540 .{ .kind = .id_result, .quantifier = .required },
7541 .{ .kind = .id_ref, .quantifier = .required },
7542 .{ .kind = .id_ref, .quantifier = .required },
7543 },
7544 },
7545 .{
7546 .name = "OpShiftLeftLogical",
7547 .opcode = 196,
7548 .operands = &.{
7549 .{ .kind = .id_result_type, .quantifier = .required },
7550 .{ .kind = .id_result, .quantifier = .required },
7551 .{ .kind = .id_ref, .quantifier = .required },
7552 .{ .kind = .id_ref, .quantifier = .required },
7553 },
7554 },
7555 .{
7556 .name = "OpBitwiseOr",
7557 .opcode = 197,
7558 .operands = &.{
7559 .{ .kind = .id_result_type, .quantifier = .required },
7560 .{ .kind = .id_result, .quantifier = .required },
7561 .{ .kind = .id_ref, .quantifier = .required },
7562 .{ .kind = .id_ref, .quantifier = .required },
7563 },
7564 },
7565 .{
7566 .name = "OpBitwiseXor",
7567 .opcode = 198,
7568 .operands = &.{
7569 .{ .kind = .id_result_type, .quantifier = .required },
7570 .{ .kind = .id_result, .quantifier = .required },
7571 .{ .kind = .id_ref, .quantifier = .required },
7572 .{ .kind = .id_ref, .quantifier = .required },
7573 },
7574 },
7575 .{
7576 .name = "OpBitwiseAnd",
7577 .opcode = 199,
7578 .operands = &.{
7579 .{ .kind = .id_result_type, .quantifier = .required },
7580 .{ .kind = .id_result, .quantifier = .required },
7581 .{ .kind = .id_ref, .quantifier = .required },
7582 .{ .kind = .id_ref, .quantifier = .required },
7583 },
7584 },
7585 .{
7586 .name = "OpNot",
7587 .opcode = 200,
7588 .operands = &.{
7589 .{ .kind = .id_result_type, .quantifier = .required },
7590 .{ .kind = .id_result, .quantifier = .required },
7591 .{ .kind = .id_ref, .quantifier = .required },
7592 },
7593 },
7594 .{
7595 .name = "OpBitFieldInsert",
7596 .opcode = 201,
7597 .operands = &.{
7598 .{ .kind = .id_result_type, .quantifier = .required },
7599 .{ .kind = .id_result, .quantifier = .required },
7600 .{ .kind = .id_ref, .quantifier = .required },
7601 .{ .kind = .id_ref, .quantifier = .required },
7602 .{ .kind = .id_ref, .quantifier = .required },
7603 .{ .kind = .id_ref, .quantifier = .required },
7604 },
7605 },
7606 .{
7607 .name = "OpBitFieldSExtract",
7608 .opcode = 202,
7609 .operands = &.{
7610 .{ .kind = .id_result_type, .quantifier = .required },
7611 .{ .kind = .id_result, .quantifier = .required },
7612 .{ .kind = .id_ref, .quantifier = .required },
7613 .{ .kind = .id_ref, .quantifier = .required },
7614 .{ .kind = .id_ref, .quantifier = .required },
7615 },
7616 },
7617 .{
7618 .name = "OpBitFieldUExtract",
7619 .opcode = 203,
7620 .operands = &.{
7621 .{ .kind = .id_result_type, .quantifier = .required },
7622 .{ .kind = .id_result, .quantifier = .required },
7623 .{ .kind = .id_ref, .quantifier = .required },
7624 .{ .kind = .id_ref, .quantifier = .required },
7625 .{ .kind = .id_ref, .quantifier = .required },
7626 },
7627 },
7628 .{
7629 .name = "OpBitReverse",
7630 .opcode = 204,
7631 .operands = &.{
7632 .{ .kind = .id_result_type, .quantifier = .required },
7633 .{ .kind = .id_result, .quantifier = .required },
7634 .{ .kind = .id_ref, .quantifier = .required },
7635 },
7636 },
7637 .{
7638 .name = "OpBitCount",
7639 .opcode = 205,
7640 .operands = &.{
7641 .{ .kind = .id_result_type, .quantifier = .required },
7642 .{ .kind = .id_result, .quantifier = .required },
7643 .{ .kind = .id_ref, .quantifier = .required },
7644 },
7645 },
7646 .{
7647 .name = "OpDPdx",
7648 .opcode = 207,
7649 .operands = &.{
7650 .{ .kind = .id_result_type, .quantifier = .required },
7651 .{ .kind = .id_result, .quantifier = .required },
7652 .{ .kind = .id_ref, .quantifier = .required },
7653 },
7654 },
7655 .{
7656 .name = "OpDPdy",
7657 .opcode = 208,
7658 .operands = &.{
7659 .{ .kind = .id_result_type, .quantifier = .required },
7660 .{ .kind = .id_result, .quantifier = .required },
7661 .{ .kind = .id_ref, .quantifier = .required },
7662 },
7663 },
7664 .{
7665 .name = "OpFwidth",
7666 .opcode = 209,
7667 .operands = &.{
7668 .{ .kind = .id_result_type, .quantifier = .required },
7669 .{ .kind = .id_result, .quantifier = .required },
7670 .{ .kind = .id_ref, .quantifier = .required },
7671 },
7672 },
7673 .{
7674 .name = "OpDPdxFine",
7675 .opcode = 210,
7676 .operands = &.{
7677 .{ .kind = .id_result_type, .quantifier = .required },
7678 .{ .kind = .id_result, .quantifier = .required },
7679 .{ .kind = .id_ref, .quantifier = .required },
7680 },
7681 },
7682 .{
7683 .name = "OpDPdyFine",
7684 .opcode = 211,
7685 .operands = &.{
7686 .{ .kind = .id_result_type, .quantifier = .required },
7687 .{ .kind = .id_result, .quantifier = .required },
7688 .{ .kind = .id_ref, .quantifier = .required },
7689 },
7690 },
7691 .{
7692 .name = "OpFwidthFine",
7693 .opcode = 212,
7694 .operands = &.{
7695 .{ .kind = .id_result_type, .quantifier = .required },
7696 .{ .kind = .id_result, .quantifier = .required },
7697 .{ .kind = .id_ref, .quantifier = .required },
7698 },
7699 },
7700 .{
7701 .name = "OpDPdxCoarse",
7702 .opcode = 213,
7703 .operands = &.{
7704 .{ .kind = .id_result_type, .quantifier = .required },
7705 .{ .kind = .id_result, .quantifier = .required },
7706 .{ .kind = .id_ref, .quantifier = .required },
7707 },
7708 },
7709 .{
7710 .name = "OpDPdyCoarse",
7711 .opcode = 214,
7712 .operands = &.{
7713 .{ .kind = .id_result_type, .quantifier = .required },
7714 .{ .kind = .id_result, .quantifier = .required },
7715 .{ .kind = .id_ref, .quantifier = .required },
7716 },
7717 },
7718 .{
7719 .name = "OpFwidthCoarse",
7720 .opcode = 215,
7721 .operands = &.{
7722 .{ .kind = .id_result_type, .quantifier = .required },
7723 .{ .kind = .id_result, .quantifier = .required },
7724 .{ .kind = .id_ref, .quantifier = .required },
7725 },
7726 },
7727 .{
7728 .name = "OpEmitVertex",
7729 .opcode = 218,
7730 .operands = &.{},
7731 },
7732 .{
7733 .name = "OpEndPrimitive",
7734 .opcode = 219,
7735 .operands = &.{},
7736 },
7737 .{
7738 .name = "OpEmitStreamVertex",
7739 .opcode = 220,
7740 .operands = &.{
7741 .{ .kind = .id_ref, .quantifier = .required },
7742 },
7743 },
7744 .{
7745 .name = "OpEndStreamPrimitive",
7746 .opcode = 221,
7747 .operands = &.{
7748 .{ .kind = .id_ref, .quantifier = .required },
7749 },
7750 },
7751 .{
7752 .name = "OpControlBarrier",
7753 .opcode = 224,
7754 .operands = &.{
7755 .{ .kind = .id_scope, .quantifier = .required },
7756 .{ .kind = .id_scope, .quantifier = .required },
7757 .{ .kind = .id_memory_semantics, .quantifier = .required },
7758 },
7759 },
7760 .{
7761 .name = "OpMemoryBarrier",
7762 .opcode = 225,
7763 .operands = &.{
7764 .{ .kind = .id_scope, .quantifier = .required },
7765 .{ .kind = .id_memory_semantics, .quantifier = .required },
7766 },
7767 },
7768 .{
7769 .name = "OpAtomicLoad",
7770 .opcode = 227,
7771 .operands = &.{
7772 .{ .kind = .id_result_type, .quantifier = .required },
7773 .{ .kind = .id_result, .quantifier = .required },
7774 .{ .kind = .id_ref, .quantifier = .required },
7775 .{ .kind = .id_scope, .quantifier = .required },
7776 .{ .kind = .id_memory_semantics, .quantifier = .required },
7777 },
7778 },
7779 .{
7780 .name = "OpAtomicStore",
7781 .opcode = 228,
7782 .operands = &.{
7783 .{ .kind = .id_ref, .quantifier = .required },
7784 .{ .kind = .id_scope, .quantifier = .required },
7785 .{ .kind = .id_memory_semantics, .quantifier = .required },
7786 .{ .kind = .id_ref, .quantifier = .required },
7787 },
7788 },
7789 .{
7790 .name = "OpAtomicExchange",
7791 .opcode = 229,
7792 .operands = &.{
7793 .{ .kind = .id_result_type, .quantifier = .required },
7794 .{ .kind = .id_result, .quantifier = .required },
7795 .{ .kind = .id_ref, .quantifier = .required },
7796 .{ .kind = .id_scope, .quantifier = .required },
7797 .{ .kind = .id_memory_semantics, .quantifier = .required },
7798 .{ .kind = .id_ref, .quantifier = .required },
7799 },
7800 },
7801 .{
7802 .name = "OpAtomicCompareExchange",
7803 .opcode = 230,
7804 .operands = &.{
7805 .{ .kind = .id_result_type, .quantifier = .required },
7806 .{ .kind = .id_result, .quantifier = .required },
7807 .{ .kind = .id_ref, .quantifier = .required },
7808 .{ .kind = .id_scope, .quantifier = .required },
7809 .{ .kind = .id_memory_semantics, .quantifier = .required },
7810 .{ .kind = .id_memory_semantics, .quantifier = .required },
7811 .{ .kind = .id_ref, .quantifier = .required },
7812 .{ .kind = .id_ref, .quantifier = .required },
7813 },
7814 },
7815 .{
7816 .name = "OpAtomicCompareExchangeWeak",
7817 .opcode = 231,
7818 .operands = &.{
7819 .{ .kind = .id_result_type, .quantifier = .required },
7820 .{ .kind = .id_result, .quantifier = .required },
7821 .{ .kind = .id_ref, .quantifier = .required },
7822 .{ .kind = .id_scope, .quantifier = .required },
7823 .{ .kind = .id_memory_semantics, .quantifier = .required },
7824 .{ .kind = .id_memory_semantics, .quantifier = .required },
7825 .{ .kind = .id_ref, .quantifier = .required },
7826 .{ .kind = .id_ref, .quantifier = .required },
7827 },
7828 },
7829 .{
7830 .name = "OpAtomicIIncrement",
7831 .opcode = 232,
7832 .operands = &.{
7833 .{ .kind = .id_result_type, .quantifier = .required },
7834 .{ .kind = .id_result, .quantifier = .required },
7835 .{ .kind = .id_ref, .quantifier = .required },
7836 .{ .kind = .id_scope, .quantifier = .required },
7837 .{ .kind = .id_memory_semantics, .quantifier = .required },
7838 },
7839 },
7840 .{
7841 .name = "OpAtomicIDecrement",
7842 .opcode = 233,
7843 .operands = &.{
7844 .{ .kind = .id_result_type, .quantifier = .required },
7845 .{ .kind = .id_result, .quantifier = .required },
7846 .{ .kind = .id_ref, .quantifier = .required },
7847 .{ .kind = .id_scope, .quantifier = .required },
7848 .{ .kind = .id_memory_semantics, .quantifier = .required },
7849 },
7850 },
7851 .{
7852 .name = "OpAtomicIAdd",
7853 .opcode = 234,
7854 .operands = &.{
7855 .{ .kind = .id_result_type, .quantifier = .required },
7856 .{ .kind = .id_result, .quantifier = .required },
7857 .{ .kind = .id_ref, .quantifier = .required },
7858 .{ .kind = .id_scope, .quantifier = .required },
7859 .{ .kind = .id_memory_semantics, .quantifier = .required },
7860 .{ .kind = .id_ref, .quantifier = .required },
7861 },
7862 },
7863 .{
7864 .name = "OpAtomicISub",
7865 .opcode = 235,
7866 .operands = &.{
7867 .{ .kind = .id_result_type, .quantifier = .required },
7868 .{ .kind = .id_result, .quantifier = .required },
7869 .{ .kind = .id_ref, .quantifier = .required },
7870 .{ .kind = .id_scope, .quantifier = .required },
7871 .{ .kind = .id_memory_semantics, .quantifier = .required },
7872 .{ .kind = .id_ref, .quantifier = .required },
7873 },
7874 },
7875 .{
7876 .name = "OpAtomicSMin",
7877 .opcode = 236,
7878 .operands = &.{
7879 .{ .kind = .id_result_type, .quantifier = .required },
7880 .{ .kind = .id_result, .quantifier = .required },
7881 .{ .kind = .id_ref, .quantifier = .required },
7882 .{ .kind = .id_scope, .quantifier = .required },
7883 .{ .kind = .id_memory_semantics, .quantifier = .required },
7884 .{ .kind = .id_ref, .quantifier = .required },
7885 },
7886 },
7887 .{
7888 .name = "OpAtomicUMin",
7889 .opcode = 237,
7890 .operands = &.{
7891 .{ .kind = .id_result_type, .quantifier = .required },
7892 .{ .kind = .id_result, .quantifier = .required },
7893 .{ .kind = .id_ref, .quantifier = .required },
7894 .{ .kind = .id_scope, .quantifier = .required },
7895 .{ .kind = .id_memory_semantics, .quantifier = .required },
7896 .{ .kind = .id_ref, .quantifier = .required },
7897 },
7898 },
7899 .{
7900 .name = "OpAtomicSMax",
7901 .opcode = 238,
7902 .operands = &.{
7903 .{ .kind = .id_result_type, .quantifier = .required },
7904 .{ .kind = .id_result, .quantifier = .required },
7905 .{ .kind = .id_ref, .quantifier = .required },
7906 .{ .kind = .id_scope, .quantifier = .required },
7907 .{ .kind = .id_memory_semantics, .quantifier = .required },
7908 .{ .kind = .id_ref, .quantifier = .required },
7909 },
7910 },
7911 .{
7912 .name = "OpAtomicUMax",
7913 .opcode = 239,
7914 .operands = &.{
7915 .{ .kind = .id_result_type, .quantifier = .required },
7916 .{ .kind = .id_result, .quantifier = .required },
7917 .{ .kind = .id_ref, .quantifier = .required },
7918 .{ .kind = .id_scope, .quantifier = .required },
7919 .{ .kind = .id_memory_semantics, .quantifier = .required },
7920 .{ .kind = .id_ref, .quantifier = .required },
7921 },
7922 },
7923 .{
7924 .name = "OpAtomicAnd",
7925 .opcode = 240,
7926 .operands = &.{
7927 .{ .kind = .id_result_type, .quantifier = .required },
7928 .{ .kind = .id_result, .quantifier = .required },
7929 .{ .kind = .id_ref, .quantifier = .required },
7930 .{ .kind = .id_scope, .quantifier = .required },
7931 .{ .kind = .id_memory_semantics, .quantifier = .required },
7932 .{ .kind = .id_ref, .quantifier = .required },
7933 },
7934 },
7935 .{
7936 .name = "OpAtomicOr",
7937 .opcode = 241,
7938 .operands = &.{
7939 .{ .kind = .id_result_type, .quantifier = .required },
7940 .{ .kind = .id_result, .quantifier = .required },
7941 .{ .kind = .id_ref, .quantifier = .required },
7942 .{ .kind = .id_scope, .quantifier = .required },
7943 .{ .kind = .id_memory_semantics, .quantifier = .required },
7944 .{ .kind = .id_ref, .quantifier = .required },
7945 },
7946 },
7947 .{
7948 .name = "OpAtomicXor",
7949 .opcode = 242,
7950 .operands = &.{
7951 .{ .kind = .id_result_type, .quantifier = .required },
7952 .{ .kind = .id_result, .quantifier = .required },
7953 .{ .kind = .id_ref, .quantifier = .required },
7954 .{ .kind = .id_scope, .quantifier = .required },
7955 .{ .kind = .id_memory_semantics, .quantifier = .required },
7956 .{ .kind = .id_ref, .quantifier = .required },
7957 },
7958 },
7959 .{
7960 .name = "OpPhi",
7961 .opcode = 245,
7962 .operands = &.{
7963 .{ .kind = .id_result_type, .quantifier = .required },
7964 .{ .kind = .id_result, .quantifier = .required },
7965 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
7966 },
7967 },
7968 .{
7969 .name = "OpLoopMerge",
7970 .opcode = 246,
7971 .operands = &.{
7972 .{ .kind = .id_ref, .quantifier = .required },
7973 .{ .kind = .id_ref, .quantifier = .required },
7974 .{ .kind = .loop_control, .quantifier = .required },
7975 },
7976 },
7977 .{
7978 .name = "OpSelectionMerge",
7979 .opcode = 247,
7980 .operands = &.{
7981 .{ .kind = .id_ref, .quantifier = .required },
7982 .{ .kind = .selection_control, .quantifier = .required },
7983 },
7984 },
7985 .{
7986 .name = "OpLabel",
7987 .opcode = 248,
7988 .operands = &.{
7989 .{ .kind = .id_result, .quantifier = .required },
7990 },
7991 },
7992 .{
7993 .name = "OpBranch",
7994 .opcode = 249,
7995 .operands = &.{
7996 .{ .kind = .id_ref, .quantifier = .required },
7997 },
7998 },
7999 .{
8000 .name = "OpBranchConditional",
8001 .opcode = 250,
8002 .operands = &.{
8003 .{ .kind = .id_ref, .quantifier = .required },
8004 .{ .kind = .id_ref, .quantifier = .required },
8005 .{ .kind = .id_ref, .quantifier = .required },
8006 .{ .kind = .literal_integer, .quantifier = .variadic },
8007 },
8008 },
8009 .{
8010 .name = "OpSwitch",
8011 .opcode = 251,
8012 .operands = &.{
8013 .{ .kind = .id_ref, .quantifier = .required },
8014 .{ .kind = .id_ref, .quantifier = .required },
8015 .{ .kind = .pair_literal_integer_id_ref, .quantifier = .variadic },
8016 },
8017 },
8018 .{
8019 .name = "OpKill",
8020 .opcode = 252,
8021 .operands = &.{},
8022 },
8023 .{
8024 .name = "OpReturn",
8025 .opcode = 253,
8026 .operands = &.{},
8027 },
8028 .{
8029 .name = "OpReturnValue",
8030 .opcode = 254,
8031 .operands = &.{
8032 .{ .kind = .id_ref, .quantifier = .required },
8033 },
8034 },
8035 .{
8036 .name = "OpUnreachable",
8037 .opcode = 255,
8038 .operands = &.{},
8039 },
8040 .{
8041 .name = "OpLifetimeStart",
8042 .opcode = 256,
8043 .operands = &.{
8044 .{ .kind = .id_ref, .quantifier = .required },
8045 .{ .kind = .literal_integer, .quantifier = .required },
8046 },
8047 },
8048 .{
8049 .name = "OpLifetimeStop",
8050 .opcode = 257,
8051 .operands = &.{
8052 .{ .kind = .id_ref, .quantifier = .required },
8053 .{ .kind = .literal_integer, .quantifier = .required },
8054 },
8055 },
8056 .{
8057 .name = "OpGroupAsyncCopy",
8058 .opcode = 259,
8059 .operands = &.{
8060 .{ .kind = .id_result_type, .quantifier = .required },
8061 .{ .kind = .id_result, .quantifier = .required },
8062 .{ .kind = .id_scope, .quantifier = .required },
8063 .{ .kind = .id_ref, .quantifier = .required },
8064 .{ .kind = .id_ref, .quantifier = .required },
8065 .{ .kind = .id_ref, .quantifier = .required },
8066 .{ .kind = .id_ref, .quantifier = .required },
8067 .{ .kind = .id_ref, .quantifier = .required },
8068 },
8069 },
8070 .{
8071 .name = "OpGroupWaitEvents",
8072 .opcode = 260,
8073 .operands = &.{
8074 .{ .kind = .id_scope, .quantifier = .required },
8075 .{ .kind = .id_ref, .quantifier = .required },
8076 .{ .kind = .id_ref, .quantifier = .required },
8077 },
8078 },
8079 .{
8080 .name = "OpGroupAll",
8081 .opcode = 261,
8082 .operands = &.{
8083 .{ .kind = .id_result_type, .quantifier = .required },
8084 .{ .kind = .id_result, .quantifier = .required },
8085 .{ .kind = .id_scope, .quantifier = .required },
8086 .{ .kind = .id_ref, .quantifier = .required },
8087 },
8088 },
8089 .{
8090 .name = "OpGroupAny",
8091 .opcode = 262,
8092 .operands = &.{
8093 .{ .kind = .id_result_type, .quantifier = .required },
8094 .{ .kind = .id_result, .quantifier = .required },
8095 .{ .kind = .id_scope, .quantifier = .required },
8096 .{ .kind = .id_ref, .quantifier = .required },
8097 },
8098 },
8099 .{
8100 .name = "OpGroupBroadcast",
8101 .opcode = 263,
8102 .operands = &.{
8103 .{ .kind = .id_result_type, .quantifier = .required },
8104 .{ .kind = .id_result, .quantifier = .required },
8105 .{ .kind = .id_scope, .quantifier = .required },
8106 .{ .kind = .id_ref, .quantifier = .required },
8107 .{ .kind = .id_ref, .quantifier = .required },
8108 },
8109 },
8110 .{
8111 .name = "OpGroupIAdd",
8112 .opcode = 264,
8113 .operands = &.{
8114 .{ .kind = .id_result_type, .quantifier = .required },
8115 .{ .kind = .id_result, .quantifier = .required },
8116 .{ .kind = .id_scope, .quantifier = .required },
8117 .{ .kind = .group_operation, .quantifier = .required },
8118 .{ .kind = .id_ref, .quantifier = .required },
8119 },
8120 },
8121 .{
8122 .name = "OpGroupFAdd",
8123 .opcode = 265,
8124 .operands = &.{
8125 .{ .kind = .id_result_type, .quantifier = .required },
8126 .{ .kind = .id_result, .quantifier = .required },
8127 .{ .kind = .id_scope, .quantifier = .required },
8128 .{ .kind = .group_operation, .quantifier = .required },
8129 .{ .kind = .id_ref, .quantifier = .required },
8130 },
8131 },
8132 .{
8133 .name = "OpGroupFMin",
8134 .opcode = 266,
8135 .operands = &.{
8136 .{ .kind = .id_result_type, .quantifier = .required },
8137 .{ .kind = .id_result, .quantifier = .required },
8138 .{ .kind = .id_scope, .quantifier = .required },
8139 .{ .kind = .group_operation, .quantifier = .required },
8140 .{ .kind = .id_ref, .quantifier = .required },
8141 },
8142 },
8143 .{
8144 .name = "OpGroupUMin",
8145 .opcode = 267,
8146 .operands = &.{
8147 .{ .kind = .id_result_type, .quantifier = .required },
8148 .{ .kind = .id_result, .quantifier = .required },
8149 .{ .kind = .id_scope, .quantifier = .required },
8150 .{ .kind = .group_operation, .quantifier = .required },
8151 .{ .kind = .id_ref, .quantifier = .required },
8152 },
8153 },
8154 .{
8155 .name = "OpGroupSMin",
8156 .opcode = 268,
8157 .operands = &.{
8158 .{ .kind = .id_result_type, .quantifier = .required },
8159 .{ .kind = .id_result, .quantifier = .required },
8160 .{ .kind = .id_scope, .quantifier = .required },
8161 .{ .kind = .group_operation, .quantifier = .required },
8162 .{ .kind = .id_ref, .quantifier = .required },
8163 },
8164 },
8165 .{
8166 .name = "OpGroupFMax",
8167 .opcode = 269,
8168 .operands = &.{
8169 .{ .kind = .id_result_type, .quantifier = .required },
8170 .{ .kind = .id_result, .quantifier = .required },
8171 .{ .kind = .id_scope, .quantifier = .required },
8172 .{ .kind = .group_operation, .quantifier = .required },
8173 .{ .kind = .id_ref, .quantifier = .required },
8174 },
8175 },
8176 .{
8177 .name = "OpGroupUMax",
8178 .opcode = 270,
8179 .operands = &.{
8180 .{ .kind = .id_result_type, .quantifier = .required },
8181 .{ .kind = .id_result, .quantifier = .required },
8182 .{ .kind = .id_scope, .quantifier = .required },
8183 .{ .kind = .group_operation, .quantifier = .required },
8184 .{ .kind = .id_ref, .quantifier = .required },
8185 },
8186 },
8187 .{
8188 .name = "OpGroupSMax",
8189 .opcode = 271,
8190 .operands = &.{
8191 .{ .kind = .id_result_type, .quantifier = .required },
8192 .{ .kind = .id_result, .quantifier = .required },
8193 .{ .kind = .id_scope, .quantifier = .required },
8194 .{ .kind = .group_operation, .quantifier = .required },
8195 .{ .kind = .id_ref, .quantifier = .required },
8196 },
8197 },
8198 .{
8199 .name = "OpReadPipe",
8200 .opcode = 274,
8201 .operands = &.{
8202 .{ .kind = .id_result_type, .quantifier = .required },
8203 .{ .kind = .id_result, .quantifier = .required },
8204 .{ .kind = .id_ref, .quantifier = .required },
8205 .{ .kind = .id_ref, .quantifier = .required },
8206 .{ .kind = .id_ref, .quantifier = .required },
8207 .{ .kind = .id_ref, .quantifier = .required },
8208 },
8209 },
8210 .{
8211 .name = "OpWritePipe",
8212 .opcode = 275,
8213 .operands = &.{
8214 .{ .kind = .id_result_type, .quantifier = .required },
8215 .{ .kind = .id_result, .quantifier = .required },
8216 .{ .kind = .id_ref, .quantifier = .required },
8217 .{ .kind = .id_ref, .quantifier = .required },
8218 .{ .kind = .id_ref, .quantifier = .required },
8219 .{ .kind = .id_ref, .quantifier = .required },
8220 },
8221 },
8222 .{
8223 .name = "OpReservedReadPipe",
8224 .opcode = 276,
8225 .operands = &.{
8226 .{ .kind = .id_result_type, .quantifier = .required },
8227 .{ .kind = .id_result, .quantifier = .required },
8228 .{ .kind = .id_ref, .quantifier = .required },
8229 .{ .kind = .id_ref, .quantifier = .required },
8230 .{ .kind = .id_ref, .quantifier = .required },
8231 .{ .kind = .id_ref, .quantifier = .required },
8232 .{ .kind = .id_ref, .quantifier = .required },
8233 .{ .kind = .id_ref, .quantifier = .required },
8234 },
8235 },
8236 .{
8237 .name = "OpReservedWritePipe",
8238 .opcode = 277,
8239 .operands = &.{
8240 .{ .kind = .id_result_type, .quantifier = .required },
8241 .{ .kind = .id_result, .quantifier = .required },
8242 .{ .kind = .id_ref, .quantifier = .required },
8243 .{ .kind = .id_ref, .quantifier = .required },
8244 .{ .kind = .id_ref, .quantifier = .required },
8245 .{ .kind = .id_ref, .quantifier = .required },
8246 .{ .kind = .id_ref, .quantifier = .required },
8247 .{ .kind = .id_ref, .quantifier = .required },
8248 },
8249 },
8250 .{
8251 .name = "OpReserveReadPipePackets",
8252 .opcode = 278,
8253 .operands = &.{
8254 .{ .kind = .id_result_type, .quantifier = .required },
8255 .{ .kind = .id_result, .quantifier = .required },
8256 .{ .kind = .id_ref, .quantifier = .required },
8257 .{ .kind = .id_ref, .quantifier = .required },
8258 .{ .kind = .id_ref, .quantifier = .required },
8259 .{ .kind = .id_ref, .quantifier = .required },
8260 },
8261 },
8262 .{
8263 .name = "OpReserveWritePipePackets",
8264 .opcode = 279,
8265 .operands = &.{
8266 .{ .kind = .id_result_type, .quantifier = .required },
8267 .{ .kind = .id_result, .quantifier = .required },
8268 .{ .kind = .id_ref, .quantifier = .required },
8269 .{ .kind = .id_ref, .quantifier = .required },
8270 .{ .kind = .id_ref, .quantifier = .required },
8271 .{ .kind = .id_ref, .quantifier = .required },
8272 },
8273 },
8274 .{
8275 .name = "OpCommitReadPipe",
8276 .opcode = 280,
8277 .operands = &.{
8278 .{ .kind = .id_ref, .quantifier = .required },
8279 .{ .kind = .id_ref, .quantifier = .required },
8280 .{ .kind = .id_ref, .quantifier = .required },
8281 .{ .kind = .id_ref, .quantifier = .required },
8282 },
8283 },
8284 .{
8285 .name = "OpCommitWritePipe",
8286 .opcode = 281,
8287 .operands = &.{
8288 .{ .kind = .id_ref, .quantifier = .required },
8289 .{ .kind = .id_ref, .quantifier = .required },
8290 .{ .kind = .id_ref, .quantifier = .required },
8291 .{ .kind = .id_ref, .quantifier = .required },
8292 },
8293 },
8294 .{
8295 .name = "OpIsValidReserveId",
8296 .opcode = 282,
8297 .operands = &.{
8298 .{ .kind = .id_result_type, .quantifier = .required },
8299 .{ .kind = .id_result, .quantifier = .required },
8300 .{ .kind = .id_ref, .quantifier = .required },
8301 },
8302 },
8303 .{
8304 .name = "OpGetNumPipePackets",
8305 .opcode = 283,
8306 .operands = &.{
8307 .{ .kind = .id_result_type, .quantifier = .required },
8308 .{ .kind = .id_result, .quantifier = .required },
8309 .{ .kind = .id_ref, .quantifier = .required },
8310 .{ .kind = .id_ref, .quantifier = .required },
8311 .{ .kind = .id_ref, .quantifier = .required },
8312 },
8313 },
8314 .{
8315 .name = "OpGetMaxPipePackets",
8316 .opcode = 284,
8317 .operands = &.{
8318 .{ .kind = .id_result_type, .quantifier = .required },
8319 .{ .kind = .id_result, .quantifier = .required },
8320 .{ .kind = .id_ref, .quantifier = .required },
8321 .{ .kind = .id_ref, .quantifier = .required },
8322 .{ .kind = .id_ref, .quantifier = .required },
8323 },
8324 },
8325 .{
8326 .name = "OpGroupReserveReadPipePackets",
8327 .opcode = 285,
8328 .operands = &.{
8329 .{ .kind = .id_result_type, .quantifier = .required },
8330 .{ .kind = .id_result, .quantifier = .required },
8331 .{ .kind = .id_scope, .quantifier = .required },
8332 .{ .kind = .id_ref, .quantifier = .required },
8333 .{ .kind = .id_ref, .quantifier = .required },
8334 .{ .kind = .id_ref, .quantifier = .required },
8335 .{ .kind = .id_ref, .quantifier = .required },
8336 },
8337 },
8338 .{
8339 .name = "OpGroupReserveWritePipePackets",
8340 .opcode = 286,
8341 .operands = &.{
8342 .{ .kind = .id_result_type, .quantifier = .required },
8343 .{ .kind = .id_result, .quantifier = .required },
8344 .{ .kind = .id_scope, .quantifier = .required },
8345 .{ .kind = .id_ref, .quantifier = .required },
8346 .{ .kind = .id_ref, .quantifier = .required },
8347 .{ .kind = .id_ref, .quantifier = .required },
8348 .{ .kind = .id_ref, .quantifier = .required },
8349 },
8350 },
8351 .{
8352 .name = "OpGroupCommitReadPipe",
8353 .opcode = 287,
8354 .operands = &.{
8355 .{ .kind = .id_scope, .quantifier = .required },
8356 .{ .kind = .id_ref, .quantifier = .required },
8357 .{ .kind = .id_ref, .quantifier = .required },
8358 .{ .kind = .id_ref, .quantifier = .required },
8359 .{ .kind = .id_ref, .quantifier = .required },
8360 },
8361 },
8362 .{
8363 .name = "OpGroupCommitWritePipe",
8364 .opcode = 288,
8365 .operands = &.{
8366 .{ .kind = .id_scope, .quantifier = .required },
8367 .{ .kind = .id_ref, .quantifier = .required },
8368 .{ .kind = .id_ref, .quantifier = .required },
8369 .{ .kind = .id_ref, .quantifier = .required },
8370 .{ .kind = .id_ref, .quantifier = .required },
8371 },
8372 },
8373 .{
8374 .name = "OpEnqueueMarker",
8375 .opcode = 291,
8376 .operands = &.{
8377 .{ .kind = .id_result_type, .quantifier = .required },
8378 .{ .kind = .id_result, .quantifier = .required },
8379 .{ .kind = .id_ref, .quantifier = .required },
8380 .{ .kind = .id_ref, .quantifier = .required },
8381 .{ .kind = .id_ref, .quantifier = .required },
8382 .{ .kind = .id_ref, .quantifier = .required },
8383 },
8384 },
8385 .{
8386 .name = "OpEnqueueKernel",
8387 .opcode = 292,
8388 .operands = &.{
8389 .{ .kind = .id_result_type, .quantifier = .required },
8390 .{ .kind = .id_result, .quantifier = .required },
8391 .{ .kind = .id_ref, .quantifier = .required },
8392 .{ .kind = .id_ref, .quantifier = .required },
8393 .{ .kind = .id_ref, .quantifier = .required },
8394 .{ .kind = .id_ref, .quantifier = .required },
8395 .{ .kind = .id_ref, .quantifier = .required },
8396 .{ .kind = .id_ref, .quantifier = .required },
8397 .{ .kind = .id_ref, .quantifier = .required },
8398 .{ .kind = .id_ref, .quantifier = .required },
8399 .{ .kind = .id_ref, .quantifier = .required },
8400 .{ .kind = .id_ref, .quantifier = .required },
8401 .{ .kind = .id_ref, .quantifier = .variadic },
8402 },
8403 },
8404 .{
8405 .name = "OpGetKernelNDrangeSubGroupCount",
8406 .opcode = 293,
8407 .operands = &.{
8408 .{ .kind = .id_result_type, .quantifier = .required },
8409 .{ .kind = .id_result, .quantifier = .required },
8410 .{ .kind = .id_ref, .quantifier = .required },
8411 .{ .kind = .id_ref, .quantifier = .required },
8412 .{ .kind = .id_ref, .quantifier = .required },
8413 .{ .kind = .id_ref, .quantifier = .required },
8414 .{ .kind = .id_ref, .quantifier = .required },
8415 },
8416 },
8417 .{
8418 .name = "OpGetKernelNDrangeMaxSubGroupSize",
8419 .opcode = 294,
8420 .operands = &.{
8421 .{ .kind = .id_result_type, .quantifier = .required },
8422 .{ .kind = .id_result, .quantifier = .required },
8423 .{ .kind = .id_ref, .quantifier = .required },
8424 .{ .kind = .id_ref, .quantifier = .required },
8425 .{ .kind = .id_ref, .quantifier = .required },
8426 .{ .kind = .id_ref, .quantifier = .required },
8427 .{ .kind = .id_ref, .quantifier = .required },
8428 },
8429 },
8430 .{
8431 .name = "OpGetKernelWorkGroupSize",
8432 .opcode = 295,
8433 .operands = &.{
8434 .{ .kind = .id_result_type, .quantifier = .required },
8435 .{ .kind = .id_result, .quantifier = .required },
8436 .{ .kind = .id_ref, .quantifier = .required },
8437 .{ .kind = .id_ref, .quantifier = .required },
8438 .{ .kind = .id_ref, .quantifier = .required },
8439 .{ .kind = .id_ref, .quantifier = .required },
8440 },
8441 },
8442 .{
8443 .name = "OpGetKernelPreferredWorkGroupSizeMultiple",
8444 .opcode = 296,
8445 .operands = &.{
8446 .{ .kind = .id_result_type, .quantifier = .required },
8447 .{ .kind = .id_result, .quantifier = .required },
8448 .{ .kind = .id_ref, .quantifier = .required },
8449 .{ .kind = .id_ref, .quantifier = .required },
8450 .{ .kind = .id_ref, .quantifier = .required },
8451 .{ .kind = .id_ref, .quantifier = .required },
8452 },
8453 },
8454 .{
8455 .name = "OpRetainEvent",
8456 .opcode = 297,
8457 .operands = &.{
8458 .{ .kind = .id_ref, .quantifier = .required },
8459 },
8460 },
8461 .{
8462 .name = "OpReleaseEvent",
8463 .opcode = 298,
8464 .operands = &.{
8465 .{ .kind = .id_ref, .quantifier = .required },
8466 },
8467 },
8468 .{
8469 .name = "OpCreateUserEvent",
8470 .opcode = 299,
8471 .operands = &.{
8472 .{ .kind = .id_result_type, .quantifier = .required },
8473 .{ .kind = .id_result, .quantifier = .required },
8474 },
8475 },
8476 .{
8477 .name = "OpIsValidEvent",
8478 .opcode = 300,
8479 .operands = &.{
8480 .{ .kind = .id_result_type, .quantifier = .required },
8481 .{ .kind = .id_result, .quantifier = .required },
8482 .{ .kind = .id_ref, .quantifier = .required },
8483 },
8484 },
8485 .{
8486 .name = "OpSetUserEventStatus",
8487 .opcode = 301,
8488 .operands = &.{
8489 .{ .kind = .id_ref, .quantifier = .required },
8490 .{ .kind = .id_ref, .quantifier = .required },
8491 },
8492 },
8493 .{
8494 .name = "OpCaptureEventProfilingInfo",
8495 .opcode = 302,
8496 .operands = &.{
8497 .{ .kind = .id_ref, .quantifier = .required },
8498 .{ .kind = .id_ref, .quantifier = .required },
8499 .{ .kind = .id_ref, .quantifier = .required },
8500 },
8501 },
8502 .{
8503 .name = "OpGetDefaultQueue",
8504 .opcode = 303,
8505 .operands = &.{
8506 .{ .kind = .id_result_type, .quantifier = .required },
8507 .{ .kind = .id_result, .quantifier = .required },
8508 },
8509 },
8510 .{
8511 .name = "OpBuildNDRange",
8512 .opcode = 304,
8513 .operands = &.{
8514 .{ .kind = .id_result_type, .quantifier = .required },
8515 .{ .kind = .id_result, .quantifier = .required },
8516 .{ .kind = .id_ref, .quantifier = .required },
8517 .{ .kind = .id_ref, .quantifier = .required },
8518 .{ .kind = .id_ref, .quantifier = .required },
8519 },
8520 },
8521 .{
8522 .name = "OpImageSparseSampleImplicitLod",
8523 .opcode = 305,
8524 .operands = &.{
8525 .{ .kind = .id_result_type, .quantifier = .required },
8526 .{ .kind = .id_result, .quantifier = .required },
8527 .{ .kind = .id_ref, .quantifier = .required },
8528 .{ .kind = .id_ref, .quantifier = .required },
8529 .{ .kind = .image_operands, .quantifier = .optional },
8530 },
8531 },
8532 .{
8533 .name = "OpImageSparseSampleExplicitLod",
8534 .opcode = 306,
8535 .operands = &.{
8536 .{ .kind = .id_result_type, .quantifier = .required },
8537 .{ .kind = .id_result, .quantifier = .required },
8538 .{ .kind = .id_ref, .quantifier = .required },
8539 .{ .kind = .id_ref, .quantifier = .required },
8540 .{ .kind = .image_operands, .quantifier = .required },
8541 },
8542 },
8543 .{
8544 .name = "OpImageSparseSampleDrefImplicitLod",
8545 .opcode = 307,
8546 .operands = &.{
8547 .{ .kind = .id_result_type, .quantifier = .required },
8548 .{ .kind = .id_result, .quantifier = .required },
8549 .{ .kind = .id_ref, .quantifier = .required },
8550 .{ .kind = .id_ref, .quantifier = .required },
8551 .{ .kind = .id_ref, .quantifier = .required },
8552 .{ .kind = .image_operands, .quantifier = .optional },
8553 },
8554 },
8555 .{
8556 .name = "OpImageSparseSampleDrefExplicitLod",
8557 .opcode = 308,
8558 .operands = &.{
8559 .{ .kind = .id_result_type, .quantifier = .required },
8560 .{ .kind = .id_result, .quantifier = .required },
8561 .{ .kind = .id_ref, .quantifier = .required },
8562 .{ .kind = .id_ref, .quantifier = .required },
8563 .{ .kind = .id_ref, .quantifier = .required },
8564 .{ .kind = .image_operands, .quantifier = .required },
8565 },
8566 },
8567 .{
8568 .name = "OpImageSparseSampleProjImplicitLod",
8569 .opcode = 309,
8570 .operands = &.{
8571 .{ .kind = .id_result_type, .quantifier = .required },
8572 .{ .kind = .id_result, .quantifier = .required },
8573 .{ .kind = .id_ref, .quantifier = .required },
8574 .{ .kind = .id_ref, .quantifier = .required },
8575 .{ .kind = .image_operands, .quantifier = .optional },
8576 },
8577 },
8578 .{
8579 .name = "OpImageSparseSampleProjExplicitLod",
8580 .opcode = 310,
8581 .operands = &.{
8582 .{ .kind = .id_result_type, .quantifier = .required },
8583 .{ .kind = .id_result, .quantifier = .required },
8584 .{ .kind = .id_ref, .quantifier = .required },
8585 .{ .kind = .id_ref, .quantifier = .required },
8586 .{ .kind = .image_operands, .quantifier = .required },
8587 },
8588 },
8589 .{
8590 .name = "OpImageSparseSampleProjDrefImplicitLod",
8591 .opcode = 311,
8592 .operands = &.{
8593 .{ .kind = .id_result_type, .quantifier = .required },
8594 .{ .kind = .id_result, .quantifier = .required },
8595 .{ .kind = .id_ref, .quantifier = .required },
8596 .{ .kind = .id_ref, .quantifier = .required },
8597 .{ .kind = .id_ref, .quantifier = .required },
8598 .{ .kind = .image_operands, .quantifier = .optional },
8599 },
8600 },
8601 .{
8602 .name = "OpImageSparseSampleProjDrefExplicitLod",
8603 .opcode = 312,
8604 .operands = &.{
8605 .{ .kind = .id_result_type, .quantifier = .required },
8606 .{ .kind = .id_result, .quantifier = .required },
8607 .{ .kind = .id_ref, .quantifier = .required },
8608 .{ .kind = .id_ref, .quantifier = .required },
8609 .{ .kind = .id_ref, .quantifier = .required },
8610 .{ .kind = .image_operands, .quantifier = .required },
8611 },
8612 },
8613 .{
8614 .name = "OpImageSparseFetch",
8615 .opcode = 313,
8616 .operands = &.{
8617 .{ .kind = .id_result_type, .quantifier = .required },
8618 .{ .kind = .id_result, .quantifier = .required },
8619 .{ .kind = .id_ref, .quantifier = .required },
8620 .{ .kind = .id_ref, .quantifier = .required },
8621 .{ .kind = .image_operands, .quantifier = .optional },
8622 },
8623 },
8624 .{
8625 .name = "OpImageSparseGather",
8626 .opcode = 314,
8627 .operands = &.{
8628 .{ .kind = .id_result_type, .quantifier = .required },
8629 .{ .kind = .id_result, .quantifier = .required },
8630 .{ .kind = .id_ref, .quantifier = .required },
8631 .{ .kind = .id_ref, .quantifier = .required },
8632 .{ .kind = .id_ref, .quantifier = .required },
8633 .{ .kind = .image_operands, .quantifier = .optional },
8634 },
8635 },
8636 .{
8637 .name = "OpImageSparseDrefGather",
8638 .opcode = 315,
8639 .operands = &.{
8640 .{ .kind = .id_result_type, .quantifier = .required },
8641 .{ .kind = .id_result, .quantifier = .required },
8642 .{ .kind = .id_ref, .quantifier = .required },
8643 .{ .kind = .id_ref, .quantifier = .required },
8644 .{ .kind = .id_ref, .quantifier = .required },
8645 .{ .kind = .image_operands, .quantifier = .optional },
8646 },
8647 },
8648 .{
8649 .name = "OpImageSparseTexelsResident",
8650 .opcode = 316,
8651 .operands = &.{
8652 .{ .kind = .id_result_type, .quantifier = .required },
8653 .{ .kind = .id_result, .quantifier = .required },
8654 .{ .kind = .id_ref, .quantifier = .required },
8655 },
8656 },
8657 .{
8658 .name = "OpNoLine",
8659 .opcode = 317,
8660 .operands = &.{},
8661 },
8662 .{
8663 .name = "OpAtomicFlagTestAndSet",
8664 .opcode = 318,
8665 .operands = &.{
8666 .{ .kind = .id_result_type, .quantifier = .required },
8667 .{ .kind = .id_result, .quantifier = .required },
8668 .{ .kind = .id_ref, .quantifier = .required },
8669 .{ .kind = .id_scope, .quantifier = .required },
8670 .{ .kind = .id_memory_semantics, .quantifier = .required },
8671 },
8672 },
8673 .{
8674 .name = "OpAtomicFlagClear",
8675 .opcode = 319,
8676 .operands = &.{
8677 .{ .kind = .id_ref, .quantifier = .required },
8678 .{ .kind = .id_scope, .quantifier = .required },
8679 .{ .kind = .id_memory_semantics, .quantifier = .required },
8680 },
8681 },
8682 .{
8683 .name = "OpImageSparseRead",
8684 .opcode = 320,
8685 .operands = &.{
8686 .{ .kind = .id_result_type, .quantifier = .required },
8687 .{ .kind = .id_result, .quantifier = .required },
8688 .{ .kind = .id_ref, .quantifier = .required },
8689 .{ .kind = .id_ref, .quantifier = .required },
8690 .{ .kind = .image_operands, .quantifier = .optional },
8691 },
8692 },
8693 .{
8694 .name = "OpSizeOf",
8695 .opcode = 321,
8696 .operands = &.{
8697 .{ .kind = .id_result_type, .quantifier = .required },
8698 .{ .kind = .id_result, .quantifier = .required },
8699 .{ .kind = .id_ref, .quantifier = .required },
8700 },
8701 },
8702 .{
8703 .name = "OpTypePipeStorage",
8704 .opcode = 322,
8705 .operands = &.{
8706 .{ .kind = .id_result, .quantifier = .required },
8707 },
8708 },
8709 .{
8710 .name = "OpConstantPipeStorage",
8711 .opcode = 323,
8712 .operands = &.{
8713 .{ .kind = .id_result_type, .quantifier = .required },
8714 .{ .kind = .id_result, .quantifier = .required },
8715 .{ .kind = .literal_integer, .quantifier = .required },
8716 .{ .kind = .literal_integer, .quantifier = .required },
8717 .{ .kind = .literal_integer, .quantifier = .required },
8718 },
8719 },
8720 .{
8721 .name = "OpCreatePipeFromPipeStorage",
8722 .opcode = 324,
8723 .operands = &.{
8724 .{ .kind = .id_result_type, .quantifier = .required },
8725 .{ .kind = .id_result, .quantifier = .required },
8726 .{ .kind = .id_ref, .quantifier = .required },
8727 },
8728 },
8729 .{
8730 .name = "OpGetKernelLocalSizeForSubgroupCount",
8731 .opcode = 325,
8732 .operands = &.{
8733 .{ .kind = .id_result_type, .quantifier = .required },
8734 .{ .kind = .id_result, .quantifier = .required },
8735 .{ .kind = .id_ref, .quantifier = .required },
8736 .{ .kind = .id_ref, .quantifier = .required },
8737 .{ .kind = .id_ref, .quantifier = .required },
8738 .{ .kind = .id_ref, .quantifier = .required },
8739 .{ .kind = .id_ref, .quantifier = .required },
8740 },
8741 },
8742 .{
8743 .name = "OpGetKernelMaxNumSubgroups",
8744 .opcode = 326,
8745 .operands = &.{
8746 .{ .kind = .id_result_type, .quantifier = .required },
8747 .{ .kind = .id_result, .quantifier = .required },
8748 .{ .kind = .id_ref, .quantifier = .required },
8749 .{ .kind = .id_ref, .quantifier = .required },
8750 .{ .kind = .id_ref, .quantifier = .required },
8751 .{ .kind = .id_ref, .quantifier = .required },
8752 },
8753 },
8754 .{
8755 .name = "OpTypeNamedBarrier",
8756 .opcode = 327,
8757 .operands = &.{
8758 .{ .kind = .id_result, .quantifier = .required },
8759 },
8760 },
8761 .{
8762 .name = "OpNamedBarrierInitialize",
8763 .opcode = 328,
8764 .operands = &.{
8765 .{ .kind = .id_result_type, .quantifier = .required },
8766 .{ .kind = .id_result, .quantifier = .required },
8767 .{ .kind = .id_ref, .quantifier = .required },
8768 },
8769 },
8770 .{
8771 .name = "OpMemoryNamedBarrier",
8772 .opcode = 329,
8773 .operands = &.{
8774 .{ .kind = .id_ref, .quantifier = .required },
8775 .{ .kind = .id_scope, .quantifier = .required },
8776 .{ .kind = .id_memory_semantics, .quantifier = .required },
8777 },
8778 },
8779 .{
8780 .name = "OpModuleProcessed",
8781 .opcode = 330,
8782 .operands = &.{
8783 .{ .kind = .literal_string, .quantifier = .required },
8784 },
8785 },
8786 .{
8787 .name = "OpExecutionModeId",
8788 .opcode = 331,
8789 .operands = &.{
8790 .{ .kind = .id_ref, .quantifier = .required },
8791 .{ .kind = .execution_mode, .quantifier = .required },
8792 },
8793 },
8794 .{
8795 .name = "OpDecorateId",
8796 .opcode = 332,
8797 .operands = &.{
8798 .{ .kind = .id_ref, .quantifier = .required },
8799 .{ .kind = .decoration, .quantifier = .required },
8800 },
8801 },
8802 .{
8803 .name = "OpGroupNonUniformElect",
8804 .opcode = 333,
8805 .operands = &.{
8806 .{ .kind = .id_result_type, .quantifier = .required },
8807 .{ .kind = .id_result, .quantifier = .required },
8808 .{ .kind = .id_scope, .quantifier = .required },
8809 },
8810 },
8811 .{
8812 .name = "OpGroupNonUniformAll",
8813 .opcode = 334,
8814 .operands = &.{
8815 .{ .kind = .id_result_type, .quantifier = .required },
8816 .{ .kind = .id_result, .quantifier = .required },
8817 .{ .kind = .id_scope, .quantifier = .required },
8818 .{ .kind = .id_ref, .quantifier = .required },
8819 },
8820 },
8821 .{
8822 .name = "OpGroupNonUniformAny",
8823 .opcode = 335,
8824 .operands = &.{
8825 .{ .kind = .id_result_type, .quantifier = .required },
8826 .{ .kind = .id_result, .quantifier = .required },
8827 .{ .kind = .id_scope, .quantifier = .required },
8828 .{ .kind = .id_ref, .quantifier = .required },
8829 },
8830 },
8831 .{
8832 .name = "OpGroupNonUniformAllEqual",
8833 .opcode = 336,
8834 .operands = &.{
8835 .{ .kind = .id_result_type, .quantifier = .required },
8836 .{ .kind = .id_result, .quantifier = .required },
8837 .{ .kind = .id_scope, .quantifier = .required },
8838 .{ .kind = .id_ref, .quantifier = .required },
8839 },
8840 },
8841 .{
8842 .name = "OpGroupNonUniformBroadcast",
8843 .opcode = 337,
8844 .operands = &.{
8845 .{ .kind = .id_result_type, .quantifier = .required },
8846 .{ .kind = .id_result, .quantifier = .required },
8847 .{ .kind = .id_scope, .quantifier = .required },
8848 .{ .kind = .id_ref, .quantifier = .required },
8849 .{ .kind = .id_ref, .quantifier = .required },
8850 },
8851 },
8852 .{
8853 .name = "OpGroupNonUniformBroadcastFirst",
8854 .opcode = 338,
8855 .operands = &.{
8856 .{ .kind = .id_result_type, .quantifier = .required },
8857 .{ .kind = .id_result, .quantifier = .required },
8858 .{ .kind = .id_scope, .quantifier = .required },
8859 .{ .kind = .id_ref, .quantifier = .required },
8860 },
8861 },
8862 .{
8863 .name = "OpGroupNonUniformBallot",
8864 .opcode = 339,
8865 .operands = &.{
8866 .{ .kind = .id_result_type, .quantifier = .required },
8867 .{ .kind = .id_result, .quantifier = .required },
8868 .{ .kind = .id_scope, .quantifier = .required },
8869 .{ .kind = .id_ref, .quantifier = .required },
8870 },
8871 },
8872 .{
8873 .name = "OpGroupNonUniformInverseBallot",
8874 .opcode = 340,
8875 .operands = &.{
8876 .{ .kind = .id_result_type, .quantifier = .required },
8877 .{ .kind = .id_result, .quantifier = .required },
8878 .{ .kind = .id_scope, .quantifier = .required },
8879 .{ .kind = .id_ref, .quantifier = .required },
8880 },
8881 },
8882 .{
8883 .name = "OpGroupNonUniformBallotBitExtract",
8884 .opcode = 341,
8885 .operands = &.{
8886 .{ .kind = .id_result_type, .quantifier = .required },
8887 .{ .kind = .id_result, .quantifier = .required },
8888 .{ .kind = .id_scope, .quantifier = .required },
8889 .{ .kind = .id_ref, .quantifier = .required },
8890 .{ .kind = .id_ref, .quantifier = .required },
8891 },
8892 },
8893 .{
8894 .name = "OpGroupNonUniformBallotBitCount",
8895 .opcode = 342,
8896 .operands = &.{
8897 .{ .kind = .id_result_type, .quantifier = .required },
8898 .{ .kind = .id_result, .quantifier = .required },
8899 .{ .kind = .id_scope, .quantifier = .required },
8900 .{ .kind = .group_operation, .quantifier = .required },
8901 .{ .kind = .id_ref, .quantifier = .required },
8902 },
8903 },
8904 .{
8905 .name = "OpGroupNonUniformBallotFindLSB",
8906 .opcode = 343,
8907 .operands = &.{
8908 .{ .kind = .id_result_type, .quantifier = .required },
8909 .{ .kind = .id_result, .quantifier = .required },
8910 .{ .kind = .id_scope, .quantifier = .required },
8911 .{ .kind = .id_ref, .quantifier = .required },
8912 },
8913 },
8914 .{
8915 .name = "OpGroupNonUniformBallotFindMSB",
8916 .opcode = 344,
8917 .operands = &.{
8918 .{ .kind = .id_result_type, .quantifier = .required },
8919 .{ .kind = .id_result, .quantifier = .required },
8920 .{ .kind = .id_scope, .quantifier = .required },
8921 .{ .kind = .id_ref, .quantifier = .required },
8922 },
8923 },
8924 .{
8925 .name = "OpGroupNonUniformShuffle",
8926 .opcode = 345,
8927 .operands = &.{
8928 .{ .kind = .id_result_type, .quantifier = .required },
8929 .{ .kind = .id_result, .quantifier = .required },
8930 .{ .kind = .id_scope, .quantifier = .required },
8931 .{ .kind = .id_ref, .quantifier = .required },
8932 .{ .kind = .id_ref, .quantifier = .required },
8933 },
8934 },
8935 .{
8936 .name = "OpGroupNonUniformShuffleXor",
8937 .opcode = 346,
8938 .operands = &.{
8939 .{ .kind = .id_result_type, .quantifier = .required },
8940 .{ .kind = .id_result, .quantifier = .required },
8941 .{ .kind = .id_scope, .quantifier = .required },
8942 .{ .kind = .id_ref, .quantifier = .required },
8943 .{ .kind = .id_ref, .quantifier = .required },
8944 },
8945 },
8946 .{
8947 .name = "OpGroupNonUniformShuffleUp",
8948 .opcode = 347,
8949 .operands = &.{
8950 .{ .kind = .id_result_type, .quantifier = .required },
8951 .{ .kind = .id_result, .quantifier = .required },
8952 .{ .kind = .id_scope, .quantifier = .required },
8953 .{ .kind = .id_ref, .quantifier = .required },
8954 .{ .kind = .id_ref, .quantifier = .required },
8955 },
8956 },
8957 .{
8958 .name = "OpGroupNonUniformShuffleDown",
8959 .opcode = 348,
8960 .operands = &.{
8961 .{ .kind = .id_result_type, .quantifier = .required },
8962 .{ .kind = .id_result, .quantifier = .required },
8963 .{ .kind = .id_scope, .quantifier = .required },
8964 .{ .kind = .id_ref, .quantifier = .required },
8965 .{ .kind = .id_ref, .quantifier = .required },
8966 },
8967 },
8968 .{
8969 .name = "OpGroupNonUniformIAdd",
8970 .opcode = 349,
8971 .operands = &.{
8972 .{ .kind = .id_result_type, .quantifier = .required },
8973 .{ .kind = .id_result, .quantifier = .required },
8974 .{ .kind = .id_scope, .quantifier = .required },
8975 .{ .kind = .group_operation, .quantifier = .required },
8976 .{ .kind = .id_ref, .quantifier = .required },
8977 .{ .kind = .id_ref, .quantifier = .optional },
8978 },
8979 },
8980 .{
8981 .name = "OpGroupNonUniformFAdd",
8982 .opcode = 350,
8983 .operands = &.{
8984 .{ .kind = .id_result_type, .quantifier = .required },
8985 .{ .kind = .id_result, .quantifier = .required },
8986 .{ .kind = .id_scope, .quantifier = .required },
8987 .{ .kind = .group_operation, .quantifier = .required },
8988 .{ .kind = .id_ref, .quantifier = .required },
8989 .{ .kind = .id_ref, .quantifier = .optional },
8990 },
8991 },
8992 .{
8993 .name = "OpGroupNonUniformIMul",
8994 .opcode = 351,
8995 .operands = &.{
8996 .{ .kind = .id_result_type, .quantifier = .required },
8997 .{ .kind = .id_result, .quantifier = .required },
8998 .{ .kind = .id_scope, .quantifier = .required },
8999 .{ .kind = .group_operation, .quantifier = .required },
9000 .{ .kind = .id_ref, .quantifier = .required },
9001 .{ .kind = .id_ref, .quantifier = .optional },
9002 },
9003 },
9004 .{
9005 .name = "OpGroupNonUniformFMul",
9006 .opcode = 352,
9007 .operands = &.{
9008 .{ .kind = .id_result_type, .quantifier = .required },
9009 .{ .kind = .id_result, .quantifier = .required },
9010 .{ .kind = .id_scope, .quantifier = .required },
9011 .{ .kind = .group_operation, .quantifier = .required },
9012 .{ .kind = .id_ref, .quantifier = .required },
9013 .{ .kind = .id_ref, .quantifier = .optional },
9014 },
9015 },
9016 .{
9017 .name = "OpGroupNonUniformSMin",
9018 .opcode = 353,
9019 .operands = &.{
9020 .{ .kind = .id_result_type, .quantifier = .required },
9021 .{ .kind = .id_result, .quantifier = .required },
9022 .{ .kind = .id_scope, .quantifier = .required },
9023 .{ .kind = .group_operation, .quantifier = .required },
9024 .{ .kind = .id_ref, .quantifier = .required },
9025 .{ .kind = .id_ref, .quantifier = .optional },
9026 },
9027 },
9028 .{
9029 .name = "OpGroupNonUniformUMin",
9030 .opcode = 354,
9031 .operands = &.{
9032 .{ .kind = .id_result_type, .quantifier = .required },
9033 .{ .kind = .id_result, .quantifier = .required },
9034 .{ .kind = .id_scope, .quantifier = .required },
9035 .{ .kind = .group_operation, .quantifier = .required },
9036 .{ .kind = .id_ref, .quantifier = .required },
9037 .{ .kind = .id_ref, .quantifier = .optional },
9038 },
9039 },
9040 .{
9041 .name = "OpGroupNonUniformFMin",
9042 .opcode = 355,
9043 .operands = &.{
9044 .{ .kind = .id_result_type, .quantifier = .required },
9045 .{ .kind = .id_result, .quantifier = .required },
9046 .{ .kind = .id_scope, .quantifier = .required },
9047 .{ .kind = .group_operation, .quantifier = .required },
9048 .{ .kind = .id_ref, .quantifier = .required },
9049 .{ .kind = .id_ref, .quantifier = .optional },
9050 },
9051 },
9052 .{
9053 .name = "OpGroupNonUniformSMax",
9054 .opcode = 356,
9055 .operands = &.{
9056 .{ .kind = .id_result_type, .quantifier = .required },
9057 .{ .kind = .id_result, .quantifier = .required },
9058 .{ .kind = .id_scope, .quantifier = .required },
9059 .{ .kind = .group_operation, .quantifier = .required },
9060 .{ .kind = .id_ref, .quantifier = .required },
9061 .{ .kind = .id_ref, .quantifier = .optional },
9062 },
9063 },
9064 .{
9065 .name = "OpGroupNonUniformUMax",
9066 .opcode = 357,
9067 .operands = &.{
9068 .{ .kind = .id_result_type, .quantifier = .required },
9069 .{ .kind = .id_result, .quantifier = .required },
9070 .{ .kind = .id_scope, .quantifier = .required },
9071 .{ .kind = .group_operation, .quantifier = .required },
9072 .{ .kind = .id_ref, .quantifier = .required },
9073 .{ .kind = .id_ref, .quantifier = .optional },
9074 },
9075 },
9076 .{
9077 .name = "OpGroupNonUniformFMax",
9078 .opcode = 358,
9079 .operands = &.{
9080 .{ .kind = .id_result_type, .quantifier = .required },
9081 .{ .kind = .id_result, .quantifier = .required },
9082 .{ .kind = .id_scope, .quantifier = .required },
9083 .{ .kind = .group_operation, .quantifier = .required },
9084 .{ .kind = .id_ref, .quantifier = .required },
9085 .{ .kind = .id_ref, .quantifier = .optional },
9086 },
9087 },
9088 .{
9089 .name = "OpGroupNonUniformBitwiseAnd",
9090 .opcode = 359,
9091 .operands = &.{
9092 .{ .kind = .id_result_type, .quantifier = .required },
9093 .{ .kind = .id_result, .quantifier = .required },
9094 .{ .kind = .id_scope, .quantifier = .required },
9095 .{ .kind = .group_operation, .quantifier = .required },
9096 .{ .kind = .id_ref, .quantifier = .required },
9097 .{ .kind = .id_ref, .quantifier = .optional },
9098 },
9099 },
9100 .{
9101 .name = "OpGroupNonUniformBitwiseOr",
9102 .opcode = 360,
9103 .operands = &.{
9104 .{ .kind = .id_result_type, .quantifier = .required },
9105 .{ .kind = .id_result, .quantifier = .required },
9106 .{ .kind = .id_scope, .quantifier = .required },
9107 .{ .kind = .group_operation, .quantifier = .required },
9108 .{ .kind = .id_ref, .quantifier = .required },
9109 .{ .kind = .id_ref, .quantifier = .optional },
9110 },
9111 },
9112 .{
9113 .name = "OpGroupNonUniformBitwiseXor",
9114 .opcode = 361,
9115 .operands = &.{
9116 .{ .kind = .id_result_type, .quantifier = .required },
9117 .{ .kind = .id_result, .quantifier = .required },
9118 .{ .kind = .id_scope, .quantifier = .required },
9119 .{ .kind = .group_operation, .quantifier = .required },
9120 .{ .kind = .id_ref, .quantifier = .required },
9121 .{ .kind = .id_ref, .quantifier = .optional },
9122 },
9123 },
9124 .{
9125 .name = "OpGroupNonUniformLogicalAnd",
9126 .opcode = 362,
9127 .operands = &.{
9128 .{ .kind = .id_result_type, .quantifier = .required },
9129 .{ .kind = .id_result, .quantifier = .required },
9130 .{ .kind = .id_scope, .quantifier = .required },
9131 .{ .kind = .group_operation, .quantifier = .required },
9132 .{ .kind = .id_ref, .quantifier = .required },
9133 .{ .kind = .id_ref, .quantifier = .optional },
9134 },
9135 },
9136 .{
9137 .name = "OpGroupNonUniformLogicalOr",
9138 .opcode = 363,
9139 .operands = &.{
9140 .{ .kind = .id_result_type, .quantifier = .required },
9141 .{ .kind = .id_result, .quantifier = .required },
9142 .{ .kind = .id_scope, .quantifier = .required },
9143 .{ .kind = .group_operation, .quantifier = .required },
9144 .{ .kind = .id_ref, .quantifier = .required },
9145 .{ .kind = .id_ref, .quantifier = .optional },
9146 },
9147 },
9148 .{
9149 .name = "OpGroupNonUniformLogicalXor",
9150 .opcode = 364,
9151 .operands = &.{
9152 .{ .kind = .id_result_type, .quantifier = .required },
9153 .{ .kind = .id_result, .quantifier = .required },
9154 .{ .kind = .id_scope, .quantifier = .required },
9155 .{ .kind = .group_operation, .quantifier = .required },
9156 .{ .kind = .id_ref, .quantifier = .required },
9157 .{ .kind = .id_ref, .quantifier = .optional },
9158 },
9159 },
9160 .{
9161 .name = "OpGroupNonUniformQuadBroadcast",
9162 .opcode = 365,
9163 .operands = &.{
9164 .{ .kind = .id_result_type, .quantifier = .required },
9165 .{ .kind = .id_result, .quantifier = .required },
9166 .{ .kind = .id_scope, .quantifier = .required },
9167 .{ .kind = .id_ref, .quantifier = .required },
9168 .{ .kind = .id_ref, .quantifier = .required },
9169 },
9170 },
9171 .{
9172 .name = "OpGroupNonUniformQuadSwap",
9173 .opcode = 366,
9174 .operands = &.{
9175 .{ .kind = .id_result_type, .quantifier = .required },
9176 .{ .kind = .id_result, .quantifier = .required },
9177 .{ .kind = .id_scope, .quantifier = .required },
9178 .{ .kind = .id_ref, .quantifier = .required },
9179 .{ .kind = .id_ref, .quantifier = .required },
9180 },
9181 },
9182 .{
9183 .name = "OpCopyLogical",
9184 .opcode = 400,
9185 .operands = &.{
9186 .{ .kind = .id_result_type, .quantifier = .required },
9187 .{ .kind = .id_result, .quantifier = .required },
9188 .{ .kind = .id_ref, .quantifier = .required },
9189 },
9190 },
9191 .{
9192 .name = "OpPtrEqual",
9193 .opcode = 401,
9194 .operands = &.{
9195 .{ .kind = .id_result_type, .quantifier = .required },
9196 .{ .kind = .id_result, .quantifier = .required },
9197 .{ .kind = .id_ref, .quantifier = .required },
9198 .{ .kind = .id_ref, .quantifier = .required },
9199 },
9200 },
9201 .{
9202 .name = "OpPtrNotEqual",
9203 .opcode = 402,
9204 .operands = &.{
9205 .{ .kind = .id_result_type, .quantifier = .required },
9206 .{ .kind = .id_result, .quantifier = .required },
9207 .{ .kind = .id_ref, .quantifier = .required },
9208 .{ .kind = .id_ref, .quantifier = .required },
9209 },
9210 },
9211 .{
9212 .name = "OpPtrDiff",
9213 .opcode = 403,
9214 .operands = &.{
9215 .{ .kind = .id_result_type, .quantifier = .required },
9216 .{ .kind = .id_result, .quantifier = .required },
9217 .{ .kind = .id_ref, .quantifier = .required },
9218 .{ .kind = .id_ref, .quantifier = .required },
9219 },
9220 },
9221 .{
9222 .name = "OpColorAttachmentReadEXT",
9223 .opcode = 4160,
9224 .operands = &.{
9225 .{ .kind = .id_result_type, .quantifier = .required },
9226 .{ .kind = .id_result, .quantifier = .required },
9227 .{ .kind = .id_ref, .quantifier = .required },
9228 .{ .kind = .id_ref, .quantifier = .optional },
9229 },
9230 },
9231 .{
9232 .name = "OpDepthAttachmentReadEXT",
9233 .opcode = 4161,
9234 .operands = &.{
9235 .{ .kind = .id_result_type, .quantifier = .required },
9236 .{ .kind = .id_result, .quantifier = .required },
9237 .{ .kind = .id_ref, .quantifier = .optional },
9238 },
9239 },
9240 .{
9241 .name = "OpStencilAttachmentReadEXT",
9242 .opcode = 4162,
9243 .operands = &.{
9244 .{ .kind = .id_result_type, .quantifier = .required },
9245 .{ .kind = .id_result, .quantifier = .required },
9246 .{ .kind = .id_ref, .quantifier = .optional },
9247 },
9248 },
9249 .{
9250 .name = "OpTypeTensorARM",
9251 .opcode = 4163,
9252 .operands = &.{
9253 .{ .kind = .id_result, .quantifier = .required },
9254 .{ .kind = .id_ref, .quantifier = .required },
9255 .{ .kind = .id_ref, .quantifier = .optional },
9256 .{ .kind = .id_ref, .quantifier = .optional },
9257 },
9258 },
9259 .{
9260 .name = "OpTensorReadARM",
9261 .opcode = 4164,
9262 .operands = &.{
9263 .{ .kind = .id_result_type, .quantifier = .required },
9264 .{ .kind = .id_result, .quantifier = .required },
9265 .{ .kind = .id_ref, .quantifier = .required },
9266 .{ .kind = .id_ref, .quantifier = .required },
9267 .{ .kind = .tensor_operands, .quantifier = .optional },
9268 },
9269 },
9270 .{
9271 .name = "OpTensorWriteARM",
9272 .opcode = 4165,
9273 .operands = &.{
9274 .{ .kind = .id_ref, .quantifier = .required },
9275 .{ .kind = .id_ref, .quantifier = .required },
9276 .{ .kind = .id_ref, .quantifier = .required },
9277 .{ .kind = .tensor_operands, .quantifier = .optional },
9278 },
9279 },
9280 .{
9281 .name = "OpTensorQuerySizeARM",
9282 .opcode = 4166,
9283 .operands = &.{
9284 .{ .kind = .id_result_type, .quantifier = .required },
9285 .{ .kind = .id_result, .quantifier = .required },
9286 .{ .kind = .id_ref, .quantifier = .required },
9287 .{ .kind = .id_ref, .quantifier = .required },
9288 },
9289 },
9290 .{
9291 .name = "OpGraphConstantARM",
9292 .opcode = 4181,
9293 .operands = &.{
9294 .{ .kind = .id_result_type, .quantifier = .required },
9295 .{ .kind = .id_result, .quantifier = .required },
9296 .{ .kind = .literal_integer, .quantifier = .required },
9297 },
9298 },
9299 .{
9300 .name = "OpGraphEntryPointARM",
9301 .opcode = 4182,
9302 .operands = &.{
9303 .{ .kind = .id_ref, .quantifier = .required },
9304 .{ .kind = .literal_string, .quantifier = .required },
9305 .{ .kind = .id_ref, .quantifier = .variadic },
9306 },
9307 },
9308 .{
9309 .name = "OpGraphARM",
9310 .opcode = 4183,
9311 .operands = &.{
9312 .{ .kind = .id_result_type, .quantifier = .required },
9313 .{ .kind = .id_result, .quantifier = .required },
9314 },
9315 },
9316 .{
9317 .name = "OpGraphInputARM",
9318 .opcode = 4184,
9319 .operands = &.{
9320 .{ .kind = .id_result_type, .quantifier = .required },
9321 .{ .kind = .id_result, .quantifier = .required },
9322 .{ .kind = .id_ref, .quantifier = .required },
9323 .{ .kind = .id_ref, .quantifier = .variadic },
9324 },
9325 },
9326 .{
9327 .name = "OpGraphSetOutputARM",
9328 .opcode = 4185,
9329 .operands = &.{
9330 .{ .kind = .id_ref, .quantifier = .required },
9331 .{ .kind = .id_ref, .quantifier = .required },
9332 .{ .kind = .id_ref, .quantifier = .variadic },
9333 },
9334 },
9335 .{
9336 .name = "OpGraphEndARM",
9337 .opcode = 4186,
9338 .operands = &.{},
9339 },
9340 .{
9341 .name = "OpTypeGraphARM",
9342 .opcode = 4190,
9343 .operands = &.{
9344 .{ .kind = .id_result, .quantifier = .required },
9345 .{ .kind = .literal_integer, .quantifier = .required },
9346 .{ .kind = .id_ref, .quantifier = .variadic },
9347 },
9348 },
9349 .{
9350 .name = "OpTerminateInvocation",
9351 .opcode = 4416,
9352 .operands = &.{},
9353 },
9354 .{
9355 .name = "OpTypeUntypedPointerKHR",
9356 .opcode = 4417,
9357 .operands = &.{
9358 .{ .kind = .id_result, .quantifier = .required },
9359 .{ .kind = .storage_class, .quantifier = .required },
9360 },
9361 },
9362 .{
9363 .name = "OpUntypedVariableKHR",
9364 .opcode = 4418,
9365 .operands = &.{
9366 .{ .kind = .id_result_type, .quantifier = .required },
9367 .{ .kind = .id_result, .quantifier = .required },
9368 .{ .kind = .storage_class, .quantifier = .required },
9369 .{ .kind = .id_ref, .quantifier = .optional },
9370 .{ .kind = .id_ref, .quantifier = .optional },
9371 },
9372 },
9373 .{
9374 .name = "OpUntypedAccessChainKHR",
9375 .opcode = 4419,
9376 .operands = &.{
9377 .{ .kind = .id_result_type, .quantifier = .required },
9378 .{ .kind = .id_result, .quantifier = .required },
9379 .{ .kind = .id_ref, .quantifier = .required },
9380 .{ .kind = .id_ref, .quantifier = .required },
9381 .{ .kind = .id_ref, .quantifier = .variadic },
9382 },
9383 },
9384 .{
9385 .name = "OpUntypedInBoundsAccessChainKHR",
9386 .opcode = 4420,
9387 .operands = &.{
9388 .{ .kind = .id_result_type, .quantifier = .required },
9389 .{ .kind = .id_result, .quantifier = .required },
9390 .{ .kind = .id_ref, .quantifier = .required },
9391 .{ .kind = .id_ref, .quantifier = .required },
9392 .{ .kind = .id_ref, .quantifier = .variadic },
9393 },
9394 },
9395 .{
9396 .name = "OpSubgroupBallotKHR",
9397 .opcode = 4421,
9398 .operands = &.{
9399 .{ .kind = .id_result_type, .quantifier = .required },
9400 .{ .kind = .id_result, .quantifier = .required },
9401 .{ .kind = .id_ref, .quantifier = .required },
9402 },
9403 },
9404 .{
9405 .name = "OpSubgroupFirstInvocationKHR",
9406 .opcode = 4422,
9407 .operands = &.{
9408 .{ .kind = .id_result_type, .quantifier = .required },
9409 .{ .kind = .id_result, .quantifier = .required },
9410 .{ .kind = .id_ref, .quantifier = .required },
9411 },
9412 },
9413 .{
9414 .name = "OpUntypedPtrAccessChainKHR",
9415 .opcode = 4423,
9416 .operands = &.{
9417 .{ .kind = .id_result_type, .quantifier = .required },
9418 .{ .kind = .id_result, .quantifier = .required },
9419 .{ .kind = .id_ref, .quantifier = .required },
9420 .{ .kind = .id_ref, .quantifier = .required },
9421 .{ .kind = .id_ref, .quantifier = .required },
9422 .{ .kind = .id_ref, .quantifier = .variadic },
9423 },
9424 },
9425 .{
9426 .name = "OpUntypedInBoundsPtrAccessChainKHR",
9427 .opcode = 4424,
9428 .operands = &.{
9429 .{ .kind = .id_result_type, .quantifier = .required },
9430 .{ .kind = .id_result, .quantifier = .required },
9431 .{ .kind = .id_ref, .quantifier = .required },
9432 .{ .kind = .id_ref, .quantifier = .required },
9433 .{ .kind = .id_ref, .quantifier = .required },
9434 .{ .kind = .id_ref, .quantifier = .variadic },
9435 },
9436 },
9437 .{
9438 .name = "OpUntypedArrayLengthKHR",
9439 .opcode = 4425,
9440 .operands = &.{
9441 .{ .kind = .id_result_type, .quantifier = .required },
9442 .{ .kind = .id_result, .quantifier = .required },
9443 .{ .kind = .id_ref, .quantifier = .required },
9444 .{ .kind = .id_ref, .quantifier = .required },
9445 .{ .kind = .literal_integer, .quantifier = .required },
9446 },
9447 },
9448 .{
9449 .name = "OpUntypedPrefetchKHR",
9450 .opcode = 4426,
9451 .operands = &.{
9452 .{ .kind = .id_ref, .quantifier = .required },
9453 .{ .kind = .id_ref, .quantifier = .required },
9454 .{ .kind = .id_ref, .quantifier = .optional },
9455 .{ .kind = .id_ref, .quantifier = .optional },
9456 .{ .kind = .id_ref, .quantifier = .optional },
9457 },
9458 },
9459 .{
9460 .name = "OpSubgroupAllKHR",
9461 .opcode = 4428,
9462 .operands = &.{
9463 .{ .kind = .id_result_type, .quantifier = .required },
9464 .{ .kind = .id_result, .quantifier = .required },
9465 .{ .kind = .id_ref, .quantifier = .required },
9466 },
9467 },
9468 .{
9469 .name = "OpSubgroupAnyKHR",
9470 .opcode = 4429,
9471 .operands = &.{
9472 .{ .kind = .id_result_type, .quantifier = .required },
9473 .{ .kind = .id_result, .quantifier = .required },
9474 .{ .kind = .id_ref, .quantifier = .required },
9475 },
9476 },
9477 .{
9478 .name = "OpSubgroupAllEqualKHR",
9479 .opcode = 4430,
9480 .operands = &.{
9481 .{ .kind = .id_result_type, .quantifier = .required },
9482 .{ .kind = .id_result, .quantifier = .required },
9483 .{ .kind = .id_ref, .quantifier = .required },
9484 },
9485 },
9486 .{
9487 .name = "OpGroupNonUniformRotateKHR",
9488 .opcode = 4431,
9489 .operands = &.{
9490 .{ .kind = .id_result_type, .quantifier = .required },
9491 .{ .kind = .id_result, .quantifier = .required },
9492 .{ .kind = .id_scope, .quantifier = .required },
9493 .{ .kind = .id_ref, .quantifier = .required },
9494 .{ .kind = .id_ref, .quantifier = .required },
9495 .{ .kind = .id_ref, .quantifier = .optional },
9496 },
9497 },
9498 .{
9499 .name = "OpSubgroupReadInvocationKHR",
9500 .opcode = 4432,
9501 .operands = &.{
9502 .{ .kind = .id_result_type, .quantifier = .required },
9503 .{ .kind = .id_result, .quantifier = .required },
9504 .{ .kind = .id_ref, .quantifier = .required },
9505 .{ .kind = .id_ref, .quantifier = .required },
9506 },
9507 },
9508 .{
9509 .name = "OpExtInstWithForwardRefsKHR",
9510 .opcode = 4433,
9511 .operands = &.{
9512 .{ .kind = .id_result_type, .quantifier = .required },
9513 .{ .kind = .id_result, .quantifier = .required },
9514 .{ .kind = .id_ref, .quantifier = .required },
9515 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
9516 .{ .kind = .id_ref, .quantifier = .variadic },
9517 },
9518 },
9519 .{
9520 .name = "OpTraceRayKHR",
9521 .opcode = 4445,
9522 .operands = &.{
9523 .{ .kind = .id_ref, .quantifier = .required },
9524 .{ .kind = .id_ref, .quantifier = .required },
9525 .{ .kind = .id_ref, .quantifier = .required },
9526 .{ .kind = .id_ref, .quantifier = .required },
9527 .{ .kind = .id_ref, .quantifier = .required },
9528 .{ .kind = .id_ref, .quantifier = .required },
9529 .{ .kind = .id_ref, .quantifier = .required },
9530 .{ .kind = .id_ref, .quantifier = .required },
9531 .{ .kind = .id_ref, .quantifier = .required },
9532 .{ .kind = .id_ref, .quantifier = .required },
9533 .{ .kind = .id_ref, .quantifier = .required },
9534 },
9535 },
9536 .{
9537 .name = "OpExecuteCallableKHR",
9538 .opcode = 4446,
9539 .operands = &.{
9540 .{ .kind = .id_ref, .quantifier = .required },
9541 .{ .kind = .id_ref, .quantifier = .required },
9542 },
9543 },
9544 .{
9545 .name = "OpConvertUToAccelerationStructureKHR",
9546 .opcode = 4447,
9547 .operands = &.{
9548 .{ .kind = .id_result_type, .quantifier = .required },
9549 .{ .kind = .id_result, .quantifier = .required },
9550 .{ .kind = .id_ref, .quantifier = .required },
9551 },
9552 },
9553 .{
9554 .name = "OpIgnoreIntersectionKHR",
9555 .opcode = 4448,
9556 .operands = &.{},
9557 },
9558 .{
9559 .name = "OpTerminateRayKHR",
9560 .opcode = 4449,
9561 .operands = &.{},
9562 },
9563 .{
9564 .name = "OpSDot",
9565 .opcode = 4450,
9566 .operands = &.{
9567 .{ .kind = .id_result_type, .quantifier = .required },
9568 .{ .kind = .id_result, .quantifier = .required },
9569 .{ .kind = .id_ref, .quantifier = .required },
9570 .{ .kind = .id_ref, .quantifier = .required },
9571 .{ .kind = .packed_vector_format, .quantifier = .optional },
9572 },
9573 },
9574 .{
9575 .name = "OpUDot",
9576 .opcode = 4451,
9577 .operands = &.{
9578 .{ .kind = .id_result_type, .quantifier = .required },
9579 .{ .kind = .id_result, .quantifier = .required },
9580 .{ .kind = .id_ref, .quantifier = .required },
9581 .{ .kind = .id_ref, .quantifier = .required },
9582 .{ .kind = .packed_vector_format, .quantifier = .optional },
9583 },
9584 },
9585 .{
9586 .name = "OpSUDot",
9587 .opcode = 4452,
9588 .operands = &.{
9589 .{ .kind = .id_result_type, .quantifier = .required },
9590 .{ .kind = .id_result, .quantifier = .required },
9591 .{ .kind = .id_ref, .quantifier = .required },
9592 .{ .kind = .id_ref, .quantifier = .required },
9593 .{ .kind = .packed_vector_format, .quantifier = .optional },
9594 },
9595 },
9596 .{
9597 .name = "OpSDotAccSat",
9598 .opcode = 4453,
9599 .operands = &.{
9600 .{ .kind = .id_result_type, .quantifier = .required },
9601 .{ .kind = .id_result, .quantifier = .required },
9602 .{ .kind = .id_ref, .quantifier = .required },
9603 .{ .kind = .id_ref, .quantifier = .required },
9604 .{ .kind = .id_ref, .quantifier = .required },
9605 .{ .kind = .packed_vector_format, .quantifier = .optional },
9606 },
9607 },
9608 .{
9609 .name = "OpUDotAccSat",
9610 .opcode = 4454,
9611 .operands = &.{
9612 .{ .kind = .id_result_type, .quantifier = .required },
9613 .{ .kind = .id_result, .quantifier = .required },
9614 .{ .kind = .id_ref, .quantifier = .required },
9615 .{ .kind = .id_ref, .quantifier = .required },
9616 .{ .kind = .id_ref, .quantifier = .required },
9617 .{ .kind = .packed_vector_format, .quantifier = .optional },
9618 },
9619 },
9620 .{
9621 .name = "OpSUDotAccSat",
9622 .opcode = 4455,
9623 .operands = &.{
9624 .{ .kind = .id_result_type, .quantifier = .required },
9625 .{ .kind = .id_result, .quantifier = .required },
9626 .{ .kind = .id_ref, .quantifier = .required },
9627 .{ .kind = .id_ref, .quantifier = .required },
9628 .{ .kind = .id_ref, .quantifier = .required },
9629 .{ .kind = .packed_vector_format, .quantifier = .optional },
9630 },
9631 },
9632 .{
9633 .name = "OpTypeCooperativeMatrixKHR",
9634 .opcode = 4456,
9635 .operands = &.{
9636 .{ .kind = .id_result, .quantifier = .required },
9637 .{ .kind = .id_ref, .quantifier = .required },
9638 .{ .kind = .id_scope, .quantifier = .required },
9639 .{ .kind = .id_ref, .quantifier = .required },
9640 .{ .kind = .id_ref, .quantifier = .required },
9641 .{ .kind = .id_ref, .quantifier = .required },
9642 },
9643 },
9644 .{
9645 .name = "OpCooperativeMatrixLoadKHR",
9646 .opcode = 4457,
9647 .operands = &.{
9648 .{ .kind = .id_result_type, .quantifier = .required },
9649 .{ .kind = .id_result, .quantifier = .required },
9650 .{ .kind = .id_ref, .quantifier = .required },
9651 .{ .kind = .id_ref, .quantifier = .required },
9652 .{ .kind = .id_ref, .quantifier = .optional },
9653 .{ .kind = .memory_access, .quantifier = .optional },
9654 },
9655 },
9656 .{
9657 .name = "OpCooperativeMatrixStoreKHR",
9658 .opcode = 4458,
9659 .operands = &.{
9660 .{ .kind = .id_ref, .quantifier = .required },
9661 .{ .kind = .id_ref, .quantifier = .required },
9662 .{ .kind = .id_ref, .quantifier = .required },
9663 .{ .kind = .id_ref, .quantifier = .optional },
9664 .{ .kind = .memory_access, .quantifier = .optional },
9665 },
9666 },
9667 .{
9668 .name = "OpCooperativeMatrixMulAddKHR",
9669 .opcode = 4459,
9670 .operands = &.{
9671 .{ .kind = .id_result_type, .quantifier = .required },
9672 .{ .kind = .id_result, .quantifier = .required },
9673 .{ .kind = .id_ref, .quantifier = .required },
9674 .{ .kind = .id_ref, .quantifier = .required },
9675 .{ .kind = .id_ref, .quantifier = .required },
9676 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
9677 },
9678 },
9679 .{
9680 .name = "OpCooperativeMatrixLengthKHR",
9681 .opcode = 4460,
9682 .operands = &.{
9683 .{ .kind = .id_result_type, .quantifier = .required },
9684 .{ .kind = .id_result, .quantifier = .required },
9685 .{ .kind = .id_ref, .quantifier = .required },
9686 },
9687 },
9688 .{
9689 .name = "OpConstantCompositeReplicateEXT",
9690 .opcode = 4461,
9691 .operands = &.{
9692 .{ .kind = .id_result_type, .quantifier = .required },
9693 .{ .kind = .id_result, .quantifier = .required },
9694 .{ .kind = .id_ref, .quantifier = .required },
9695 },
9696 },
9697 .{
9698 .name = "OpSpecConstantCompositeReplicateEXT",
9699 .opcode = 4462,
9700 .operands = &.{
9701 .{ .kind = .id_result_type, .quantifier = .required },
9702 .{ .kind = .id_result, .quantifier = .required },
9703 .{ .kind = .id_ref, .quantifier = .required },
9704 },
9705 },
9706 .{
9707 .name = "OpCompositeConstructReplicateEXT",
9708 .opcode = 4463,
9709 .operands = &.{
9710 .{ .kind = .id_result_type, .quantifier = .required },
9711 .{ .kind = .id_result, .quantifier = .required },
9712 .{ .kind = .id_ref, .quantifier = .required },
9713 },
9714 },
9715 .{
9716 .name = "OpTypeRayQueryKHR",
9717 .opcode = 4472,
9718 .operands = &.{
9719 .{ .kind = .id_result, .quantifier = .required },
9720 },
9721 },
9722 .{
9723 .name = "OpRayQueryInitializeKHR",
9724 .opcode = 4473,
9725 .operands = &.{
9726 .{ .kind = .id_ref, .quantifier = .required },
9727 .{ .kind = .id_ref, .quantifier = .required },
9728 .{ .kind = .id_ref, .quantifier = .required },
9729 .{ .kind = .id_ref, .quantifier = .required },
9730 .{ .kind = .id_ref, .quantifier = .required },
9731 .{ .kind = .id_ref, .quantifier = .required },
9732 .{ .kind = .id_ref, .quantifier = .required },
9733 .{ .kind = .id_ref, .quantifier = .required },
9734 },
9735 },
9736 .{
9737 .name = "OpRayQueryTerminateKHR",
9738 .opcode = 4474,
9739 .operands = &.{
9740 .{ .kind = .id_ref, .quantifier = .required },
9741 },
9742 },
9743 .{
9744 .name = "OpRayQueryGenerateIntersectionKHR",
9745 .opcode = 4475,
9746 .operands = &.{
9747 .{ .kind = .id_ref, .quantifier = .required },
9748 .{ .kind = .id_ref, .quantifier = .required },
9749 },
9750 },
9751 .{
9752 .name = "OpRayQueryConfirmIntersectionKHR",
9753 .opcode = 4476,
9754 .operands = &.{
9755 .{ .kind = .id_ref, .quantifier = .required },
9756 },
9757 },
9758 .{
9759 .name = "OpRayQueryProceedKHR",
9760 .opcode = 4477,
9761 .operands = &.{
9762 .{ .kind = .id_result_type, .quantifier = .required },
9763 .{ .kind = .id_result, .quantifier = .required },
9764 .{ .kind = .id_ref, .quantifier = .required },
9765 },
9766 },
9767 .{
9768 .name = "OpRayQueryGetIntersectionTypeKHR",
9769 .opcode = 4479,
9770 .operands = &.{
9771 .{ .kind = .id_result_type, .quantifier = .required },
9772 .{ .kind = .id_result, .quantifier = .required },
9773 .{ .kind = .id_ref, .quantifier = .required },
9774 .{ .kind = .id_ref, .quantifier = .required },
9775 },
9776 },
9777 .{
9778 .name = "OpImageSampleWeightedQCOM",
9779 .opcode = 4480,
9780 .operands = &.{
9781 .{ .kind = .id_result_type, .quantifier = .required },
9782 .{ .kind = .id_result, .quantifier = .required },
9783 .{ .kind = .id_ref, .quantifier = .required },
9784 .{ .kind = .id_ref, .quantifier = .required },
9785 .{ .kind = .id_ref, .quantifier = .required },
9786 },
9787 },
9788 .{
9789 .name = "OpImageBoxFilterQCOM",
9790 .opcode = 4481,
9791 .operands = &.{
9792 .{ .kind = .id_result_type, .quantifier = .required },
9793 .{ .kind = .id_result, .quantifier = .required },
9794 .{ .kind = .id_ref, .quantifier = .required },
9795 .{ .kind = .id_ref, .quantifier = .required },
9796 .{ .kind = .id_ref, .quantifier = .required },
9797 },
9798 },
9799 .{
9800 .name = "OpImageBlockMatchSSDQCOM",
9801 .opcode = 4482,
9802 .operands = &.{
9803 .{ .kind = .id_result_type, .quantifier = .required },
9804 .{ .kind = .id_result, .quantifier = .required },
9805 .{ .kind = .id_ref, .quantifier = .required },
9806 .{ .kind = .id_ref, .quantifier = .required },
9807 .{ .kind = .id_ref, .quantifier = .required },
9808 .{ .kind = .id_ref, .quantifier = .required },
9809 .{ .kind = .id_ref, .quantifier = .required },
9810 },
9811 },
9812 .{
9813 .name = "OpImageBlockMatchSADQCOM",
9814 .opcode = 4483,
9815 .operands = &.{
9816 .{ .kind = .id_result_type, .quantifier = .required },
9817 .{ .kind = .id_result, .quantifier = .required },
9818 .{ .kind = .id_ref, .quantifier = .required },
9819 .{ .kind = .id_ref, .quantifier = .required },
9820 .{ .kind = .id_ref, .quantifier = .required },
9821 .{ .kind = .id_ref, .quantifier = .required },
9822 .{ .kind = .id_ref, .quantifier = .required },
9823 },
9824 },
9825 .{
9826 .name = "OpImageBlockMatchWindowSSDQCOM",
9827 .opcode = 4500,
9828 .operands = &.{
9829 .{ .kind = .id_result_type, .quantifier = .required },
9830 .{ .kind = .id_result, .quantifier = .required },
9831 .{ .kind = .id_ref, .quantifier = .required },
9832 .{ .kind = .id_ref, .quantifier = .required },
9833 .{ .kind = .id_ref, .quantifier = .required },
9834 .{ .kind = .id_ref, .quantifier = .required },
9835 .{ .kind = .id_ref, .quantifier = .required },
9836 },
9837 },
9838 .{
9839 .name = "OpImageBlockMatchWindowSADQCOM",
9840 .opcode = 4501,
9841 .operands = &.{
9842 .{ .kind = .id_result_type, .quantifier = .required },
9843 .{ .kind = .id_result, .quantifier = .required },
9844 .{ .kind = .id_ref, .quantifier = .required },
9845 .{ .kind = .id_ref, .quantifier = .required },
9846 .{ .kind = .id_ref, .quantifier = .required },
9847 .{ .kind = .id_ref, .quantifier = .required },
9848 .{ .kind = .id_ref, .quantifier = .required },
9849 },
9850 },
9851 .{
9852 .name = "OpImageBlockMatchGatherSSDQCOM",
9853 .opcode = 4502,
9854 .operands = &.{
9855 .{ .kind = .id_result_type, .quantifier = .required },
9856 .{ .kind = .id_result, .quantifier = .required },
9857 .{ .kind = .id_ref, .quantifier = .required },
9858 .{ .kind = .id_ref, .quantifier = .required },
9859 .{ .kind = .id_ref, .quantifier = .required },
9860 .{ .kind = .id_ref, .quantifier = .required },
9861 .{ .kind = .id_ref, .quantifier = .required },
9862 },
9863 },
9864 .{
9865 .name = "OpImageBlockMatchGatherSADQCOM",
9866 .opcode = 4503,
9867 .operands = &.{
9868 .{ .kind = .id_result_type, .quantifier = .required },
9869 .{ .kind = .id_result, .quantifier = .required },
9870 .{ .kind = .id_ref, .quantifier = .required },
9871 .{ .kind = .id_ref, .quantifier = .required },
9872 .{ .kind = .id_ref, .quantifier = .required },
9873 .{ .kind = .id_ref, .quantifier = .required },
9874 .{ .kind = .id_ref, .quantifier = .required },
9875 },
9876 },
9877 .{
9878 .name = "OpGroupIAddNonUniformAMD",
9879 .opcode = 5000,
9880 .operands = &.{
9881 .{ .kind = .id_result_type, .quantifier = .required },
9882 .{ .kind = .id_result, .quantifier = .required },
9883 .{ .kind = .id_scope, .quantifier = .required },
9884 .{ .kind = .group_operation, .quantifier = .required },
9885 .{ .kind = .id_ref, .quantifier = .required },
9886 },
9887 },
9888 .{
9889 .name = "OpGroupFAddNonUniformAMD",
9890 .opcode = 5001,
9891 .operands = &.{
9892 .{ .kind = .id_result_type, .quantifier = .required },
9893 .{ .kind = .id_result, .quantifier = .required },
9894 .{ .kind = .id_scope, .quantifier = .required },
9895 .{ .kind = .group_operation, .quantifier = .required },
9896 .{ .kind = .id_ref, .quantifier = .required },
9897 },
9898 },
9899 .{
9900 .name = "OpGroupFMinNonUniformAMD",
9901 .opcode = 5002,
9902 .operands = &.{
9903 .{ .kind = .id_result_type, .quantifier = .required },
9904 .{ .kind = .id_result, .quantifier = .required },
9905 .{ .kind = .id_scope, .quantifier = .required },
9906 .{ .kind = .group_operation, .quantifier = .required },
9907 .{ .kind = .id_ref, .quantifier = .required },
9908 },
9909 },
9910 .{
9911 .name = "OpGroupUMinNonUniformAMD",
9912 .opcode = 5003,
9913 .operands = &.{
9914 .{ .kind = .id_result_type, .quantifier = .required },
9915 .{ .kind = .id_result, .quantifier = .required },
9916 .{ .kind = .id_scope, .quantifier = .required },
9917 .{ .kind = .group_operation, .quantifier = .required },
9918 .{ .kind = .id_ref, .quantifier = .required },
9919 },
9920 },
9921 .{
9922 .name = "OpGroupSMinNonUniformAMD",
9923 .opcode = 5004,
9924 .operands = &.{
9925 .{ .kind = .id_result_type, .quantifier = .required },
9926 .{ .kind = .id_result, .quantifier = .required },
9927 .{ .kind = .id_scope, .quantifier = .required },
9928 .{ .kind = .group_operation, .quantifier = .required },
9929 .{ .kind = .id_ref, .quantifier = .required },
9930 },
9931 },
9932 .{
9933 .name = "OpGroupFMaxNonUniformAMD",
9934 .opcode = 5005,
9935 .operands = &.{
9936 .{ .kind = .id_result_type, .quantifier = .required },
9937 .{ .kind = .id_result, .quantifier = .required },
9938 .{ .kind = .id_scope, .quantifier = .required },
9939 .{ .kind = .group_operation, .quantifier = .required },
9940 .{ .kind = .id_ref, .quantifier = .required },
9941 },
9942 },
9943 .{
9944 .name = "OpGroupUMaxNonUniformAMD",
9945 .opcode = 5006,
9946 .operands = &.{
9947 .{ .kind = .id_result_type, .quantifier = .required },
9948 .{ .kind = .id_result, .quantifier = .required },
9949 .{ .kind = .id_scope, .quantifier = .required },
9950 .{ .kind = .group_operation, .quantifier = .required },
9951 .{ .kind = .id_ref, .quantifier = .required },
9952 },
9953 },
9954 .{
9955 .name = "OpGroupSMaxNonUniformAMD",
9956 .opcode = 5007,
9957 .operands = &.{
9958 .{ .kind = .id_result_type, .quantifier = .required },
9959 .{ .kind = .id_result, .quantifier = .required },
9960 .{ .kind = .id_scope, .quantifier = .required },
9961 .{ .kind = .group_operation, .quantifier = .required },
9962 .{ .kind = .id_ref, .quantifier = .required },
9963 },
9964 },
9965 .{
9966 .name = "OpFragmentMaskFetchAMD",
9967 .opcode = 5011,
9968 .operands = &.{
9969 .{ .kind = .id_result_type, .quantifier = .required },
9970 .{ .kind = .id_result, .quantifier = .required },
9971 .{ .kind = .id_ref, .quantifier = .required },
9972 .{ .kind = .id_ref, .quantifier = .required },
9973 },
9974 },
9975 .{
9976 .name = "OpFragmentFetchAMD",
9977 .opcode = 5012,
9978 .operands = &.{
9979 .{ .kind = .id_result_type, .quantifier = .required },
9980 .{ .kind = .id_result, .quantifier = .required },
9981 .{ .kind = .id_ref, .quantifier = .required },
9982 .{ .kind = .id_ref, .quantifier = .required },
9983 .{ .kind = .id_ref, .quantifier = .required },
9984 },
9985 },
9986 .{
9987 .name = "OpReadClockKHR",
9988 .opcode = 5056,
9989 .operands = &.{
9990 .{ .kind = .id_result_type, .quantifier = .required },
9991 .{ .kind = .id_result, .quantifier = .required },
9992 .{ .kind = .id_scope, .quantifier = .required },
9993 },
9994 },
9995 .{
9996 .name = "OpAllocateNodePayloadsAMDX",
9997 .opcode = 5074,
9998 .operands = &.{
9999 .{ .kind = .id_result_type, .quantifier = .required },
10000 .{ .kind = .id_result, .quantifier = .required },
10001 .{ .kind = .id_scope, .quantifier = .required },
10002 .{ .kind = .id_ref, .quantifier = .required },
10003 .{ .kind = .id_ref, .quantifier = .required },
10004 },
10005 },
10006 .{
10007 .name = "OpEnqueueNodePayloadsAMDX",
10008 .opcode = 5075,
10009 .operands = &.{
10010 .{ .kind = .id_ref, .quantifier = .required },
10011 },
10012 },
10013 .{
10014 .name = "OpTypeNodePayloadArrayAMDX",
10015 .opcode = 5076,
10016 .operands = &.{
10017 .{ .kind = .id_result, .quantifier = .required },
10018 .{ .kind = .id_ref, .quantifier = .required },
10019 },
10020 },
10021 .{
10022 .name = "OpFinishWritingNodePayloadAMDX",
10023 .opcode = 5078,
10024 .operands = &.{
10025 .{ .kind = .id_result_type, .quantifier = .required },
10026 .{ .kind = .id_result, .quantifier = .required },
10027 .{ .kind = .id_ref, .quantifier = .required },
10028 },
10029 },
10030 .{
10031 .name = "OpNodePayloadArrayLengthAMDX",
10032 .opcode = 5090,
10033 .operands = &.{
10034 .{ .kind = .id_result_type, .quantifier = .required },
10035 .{ .kind = .id_result, .quantifier = .required },
10036 .{ .kind = .id_ref, .quantifier = .required },
10037 },
10038 },
10039 .{
10040 .name = "OpIsNodePayloadValidAMDX",
10041 .opcode = 5101,
10042 .operands = &.{
10043 .{ .kind = .id_result_type, .quantifier = .required },
10044 .{ .kind = .id_result, .quantifier = .required },
10045 .{ .kind = .id_ref, .quantifier = .required },
10046 .{ .kind = .id_ref, .quantifier = .required },
10047 },
10048 },
10049 .{
10050 .name = "OpConstantStringAMDX",
10051 .opcode = 5103,
10052 .operands = &.{
10053 .{ .kind = .id_result, .quantifier = .required },
10054 .{ .kind = .literal_string, .quantifier = .required },
10055 },
10056 },
10057 .{
10058 .name = "OpSpecConstantStringAMDX",
10059 .opcode = 5104,
10060 .operands = &.{
10061 .{ .kind = .id_result, .quantifier = .required },
10062 .{ .kind = .literal_string, .quantifier = .required },
10063 },
10064 },
10065 .{
10066 .name = "OpGroupNonUniformQuadAllKHR",
10067 .opcode = 5110,
10068 .operands = &.{
10069 .{ .kind = .id_result_type, .quantifier = .required },
10070 .{ .kind = .id_result, .quantifier = .required },
10071 .{ .kind = .id_ref, .quantifier = .required },
10072 },
10073 },
10074 .{
10075 .name = "OpGroupNonUniformQuadAnyKHR",
10076 .opcode = 5111,
10077 .operands = &.{
10078 .{ .kind = .id_result_type, .quantifier = .required },
10079 .{ .kind = .id_result, .quantifier = .required },
10080 .{ .kind = .id_ref, .quantifier = .required },
10081 },
10082 },
10083 .{
10084 .name = "OpHitObjectRecordHitMotionNV",
10085 .opcode = 5249,
10086 .operands = &.{
10087 .{ .kind = .id_ref, .quantifier = .required },
10088 .{ .kind = .id_ref, .quantifier = .required },
10089 .{ .kind = .id_ref, .quantifier = .required },
10090 .{ .kind = .id_ref, .quantifier = .required },
10091 .{ .kind = .id_ref, .quantifier = .required },
10092 .{ .kind = .id_ref, .quantifier = .required },
10093 .{ .kind = .id_ref, .quantifier = .required },
10094 .{ .kind = .id_ref, .quantifier = .required },
10095 .{ .kind = .id_ref, .quantifier = .required },
10096 .{ .kind = .id_ref, .quantifier = .required },
10097 .{ .kind = .id_ref, .quantifier = .required },
10098 .{ .kind = .id_ref, .quantifier = .required },
10099 .{ .kind = .id_ref, .quantifier = .required },
10100 .{ .kind = .id_ref, .quantifier = .required },
10101 },
10102 },
10103 .{
10104 .name = "OpHitObjectRecordHitWithIndexMotionNV",
10105 .opcode = 5250,
10106 .operands = &.{
10107 .{ .kind = .id_ref, .quantifier = .required },
10108 .{ .kind = .id_ref, .quantifier = .required },
10109 .{ .kind = .id_ref, .quantifier = .required },
10110 .{ .kind = .id_ref, .quantifier = .required },
10111 .{ .kind = .id_ref, .quantifier = .required },
10112 .{ .kind = .id_ref, .quantifier = .required },
10113 .{ .kind = .id_ref, .quantifier = .required },
10114 .{ .kind = .id_ref, .quantifier = .required },
10115 .{ .kind = .id_ref, .quantifier = .required },
10116 .{ .kind = .id_ref, .quantifier = .required },
10117 .{ .kind = .id_ref, .quantifier = .required },
10118 .{ .kind = .id_ref, .quantifier = .required },
10119 .{ .kind = .id_ref, .quantifier = .required },
10120 },
10121 },
10122 .{
10123 .name = "OpHitObjectRecordMissMotionNV",
10124 .opcode = 5251,
10125 .operands = &.{
10126 .{ .kind = .id_ref, .quantifier = .required },
10127 .{ .kind = .id_ref, .quantifier = .required },
10128 .{ .kind = .id_ref, .quantifier = .required },
10129 .{ .kind = .id_ref, .quantifier = .required },
10130 .{ .kind = .id_ref, .quantifier = .required },
10131 .{ .kind = .id_ref, .quantifier = .required },
10132 .{ .kind = .id_ref, .quantifier = .required },
10133 },
10134 },
10135 .{
10136 .name = "OpHitObjectGetWorldToObjectNV",
10137 .opcode = 5252,
10138 .operands = &.{
10139 .{ .kind = .id_result_type, .quantifier = .required },
10140 .{ .kind = .id_result, .quantifier = .required },
10141 .{ .kind = .id_ref, .quantifier = .required },
10142 },
10143 },
10144 .{
10145 .name = "OpHitObjectGetObjectToWorldNV",
10146 .opcode = 5253,
10147 .operands = &.{
10148 .{ .kind = .id_result_type, .quantifier = .required },
10149 .{ .kind = .id_result, .quantifier = .required },
10150 .{ .kind = .id_ref, .quantifier = .required },
10151 },
10152 },
10153 .{
10154 .name = "OpHitObjectGetObjectRayDirectionNV",
10155 .opcode = 5254,
10156 .operands = &.{
10157 .{ .kind = .id_result_type, .quantifier = .required },
10158 .{ .kind = .id_result, .quantifier = .required },
10159 .{ .kind = .id_ref, .quantifier = .required },
10160 },
10161 },
10162 .{
10163 .name = "OpHitObjectGetObjectRayOriginNV",
10164 .opcode = 5255,
10165 .operands = &.{
10166 .{ .kind = .id_result_type, .quantifier = .required },
10167 .{ .kind = .id_result, .quantifier = .required },
10168 .{ .kind = .id_ref, .quantifier = .required },
10169 },
10170 },
10171 .{
10172 .name = "OpHitObjectTraceRayMotionNV",
10173 .opcode = 5256,
10174 .operands = &.{
10175 .{ .kind = .id_ref, .quantifier = .required },
10176 .{ .kind = .id_ref, .quantifier = .required },
10177 .{ .kind = .id_ref, .quantifier = .required },
10178 .{ .kind = .id_ref, .quantifier = .required },
10179 .{ .kind = .id_ref, .quantifier = .required },
10180 .{ .kind = .id_ref, .quantifier = .required },
10181 .{ .kind = .id_ref, .quantifier = .required },
10182 .{ .kind = .id_ref, .quantifier = .required },
10183 .{ .kind = .id_ref, .quantifier = .required },
10184 .{ .kind = .id_ref, .quantifier = .required },
10185 .{ .kind = .id_ref, .quantifier = .required },
10186 .{ .kind = .id_ref, .quantifier = .required },
10187 .{ .kind = .id_ref, .quantifier = .required },
10188 },
10189 },
10190 .{
10191 .name = "OpHitObjectGetShaderRecordBufferHandleNV",
10192 .opcode = 5257,
10193 .operands = &.{
10194 .{ .kind = .id_result_type, .quantifier = .required },
10195 .{ .kind = .id_result, .quantifier = .required },
10196 .{ .kind = .id_ref, .quantifier = .required },
10197 },
10198 },
10199 .{
10200 .name = "OpHitObjectGetShaderBindingTableRecordIndexNV",
10201 .opcode = 5258,
10202 .operands = &.{
10203 .{ .kind = .id_result_type, .quantifier = .required },
10204 .{ .kind = .id_result, .quantifier = .required },
10205 .{ .kind = .id_ref, .quantifier = .required },
10206 },
10207 },
10208 .{
10209 .name = "OpHitObjectRecordEmptyNV",
10210 .opcode = 5259,
10211 .operands = &.{
10212 .{ .kind = .id_ref, .quantifier = .required },
10213 },
10214 },
10215 .{
10216 .name = "OpHitObjectTraceRayNV",
10217 .opcode = 5260,
10218 .operands = &.{
10219 .{ .kind = .id_ref, .quantifier = .required },
10220 .{ .kind = .id_ref, .quantifier = .required },
10221 .{ .kind = .id_ref, .quantifier = .required },
10222 .{ .kind = .id_ref, .quantifier = .required },
10223 .{ .kind = .id_ref, .quantifier = .required },
10224 .{ .kind = .id_ref, .quantifier = .required },
10225 .{ .kind = .id_ref, .quantifier = .required },
10226 .{ .kind = .id_ref, .quantifier = .required },
10227 .{ .kind = .id_ref, .quantifier = .required },
10228 .{ .kind = .id_ref, .quantifier = .required },
10229 .{ .kind = .id_ref, .quantifier = .required },
10230 .{ .kind = .id_ref, .quantifier = .required },
10231 },
10232 },
10233 .{
10234 .name = "OpHitObjectRecordHitNV",
10235 .opcode = 5261,
10236 .operands = &.{
10237 .{ .kind = .id_ref, .quantifier = .required },
10238 .{ .kind = .id_ref, .quantifier = .required },
10239 .{ .kind = .id_ref, .quantifier = .required },
10240 .{ .kind = .id_ref, .quantifier = .required },
10241 .{ .kind = .id_ref, .quantifier = .required },
10242 .{ .kind = .id_ref, .quantifier = .required },
10243 .{ .kind = .id_ref, .quantifier = .required },
10244 .{ .kind = .id_ref, .quantifier = .required },
10245 .{ .kind = .id_ref, .quantifier = .required },
10246 .{ .kind = .id_ref, .quantifier = .required },
10247 .{ .kind = .id_ref, .quantifier = .required },
10248 .{ .kind = .id_ref, .quantifier = .required },
10249 .{ .kind = .id_ref, .quantifier = .required },
10250 },
10251 },
10252 .{
10253 .name = "OpHitObjectRecordHitWithIndexNV",
10254 .opcode = 5262,
10255 .operands = &.{
10256 .{ .kind = .id_ref, .quantifier = .required },
10257 .{ .kind = .id_ref, .quantifier = .required },
10258 .{ .kind = .id_ref, .quantifier = .required },
10259 .{ .kind = .id_ref, .quantifier = .required },
10260 .{ .kind = .id_ref, .quantifier = .required },
10261 .{ .kind = .id_ref, .quantifier = .required },
10262 .{ .kind = .id_ref, .quantifier = .required },
10263 .{ .kind = .id_ref, .quantifier = .required },
10264 .{ .kind = .id_ref, .quantifier = .required },
10265 .{ .kind = .id_ref, .quantifier = .required },
10266 .{ .kind = .id_ref, .quantifier = .required },
10267 .{ .kind = .id_ref, .quantifier = .required },
10268 },
10269 },
10270 .{
10271 .name = "OpHitObjectRecordMissNV",
10272 .opcode = 5263,
10273 .operands = &.{
10274 .{ .kind = .id_ref, .quantifier = .required },
10275 .{ .kind = .id_ref, .quantifier = .required },
10276 .{ .kind = .id_ref, .quantifier = .required },
10277 .{ .kind = .id_ref, .quantifier = .required },
10278 .{ .kind = .id_ref, .quantifier = .required },
10279 .{ .kind = .id_ref, .quantifier = .required },
10280 },
10281 },
10282 .{
10283 .name = "OpHitObjectExecuteShaderNV",
10284 .opcode = 5264,
10285 .operands = &.{
10286 .{ .kind = .id_ref, .quantifier = .required },
10287 .{ .kind = .id_ref, .quantifier = .required },
10288 },
10289 },
10290 .{
10291 .name = "OpHitObjectGetCurrentTimeNV",
10292 .opcode = 5265,
10293 .operands = &.{
10294 .{ .kind = .id_result_type, .quantifier = .required },
10295 .{ .kind = .id_result, .quantifier = .required },
10296 .{ .kind = .id_ref, .quantifier = .required },
10297 },
10298 },
10299 .{
10300 .name = "OpHitObjectGetAttributesNV",
10301 .opcode = 5266,
10302 .operands = &.{
10303 .{ .kind = .id_ref, .quantifier = .required },
10304 .{ .kind = .id_ref, .quantifier = .required },
10305 },
10306 },
10307 .{
10308 .name = "OpHitObjectGetHitKindNV",
10309 .opcode = 5267,
10310 .operands = &.{
10311 .{ .kind = .id_result_type, .quantifier = .required },
10312 .{ .kind = .id_result, .quantifier = .required },
10313 .{ .kind = .id_ref, .quantifier = .required },
10314 },
10315 },
10316 .{
10317 .name = "OpHitObjectGetPrimitiveIndexNV",
10318 .opcode = 5268,
10319 .operands = &.{
10320 .{ .kind = .id_result_type, .quantifier = .required },
10321 .{ .kind = .id_result, .quantifier = .required },
10322 .{ .kind = .id_ref, .quantifier = .required },
10323 },
10324 },
10325 .{
10326 .name = "OpHitObjectGetGeometryIndexNV",
10327 .opcode = 5269,
10328 .operands = &.{
10329 .{ .kind = .id_result_type, .quantifier = .required },
10330 .{ .kind = .id_result, .quantifier = .required },
10331 .{ .kind = .id_ref, .quantifier = .required },
10332 },
10333 },
10334 .{
10335 .name = "OpHitObjectGetInstanceIdNV",
10336 .opcode = 5270,
10337 .operands = &.{
10338 .{ .kind = .id_result_type, .quantifier = .required },
10339 .{ .kind = .id_result, .quantifier = .required },
10340 .{ .kind = .id_ref, .quantifier = .required },
10341 },
10342 },
10343 .{
10344 .name = "OpHitObjectGetInstanceCustomIndexNV",
10345 .opcode = 5271,
10346 .operands = &.{
10347 .{ .kind = .id_result_type, .quantifier = .required },
10348 .{ .kind = .id_result, .quantifier = .required },
10349 .{ .kind = .id_ref, .quantifier = .required },
10350 },
10351 },
10352 .{
10353 .name = "OpHitObjectGetWorldRayDirectionNV",
10354 .opcode = 5272,
10355 .operands = &.{
10356 .{ .kind = .id_result_type, .quantifier = .required },
10357 .{ .kind = .id_result, .quantifier = .required },
10358 .{ .kind = .id_ref, .quantifier = .required },
10359 },
10360 },
10361 .{
10362 .name = "OpHitObjectGetWorldRayOriginNV",
10363 .opcode = 5273,
10364 .operands = &.{
10365 .{ .kind = .id_result_type, .quantifier = .required },
10366 .{ .kind = .id_result, .quantifier = .required },
10367 .{ .kind = .id_ref, .quantifier = .required },
10368 },
10369 },
10370 .{
10371 .name = "OpHitObjectGetRayTMaxNV",
10372 .opcode = 5274,
10373 .operands = &.{
10374 .{ .kind = .id_result_type, .quantifier = .required },
10375 .{ .kind = .id_result, .quantifier = .required },
10376 .{ .kind = .id_ref, .quantifier = .required },
10377 },
10378 },
10379 .{
10380 .name = "OpHitObjectGetRayTMinNV",
10381 .opcode = 5275,
10382 .operands = &.{
10383 .{ .kind = .id_result_type, .quantifier = .required },
10384 .{ .kind = .id_result, .quantifier = .required },
10385 .{ .kind = .id_ref, .quantifier = .required },
10386 },
10387 },
10388 .{
10389 .name = "OpHitObjectIsEmptyNV",
10390 .opcode = 5276,
10391 .operands = &.{
10392 .{ .kind = .id_result_type, .quantifier = .required },
10393 .{ .kind = .id_result, .quantifier = .required },
10394 .{ .kind = .id_ref, .quantifier = .required },
10395 },
10396 },
10397 .{
10398 .name = "OpHitObjectIsHitNV",
10399 .opcode = 5277,
10400 .operands = &.{
10401 .{ .kind = .id_result_type, .quantifier = .required },
10402 .{ .kind = .id_result, .quantifier = .required },
10403 .{ .kind = .id_ref, .quantifier = .required },
10404 },
10405 },
10406 .{
10407 .name = "OpHitObjectIsMissNV",
10408 .opcode = 5278,
10409 .operands = &.{
10410 .{ .kind = .id_result_type, .quantifier = .required },
10411 .{ .kind = .id_result, .quantifier = .required },
10412 .{ .kind = .id_ref, .quantifier = .required },
10413 },
10414 },
10415 .{
10416 .name = "OpReorderThreadWithHitObjectNV",
10417 .opcode = 5279,
10418 .operands = &.{
10419 .{ .kind = .id_ref, .quantifier = .required },
10420 .{ .kind = .id_ref, .quantifier = .optional },
10421 .{ .kind = .id_ref, .quantifier = .optional },
10422 },
10423 },
10424 .{
10425 .name = "OpReorderThreadWithHintNV",
10426 .opcode = 5280,
10427 .operands = &.{
10428 .{ .kind = .id_ref, .quantifier = .required },
10429 .{ .kind = .id_ref, .quantifier = .required },
10430 },
10431 },
10432 .{
10433 .name = "OpTypeHitObjectNV",
10434 .opcode = 5281,
10435 .operands = &.{
10436 .{ .kind = .id_result, .quantifier = .required },
10437 },
10438 },
10439 .{
10440 .name = "OpImageSampleFootprintNV",
10441 .opcode = 5283,
10442 .operands = &.{
10443 .{ .kind = .id_result_type, .quantifier = .required },
10444 .{ .kind = .id_result, .quantifier = .required },
10445 .{ .kind = .id_ref, .quantifier = .required },
10446 .{ .kind = .id_ref, .quantifier = .required },
10447 .{ .kind = .id_ref, .quantifier = .required },
10448 .{ .kind = .id_ref, .quantifier = .required },
10449 .{ .kind = .image_operands, .quantifier = .optional },
10450 },
10451 },
10452 .{
10453 .name = "OpTypeCooperativeVectorNV",
10454 .opcode = 5288,
10455 .operands = &.{
10456 .{ .kind = .id_result, .quantifier = .required },
10457 .{ .kind = .id_ref, .quantifier = .required },
10458 .{ .kind = .id_ref, .quantifier = .required },
10459 },
10460 },
10461 .{
10462 .name = "OpCooperativeVectorMatrixMulNV",
10463 .opcode = 5289,
10464 .operands = &.{
10465 .{ .kind = .id_result_type, .quantifier = .required },
10466 .{ .kind = .id_result, .quantifier = .required },
10467 .{ .kind = .id_ref, .quantifier = .required },
10468 .{ .kind = .id_ref, .quantifier = .required },
10469 .{ .kind = .id_ref, .quantifier = .required },
10470 .{ .kind = .id_ref, .quantifier = .required },
10471 .{ .kind = .id_ref, .quantifier = .required },
10472 .{ .kind = .id_ref, .quantifier = .required },
10473 .{ .kind = .id_ref, .quantifier = .required },
10474 .{ .kind = .id_ref, .quantifier = .required },
10475 .{ .kind = .id_ref, .quantifier = .required },
10476 .{ .kind = .id_ref, .quantifier = .optional },
10477 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10478 },
10479 },
10480 .{
10481 .name = "OpCooperativeVectorOuterProductAccumulateNV",
10482 .opcode = 5290,
10483 .operands = &.{
10484 .{ .kind = .id_ref, .quantifier = .required },
10485 .{ .kind = .id_ref, .quantifier = .required },
10486 .{ .kind = .id_ref, .quantifier = .required },
10487 .{ .kind = .id_ref, .quantifier = .required },
10488 .{ .kind = .id_ref, .quantifier = .required },
10489 .{ .kind = .id_ref, .quantifier = .required },
10490 .{ .kind = .id_ref, .quantifier = .optional },
10491 },
10492 },
10493 .{
10494 .name = "OpCooperativeVectorReduceSumAccumulateNV",
10495 .opcode = 5291,
10496 .operands = &.{
10497 .{ .kind = .id_ref, .quantifier = .required },
10498 .{ .kind = .id_ref, .quantifier = .required },
10499 .{ .kind = .id_ref, .quantifier = .required },
10500 },
10501 },
10502 .{
10503 .name = "OpCooperativeVectorMatrixMulAddNV",
10504 .opcode = 5292,
10505 .operands = &.{
10506 .{ .kind = .id_result_type, .quantifier = .required },
10507 .{ .kind = .id_result, .quantifier = .required },
10508 .{ .kind = .id_ref, .quantifier = .required },
10509 .{ .kind = .id_ref, .quantifier = .required },
10510 .{ .kind = .id_ref, .quantifier = .required },
10511 .{ .kind = .id_ref, .quantifier = .required },
10512 .{ .kind = .id_ref, .quantifier = .required },
10513 .{ .kind = .id_ref, .quantifier = .required },
10514 .{ .kind = .id_ref, .quantifier = .required },
10515 .{ .kind = .id_ref, .quantifier = .required },
10516 .{ .kind = .id_ref, .quantifier = .required },
10517 .{ .kind = .id_ref, .quantifier = .required },
10518 .{ .kind = .id_ref, .quantifier = .required },
10519 .{ .kind = .id_ref, .quantifier = .required },
10520 .{ .kind = .id_ref, .quantifier = .optional },
10521 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10522 },
10523 },
10524 .{
10525 .name = "OpCooperativeMatrixConvertNV",
10526 .opcode = 5293,
10527 .operands = &.{
10528 .{ .kind = .id_result_type, .quantifier = .required },
10529 .{ .kind = .id_result, .quantifier = .required },
10530 .{ .kind = .id_ref, .quantifier = .required },
10531 },
10532 },
10533 .{
10534 .name = "OpEmitMeshTasksEXT",
10535 .opcode = 5294,
10536 .operands = &.{
10537 .{ .kind = .id_ref, .quantifier = .required },
10538 .{ .kind = .id_ref, .quantifier = .required },
10539 .{ .kind = .id_ref, .quantifier = .required },
10540 .{ .kind = .id_ref, .quantifier = .optional },
10541 },
10542 },
10543 .{
10544 .name = "OpSetMeshOutputsEXT",
10545 .opcode = 5295,
10546 .operands = &.{
10547 .{ .kind = .id_ref, .quantifier = .required },
10548 .{ .kind = .id_ref, .quantifier = .required },
10549 },
10550 },
10551 .{
10552 .name = "OpGroupNonUniformPartitionNV",
10553 .opcode = 5296,
10554 .operands = &.{
10555 .{ .kind = .id_result_type, .quantifier = .required },
10556 .{ .kind = .id_result, .quantifier = .required },
10557 .{ .kind = .id_ref, .quantifier = .required },
10558 },
10559 },
10560 .{
10561 .name = "OpWritePackedPrimitiveIndices4x8NV",
10562 .opcode = 5299,
10563 .operands = &.{
10564 .{ .kind = .id_ref, .quantifier = .required },
10565 .{ .kind = .id_ref, .quantifier = .required },
10566 },
10567 },
10568 .{
10569 .name = "OpFetchMicroTriangleVertexPositionNV",
10570 .opcode = 5300,
10571 .operands = &.{
10572 .{ .kind = .id_result_type, .quantifier = .required },
10573 .{ .kind = .id_result, .quantifier = .required },
10574 .{ .kind = .id_ref, .quantifier = .required },
10575 .{ .kind = .id_ref, .quantifier = .required },
10576 .{ .kind = .id_ref, .quantifier = .required },
10577 .{ .kind = .id_ref, .quantifier = .required },
10578 .{ .kind = .id_ref, .quantifier = .required },
10579 },
10580 },
10581 .{
10582 .name = "OpFetchMicroTriangleVertexBarycentricNV",
10583 .opcode = 5301,
10584 .operands = &.{
10585 .{ .kind = .id_result_type, .quantifier = .required },
10586 .{ .kind = .id_result, .quantifier = .required },
10587 .{ .kind = .id_ref, .quantifier = .required },
10588 .{ .kind = .id_ref, .quantifier = .required },
10589 .{ .kind = .id_ref, .quantifier = .required },
10590 .{ .kind = .id_ref, .quantifier = .required },
10591 .{ .kind = .id_ref, .quantifier = .required },
10592 },
10593 },
10594 .{
10595 .name = "OpCooperativeVectorLoadNV",
10596 .opcode = 5302,
10597 .operands = &.{
10598 .{ .kind = .id_result_type, .quantifier = .required },
10599 .{ .kind = .id_result, .quantifier = .required },
10600 .{ .kind = .id_ref, .quantifier = .required },
10601 .{ .kind = .id_ref, .quantifier = .required },
10602 .{ .kind = .memory_access, .quantifier = .optional },
10603 },
10604 },
10605 .{
10606 .name = "OpCooperativeVectorStoreNV",
10607 .opcode = 5303,
10608 .operands = &.{
10609 .{ .kind = .id_ref, .quantifier = .required },
10610 .{ .kind = .id_ref, .quantifier = .required },
10611 .{ .kind = .id_ref, .quantifier = .required },
10612 .{ .kind = .memory_access, .quantifier = .optional },
10613 },
10614 },
10615 .{
10616 .name = "OpReportIntersectionKHR",
10617 .opcode = 5334,
10618 .operands = &.{
10619 .{ .kind = .id_result_type, .quantifier = .required },
10620 .{ .kind = .id_result, .quantifier = .required },
10621 .{ .kind = .id_ref, .quantifier = .required },
10622 .{ .kind = .id_ref, .quantifier = .required },
10623 },
10624 },
10625 .{
10626 .name = "OpIgnoreIntersectionNV",
10627 .opcode = 5335,
10628 .operands = &.{},
10629 },
10630 .{
10631 .name = "OpTerminateRayNV",
10632 .opcode = 5336,
10633 .operands = &.{},
10634 },
10635 .{
10636 .name = "OpTraceNV",
10637 .opcode = 5337,
10638 .operands = &.{
10639 .{ .kind = .id_ref, .quantifier = .required },
10640 .{ .kind = .id_ref, .quantifier = .required },
10641 .{ .kind = .id_ref, .quantifier = .required },
10642 .{ .kind = .id_ref, .quantifier = .required },
10643 .{ .kind = .id_ref, .quantifier = .required },
10644 .{ .kind = .id_ref, .quantifier = .required },
10645 .{ .kind = .id_ref, .quantifier = .required },
10646 .{ .kind = .id_ref, .quantifier = .required },
10647 .{ .kind = .id_ref, .quantifier = .required },
10648 .{ .kind = .id_ref, .quantifier = .required },
10649 .{ .kind = .id_ref, .quantifier = .required },
10650 },
10651 },
10652 .{
10653 .name = "OpTraceMotionNV",
10654 .opcode = 5338,
10655 .operands = &.{
10656 .{ .kind = .id_ref, .quantifier = .required },
10657 .{ .kind = .id_ref, .quantifier = .required },
10658 .{ .kind = .id_ref, .quantifier = .required },
10659 .{ .kind = .id_ref, .quantifier = .required },
10660 .{ .kind = .id_ref, .quantifier = .required },
10661 .{ .kind = .id_ref, .quantifier = .required },
10662 .{ .kind = .id_ref, .quantifier = .required },
10663 .{ .kind = .id_ref, .quantifier = .required },
10664 .{ .kind = .id_ref, .quantifier = .required },
10665 .{ .kind = .id_ref, .quantifier = .required },
10666 .{ .kind = .id_ref, .quantifier = .required },
10667 .{ .kind = .id_ref, .quantifier = .required },
10668 },
10669 },
10670 .{
10671 .name = "OpTraceRayMotionNV",
10672 .opcode = 5339,
10673 .operands = &.{
10674 .{ .kind = .id_ref, .quantifier = .required },
10675 .{ .kind = .id_ref, .quantifier = .required },
10676 .{ .kind = .id_ref, .quantifier = .required },
10677 .{ .kind = .id_ref, .quantifier = .required },
10678 .{ .kind = .id_ref, .quantifier = .required },
10679 .{ .kind = .id_ref, .quantifier = .required },
10680 .{ .kind = .id_ref, .quantifier = .required },
10681 .{ .kind = .id_ref, .quantifier = .required },
10682 .{ .kind = .id_ref, .quantifier = .required },
10683 .{ .kind = .id_ref, .quantifier = .required },
10684 .{ .kind = .id_ref, .quantifier = .required },
10685 .{ .kind = .id_ref, .quantifier = .required },
10686 },
10687 },
10688 .{
10689 .name = "OpRayQueryGetIntersectionTriangleVertexPositionsKHR",
10690 .opcode = 5340,
10691 .operands = &.{
10692 .{ .kind = .id_result_type, .quantifier = .required },
10693 .{ .kind = .id_result, .quantifier = .required },
10694 .{ .kind = .id_ref, .quantifier = .required },
10695 .{ .kind = .id_ref, .quantifier = .required },
10696 },
10697 },
10698 .{
10699 .name = "OpTypeAccelerationStructureKHR",
10700 .opcode = 5341,
10701 .operands = &.{
10702 .{ .kind = .id_result, .quantifier = .required },
10703 },
10704 },
10705 .{
10706 .name = "OpExecuteCallableNV",
10707 .opcode = 5344,
10708 .operands = &.{
10709 .{ .kind = .id_ref, .quantifier = .required },
10710 .{ .kind = .id_ref, .quantifier = .required },
10711 },
10712 },
10713 .{
10714 .name = "OpRayQueryGetClusterIdNV",
10715 .opcode = 5345,
10716 .operands = &.{
10717 .{ .kind = .id_result_type, .quantifier = .required },
10718 .{ .kind = .id_result, .quantifier = .required },
10719 .{ .kind = .id_ref, .quantifier = .required },
10720 .{ .kind = .id_ref, .quantifier = .required },
10721 },
10722 },
10723 .{
10724 .name = "OpHitObjectGetClusterIdNV",
10725 .opcode = 5346,
10726 .operands = &.{
10727 .{ .kind = .id_result_type, .quantifier = .required },
10728 .{ .kind = .id_result, .quantifier = .required },
10729 .{ .kind = .id_ref, .quantifier = .required },
10730 },
10731 },
10732 .{
10733 .name = "OpTypeCooperativeMatrixNV",
10734 .opcode = 5358,
10735 .operands = &.{
10736 .{ .kind = .id_result, .quantifier = .required },
10737 .{ .kind = .id_ref, .quantifier = .required },
10738 .{ .kind = .id_scope, .quantifier = .required },
10739 .{ .kind = .id_ref, .quantifier = .required },
10740 .{ .kind = .id_ref, .quantifier = .required },
10741 },
10742 },
10743 .{
10744 .name = "OpCooperativeMatrixLoadNV",
10745 .opcode = 5359,
10746 .operands = &.{
10747 .{ .kind = .id_result_type, .quantifier = .required },
10748 .{ .kind = .id_result, .quantifier = .required },
10749 .{ .kind = .id_ref, .quantifier = .required },
10750 .{ .kind = .id_ref, .quantifier = .required },
10751 .{ .kind = .id_ref, .quantifier = .required },
10752 .{ .kind = .memory_access, .quantifier = .optional },
10753 },
10754 },
10755 .{
10756 .name = "OpCooperativeMatrixStoreNV",
10757 .opcode = 5360,
10758 .operands = &.{
10759 .{ .kind = .id_ref, .quantifier = .required },
10760 .{ .kind = .id_ref, .quantifier = .required },
10761 .{ .kind = .id_ref, .quantifier = .required },
10762 .{ .kind = .id_ref, .quantifier = .required },
10763 .{ .kind = .memory_access, .quantifier = .optional },
10764 },
10765 },
10766 .{
10767 .name = "OpCooperativeMatrixMulAddNV",
10768 .opcode = 5361,
10769 .operands = &.{
10770 .{ .kind = .id_result_type, .quantifier = .required },
10771 .{ .kind = .id_result, .quantifier = .required },
10772 .{ .kind = .id_ref, .quantifier = .required },
10773 .{ .kind = .id_ref, .quantifier = .required },
10774 .{ .kind = .id_ref, .quantifier = .required },
10775 },
10776 },
10777 .{
10778 .name = "OpCooperativeMatrixLengthNV",
10779 .opcode = 5362,
10780 .operands = &.{
10781 .{ .kind = .id_result_type, .quantifier = .required },
10782 .{ .kind = .id_result, .quantifier = .required },
10783 .{ .kind = .id_ref, .quantifier = .required },
10784 },
10785 },
10786 .{
10787 .name = "OpBeginInvocationInterlockEXT",
10788 .opcode = 5364,
10789 .operands = &.{},
10790 },
10791 .{
10792 .name = "OpEndInvocationInterlockEXT",
10793 .opcode = 5365,
10794 .operands = &.{},
10795 },
10796 .{
10797 .name = "OpCooperativeMatrixReduceNV",
10798 .opcode = 5366,
10799 .operands = &.{
10800 .{ .kind = .id_result_type, .quantifier = .required },
10801 .{ .kind = .id_result, .quantifier = .required },
10802 .{ .kind = .id_ref, .quantifier = .required },
10803 .{ .kind = .cooperative_matrix_reduce, .quantifier = .required },
10804 .{ .kind = .id_ref, .quantifier = .required },
10805 },
10806 },
10807 .{
10808 .name = "OpCooperativeMatrixLoadTensorNV",
10809 .opcode = 5367,
10810 .operands = &.{
10811 .{ .kind = .id_result_type, .quantifier = .required },
10812 .{ .kind = .id_result, .quantifier = .required },
10813 .{ .kind = .id_ref, .quantifier = .required },
10814 .{ .kind = .id_ref, .quantifier = .required },
10815 .{ .kind = .id_ref, .quantifier = .required },
10816 .{ .kind = .memory_access, .quantifier = .required },
10817 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10818 },
10819 },
10820 .{
10821 .name = "OpCooperativeMatrixStoreTensorNV",
10822 .opcode = 5368,
10823 .operands = &.{
10824 .{ .kind = .id_ref, .quantifier = .required },
10825 .{ .kind = .id_ref, .quantifier = .required },
10826 .{ .kind = .id_ref, .quantifier = .required },
10827 .{ .kind = .memory_access, .quantifier = .required },
10828 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10829 },
10830 },
10831 .{
10832 .name = "OpCooperativeMatrixPerElementOpNV",
10833 .opcode = 5369,
10834 .operands = &.{
10835 .{ .kind = .id_result_type, .quantifier = .required },
10836 .{ .kind = .id_result, .quantifier = .required },
10837 .{ .kind = .id_ref, .quantifier = .required },
10838 .{ .kind = .id_ref, .quantifier = .required },
10839 .{ .kind = .id_ref, .quantifier = .variadic },
10840 },
10841 },
10842 .{
10843 .name = "OpTypeTensorLayoutNV",
10844 .opcode = 5370,
10845 .operands = &.{
10846 .{ .kind = .id_result, .quantifier = .required },
10847 .{ .kind = .id_ref, .quantifier = .required },
10848 .{ .kind = .id_ref, .quantifier = .required },
10849 },
10850 },
10851 .{
10852 .name = "OpTypeTensorViewNV",
10853 .opcode = 5371,
10854 .operands = &.{
10855 .{ .kind = .id_result, .quantifier = .required },
10856 .{ .kind = .id_ref, .quantifier = .required },
10857 .{ .kind = .id_ref, .quantifier = .required },
10858 .{ .kind = .id_ref, .quantifier = .variadic },
10859 },
10860 },
10861 .{
10862 .name = "OpCreateTensorLayoutNV",
10863 .opcode = 5372,
10864 .operands = &.{
10865 .{ .kind = .id_result_type, .quantifier = .required },
10866 .{ .kind = .id_result, .quantifier = .required },
10867 },
10868 },
10869 .{
10870 .name = "OpTensorLayoutSetDimensionNV",
10871 .opcode = 5373,
10872 .operands = &.{
10873 .{ .kind = .id_result_type, .quantifier = .required },
10874 .{ .kind = .id_result, .quantifier = .required },
10875 .{ .kind = .id_ref, .quantifier = .required },
10876 .{ .kind = .id_ref, .quantifier = .variadic },
10877 },
10878 },
10879 .{
10880 .name = "OpTensorLayoutSetStrideNV",
10881 .opcode = 5374,
10882 .operands = &.{
10883 .{ .kind = .id_result_type, .quantifier = .required },
10884 .{ .kind = .id_result, .quantifier = .required },
10885 .{ .kind = .id_ref, .quantifier = .required },
10886 .{ .kind = .id_ref, .quantifier = .variadic },
10887 },
10888 },
10889 .{
10890 .name = "OpTensorLayoutSliceNV",
10891 .opcode = 5375,
10892 .operands = &.{
10893 .{ .kind = .id_result_type, .quantifier = .required },
10894 .{ .kind = .id_result, .quantifier = .required },
10895 .{ .kind = .id_ref, .quantifier = .required },
10896 .{ .kind = .id_ref, .quantifier = .variadic },
10897 },
10898 },
10899 .{
10900 .name = "OpTensorLayoutSetClampValueNV",
10901 .opcode = 5376,
10902 .operands = &.{
10903 .{ .kind = .id_result_type, .quantifier = .required },
10904 .{ .kind = .id_result, .quantifier = .required },
10905 .{ .kind = .id_ref, .quantifier = .required },
10906 .{ .kind = .id_ref, .quantifier = .required },
10907 },
10908 },
10909 .{
10910 .name = "OpCreateTensorViewNV",
10911 .opcode = 5377,
10912 .operands = &.{
10913 .{ .kind = .id_result_type, .quantifier = .required },
10914 .{ .kind = .id_result, .quantifier = .required },
10915 },
10916 },
10917 .{
10918 .name = "OpTensorViewSetDimensionNV",
10919 .opcode = 5378,
10920 .operands = &.{
10921 .{ .kind = .id_result_type, .quantifier = .required },
10922 .{ .kind = .id_result, .quantifier = .required },
10923 .{ .kind = .id_ref, .quantifier = .required },
10924 .{ .kind = .id_ref, .quantifier = .variadic },
10925 },
10926 },
10927 .{
10928 .name = "OpTensorViewSetStrideNV",
10929 .opcode = 5379,
10930 .operands = &.{
10931 .{ .kind = .id_result_type, .quantifier = .required },
10932 .{ .kind = .id_result, .quantifier = .required },
10933 .{ .kind = .id_ref, .quantifier = .required },
10934 .{ .kind = .id_ref, .quantifier = .variadic },
10935 },
10936 },
10937 .{
10938 .name = "OpDemoteToHelperInvocation",
10939 .opcode = 5380,
10940 .operands = &.{},
10941 },
10942 .{
10943 .name = "OpIsHelperInvocationEXT",
10944 .opcode = 5381,
10945 .operands = &.{
10946 .{ .kind = .id_result_type, .quantifier = .required },
10947 .{ .kind = .id_result, .quantifier = .required },
10948 },
10949 },
10950 .{
10951 .name = "OpTensorViewSetClipNV",
10952 .opcode = 5382,
10953 .operands = &.{
10954 .{ .kind = .id_result_type, .quantifier = .required },
10955 .{ .kind = .id_result, .quantifier = .required },
10956 .{ .kind = .id_ref, .quantifier = .required },
10957 .{ .kind = .id_ref, .quantifier = .required },
10958 .{ .kind = .id_ref, .quantifier = .required },
10959 .{ .kind = .id_ref, .quantifier = .required },
10960 .{ .kind = .id_ref, .quantifier = .required },
10961 },
10962 },
10963 .{
10964 .name = "OpTensorLayoutSetBlockSizeNV",
10965 .opcode = 5384,
10966 .operands = &.{
10967 .{ .kind = .id_result_type, .quantifier = .required },
10968 .{ .kind = .id_result, .quantifier = .required },
10969 .{ .kind = .id_ref, .quantifier = .required },
10970 .{ .kind = .id_ref, .quantifier = .variadic },
10971 },
10972 },
10973 .{
10974 .name = "OpCooperativeMatrixTransposeNV",
10975 .opcode = 5390,
10976 .operands = &.{
10977 .{ .kind = .id_result_type, .quantifier = .required },
10978 .{ .kind = .id_result, .quantifier = .required },
10979 .{ .kind = .id_ref, .quantifier = .required },
10980 },
10981 },
10982 .{
10983 .name = "OpConvertUToImageNV",
10984 .opcode = 5391,
10985 .operands = &.{
10986 .{ .kind = .id_result_type, .quantifier = .required },
10987 .{ .kind = .id_result, .quantifier = .required },
10988 .{ .kind = .id_ref, .quantifier = .required },
10989 },
10990 },
10991 .{
10992 .name = "OpConvertUToSamplerNV",
10993 .opcode = 5392,
10994 .operands = &.{
10995 .{ .kind = .id_result_type, .quantifier = .required },
10996 .{ .kind = .id_result, .quantifier = .required },
10997 .{ .kind = .id_ref, .quantifier = .required },
10998 },
10999 },
11000 .{
11001 .name = "OpConvertImageToUNV",
11002 .opcode = 5393,
11003 .operands = &.{
11004 .{ .kind = .id_result_type, .quantifier = .required },
11005 .{ .kind = .id_result, .quantifier = .required },
11006 .{ .kind = .id_ref, .quantifier = .required },
11007 },
11008 },
11009 .{
11010 .name = "OpConvertSamplerToUNV",
11011 .opcode = 5394,
11012 .operands = &.{
11013 .{ .kind = .id_result_type, .quantifier = .required },
11014 .{ .kind = .id_result, .quantifier = .required },
11015 .{ .kind = .id_ref, .quantifier = .required },
11016 },
11017 },
11018 .{
11019 .name = "OpConvertUToSampledImageNV",
11020 .opcode = 5395,
11021 .operands = &.{
11022 .{ .kind = .id_result_type, .quantifier = .required },
11023 .{ .kind = .id_result, .quantifier = .required },
11024 .{ .kind = .id_ref, .quantifier = .required },
11025 },
11026 },
11027 .{
11028 .name = "OpConvertSampledImageToUNV",
11029 .opcode = 5396,
11030 .operands = &.{
11031 .{ .kind = .id_result_type, .quantifier = .required },
11032 .{ .kind = .id_result, .quantifier = .required },
11033 .{ .kind = .id_ref, .quantifier = .required },
11034 },
11035 },
11036 .{
11037 .name = "OpSamplerImageAddressingModeNV",
11038 .opcode = 5397,
11039 .operands = &.{
11040 .{ .kind = .literal_integer, .quantifier = .required },
11041 },
11042 },
11043 .{
11044 .name = "OpRawAccessChainNV",
11045 .opcode = 5398,
11046 .operands = &.{
11047 .{ .kind = .id_result_type, .quantifier = .required },
11048 .{ .kind = .id_result, .quantifier = .required },
11049 .{ .kind = .id_ref, .quantifier = .required },
11050 .{ .kind = .id_ref, .quantifier = .required },
11051 .{ .kind = .id_ref, .quantifier = .required },
11052 .{ .kind = .id_ref, .quantifier = .required },
11053 .{ .kind = .raw_access_chain_operands, .quantifier = .optional },
11054 },
11055 },
11056 .{
11057 .name = "OpRayQueryGetIntersectionSpherePositionNV",
11058 .opcode = 5427,
11059 .operands = &.{
11060 .{ .kind = .id_result_type, .quantifier = .required },
11061 .{ .kind = .id_result, .quantifier = .required },
11062 .{ .kind = .id_ref, .quantifier = .required },
11063 .{ .kind = .id_ref, .quantifier = .required },
11064 },
11065 },
11066 .{
11067 .name = "OpRayQueryGetIntersectionSphereRadiusNV",
11068 .opcode = 5428,
11069 .operands = &.{
11070 .{ .kind = .id_result_type, .quantifier = .required },
11071 .{ .kind = .id_result, .quantifier = .required },
11072 .{ .kind = .id_ref, .quantifier = .required },
11073 .{ .kind = .id_ref, .quantifier = .required },
11074 },
11075 },
11076 .{
11077 .name = "OpRayQueryGetIntersectionLSSPositionsNV",
11078 .opcode = 5429,
11079 .operands = &.{
11080 .{ .kind = .id_result_type, .quantifier = .required },
11081 .{ .kind = .id_result, .quantifier = .required },
11082 .{ .kind = .id_ref, .quantifier = .required },
11083 .{ .kind = .id_ref, .quantifier = .required },
11084 },
11085 },
11086 .{
11087 .name = "OpRayQueryGetIntersectionLSSRadiiNV",
11088 .opcode = 5430,
11089 .operands = &.{
11090 .{ .kind = .id_result_type, .quantifier = .required },
11091 .{ .kind = .id_result, .quantifier = .required },
11092 .{ .kind = .id_ref, .quantifier = .required },
11093 .{ .kind = .id_ref, .quantifier = .required },
11094 },
11095 },
11096 .{
11097 .name = "OpRayQueryGetIntersectionLSSHitValueNV",
11098 .opcode = 5431,
11099 .operands = &.{
11100 .{ .kind = .id_result_type, .quantifier = .required },
11101 .{ .kind = .id_result, .quantifier = .required },
11102 .{ .kind = .id_ref, .quantifier = .required },
11103 .{ .kind = .id_ref, .quantifier = .required },
11104 },
11105 },
11106 .{
11107 .name = "OpHitObjectGetSpherePositionNV",
11108 .opcode = 5432,
11109 .operands = &.{
11110 .{ .kind = .id_result_type, .quantifier = .required },
11111 .{ .kind = .id_result, .quantifier = .required },
11112 .{ .kind = .id_ref, .quantifier = .required },
11113 },
11114 },
11115 .{
11116 .name = "OpHitObjectGetSphereRadiusNV",
11117 .opcode = 5433,
11118 .operands = &.{
11119 .{ .kind = .id_result_type, .quantifier = .required },
11120 .{ .kind = .id_result, .quantifier = .required },
11121 .{ .kind = .id_ref, .quantifier = .required },
11122 },
11123 },
11124 .{
11125 .name = "OpHitObjectGetLSSPositionsNV",
11126 .opcode = 5434,
11127 .operands = &.{
11128 .{ .kind = .id_result_type, .quantifier = .required },
11129 .{ .kind = .id_result, .quantifier = .required },
11130 .{ .kind = .id_ref, .quantifier = .required },
11131 },
11132 },
11133 .{
11134 .name = "OpHitObjectGetLSSRadiiNV",
11135 .opcode = 5435,
11136 .operands = &.{
11137 .{ .kind = .id_result_type, .quantifier = .required },
11138 .{ .kind = .id_result, .quantifier = .required },
11139 .{ .kind = .id_ref, .quantifier = .required },
11140 },
11141 },
11142 .{
11143 .name = "OpHitObjectIsSphereHitNV",
11144 .opcode = 5436,
11145 .operands = &.{
11146 .{ .kind = .id_result_type, .quantifier = .required },
11147 .{ .kind = .id_result, .quantifier = .required },
11148 .{ .kind = .id_ref, .quantifier = .required },
11149 },
11150 },
11151 .{
11152 .name = "OpHitObjectIsLSSHitNV",
11153 .opcode = 5437,
11154 .operands = &.{
11155 .{ .kind = .id_result_type, .quantifier = .required },
11156 .{ .kind = .id_result, .quantifier = .required },
11157 .{ .kind = .id_ref, .quantifier = .required },
11158 },
11159 },
11160 .{
11161 .name = "OpRayQueryIsSphereHitNV",
11162 .opcode = 5438,
11163 .operands = &.{
11164 .{ .kind = .id_result_type, .quantifier = .required },
11165 .{ .kind = .id_result, .quantifier = .required },
11166 .{ .kind = .id_ref, .quantifier = .required },
11167 .{ .kind = .id_ref, .quantifier = .required },
11168 },
11169 },
11170 .{
11171 .name = "OpRayQueryIsLSSHitNV",
11172 .opcode = 5439,
11173 .operands = &.{
11174 .{ .kind = .id_result_type, .quantifier = .required },
11175 .{ .kind = .id_result, .quantifier = .required },
11176 .{ .kind = .id_ref, .quantifier = .required },
11177 .{ .kind = .id_ref, .quantifier = .required },
11178 },
11179 },
11180 .{
11181 .name = "OpSubgroupShuffleINTEL",
11182 .opcode = 5571,
11183 .operands = &.{
11184 .{ .kind = .id_result_type, .quantifier = .required },
11185 .{ .kind = .id_result, .quantifier = .required },
11186 .{ .kind = .id_ref, .quantifier = .required },
11187 .{ .kind = .id_ref, .quantifier = .required },
11188 },
11189 },
11190 .{
11191 .name = "OpSubgroupShuffleDownINTEL",
11192 .opcode = 5572,
11193 .operands = &.{
11194 .{ .kind = .id_result_type, .quantifier = .required },
11195 .{ .kind = .id_result, .quantifier = .required },
11196 .{ .kind = .id_ref, .quantifier = .required },
11197 .{ .kind = .id_ref, .quantifier = .required },
11198 .{ .kind = .id_ref, .quantifier = .required },
11199 },
11200 },
11201 .{
11202 .name = "OpSubgroupShuffleUpINTEL",
11203 .opcode = 5573,
11204 .operands = &.{
11205 .{ .kind = .id_result_type, .quantifier = .required },
11206 .{ .kind = .id_result, .quantifier = .required },
11207 .{ .kind = .id_ref, .quantifier = .required },
11208 .{ .kind = .id_ref, .quantifier = .required },
11209 .{ .kind = .id_ref, .quantifier = .required },
11210 },
11211 },
11212 .{
11213 .name = "OpSubgroupShuffleXorINTEL",
11214 .opcode = 5574,
11215 .operands = &.{
11216 .{ .kind = .id_result_type, .quantifier = .required },
11217 .{ .kind = .id_result, .quantifier = .required },
11218 .{ .kind = .id_ref, .quantifier = .required },
11219 .{ .kind = .id_ref, .quantifier = .required },
11220 },
11221 },
11222 .{
11223 .name = "OpSubgroupBlockReadINTEL",
11224 .opcode = 5575,
11225 .operands = &.{
11226 .{ .kind = .id_result_type, .quantifier = .required },
11227 .{ .kind = .id_result, .quantifier = .required },
11228 .{ .kind = .id_ref, .quantifier = .required },
11229 },
11230 },
11231 .{
11232 .name = "OpSubgroupBlockWriteINTEL",
11233 .opcode = 5576,
11234 .operands = &.{
11235 .{ .kind = .id_ref, .quantifier = .required },
11236 .{ .kind = .id_ref, .quantifier = .required },
11237 },
11238 },
11239 .{
11240 .name = "OpSubgroupImageBlockReadINTEL",
11241 .opcode = 5577,
11242 .operands = &.{
11243 .{ .kind = .id_result_type, .quantifier = .required },
11244 .{ .kind = .id_result, .quantifier = .required },
11245 .{ .kind = .id_ref, .quantifier = .required },
11246 .{ .kind = .id_ref, .quantifier = .required },
11247 },
11248 },
11249 .{
11250 .name = "OpSubgroupImageBlockWriteINTEL",
11251 .opcode = 5578,
11252 .operands = &.{
11253 .{ .kind = .id_ref, .quantifier = .required },
11254 .{ .kind = .id_ref, .quantifier = .required },
11255 .{ .kind = .id_ref, .quantifier = .required },
11256 },
11257 },
11258 .{
11259 .name = "OpSubgroupImageMediaBlockReadINTEL",
11260 .opcode = 5580,
11261 .operands = &.{
11262 .{ .kind = .id_result_type, .quantifier = .required },
11263 .{ .kind = .id_result, .quantifier = .required },
11264 .{ .kind = .id_ref, .quantifier = .required },
11265 .{ .kind = .id_ref, .quantifier = .required },
11266 .{ .kind = .id_ref, .quantifier = .required },
11267 .{ .kind = .id_ref, .quantifier = .required },
11268 },
11269 },
11270 .{
11271 .name = "OpSubgroupImageMediaBlockWriteINTEL",
11272 .opcode = 5581,
11273 .operands = &.{
11274 .{ .kind = .id_ref, .quantifier = .required },
11275 .{ .kind = .id_ref, .quantifier = .required },
11276 .{ .kind = .id_ref, .quantifier = .required },
11277 .{ .kind = .id_ref, .quantifier = .required },
11278 .{ .kind = .id_ref, .quantifier = .required },
11279 },
11280 },
11281 .{
11282 .name = "OpUCountLeadingZerosINTEL",
11283 .opcode = 5585,
11284 .operands = &.{
11285 .{ .kind = .id_result_type, .quantifier = .required },
11286 .{ .kind = .id_result, .quantifier = .required },
11287 .{ .kind = .id_ref, .quantifier = .required },
11288 },
11289 },
11290 .{
11291 .name = "OpUCountTrailingZerosINTEL",
11292 .opcode = 5586,
11293 .operands = &.{
11294 .{ .kind = .id_result_type, .quantifier = .required },
11295 .{ .kind = .id_result, .quantifier = .required },
11296 .{ .kind = .id_ref, .quantifier = .required },
11297 },
11298 },
11299 .{
11300 .name = "OpAbsISubINTEL",
11301 .opcode = 5587,
11302 .operands = &.{
11303 .{ .kind = .id_result_type, .quantifier = .required },
11304 .{ .kind = .id_result, .quantifier = .required },
11305 .{ .kind = .id_ref, .quantifier = .required },
11306 .{ .kind = .id_ref, .quantifier = .required },
11307 },
11308 },
11309 .{
11310 .name = "OpAbsUSubINTEL",
11311 .opcode = 5588,
11312 .operands = &.{
11313 .{ .kind = .id_result_type, .quantifier = .required },
11314 .{ .kind = .id_result, .quantifier = .required },
11315 .{ .kind = .id_ref, .quantifier = .required },
11316 .{ .kind = .id_ref, .quantifier = .required },
11317 },
11318 },
11319 .{
11320 .name = "OpIAddSatINTEL",
11321 .opcode = 5589,
11322 .operands = &.{
11323 .{ .kind = .id_result_type, .quantifier = .required },
11324 .{ .kind = .id_result, .quantifier = .required },
11325 .{ .kind = .id_ref, .quantifier = .required },
11326 .{ .kind = .id_ref, .quantifier = .required },
11327 },
11328 },
11329 .{
11330 .name = "OpUAddSatINTEL",
11331 .opcode = 5590,
11332 .operands = &.{
11333 .{ .kind = .id_result_type, .quantifier = .required },
11334 .{ .kind = .id_result, .quantifier = .required },
11335 .{ .kind = .id_ref, .quantifier = .required },
11336 .{ .kind = .id_ref, .quantifier = .required },
11337 },
11338 },
11339 .{
11340 .name = "OpIAverageINTEL",
11341 .opcode = 5591,
11342 .operands = &.{
11343 .{ .kind = .id_result_type, .quantifier = .required },
11344 .{ .kind = .id_result, .quantifier = .required },
11345 .{ .kind = .id_ref, .quantifier = .required },
11346 .{ .kind = .id_ref, .quantifier = .required },
11347 },
11348 },
11349 .{
11350 .name = "OpUAverageINTEL",
11351 .opcode = 5592,
11352 .operands = &.{
11353 .{ .kind = .id_result_type, .quantifier = .required },
11354 .{ .kind = .id_result, .quantifier = .required },
11355 .{ .kind = .id_ref, .quantifier = .required },
11356 .{ .kind = .id_ref, .quantifier = .required },
11357 },
11358 },
11359 .{
11360 .name = "OpIAverageRoundedINTEL",
11361 .opcode = 5593,
11362 .operands = &.{
11363 .{ .kind = .id_result_type, .quantifier = .required },
11364 .{ .kind = .id_result, .quantifier = .required },
11365 .{ .kind = .id_ref, .quantifier = .required },
11366 .{ .kind = .id_ref, .quantifier = .required },
11367 },
11368 },
11369 .{
11370 .name = "OpUAverageRoundedINTEL",
11371 .opcode = 5594,
11372 .operands = &.{
11373 .{ .kind = .id_result_type, .quantifier = .required },
11374 .{ .kind = .id_result, .quantifier = .required },
11375 .{ .kind = .id_ref, .quantifier = .required },
11376 .{ .kind = .id_ref, .quantifier = .required },
11377 },
11378 },
11379 .{
11380 .name = "OpISubSatINTEL",
11381 .opcode = 5595,
11382 .operands = &.{
11383 .{ .kind = .id_result_type, .quantifier = .required },
11384 .{ .kind = .id_result, .quantifier = .required },
11385 .{ .kind = .id_ref, .quantifier = .required },
11386 .{ .kind = .id_ref, .quantifier = .required },
11387 },
11388 },
11389 .{
11390 .name = "OpUSubSatINTEL",
11391 .opcode = 5596,
11392 .operands = &.{
11393 .{ .kind = .id_result_type, .quantifier = .required },
11394 .{ .kind = .id_result, .quantifier = .required },
11395 .{ .kind = .id_ref, .quantifier = .required },
11396 .{ .kind = .id_ref, .quantifier = .required },
11397 },
11398 },
11399 .{
11400 .name = "OpIMul32x16INTEL",
11401 .opcode = 5597,
11402 .operands = &.{
11403 .{ .kind = .id_result_type, .quantifier = .required },
11404 .{ .kind = .id_result, .quantifier = .required },
11405 .{ .kind = .id_ref, .quantifier = .required },
11406 .{ .kind = .id_ref, .quantifier = .required },
11407 },
11408 },
11409 .{
11410 .name = "OpUMul32x16INTEL",
11411 .opcode = 5598,
11412 .operands = &.{
11413 .{ .kind = .id_result_type, .quantifier = .required },
11414 .{ .kind = .id_result, .quantifier = .required },
11415 .{ .kind = .id_ref, .quantifier = .required },
11416 .{ .kind = .id_ref, .quantifier = .required },
11417 },
11418 },
11419 .{
11420 .name = "OpConstantFunctionPointerINTEL",
11421 .opcode = 5600,
11422 .operands = &.{
11423 .{ .kind = .id_result_type, .quantifier = .required },
11424 .{ .kind = .id_result, .quantifier = .required },
11425 .{ .kind = .id_ref, .quantifier = .required },
11426 },
11427 },
11428 .{
11429 .name = "OpFunctionPointerCallINTEL",
11430 .opcode = 5601,
11431 .operands = &.{
11432 .{ .kind = .id_result_type, .quantifier = .required },
11433 .{ .kind = .id_result, .quantifier = .required },
11434 .{ .kind = .id_ref, .quantifier = .variadic },
11435 },
11436 },
11437 .{
11438 .name = "OpAsmTargetINTEL",
11439 .opcode = 5609,
11440 .operands = &.{
11441 .{ .kind = .id_result, .quantifier = .required },
11442 .{ .kind = .literal_string, .quantifier = .required },
11443 },
11444 },
11445 .{
11446 .name = "OpAsmINTEL",
11447 .opcode = 5610,
11448 .operands = &.{
11449 .{ .kind = .id_result_type, .quantifier = .required },
11450 .{ .kind = .id_result, .quantifier = .required },
11451 .{ .kind = .id_ref, .quantifier = .required },
11452 .{ .kind = .id_ref, .quantifier = .required },
11453 .{ .kind = .literal_string, .quantifier = .required },
11454 .{ .kind = .literal_string, .quantifier = .required },
11455 },
11456 },
11457 .{
11458 .name = "OpAsmCallINTEL",
11459 .opcode = 5611,
11460 .operands = &.{
11461 .{ .kind = .id_result_type, .quantifier = .required },
11462 .{ .kind = .id_result, .quantifier = .required },
11463 .{ .kind = .id_ref, .quantifier = .required },
11464 .{ .kind = .id_ref, .quantifier = .variadic },
11465 },
11466 },
11467 .{
11468 .name = "OpAtomicFMinEXT",
11469 .opcode = 5614,
11470 .operands = &.{
11471 .{ .kind = .id_result_type, .quantifier = .required },
11472 .{ .kind = .id_result, .quantifier = .required },
11473 .{ .kind = .id_ref, .quantifier = .required },
11474 .{ .kind = .id_scope, .quantifier = .required },
11475 .{ .kind = .id_memory_semantics, .quantifier = .required },
11476 .{ .kind = .id_ref, .quantifier = .required },
11477 },
11478 },
11479 .{
11480 .name = "OpAtomicFMaxEXT",
11481 .opcode = 5615,
11482 .operands = &.{
11483 .{ .kind = .id_result_type, .quantifier = .required },
11484 .{ .kind = .id_result, .quantifier = .required },
11485 .{ .kind = .id_ref, .quantifier = .required },
11486 .{ .kind = .id_scope, .quantifier = .required },
11487 .{ .kind = .id_memory_semantics, .quantifier = .required },
11488 .{ .kind = .id_ref, .quantifier = .required },
11489 },
11490 },
11491 .{
11492 .name = "OpAssumeTrueKHR",
11493 .opcode = 5630,
11494 .operands = &.{
11495 .{ .kind = .id_ref, .quantifier = .required },
11496 },
11497 },
11498 .{
11499 .name = "OpExpectKHR",
11500 .opcode = 5631,
11501 .operands = &.{
11502 .{ .kind = .id_result_type, .quantifier = .required },
11503 .{ .kind = .id_result, .quantifier = .required },
11504 .{ .kind = .id_ref, .quantifier = .required },
11505 .{ .kind = .id_ref, .quantifier = .required },
11506 },
11507 },
11508 .{
11509 .name = "OpDecorateString",
11510 .opcode = 5632,
11511 .operands = &.{
11512 .{ .kind = .id_ref, .quantifier = .required },
11513 .{ .kind = .decoration, .quantifier = .required },
11514 },
11515 },
11516 .{
11517 .name = "OpMemberDecorateString",
11518 .opcode = 5633,
11519 .operands = &.{
11520 .{ .kind = .id_ref, .quantifier = .required },
11521 .{ .kind = .literal_integer, .quantifier = .required },
11522 .{ .kind = .decoration, .quantifier = .required },
11523 },
11524 },
11525 .{
11526 .name = "OpVmeImageINTEL",
11527 .opcode = 5699,
11528 .operands = &.{
11529 .{ .kind = .id_result_type, .quantifier = .required },
11530 .{ .kind = .id_result, .quantifier = .required },
11531 .{ .kind = .id_ref, .quantifier = .required },
11532 .{ .kind = .id_ref, .quantifier = .required },
11533 },
11534 },
11535 .{
11536 .name = "OpTypeVmeImageINTEL",
11537 .opcode = 5700,
11538 .operands = &.{
11539 .{ .kind = .id_result, .quantifier = .required },
11540 .{ .kind = .id_ref, .quantifier = .required },
11541 },
11542 },
11543 .{
11544 .name = "OpTypeAvcImePayloadINTEL",
11545 .opcode = 5701,
11546 .operands = &.{
11547 .{ .kind = .id_result, .quantifier = .required },
11548 },
11549 },
11550 .{
11551 .name = "OpTypeAvcRefPayloadINTEL",
11552 .opcode = 5702,
11553 .operands = &.{
11554 .{ .kind = .id_result, .quantifier = .required },
11555 },
11556 },
11557 .{
11558 .name = "OpTypeAvcSicPayloadINTEL",
11559 .opcode = 5703,
11560 .operands = &.{
11561 .{ .kind = .id_result, .quantifier = .required },
11562 },
11563 },
11564 .{
11565 .name = "OpTypeAvcMcePayloadINTEL",
11566 .opcode = 5704,
11567 .operands = &.{
11568 .{ .kind = .id_result, .quantifier = .required },
11569 },
11570 },
11571 .{
11572 .name = "OpTypeAvcMceResultINTEL",
11573 .opcode = 5705,
11574 .operands = &.{
11575 .{ .kind = .id_result, .quantifier = .required },
11576 },
11577 },
11578 .{
11579 .name = "OpTypeAvcImeResultINTEL",
11580 .opcode = 5706,
11581 .operands = &.{
11582 .{ .kind = .id_result, .quantifier = .required },
11583 },
11584 },
11585 .{
11586 .name = "OpTypeAvcImeResultSingleReferenceStreamoutINTEL",
11587 .opcode = 5707,
11588 .operands = &.{
11589 .{ .kind = .id_result, .quantifier = .required },
11590 },
11591 },
11592 .{
11593 .name = "OpTypeAvcImeResultDualReferenceStreamoutINTEL",
11594 .opcode = 5708,
11595 .operands = &.{
11596 .{ .kind = .id_result, .quantifier = .required },
11597 },
11598 },
11599 .{
11600 .name = "OpTypeAvcImeSingleReferenceStreaminINTEL",
11601 .opcode = 5709,
11602 .operands = &.{
11603 .{ .kind = .id_result, .quantifier = .required },
11604 },
11605 },
11606 .{
11607 .name = "OpTypeAvcImeDualReferenceStreaminINTEL",
11608 .opcode = 5710,
11609 .operands = &.{
11610 .{ .kind = .id_result, .quantifier = .required },
11611 },
11612 },
11613 .{
11614 .name = "OpTypeAvcRefResultINTEL",
11615 .opcode = 5711,
11616 .operands = &.{
11617 .{ .kind = .id_result, .quantifier = .required },
11618 },
11619 },
11620 .{
11621 .name = "OpTypeAvcSicResultINTEL",
11622 .opcode = 5712,
11623 .operands = &.{
11624 .{ .kind = .id_result, .quantifier = .required },
11625 },
11626 },
11627 .{
11628 .name = "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL",
11629 .opcode = 5713,
11630 .operands = &.{
11631 .{ .kind = .id_result_type, .quantifier = .required },
11632 .{ .kind = .id_result, .quantifier = .required },
11633 .{ .kind = .id_ref, .quantifier = .required },
11634 .{ .kind = .id_ref, .quantifier = .required },
11635 },
11636 },
11637 .{
11638 .name = "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL",
11639 .opcode = 5714,
11640 .operands = &.{
11641 .{ .kind = .id_result_type, .quantifier = .required },
11642 .{ .kind = .id_result, .quantifier = .required },
11643 .{ .kind = .id_ref, .quantifier = .required },
11644 .{ .kind = .id_ref, .quantifier = .required },
11645 },
11646 },
11647 .{
11648 .name = "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL",
11649 .opcode = 5715,
11650 .operands = &.{
11651 .{ .kind = .id_result_type, .quantifier = .required },
11652 .{ .kind = .id_result, .quantifier = .required },
11653 .{ .kind = .id_ref, .quantifier = .required },
11654 .{ .kind = .id_ref, .quantifier = .required },
11655 },
11656 },
11657 .{
11658 .name = "OpSubgroupAvcMceSetInterShapePenaltyINTEL",
11659 .opcode = 5716,
11660 .operands = &.{
11661 .{ .kind = .id_result_type, .quantifier = .required },
11662 .{ .kind = .id_result, .quantifier = .required },
11663 .{ .kind = .id_ref, .quantifier = .required },
11664 .{ .kind = .id_ref, .quantifier = .required },
11665 },
11666 },
11667 .{
11668 .name = "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL",
11669 .opcode = 5717,
11670 .operands = &.{
11671 .{ .kind = .id_result_type, .quantifier = .required },
11672 .{ .kind = .id_result, .quantifier = .required },
11673 .{ .kind = .id_ref, .quantifier = .required },
11674 .{ .kind = .id_ref, .quantifier = .required },
11675 },
11676 },
11677 .{
11678 .name = "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL",
11679 .opcode = 5718,
11680 .operands = &.{
11681 .{ .kind = .id_result_type, .quantifier = .required },
11682 .{ .kind = .id_result, .quantifier = .required },
11683 .{ .kind = .id_ref, .quantifier = .required },
11684 .{ .kind = .id_ref, .quantifier = .required },
11685 },
11686 },
11687 .{
11688 .name = "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL",
11689 .opcode = 5719,
11690 .operands = &.{
11691 .{ .kind = .id_result_type, .quantifier = .required },
11692 .{ .kind = .id_result, .quantifier = .required },
11693 .{ .kind = .id_ref, .quantifier = .required },
11694 .{ .kind = .id_ref, .quantifier = .required },
11695 },
11696 },
11697 .{
11698 .name = "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL",
11699 .opcode = 5720,
11700 .operands = &.{
11701 .{ .kind = .id_result_type, .quantifier = .required },
11702 .{ .kind = .id_result, .quantifier = .required },
11703 .{ .kind = .id_ref, .quantifier = .required },
11704 .{ .kind = .id_ref, .quantifier = .required },
11705 },
11706 },
11707 .{
11708 .name = "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL",
11709 .opcode = 5721,
11710 .operands = &.{
11711 .{ .kind = .id_result_type, .quantifier = .required },
11712 .{ .kind = .id_result, .quantifier = .required },
11713 },
11714 },
11715 .{
11716 .name = "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL",
11717 .opcode = 5722,
11718 .operands = &.{
11719 .{ .kind = .id_result_type, .quantifier = .required },
11720 .{ .kind = .id_result, .quantifier = .required },
11721 },
11722 },
11723 .{
11724 .name = "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL",
11725 .opcode = 5723,
11726 .operands = &.{
11727 .{ .kind = .id_result_type, .quantifier = .required },
11728 .{ .kind = .id_result, .quantifier = .required },
11729 },
11730 },
11731 .{
11732 .name = "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL",
11733 .opcode = 5724,
11734 .operands = &.{
11735 .{ .kind = .id_result_type, .quantifier = .required },
11736 .{ .kind = .id_result, .quantifier = .required },
11737 .{ .kind = .id_ref, .quantifier = .required },
11738 .{ .kind = .id_ref, .quantifier = .required },
11739 .{ .kind = .id_ref, .quantifier = .required },
11740 .{ .kind = .id_ref, .quantifier = .required },
11741 },
11742 },
11743 .{
11744 .name = "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL",
11745 .opcode = 5725,
11746 .operands = &.{
11747 .{ .kind = .id_result_type, .quantifier = .required },
11748 .{ .kind = .id_result, .quantifier = .required },
11749 .{ .kind = .id_ref, .quantifier = .required },
11750 .{ .kind = .id_ref, .quantifier = .required },
11751 },
11752 },
11753 .{
11754 .name = "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL",
11755 .opcode = 5726,
11756 .operands = &.{
11757 .{ .kind = .id_result_type, .quantifier = .required },
11758 .{ .kind = .id_result, .quantifier = .required },
11759 },
11760 },
11761 .{
11762 .name = "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL",
11763 .opcode = 5727,
11764 .operands = &.{
11765 .{ .kind = .id_result_type, .quantifier = .required },
11766 .{ .kind = .id_result, .quantifier = .required },
11767 },
11768 },
11769 .{
11770 .name = "OpSubgroupAvcMceSetAcOnlyHaarINTEL",
11771 .opcode = 5728,
11772 .operands = &.{
11773 .{ .kind = .id_result_type, .quantifier = .required },
11774 .{ .kind = .id_result, .quantifier = .required },
11775 .{ .kind = .id_ref, .quantifier = .required },
11776 },
11777 },
11778 .{
11779 .name = "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL",
11780 .opcode = 5729,
11781 .operands = &.{
11782 .{ .kind = .id_result_type, .quantifier = .required },
11783 .{ .kind = .id_result, .quantifier = .required },
11784 .{ .kind = .id_ref, .quantifier = .required },
11785 .{ .kind = .id_ref, .quantifier = .required },
11786 },
11787 },
11788 .{
11789 .name = "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL",
11790 .opcode = 5730,
11791 .operands = &.{
11792 .{ .kind = .id_result_type, .quantifier = .required },
11793 .{ .kind = .id_result, .quantifier = .required },
11794 .{ .kind = .id_ref, .quantifier = .required },
11795 .{ .kind = .id_ref, .quantifier = .required },
11796 },
11797 },
11798 .{
11799 .name = "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL",
11800 .opcode = 5731,
11801 .operands = &.{
11802 .{ .kind = .id_result_type, .quantifier = .required },
11803 .{ .kind = .id_result, .quantifier = .required },
11804 .{ .kind = .id_ref, .quantifier = .required },
11805 .{ .kind = .id_ref, .quantifier = .required },
11806 .{ .kind = .id_ref, .quantifier = .required },
11807 },
11808 },
11809 .{
11810 .name = "OpSubgroupAvcMceConvertToImePayloadINTEL",
11811 .opcode = 5732,
11812 .operands = &.{
11813 .{ .kind = .id_result_type, .quantifier = .required },
11814 .{ .kind = .id_result, .quantifier = .required },
11815 .{ .kind = .id_ref, .quantifier = .required },
11816 },
11817 },
11818 .{
11819 .name = "OpSubgroupAvcMceConvertToImeResultINTEL",
11820 .opcode = 5733,
11821 .operands = &.{
11822 .{ .kind = .id_result_type, .quantifier = .required },
11823 .{ .kind = .id_result, .quantifier = .required },
11824 .{ .kind = .id_ref, .quantifier = .required },
11825 },
11826 },
11827 .{
11828 .name = "OpSubgroupAvcMceConvertToRefPayloadINTEL",
11829 .opcode = 5734,
11830 .operands = &.{
11831 .{ .kind = .id_result_type, .quantifier = .required },
11832 .{ .kind = .id_result, .quantifier = .required },
11833 .{ .kind = .id_ref, .quantifier = .required },
11834 },
11835 },
11836 .{
11837 .name = "OpSubgroupAvcMceConvertToRefResultINTEL",
11838 .opcode = 5735,
11839 .operands = &.{
11840 .{ .kind = .id_result_type, .quantifier = .required },
11841 .{ .kind = .id_result, .quantifier = .required },
11842 .{ .kind = .id_ref, .quantifier = .required },
11843 },
11844 },
11845 .{
11846 .name = "OpSubgroupAvcMceConvertToSicPayloadINTEL",
11847 .opcode = 5736,
11848 .operands = &.{
11849 .{ .kind = .id_result_type, .quantifier = .required },
11850 .{ .kind = .id_result, .quantifier = .required },
11851 .{ .kind = .id_ref, .quantifier = .required },
11852 },
11853 },
11854 .{
11855 .name = "OpSubgroupAvcMceConvertToSicResultINTEL",
11856 .opcode = 5737,
11857 .operands = &.{
11858 .{ .kind = .id_result_type, .quantifier = .required },
11859 .{ .kind = .id_result, .quantifier = .required },
11860 .{ .kind = .id_ref, .quantifier = .required },
11861 },
11862 },
11863 .{
11864 .name = "OpSubgroupAvcMceGetMotionVectorsINTEL",
11865 .opcode = 5738,
11866 .operands = &.{
11867 .{ .kind = .id_result_type, .quantifier = .required },
11868 .{ .kind = .id_result, .quantifier = .required },
11869 .{ .kind = .id_ref, .quantifier = .required },
11870 },
11871 },
11872 .{
11873 .name = "OpSubgroupAvcMceGetInterDistortionsINTEL",
11874 .opcode = 5739,
11875 .operands = &.{
11876 .{ .kind = .id_result_type, .quantifier = .required },
11877 .{ .kind = .id_result, .quantifier = .required },
11878 .{ .kind = .id_ref, .quantifier = .required },
11879 },
11880 },
11881 .{
11882 .name = "OpSubgroupAvcMceGetBestInterDistortionsINTEL",
11883 .opcode = 5740,
11884 .operands = &.{
11885 .{ .kind = .id_result_type, .quantifier = .required },
11886 .{ .kind = .id_result, .quantifier = .required },
11887 .{ .kind = .id_ref, .quantifier = .required },
11888 },
11889 },
11890 .{
11891 .name = "OpSubgroupAvcMceGetInterMajorShapeINTEL",
11892 .opcode = 5741,
11893 .operands = &.{
11894 .{ .kind = .id_result_type, .quantifier = .required },
11895 .{ .kind = .id_result, .quantifier = .required },
11896 .{ .kind = .id_ref, .quantifier = .required },
11897 },
11898 },
11899 .{
11900 .name = "OpSubgroupAvcMceGetInterMinorShapeINTEL",
11901 .opcode = 5742,
11902 .operands = &.{
11903 .{ .kind = .id_result_type, .quantifier = .required },
11904 .{ .kind = .id_result, .quantifier = .required },
11905 .{ .kind = .id_ref, .quantifier = .required },
11906 },
11907 },
11908 .{
11909 .name = "OpSubgroupAvcMceGetInterDirectionsINTEL",
11910 .opcode = 5743,
11911 .operands = &.{
11912 .{ .kind = .id_result_type, .quantifier = .required },
11913 .{ .kind = .id_result, .quantifier = .required },
11914 .{ .kind = .id_ref, .quantifier = .required },
11915 },
11916 },
11917 .{
11918 .name = "OpSubgroupAvcMceGetInterMotionVectorCountINTEL",
11919 .opcode = 5744,
11920 .operands = &.{
11921 .{ .kind = .id_result_type, .quantifier = .required },
11922 .{ .kind = .id_result, .quantifier = .required },
11923 .{ .kind = .id_ref, .quantifier = .required },
11924 },
11925 },
11926 .{
11927 .name = "OpSubgroupAvcMceGetInterReferenceIdsINTEL",
11928 .opcode = 5745,
11929 .operands = &.{
11930 .{ .kind = .id_result_type, .quantifier = .required },
11931 .{ .kind = .id_result, .quantifier = .required },
11932 .{ .kind = .id_ref, .quantifier = .required },
11933 },
11934 },
11935 .{
11936 .name = "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL",
11937 .opcode = 5746,
11938 .operands = &.{
11939 .{ .kind = .id_result_type, .quantifier = .required },
11940 .{ .kind = .id_result, .quantifier = .required },
11941 .{ .kind = .id_ref, .quantifier = .required },
11942 .{ .kind = .id_ref, .quantifier = .required },
11943 .{ .kind = .id_ref, .quantifier = .required },
11944 },
11945 },
11946 .{
11947 .name = "OpSubgroupAvcImeInitializeINTEL",
11948 .opcode = 5747,
11949 .operands = &.{
11950 .{ .kind = .id_result_type, .quantifier = .required },
11951 .{ .kind = .id_result, .quantifier = .required },
11952 .{ .kind = .id_ref, .quantifier = .required },
11953 .{ .kind = .id_ref, .quantifier = .required },
11954 .{ .kind = .id_ref, .quantifier = .required },
11955 },
11956 },
11957 .{
11958 .name = "OpSubgroupAvcImeSetSingleReferenceINTEL",
11959 .opcode = 5748,
11960 .operands = &.{
11961 .{ .kind = .id_result_type, .quantifier = .required },
11962 .{ .kind = .id_result, .quantifier = .required },
11963 .{ .kind = .id_ref, .quantifier = .required },
11964 .{ .kind = .id_ref, .quantifier = .required },
11965 .{ .kind = .id_ref, .quantifier = .required },
11966 },
11967 },
11968 .{
11969 .name = "OpSubgroupAvcImeSetDualReferenceINTEL",
11970 .opcode = 5749,
11971 .operands = &.{
11972 .{ .kind = .id_result_type, .quantifier = .required },
11973 .{ .kind = .id_result, .quantifier = .required },
11974 .{ .kind = .id_ref, .quantifier = .required },
11975 .{ .kind = .id_ref, .quantifier = .required },
11976 .{ .kind = .id_ref, .quantifier = .required },
11977 .{ .kind = .id_ref, .quantifier = .required },
11978 },
11979 },
11980 .{
11981 .name = "OpSubgroupAvcImeRefWindowSizeINTEL",
11982 .opcode = 5750,
11983 .operands = &.{
11984 .{ .kind = .id_result_type, .quantifier = .required },
11985 .{ .kind = .id_result, .quantifier = .required },
11986 .{ .kind = .id_ref, .quantifier = .required },
11987 .{ .kind = .id_ref, .quantifier = .required },
11988 },
11989 },
11990 .{
11991 .name = "OpSubgroupAvcImeAdjustRefOffsetINTEL",
11992 .opcode = 5751,
11993 .operands = &.{
11994 .{ .kind = .id_result_type, .quantifier = .required },
11995 .{ .kind = .id_result, .quantifier = .required },
11996 .{ .kind = .id_ref, .quantifier = .required },
11997 .{ .kind = .id_ref, .quantifier = .required },
11998 .{ .kind = .id_ref, .quantifier = .required },
11999 .{ .kind = .id_ref, .quantifier = .required },
12000 },
12001 },
12002 .{
12003 .name = "OpSubgroupAvcImeConvertToMcePayloadINTEL",
12004 .opcode = 5752,
12005 .operands = &.{
12006 .{ .kind = .id_result_type, .quantifier = .required },
12007 .{ .kind = .id_result, .quantifier = .required },
12008 .{ .kind = .id_ref, .quantifier = .required },
12009 },
12010 },
12011 .{
12012 .name = "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL",
12013 .opcode = 5753,
12014 .operands = &.{
12015 .{ .kind = .id_result_type, .quantifier = .required },
12016 .{ .kind = .id_result, .quantifier = .required },
12017 .{ .kind = .id_ref, .quantifier = .required },
12018 .{ .kind = .id_ref, .quantifier = .required },
12019 },
12020 },
12021 .{
12022 .name = "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL",
12023 .opcode = 5754,
12024 .operands = &.{
12025 .{ .kind = .id_result_type, .quantifier = .required },
12026 .{ .kind = .id_result, .quantifier = .required },
12027 .{ .kind = .id_ref, .quantifier = .required },
12028 },
12029 },
12030 .{
12031 .name = "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL",
12032 .opcode = 5755,
12033 .operands = &.{
12034 .{ .kind = .id_result_type, .quantifier = .required },
12035 .{ .kind = .id_result, .quantifier = .required },
12036 .{ .kind = .id_ref, .quantifier = .required },
12037 .{ .kind = .id_ref, .quantifier = .required },
12038 },
12039 },
12040 .{
12041 .name = "OpSubgroupAvcImeSetWeightedSadINTEL",
12042 .opcode = 5756,
12043 .operands = &.{
12044 .{ .kind = .id_result_type, .quantifier = .required },
12045 .{ .kind = .id_result, .quantifier = .required },
12046 .{ .kind = .id_ref, .quantifier = .required },
12047 .{ .kind = .id_ref, .quantifier = .required },
12048 },
12049 },
12050 .{
12051 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL",
12052 .opcode = 5757,
12053 .operands = &.{
12054 .{ .kind = .id_result_type, .quantifier = .required },
12055 .{ .kind = .id_result, .quantifier = .required },
12056 .{ .kind = .id_ref, .quantifier = .required },
12057 .{ .kind = .id_ref, .quantifier = .required },
12058 .{ .kind = .id_ref, .quantifier = .required },
12059 },
12060 },
12061 .{
12062 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL",
12063 .opcode = 5758,
12064 .operands = &.{
12065 .{ .kind = .id_result_type, .quantifier = .required },
12066 .{ .kind = .id_result, .quantifier = .required },
12067 .{ .kind = .id_ref, .quantifier = .required },
12068 .{ .kind = .id_ref, .quantifier = .required },
12069 .{ .kind = .id_ref, .quantifier = .required },
12070 .{ .kind = .id_ref, .quantifier = .required },
12071 },
12072 },
12073 .{
12074 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL",
12075 .opcode = 5759,
12076 .operands = &.{
12077 .{ .kind = .id_result_type, .quantifier = .required },
12078 .{ .kind = .id_result, .quantifier = .required },
12079 .{ .kind = .id_ref, .quantifier = .required },
12080 .{ .kind = .id_ref, .quantifier = .required },
12081 .{ .kind = .id_ref, .quantifier = .required },
12082 .{ .kind = .id_ref, .quantifier = .required },
12083 },
12084 },
12085 .{
12086 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL",
12087 .opcode = 5760,
12088 .operands = &.{
12089 .{ .kind = .id_result_type, .quantifier = .required },
12090 .{ .kind = .id_result, .quantifier = .required },
12091 .{ .kind = .id_ref, .quantifier = .required },
12092 .{ .kind = .id_ref, .quantifier = .required },
12093 .{ .kind = .id_ref, .quantifier = .required },
12094 .{ .kind = .id_ref, .quantifier = .required },
12095 .{ .kind = .id_ref, .quantifier = .required },
12096 },
12097 },
12098 .{
12099 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL",
12100 .opcode = 5761,
12101 .operands = &.{
12102 .{ .kind = .id_result_type, .quantifier = .required },
12103 .{ .kind = .id_result, .quantifier = .required },
12104 .{ .kind = .id_ref, .quantifier = .required },
12105 .{ .kind = .id_ref, .quantifier = .required },
12106 .{ .kind = .id_ref, .quantifier = .required },
12107 },
12108 },
12109 .{
12110 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL",
12111 .opcode = 5762,
12112 .operands = &.{
12113 .{ .kind = .id_result_type, .quantifier = .required },
12114 .{ .kind = .id_result, .quantifier = .required },
12115 .{ .kind = .id_ref, .quantifier = .required },
12116 .{ .kind = .id_ref, .quantifier = .required },
12117 .{ .kind = .id_ref, .quantifier = .required },
12118 .{ .kind = .id_ref, .quantifier = .required },
12119 },
12120 },
12121 .{
12122 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL",
12123 .opcode = 5763,
12124 .operands = &.{
12125 .{ .kind = .id_result_type, .quantifier = .required },
12126 .{ .kind = .id_result, .quantifier = .required },
12127 .{ .kind = .id_ref, .quantifier = .required },
12128 .{ .kind = .id_ref, .quantifier = .required },
12129 .{ .kind = .id_ref, .quantifier = .required },
12130 .{ .kind = .id_ref, .quantifier = .required },
12131 },
12132 },
12133 .{
12134 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL",
12135 .opcode = 5764,
12136 .operands = &.{
12137 .{ .kind = .id_result_type, .quantifier = .required },
12138 .{ .kind = .id_result, .quantifier = .required },
12139 .{ .kind = .id_ref, .quantifier = .required },
12140 .{ .kind = .id_ref, .quantifier = .required },
12141 .{ .kind = .id_ref, .quantifier = .required },
12142 .{ .kind = .id_ref, .quantifier = .required },
12143 .{ .kind = .id_ref, .quantifier = .required },
12144 },
12145 },
12146 .{
12147 .name = "OpSubgroupAvcImeConvertToMceResultINTEL",
12148 .opcode = 5765,
12149 .operands = &.{
12150 .{ .kind = .id_result_type, .quantifier = .required },
12151 .{ .kind = .id_result, .quantifier = .required },
12152 .{ .kind = .id_ref, .quantifier = .required },
12153 },
12154 },
12155 .{
12156 .name = "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL",
12157 .opcode = 5766,
12158 .operands = &.{
12159 .{ .kind = .id_result_type, .quantifier = .required },
12160 .{ .kind = .id_result, .quantifier = .required },
12161 .{ .kind = .id_ref, .quantifier = .required },
12162 },
12163 },
12164 .{
12165 .name = "OpSubgroupAvcImeGetDualReferenceStreaminINTEL",
12166 .opcode = 5767,
12167 .operands = &.{
12168 .{ .kind = .id_result_type, .quantifier = .required },
12169 .{ .kind = .id_result, .quantifier = .required },
12170 .{ .kind = .id_ref, .quantifier = .required },
12171 },
12172 },
12173 .{
12174 .name = "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL",
12175 .opcode = 5768,
12176 .operands = &.{
12177 .{ .kind = .id_result_type, .quantifier = .required },
12178 .{ .kind = .id_result, .quantifier = .required },
12179 .{ .kind = .id_ref, .quantifier = .required },
12180 },
12181 },
12182 .{
12183 .name = "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL",
12184 .opcode = 5769,
12185 .operands = &.{
12186 .{ .kind = .id_result_type, .quantifier = .required },
12187 .{ .kind = .id_result, .quantifier = .required },
12188 .{ .kind = .id_ref, .quantifier = .required },
12189 },
12190 },
12191 .{
12192 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL",
12193 .opcode = 5770,
12194 .operands = &.{
12195 .{ .kind = .id_result_type, .quantifier = .required },
12196 .{ .kind = .id_result, .quantifier = .required },
12197 .{ .kind = .id_ref, .quantifier = .required },
12198 .{ .kind = .id_ref, .quantifier = .required },
12199 },
12200 },
12201 .{
12202 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL",
12203 .opcode = 5771,
12204 .operands = &.{
12205 .{ .kind = .id_result_type, .quantifier = .required },
12206 .{ .kind = .id_result, .quantifier = .required },
12207 .{ .kind = .id_ref, .quantifier = .required },
12208 .{ .kind = .id_ref, .quantifier = .required },
12209 },
12210 },
12211 .{
12212 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL",
12213 .opcode = 5772,
12214 .operands = &.{
12215 .{ .kind = .id_result_type, .quantifier = .required },
12216 .{ .kind = .id_result, .quantifier = .required },
12217 .{ .kind = .id_ref, .quantifier = .required },
12218 .{ .kind = .id_ref, .quantifier = .required },
12219 },
12220 },
12221 .{
12222 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL",
12223 .opcode = 5773,
12224 .operands = &.{
12225 .{ .kind = .id_result_type, .quantifier = .required },
12226 .{ .kind = .id_result, .quantifier = .required },
12227 .{ .kind = .id_ref, .quantifier = .required },
12228 .{ .kind = .id_ref, .quantifier = .required },
12229 .{ .kind = .id_ref, .quantifier = .required },
12230 },
12231 },
12232 .{
12233 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL",
12234 .opcode = 5774,
12235 .operands = &.{
12236 .{ .kind = .id_result_type, .quantifier = .required },
12237 .{ .kind = .id_result, .quantifier = .required },
12238 .{ .kind = .id_ref, .quantifier = .required },
12239 .{ .kind = .id_ref, .quantifier = .required },
12240 .{ .kind = .id_ref, .quantifier = .required },
12241 },
12242 },
12243 .{
12244 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL",
12245 .opcode = 5775,
12246 .operands = &.{
12247 .{ .kind = .id_result_type, .quantifier = .required },
12248 .{ .kind = .id_result, .quantifier = .required },
12249 .{ .kind = .id_ref, .quantifier = .required },
12250 .{ .kind = .id_ref, .quantifier = .required },
12251 .{ .kind = .id_ref, .quantifier = .required },
12252 },
12253 },
12254 .{
12255 .name = "OpSubgroupAvcImeGetBorderReachedINTEL",
12256 .opcode = 5776,
12257 .operands = &.{
12258 .{ .kind = .id_result_type, .quantifier = .required },
12259 .{ .kind = .id_result, .quantifier = .required },
12260 .{ .kind = .id_ref, .quantifier = .required },
12261 .{ .kind = .id_ref, .quantifier = .required },
12262 },
12263 },
12264 .{
12265 .name = "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL",
12266 .opcode = 5777,
12267 .operands = &.{
12268 .{ .kind = .id_result_type, .quantifier = .required },
12269 .{ .kind = .id_result, .quantifier = .required },
12270 .{ .kind = .id_ref, .quantifier = .required },
12271 },
12272 },
12273 .{
12274 .name = "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL",
12275 .opcode = 5778,
12276 .operands = &.{
12277 .{ .kind = .id_result_type, .quantifier = .required },
12278 .{ .kind = .id_result, .quantifier = .required },
12279 .{ .kind = .id_ref, .quantifier = .required },
12280 },
12281 },
12282 .{
12283 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL",
12284 .opcode = 5779,
12285 .operands = &.{
12286 .{ .kind = .id_result_type, .quantifier = .required },
12287 .{ .kind = .id_result, .quantifier = .required },
12288 .{ .kind = .id_ref, .quantifier = .required },
12289 },
12290 },
12291 .{
12292 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL",
12293 .opcode = 5780,
12294 .operands = &.{
12295 .{ .kind = .id_result_type, .quantifier = .required },
12296 .{ .kind = .id_result, .quantifier = .required },
12297 .{ .kind = .id_ref, .quantifier = .required },
12298 },
12299 },
12300 .{
12301 .name = "OpSubgroupAvcFmeInitializeINTEL",
12302 .opcode = 5781,
12303 .operands = &.{
12304 .{ .kind = .id_result_type, .quantifier = .required },
12305 .{ .kind = .id_result, .quantifier = .required },
12306 .{ .kind = .id_ref, .quantifier = .required },
12307 .{ .kind = .id_ref, .quantifier = .required },
12308 .{ .kind = .id_ref, .quantifier = .required },
12309 .{ .kind = .id_ref, .quantifier = .required },
12310 .{ .kind = .id_ref, .quantifier = .required },
12311 .{ .kind = .id_ref, .quantifier = .required },
12312 .{ .kind = .id_ref, .quantifier = .required },
12313 },
12314 },
12315 .{
12316 .name = "OpSubgroupAvcBmeInitializeINTEL",
12317 .opcode = 5782,
12318 .operands = &.{
12319 .{ .kind = .id_result_type, .quantifier = .required },
12320 .{ .kind = .id_result, .quantifier = .required },
12321 .{ .kind = .id_ref, .quantifier = .required },
12322 .{ .kind = .id_ref, .quantifier = .required },
12323 .{ .kind = .id_ref, .quantifier = .required },
12324 .{ .kind = .id_ref, .quantifier = .required },
12325 .{ .kind = .id_ref, .quantifier = .required },
12326 .{ .kind = .id_ref, .quantifier = .required },
12327 .{ .kind = .id_ref, .quantifier = .required },
12328 .{ .kind = .id_ref, .quantifier = .required },
12329 },
12330 },
12331 .{
12332 .name = "OpSubgroupAvcRefConvertToMcePayloadINTEL",
12333 .opcode = 5783,
12334 .operands = &.{
12335 .{ .kind = .id_result_type, .quantifier = .required },
12336 .{ .kind = .id_result, .quantifier = .required },
12337 .{ .kind = .id_ref, .quantifier = .required },
12338 },
12339 },
12340 .{
12341 .name = "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL",
12342 .opcode = 5784,
12343 .operands = &.{
12344 .{ .kind = .id_result_type, .quantifier = .required },
12345 .{ .kind = .id_result, .quantifier = .required },
12346 .{ .kind = .id_ref, .quantifier = .required },
12347 },
12348 },
12349 .{
12350 .name = "OpSubgroupAvcRefSetBilinearFilterEnableINTEL",
12351 .opcode = 5785,
12352 .operands = &.{
12353 .{ .kind = .id_result_type, .quantifier = .required },
12354 .{ .kind = .id_result, .quantifier = .required },
12355 .{ .kind = .id_ref, .quantifier = .required },
12356 },
12357 },
12358 .{
12359 .name = "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL",
12360 .opcode = 5786,
12361 .operands = &.{
12362 .{ .kind = .id_result_type, .quantifier = .required },
12363 .{ .kind = .id_result, .quantifier = .required },
12364 .{ .kind = .id_ref, .quantifier = .required },
12365 .{ .kind = .id_ref, .quantifier = .required },
12366 .{ .kind = .id_ref, .quantifier = .required },
12367 },
12368 },
12369 .{
12370 .name = "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL",
12371 .opcode = 5787,
12372 .operands = &.{
12373 .{ .kind = .id_result_type, .quantifier = .required },
12374 .{ .kind = .id_result, .quantifier = .required },
12375 .{ .kind = .id_ref, .quantifier = .required },
12376 .{ .kind = .id_ref, .quantifier = .required },
12377 .{ .kind = .id_ref, .quantifier = .required },
12378 .{ .kind = .id_ref, .quantifier = .required },
12379 },
12380 },
12381 .{
12382 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL",
12383 .opcode = 5788,
12384 .operands = &.{
12385 .{ .kind = .id_result_type, .quantifier = .required },
12386 .{ .kind = .id_result, .quantifier = .required },
12387 .{ .kind = .id_ref, .quantifier = .required },
12388 .{ .kind = .id_ref, .quantifier = .required },
12389 .{ .kind = .id_ref, .quantifier = .required },
12390 },
12391 },
12392 .{
12393 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL",
12394 .opcode = 5789,
12395 .operands = &.{
12396 .{ .kind = .id_result_type, .quantifier = .required },
12397 .{ .kind = .id_result, .quantifier = .required },
12398 .{ .kind = .id_ref, .quantifier = .required },
12399 .{ .kind = .id_ref, .quantifier = .required },
12400 .{ .kind = .id_ref, .quantifier = .required },
12401 .{ .kind = .id_ref, .quantifier = .required },
12402 },
12403 },
12404 .{
12405 .name = "OpSubgroupAvcRefConvertToMceResultINTEL",
12406 .opcode = 5790,
12407 .operands = &.{
12408 .{ .kind = .id_result_type, .quantifier = .required },
12409 .{ .kind = .id_result, .quantifier = .required },
12410 .{ .kind = .id_ref, .quantifier = .required },
12411 },
12412 },
12413 .{
12414 .name = "OpSubgroupAvcSicInitializeINTEL",
12415 .opcode = 5791,
12416 .operands = &.{
12417 .{ .kind = .id_result_type, .quantifier = .required },
12418 .{ .kind = .id_result, .quantifier = .required },
12419 .{ .kind = .id_ref, .quantifier = .required },
12420 },
12421 },
12422 .{
12423 .name = "OpSubgroupAvcSicConfigureSkcINTEL",
12424 .opcode = 5792,
12425 .operands = &.{
12426 .{ .kind = .id_result_type, .quantifier = .required },
12427 .{ .kind = .id_result, .quantifier = .required },
12428 .{ .kind = .id_ref, .quantifier = .required },
12429 .{ .kind = .id_ref, .quantifier = .required },
12430 .{ .kind = .id_ref, .quantifier = .required },
12431 .{ .kind = .id_ref, .quantifier = .required },
12432 .{ .kind = .id_ref, .quantifier = .required },
12433 .{ .kind = .id_ref, .quantifier = .required },
12434 },
12435 },
12436 .{
12437 .name = "OpSubgroupAvcSicConfigureIpeLumaINTEL",
12438 .opcode = 5793,
12439 .operands = &.{
12440 .{ .kind = .id_result_type, .quantifier = .required },
12441 .{ .kind = .id_result, .quantifier = .required },
12442 .{ .kind = .id_ref, .quantifier = .required },
12443 .{ .kind = .id_ref, .quantifier = .required },
12444 .{ .kind = .id_ref, .quantifier = .required },
12445 .{ .kind = .id_ref, .quantifier = .required },
12446 .{ .kind = .id_ref, .quantifier = .required },
12447 .{ .kind = .id_ref, .quantifier = .required },
12448 .{ .kind = .id_ref, .quantifier = .required },
12449 .{ .kind = .id_ref, .quantifier = .required },
12450 },
12451 },
12452 .{
12453 .name = "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL",
12454 .opcode = 5794,
12455 .operands = &.{
12456 .{ .kind = .id_result_type, .quantifier = .required },
12457 .{ .kind = .id_result, .quantifier = .required },
12458 .{ .kind = .id_ref, .quantifier = .required },
12459 .{ .kind = .id_ref, .quantifier = .required },
12460 .{ .kind = .id_ref, .quantifier = .required },
12461 .{ .kind = .id_ref, .quantifier = .required },
12462 .{ .kind = .id_ref, .quantifier = .required },
12463 .{ .kind = .id_ref, .quantifier = .required },
12464 .{ .kind = .id_ref, .quantifier = .required },
12465 .{ .kind = .id_ref, .quantifier = .required },
12466 .{ .kind = .id_ref, .quantifier = .required },
12467 .{ .kind = .id_ref, .quantifier = .required },
12468 .{ .kind = .id_ref, .quantifier = .required },
12469 },
12470 },
12471 .{
12472 .name = "OpSubgroupAvcSicGetMotionVectorMaskINTEL",
12473 .opcode = 5795,
12474 .operands = &.{
12475 .{ .kind = .id_result_type, .quantifier = .required },
12476 .{ .kind = .id_result, .quantifier = .required },
12477 .{ .kind = .id_ref, .quantifier = .required },
12478 .{ .kind = .id_ref, .quantifier = .required },
12479 },
12480 },
12481 .{
12482 .name = "OpSubgroupAvcSicConvertToMcePayloadINTEL",
12483 .opcode = 5796,
12484 .operands = &.{
12485 .{ .kind = .id_result_type, .quantifier = .required },
12486 .{ .kind = .id_result, .quantifier = .required },
12487 .{ .kind = .id_ref, .quantifier = .required },
12488 },
12489 },
12490 .{
12491 .name = "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL",
12492 .opcode = 5797,
12493 .operands = &.{
12494 .{ .kind = .id_result_type, .quantifier = .required },
12495 .{ .kind = .id_result, .quantifier = .required },
12496 .{ .kind = .id_ref, .quantifier = .required },
12497 .{ .kind = .id_ref, .quantifier = .required },
12498 },
12499 },
12500 .{
12501 .name = "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL",
12502 .opcode = 5798,
12503 .operands = &.{
12504 .{ .kind = .id_result_type, .quantifier = .required },
12505 .{ .kind = .id_result, .quantifier = .required },
12506 .{ .kind = .id_ref, .quantifier = .required },
12507 .{ .kind = .id_ref, .quantifier = .required },
12508 .{ .kind = .id_ref, .quantifier = .required },
12509 .{ .kind = .id_ref, .quantifier = .required },
12510 },
12511 },
12512 .{
12513 .name = "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL",
12514 .opcode = 5799,
12515 .operands = &.{
12516 .{ .kind = .id_result_type, .quantifier = .required },
12517 .{ .kind = .id_result, .quantifier = .required },
12518 .{ .kind = .id_ref, .quantifier = .required },
12519 .{ .kind = .id_ref, .quantifier = .required },
12520 },
12521 },
12522 .{
12523 .name = "OpSubgroupAvcSicSetBilinearFilterEnableINTEL",
12524 .opcode = 5800,
12525 .operands = &.{
12526 .{ .kind = .id_result_type, .quantifier = .required },
12527 .{ .kind = .id_result, .quantifier = .required },
12528 .{ .kind = .id_ref, .quantifier = .required },
12529 },
12530 },
12531 .{
12532 .name = "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL",
12533 .opcode = 5801,
12534 .operands = &.{
12535 .{ .kind = .id_result_type, .quantifier = .required },
12536 .{ .kind = .id_result, .quantifier = .required },
12537 .{ .kind = .id_ref, .quantifier = .required },
12538 .{ .kind = .id_ref, .quantifier = .required },
12539 },
12540 },
12541 .{
12542 .name = "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL",
12543 .opcode = 5802,
12544 .operands = &.{
12545 .{ .kind = .id_result_type, .quantifier = .required },
12546 .{ .kind = .id_result, .quantifier = .required },
12547 .{ .kind = .id_ref, .quantifier = .required },
12548 .{ .kind = .id_ref, .quantifier = .required },
12549 },
12550 },
12551 .{
12552 .name = "OpSubgroupAvcSicEvaluateIpeINTEL",
12553 .opcode = 5803,
12554 .operands = &.{
12555 .{ .kind = .id_result_type, .quantifier = .required },
12556 .{ .kind = .id_result, .quantifier = .required },
12557 .{ .kind = .id_ref, .quantifier = .required },
12558 .{ .kind = .id_ref, .quantifier = .required },
12559 },
12560 },
12561 .{
12562 .name = "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL",
12563 .opcode = 5804,
12564 .operands = &.{
12565 .{ .kind = .id_result_type, .quantifier = .required },
12566 .{ .kind = .id_result, .quantifier = .required },
12567 .{ .kind = .id_ref, .quantifier = .required },
12568 .{ .kind = .id_ref, .quantifier = .required },
12569 .{ .kind = .id_ref, .quantifier = .required },
12570 },
12571 },
12572 .{
12573 .name = "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL",
12574 .opcode = 5805,
12575 .operands = &.{
12576 .{ .kind = .id_result_type, .quantifier = .required },
12577 .{ .kind = .id_result, .quantifier = .required },
12578 .{ .kind = .id_ref, .quantifier = .required },
12579 .{ .kind = .id_ref, .quantifier = .required },
12580 .{ .kind = .id_ref, .quantifier = .required },
12581 .{ .kind = .id_ref, .quantifier = .required },
12582 },
12583 },
12584 .{
12585 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL",
12586 .opcode = 5806,
12587 .operands = &.{
12588 .{ .kind = .id_result_type, .quantifier = .required },
12589 .{ .kind = .id_result, .quantifier = .required },
12590 .{ .kind = .id_ref, .quantifier = .required },
12591 .{ .kind = .id_ref, .quantifier = .required },
12592 .{ .kind = .id_ref, .quantifier = .required },
12593 },
12594 },
12595 .{
12596 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL",
12597 .opcode = 5807,
12598 .operands = &.{
12599 .{ .kind = .id_result_type, .quantifier = .required },
12600 .{ .kind = .id_result, .quantifier = .required },
12601 .{ .kind = .id_ref, .quantifier = .required },
12602 .{ .kind = .id_ref, .quantifier = .required },
12603 .{ .kind = .id_ref, .quantifier = .required },
12604 .{ .kind = .id_ref, .quantifier = .required },
12605 },
12606 },
12607 .{
12608 .name = "OpSubgroupAvcSicConvertToMceResultINTEL",
12609 .opcode = 5808,
12610 .operands = &.{
12611 .{ .kind = .id_result_type, .quantifier = .required },
12612 .{ .kind = .id_result, .quantifier = .required },
12613 .{ .kind = .id_ref, .quantifier = .required },
12614 },
12615 },
12616 .{
12617 .name = "OpSubgroupAvcSicGetIpeLumaShapeINTEL",
12618 .opcode = 5809,
12619 .operands = &.{
12620 .{ .kind = .id_result_type, .quantifier = .required },
12621 .{ .kind = .id_result, .quantifier = .required },
12622 .{ .kind = .id_ref, .quantifier = .required },
12623 },
12624 },
12625 .{
12626 .name = "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL",
12627 .opcode = 5810,
12628 .operands = &.{
12629 .{ .kind = .id_result_type, .quantifier = .required },
12630 .{ .kind = .id_result, .quantifier = .required },
12631 .{ .kind = .id_ref, .quantifier = .required },
12632 },
12633 },
12634 .{
12635 .name = "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL",
12636 .opcode = 5811,
12637 .operands = &.{
12638 .{ .kind = .id_result_type, .quantifier = .required },
12639 .{ .kind = .id_result, .quantifier = .required },
12640 .{ .kind = .id_ref, .quantifier = .required },
12641 },
12642 },
12643 .{
12644 .name = "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL",
12645 .opcode = 5812,
12646 .operands = &.{
12647 .{ .kind = .id_result_type, .quantifier = .required },
12648 .{ .kind = .id_result, .quantifier = .required },
12649 .{ .kind = .id_ref, .quantifier = .required },
12650 },
12651 },
12652 .{
12653 .name = "OpSubgroupAvcSicGetIpeChromaModeINTEL",
12654 .opcode = 5813,
12655 .operands = &.{
12656 .{ .kind = .id_result_type, .quantifier = .required },
12657 .{ .kind = .id_result, .quantifier = .required },
12658 .{ .kind = .id_ref, .quantifier = .required },
12659 },
12660 },
12661 .{
12662 .name = "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL",
12663 .opcode = 5814,
12664 .operands = &.{
12665 .{ .kind = .id_result_type, .quantifier = .required },
12666 .{ .kind = .id_result, .quantifier = .required },
12667 .{ .kind = .id_ref, .quantifier = .required },
12668 },
12669 },
12670 .{
12671 .name = "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL",
12672 .opcode = 5815,
12673 .operands = &.{
12674 .{ .kind = .id_result_type, .quantifier = .required },
12675 .{ .kind = .id_result, .quantifier = .required },
12676 .{ .kind = .id_ref, .quantifier = .required },
12677 },
12678 },
12679 .{
12680 .name = "OpSubgroupAvcSicGetInterRawSadsINTEL",
12681 .opcode = 5816,
12682 .operands = &.{
12683 .{ .kind = .id_result_type, .quantifier = .required },
12684 .{ .kind = .id_result, .quantifier = .required },
12685 .{ .kind = .id_ref, .quantifier = .required },
12686 },
12687 },
12688 .{
12689 .name = "OpVariableLengthArrayINTEL",
12690 .opcode = 5818,
12691 .operands = &.{
12692 .{ .kind = .id_result_type, .quantifier = .required },
12693 .{ .kind = .id_result, .quantifier = .required },
12694 .{ .kind = .id_ref, .quantifier = .required },
12695 },
12696 },
12697 .{
12698 .name = "OpSaveMemoryINTEL",
12699 .opcode = 5819,
12700 .operands = &.{
12701 .{ .kind = .id_result_type, .quantifier = .required },
12702 .{ .kind = .id_result, .quantifier = .required },
12703 },
12704 },
12705 .{
12706 .name = "OpRestoreMemoryINTEL",
12707 .opcode = 5820,
12708 .operands = &.{
12709 .{ .kind = .id_ref, .quantifier = .required },
12710 },
12711 },
12712 .{
12713 .name = "OpArbitraryFloatSinCosPiINTEL",
12714 .opcode = 5840,
12715 .operands = &.{
12716 .{ .kind = .id_result_type, .quantifier = .required },
12717 .{ .kind = .id_result, .quantifier = .required },
12718 .{ .kind = .id_ref, .quantifier = .required },
12719 .{ .kind = .literal_integer, .quantifier = .required },
12720 .{ .kind = .literal_integer, .quantifier = .required },
12721 .{ .kind = .literal_integer, .quantifier = .required },
12722 .{ .kind = .literal_integer, .quantifier = .required },
12723 .{ .kind = .literal_integer, .quantifier = .required },
12724 },
12725 },
12726 .{
12727 .name = "OpArbitraryFloatCastINTEL",
12728 .opcode = 5841,
12729 .operands = &.{
12730 .{ .kind = .id_result_type, .quantifier = .required },
12731 .{ .kind = .id_result, .quantifier = .required },
12732 .{ .kind = .id_ref, .quantifier = .required },
12733 .{ .kind = .literal_integer, .quantifier = .required },
12734 .{ .kind = .literal_integer, .quantifier = .required },
12735 .{ .kind = .literal_integer, .quantifier = .required },
12736 .{ .kind = .literal_integer, .quantifier = .required },
12737 .{ .kind = .literal_integer, .quantifier = .required },
12738 },
12739 },
12740 .{
12741 .name = "OpArbitraryFloatCastFromIntINTEL",
12742 .opcode = 5842,
12743 .operands = &.{
12744 .{ .kind = .id_result_type, .quantifier = .required },
12745 .{ .kind = .id_result, .quantifier = .required },
12746 .{ .kind = .id_ref, .quantifier = .required },
12747 .{ .kind = .literal_integer, .quantifier = .required },
12748 .{ .kind = .literal_integer, .quantifier = .required },
12749 .{ .kind = .literal_integer, .quantifier = .required },
12750 .{ .kind = .literal_integer, .quantifier = .required },
12751 .{ .kind = .literal_integer, .quantifier = .required },
12752 },
12753 },
12754 .{
12755 .name = "OpArbitraryFloatCastToIntINTEL",
12756 .opcode = 5843,
12757 .operands = &.{
12758 .{ .kind = .id_result_type, .quantifier = .required },
12759 .{ .kind = .id_result, .quantifier = .required },
12760 .{ .kind = .id_ref, .quantifier = .required },
12761 .{ .kind = .literal_integer, .quantifier = .required },
12762 .{ .kind = .literal_integer, .quantifier = .required },
12763 .{ .kind = .literal_integer, .quantifier = .required },
12764 .{ .kind = .literal_integer, .quantifier = .required },
12765 .{ .kind = .literal_integer, .quantifier = .required },
12766 },
12767 },
12768 .{
12769 .name = "OpArbitraryFloatAddINTEL",
12770 .opcode = 5846,
12771 .operands = &.{
12772 .{ .kind = .id_result_type, .quantifier = .required },
12773 .{ .kind = .id_result, .quantifier = .required },
12774 .{ .kind = .id_ref, .quantifier = .required },
12775 .{ .kind = .literal_integer, .quantifier = .required },
12776 .{ .kind = .id_ref, .quantifier = .required },
12777 .{ .kind = .literal_integer, .quantifier = .required },
12778 .{ .kind = .literal_integer, .quantifier = .required },
12779 .{ .kind = .literal_integer, .quantifier = .required },
12780 .{ .kind = .literal_integer, .quantifier = .required },
12781 .{ .kind = .literal_integer, .quantifier = .required },
12782 },
12783 },
12784 .{
12785 .name = "OpArbitraryFloatSubINTEL",
12786 .opcode = 5847,
12787 .operands = &.{
12788 .{ .kind = .id_result_type, .quantifier = .required },
12789 .{ .kind = .id_result, .quantifier = .required },
12790 .{ .kind = .id_ref, .quantifier = .required },
12791 .{ .kind = .literal_integer, .quantifier = .required },
12792 .{ .kind = .id_ref, .quantifier = .required },
12793 .{ .kind = .literal_integer, .quantifier = .required },
12794 .{ .kind = .literal_integer, .quantifier = .required },
12795 .{ .kind = .literal_integer, .quantifier = .required },
12796 .{ .kind = .literal_integer, .quantifier = .required },
12797 .{ .kind = .literal_integer, .quantifier = .required },
12798 },
12799 },
12800 .{
12801 .name = "OpArbitraryFloatMulINTEL",
12802 .opcode = 5848,
12803 .operands = &.{
12804 .{ .kind = .id_result_type, .quantifier = .required },
12805 .{ .kind = .id_result, .quantifier = .required },
12806 .{ .kind = .id_ref, .quantifier = .required },
12807 .{ .kind = .literal_integer, .quantifier = .required },
12808 .{ .kind = .id_ref, .quantifier = .required },
12809 .{ .kind = .literal_integer, .quantifier = .required },
12810 .{ .kind = .literal_integer, .quantifier = .required },
12811 .{ .kind = .literal_integer, .quantifier = .required },
12812 .{ .kind = .literal_integer, .quantifier = .required },
12813 .{ .kind = .literal_integer, .quantifier = .required },
12814 },
12815 },
12816 .{
12817 .name = "OpArbitraryFloatDivINTEL",
12818 .opcode = 5849,
12819 .operands = &.{
12820 .{ .kind = .id_result_type, .quantifier = .required },
12821 .{ .kind = .id_result, .quantifier = .required },
12822 .{ .kind = .id_ref, .quantifier = .required },
12823 .{ .kind = .literal_integer, .quantifier = .required },
12824 .{ .kind = .id_ref, .quantifier = .required },
12825 .{ .kind = .literal_integer, .quantifier = .required },
12826 .{ .kind = .literal_integer, .quantifier = .required },
12827 .{ .kind = .literal_integer, .quantifier = .required },
12828 .{ .kind = .literal_integer, .quantifier = .required },
12829 .{ .kind = .literal_integer, .quantifier = .required },
12830 },
12831 },
12832 .{
12833 .name = "OpArbitraryFloatGTINTEL",
12834 .opcode = 5850,
12835 .operands = &.{
12836 .{ .kind = .id_result_type, .quantifier = .required },
12837 .{ .kind = .id_result, .quantifier = .required },
12838 .{ .kind = .id_ref, .quantifier = .required },
12839 .{ .kind = .literal_integer, .quantifier = .required },
12840 .{ .kind = .id_ref, .quantifier = .required },
12841 .{ .kind = .literal_integer, .quantifier = .required },
12842 },
12843 },
12844 .{
12845 .name = "OpArbitraryFloatGEINTEL",
12846 .opcode = 5851,
12847 .operands = &.{
12848 .{ .kind = .id_result_type, .quantifier = .required },
12849 .{ .kind = .id_result, .quantifier = .required },
12850 .{ .kind = .id_ref, .quantifier = .required },
12851 .{ .kind = .literal_integer, .quantifier = .required },
12852 .{ .kind = .id_ref, .quantifier = .required },
12853 .{ .kind = .literal_integer, .quantifier = .required },
12854 },
12855 },
12856 .{
12857 .name = "OpArbitraryFloatLTINTEL",
12858 .opcode = 5852,
12859 .operands = &.{
12860 .{ .kind = .id_result_type, .quantifier = .required },
12861 .{ .kind = .id_result, .quantifier = .required },
12862 .{ .kind = .id_ref, .quantifier = .required },
12863 .{ .kind = .literal_integer, .quantifier = .required },
12864 .{ .kind = .id_ref, .quantifier = .required },
12865 .{ .kind = .literal_integer, .quantifier = .required },
12866 },
12867 },
12868 .{
12869 .name = "OpArbitraryFloatLEINTEL",
12870 .opcode = 5853,
12871 .operands = &.{
12872 .{ .kind = .id_result_type, .quantifier = .required },
12873 .{ .kind = .id_result, .quantifier = .required },
12874 .{ .kind = .id_ref, .quantifier = .required },
12875 .{ .kind = .literal_integer, .quantifier = .required },
12876 .{ .kind = .id_ref, .quantifier = .required },
12877 .{ .kind = .literal_integer, .quantifier = .required },
12878 },
12879 },
12880 .{
12881 .name = "OpArbitraryFloatEQINTEL",
12882 .opcode = 5854,
12883 .operands = &.{
12884 .{ .kind = .id_result_type, .quantifier = .required },
12885 .{ .kind = .id_result, .quantifier = .required },
12886 .{ .kind = .id_ref, .quantifier = .required },
12887 .{ .kind = .literal_integer, .quantifier = .required },
12888 .{ .kind = .id_ref, .quantifier = .required },
12889 .{ .kind = .literal_integer, .quantifier = .required },
12890 },
12891 },
12892 .{
12893 .name = "OpArbitraryFloatRecipINTEL",
12894 .opcode = 5855,
12895 .operands = &.{
12896 .{ .kind = .id_result_type, .quantifier = .required },
12897 .{ .kind = .id_result, .quantifier = .required },
12898 .{ .kind = .id_ref, .quantifier = .required },
12899 .{ .kind = .literal_integer, .quantifier = .required },
12900 .{ .kind = .literal_integer, .quantifier = .required },
12901 .{ .kind = .literal_integer, .quantifier = .required },
12902 .{ .kind = .literal_integer, .quantifier = .required },
12903 .{ .kind = .literal_integer, .quantifier = .required },
12904 },
12905 },
12906 .{
12907 .name = "OpArbitraryFloatRSqrtINTEL",
12908 .opcode = 5856,
12909 .operands = &.{
12910 .{ .kind = .id_result_type, .quantifier = .required },
12911 .{ .kind = .id_result, .quantifier = .required },
12912 .{ .kind = .id_ref, .quantifier = .required },
12913 .{ .kind = .literal_integer, .quantifier = .required },
12914 .{ .kind = .literal_integer, .quantifier = .required },
12915 .{ .kind = .literal_integer, .quantifier = .required },
12916 .{ .kind = .literal_integer, .quantifier = .required },
12917 .{ .kind = .literal_integer, .quantifier = .required },
12918 },
12919 },
12920 .{
12921 .name = "OpArbitraryFloatCbrtINTEL",
12922 .opcode = 5857,
12923 .operands = &.{
12924 .{ .kind = .id_result_type, .quantifier = .required },
12925 .{ .kind = .id_result, .quantifier = .required },
12926 .{ .kind = .id_ref, .quantifier = .required },
12927 .{ .kind = .literal_integer, .quantifier = .required },
12928 .{ .kind = .literal_integer, .quantifier = .required },
12929 .{ .kind = .literal_integer, .quantifier = .required },
12930 .{ .kind = .literal_integer, .quantifier = .required },
12931 .{ .kind = .literal_integer, .quantifier = .required },
12932 },
12933 },
12934 .{
12935 .name = "OpArbitraryFloatHypotINTEL",
12936 .opcode = 5858,
12937 .operands = &.{
12938 .{ .kind = .id_result_type, .quantifier = .required },
12939 .{ .kind = .id_result, .quantifier = .required },
12940 .{ .kind = .id_ref, .quantifier = .required },
12941 .{ .kind = .literal_integer, .quantifier = .required },
12942 .{ .kind = .id_ref, .quantifier = .required },
12943 .{ .kind = .literal_integer, .quantifier = .required },
12944 .{ .kind = .literal_integer, .quantifier = .required },
12945 .{ .kind = .literal_integer, .quantifier = .required },
12946 .{ .kind = .literal_integer, .quantifier = .required },
12947 .{ .kind = .literal_integer, .quantifier = .required },
12948 },
12949 },
12950 .{
12951 .name = "OpArbitraryFloatSqrtINTEL",
12952 .opcode = 5859,
12953 .operands = &.{
12954 .{ .kind = .id_result_type, .quantifier = .required },
12955 .{ .kind = .id_result, .quantifier = .required },
12956 .{ .kind = .id_ref, .quantifier = .required },
12957 .{ .kind = .literal_integer, .quantifier = .required },
12958 .{ .kind = .literal_integer, .quantifier = .required },
12959 .{ .kind = .literal_integer, .quantifier = .required },
12960 .{ .kind = .literal_integer, .quantifier = .required },
12961 .{ .kind = .literal_integer, .quantifier = .required },
12962 },
12963 },
12964 .{
12965 .name = "OpArbitraryFloatLogINTEL",
12966 .opcode = 5860,
12967 .operands = &.{
12968 .{ .kind = .id_result_type, .quantifier = .required },
12969 .{ .kind = .id_result, .quantifier = .required },
12970 .{ .kind = .id_ref, .quantifier = .required },
12971 .{ .kind = .literal_integer, .quantifier = .required },
12972 .{ .kind = .literal_integer, .quantifier = .required },
12973 .{ .kind = .literal_integer, .quantifier = .required },
12974 .{ .kind = .literal_integer, .quantifier = .required },
12975 .{ .kind = .literal_integer, .quantifier = .required },
12976 },
12977 },
12978 .{
12979 .name = "OpArbitraryFloatLog2INTEL",
12980 .opcode = 5861,
12981 .operands = &.{
12982 .{ .kind = .id_result_type, .quantifier = .required },
12983 .{ .kind = .id_result, .quantifier = .required },
12984 .{ .kind = .id_ref, .quantifier = .required },
12985 .{ .kind = .literal_integer, .quantifier = .required },
12986 .{ .kind = .literal_integer, .quantifier = .required },
12987 .{ .kind = .literal_integer, .quantifier = .required },
12988 .{ .kind = .literal_integer, .quantifier = .required },
12989 .{ .kind = .literal_integer, .quantifier = .required },
12990 },
12991 },
12992 .{
12993 .name = "OpArbitraryFloatLog10INTEL",
12994 .opcode = 5862,
12995 .operands = &.{
12996 .{ .kind = .id_result_type, .quantifier = .required },
12997 .{ .kind = .id_result, .quantifier = .required },
12998 .{ .kind = .id_ref, .quantifier = .required },
12999 .{ .kind = .literal_integer, .quantifier = .required },
13000 .{ .kind = .literal_integer, .quantifier = .required },
13001 .{ .kind = .literal_integer, .quantifier = .required },
13002 .{ .kind = .literal_integer, .quantifier = .required },
13003 .{ .kind = .literal_integer, .quantifier = .required },
13004 },
13005 },
13006 .{
13007 .name = "OpArbitraryFloatLog1pINTEL",
13008 .opcode = 5863,
13009 .operands = &.{
13010 .{ .kind = .id_result_type, .quantifier = .required },
13011 .{ .kind = .id_result, .quantifier = .required },
13012 .{ .kind = .id_ref, .quantifier = .required },
13013 .{ .kind = .literal_integer, .quantifier = .required },
13014 .{ .kind = .literal_integer, .quantifier = .required },
13015 .{ .kind = .literal_integer, .quantifier = .required },
13016 .{ .kind = .literal_integer, .quantifier = .required },
13017 .{ .kind = .literal_integer, .quantifier = .required },
13018 },
13019 },
13020 .{
13021 .name = "OpArbitraryFloatExpINTEL",
13022 .opcode = 5864,
13023 .operands = &.{
13024 .{ .kind = .id_result_type, .quantifier = .required },
13025 .{ .kind = .id_result, .quantifier = .required },
13026 .{ .kind = .id_ref, .quantifier = .required },
13027 .{ .kind = .literal_integer, .quantifier = .required },
13028 .{ .kind = .literal_integer, .quantifier = .required },
13029 .{ .kind = .literal_integer, .quantifier = .required },
13030 .{ .kind = .literal_integer, .quantifier = .required },
13031 .{ .kind = .literal_integer, .quantifier = .required },
13032 },
13033 },
13034 .{
13035 .name = "OpArbitraryFloatExp2INTEL",
13036 .opcode = 5865,
13037 .operands = &.{
13038 .{ .kind = .id_result_type, .quantifier = .required },
13039 .{ .kind = .id_result, .quantifier = .required },
13040 .{ .kind = .id_ref, .quantifier = .required },
13041 .{ .kind = .literal_integer, .quantifier = .required },
13042 .{ .kind = .literal_integer, .quantifier = .required },
13043 .{ .kind = .literal_integer, .quantifier = .required },
13044 .{ .kind = .literal_integer, .quantifier = .required },
13045 .{ .kind = .literal_integer, .quantifier = .required },
13046 },
13047 },
13048 .{
13049 .name = "OpArbitraryFloatExp10INTEL",
13050 .opcode = 5866,
13051 .operands = &.{
13052 .{ .kind = .id_result_type, .quantifier = .required },
13053 .{ .kind = .id_result, .quantifier = .required },
13054 .{ .kind = .id_ref, .quantifier = .required },
13055 .{ .kind = .literal_integer, .quantifier = .required },
13056 .{ .kind = .literal_integer, .quantifier = .required },
13057 .{ .kind = .literal_integer, .quantifier = .required },
13058 .{ .kind = .literal_integer, .quantifier = .required },
13059 .{ .kind = .literal_integer, .quantifier = .required },
13060 },
13061 },
13062 .{
13063 .name = "OpArbitraryFloatExpm1INTEL",
13064 .opcode = 5867,
13065 .operands = &.{
13066 .{ .kind = .id_result_type, .quantifier = .required },
13067 .{ .kind = .id_result, .quantifier = .required },
13068 .{ .kind = .id_ref, .quantifier = .required },
13069 .{ .kind = .literal_integer, .quantifier = .required },
13070 .{ .kind = .literal_integer, .quantifier = .required },
13071 .{ .kind = .literal_integer, .quantifier = .required },
13072 .{ .kind = .literal_integer, .quantifier = .required },
13073 .{ .kind = .literal_integer, .quantifier = .required },
13074 },
13075 },
13076 .{
13077 .name = "OpArbitraryFloatSinINTEL",
13078 .opcode = 5868,
13079 .operands = &.{
13080 .{ .kind = .id_result_type, .quantifier = .required },
13081 .{ .kind = .id_result, .quantifier = .required },
13082 .{ .kind = .id_ref, .quantifier = .required },
13083 .{ .kind = .literal_integer, .quantifier = .required },
13084 .{ .kind = .literal_integer, .quantifier = .required },
13085 .{ .kind = .literal_integer, .quantifier = .required },
13086 .{ .kind = .literal_integer, .quantifier = .required },
13087 .{ .kind = .literal_integer, .quantifier = .required },
13088 },
13089 },
13090 .{
13091 .name = "OpArbitraryFloatCosINTEL",
13092 .opcode = 5869,
13093 .operands = &.{
13094 .{ .kind = .id_result_type, .quantifier = .required },
13095 .{ .kind = .id_result, .quantifier = .required },
13096 .{ .kind = .id_ref, .quantifier = .required },
13097 .{ .kind = .literal_integer, .quantifier = .required },
13098 .{ .kind = .literal_integer, .quantifier = .required },
13099 .{ .kind = .literal_integer, .quantifier = .required },
13100 .{ .kind = .literal_integer, .quantifier = .required },
13101 .{ .kind = .literal_integer, .quantifier = .required },
13102 },
13103 },
13104 .{
13105 .name = "OpArbitraryFloatSinCosINTEL",
13106 .opcode = 5870,
13107 .operands = &.{
13108 .{ .kind = .id_result_type, .quantifier = .required },
13109 .{ .kind = .id_result, .quantifier = .required },
13110 .{ .kind = .id_ref, .quantifier = .required },
13111 .{ .kind = .literal_integer, .quantifier = .required },
13112 .{ .kind = .literal_integer, .quantifier = .required },
13113 .{ .kind = .literal_integer, .quantifier = .required },
13114 .{ .kind = .literal_integer, .quantifier = .required },
13115 .{ .kind = .literal_integer, .quantifier = .required },
13116 },
13117 },
13118 .{
13119 .name = "OpArbitraryFloatSinPiINTEL",
13120 .opcode = 5871,
13121 .operands = &.{
13122 .{ .kind = .id_result_type, .quantifier = .required },
13123 .{ .kind = .id_result, .quantifier = .required },
13124 .{ .kind = .id_ref, .quantifier = .required },
13125 .{ .kind = .literal_integer, .quantifier = .required },
13126 .{ .kind = .literal_integer, .quantifier = .required },
13127 .{ .kind = .literal_integer, .quantifier = .required },
13128 .{ .kind = .literal_integer, .quantifier = .required },
13129 .{ .kind = .literal_integer, .quantifier = .required },
13130 },
13131 },
13132 .{
13133 .name = "OpArbitraryFloatCosPiINTEL",
13134 .opcode = 5872,
13135 .operands = &.{
13136 .{ .kind = .id_result_type, .quantifier = .required },
13137 .{ .kind = .id_result, .quantifier = .required },
13138 .{ .kind = .id_ref, .quantifier = .required },
13139 .{ .kind = .literal_integer, .quantifier = .required },
13140 .{ .kind = .literal_integer, .quantifier = .required },
13141 .{ .kind = .literal_integer, .quantifier = .required },
13142 .{ .kind = .literal_integer, .quantifier = .required },
13143 .{ .kind = .literal_integer, .quantifier = .required },
13144 },
13145 },
13146 .{
13147 .name = "OpArbitraryFloatASinINTEL",
13148 .opcode = 5873,
13149 .operands = &.{
13150 .{ .kind = .id_result_type, .quantifier = .required },
13151 .{ .kind = .id_result, .quantifier = .required },
13152 .{ .kind = .id_ref, .quantifier = .required },
13153 .{ .kind = .literal_integer, .quantifier = .required },
13154 .{ .kind = .literal_integer, .quantifier = .required },
13155 .{ .kind = .literal_integer, .quantifier = .required },
13156 .{ .kind = .literal_integer, .quantifier = .required },
13157 .{ .kind = .literal_integer, .quantifier = .required },
13158 },
13159 },
13160 .{
13161 .name = "OpArbitraryFloatASinPiINTEL",
13162 .opcode = 5874,
13163 .operands = &.{
13164 .{ .kind = .id_result_type, .quantifier = .required },
13165 .{ .kind = .id_result, .quantifier = .required },
13166 .{ .kind = .id_ref, .quantifier = .required },
13167 .{ .kind = .literal_integer, .quantifier = .required },
13168 .{ .kind = .literal_integer, .quantifier = .required },
13169 .{ .kind = .literal_integer, .quantifier = .required },
13170 .{ .kind = .literal_integer, .quantifier = .required },
13171 .{ .kind = .literal_integer, .quantifier = .required },
13172 },
13173 },
13174 .{
13175 .name = "OpArbitraryFloatACosINTEL",
13176 .opcode = 5875,
13177 .operands = &.{
13178 .{ .kind = .id_result_type, .quantifier = .required },
13179 .{ .kind = .id_result, .quantifier = .required },
13180 .{ .kind = .id_ref, .quantifier = .required },
13181 .{ .kind = .literal_integer, .quantifier = .required },
13182 .{ .kind = .literal_integer, .quantifier = .required },
13183 .{ .kind = .literal_integer, .quantifier = .required },
13184 .{ .kind = .literal_integer, .quantifier = .required },
13185 .{ .kind = .literal_integer, .quantifier = .required },
13186 },
13187 },
13188 .{
13189 .name = "OpArbitraryFloatACosPiINTEL",
13190 .opcode = 5876,
13191 .operands = &.{
13192 .{ .kind = .id_result_type, .quantifier = .required },
13193 .{ .kind = .id_result, .quantifier = .required },
13194 .{ .kind = .id_ref, .quantifier = .required },
13195 .{ .kind = .literal_integer, .quantifier = .required },
13196 .{ .kind = .literal_integer, .quantifier = .required },
13197 .{ .kind = .literal_integer, .quantifier = .required },
13198 .{ .kind = .literal_integer, .quantifier = .required },
13199 .{ .kind = .literal_integer, .quantifier = .required },
13200 },
13201 },
13202 .{
13203 .name = "OpArbitraryFloatATanINTEL",
13204 .opcode = 5877,
13205 .operands = &.{
13206 .{ .kind = .id_result_type, .quantifier = .required },
13207 .{ .kind = .id_result, .quantifier = .required },
13208 .{ .kind = .id_ref, .quantifier = .required },
13209 .{ .kind = .literal_integer, .quantifier = .required },
13210 .{ .kind = .literal_integer, .quantifier = .required },
13211 .{ .kind = .literal_integer, .quantifier = .required },
13212 .{ .kind = .literal_integer, .quantifier = .required },
13213 .{ .kind = .literal_integer, .quantifier = .required },
13214 },
13215 },
13216 .{
13217 .name = "OpArbitraryFloatATanPiINTEL",
13218 .opcode = 5878,
13219 .operands = &.{
13220 .{ .kind = .id_result_type, .quantifier = .required },
13221 .{ .kind = .id_result, .quantifier = .required },
13222 .{ .kind = .id_ref, .quantifier = .required },
13223 .{ .kind = .literal_integer, .quantifier = .required },
13224 .{ .kind = .literal_integer, .quantifier = .required },
13225 .{ .kind = .literal_integer, .quantifier = .required },
13226 .{ .kind = .literal_integer, .quantifier = .required },
13227 .{ .kind = .literal_integer, .quantifier = .required },
13228 },
13229 },
13230 .{
13231 .name = "OpArbitraryFloatATan2INTEL",
13232 .opcode = 5879,
13233 .operands = &.{
13234 .{ .kind = .id_result_type, .quantifier = .required },
13235 .{ .kind = .id_result, .quantifier = .required },
13236 .{ .kind = .id_ref, .quantifier = .required },
13237 .{ .kind = .literal_integer, .quantifier = .required },
13238 .{ .kind = .id_ref, .quantifier = .required },
13239 .{ .kind = .literal_integer, .quantifier = .required },
13240 .{ .kind = .literal_integer, .quantifier = .required },
13241 .{ .kind = .literal_integer, .quantifier = .required },
13242 .{ .kind = .literal_integer, .quantifier = .required },
13243 .{ .kind = .literal_integer, .quantifier = .required },
13244 },
13245 },
13246 .{
13247 .name = "OpArbitraryFloatPowINTEL",
13248 .opcode = 5880,
13249 .operands = &.{
13250 .{ .kind = .id_result_type, .quantifier = .required },
13251 .{ .kind = .id_result, .quantifier = .required },
13252 .{ .kind = .id_ref, .quantifier = .required },
13253 .{ .kind = .literal_integer, .quantifier = .required },
13254 .{ .kind = .id_ref, .quantifier = .required },
13255 .{ .kind = .literal_integer, .quantifier = .required },
13256 .{ .kind = .literal_integer, .quantifier = .required },
13257 .{ .kind = .literal_integer, .quantifier = .required },
13258 .{ .kind = .literal_integer, .quantifier = .required },
13259 .{ .kind = .literal_integer, .quantifier = .required },
13260 },
13261 },
13262 .{
13263 .name = "OpArbitraryFloatPowRINTEL",
13264 .opcode = 5881,
13265 .operands = &.{
13266 .{ .kind = .id_result_type, .quantifier = .required },
13267 .{ .kind = .id_result, .quantifier = .required },
13268 .{ .kind = .id_ref, .quantifier = .required },
13269 .{ .kind = .literal_integer, .quantifier = .required },
13270 .{ .kind = .id_ref, .quantifier = .required },
13271 .{ .kind = .literal_integer, .quantifier = .required },
13272 .{ .kind = .literal_integer, .quantifier = .required },
13273 .{ .kind = .literal_integer, .quantifier = .required },
13274 .{ .kind = .literal_integer, .quantifier = .required },
13275 .{ .kind = .literal_integer, .quantifier = .required },
13276 },
13277 },
13278 .{
13279 .name = "OpArbitraryFloatPowNINTEL",
13280 .opcode = 5882,
13281 .operands = &.{
13282 .{ .kind = .id_result_type, .quantifier = .required },
13283 .{ .kind = .id_result, .quantifier = .required },
13284 .{ .kind = .id_ref, .quantifier = .required },
13285 .{ .kind = .literal_integer, .quantifier = .required },
13286 .{ .kind = .id_ref, .quantifier = .required },
13287 .{ .kind = .literal_integer, .quantifier = .required },
13288 .{ .kind = .literal_integer, .quantifier = .required },
13289 .{ .kind = .literal_integer, .quantifier = .required },
13290 .{ .kind = .literal_integer, .quantifier = .required },
13291 .{ .kind = .literal_integer, .quantifier = .required },
13292 },
13293 },
13294 .{
13295 .name = "OpLoopControlINTEL",
13296 .opcode = 5887,
13297 .operands = &.{
13298 .{ .kind = .literal_integer, .quantifier = .variadic },
13299 },
13300 },
13301 .{
13302 .name = "OpAliasDomainDeclINTEL",
13303 .opcode = 5911,
13304 .operands = &.{
13305 .{ .kind = .id_result, .quantifier = .required },
13306 .{ .kind = .id_ref, .quantifier = .optional },
13307 },
13308 },
13309 .{
13310 .name = "OpAliasScopeDeclINTEL",
13311 .opcode = 5912,
13312 .operands = &.{
13313 .{ .kind = .id_result, .quantifier = .required },
13314 .{ .kind = .id_ref, .quantifier = .required },
13315 .{ .kind = .id_ref, .quantifier = .optional },
13316 },
13317 },
13318 .{
13319 .name = "OpAliasScopeListDeclINTEL",
13320 .opcode = 5913,
13321 .operands = &.{
13322 .{ .kind = .id_result, .quantifier = .required },
13323 .{ .kind = .id_ref, .quantifier = .variadic },
13324 },
13325 },
13326 .{
13327 .name = "OpFixedSqrtINTEL",
13328 .opcode = 5923,
13329 .operands = &.{
13330 .{ .kind = .id_result_type, .quantifier = .required },
13331 .{ .kind = .id_result, .quantifier = .required },
13332 .{ .kind = .id_ref, .quantifier = .required },
13333 .{ .kind = .literal_integer, .quantifier = .required },
13334 .{ .kind = .literal_integer, .quantifier = .required },
13335 .{ .kind = .literal_integer, .quantifier = .required },
13336 .{ .kind = .literal_integer, .quantifier = .required },
13337 .{ .kind = .literal_integer, .quantifier = .required },
13338 },
13339 },
13340 .{
13341 .name = "OpFixedRecipINTEL",
13342 .opcode = 5924,
13343 .operands = &.{
13344 .{ .kind = .id_result_type, .quantifier = .required },
13345 .{ .kind = .id_result, .quantifier = .required },
13346 .{ .kind = .id_ref, .quantifier = .required },
13347 .{ .kind = .literal_integer, .quantifier = .required },
13348 .{ .kind = .literal_integer, .quantifier = .required },
13349 .{ .kind = .literal_integer, .quantifier = .required },
13350 .{ .kind = .literal_integer, .quantifier = .required },
13351 .{ .kind = .literal_integer, .quantifier = .required },
13352 },
13353 },
13354 .{
13355 .name = "OpFixedRsqrtINTEL",
13356 .opcode = 5925,
13357 .operands = &.{
13358 .{ .kind = .id_result_type, .quantifier = .required },
13359 .{ .kind = .id_result, .quantifier = .required },
13360 .{ .kind = .id_ref, .quantifier = .required },
13361 .{ .kind = .literal_integer, .quantifier = .required },
13362 .{ .kind = .literal_integer, .quantifier = .required },
13363 .{ .kind = .literal_integer, .quantifier = .required },
13364 .{ .kind = .literal_integer, .quantifier = .required },
13365 .{ .kind = .literal_integer, .quantifier = .required },
13366 },
13367 },
13368 .{
13369 .name = "OpFixedSinINTEL",
13370 .opcode = 5926,
13371 .operands = &.{
13372 .{ .kind = .id_result_type, .quantifier = .required },
13373 .{ .kind = .id_result, .quantifier = .required },
13374 .{ .kind = .id_ref, .quantifier = .required },
13375 .{ .kind = .literal_integer, .quantifier = .required },
13376 .{ .kind = .literal_integer, .quantifier = .required },
13377 .{ .kind = .literal_integer, .quantifier = .required },
13378 .{ .kind = .literal_integer, .quantifier = .required },
13379 .{ .kind = .literal_integer, .quantifier = .required },
13380 },
13381 },
13382 .{
13383 .name = "OpFixedCosINTEL",
13384 .opcode = 5927,
13385 .operands = &.{
13386 .{ .kind = .id_result_type, .quantifier = .required },
13387 .{ .kind = .id_result, .quantifier = .required },
13388 .{ .kind = .id_ref, .quantifier = .required },
13389 .{ .kind = .literal_integer, .quantifier = .required },
13390 .{ .kind = .literal_integer, .quantifier = .required },
13391 .{ .kind = .literal_integer, .quantifier = .required },
13392 .{ .kind = .literal_integer, .quantifier = .required },
13393 .{ .kind = .literal_integer, .quantifier = .required },
13394 },
13395 },
13396 .{
13397 .name = "OpFixedSinCosINTEL",
13398 .opcode = 5928,
13399 .operands = &.{
13400 .{ .kind = .id_result_type, .quantifier = .required },
13401 .{ .kind = .id_result, .quantifier = .required },
13402 .{ .kind = .id_ref, .quantifier = .required },
13403 .{ .kind = .literal_integer, .quantifier = .required },
13404 .{ .kind = .literal_integer, .quantifier = .required },
13405 .{ .kind = .literal_integer, .quantifier = .required },
13406 .{ .kind = .literal_integer, .quantifier = .required },
13407 .{ .kind = .literal_integer, .quantifier = .required },
13408 },
13409 },
13410 .{
13411 .name = "OpFixedSinPiINTEL",
13412 .opcode = 5929,
13413 .operands = &.{
13414 .{ .kind = .id_result_type, .quantifier = .required },
13415 .{ .kind = .id_result, .quantifier = .required },
13416 .{ .kind = .id_ref, .quantifier = .required },
13417 .{ .kind = .literal_integer, .quantifier = .required },
13418 .{ .kind = .literal_integer, .quantifier = .required },
13419 .{ .kind = .literal_integer, .quantifier = .required },
13420 .{ .kind = .literal_integer, .quantifier = .required },
13421 .{ .kind = .literal_integer, .quantifier = .required },
13422 },
13423 },
13424 .{
13425 .name = "OpFixedCosPiINTEL",
13426 .opcode = 5930,
13427 .operands = &.{
13428 .{ .kind = .id_result_type, .quantifier = .required },
13429 .{ .kind = .id_result, .quantifier = .required },
13430 .{ .kind = .id_ref, .quantifier = .required },
13431 .{ .kind = .literal_integer, .quantifier = .required },
13432 .{ .kind = .literal_integer, .quantifier = .required },
13433 .{ .kind = .literal_integer, .quantifier = .required },
13434 .{ .kind = .literal_integer, .quantifier = .required },
13435 .{ .kind = .literal_integer, .quantifier = .required },
13436 },
13437 },
13438 .{
13439 .name = "OpFixedSinCosPiINTEL",
13440 .opcode = 5931,
13441 .operands = &.{
13442 .{ .kind = .id_result_type, .quantifier = .required },
13443 .{ .kind = .id_result, .quantifier = .required },
13444 .{ .kind = .id_ref, .quantifier = .required },
13445 .{ .kind = .literal_integer, .quantifier = .required },
13446 .{ .kind = .literal_integer, .quantifier = .required },
13447 .{ .kind = .literal_integer, .quantifier = .required },
13448 .{ .kind = .literal_integer, .quantifier = .required },
13449 .{ .kind = .literal_integer, .quantifier = .required },
13450 },
13451 },
13452 .{
13453 .name = "OpFixedLogINTEL",
13454 .opcode = 5932,
13455 .operands = &.{
13456 .{ .kind = .id_result_type, .quantifier = .required },
13457 .{ .kind = .id_result, .quantifier = .required },
13458 .{ .kind = .id_ref, .quantifier = .required },
13459 .{ .kind = .literal_integer, .quantifier = .required },
13460 .{ .kind = .literal_integer, .quantifier = .required },
13461 .{ .kind = .literal_integer, .quantifier = .required },
13462 .{ .kind = .literal_integer, .quantifier = .required },
13463 .{ .kind = .literal_integer, .quantifier = .required },
13464 },
13465 },
13466 .{
13467 .name = "OpFixedExpINTEL",
13468 .opcode = 5933,
13469 .operands = &.{
13470 .{ .kind = .id_result_type, .quantifier = .required },
13471 .{ .kind = .id_result, .quantifier = .required },
13472 .{ .kind = .id_ref, .quantifier = .required },
13473 .{ .kind = .literal_integer, .quantifier = .required },
13474 .{ .kind = .literal_integer, .quantifier = .required },
13475 .{ .kind = .literal_integer, .quantifier = .required },
13476 .{ .kind = .literal_integer, .quantifier = .required },
13477 .{ .kind = .literal_integer, .quantifier = .required },
13478 },
13479 },
13480 .{
13481 .name = "OpPtrCastToCrossWorkgroupINTEL",
13482 .opcode = 5934,
13483 .operands = &.{
13484 .{ .kind = .id_result_type, .quantifier = .required },
13485 .{ .kind = .id_result, .quantifier = .required },
13486 .{ .kind = .id_ref, .quantifier = .required },
13487 },
13488 },
13489 .{
13490 .name = "OpCrossWorkgroupCastToPtrINTEL",
13491 .opcode = 5938,
13492 .operands = &.{
13493 .{ .kind = .id_result_type, .quantifier = .required },
13494 .{ .kind = .id_result, .quantifier = .required },
13495 .{ .kind = .id_ref, .quantifier = .required },
13496 },
13497 },
13498 .{
13499 .name = "OpReadPipeBlockingINTEL",
13500 .opcode = 5946,
13501 .operands = &.{
13502 .{ .kind = .id_result_type, .quantifier = .required },
13503 .{ .kind = .id_result, .quantifier = .required },
13504 .{ .kind = .id_ref, .quantifier = .required },
13505 .{ .kind = .id_ref, .quantifier = .required },
13506 },
13507 },
13508 .{
13509 .name = "OpWritePipeBlockingINTEL",
13510 .opcode = 5947,
13511 .operands = &.{
13512 .{ .kind = .id_result_type, .quantifier = .required },
13513 .{ .kind = .id_result, .quantifier = .required },
13514 .{ .kind = .id_ref, .quantifier = .required },
13515 .{ .kind = .id_ref, .quantifier = .required },
13516 },
13517 },
13518 .{
13519 .name = "OpFPGARegINTEL",
13520 .opcode = 5949,
13521 .operands = &.{
13522 .{ .kind = .id_result_type, .quantifier = .required },
13523 .{ .kind = .id_result, .quantifier = .required },
13524 .{ .kind = .id_ref, .quantifier = .required },
13525 },
13526 },
13527 .{
13528 .name = "OpRayQueryGetRayTMinKHR",
13529 .opcode = 6016,
13530 .operands = &.{
13531 .{ .kind = .id_result_type, .quantifier = .required },
13532 .{ .kind = .id_result, .quantifier = .required },
13533 .{ .kind = .id_ref, .quantifier = .required },
13534 },
13535 },
13536 .{
13537 .name = "OpRayQueryGetRayFlagsKHR",
13538 .opcode = 6017,
13539 .operands = &.{
13540 .{ .kind = .id_result_type, .quantifier = .required },
13541 .{ .kind = .id_result, .quantifier = .required },
13542 .{ .kind = .id_ref, .quantifier = .required },
13543 },
13544 },
13545 .{
13546 .name = "OpRayQueryGetIntersectionTKHR",
13547 .opcode = 6018,
13548 .operands = &.{
13549 .{ .kind = .id_result_type, .quantifier = .required },
13550 .{ .kind = .id_result, .quantifier = .required },
13551 .{ .kind = .id_ref, .quantifier = .required },
13552 .{ .kind = .id_ref, .quantifier = .required },
13553 },
13554 },
13555 .{
13556 .name = "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
13557 .opcode = 6019,
13558 .operands = &.{
13559 .{ .kind = .id_result_type, .quantifier = .required },
13560 .{ .kind = .id_result, .quantifier = .required },
13561 .{ .kind = .id_ref, .quantifier = .required },
13562 .{ .kind = .id_ref, .quantifier = .required },
13563 },
13564 },
13565 .{
13566 .name = "OpRayQueryGetIntersectionInstanceIdKHR",
13567 .opcode = 6020,
13568 .operands = &.{
13569 .{ .kind = .id_result_type, .quantifier = .required },
13570 .{ .kind = .id_result, .quantifier = .required },
13571 .{ .kind = .id_ref, .quantifier = .required },
13572 .{ .kind = .id_ref, .quantifier = .required },
13573 },
13574 },
13575 .{
13576 .name = "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
13577 .opcode = 6021,
13578 .operands = &.{
13579 .{ .kind = .id_result_type, .quantifier = .required },
13580 .{ .kind = .id_result, .quantifier = .required },
13581 .{ .kind = .id_ref, .quantifier = .required },
13582 .{ .kind = .id_ref, .quantifier = .required },
13583 },
13584 },
13585 .{
13586 .name = "OpRayQueryGetIntersectionGeometryIndexKHR",
13587 .opcode = 6022,
13588 .operands = &.{
13589 .{ .kind = .id_result_type, .quantifier = .required },
13590 .{ .kind = .id_result, .quantifier = .required },
13591 .{ .kind = .id_ref, .quantifier = .required },
13592 .{ .kind = .id_ref, .quantifier = .required },
13593 },
13594 },
13595 .{
13596 .name = "OpRayQueryGetIntersectionPrimitiveIndexKHR",
13597 .opcode = 6023,
13598 .operands = &.{
13599 .{ .kind = .id_result_type, .quantifier = .required },
13600 .{ .kind = .id_result, .quantifier = .required },
13601 .{ .kind = .id_ref, .quantifier = .required },
13602 .{ .kind = .id_ref, .quantifier = .required },
13603 },
13604 },
13605 .{
13606 .name = "OpRayQueryGetIntersectionBarycentricsKHR",
13607 .opcode = 6024,
13608 .operands = &.{
13609 .{ .kind = .id_result_type, .quantifier = .required },
13610 .{ .kind = .id_result, .quantifier = .required },
13611 .{ .kind = .id_ref, .quantifier = .required },
13612 .{ .kind = .id_ref, .quantifier = .required },
13613 },
13614 },
13615 .{
13616 .name = "OpRayQueryGetIntersectionFrontFaceKHR",
13617 .opcode = 6025,
13618 .operands = &.{
13619 .{ .kind = .id_result_type, .quantifier = .required },
13620 .{ .kind = .id_result, .quantifier = .required },
13621 .{ .kind = .id_ref, .quantifier = .required },
13622 .{ .kind = .id_ref, .quantifier = .required },
13623 },
13624 },
13625 .{
13626 .name = "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
13627 .opcode = 6026,
13628 .operands = &.{
13629 .{ .kind = .id_result_type, .quantifier = .required },
13630 .{ .kind = .id_result, .quantifier = .required },
13631 .{ .kind = .id_ref, .quantifier = .required },
13632 },
13633 },
13634 .{
13635 .name = "OpRayQueryGetIntersectionObjectRayDirectionKHR",
13636 .opcode = 6027,
13637 .operands = &.{
13638 .{ .kind = .id_result_type, .quantifier = .required },
13639 .{ .kind = .id_result, .quantifier = .required },
13640 .{ .kind = .id_ref, .quantifier = .required },
13641 .{ .kind = .id_ref, .quantifier = .required },
13642 },
13643 },
13644 .{
13645 .name = "OpRayQueryGetIntersectionObjectRayOriginKHR",
13646 .opcode = 6028,
13647 .operands = &.{
13648 .{ .kind = .id_result_type, .quantifier = .required },
13649 .{ .kind = .id_result, .quantifier = .required },
13650 .{ .kind = .id_ref, .quantifier = .required },
13651 .{ .kind = .id_ref, .quantifier = .required },
13652 },
13653 },
13654 .{
13655 .name = "OpRayQueryGetWorldRayDirectionKHR",
13656 .opcode = 6029,
13657 .operands = &.{
13658 .{ .kind = .id_result_type, .quantifier = .required },
13659 .{ .kind = .id_result, .quantifier = .required },
13660 .{ .kind = .id_ref, .quantifier = .required },
13661 },
13662 },
13663 .{
13664 .name = "OpRayQueryGetWorldRayOriginKHR",
13665 .opcode = 6030,
13666 .operands = &.{
13667 .{ .kind = .id_result_type, .quantifier = .required },
13668 .{ .kind = .id_result, .quantifier = .required },
13669 .{ .kind = .id_ref, .quantifier = .required },
13670 },
13671 },
13672 .{
13673 .name = "OpRayQueryGetIntersectionObjectToWorldKHR",
13674 .opcode = 6031,
13675 .operands = &.{
13676 .{ .kind = .id_result_type, .quantifier = .required },
13677 .{ .kind = .id_result, .quantifier = .required },
13678 .{ .kind = .id_ref, .quantifier = .required },
13679 .{ .kind = .id_ref, .quantifier = .required },
13680 },
13681 },
13682 .{
13683 .name = "OpRayQueryGetIntersectionWorldToObjectKHR",
13684 .opcode = 6032,
13685 .operands = &.{
13686 .{ .kind = .id_result_type, .quantifier = .required },
13687 .{ .kind = .id_result, .quantifier = .required },
13688 .{ .kind = .id_ref, .quantifier = .required },
13689 .{ .kind = .id_ref, .quantifier = .required },
13690 },
13691 },
13692 .{
13693 .name = "OpAtomicFAddEXT",
13694 .opcode = 6035,
13695 .operands = &.{
13696 .{ .kind = .id_result_type, .quantifier = .required },
13697 .{ .kind = .id_result, .quantifier = .required },
13698 .{ .kind = .id_ref, .quantifier = .required },
13699 .{ .kind = .id_scope, .quantifier = .required },
13700 .{ .kind = .id_memory_semantics, .quantifier = .required },
13701 .{ .kind = .id_ref, .quantifier = .required },
13702 },
13703 },
13704 .{
13705 .name = "OpTypeBufferSurfaceINTEL",
13706 .opcode = 6086,
13707 .operands = &.{
13708 .{ .kind = .id_result, .quantifier = .required },
13709 .{ .kind = .access_qualifier, .quantifier = .required },
13710 },
13711 },
13712 .{
13713 .name = "OpTypeStructContinuedINTEL",
13714 .opcode = 6090,
13715 .operands = &.{
13716 .{ .kind = .id_ref, .quantifier = .variadic },
13717 },
13718 },
13719 .{
13720 .name = "OpConstantCompositeContinuedINTEL",
13721 .opcode = 6091,
13722 .operands = &.{
13723 .{ .kind = .id_ref, .quantifier = .variadic },
13724 },
13725 },
13726 .{
13727 .name = "OpSpecConstantCompositeContinuedINTEL",
13728 .opcode = 6092,
13729 .operands = &.{
13730 .{ .kind = .id_ref, .quantifier = .variadic },
13731 },
13732 },
13733 .{
13734 .name = "OpCompositeConstructContinuedINTEL",
13735 .opcode = 6096,
13736 .operands = &.{
13737 .{ .kind = .id_result_type, .quantifier = .required },
13738 .{ .kind = .id_result, .quantifier = .required },
13739 .{ .kind = .id_ref, .quantifier = .variadic },
13740 },
13741 },
13742 .{
13743 .name = "OpConvertFToBF16INTEL",
13744 .opcode = 6116,
13745 .operands = &.{
13746 .{ .kind = .id_result_type, .quantifier = .required },
13747 .{ .kind = .id_result, .quantifier = .required },
13748 .{ .kind = .id_ref, .quantifier = .required },
13749 },
13750 },
13751 .{
13752 .name = "OpConvertBF16ToFINTEL",
13753 .opcode = 6117,
13754 .operands = &.{
13755 .{ .kind = .id_result_type, .quantifier = .required },
13756 .{ .kind = .id_result, .quantifier = .required },
13757 .{ .kind = .id_ref, .quantifier = .required },
13758 },
13759 },
13760 .{
13761 .name = "OpControlBarrierArriveINTEL",
13762 .opcode = 6142,
13763 .operands = &.{
13764 .{ .kind = .id_scope, .quantifier = .required },
13765 .{ .kind = .id_scope, .quantifier = .required },
13766 .{ .kind = .id_memory_semantics, .quantifier = .required },
13767 },
13768 },
13769 .{
13770 .name = "OpControlBarrierWaitINTEL",
13771 .opcode = 6143,
13772 .operands = &.{
13773 .{ .kind = .id_scope, .quantifier = .required },
13774 .{ .kind = .id_scope, .quantifier = .required },
13775 .{ .kind = .id_memory_semantics, .quantifier = .required },
13776 },
13777 },
13778 .{
13779 .name = "OpArithmeticFenceEXT",
13780 .opcode = 6145,
13781 .operands = &.{
13782 .{ .kind = .id_result_type, .quantifier = .required },
13783 .{ .kind = .id_result, .quantifier = .required },
13784 .{ .kind = .id_ref, .quantifier = .required },
13785 },
13786 },
13787 .{
13788 .name = "OpTaskSequenceCreateINTEL",
13789 .opcode = 6163,
13790 .operands = &.{
13791 .{ .kind = .id_result_type, .quantifier = .required },
13792 .{ .kind = .id_result, .quantifier = .required },
13793 .{ .kind = .id_ref, .quantifier = .required },
13794 .{ .kind = .literal_integer, .quantifier = .required },
13795 .{ .kind = .literal_integer, .quantifier = .required },
13796 .{ .kind = .literal_integer, .quantifier = .required },
13797 .{ .kind = .literal_integer, .quantifier = .required },
13798 },
13799 },
13800 .{
13801 .name = "OpTaskSequenceAsyncINTEL",
13802 .opcode = 6164,
13803 .operands = &.{
13804 .{ .kind = .id_ref, .quantifier = .required },
13805 .{ .kind = .id_ref, .quantifier = .variadic },
13806 },
13807 },
13808 .{
13809 .name = "OpTaskSequenceGetINTEL",
13810 .opcode = 6165,
13811 .operands = &.{
13812 .{ .kind = .id_result_type, .quantifier = .required },
13813 .{ .kind = .id_result, .quantifier = .required },
13814 .{ .kind = .id_ref, .quantifier = .required },
13815 },
13816 },
13817 .{
13818 .name = "OpTaskSequenceReleaseINTEL",
13819 .opcode = 6166,
13820 .operands = &.{
13821 .{ .kind = .id_ref, .quantifier = .required },
13822 },
13823 },
13824 .{
13825 .name = "OpTypeTaskSequenceINTEL",
13826 .opcode = 6199,
13827 .operands = &.{
13828 .{ .kind = .id_result, .quantifier = .required },
13829 },
13830 },
13831 .{
13832 .name = "OpSubgroupBlockPrefetchINTEL",
13833 .opcode = 6221,
13834 .operands = &.{
13835 .{ .kind = .id_ref, .quantifier = .required },
13836 .{ .kind = .id_ref, .quantifier = .required },
13837 .{ .kind = .memory_access, .quantifier = .optional },
13838 },
13839 },
13840 .{
13841 .name = "OpSubgroup2DBlockLoadINTEL",
13842 .opcode = 6231,
13843 .operands = &.{
13844 .{ .kind = .id_ref, .quantifier = .required },
13845 .{ .kind = .id_ref, .quantifier = .required },
13846 .{ .kind = .id_ref, .quantifier = .required },
13847 .{ .kind = .id_ref, .quantifier = .required },
13848 .{ .kind = .id_ref, .quantifier = .required },
13849 .{ .kind = .id_ref, .quantifier = .required },
13850 .{ .kind = .id_ref, .quantifier = .required },
13851 .{ .kind = .id_ref, .quantifier = .required },
13852 .{ .kind = .id_ref, .quantifier = .required },
13853 .{ .kind = .id_ref, .quantifier = .required },
13854 },
13855 },
13856 .{
13857 .name = "OpSubgroup2DBlockLoadTransformINTEL",
13858 .opcode = 6232,
13859 .operands = &.{
13860 .{ .kind = .id_ref, .quantifier = .required },
13861 .{ .kind = .id_ref, .quantifier = .required },
13862 .{ .kind = .id_ref, .quantifier = .required },
13863 .{ .kind = .id_ref, .quantifier = .required },
13864 .{ .kind = .id_ref, .quantifier = .required },
13865 .{ .kind = .id_ref, .quantifier = .required },
13866 .{ .kind = .id_ref, .quantifier = .required },
13867 .{ .kind = .id_ref, .quantifier = .required },
13868 .{ .kind = .id_ref, .quantifier = .required },
13869 .{ .kind = .id_ref, .quantifier = .required },
13870 },
13871 },
13872 .{
13873 .name = "OpSubgroup2DBlockLoadTransposeINTEL",
13874 .opcode = 6233,
13875 .operands = &.{
13876 .{ .kind = .id_ref, .quantifier = .required },
13877 .{ .kind = .id_ref, .quantifier = .required },
13878 .{ .kind = .id_ref, .quantifier = .required },
13879 .{ .kind = .id_ref, .quantifier = .required },
13880 .{ .kind = .id_ref, .quantifier = .required },
13881 .{ .kind = .id_ref, .quantifier = .required },
13882 .{ .kind = .id_ref, .quantifier = .required },
13883 .{ .kind = .id_ref, .quantifier = .required },
13884 .{ .kind = .id_ref, .quantifier = .required },
13885 .{ .kind = .id_ref, .quantifier = .required },
13886 },
13887 },
13888 .{
13889 .name = "OpSubgroup2DBlockPrefetchINTEL",
13890 .opcode = 6234,
13891 .operands = &.{
13892 .{ .kind = .id_ref, .quantifier = .required },
13893 .{ .kind = .id_ref, .quantifier = .required },
13894 .{ .kind = .id_ref, .quantifier = .required },
13895 .{ .kind = .id_ref, .quantifier = .required },
13896 .{ .kind = .id_ref, .quantifier = .required },
13897 .{ .kind = .id_ref, .quantifier = .required },
13898 .{ .kind = .id_ref, .quantifier = .required },
13899 .{ .kind = .id_ref, .quantifier = .required },
13900 .{ .kind = .id_ref, .quantifier = .required },
13901 },
13902 },
13903 .{
13904 .name = "OpSubgroup2DBlockStoreINTEL",
13905 .opcode = 6235,
13906 .operands = &.{
13907 .{ .kind = .id_ref, .quantifier = .required },
13908 .{ .kind = .id_ref, .quantifier = .required },
13909 .{ .kind = .id_ref, .quantifier = .required },
13910 .{ .kind = .id_ref, .quantifier = .required },
13911 .{ .kind = .id_ref, .quantifier = .required },
13912 .{ .kind = .id_ref, .quantifier = .required },
13913 .{ .kind = .id_ref, .quantifier = .required },
13914 .{ .kind = .id_ref, .quantifier = .required },
13915 .{ .kind = .id_ref, .quantifier = .required },
13916 .{ .kind = .id_ref, .quantifier = .required },
13917 },
13918 },
13919 .{
13920 .name = "OpSubgroupMatrixMultiplyAccumulateINTEL",
13921 .opcode = 6237,
13922 .operands = &.{
13923 .{ .kind = .id_result_type, .quantifier = .required },
13924 .{ .kind = .id_result, .quantifier = .required },
13925 .{ .kind = .id_ref, .quantifier = .required },
13926 .{ .kind = .id_ref, .quantifier = .required },
13927 .{ .kind = .id_ref, .quantifier = .required },
13928 .{ .kind = .id_ref, .quantifier = .required },
13929 .{ .kind = .matrix_multiply_accumulate_operands, .quantifier = .optional },
13930 },
13931 },
13932 .{
13933 .name = "OpBitwiseFunctionINTEL",
13934 .opcode = 6242,
13935 .operands = &.{
13936 .{ .kind = .id_result_type, .quantifier = .required },
13937 .{ .kind = .id_result, .quantifier = .required },
13938 .{ .kind = .id_ref, .quantifier = .required },
13939 .{ .kind = .id_ref, .quantifier = .required },
13940 .{ .kind = .id_ref, .quantifier = .required },
13941 .{ .kind = .id_ref, .quantifier = .required },
13942 },
13943 },
13944 .{
13945 .name = "OpGroupIMulKHR",
13946 .opcode = 6401,
13947 .operands = &.{
13948 .{ .kind = .id_result_type, .quantifier = .required },
13949 .{ .kind = .id_result, .quantifier = .required },
13950 .{ .kind = .id_scope, .quantifier = .required },
13951 .{ .kind = .group_operation, .quantifier = .required },
13952 .{ .kind = .id_ref, .quantifier = .required },
13953 },
13954 },
13955 .{
13956 .name = "OpGroupFMulKHR",
13957 .opcode = 6402,
13958 .operands = &.{
13959 .{ .kind = .id_result_type, .quantifier = .required },
13960 .{ .kind = .id_result, .quantifier = .required },
13961 .{ .kind = .id_scope, .quantifier = .required },
13962 .{ .kind = .group_operation, .quantifier = .required },
13963 .{ .kind = .id_ref, .quantifier = .required },
13964 },
13965 },
13966 .{
13967 .name = "OpGroupBitwiseAndKHR",
13968 .opcode = 6403,
13969 .operands = &.{
13970 .{ .kind = .id_result_type, .quantifier = .required },
13971 .{ .kind = .id_result, .quantifier = .required },
13972 .{ .kind = .id_scope, .quantifier = .required },
13973 .{ .kind = .group_operation, .quantifier = .required },
13974 .{ .kind = .id_ref, .quantifier = .required },
13975 },
13976 },
13977 .{
13978 .name = "OpGroupBitwiseOrKHR",
13979 .opcode = 6404,
13980 .operands = &.{
13981 .{ .kind = .id_result_type, .quantifier = .required },
13982 .{ .kind = .id_result, .quantifier = .required },
13983 .{ .kind = .id_scope, .quantifier = .required },
13984 .{ .kind = .group_operation, .quantifier = .required },
13985 .{ .kind = .id_ref, .quantifier = .required },
13986 },
13987 },
13988 .{
13989 .name = "OpGroupBitwiseXorKHR",
13990 .opcode = 6405,
13991 .operands = &.{
13992 .{ .kind = .id_result_type, .quantifier = .required },
13993 .{ .kind = .id_result, .quantifier = .required },
13994 .{ .kind = .id_scope, .quantifier = .required },
13995 .{ .kind = .group_operation, .quantifier = .required },
13996 .{ .kind = .id_ref, .quantifier = .required },
13997 },
13998 },
13999 .{
14000 .name = "OpGroupLogicalAndKHR",
14001 .opcode = 6406,
14002 .operands = &.{
14003 .{ .kind = .id_result_type, .quantifier = .required },
14004 .{ .kind = .id_result, .quantifier = .required },
14005 .{ .kind = .id_scope, .quantifier = .required },
14006 .{ .kind = .group_operation, .quantifier = .required },
14007 .{ .kind = .id_ref, .quantifier = .required },
14008 },
14009 },
14010 .{
14011 .name = "OpGroupLogicalOrKHR",
14012 .opcode = 6407,
14013 .operands = &.{
14014 .{ .kind = .id_result_type, .quantifier = .required },
14015 .{ .kind = .id_result, .quantifier = .required },
14016 .{ .kind = .id_scope, .quantifier = .required },
14017 .{ .kind = .group_operation, .quantifier = .required },
14018 .{ .kind = .id_ref, .quantifier = .required },
14019 },
14020 },
14021 .{
14022 .name = "OpGroupLogicalXorKHR",
14023 .opcode = 6408,
14024 .operands = &.{
14025 .{ .kind = .id_result_type, .quantifier = .required },
14026 .{ .kind = .id_result, .quantifier = .required },
14027 .{ .kind = .id_scope, .quantifier = .required },
14028 .{ .kind = .group_operation, .quantifier = .required },
14029 .{ .kind = .id_ref, .quantifier = .required },
14030 },
14031 },
14032 .{
14033 .name = "OpRoundFToTF32INTEL",
14034 .opcode = 6426,
14035 .operands = &.{
14036 .{ .kind = .id_result_type, .quantifier = .required },
14037 .{ .kind = .id_result, .quantifier = .required },
14038 .{ .kind = .id_ref, .quantifier = .required },
14039 },
14040 },
14041 .{
14042 .name = "OpMaskedGatherINTEL",
14043 .opcode = 6428,
14044 .operands = &.{
14045 .{ .kind = .id_result_type, .quantifier = .required },
14046 .{ .kind = .id_result, .quantifier = .required },
14047 .{ .kind = .id_ref, .quantifier = .required },
14048 .{ .kind = .literal_integer, .quantifier = .required },
14049 .{ .kind = .id_ref, .quantifier = .required },
14050 .{ .kind = .id_ref, .quantifier = .required },
14051 },
14052 },
14053 .{
14054 .name = "OpMaskedScatterINTEL",
14055 .opcode = 6429,
14056 .operands = &.{
14057 .{ .kind = .id_ref, .quantifier = .required },
14058 .{ .kind = .id_ref, .quantifier = .required },
14059 .{ .kind = .literal_integer, .quantifier = .required },
14060 .{ .kind = .id_ref, .quantifier = .required },
14061 },
14062 },
14063 .{
14064 .name = "OpConvertHandleToImageINTEL",
14065 .opcode = 6529,
14066 .operands = &.{
14067 .{ .kind = .id_result_type, .quantifier = .required },
14068 .{ .kind = .id_result, .quantifier = .required },
14069 .{ .kind = .id_ref, .quantifier = .required },
14070 },
14071 },
14072 .{
14073 .name = "OpConvertHandleToSamplerINTEL",
14074 .opcode = 6530,
14075 .operands = &.{
14076 .{ .kind = .id_result_type, .quantifier = .required },
14077 .{ .kind = .id_result, .quantifier = .required },
14078 .{ .kind = .id_ref, .quantifier = .required },
14079 },
14080 },
14081 .{
14082 .name = "OpConvertHandleToSampledImageINTEL",
14083 .opcode = 6531,
14084 .operands = &.{
14085 .{ .kind = .id_result_type, .quantifier = .required },
14086 .{ .kind = .id_result, .quantifier = .required },
14087 .{ .kind = .id_ref, .quantifier = .required },
14088 },
14089 },
14090 },
14091 .SPV_AMD_shader_trinary_minmax => &.{
14092 .{
14093 .name = "FMin3AMD",
14094 .opcode = 1,
14095 .operands = &.{
14096 .{ .kind = .id_ref, .quantifier = .required },
14097 .{ .kind = .id_ref, .quantifier = .required },
14098 .{ .kind = .id_ref, .quantifier = .required },
14099 },
14100 },
14101 .{
14102 .name = "UMin3AMD",
14103 .opcode = 2,
14104 .operands = &.{
14105 .{ .kind = .id_ref, .quantifier = .required },
14106 .{ .kind = .id_ref, .quantifier = .required },
14107 .{ .kind = .id_ref, .quantifier = .required },
14108 },
14109 },
14110 .{
14111 .name = "SMin3AMD",
14112 .opcode = 3,
14113 .operands = &.{
14114 .{ .kind = .id_ref, .quantifier = .required },
14115 .{ .kind = .id_ref, .quantifier = .required },
14116 .{ .kind = .id_ref, .quantifier = .required },
14117 },
14118 },
14119 .{
14120 .name = "FMax3AMD",
14121 .opcode = 4,
14122 .operands = &.{
14123 .{ .kind = .id_ref, .quantifier = .required },
14124 .{ .kind = .id_ref, .quantifier = .required },
14125 .{ .kind = .id_ref, .quantifier = .required },
14126 },
14127 },
14128 .{
14129 .name = "UMax3AMD",
14130 .opcode = 5,
14131 .operands = &.{
14132 .{ .kind = .id_ref, .quantifier = .required },
14133 .{ .kind = .id_ref, .quantifier = .required },
14134 .{ .kind = .id_ref, .quantifier = .required },
14135 },
14136 },
14137 .{
14138 .name = "SMax3AMD",
14139 .opcode = 6,
14140 .operands = &.{
14141 .{ .kind = .id_ref, .quantifier = .required },
14142 .{ .kind = .id_ref, .quantifier = .required },
14143 .{ .kind = .id_ref, .quantifier = .required },
14144 },
14145 },
14146 .{
14147 .name = "FMid3AMD",
14148 .opcode = 7,
14149 .operands = &.{
14150 .{ .kind = .id_ref, .quantifier = .required },
14151 .{ .kind = .id_ref, .quantifier = .required },
14152 .{ .kind = .id_ref, .quantifier = .required },
14153 },
14154 },
14155 .{
14156 .name = "UMid3AMD",
14157 .opcode = 8,
14158 .operands = &.{
14159 .{ .kind = .id_ref, .quantifier = .required },
14160 .{ .kind = .id_ref, .quantifier = .required },
14161 .{ .kind = .id_ref, .quantifier = .required },
14162 },
14163 },
14164 .{
14165 .name = "SMid3AMD",
14166 .opcode = 9,
14167 .operands = &.{
14168 .{ .kind = .id_ref, .quantifier = .required },
14169 .{ .kind = .id_ref, .quantifier = .required },
14170 .{ .kind = .id_ref, .quantifier = .required },
14171 },
14172 },
14173 },
14174 .SPV_EXT_INST_TYPE_TOSA_001000_1 => &.{
14175 .{
14176 .name = "ARGMAX",
14177 .opcode = 0,
14178 .operands = &.{
14179 .{ .kind = .id_ref, .quantifier = .required },
14180 .{ .kind = .id_ref, .quantifier = .required },
14181 .{ .kind = .id_ref, .quantifier = .required },
14182 },
14183 },
14184 .{
14185 .name = "AVG_POOL2D",
14186 .opcode = 1,
14187 .operands = &.{
14188 .{ .kind = .id_ref, .quantifier = .required },
14189 .{ .kind = .id_ref, .quantifier = .required },
14190 .{ .kind = .id_ref, .quantifier = .required },
14191 .{ .kind = .id_ref, .quantifier = .required },
14192 .{ .kind = .id_ref, .quantifier = .required },
14193 .{ .kind = .id_ref, .quantifier = .required },
14194 .{ .kind = .id_ref, .quantifier = .required },
14195 },
14196 },
14197 .{
14198 .name = "CONV2D",
14199 .opcode = 2,
14200 .operands = &.{
14201 .{ .kind = .id_ref, .quantifier = .required },
14202 .{ .kind = .id_ref, .quantifier = .required },
14203 .{ .kind = .id_ref, .quantifier = .required },
14204 .{ .kind = .id_ref, .quantifier = .required },
14205 .{ .kind = .id_ref, .quantifier = .required },
14206 .{ .kind = .id_ref, .quantifier = .required },
14207 .{ .kind = .id_ref, .quantifier = .required },
14208 .{ .kind = .id_ref, .quantifier = .required },
14209 .{ .kind = .id_ref, .quantifier = .required },
14210 .{ .kind = .id_ref, .quantifier = .required },
14211 },
14212 },
14213 .{
14214 .name = "CONV3D",
14215 .opcode = 3,
14216 .operands = &.{
14217 .{ .kind = .id_ref, .quantifier = .required },
14218 .{ .kind = .id_ref, .quantifier = .required },
14219 .{ .kind = .id_ref, .quantifier = .required },
14220 .{ .kind = .id_ref, .quantifier = .required },
14221 .{ .kind = .id_ref, .quantifier = .required },
14222 .{ .kind = .id_ref, .quantifier = .required },
14223 .{ .kind = .id_ref, .quantifier = .required },
14224 .{ .kind = .id_ref, .quantifier = .required },
14225 .{ .kind = .id_ref, .quantifier = .required },
14226 .{ .kind = .id_ref, .quantifier = .required },
14227 },
14228 },
14229 .{
14230 .name = "DEPTHWISE_CONV2D",
14231 .opcode = 4,
14232 .operands = &.{
14233 .{ .kind = .id_ref, .quantifier = .required },
14234 .{ .kind = .id_ref, .quantifier = .required },
14235 .{ .kind = .id_ref, .quantifier = .required },
14236 .{ .kind = .id_ref, .quantifier = .required },
14237 .{ .kind = .id_ref, .quantifier = .required },
14238 .{ .kind = .id_ref, .quantifier = .required },
14239 .{ .kind = .id_ref, .quantifier = .required },
14240 .{ .kind = .id_ref, .quantifier = .required },
14241 .{ .kind = .id_ref, .quantifier = .required },
14242 .{ .kind = .id_ref, .quantifier = .required },
14243 },
14244 },
14245 .{
14246 .name = "FFT2D",
14247 .opcode = 5,
14248 .operands = &.{
14249 .{ .kind = .id_ref, .quantifier = .required },
14250 .{ .kind = .id_ref, .quantifier = .required },
14251 .{ .kind = .id_ref, .quantifier = .required },
14252 .{ .kind = .id_ref, .quantifier = .required },
14253 },
14254 },
14255 .{
14256 .name = "MATMUL",
14257 .opcode = 6,
14258 .operands = &.{
14259 .{ .kind = .id_ref, .quantifier = .required },
14260 .{ .kind = .id_ref, .quantifier = .required },
14261 .{ .kind = .id_ref, .quantifier = .required },
14262 .{ .kind = .id_ref, .quantifier = .required },
14263 },
14264 },
14265 .{
14266 .name = "MAX_POOL2D",
14267 .opcode = 7,
14268 .operands = &.{
14269 .{ .kind = .id_ref, .quantifier = .required },
14270 .{ .kind = .id_ref, .quantifier = .required },
14271 .{ .kind = .id_ref, .quantifier = .required },
14272 .{ .kind = .id_ref, .quantifier = .required },
14273 .{ .kind = .id_ref, .quantifier = .required },
14274 },
14275 },
14276 .{
14277 .name = "RFFT2D",
14278 .opcode = 8,
14279 .operands = &.{
14280 .{ .kind = .id_ref, .quantifier = .required },
14281 .{ .kind = .id_ref, .quantifier = .required },
14282 },
14283 },
14284 .{
14285 .name = "TRANSPOSE_CONV2D",
14286 .opcode = 9,
14287 .operands = &.{
14288 .{ .kind = .id_ref, .quantifier = .required },
14289 .{ .kind = .id_ref, .quantifier = .required },
14290 .{ .kind = .id_ref, .quantifier = .required },
14291 .{ .kind = .id_ref, .quantifier = .required },
14292 .{ .kind = .id_ref, .quantifier = .required },
14293 .{ .kind = .id_ref, .quantifier = .required },
14294 .{ .kind = .id_ref, .quantifier = .required },
14295 .{ .kind = .id_ref, .quantifier = .required },
14296 .{ .kind = .id_ref, .quantifier = .required },
14297 },
14298 },
14299 .{
14300 .name = "CLAMP",
14301 .opcode = 10,
14302 .operands = &.{
14303 .{ .kind = .id_ref, .quantifier = .required },
14304 .{ .kind = .id_ref, .quantifier = .required },
14305 .{ .kind = .id_ref, .quantifier = .required },
14306 .{ .kind = .id_ref, .quantifier = .required },
14307 },
14308 },
14309 .{
14310 .name = "ERF",
14311 .opcode = 11,
14312 .operands = &.{
14313 .{ .kind = .id_ref, .quantifier = .required },
14314 },
14315 },
14316 .{
14317 .name = "SIGMOID",
14318 .opcode = 12,
14319 .operands = &.{
14320 .{ .kind = .id_ref, .quantifier = .required },
14321 },
14322 },
14323 .{
14324 .name = "TANH",
14325 .opcode = 13,
14326 .operands = &.{
14327 .{ .kind = .id_ref, .quantifier = .required },
14328 },
14329 },
14330 .{
14331 .name = "ADD",
14332 .opcode = 14,
14333 .operands = &.{
14334 .{ .kind = .id_ref, .quantifier = .required },
14335 .{ .kind = .id_ref, .quantifier = .required },
14336 },
14337 },
14338 .{
14339 .name = "ARITHMETIC_RIGHT_SHIFT",
14340 .opcode = 15,
14341 .operands = &.{
14342 .{ .kind = .id_ref, .quantifier = .required },
14343 .{ .kind = .id_ref, .quantifier = .required },
14344 .{ .kind = .id_ref, .quantifier = .required },
14345 },
14346 },
14347 .{
14348 .name = "BITWISE_AND",
14349 .opcode = 16,
14350 .operands = &.{
14351 .{ .kind = .id_ref, .quantifier = .required },
14352 .{ .kind = .id_ref, .quantifier = .required },
14353 },
14354 },
14355 .{
14356 .name = "BITWISE_OR",
14357 .opcode = 17,
14358 .operands = &.{
14359 .{ .kind = .id_ref, .quantifier = .required },
14360 .{ .kind = .id_ref, .quantifier = .required },
14361 },
14362 },
14363 .{
14364 .name = "BITWISE_XOR",
14365 .opcode = 18,
14366 .operands = &.{
14367 .{ .kind = .id_ref, .quantifier = .required },
14368 .{ .kind = .id_ref, .quantifier = .required },
14369 },
14370 },
14371 .{
14372 .name = "INTDIV",
14373 .opcode = 19,
14374 .operands = &.{
14375 .{ .kind = .id_ref, .quantifier = .required },
14376 .{ .kind = .id_ref, .quantifier = .required },
14377 },
14378 },
14379 .{
14380 .name = "LOGICAL_AND",
14381 .opcode = 20,
14382 .operands = &.{
14383 .{ .kind = .id_ref, .quantifier = .required },
14384 .{ .kind = .id_ref, .quantifier = .required },
14385 },
14386 },
14387 .{
14388 .name = "LOGICAL_LEFT_SHIFT",
14389 .opcode = 21,
14390 .operands = &.{
14391 .{ .kind = .id_ref, .quantifier = .required },
14392 .{ .kind = .id_ref, .quantifier = .required },
14393 },
14394 },
14395 .{
14396 .name = "LOGICAL_RIGHT_SHIFT",
14397 .opcode = 22,
14398 .operands = &.{
14399 .{ .kind = .id_ref, .quantifier = .required },
14400 .{ .kind = .id_ref, .quantifier = .required },
14401 },
14402 },
14403 .{
14404 .name = "LOGICAL_OR",
14405 .opcode = 23,
14406 .operands = &.{
14407 .{ .kind = .id_ref, .quantifier = .required },
14408 .{ .kind = .id_ref, .quantifier = .required },
14409 },
14410 },
14411 .{
14412 .name = "LOGICAL_XOR",
14413 .opcode = 24,
14414 .operands = &.{
14415 .{ .kind = .id_ref, .quantifier = .required },
14416 .{ .kind = .id_ref, .quantifier = .required },
14417 },
14418 },
14419 .{
14420 .name = "MAXIMUM",
14421 .opcode = 25,
14422 .operands = &.{
14423 .{ .kind = .id_ref, .quantifier = .required },
14424 .{ .kind = .id_ref, .quantifier = .required },
14425 .{ .kind = .id_ref, .quantifier = .required },
14426 },
14427 },
14428 .{
14429 .name = "MINIMUM",
14430 .opcode = 26,
14431 .operands = &.{
14432 .{ .kind = .id_ref, .quantifier = .required },
14433 .{ .kind = .id_ref, .quantifier = .required },
14434 .{ .kind = .id_ref, .quantifier = .required },
14435 },
14436 },
14437 .{
14438 .name = "MUL",
14439 .opcode = 27,
14440 .operands = &.{
14441 .{ .kind = .id_ref, .quantifier = .required },
14442 .{ .kind = .id_ref, .quantifier = .required },
14443 .{ .kind = .id_ref, .quantifier = .required },
14444 },
14445 },
14446 .{
14447 .name = "POW",
14448 .opcode = 28,
14449 .operands = &.{
14450 .{ .kind = .id_ref, .quantifier = .required },
14451 .{ .kind = .id_ref, .quantifier = .required },
14452 },
14453 },
14454 .{
14455 .name = "SUB",
14456 .opcode = 29,
14457 .operands = &.{
14458 .{ .kind = .id_ref, .quantifier = .required },
14459 .{ .kind = .id_ref, .quantifier = .required },
14460 },
14461 },
14462 .{
14463 .name = "TABLE",
14464 .opcode = 30,
14465 .operands = &.{
14466 .{ .kind = .id_ref, .quantifier = .required },
14467 .{ .kind = .id_ref, .quantifier = .required },
14468 },
14469 },
14470 .{
14471 .name = "ABS",
14472 .opcode = 31,
14473 .operands = &.{
14474 .{ .kind = .id_ref, .quantifier = .required },
14475 },
14476 },
14477 .{
14478 .name = "BITWISE_NOT",
14479 .opcode = 32,
14480 .operands = &.{
14481 .{ .kind = .id_ref, .quantifier = .required },
14482 },
14483 },
14484 .{
14485 .name = "CEIL",
14486 .opcode = 33,
14487 .operands = &.{
14488 .{ .kind = .id_ref, .quantifier = .required },
14489 },
14490 },
14491 .{
14492 .name = "CLZ",
14493 .opcode = 34,
14494 .operands = &.{
14495 .{ .kind = .id_ref, .quantifier = .required },
14496 },
14497 },
14498 .{
14499 .name = "COS",
14500 .opcode = 35,
14501 .operands = &.{
14502 .{ .kind = .id_ref, .quantifier = .required },
14503 },
14504 },
14505 .{
14506 .name = "EXP",
14507 .opcode = 36,
14508 .operands = &.{
14509 .{ .kind = .id_ref, .quantifier = .required },
14510 },
14511 },
14512 .{
14513 .name = "FLOOR",
14514 .opcode = 37,
14515 .operands = &.{
14516 .{ .kind = .id_ref, .quantifier = .required },
14517 },
14518 },
14519 .{
14520 .name = "LOG",
14521 .opcode = 38,
14522 .operands = &.{
14523 .{ .kind = .id_ref, .quantifier = .required },
14524 },
14525 },
14526 .{
14527 .name = "LOGICAL_NOT",
14528 .opcode = 39,
14529 .operands = &.{
14530 .{ .kind = .id_ref, .quantifier = .required },
14531 },
14532 },
14533 .{
14534 .name = "NEGATE",
14535 .opcode = 40,
14536 .operands = &.{
14537 .{ .kind = .id_ref, .quantifier = .required },
14538 .{ .kind = .id_ref, .quantifier = .required },
14539 .{ .kind = .id_ref, .quantifier = .required },
14540 },
14541 },
14542 .{
14543 .name = "RECIPROCAL",
14544 .opcode = 41,
14545 .operands = &.{
14546 .{ .kind = .id_ref, .quantifier = .required },
14547 },
14548 },
14549 .{
14550 .name = "RSQRT",
14551 .opcode = 42,
14552 .operands = &.{
14553 .{ .kind = .id_ref, .quantifier = .required },
14554 },
14555 },
14556 .{
14557 .name = "SIN",
14558 .opcode = 43,
14559 .operands = &.{
14560 .{ .kind = .id_ref, .quantifier = .required },
14561 },
14562 },
14563 .{
14564 .name = "SELECT",
14565 .opcode = 44,
14566 .operands = &.{
14567 .{ .kind = .id_ref, .quantifier = .required },
14568 .{ .kind = .id_ref, .quantifier = .required },
14569 .{ .kind = .id_ref, .quantifier = .required },
14570 },
14571 },
14572 .{
14573 .name = "EQUAL",
14574 .opcode = 45,
14575 .operands = &.{
14576 .{ .kind = .id_ref, .quantifier = .required },
14577 .{ .kind = .id_ref, .quantifier = .required },
14578 },
14579 },
14580 .{
14581 .name = "GREATER",
14582 .opcode = 46,
14583 .operands = &.{
14584 .{ .kind = .id_ref, .quantifier = .required },
14585 .{ .kind = .id_ref, .quantifier = .required },
14586 },
14587 },
14588 .{
14589 .name = "GREATER_EQUAL",
14590 .opcode = 47,
14591 .operands = &.{
14592 .{ .kind = .id_ref, .quantifier = .required },
14593 .{ .kind = .id_ref, .quantifier = .required },
14594 },
14595 },
14596 .{
14597 .name = "REDUCE_ALL",
14598 .opcode = 48,
14599 .operands = &.{
14600 .{ .kind = .id_ref, .quantifier = .required },
14601 .{ .kind = .id_ref, .quantifier = .required },
14602 },
14603 },
14604 .{
14605 .name = "REDUCE_ANY",
14606 .opcode = 49,
14607 .operands = &.{
14608 .{ .kind = .id_ref, .quantifier = .required },
14609 .{ .kind = .id_ref, .quantifier = .required },
14610 },
14611 },
14612 .{
14613 .name = "REDUCE_MAX",
14614 .opcode = 50,
14615 .operands = &.{
14616 .{ .kind = .id_ref, .quantifier = .required },
14617 .{ .kind = .id_ref, .quantifier = .required },
14618 .{ .kind = .id_ref, .quantifier = .required },
14619 },
14620 },
14621 .{
14622 .name = "REDUCE_MIN",
14623 .opcode = 51,
14624 .operands = &.{
14625 .{ .kind = .id_ref, .quantifier = .required },
14626 .{ .kind = .id_ref, .quantifier = .required },
14627 .{ .kind = .id_ref, .quantifier = .required },
14628 },
14629 },
14630 .{
14631 .name = "REDUCE_PRODUCT",
14632 .opcode = 52,
14633 .operands = &.{
14634 .{ .kind = .id_ref, .quantifier = .required },
14635 .{ .kind = .id_ref, .quantifier = .required },
14636 },
14637 },
14638 .{
14639 .name = "REDUCE_SUM",
14640 .opcode = 53,
14641 .operands = &.{
14642 .{ .kind = .id_ref, .quantifier = .required },
14643 .{ .kind = .id_ref, .quantifier = .required },
14644 },
14645 },
14646 .{
14647 .name = "CONCAT",
14648 .opcode = 54,
14649 .operands = &.{
14650 .{ .kind = .id_ref, .quantifier = .required },
14651 .{ .kind = .id_ref, .quantifier = .variadic },
14652 },
14653 },
14654 .{
14655 .name = "PAD",
14656 .opcode = 55,
14657 .operands = &.{
14658 .{ .kind = .id_ref, .quantifier = .required },
14659 .{ .kind = .id_ref, .quantifier = .required },
14660 .{ .kind = .id_ref, .quantifier = .required },
14661 },
14662 },
14663 .{
14664 .name = "RESHAPE",
14665 .opcode = 56,
14666 .operands = &.{
14667 .{ .kind = .id_ref, .quantifier = .required },
14668 .{ .kind = .id_ref, .quantifier = .required },
14669 },
14670 },
14671 .{
14672 .name = "REVERSE",
14673 .opcode = 57,
14674 .operands = &.{
14675 .{ .kind = .id_ref, .quantifier = .required },
14676 .{ .kind = .id_ref, .quantifier = .required },
14677 },
14678 },
14679 .{
14680 .name = "SLICE",
14681 .opcode = 58,
14682 .operands = &.{
14683 .{ .kind = .id_ref, .quantifier = .required },
14684 .{ .kind = .id_ref, .quantifier = .required },
14685 .{ .kind = .id_ref, .quantifier = .required },
14686 },
14687 },
14688 .{
14689 .name = "TILE",
14690 .opcode = 59,
14691 .operands = &.{
14692 .{ .kind = .id_ref, .quantifier = .required },
14693 .{ .kind = .id_ref, .quantifier = .required },
14694 },
14695 },
14696 .{
14697 .name = "TRANSPOSE",
14698 .opcode = 60,
14699 .operands = &.{
14700 .{ .kind = .id_ref, .quantifier = .required },
14701 .{ .kind = .id_ref, .quantifier = .required },
14702 },
14703 },
14704 .{
14705 .name = "GATHER",
14706 .opcode = 61,
14707 .operands = &.{
14708 .{ .kind = .id_ref, .quantifier = .required },
14709 .{ .kind = .id_ref, .quantifier = .required },
14710 },
14711 },
14712 .{
14713 .name = "SCATTER",
14714 .opcode = 62,
14715 .operands = &.{
14716 .{ .kind = .id_ref, .quantifier = .required },
14717 .{ .kind = .id_ref, .quantifier = .required },
14718 .{ .kind = .id_ref, .quantifier = .required },
14719 },
14720 },
14721 .{
14722 .name = "RESIZE",
14723 .opcode = 63,
14724 .operands = &.{
14725 .{ .kind = .id_ref, .quantifier = .required },
14726 .{ .kind = .id_ref, .quantifier = .required },
14727 .{ .kind = .id_ref, .quantifier = .required },
14728 .{ .kind = .id_ref, .quantifier = .required },
14729 .{ .kind = .id_ref, .quantifier = .required },
14730 },
14731 },
14732 .{
14733 .name = "CAST",
14734 .opcode = 64,
14735 .operands = &.{
14736 .{ .kind = .id_ref, .quantifier = .required },
14737 },
14738 },
14739 .{
14740 .name = "RESCALE",
14741 .opcode = 65,
14742 .operands = &.{
14743 .{ .kind = .id_ref, .quantifier = .required },
14744 .{ .kind = .id_ref, .quantifier = .required },
14745 .{ .kind = .id_ref, .quantifier = .required },
14746 .{ .kind = .id_ref, .quantifier = .required },
14747 .{ .kind = .id_ref, .quantifier = .required },
14748 .{ .kind = .id_ref, .quantifier = .required },
14749 .{ .kind = .id_ref, .quantifier = .required },
14750 .{ .kind = .id_ref, .quantifier = .required },
14751 .{ .kind = .id_ref, .quantifier = .required },
14752 .{ .kind = .id_ref, .quantifier = .required },
14753 },
14754 },
14755 },
14756 .@"NonSemantic.VkspReflection" => &.{
14757 .{
14758 .name = "Configuration",
14759 .opcode = 1,
14760 .operands = &.{
14761 .{ .kind = .id_ref, .quantifier = .required },
14762 .{ .kind = .id_ref, .quantifier = .required },
14763 .{ .kind = .id_ref, .quantifier = .required },
14764 .{ .kind = .id_ref, .quantifier = .required },
14765 .{ .kind = .id_ref, .quantifier = .required },
14766 .{ .kind = .id_ref, .quantifier = .required },
14767 .{ .kind = .id_ref, .quantifier = .required },
14768 .{ .kind = .id_ref, .quantifier = .required },
14769 .{ .kind = .id_ref, .quantifier = .required },
14770 },
14771 },
14772 .{
14773 .name = "StartCounter",
14774 .opcode = 2,
14775 .operands = &.{
14776 .{ .kind = .id_ref, .quantifier = .required },
14777 },
14778 },
14779 .{
14780 .name = "StopCounter",
14781 .opcode = 3,
14782 .operands = &.{
14783 .{ .kind = .id_ref, .quantifier = .required },
14784 },
14785 },
14786 .{
14787 .name = "PushConstants",
14788 .opcode = 4,
14789 .operands = &.{
14790 .{ .kind = .id_ref, .quantifier = .required },
14791 .{ .kind = .id_ref, .quantifier = .required },
14792 .{ .kind = .id_ref, .quantifier = .required },
14793 .{ .kind = .id_ref, .quantifier = .required },
14794 },
14795 },
14796 .{
14797 .name = "SpecializationMapEntry",
14798 .opcode = 5,
14799 .operands = &.{
14800 .{ .kind = .id_ref, .quantifier = .required },
14801 .{ .kind = .id_ref, .quantifier = .required },
14802 .{ .kind = .id_ref, .quantifier = .required },
14803 },
14804 },
14805 .{
14806 .name = "DescriptorSetBuffer",
14807 .opcode = 6,
14808 .operands = &.{
14809 .{ .kind = .id_ref, .quantifier = .required },
14810 .{ .kind = .id_ref, .quantifier = .required },
14811 .{ .kind = .id_ref, .quantifier = .required },
14812 .{ .kind = .id_ref, .quantifier = .required },
14813 .{ .kind = .id_ref, .quantifier = .required },
14814 .{ .kind = .id_ref, .quantifier = .required },
14815 .{ .kind = .id_ref, .quantifier = .required },
14816 .{ .kind = .id_ref, .quantifier = .required },
14817 .{ .kind = .id_ref, .quantifier = .required },
14818 .{ .kind = .id_ref, .quantifier = .required },
14819 .{ .kind = .id_ref, .quantifier = .required },
14820 .{ .kind = .id_ref, .quantifier = .required },
14821 .{ .kind = .id_ref, .quantifier = .required },
14822 .{ .kind = .id_ref, .quantifier = .required },
14823 .{ .kind = .id_ref, .quantifier = .required },
14824 },
14825 },
14826 .{
14827 .name = "DescriptorSetImage",
14828 .opcode = 7,
14829 .operands = &.{
14830 .{ .kind = .id_ref, .quantifier = .required },
14831 .{ .kind = .id_ref, .quantifier = .required },
14832 .{ .kind = .id_ref, .quantifier = .required },
14833 .{ .kind = .id_ref, .quantifier = .required },
14834 .{ .kind = .id_ref, .quantifier = .required },
14835 .{ .kind = .id_ref, .quantifier = .required },
14836 .{ .kind = .id_ref, .quantifier = .required },
14837 .{ .kind = .id_ref, .quantifier = .required },
14838 .{ .kind = .id_ref, .quantifier = .required },
14839 .{ .kind = .id_ref, .quantifier = .required },
14840 .{ .kind = .id_ref, .quantifier = .required },
14841 .{ .kind = .id_ref, .quantifier = .required },
14842 .{ .kind = .id_ref, .quantifier = .required },
14843 .{ .kind = .id_ref, .quantifier = .required },
14844 .{ .kind = .id_ref, .quantifier = .required },
14845 .{ .kind = .id_ref, .quantifier = .required },
14846 .{ .kind = .id_ref, .quantifier = .required },
14847 .{ .kind = .id_ref, .quantifier = .required },
14848 .{ .kind = .id_ref, .quantifier = .required },
14849 .{ .kind = .id_ref, .quantifier = .required },
14850 .{ .kind = .id_ref, .quantifier = .required },
14851 .{ .kind = .id_ref, .quantifier = .required },
14852 .{ .kind = .id_ref, .quantifier = .required },
14853 .{ .kind = .id_ref, .quantifier = .required },
14854 .{ .kind = .id_ref, .quantifier = .required },
14855 .{ .kind = .id_ref, .quantifier = .required },
14856 .{ .kind = .id_ref, .quantifier = .required },
14857 .{ .kind = .id_ref, .quantifier = .required },
14858 .{ .kind = .id_ref, .quantifier = .required },
14859 .{ .kind = .id_ref, .quantifier = .required },
14860 .{ .kind = .id_ref, .quantifier = .required },
14861 .{ .kind = .id_ref, .quantifier = .required },
14862 .{ .kind = .id_ref, .quantifier = .required },
14863 },
14864 },
14865 .{
14866 .name = "DescriptorSetSampler",
14867 .opcode = 8,
14868 .operands = &.{
14869 .{ .kind = .id_ref, .quantifier = .required },
14870 .{ .kind = .id_ref, .quantifier = .required },
14871 .{ .kind = .id_ref, .quantifier = .required },
14872 .{ .kind = .id_ref, .quantifier = .required },
14873 .{ .kind = .id_ref, .quantifier = .required },
14874 .{ .kind = .id_ref, .quantifier = .required },
14875 .{ .kind = .id_ref, .quantifier = .required },
14876 .{ .kind = .id_ref, .quantifier = .required },
14877 .{ .kind = .id_ref, .quantifier = .required },
14878 .{ .kind = .id_ref, .quantifier = .required },
14879 .{ .kind = .id_ref, .quantifier = .required },
14880 .{ .kind = .id_ref, .quantifier = .required },
14881 .{ .kind = .id_ref, .quantifier = .required },
14882 .{ .kind = .id_ref, .quantifier = .required },
14883 .{ .kind = .id_ref, .quantifier = .required },
14884 .{ .kind = .id_ref, .quantifier = .required },
14885 .{ .kind = .id_ref, .quantifier = .required },
14886 .{ .kind = .id_ref, .quantifier = .required },
14887 .{ .kind = .id_ref, .quantifier = .required },
14888 },
14889 },
14890 },
14891 .SPV_AMD_shader_explicit_vertex_parameter => &.{
14892 .{
14893 .name = "InterpolateAtVertexAMD",
14894 .opcode = 1,
14895 .operands = &.{
14896 .{ .kind = .id_ref, .quantifier = .required },
14897 .{ .kind = .id_ref, .quantifier = .required },
14898 },
14899 },
14900 },
14901 .DebugInfo => &.{
14902 .{
14903 .name = "DebugInfoNone",
14904 .opcode = 0,
14905 .operands = &.{},
14906 },
14907 .{
14908 .name = "DebugCompilationUnit",
14909 .opcode = 1,
14910 .operands = &.{
14911 .{ .kind = .id_ref, .quantifier = .required },
14912 .{ .kind = .literal_integer, .quantifier = .required },
14913 .{ .kind = .literal_integer, .quantifier = .required },
14914 },
14915 },
14916 .{
14917 .name = "DebugTypeBasic",
14918 .opcode = 2,
14919 .operands = &.{
14920 .{ .kind = .id_ref, .quantifier = .required },
14921 .{ .kind = .id_ref, .quantifier = .required },
14922 .{ .kind = .debug_info_debug_base_type_attribute_encoding, .quantifier = .required },
14923 },
14924 },
14925 .{
14926 .name = "DebugTypePointer",
14927 .opcode = 3,
14928 .operands = &.{
14929 .{ .kind = .id_ref, .quantifier = .required },
14930 .{ .kind = .storage_class, .quantifier = .required },
14931 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14932 },
14933 },
14934 .{
14935 .name = "DebugTypeQualifier",
14936 .opcode = 4,
14937 .operands = &.{
14938 .{ .kind = .id_ref, .quantifier = .required },
14939 .{ .kind = .debug_info_debug_type_qualifier, .quantifier = .required },
14940 },
14941 },
14942 .{
14943 .name = "DebugTypeArray",
14944 .opcode = 5,
14945 .operands = &.{
14946 .{ .kind = .id_ref, .quantifier = .required },
14947 .{ .kind = .id_ref, .quantifier = .variadic },
14948 },
14949 },
14950 .{
14951 .name = "DebugTypeVector",
14952 .opcode = 6,
14953 .operands = &.{
14954 .{ .kind = .id_ref, .quantifier = .required },
14955 .{ .kind = .literal_integer, .quantifier = .required },
14956 },
14957 },
14958 .{
14959 .name = "DebugTypedef",
14960 .opcode = 7,
14961 .operands = &.{
14962 .{ .kind = .id_ref, .quantifier = .required },
14963 .{ .kind = .id_ref, .quantifier = .required },
14964 .{ .kind = .id_ref, .quantifier = .required },
14965 .{ .kind = .literal_integer, .quantifier = .required },
14966 .{ .kind = .literal_integer, .quantifier = .required },
14967 .{ .kind = .id_ref, .quantifier = .required },
14968 },
14969 },
14970 .{
14971 .name = "DebugTypeFunction",
14972 .opcode = 8,
14973 .operands = &.{
14974 .{ .kind = .id_ref, .quantifier = .required },
14975 .{ .kind = .id_ref, .quantifier = .variadic },
14976 },
14977 },
14978 .{
14979 .name = "DebugTypeEnum",
14980 .opcode = 9,
14981 .operands = &.{
14982 .{ .kind = .id_ref, .quantifier = .required },
14983 .{ .kind = .id_ref, .quantifier = .required },
14984 .{ .kind = .id_ref, .quantifier = .required },
14985 .{ .kind = .literal_integer, .quantifier = .required },
14986 .{ .kind = .literal_integer, .quantifier = .required },
14987 .{ .kind = .id_ref, .quantifier = .required },
14988 .{ .kind = .id_ref, .quantifier = .required },
14989 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14990 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
14991 },
14992 },
14993 .{
14994 .name = "DebugTypeComposite",
14995 .opcode = 10,
14996 .operands = &.{
14997 .{ .kind = .id_ref, .quantifier = .required },
14998 .{ .kind = .debug_info_debug_composite_type, .quantifier = .required },
14999 .{ .kind = .id_ref, .quantifier = .required },
15000 .{ .kind = .literal_integer, .quantifier = .required },
15001 .{ .kind = .literal_integer, .quantifier = .required },
15002 .{ .kind = .id_ref, .quantifier = .required },
15003 .{ .kind = .id_ref, .quantifier = .required },
15004 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15005 .{ .kind = .id_ref, .quantifier = .variadic },
15006 },
15007 },
15008 .{
15009 .name = "DebugTypeMember",
15010 .opcode = 11,
15011 .operands = &.{
15012 .{ .kind = .id_ref, .quantifier = .required },
15013 .{ .kind = .id_ref, .quantifier = .required },
15014 .{ .kind = .id_ref, .quantifier = .required },
15015 .{ .kind = .literal_integer, .quantifier = .required },
15016 .{ .kind = .literal_integer, .quantifier = .required },
15017 .{ .kind = .id_ref, .quantifier = .required },
15018 .{ .kind = .id_ref, .quantifier = .required },
15019 .{ .kind = .id_ref, .quantifier = .required },
15020 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15021 .{ .kind = .id_ref, .quantifier = .optional },
15022 },
15023 },
15024 .{
15025 .name = "DebugTypeInheritance",
15026 .opcode = 12,
15027 .operands = &.{
15028 .{ .kind = .id_ref, .quantifier = .required },
15029 .{ .kind = .id_ref, .quantifier = .required },
15030 .{ .kind = .id_ref, .quantifier = .required },
15031 .{ .kind = .id_ref, .quantifier = .required },
15032 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15033 },
15034 },
15035 .{
15036 .name = "DebugTypePtrToMember",
15037 .opcode = 13,
15038 .operands = &.{
15039 .{ .kind = .id_ref, .quantifier = .required },
15040 .{ .kind = .id_ref, .quantifier = .required },
15041 },
15042 },
15043 .{
15044 .name = "DebugTypeTemplate",
15045 .opcode = 14,
15046 .operands = &.{
15047 .{ .kind = .id_ref, .quantifier = .required },
15048 .{ .kind = .id_ref, .quantifier = .variadic },
15049 },
15050 },
15051 .{
15052 .name = "DebugTypeTemplateParameter",
15053 .opcode = 15,
15054 .operands = &.{
15055 .{ .kind = .id_ref, .quantifier = .required },
15056 .{ .kind = .id_ref, .quantifier = .required },
15057 .{ .kind = .id_ref, .quantifier = .required },
15058 .{ .kind = .id_ref, .quantifier = .required },
15059 .{ .kind = .literal_integer, .quantifier = .required },
15060 .{ .kind = .literal_integer, .quantifier = .required },
15061 },
15062 },
15063 .{
15064 .name = "DebugTypeTemplateTemplateParameter",
15065 .opcode = 16,
15066 .operands = &.{
15067 .{ .kind = .id_ref, .quantifier = .required },
15068 .{ .kind = .id_ref, .quantifier = .required },
15069 .{ .kind = .id_ref, .quantifier = .required },
15070 .{ .kind = .literal_integer, .quantifier = .required },
15071 .{ .kind = .literal_integer, .quantifier = .required },
15072 },
15073 },
15074 .{
15075 .name = "DebugTypeTemplateParameterPack",
15076 .opcode = 17,
15077 .operands = &.{
15078 .{ .kind = .id_ref, .quantifier = .required },
15079 .{ .kind = .id_ref, .quantifier = .required },
15080 .{ .kind = .literal_integer, .quantifier = .required },
15081 .{ .kind = .literal_integer, .quantifier = .required },
15082 .{ .kind = .id_ref, .quantifier = .variadic },
15083 },
15084 },
15085 .{
15086 .name = "DebugGlobalVariable",
15087 .opcode = 18,
15088 .operands = &.{
15089 .{ .kind = .id_ref, .quantifier = .required },
15090 .{ .kind = .id_ref, .quantifier = .required },
15091 .{ .kind = .id_ref, .quantifier = .required },
15092 .{ .kind = .literal_integer, .quantifier = .required },
15093 .{ .kind = .literal_integer, .quantifier = .required },
15094 .{ .kind = .id_ref, .quantifier = .required },
15095 .{ .kind = .id_ref, .quantifier = .required },
15096 .{ .kind = .id_ref, .quantifier = .required },
15097 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15098 .{ .kind = .id_ref, .quantifier = .optional },
15099 },
15100 },
15101 .{
15102 .name = "DebugFunctionDeclaration",
15103 .opcode = 19,
15104 .operands = &.{
15105 .{ .kind = .id_ref, .quantifier = .required },
15106 .{ .kind = .id_ref, .quantifier = .required },
15107 .{ .kind = .id_ref, .quantifier = .required },
15108 .{ .kind = .literal_integer, .quantifier = .required },
15109 .{ .kind = .literal_integer, .quantifier = .required },
15110 .{ .kind = .id_ref, .quantifier = .required },
15111 .{ .kind = .id_ref, .quantifier = .required },
15112 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15113 },
15114 },
15115 .{
15116 .name = "DebugFunction",
15117 .opcode = 20,
15118 .operands = &.{
15119 .{ .kind = .id_ref, .quantifier = .required },
15120 .{ .kind = .id_ref, .quantifier = .required },
15121 .{ .kind = .id_ref, .quantifier = .required },
15122 .{ .kind = .literal_integer, .quantifier = .required },
15123 .{ .kind = .literal_integer, .quantifier = .required },
15124 .{ .kind = .id_ref, .quantifier = .required },
15125 .{ .kind = .id_ref, .quantifier = .required },
15126 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15127 .{ .kind = .literal_integer, .quantifier = .required },
15128 .{ .kind = .id_ref, .quantifier = .required },
15129 .{ .kind = .id_ref, .quantifier = .optional },
15130 },
15131 },
15132 .{
15133 .name = "DebugLexicalBlock",
15134 .opcode = 21,
15135 .operands = &.{
15136 .{ .kind = .id_ref, .quantifier = .required },
15137 .{ .kind = .literal_integer, .quantifier = .required },
15138 .{ .kind = .literal_integer, .quantifier = .required },
15139 .{ .kind = .id_ref, .quantifier = .required },
15140 .{ .kind = .id_ref, .quantifier = .optional },
15141 },
15142 },
15143 .{
15144 .name = "DebugLexicalBlockDiscriminator",
15145 .opcode = 22,
15146 .operands = &.{
15147 .{ .kind = .id_ref, .quantifier = .required },
15148 .{ .kind = .literal_integer, .quantifier = .required },
15149 .{ .kind = .id_ref, .quantifier = .required },
15150 },
15151 },
15152 .{
15153 .name = "DebugScope",
15154 .opcode = 23,
15155 .operands = &.{
15156 .{ .kind = .id_ref, .quantifier = .required },
15157 .{ .kind = .id_ref, .quantifier = .optional },
15158 },
15159 },
15160 .{
15161 .name = "DebugNoScope",
15162 .opcode = 24,
15163 .operands = &.{},
15164 },
15165 .{
15166 .name = "DebugInlinedAt",
15167 .opcode = 25,
15168 .operands = &.{
15169 .{ .kind = .literal_integer, .quantifier = .required },
15170 .{ .kind = .id_ref, .quantifier = .required },
15171 .{ .kind = .id_ref, .quantifier = .optional },
15172 },
15173 },
15174 .{
15175 .name = "DebugLocalVariable",
15176 .opcode = 26,
15177 .operands = &.{
15178 .{ .kind = .id_ref, .quantifier = .required },
15179 .{ .kind = .id_ref, .quantifier = .required },
15180 .{ .kind = .id_ref, .quantifier = .required },
15181 .{ .kind = .literal_integer, .quantifier = .required },
15182 .{ .kind = .literal_integer, .quantifier = .required },
15183 .{ .kind = .id_ref, .quantifier = .required },
15184 .{ .kind = .literal_integer, .quantifier = .optional },
15185 },
15186 },
15187 .{
15188 .name = "DebugInlinedVariable",
15189 .opcode = 27,
15190 .operands = &.{
15191 .{ .kind = .id_ref, .quantifier = .required },
15192 .{ .kind = .id_ref, .quantifier = .required },
15193 },
15194 },
15195 .{
15196 .name = "DebugDeclare",
15197 .opcode = 28,
15198 .operands = &.{
15199 .{ .kind = .id_ref, .quantifier = .required },
15200 .{ .kind = .id_ref, .quantifier = .required },
15201 .{ .kind = .id_ref, .quantifier = .required },
15202 },
15203 },
15204 .{
15205 .name = "DebugValue",
15206 .opcode = 29,
15207 .operands = &.{
15208 .{ .kind = .id_ref, .quantifier = .required },
15209 .{ .kind = .id_ref, .quantifier = .required },
15210 .{ .kind = .id_ref, .quantifier = .variadic },
15211 },
15212 },
15213 .{
15214 .name = "DebugOperation",
15215 .opcode = 30,
15216 .operands = &.{
15217 .{ .kind = .debug_info_debug_operation, .quantifier = .required },
15218 .{ .kind = .literal_integer, .quantifier = .variadic },
15219 },
15220 },
15221 .{
15222 .name = "DebugExpression",
15223 .opcode = 31,
15224 .operands = &.{
15225 .{ .kind = .id_ref, .quantifier = .variadic },
15226 },
15227 },
15228 .{
15229 .name = "DebugMacroDef",
15230 .opcode = 32,
15231 .operands = &.{
15232 .{ .kind = .id_ref, .quantifier = .required },
15233 .{ .kind = .literal_integer, .quantifier = .required },
15234 .{ .kind = .id_ref, .quantifier = .required },
15235 .{ .kind = .id_ref, .quantifier = .optional },
15236 },
15237 },
15238 .{
15239 .name = "DebugMacroUndef",
15240 .opcode = 33,
15241 .operands = &.{
15242 .{ .kind = .id_ref, .quantifier = .required },
15243 .{ .kind = .literal_integer, .quantifier = .required },
15244 .{ .kind = .id_ref, .quantifier = .required },
15245 },
15246 },
15247 },
15248 .@"NonSemantic.DebugBreak" => &.{
15249 .{
15250 .name = "DebugBreak",
15251 .opcode = 1,
15252 .operands = &.{},
15253 },
15254 },
15255 .@"OpenCL.DebugInfo.100" => &.{
15256 .{
15257 .name = "DebugInfoNone",
15258 .opcode = 0,
15259 .operands = &.{},
15260 },
15261 .{
15262 .name = "DebugCompilationUnit",
15263 .opcode = 1,
15264 .operands = &.{
15265 .{ .kind = .literal_integer, .quantifier = .required },
15266 .{ .kind = .literal_integer, .quantifier = .required },
15267 .{ .kind = .id_ref, .quantifier = .required },
15268 .{ .kind = .source_language, .quantifier = .required },
15269 },
15270 },
15271 .{
15272 .name = "DebugTypeBasic",
15273 .opcode = 2,
15274 .operands = &.{
15275 .{ .kind = .id_ref, .quantifier = .required },
15276 .{ .kind = .id_ref, .quantifier = .required },
15277 .{ .kind = .open_cl_debug_info_100_debug_base_type_attribute_encoding, .quantifier = .required },
15278 },
15279 },
15280 .{
15281 .name = "DebugTypePointer",
15282 .opcode = 3,
15283 .operands = &.{
15284 .{ .kind = .id_ref, .quantifier = .required },
15285 .{ .kind = .storage_class, .quantifier = .required },
15286 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15287 },
15288 },
15289 .{
15290 .name = "DebugTypeQualifier",
15291 .opcode = 4,
15292 .operands = &.{
15293 .{ .kind = .id_ref, .quantifier = .required },
15294 .{ .kind = .open_cl_debug_info_100_debug_type_qualifier, .quantifier = .required },
15295 },
15296 },
15297 .{
15298 .name = "DebugTypeArray",
15299 .opcode = 5,
15300 .operands = &.{
15301 .{ .kind = .id_ref, .quantifier = .required },
15302 .{ .kind = .id_ref, .quantifier = .variadic },
15303 },
15304 },
15305 .{
15306 .name = "DebugTypeVector",
15307 .opcode = 6,
15308 .operands = &.{
15309 .{ .kind = .id_ref, .quantifier = .required },
15310 .{ .kind = .literal_integer, .quantifier = .required },
15311 },
15312 },
15313 .{
15314 .name = "DebugTypedef",
15315 .opcode = 7,
15316 .operands = &.{
15317 .{ .kind = .id_ref, .quantifier = .required },
15318 .{ .kind = .id_ref, .quantifier = .required },
15319 .{ .kind = .id_ref, .quantifier = .required },
15320 .{ .kind = .literal_integer, .quantifier = .required },
15321 .{ .kind = .literal_integer, .quantifier = .required },
15322 .{ .kind = .id_ref, .quantifier = .required },
15323 },
15324 },
15325 .{
15326 .name = "DebugTypeFunction",
15327 .opcode = 8,
15328 .operands = &.{
15329 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15330 .{ .kind = .id_ref, .quantifier = .required },
15331 .{ .kind = .id_ref, .quantifier = .variadic },
15332 },
15333 },
15334 .{
15335 .name = "DebugTypeEnum",
15336 .opcode = 9,
15337 .operands = &.{
15338 .{ .kind = .id_ref, .quantifier = .required },
15339 .{ .kind = .id_ref, .quantifier = .required },
15340 .{ .kind = .id_ref, .quantifier = .required },
15341 .{ .kind = .literal_integer, .quantifier = .required },
15342 .{ .kind = .literal_integer, .quantifier = .required },
15343 .{ .kind = .id_ref, .quantifier = .required },
15344 .{ .kind = .id_ref, .quantifier = .required },
15345 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15346 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
15347 },
15348 },
15349 .{
15350 .name = "DebugTypeComposite",
15351 .opcode = 10,
15352 .operands = &.{
15353 .{ .kind = .id_ref, .quantifier = .required },
15354 .{ .kind = .open_cl_debug_info_100_debug_composite_type, .quantifier = .required },
15355 .{ .kind = .id_ref, .quantifier = .required },
15356 .{ .kind = .literal_integer, .quantifier = .required },
15357 .{ .kind = .literal_integer, .quantifier = .required },
15358 .{ .kind = .id_ref, .quantifier = .required },
15359 .{ .kind = .id_ref, .quantifier = .required },
15360 .{ .kind = .id_ref, .quantifier = .required },
15361 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15362 .{ .kind = .id_ref, .quantifier = .variadic },
15363 },
15364 },
15365 .{
15366 .name = "DebugTypeMember",
15367 .opcode = 11,
15368 .operands = &.{
15369 .{ .kind = .id_ref, .quantifier = .required },
15370 .{ .kind = .id_ref, .quantifier = .required },
15371 .{ .kind = .id_ref, .quantifier = .required },
15372 .{ .kind = .literal_integer, .quantifier = .required },
15373 .{ .kind = .literal_integer, .quantifier = .required },
15374 .{ .kind = .id_ref, .quantifier = .required },
15375 .{ .kind = .id_ref, .quantifier = .required },
15376 .{ .kind = .id_ref, .quantifier = .required },
15377 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15378 .{ .kind = .id_ref, .quantifier = .optional },
15379 },
15380 },
15381 .{
15382 .name = "DebugTypeInheritance",
15383 .opcode = 12,
15384 .operands = &.{
15385 .{ .kind = .id_ref, .quantifier = .required },
15386 .{ .kind = .id_ref, .quantifier = .required },
15387 .{ .kind = .id_ref, .quantifier = .required },
15388 .{ .kind = .id_ref, .quantifier = .required },
15389 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15390 },
15391 },
15392 .{
15393 .name = "DebugTypePtrToMember",
15394 .opcode = 13,
15395 .operands = &.{
15396 .{ .kind = .id_ref, .quantifier = .required },
15397 .{ .kind = .id_ref, .quantifier = .required },
15398 },
15399 },
15400 .{
15401 .name = "DebugTypeTemplate",
15402 .opcode = 14,
15403 .operands = &.{
15404 .{ .kind = .id_ref, .quantifier = .required },
15405 .{ .kind = .id_ref, .quantifier = .variadic },
15406 },
15407 },
15408 .{
15409 .name = "DebugTypeTemplateParameter",
15410 .opcode = 15,
15411 .operands = &.{
15412 .{ .kind = .id_ref, .quantifier = .required },
15413 .{ .kind = .id_ref, .quantifier = .required },
15414 .{ .kind = .id_ref, .quantifier = .required },
15415 .{ .kind = .id_ref, .quantifier = .required },
15416 .{ .kind = .literal_integer, .quantifier = .required },
15417 .{ .kind = .literal_integer, .quantifier = .required },
15418 },
15419 },
15420 .{
15421 .name = "DebugTypeTemplateTemplateParameter",
15422 .opcode = 16,
15423 .operands = &.{
15424 .{ .kind = .id_ref, .quantifier = .required },
15425 .{ .kind = .id_ref, .quantifier = .required },
15426 .{ .kind = .id_ref, .quantifier = .required },
15427 .{ .kind = .literal_integer, .quantifier = .required },
15428 .{ .kind = .literal_integer, .quantifier = .required },
15429 },
15430 },
15431 .{
15432 .name = "DebugTypeTemplateParameterPack",
15433 .opcode = 17,
15434 .operands = &.{
15435 .{ .kind = .id_ref, .quantifier = .required },
15436 .{ .kind = .id_ref, .quantifier = .required },
15437 .{ .kind = .literal_integer, .quantifier = .required },
15438 .{ .kind = .literal_integer, .quantifier = .required },
15439 .{ .kind = .id_ref, .quantifier = .variadic },
15440 },
15441 },
15442 .{
15443 .name = "DebugGlobalVariable",
15444 .opcode = 18,
15445 .operands = &.{
15446 .{ .kind = .id_ref, .quantifier = .required },
15447 .{ .kind = .id_ref, .quantifier = .required },
15448 .{ .kind = .id_ref, .quantifier = .required },
15449 .{ .kind = .literal_integer, .quantifier = .required },
15450 .{ .kind = .literal_integer, .quantifier = .required },
15451 .{ .kind = .id_ref, .quantifier = .required },
15452 .{ .kind = .id_ref, .quantifier = .required },
15453 .{ .kind = .id_ref, .quantifier = .required },
15454 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15455 .{ .kind = .id_ref, .quantifier = .optional },
15456 },
15457 },
15458 .{
15459 .name = "DebugFunctionDeclaration",
15460 .opcode = 19,
15461 .operands = &.{
15462 .{ .kind = .id_ref, .quantifier = .required },
15463 .{ .kind = .id_ref, .quantifier = .required },
15464 .{ .kind = .id_ref, .quantifier = .required },
15465 .{ .kind = .literal_integer, .quantifier = .required },
15466 .{ .kind = .literal_integer, .quantifier = .required },
15467 .{ .kind = .id_ref, .quantifier = .required },
15468 .{ .kind = .id_ref, .quantifier = .required },
15469 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15470 },
15471 },
15472 .{
15473 .name = "DebugFunction",
15474 .opcode = 20,
15475 .operands = &.{
15476 .{ .kind = .id_ref, .quantifier = .required },
15477 .{ .kind = .id_ref, .quantifier = .required },
15478 .{ .kind = .id_ref, .quantifier = .required },
15479 .{ .kind = .literal_integer, .quantifier = .required },
15480 .{ .kind = .literal_integer, .quantifier = .required },
15481 .{ .kind = .id_ref, .quantifier = .required },
15482 .{ .kind = .id_ref, .quantifier = .required },
15483 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15484 .{ .kind = .literal_integer, .quantifier = .required },
15485 .{ .kind = .id_ref, .quantifier = .required },
15486 .{ .kind = .id_ref, .quantifier = .optional },
15487 },
15488 },
15489 .{
15490 .name = "DebugLexicalBlock",
15491 .opcode = 21,
15492 .operands = &.{
15493 .{ .kind = .id_ref, .quantifier = .required },
15494 .{ .kind = .literal_integer, .quantifier = .required },
15495 .{ .kind = .literal_integer, .quantifier = .required },
15496 .{ .kind = .id_ref, .quantifier = .required },
15497 .{ .kind = .id_ref, .quantifier = .optional },
15498 },
15499 },
15500 .{
15501 .name = "DebugLexicalBlockDiscriminator",
15502 .opcode = 22,
15503 .operands = &.{
15504 .{ .kind = .id_ref, .quantifier = .required },
15505 .{ .kind = .literal_integer, .quantifier = .required },
15506 .{ .kind = .id_ref, .quantifier = .required },
15507 },
15508 },
15509 .{
15510 .name = "DebugScope",
15511 .opcode = 23,
15512 .operands = &.{
15513 .{ .kind = .id_ref, .quantifier = .required },
15514 .{ .kind = .id_ref, .quantifier = .optional },
15515 },
15516 },
15517 .{
15518 .name = "DebugNoScope",
15519 .opcode = 24,
15520 .operands = &.{},
15521 },
15522 .{
15523 .name = "DebugInlinedAt",
15524 .opcode = 25,
15525 .operands = &.{
15526 .{ .kind = .literal_integer, .quantifier = .required },
15527 .{ .kind = .id_ref, .quantifier = .required },
15528 .{ .kind = .id_ref, .quantifier = .optional },
15529 },
15530 },
15531 .{
15532 .name = "DebugLocalVariable",
15533 .opcode = 26,
15534 .operands = &.{
15535 .{ .kind = .id_ref, .quantifier = .required },
15536 .{ .kind = .id_ref, .quantifier = .required },
15537 .{ .kind = .id_ref, .quantifier = .required },
15538 .{ .kind = .literal_integer, .quantifier = .required },
15539 .{ .kind = .literal_integer, .quantifier = .required },
15540 .{ .kind = .id_ref, .quantifier = .required },
15541 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15542 .{ .kind = .literal_integer, .quantifier = .optional },
15543 },
15544 },
15545 .{
15546 .name = "DebugInlinedVariable",
15547 .opcode = 27,
15548 .operands = &.{
15549 .{ .kind = .id_ref, .quantifier = .required },
15550 .{ .kind = .id_ref, .quantifier = .required },
15551 },
15552 },
15553 .{
15554 .name = "DebugDeclare",
15555 .opcode = 28,
15556 .operands = &.{
15557 .{ .kind = .id_ref, .quantifier = .required },
15558 .{ .kind = .id_ref, .quantifier = .required },
15559 .{ .kind = .id_ref, .quantifier = .required },
15560 },
15561 },
15562 .{
15563 .name = "DebugValue",
15564 .opcode = 29,
15565 .operands = &.{
15566 .{ .kind = .id_ref, .quantifier = .required },
15567 .{ .kind = .id_ref, .quantifier = .required },
15568 .{ .kind = .id_ref, .quantifier = .required },
15569 .{ .kind = .id_ref, .quantifier = .variadic },
15570 },
15571 },
15572 .{
15573 .name = "DebugOperation",
15574 .opcode = 30,
15575 .operands = &.{
15576 .{ .kind = .open_cl_debug_info_100_debug_operation, .quantifier = .required },
15577 .{ .kind = .literal_integer, .quantifier = .variadic },
15578 },
15579 },
15580 .{
15581 .name = "DebugExpression",
15582 .opcode = 31,
15583 .operands = &.{
15584 .{ .kind = .id_ref, .quantifier = .variadic },
15585 },
15586 },
15587 .{
15588 .name = "DebugMacroDef",
15589 .opcode = 32,
15590 .operands = &.{
15591 .{ .kind = .id_ref, .quantifier = .required },
15592 .{ .kind = .literal_integer, .quantifier = .required },
15593 .{ .kind = .id_ref, .quantifier = .required },
15594 .{ .kind = .id_ref, .quantifier = .optional },
15595 },
15596 },
15597 .{
15598 .name = "DebugMacroUndef",
15599 .opcode = 33,
15600 .operands = &.{
15601 .{ .kind = .id_ref, .quantifier = .required },
15602 .{ .kind = .literal_integer, .quantifier = .required },
15603 .{ .kind = .id_ref, .quantifier = .required },
15604 },
15605 },
15606 .{
15607 .name = "DebugImportedEntity",
15608 .opcode = 34,
15609 .operands = &.{
15610 .{ .kind = .id_ref, .quantifier = .required },
15611 .{ .kind = .open_cl_debug_info_100_debug_imported_entity, .quantifier = .required },
15612 .{ .kind = .id_ref, .quantifier = .required },
15613 .{ .kind = .id_ref, .quantifier = .required },
15614 .{ .kind = .literal_integer, .quantifier = .required },
15615 .{ .kind = .literal_integer, .quantifier = .required },
15616 .{ .kind = .id_ref, .quantifier = .required },
15617 },
15618 },
15619 .{
15620 .name = "DebugSource",
15621 .opcode = 35,
15622 .operands = &.{
15623 .{ .kind = .id_ref, .quantifier = .required },
15624 .{ .kind = .id_ref, .quantifier = .optional },
15625 },
15626 },
15627 .{
15628 .name = "DebugModuleINTEL",
15629 .opcode = 36,
15630 .operands = &.{
15631 .{ .kind = .id_ref, .quantifier = .required },
15632 .{ .kind = .id_ref, .quantifier = .required },
15633 .{ .kind = .id_ref, .quantifier = .required },
15634 .{ .kind = .literal_integer, .quantifier = .required },
15635 .{ .kind = .id_ref, .quantifier = .required },
15636 .{ .kind = .id_ref, .quantifier = .required },
15637 .{ .kind = .id_ref, .quantifier = .required },
15638 .{ .kind = .literal_integer, .quantifier = .required },
15639 },
15640 },
15641 },
15642 .@"NonSemantic.ClspvReflection.6" => &.{
15643 .{
15644 .name = "Kernel",
15645 .opcode = 1,
15646 .operands = &.{
15647 .{ .kind = .id_ref, .quantifier = .required },
15648 .{ .kind = .id_ref, .quantifier = .required },
15649 .{ .kind = .id_ref, .quantifier = .optional },
15650 .{ .kind = .id_ref, .quantifier = .optional },
15651 .{ .kind = .id_ref, .quantifier = .optional },
15652 },
15653 },
15654 .{
15655 .name = "ArgumentInfo",
15656 .opcode = 2,
15657 .operands = &.{
15658 .{ .kind = .id_ref, .quantifier = .required },
15659 .{ .kind = .id_ref, .quantifier = .optional },
15660 .{ .kind = .id_ref, .quantifier = .optional },
15661 .{ .kind = .id_ref, .quantifier = .optional },
15662 .{ .kind = .id_ref, .quantifier = .optional },
15663 },
15664 },
15665 .{
15666 .name = "ArgumentStorageBuffer",
15667 .opcode = 3,
15668 .operands = &.{
15669 .{ .kind = .id_ref, .quantifier = .required },
15670 .{ .kind = .id_ref, .quantifier = .required },
15671 .{ .kind = .id_ref, .quantifier = .required },
15672 .{ .kind = .id_ref, .quantifier = .required },
15673 .{ .kind = .id_ref, .quantifier = .optional },
15674 },
15675 },
15676 .{
15677 .name = "ArgumentUniform",
15678 .opcode = 4,
15679 .operands = &.{
15680 .{ .kind = .id_ref, .quantifier = .required },
15681 .{ .kind = .id_ref, .quantifier = .required },
15682 .{ .kind = .id_ref, .quantifier = .required },
15683 .{ .kind = .id_ref, .quantifier = .required },
15684 .{ .kind = .id_ref, .quantifier = .optional },
15685 },
15686 },
15687 .{
15688 .name = "ArgumentPodStorageBuffer",
15689 .opcode = 5,
15690 .operands = &.{
15691 .{ .kind = .id_ref, .quantifier = .required },
15692 .{ .kind = .id_ref, .quantifier = .required },
15693 .{ .kind = .id_ref, .quantifier = .required },
15694 .{ .kind = .id_ref, .quantifier = .required },
15695 .{ .kind = .id_ref, .quantifier = .required },
15696 .{ .kind = .id_ref, .quantifier = .required },
15697 .{ .kind = .id_ref, .quantifier = .optional },
15698 },
15699 },
15700 .{
15701 .name = "ArgumentPodUniform",
15702 .opcode = 6,
15703 .operands = &.{
15704 .{ .kind = .id_ref, .quantifier = .required },
15705 .{ .kind = .id_ref, .quantifier = .required },
15706 .{ .kind = .id_ref, .quantifier = .required },
15707 .{ .kind = .id_ref, .quantifier = .required },
15708 .{ .kind = .id_ref, .quantifier = .required },
15709 .{ .kind = .id_ref, .quantifier = .required },
15710 .{ .kind = .id_ref, .quantifier = .optional },
15711 },
15712 },
15713 .{
15714 .name = "ArgumentPodPushConstant",
15715 .opcode = 7,
15716 .operands = &.{
15717 .{ .kind = .id_ref, .quantifier = .required },
15718 .{ .kind = .id_ref, .quantifier = .required },
15719 .{ .kind = .id_ref, .quantifier = .required },
15720 .{ .kind = .id_ref, .quantifier = .required },
15721 .{ .kind = .id_ref, .quantifier = .optional },
15722 },
15723 },
15724 .{
15725 .name = "ArgumentSampledImage",
15726 .opcode = 8,
15727 .operands = &.{
15728 .{ .kind = .id_ref, .quantifier = .required },
15729 .{ .kind = .id_ref, .quantifier = .required },
15730 .{ .kind = .id_ref, .quantifier = .required },
15731 .{ .kind = .id_ref, .quantifier = .required },
15732 .{ .kind = .id_ref, .quantifier = .optional },
15733 },
15734 },
15735 .{
15736 .name = "ArgumentStorageImage",
15737 .opcode = 9,
15738 .operands = &.{
15739 .{ .kind = .id_ref, .quantifier = .required },
15740 .{ .kind = .id_ref, .quantifier = .required },
15741 .{ .kind = .id_ref, .quantifier = .required },
15742 .{ .kind = .id_ref, .quantifier = .required },
15743 .{ .kind = .id_ref, .quantifier = .optional },
15744 },
15745 },
15746 .{
15747 .name = "ArgumentSampler",
15748 .opcode = 10,
15749 .operands = &.{
15750 .{ .kind = .id_ref, .quantifier = .required },
15751 .{ .kind = .id_ref, .quantifier = .required },
15752 .{ .kind = .id_ref, .quantifier = .required },
15753 .{ .kind = .id_ref, .quantifier = .required },
15754 .{ .kind = .id_ref, .quantifier = .optional },
15755 },
15756 },
15757 .{
15758 .name = "ArgumentWorkgroup",
15759 .opcode = 11,
15760 .operands = &.{
15761 .{ .kind = .id_ref, .quantifier = .required },
15762 .{ .kind = .id_ref, .quantifier = .required },
15763 .{ .kind = .id_ref, .quantifier = .required },
15764 .{ .kind = .id_ref, .quantifier = .required },
15765 .{ .kind = .id_ref, .quantifier = .optional },
15766 },
15767 },
15768 .{
15769 .name = "SpecConstantWorkgroupSize",
15770 .opcode = 12,
15771 .operands = &.{
15772 .{ .kind = .id_ref, .quantifier = .required },
15773 .{ .kind = .id_ref, .quantifier = .required },
15774 .{ .kind = .id_ref, .quantifier = .required },
15775 },
15776 },
15777 .{
15778 .name = "SpecConstantGlobalOffset",
15779 .opcode = 13,
15780 .operands = &.{
15781 .{ .kind = .id_ref, .quantifier = .required },
15782 .{ .kind = .id_ref, .quantifier = .required },
15783 .{ .kind = .id_ref, .quantifier = .required },
15784 },
15785 },
15786 .{
15787 .name = "SpecConstantWorkDim",
15788 .opcode = 14,
15789 .operands = &.{
15790 .{ .kind = .id_ref, .quantifier = .required },
15791 },
15792 },
15793 .{
15794 .name = "PushConstantGlobalOffset",
15795 .opcode = 15,
15796 .operands = &.{
15797 .{ .kind = .id_ref, .quantifier = .required },
15798 .{ .kind = .id_ref, .quantifier = .required },
15799 },
15800 },
15801 .{
15802 .name = "PushConstantEnqueuedLocalSize",
15803 .opcode = 16,
15804 .operands = &.{
15805 .{ .kind = .id_ref, .quantifier = .required },
15806 .{ .kind = .id_ref, .quantifier = .required },
15807 },
15808 },
15809 .{
15810 .name = "PushConstantGlobalSize",
15811 .opcode = 17,
15812 .operands = &.{
15813 .{ .kind = .id_ref, .quantifier = .required },
15814 .{ .kind = .id_ref, .quantifier = .required },
15815 },
15816 },
15817 .{
15818 .name = "PushConstantRegionOffset",
15819 .opcode = 18,
15820 .operands = &.{
15821 .{ .kind = .id_ref, .quantifier = .required },
15822 .{ .kind = .id_ref, .quantifier = .required },
15823 },
15824 },
15825 .{
15826 .name = "PushConstantNumWorkgroups",
15827 .opcode = 19,
15828 .operands = &.{
15829 .{ .kind = .id_ref, .quantifier = .required },
15830 .{ .kind = .id_ref, .quantifier = .required },
15831 },
15832 },
15833 .{
15834 .name = "PushConstantRegionGroupOffset",
15835 .opcode = 20,
15836 .operands = &.{
15837 .{ .kind = .id_ref, .quantifier = .required },
15838 .{ .kind = .id_ref, .quantifier = .required },
15839 },
15840 },
15841 .{
15842 .name = "ConstantDataStorageBuffer",
15843 .opcode = 21,
15844 .operands = &.{
15845 .{ .kind = .id_ref, .quantifier = .required },
15846 .{ .kind = .id_ref, .quantifier = .required },
15847 .{ .kind = .id_ref, .quantifier = .required },
15848 },
15849 },
15850 .{
15851 .name = "ConstantDataUniform",
15852 .opcode = 22,
15853 .operands = &.{
15854 .{ .kind = .id_ref, .quantifier = .required },
15855 .{ .kind = .id_ref, .quantifier = .required },
15856 .{ .kind = .id_ref, .quantifier = .required },
15857 },
15858 },
15859 .{
15860 .name = "LiteralSampler",
15861 .opcode = 23,
15862 .operands = &.{
15863 .{ .kind = .id_ref, .quantifier = .required },
15864 .{ .kind = .id_ref, .quantifier = .required },
15865 .{ .kind = .id_ref, .quantifier = .required },
15866 },
15867 },
15868 .{
15869 .name = "PropertyRequiredWorkgroupSize",
15870 .opcode = 24,
15871 .operands = &.{
15872 .{ .kind = .id_ref, .quantifier = .required },
15873 .{ .kind = .id_ref, .quantifier = .required },
15874 .{ .kind = .id_ref, .quantifier = .required },
15875 .{ .kind = .id_ref, .quantifier = .required },
15876 },
15877 },
15878 .{
15879 .name = "SpecConstantSubgroupMaxSize",
15880 .opcode = 25,
15881 .operands = &.{
15882 .{ .kind = .id_ref, .quantifier = .required },
15883 },
15884 },
15885 .{
15886 .name = "ArgumentPointerPushConstant",
15887 .opcode = 26,
15888 .operands = &.{
15889 .{ .kind = .id_ref, .quantifier = .required },
15890 .{ .kind = .id_ref, .quantifier = .required },
15891 .{ .kind = .id_ref, .quantifier = .required },
15892 .{ .kind = .id_ref, .quantifier = .required },
15893 .{ .kind = .id_ref, .quantifier = .optional },
15894 },
15895 },
15896 .{
15897 .name = "ArgumentPointerUniform",
15898 .opcode = 27,
15899 .operands = &.{
15900 .{ .kind = .id_ref, .quantifier = .required },
15901 .{ .kind = .id_ref, .quantifier = .required },
15902 .{ .kind = .id_ref, .quantifier = .required },
15903 .{ .kind = .id_ref, .quantifier = .required },
15904 .{ .kind = .id_ref, .quantifier = .required },
15905 .{ .kind = .id_ref, .quantifier = .required },
15906 .{ .kind = .id_ref, .quantifier = .optional },
15907 },
15908 },
15909 .{
15910 .name = "ProgramScopeVariablesStorageBuffer",
15911 .opcode = 28,
15912 .operands = &.{
15913 .{ .kind = .id_ref, .quantifier = .required },
15914 .{ .kind = .id_ref, .quantifier = .required },
15915 .{ .kind = .id_ref, .quantifier = .required },
15916 },
15917 },
15918 .{
15919 .name = "ProgramScopeVariablePointerRelocation",
15920 .opcode = 29,
15921 .operands = &.{
15922 .{ .kind = .id_ref, .quantifier = .required },
15923 .{ .kind = .id_ref, .quantifier = .required },
15924 .{ .kind = .id_ref, .quantifier = .required },
15925 },
15926 },
15927 .{
15928 .name = "ImageArgumentInfoChannelOrderPushConstant",
15929 .opcode = 30,
15930 .operands = &.{
15931 .{ .kind = .id_ref, .quantifier = .required },
15932 .{ .kind = .id_ref, .quantifier = .required },
15933 .{ .kind = .id_ref, .quantifier = .required },
15934 .{ .kind = .id_ref, .quantifier = .required },
15935 },
15936 },
15937 .{
15938 .name = "ImageArgumentInfoChannelDataTypePushConstant",
15939 .opcode = 31,
15940 .operands = &.{
15941 .{ .kind = .id_ref, .quantifier = .required },
15942 .{ .kind = .id_ref, .quantifier = .required },
15943 .{ .kind = .id_ref, .quantifier = .required },
15944 .{ .kind = .id_ref, .quantifier = .required },
15945 },
15946 },
15947 .{
15948 .name = "ImageArgumentInfoChannelOrderUniform",
15949 .opcode = 32,
15950 .operands = &.{
15951 .{ .kind = .id_ref, .quantifier = .required },
15952 .{ .kind = .id_ref, .quantifier = .required },
15953 .{ .kind = .id_ref, .quantifier = .required },
15954 .{ .kind = .id_ref, .quantifier = .required },
15955 .{ .kind = .id_ref, .quantifier = .required },
15956 .{ .kind = .id_ref, .quantifier = .required },
15957 },
15958 },
15959 .{
15960 .name = "ImageArgumentInfoChannelDataTypeUniform",
15961 .opcode = 33,
15962 .operands = &.{
15963 .{ .kind = .id_ref, .quantifier = .required },
15964 .{ .kind = .id_ref, .quantifier = .required },
15965 .{ .kind = .id_ref, .quantifier = .required },
15966 .{ .kind = .id_ref, .quantifier = .required },
15967 .{ .kind = .id_ref, .quantifier = .required },
15968 .{ .kind = .id_ref, .quantifier = .required },
15969 },
15970 },
15971 .{
15972 .name = "ArgumentStorageTexelBuffer",
15973 .opcode = 34,
15974 .operands = &.{
15975 .{ .kind = .id_ref, .quantifier = .required },
15976 .{ .kind = .id_ref, .quantifier = .required },
15977 .{ .kind = .id_ref, .quantifier = .required },
15978 .{ .kind = .id_ref, .quantifier = .required },
15979 .{ .kind = .id_ref, .quantifier = .optional },
15980 },
15981 },
15982 .{
15983 .name = "ArgumentUniformTexelBuffer",
15984 .opcode = 35,
15985 .operands = &.{
15986 .{ .kind = .id_ref, .quantifier = .required },
15987 .{ .kind = .id_ref, .quantifier = .required },
15988 .{ .kind = .id_ref, .quantifier = .required },
15989 .{ .kind = .id_ref, .quantifier = .required },
15990 .{ .kind = .id_ref, .quantifier = .optional },
15991 },
15992 },
15993 .{
15994 .name = "ConstantDataPointerPushConstant",
15995 .opcode = 36,
15996 .operands = &.{
15997 .{ .kind = .id_ref, .quantifier = .required },
15998 .{ .kind = .id_ref, .quantifier = .required },
15999 .{ .kind = .id_ref, .quantifier = .required },
16000 },
16001 },
16002 .{
16003 .name = "ProgramScopeVariablePointerPushConstant",
16004 .opcode = 37,
16005 .operands = &.{
16006 .{ .kind = .id_ref, .quantifier = .required },
16007 .{ .kind = .id_ref, .quantifier = .required },
16008 .{ .kind = .id_ref, .quantifier = .required },
16009 },
16010 },
16011 .{
16012 .name = "PrintfInfo",
16013 .opcode = 38,
16014 .operands = &.{
16015 .{ .kind = .id_ref, .quantifier = .required },
16016 .{ .kind = .id_ref, .quantifier = .required },
16017 .{ .kind = .id_ref, .quantifier = .variadic },
16018 },
16019 },
16020 .{
16021 .name = "PrintfBufferStorageBuffer",
16022 .opcode = 39,
16023 .operands = &.{
16024 .{ .kind = .id_ref, .quantifier = .required },
16025 .{ .kind = .id_ref, .quantifier = .required },
16026 .{ .kind = .id_ref, .quantifier = .required },
16027 },
16028 },
16029 .{
16030 .name = "PrintfBufferPointerPushConstant",
16031 .opcode = 40,
16032 .operands = &.{
16033 .{ .kind = .id_ref, .quantifier = .required },
16034 .{ .kind = .id_ref, .quantifier = .required },
16035 .{ .kind = .id_ref, .quantifier = .required },
16036 },
16037 },
16038 .{
16039 .name = "NormalizedSamplerMaskPushConstant",
16040 .opcode = 41,
16041 .operands = &.{
16042 .{ .kind = .id_ref, .quantifier = .required },
16043 .{ .kind = .id_ref, .quantifier = .required },
16044 .{ .kind = .id_ref, .quantifier = .required },
16045 .{ .kind = .id_ref, .quantifier = .required },
16046 },
16047 },
16048 .{
16049 .name = "WorkgroupVariableSize",
16050 .opcode = 42,
16051 .operands = &.{
16052 .{ .kind = .id_ref, .quantifier = .required },
16053 .{ .kind = .id_ref, .quantifier = .required },
16054 },
16055 },
16056 },
16057 .@"GLSL.std.450" => &.{
16058 .{
16059 .name = "Round",
16060 .opcode = 1,
16061 .operands = &.{
16062 .{ .kind = .id_ref, .quantifier = .required },
16063 },
16064 },
16065 .{
16066 .name = "RoundEven",
16067 .opcode = 2,
16068 .operands = &.{
16069 .{ .kind = .id_ref, .quantifier = .required },
16070 },
16071 },
16072 .{
16073 .name = "Trunc",
16074 .opcode = 3,
16075 .operands = &.{
16076 .{ .kind = .id_ref, .quantifier = .required },
16077 },
16078 },
16079 .{
16080 .name = "FAbs",
16081 .opcode = 4,
16082 .operands = &.{
16083 .{ .kind = .id_ref, .quantifier = .required },
16084 },
16085 },
16086 .{
16087 .name = "SAbs",
16088 .opcode = 5,
16089 .operands = &.{
16090 .{ .kind = .id_ref, .quantifier = .required },
16091 },
16092 },
16093 .{
16094 .name = "FSign",
16095 .opcode = 6,
16096 .operands = &.{
16097 .{ .kind = .id_ref, .quantifier = .required },
16098 },
16099 },
16100 .{
16101 .name = "SSign",
16102 .opcode = 7,
16103 .operands = &.{
16104 .{ .kind = .id_ref, .quantifier = .required },
16105 },
16106 },
16107 .{
16108 .name = "Floor",
16109 .opcode = 8,
16110 .operands = &.{
16111 .{ .kind = .id_ref, .quantifier = .required },
16112 },
16113 },
16114 .{
16115 .name = "Ceil",
16116 .opcode = 9,
16117 .operands = &.{
16118 .{ .kind = .id_ref, .quantifier = .required },
16119 },
16120 },
16121 .{
16122 .name = "Fract",
16123 .opcode = 10,
16124 .operands = &.{
16125 .{ .kind = .id_ref, .quantifier = .required },
16126 },
16127 },
16128 .{
16129 .name = "Radians",
16130 .opcode = 11,
16131 .operands = &.{
16132 .{ .kind = .id_ref, .quantifier = .required },
16133 },
16134 },
16135 .{
16136 .name = "Degrees",
16137 .opcode = 12,
16138 .operands = &.{
16139 .{ .kind = .id_ref, .quantifier = .required },
16140 },
16141 },
16142 .{
16143 .name = "Sin",
16144 .opcode = 13,
16145 .operands = &.{
16146 .{ .kind = .id_ref, .quantifier = .required },
16147 },
16148 },
16149 .{
16150 .name = "Cos",
16151 .opcode = 14,
16152 .operands = &.{
16153 .{ .kind = .id_ref, .quantifier = .required },
16154 },
16155 },
16156 .{
16157 .name = "Tan",
16158 .opcode = 15,
16159 .operands = &.{
16160 .{ .kind = .id_ref, .quantifier = .required },
16161 },
16162 },
16163 .{
16164 .name = "Asin",
16165 .opcode = 16,
16166 .operands = &.{
16167 .{ .kind = .id_ref, .quantifier = .required },
16168 },
16169 },
16170 .{
16171 .name = "Acos",
16172 .opcode = 17,
16173 .operands = &.{
16174 .{ .kind = .id_ref, .quantifier = .required },
16175 },
16176 },
16177 .{
16178 .name = "Atan",
16179 .opcode = 18,
16180 .operands = &.{
16181 .{ .kind = .id_ref, .quantifier = .required },
16182 },
16183 },
16184 .{
16185 .name = "Sinh",
16186 .opcode = 19,
16187 .operands = &.{
16188 .{ .kind = .id_ref, .quantifier = .required },
16189 },
16190 },
16191 .{
16192 .name = "Cosh",
16193 .opcode = 20,
16194 .operands = &.{
16195 .{ .kind = .id_ref, .quantifier = .required },
16196 },
16197 },
16198 .{
16199 .name = "Tanh",
16200 .opcode = 21,
16201 .operands = &.{
16202 .{ .kind = .id_ref, .quantifier = .required },
16203 },
16204 },
16205 .{
16206 .name = "Asinh",
16207 .opcode = 22,
16208 .operands = &.{
16209 .{ .kind = .id_ref, .quantifier = .required },
16210 },
16211 },
16212 .{
16213 .name = "Acosh",
16214 .opcode = 23,
16215 .operands = &.{
16216 .{ .kind = .id_ref, .quantifier = .required },
16217 },
16218 },
16219 .{
16220 .name = "Atanh",
16221 .opcode = 24,
16222 .operands = &.{
16223 .{ .kind = .id_ref, .quantifier = .required },
16224 },
16225 },
16226 .{
16227 .name = "Atan2",
16228 .opcode = 25,
16229 .operands = &.{
16230 .{ .kind = .id_ref, .quantifier = .required },
16231 .{ .kind = .id_ref, .quantifier = .required },
16232 },
16233 },
16234 .{
16235 .name = "Pow",
16236 .opcode = 26,
16237 .operands = &.{
16238 .{ .kind = .id_ref, .quantifier = .required },
16239 .{ .kind = .id_ref, .quantifier = .required },
16240 },
16241 },
16242 .{
16243 .name = "Exp",
16244 .opcode = 27,
16245 .operands = &.{
16246 .{ .kind = .id_ref, .quantifier = .required },
16247 },
16248 },
16249 .{
16250 .name = "Log",
16251 .opcode = 28,
16252 .operands = &.{
16253 .{ .kind = .id_ref, .quantifier = .required },
16254 },
16255 },
16256 .{
16257 .name = "Exp2",
16258 .opcode = 29,
16259 .operands = &.{
16260 .{ .kind = .id_ref, .quantifier = .required },
16261 },
16262 },
16263 .{
16264 .name = "Log2",
16265 .opcode = 30,
16266 .operands = &.{
16267 .{ .kind = .id_ref, .quantifier = .required },
16268 },
16269 },
16270 .{
16271 .name = "Sqrt",
16272 .opcode = 31,
16273 .operands = &.{
16274 .{ .kind = .id_ref, .quantifier = .required },
16275 },
16276 },
16277 .{
16278 .name = "InverseSqrt",
16279 .opcode = 32,
16280 .operands = &.{
16281 .{ .kind = .id_ref, .quantifier = .required },
16282 },
16283 },
16284 .{
16285 .name = "Determinant",
16286 .opcode = 33,
16287 .operands = &.{
16288 .{ .kind = .id_ref, .quantifier = .required },
16289 },
16290 },
16291 .{
16292 .name = "MatrixInverse",
16293 .opcode = 34,
16294 .operands = &.{
16295 .{ .kind = .id_ref, .quantifier = .required },
16296 },
16297 },
16298 .{
16299 .name = "Modf",
16300 .opcode = 35,
16301 .operands = &.{
16302 .{ .kind = .id_ref, .quantifier = .required },
16303 .{ .kind = .id_ref, .quantifier = .required },
16304 },
16305 },
16306 .{
16307 .name = "ModfStruct",
16308 .opcode = 36,
16309 .operands = &.{
16310 .{ .kind = .id_ref, .quantifier = .required },
16311 },
16312 },
16313 .{
16314 .name = "FMin",
16315 .opcode = 37,
16316 .operands = &.{
16317 .{ .kind = .id_ref, .quantifier = .required },
16318 .{ .kind = .id_ref, .quantifier = .required },
16319 },
16320 },
16321 .{
16322 .name = "UMin",
16323 .opcode = 38,
16324 .operands = &.{
16325 .{ .kind = .id_ref, .quantifier = .required },
16326 .{ .kind = .id_ref, .quantifier = .required },
16327 },
16328 },
16329 .{
16330 .name = "SMin",
16331 .opcode = 39,
16332 .operands = &.{
16333 .{ .kind = .id_ref, .quantifier = .required },
16334 .{ .kind = .id_ref, .quantifier = .required },
16335 },
16336 },
16337 .{
16338 .name = "FMax",
16339 .opcode = 40,
16340 .operands = &.{
16341 .{ .kind = .id_ref, .quantifier = .required },
16342 .{ .kind = .id_ref, .quantifier = .required },
16343 },
16344 },
16345 .{
16346 .name = "UMax",
16347 .opcode = 41,
16348 .operands = &.{
16349 .{ .kind = .id_ref, .quantifier = .required },
16350 .{ .kind = .id_ref, .quantifier = .required },
16351 },
16352 },
16353 .{
16354 .name = "SMax",
16355 .opcode = 42,
16356 .operands = &.{
16357 .{ .kind = .id_ref, .quantifier = .required },
16358 .{ .kind = .id_ref, .quantifier = .required },
16359 },
16360 },
16361 .{
16362 .name = "FClamp",
16363 .opcode = 43,
16364 .operands = &.{
16365 .{ .kind = .id_ref, .quantifier = .required },
16366 .{ .kind = .id_ref, .quantifier = .required },
16367 .{ .kind = .id_ref, .quantifier = .required },
16368 },
16369 },
16370 .{
16371 .name = "UClamp",
16372 .opcode = 44,
16373 .operands = &.{
16374 .{ .kind = .id_ref, .quantifier = .required },
16375 .{ .kind = .id_ref, .quantifier = .required },
16376 .{ .kind = .id_ref, .quantifier = .required },
16377 },
16378 },
16379 .{
16380 .name = "SClamp",
16381 .opcode = 45,
16382 .operands = &.{
16383 .{ .kind = .id_ref, .quantifier = .required },
16384 .{ .kind = .id_ref, .quantifier = .required },
16385 .{ .kind = .id_ref, .quantifier = .required },
16386 },
16387 },
16388 .{
16389 .name = "FMix",
16390 .opcode = 46,
16391 .operands = &.{
16392 .{ .kind = .id_ref, .quantifier = .required },
16393 .{ .kind = .id_ref, .quantifier = .required },
16394 .{ .kind = .id_ref, .quantifier = .required },
16395 },
16396 },
16397 .{
16398 .name = "IMix",
16399 .opcode = 47,
16400 .operands = &.{
16401 .{ .kind = .id_ref, .quantifier = .required },
16402 .{ .kind = .id_ref, .quantifier = .required },
16403 .{ .kind = .id_ref, .quantifier = .required },
16404 },
16405 },
16406 .{
16407 .name = "Step",
16408 .opcode = 48,
16409 .operands = &.{
16410 .{ .kind = .id_ref, .quantifier = .required },
16411 .{ .kind = .id_ref, .quantifier = .required },
16412 },
16413 },
16414 .{
16415 .name = "SmoothStep",
16416 .opcode = 49,
16417 .operands = &.{
16418 .{ .kind = .id_ref, .quantifier = .required },
16419 .{ .kind = .id_ref, .quantifier = .required },
16420 .{ .kind = .id_ref, .quantifier = .required },
16421 },
16422 },
16423 .{
16424 .name = "Fma",
16425 .opcode = 50,
16426 .operands = &.{
16427 .{ .kind = .id_ref, .quantifier = .required },
16428 .{ .kind = .id_ref, .quantifier = .required },
16429 .{ .kind = .id_ref, .quantifier = .required },
16430 },
16431 },
16432 .{
16433 .name = "Frexp",
16434 .opcode = 51,
16435 .operands = &.{
16436 .{ .kind = .id_ref, .quantifier = .required },
16437 .{ .kind = .id_ref, .quantifier = .required },
16438 },
16439 },
16440 .{
16441 .name = "FrexpStruct",
16442 .opcode = 52,
16443 .operands = &.{
16444 .{ .kind = .id_ref, .quantifier = .required },
16445 },
16446 },
16447 .{
16448 .name = "Ldexp",
16449 .opcode = 53,
16450 .operands = &.{
16451 .{ .kind = .id_ref, .quantifier = .required },
16452 .{ .kind = .id_ref, .quantifier = .required },
16453 },
16454 },
16455 .{
16456 .name = "PackSnorm4x8",
16457 .opcode = 54,
16458 .operands = &.{
16459 .{ .kind = .id_ref, .quantifier = .required },
16460 },
16461 },
16462 .{
16463 .name = "PackUnorm4x8",
16464 .opcode = 55,
16465 .operands = &.{
16466 .{ .kind = .id_ref, .quantifier = .required },
16467 },
16468 },
16469 .{
16470 .name = "PackSnorm2x16",
16471 .opcode = 56,
16472 .operands = &.{
16473 .{ .kind = .id_ref, .quantifier = .required },
16474 },
16475 },
16476 .{
16477 .name = "PackUnorm2x16",
16478 .opcode = 57,
16479 .operands = &.{
16480 .{ .kind = .id_ref, .quantifier = .required },
16481 },
16482 },
16483 .{
16484 .name = "PackHalf2x16",
16485 .opcode = 58,
16486 .operands = &.{
16487 .{ .kind = .id_ref, .quantifier = .required },
16488 },
16489 },
16490 .{
16491 .name = "PackDouble2x32",
16492 .opcode = 59,
16493 .operands = &.{
16494 .{ .kind = .id_ref, .quantifier = .required },
16495 },
16496 },
16497 .{
16498 .name = "UnpackSnorm2x16",
16499 .opcode = 60,
16500 .operands = &.{
16501 .{ .kind = .id_ref, .quantifier = .required },
16502 },
16503 },
16504 .{
16505 .name = "UnpackUnorm2x16",
16506 .opcode = 61,
16507 .operands = &.{
16508 .{ .kind = .id_ref, .quantifier = .required },
16509 },
16510 },
16511 .{
16512 .name = "UnpackHalf2x16",
16513 .opcode = 62,
16514 .operands = &.{
16515 .{ .kind = .id_ref, .quantifier = .required },
16516 },
16517 },
16518 .{
16519 .name = "UnpackSnorm4x8",
16520 .opcode = 63,
16521 .operands = &.{
16522 .{ .kind = .id_ref, .quantifier = .required },
16523 },
16524 },
16525 .{
16526 .name = "UnpackUnorm4x8",
16527 .opcode = 64,
16528 .operands = &.{
16529 .{ .kind = .id_ref, .quantifier = .required },
16530 },
16531 },
16532 .{
16533 .name = "UnpackDouble2x32",
16534 .opcode = 65,
16535 .operands = &.{
16536 .{ .kind = .id_ref, .quantifier = .required },
16537 },
16538 },
16539 .{
16540 .name = "Length",
16541 .opcode = 66,
16542 .operands = &.{
16543 .{ .kind = .id_ref, .quantifier = .required },
16544 },
16545 },
16546 .{
16547 .name = "Distance",
16548 .opcode = 67,
16549 .operands = &.{
16550 .{ .kind = .id_ref, .quantifier = .required },
16551 .{ .kind = .id_ref, .quantifier = .required },
16552 },
16553 },
16554 .{
16555 .name = "Cross",
16556 .opcode = 68,
16557 .operands = &.{
16558 .{ .kind = .id_ref, .quantifier = .required },
16559 .{ .kind = .id_ref, .quantifier = .required },
16560 },
16561 },
16562 .{
16563 .name = "Normalize",
16564 .opcode = 69,
16565 .operands = &.{
16566 .{ .kind = .id_ref, .quantifier = .required },
16567 },
16568 },
16569 .{
16570 .name = "FaceForward",
16571 .opcode = 70,
16572 .operands = &.{
16573 .{ .kind = .id_ref, .quantifier = .required },
16574 .{ .kind = .id_ref, .quantifier = .required },
16575 .{ .kind = .id_ref, .quantifier = .required },
16576 },
16577 },
16578 .{
16579 .name = "Reflect",
16580 .opcode = 71,
16581 .operands = &.{
16582 .{ .kind = .id_ref, .quantifier = .required },
16583 .{ .kind = .id_ref, .quantifier = .required },
16584 },
16585 },
16586 .{
16587 .name = "Refract",
16588 .opcode = 72,
16589 .operands = &.{
16590 .{ .kind = .id_ref, .quantifier = .required },
16591 .{ .kind = .id_ref, .quantifier = .required },
16592 .{ .kind = .id_ref, .quantifier = .required },
16593 },
16594 },
16595 .{
16596 .name = "FindILsb",
16597 .opcode = 73,
16598 .operands = &.{
16599 .{ .kind = .id_ref, .quantifier = .required },
16600 },
16601 },
16602 .{
16603 .name = "FindSMsb",
16604 .opcode = 74,
16605 .operands = &.{
16606 .{ .kind = .id_ref, .quantifier = .required },
16607 },
16608 },
16609 .{
16610 .name = "FindUMsb",
16611 .opcode = 75,
16612 .operands = &.{
16613 .{ .kind = .id_ref, .quantifier = .required },
16614 },
16615 },
16616 .{
16617 .name = "InterpolateAtCentroid",
16618 .opcode = 76,
16619 .operands = &.{
16620 .{ .kind = .id_ref, .quantifier = .required },
16621 },
16622 },
16623 .{
16624 .name = "InterpolateAtSample",
16625 .opcode = 77,
16626 .operands = &.{
16627 .{ .kind = .id_ref, .quantifier = .required },
16628 .{ .kind = .id_ref, .quantifier = .required },
16629 },
16630 },
16631 .{
16632 .name = "InterpolateAtOffset",
16633 .opcode = 78,
16634 .operands = &.{
16635 .{ .kind = .id_ref, .quantifier = .required },
16636 .{ .kind = .id_ref, .quantifier = .required },
16637 },
16638 },
16639 .{
16640 .name = "NMin",
16641 .opcode = 79,
16642 .operands = &.{
16643 .{ .kind = .id_ref, .quantifier = .required },
16644 .{ .kind = .id_ref, .quantifier = .required },
16645 },
16646 },
16647 .{
16648 .name = "NMax",
16649 .opcode = 80,
16650 .operands = &.{
16651 .{ .kind = .id_ref, .quantifier = .required },
16652 .{ .kind = .id_ref, .quantifier = .required },
16653 },
16654 },
16655 .{
16656 .name = "NClamp",
16657 .opcode = 81,
16658 .operands = &.{
16659 .{ .kind = .id_ref, .quantifier = .required },
16660 .{ .kind = .id_ref, .quantifier = .required },
16661 .{ .kind = .id_ref, .quantifier = .required },
16662 },
16663 },
16664 },
16665 .SPV_AMD_shader_ballot => &.{
16666 .{
16667 .name = "SwizzleInvocationsAMD",
16668 .opcode = 1,
16669 .operands = &.{
16670 .{ .kind = .id_ref, .quantifier = .required },
16671 .{ .kind = .id_ref, .quantifier = .required },
16672 },
16673 },
16674 .{
16675 .name = "SwizzleInvocationsMaskedAMD",
16676 .opcode = 2,
16677 .operands = &.{
16678 .{ .kind = .id_ref, .quantifier = .required },
16679 .{ .kind = .id_ref, .quantifier = .required },
16680 },
16681 },
16682 .{
16683 .name = "WriteInvocationAMD",
16684 .opcode = 3,
16685 .operands = &.{
16686 .{ .kind = .id_ref, .quantifier = .required },
16687 .{ .kind = .id_ref, .quantifier = .required },
16688 .{ .kind = .id_ref, .quantifier = .required },
16689 },
16690 },
16691 .{
16692 .name = "MbcntAMD",
16693 .opcode = 4,
16694 .operands = &.{
16695 .{ .kind = .id_ref, .quantifier = .required },
16696 },
16697 },
16698 },
16699 .@"NonSemantic.DebugPrintf" => &.{
16700 .{
16701 .name = "DebugPrintf",
16702 .opcode = 1,
16703 .operands = &.{
16704 .{ .kind = .id_ref, .quantifier = .required },
16705 .{ .kind = .id_ref, .quantifier = .variadic },
16706 },
16707 },
16708 },
16709 .SPV_AMD_gcn_shader => &.{
16710 .{
16711 .name = "CubeFaceIndexAMD",
16712 .opcode = 1,
16713 .operands = &.{
16714 .{ .kind = .id_ref, .quantifier = .required },
16715 },
16716 },
16717 .{
16718 .name = "CubeFaceCoordAMD",
16719 .opcode = 2,
16720 .operands = &.{
16721 .{ .kind = .id_ref, .quantifier = .required },
16722 },
16723 },
16724 .{
16725 .name = "TimeAMD",
16726 .opcode = 3,
16727 .operands = &.{},
16728 },
16729 },
16730 .@"OpenCL.std" => &.{
16731 .{
16732 .name = "acos",
16733 .opcode = 0,
16734 .operands = &.{
16735 .{ .kind = .id_ref, .quantifier = .required },
16736 },
16737 },
16738 .{
16739 .name = "acosh",
16740 .opcode = 1,
16741 .operands = &.{
16742 .{ .kind = .id_ref, .quantifier = .required },
16743 },
16744 },
16745 .{
16746 .name = "acospi",
16747 .opcode = 2,
16748 .operands = &.{
16749 .{ .kind = .id_ref, .quantifier = .required },
16750 },
16751 },
16752 .{
16753 .name = "asin",
16754 .opcode = 3,
16755 .operands = &.{
16756 .{ .kind = .id_ref, .quantifier = .required },
16757 },
16758 },
16759 .{
16760 .name = "asinh",
16761 .opcode = 4,
16762 .operands = &.{
16763 .{ .kind = .id_ref, .quantifier = .required },
16764 },
16765 },
16766 .{
16767 .name = "asinpi",
16768 .opcode = 5,
16769 .operands = &.{
16770 .{ .kind = .id_ref, .quantifier = .required },
16771 },
16772 },
16773 .{
16774 .name = "atan",
16775 .opcode = 6,
16776 .operands = &.{
16777 .{ .kind = .id_ref, .quantifier = .required },
16778 },
16779 },
16780 .{
16781 .name = "atan2",
16782 .opcode = 7,
16783 .operands = &.{
16784 .{ .kind = .id_ref, .quantifier = .required },
16785 .{ .kind = .id_ref, .quantifier = .required },
16786 },
16787 },
16788 .{
16789 .name = "atanh",
16790 .opcode = 8,
16791 .operands = &.{
16792 .{ .kind = .id_ref, .quantifier = .required },
16793 },
16794 },
16795 .{
16796 .name = "atanpi",
16797 .opcode = 9,
16798 .operands = &.{
16799 .{ .kind = .id_ref, .quantifier = .required },
16800 },
16801 },
16802 .{
16803 .name = "atan2pi",
16804 .opcode = 10,
16805 .operands = &.{
16806 .{ .kind = .id_ref, .quantifier = .required },
16807 .{ .kind = .id_ref, .quantifier = .required },
16808 },
16809 },
16810 .{
16811 .name = "cbrt",
16812 .opcode = 11,
16813 .operands = &.{
16814 .{ .kind = .id_ref, .quantifier = .required },
16815 },
16816 },
16817 .{
16818 .name = "ceil",
16819 .opcode = 12,
16820 .operands = &.{
16821 .{ .kind = .id_ref, .quantifier = .required },
16822 },
16823 },
16824 .{
16825 .name = "copysign",
16826 .opcode = 13,
16827 .operands = &.{
16828 .{ .kind = .id_ref, .quantifier = .required },
16829 .{ .kind = .id_ref, .quantifier = .required },
16830 },
16831 },
16832 .{
16833 .name = "cos",
16834 .opcode = 14,
16835 .operands = &.{
16836 .{ .kind = .id_ref, .quantifier = .required },
16837 },
16838 },
16839 .{
16840 .name = "cosh",
16841 .opcode = 15,
16842 .operands = &.{
16843 .{ .kind = .id_ref, .quantifier = .required },
16844 },
16845 },
16846 .{
16847 .name = "cospi",
16848 .opcode = 16,
16849 .operands = &.{
16850 .{ .kind = .id_ref, .quantifier = .required },
16851 },
16852 },
16853 .{
16854 .name = "erfc",
16855 .opcode = 17,
16856 .operands = &.{
16857 .{ .kind = .id_ref, .quantifier = .required },
16858 },
16859 },
16860 .{
16861 .name = "erf",
16862 .opcode = 18,
16863 .operands = &.{
16864 .{ .kind = .id_ref, .quantifier = .required },
16865 },
16866 },
16867 .{
16868 .name = "exp",
16869 .opcode = 19,
16870 .operands = &.{
16871 .{ .kind = .id_ref, .quantifier = .required },
16872 },
16873 },
16874 .{
16875 .name = "exp2",
16876 .opcode = 20,
16877 .operands = &.{
16878 .{ .kind = .id_ref, .quantifier = .required },
16879 },
16880 },
16881 .{
16882 .name = "exp10",
16883 .opcode = 21,
16884 .operands = &.{
16885 .{ .kind = .id_ref, .quantifier = .required },
16886 },
16887 },
16888 .{
16889 .name = "expm1",
16890 .opcode = 22,
16891 .operands = &.{
16892 .{ .kind = .id_ref, .quantifier = .required },
16893 },
16894 },
16895 .{
16896 .name = "fabs",
16897 .opcode = 23,
16898 .operands = &.{
16899 .{ .kind = .id_ref, .quantifier = .required },
16900 },
16901 },
16902 .{
16903 .name = "fdim",
16904 .opcode = 24,
16905 .operands = &.{
16906 .{ .kind = .id_ref, .quantifier = .required },
16907 .{ .kind = .id_ref, .quantifier = .required },
16908 },
16909 },
16910 .{
16911 .name = "floor",
16912 .opcode = 25,
16913 .operands = &.{
16914 .{ .kind = .id_ref, .quantifier = .required },
16915 },
16916 },
16917 .{
16918 .name = "fma",
16919 .opcode = 26,
16920 .operands = &.{
16921 .{ .kind = .id_ref, .quantifier = .required },
16922 .{ .kind = .id_ref, .quantifier = .required },
16923 .{ .kind = .id_ref, .quantifier = .required },
16924 },
16925 },
16926 .{
16927 .name = "fmax",
16928 .opcode = 27,
16929 .operands = &.{
16930 .{ .kind = .id_ref, .quantifier = .required },
16931 .{ .kind = .id_ref, .quantifier = .required },
16932 },
16933 },
16934 .{
16935 .name = "fmin",
16936 .opcode = 28,
16937 .operands = &.{
16938 .{ .kind = .id_ref, .quantifier = .required },
16939 .{ .kind = .id_ref, .quantifier = .required },
16940 },
16941 },
16942 .{
16943 .name = "fmod",
16944 .opcode = 29,
16945 .operands = &.{
16946 .{ .kind = .id_ref, .quantifier = .required },
16947 .{ .kind = .id_ref, .quantifier = .required },
16948 },
16949 },
16950 .{
16951 .name = "fract",
16952 .opcode = 30,
16953 .operands = &.{
16954 .{ .kind = .id_ref, .quantifier = .required },
16955 .{ .kind = .id_ref, .quantifier = .required },
16956 },
16957 },
16958 .{
16959 .name = "frexp",
16960 .opcode = 31,
16961 .operands = &.{
16962 .{ .kind = .id_ref, .quantifier = .required },
16963 .{ .kind = .id_ref, .quantifier = .required },
16964 },
16965 },
16966 .{
16967 .name = "hypot",
16968 .opcode = 32,
16969 .operands = &.{
16970 .{ .kind = .id_ref, .quantifier = .required },
16971 .{ .kind = .id_ref, .quantifier = .required },
16972 },
16973 },
16974 .{
16975 .name = "ilogb",
16976 .opcode = 33,
16977 .operands = &.{
16978 .{ .kind = .id_ref, .quantifier = .required },
16979 },
16980 },
16981 .{
16982 .name = "ldexp",
16983 .opcode = 34,
16984 .operands = &.{
16985 .{ .kind = .id_ref, .quantifier = .required },
16986 .{ .kind = .id_ref, .quantifier = .required },
16987 },
16988 },
16989 .{
16990 .name = "lgamma",
16991 .opcode = 35,
16992 .operands = &.{
16993 .{ .kind = .id_ref, .quantifier = .required },
16994 },
16995 },
16996 .{
16997 .name = "lgamma_r",
16998 .opcode = 36,
16999 .operands = &.{
17000 .{ .kind = .id_ref, .quantifier = .required },
17001 .{ .kind = .id_ref, .quantifier = .required },
17002 },
17003 },
17004 .{
17005 .name = "log",
17006 .opcode = 37,
17007 .operands = &.{
17008 .{ .kind = .id_ref, .quantifier = .required },
17009 },
17010 },
17011 .{
17012 .name = "log2",
17013 .opcode = 38,
17014 .operands = &.{
17015 .{ .kind = .id_ref, .quantifier = .required },
17016 },
17017 },
17018 .{
17019 .name = "log10",
17020 .opcode = 39,
17021 .operands = &.{
17022 .{ .kind = .id_ref, .quantifier = .required },
17023 },
17024 },
17025 .{
17026 .name = "log1p",
17027 .opcode = 40,
17028 .operands = &.{
17029 .{ .kind = .id_ref, .quantifier = .required },
17030 },
17031 },
17032 .{
17033 .name = "logb",
17034 .opcode = 41,
17035 .operands = &.{
17036 .{ .kind = .id_ref, .quantifier = .required },
17037 },
17038 },
17039 .{
17040 .name = "mad",
17041 .opcode = 42,
17042 .operands = &.{
17043 .{ .kind = .id_ref, .quantifier = .required },
17044 .{ .kind = .id_ref, .quantifier = .required },
17045 .{ .kind = .id_ref, .quantifier = .required },
17046 },
17047 },
17048 .{
17049 .name = "maxmag",
17050 .opcode = 43,
17051 .operands = &.{
17052 .{ .kind = .id_ref, .quantifier = .required },
17053 .{ .kind = .id_ref, .quantifier = .required },
17054 },
17055 },
17056 .{
17057 .name = "minmag",
17058 .opcode = 44,
17059 .operands = &.{
17060 .{ .kind = .id_ref, .quantifier = .required },
17061 .{ .kind = .id_ref, .quantifier = .required },
17062 },
17063 },
17064 .{
17065 .name = "modf",
17066 .opcode = 45,
17067 .operands = &.{
17068 .{ .kind = .id_ref, .quantifier = .required },
17069 .{ .kind = .id_ref, .quantifier = .required },
17070 },
17071 },
17072 .{
17073 .name = "nan",
17074 .opcode = 46,
17075 .operands = &.{
17076 .{ .kind = .id_ref, .quantifier = .required },
17077 },
17078 },
17079 .{
17080 .name = "nextafter",
17081 .opcode = 47,
17082 .operands = &.{
17083 .{ .kind = .id_ref, .quantifier = .required },
17084 .{ .kind = .id_ref, .quantifier = .required },
17085 },
17086 },
17087 .{
17088 .name = "pow",
17089 .opcode = 48,
17090 .operands = &.{
17091 .{ .kind = .id_ref, .quantifier = .required },
17092 .{ .kind = .id_ref, .quantifier = .required },
17093 },
17094 },
17095 .{
17096 .name = "pown",
17097 .opcode = 49,
17098 .operands = &.{
17099 .{ .kind = .id_ref, .quantifier = .required },
17100 .{ .kind = .id_ref, .quantifier = .required },
17101 },
17102 },
17103 .{
17104 .name = "powr",
17105 .opcode = 50,
17106 .operands = &.{
17107 .{ .kind = .id_ref, .quantifier = .required },
17108 .{ .kind = .id_ref, .quantifier = .required },
17109 },
17110 },
17111 .{
17112 .name = "remainder",
17113 .opcode = 51,
17114 .operands = &.{
17115 .{ .kind = .id_ref, .quantifier = .required },
17116 .{ .kind = .id_ref, .quantifier = .required },
17117 },
17118 },
17119 .{
17120 .name = "remquo",
17121 .opcode = 52,
17122 .operands = &.{
17123 .{ .kind = .id_ref, .quantifier = .required },
17124 .{ .kind = .id_ref, .quantifier = .required },
17125 .{ .kind = .id_ref, .quantifier = .required },
17126 },
17127 },
17128 .{
17129 .name = "rint",
17130 .opcode = 53,
17131 .operands = &.{
17132 .{ .kind = .id_ref, .quantifier = .required },
17133 },
17134 },
17135 .{
17136 .name = "rootn",
17137 .opcode = 54,
17138 .operands = &.{
17139 .{ .kind = .id_ref, .quantifier = .required },
17140 .{ .kind = .id_ref, .quantifier = .required },
17141 },
17142 },
17143 .{
17144 .name = "round",
17145 .opcode = 55,
17146 .operands = &.{
17147 .{ .kind = .id_ref, .quantifier = .required },
17148 },
17149 },
17150 .{
17151 .name = "rsqrt",
17152 .opcode = 56,
17153 .operands = &.{
17154 .{ .kind = .id_ref, .quantifier = .required },
17155 },
17156 },
17157 .{
17158 .name = "sin",
17159 .opcode = 57,
17160 .operands = &.{
17161 .{ .kind = .id_ref, .quantifier = .required },
17162 },
17163 },
17164 .{
17165 .name = "sincos",
17166 .opcode = 58,
17167 .operands = &.{
17168 .{ .kind = .id_ref, .quantifier = .required },
17169 .{ .kind = .id_ref, .quantifier = .required },
17170 },
17171 },
17172 .{
17173 .name = "sinh",
17174 .opcode = 59,
17175 .operands = &.{
17176 .{ .kind = .id_ref, .quantifier = .required },
17177 },
17178 },
17179 .{
17180 .name = "sinpi",
17181 .opcode = 60,
17182 .operands = &.{
17183 .{ .kind = .id_ref, .quantifier = .required },
17184 },
17185 },
17186 .{
17187 .name = "sqrt",
17188 .opcode = 61,
17189 .operands = &.{
17190 .{ .kind = .id_ref, .quantifier = .required },
17191 },
17192 },
17193 .{
17194 .name = "tan",
17195 .opcode = 62,
17196 .operands = &.{
17197 .{ .kind = .id_ref, .quantifier = .required },
17198 },
17199 },
17200 .{
17201 .name = "tanh",
17202 .opcode = 63,
17203 .operands = &.{
17204 .{ .kind = .id_ref, .quantifier = .required },
17205 },
17206 },
17207 .{
17208 .name = "tanpi",
17209 .opcode = 64,
17210 .operands = &.{
17211 .{ .kind = .id_ref, .quantifier = .required },
17212 },
17213 },
17214 .{
17215 .name = "tgamma",
17216 .opcode = 65,
17217 .operands = &.{
17218 .{ .kind = .id_ref, .quantifier = .required },
17219 },
17220 },
17221 .{
17222 .name = "trunc",
17223 .opcode = 66,
17224 .operands = &.{
17225 .{ .kind = .id_ref, .quantifier = .required },
17226 },
17227 },
17228 .{
17229 .name = "half_cos",
17230 .opcode = 67,
17231 .operands = &.{
17232 .{ .kind = .id_ref, .quantifier = .required },
17233 },
17234 },
17235 .{
17236 .name = "half_divide",
17237 .opcode = 68,
17238 .operands = &.{
17239 .{ .kind = .id_ref, .quantifier = .required },
17240 .{ .kind = .id_ref, .quantifier = .required },
17241 },
17242 },
17243 .{
17244 .name = "half_exp",
17245 .opcode = 69,
17246 .operands = &.{
17247 .{ .kind = .id_ref, .quantifier = .required },
17248 },
17249 },
17250 .{
17251 .name = "half_exp2",
17252 .opcode = 70,
17253 .operands = &.{
17254 .{ .kind = .id_ref, .quantifier = .required },
17255 },
17256 },
17257 .{
17258 .name = "half_exp10",
17259 .opcode = 71,
17260 .operands = &.{
17261 .{ .kind = .id_ref, .quantifier = .required },
17262 },
17263 },
17264 .{
17265 .name = "half_log",
17266 .opcode = 72,
17267 .operands = &.{
17268 .{ .kind = .id_ref, .quantifier = .required },
17269 },
17270 },
17271 .{
17272 .name = "half_log2",
17273 .opcode = 73,
17274 .operands = &.{
17275 .{ .kind = .id_ref, .quantifier = .required },
17276 },
17277 },
17278 .{
17279 .name = "half_log10",
17280 .opcode = 74,
17281 .operands = &.{
17282 .{ .kind = .id_ref, .quantifier = .required },
17283 },
17284 },
17285 .{
17286 .name = "half_powr",
17287 .opcode = 75,
17288 .operands = &.{
17289 .{ .kind = .id_ref, .quantifier = .required },
17290 .{ .kind = .id_ref, .quantifier = .required },
17291 },
17292 },
17293 .{
17294 .name = "half_recip",
17295 .opcode = 76,
17296 .operands = &.{
17297 .{ .kind = .id_ref, .quantifier = .required },
17298 },
17299 },
17300 .{
17301 .name = "half_rsqrt",
17302 .opcode = 77,
17303 .operands = &.{
17304 .{ .kind = .id_ref, .quantifier = .required },
17305 },
17306 },
17307 .{
17308 .name = "half_sin",
17309 .opcode = 78,
17310 .operands = &.{
17311 .{ .kind = .id_ref, .quantifier = .required },
17312 },
17313 },
17314 .{
17315 .name = "half_sqrt",
17316 .opcode = 79,
17317 .operands = &.{
17318 .{ .kind = .id_ref, .quantifier = .required },
17319 },
17320 },
17321 .{
17322 .name = "half_tan",
17323 .opcode = 80,
17324 .operands = &.{
17325 .{ .kind = .id_ref, .quantifier = .required },
17326 },
17327 },
17328 .{
17329 .name = "native_cos",
17330 .opcode = 81,
17331 .operands = &.{
17332 .{ .kind = .id_ref, .quantifier = .required },
17333 },
17334 },
17335 .{
17336 .name = "native_divide",
17337 .opcode = 82,
17338 .operands = &.{
17339 .{ .kind = .id_ref, .quantifier = .required },
17340 .{ .kind = .id_ref, .quantifier = .required },
17341 },
17342 },
17343 .{
17344 .name = "native_exp",
17345 .opcode = 83,
17346 .operands = &.{
17347 .{ .kind = .id_ref, .quantifier = .required },
17348 },
17349 },
17350 .{
17351 .name = "native_exp2",
17352 .opcode = 84,
17353 .operands = &.{
17354 .{ .kind = .id_ref, .quantifier = .required },
17355 },
17356 },
17357 .{
17358 .name = "native_exp10",
17359 .opcode = 85,
17360 .operands = &.{
17361 .{ .kind = .id_ref, .quantifier = .required },
17362 },
17363 },
17364 .{
17365 .name = "native_log",
17366 .opcode = 86,
17367 .operands = &.{
17368 .{ .kind = .id_ref, .quantifier = .required },
17369 },
17370 },
17371 .{
17372 .name = "native_log2",
17373 .opcode = 87,
17374 .operands = &.{
17375 .{ .kind = .id_ref, .quantifier = .required },
17376 },
17377 },
17378 .{
17379 .name = "native_log10",
17380 .opcode = 88,
17381 .operands = &.{
17382 .{ .kind = .id_ref, .quantifier = .required },
17383 },
17384 },
17385 .{
17386 .name = "native_powr",
17387 .opcode = 89,
17388 .operands = &.{
17389 .{ .kind = .id_ref, .quantifier = .required },
17390 .{ .kind = .id_ref, .quantifier = .required },
17391 },
17392 },
17393 .{
17394 .name = "native_recip",
17395 .opcode = 90,
17396 .operands = &.{
17397 .{ .kind = .id_ref, .quantifier = .required },
17398 },
17399 },
17400 .{
17401 .name = "native_rsqrt",
17402 .opcode = 91,
17403 .operands = &.{
17404 .{ .kind = .id_ref, .quantifier = .required },
17405 },
17406 },
17407 .{
17408 .name = "native_sin",
17409 .opcode = 92,
17410 .operands = &.{
17411 .{ .kind = .id_ref, .quantifier = .required },
17412 },
17413 },
17414 .{
17415 .name = "native_sqrt",
17416 .opcode = 93,
17417 .operands = &.{
17418 .{ .kind = .id_ref, .quantifier = .required },
17419 },
17420 },
17421 .{
17422 .name = "native_tan",
17423 .opcode = 94,
17424 .operands = &.{
17425 .{ .kind = .id_ref, .quantifier = .required },
17426 },
17427 },
17428 .{
17429 .name = "fclamp",
17430 .opcode = 95,
17431 .operands = &.{
17432 .{ .kind = .id_ref, .quantifier = .required },
17433 .{ .kind = .id_ref, .quantifier = .required },
17434 .{ .kind = .id_ref, .quantifier = .required },
17435 },
17436 },
17437 .{
17438 .name = "degrees",
17439 .opcode = 96,
17440 .operands = &.{
17441 .{ .kind = .id_ref, .quantifier = .required },
17442 },
17443 },
17444 .{
17445 .name = "fmax_common",
17446 .opcode = 97,
17447 .operands = &.{
17448 .{ .kind = .id_ref, .quantifier = .required },
17449 .{ .kind = .id_ref, .quantifier = .required },
17450 },
17451 },
17452 .{
17453 .name = "fmin_common",
17454 .opcode = 98,
17455 .operands = &.{
17456 .{ .kind = .id_ref, .quantifier = .required },
17457 .{ .kind = .id_ref, .quantifier = .required },
17458 },
17459 },
17460 .{
17461 .name = "mix",
17462 .opcode = 99,
17463 .operands = &.{
17464 .{ .kind = .id_ref, .quantifier = .required },
17465 .{ .kind = .id_ref, .quantifier = .required },
17466 .{ .kind = .id_ref, .quantifier = .required },
17467 },
17468 },
17469 .{
17470 .name = "radians",
17471 .opcode = 100,
17472 .operands = &.{
17473 .{ .kind = .id_ref, .quantifier = .required },
17474 },
17475 },
17476 .{
17477 .name = "step",
17478 .opcode = 101,
17479 .operands = &.{
17480 .{ .kind = .id_ref, .quantifier = .required },
17481 .{ .kind = .id_ref, .quantifier = .required },
17482 },
17483 },
17484 .{
17485 .name = "smoothstep",
17486 .opcode = 102,
17487 .operands = &.{
17488 .{ .kind = .id_ref, .quantifier = .required },
17489 .{ .kind = .id_ref, .quantifier = .required },
17490 .{ .kind = .id_ref, .quantifier = .required },
17491 },
17492 },
17493 .{
17494 .name = "sign",
17495 .opcode = 103,
17496 .operands = &.{
17497 .{ .kind = .id_ref, .quantifier = .required },
17498 },
17499 },
17500 .{
17501 .name = "cross",
17502 .opcode = 104,
17503 .operands = &.{
17504 .{ .kind = .id_ref, .quantifier = .required },
17505 .{ .kind = .id_ref, .quantifier = .required },
17506 },
17507 },
17508 .{
17509 .name = "distance",
17510 .opcode = 105,
17511 .operands = &.{
17512 .{ .kind = .id_ref, .quantifier = .required },
17513 .{ .kind = .id_ref, .quantifier = .required },
17514 },
17515 },
17516 .{
17517 .name = "length",
17518 .opcode = 106,
17519 .operands = &.{
17520 .{ .kind = .id_ref, .quantifier = .required },
17521 },
17522 },
17523 .{
17524 .name = "normalize",
17525 .opcode = 107,
17526 .operands = &.{
17527 .{ .kind = .id_ref, .quantifier = .required },
17528 },
17529 },
17530 .{
17531 .name = "fast_distance",
17532 .opcode = 108,
17533 .operands = &.{
17534 .{ .kind = .id_ref, .quantifier = .required },
17535 .{ .kind = .id_ref, .quantifier = .required },
17536 },
17537 },
17538 .{
17539 .name = "fast_length",
17540 .opcode = 109,
17541 .operands = &.{
17542 .{ .kind = .id_ref, .quantifier = .required },
17543 },
17544 },
17545 .{
17546 .name = "fast_normalize",
17547 .opcode = 110,
17548 .operands = &.{
17549 .{ .kind = .id_ref, .quantifier = .required },
17550 },
17551 },
17552 .{
17553 .name = "s_abs",
17554 .opcode = 141,
17555 .operands = &.{
17556 .{ .kind = .id_ref, .quantifier = .required },
17557 },
17558 },
17559 .{
17560 .name = "s_abs_diff",
17561 .opcode = 142,
17562 .operands = &.{
17563 .{ .kind = .id_ref, .quantifier = .required },
17564 .{ .kind = .id_ref, .quantifier = .required },
17565 },
17566 },
17567 .{
17568 .name = "s_add_sat",
17569 .opcode = 143,
17570 .operands = &.{
17571 .{ .kind = .id_ref, .quantifier = .required },
17572 .{ .kind = .id_ref, .quantifier = .required },
17573 },
17574 },
17575 .{
17576 .name = "u_add_sat",
17577 .opcode = 144,
17578 .operands = &.{
17579 .{ .kind = .id_ref, .quantifier = .required },
17580 .{ .kind = .id_ref, .quantifier = .required },
17581 },
17582 },
17583 .{
17584 .name = "s_hadd",
17585 .opcode = 145,
17586 .operands = &.{
17587 .{ .kind = .id_ref, .quantifier = .required },
17588 .{ .kind = .id_ref, .quantifier = .required },
17589 },
17590 },
17591 .{
17592 .name = "u_hadd",
17593 .opcode = 146,
17594 .operands = &.{
17595 .{ .kind = .id_ref, .quantifier = .required },
17596 .{ .kind = .id_ref, .quantifier = .required },
17597 },
17598 },
17599 .{
17600 .name = "s_rhadd",
17601 .opcode = 147,
17602 .operands = &.{
17603 .{ .kind = .id_ref, .quantifier = .required },
17604 .{ .kind = .id_ref, .quantifier = .required },
17605 },
17606 },
17607 .{
17608 .name = "u_rhadd",
17609 .opcode = 148,
17610 .operands = &.{
17611 .{ .kind = .id_ref, .quantifier = .required },
17612 .{ .kind = .id_ref, .quantifier = .required },
17613 },
17614 },
17615 .{
17616 .name = "s_clamp",
17617 .opcode = 149,
17618 .operands = &.{
17619 .{ .kind = .id_ref, .quantifier = .required },
17620 .{ .kind = .id_ref, .quantifier = .required },
17621 .{ .kind = .id_ref, .quantifier = .required },
17622 },
17623 },
17624 .{
17625 .name = "u_clamp",
17626 .opcode = 150,
17627 .operands = &.{
17628 .{ .kind = .id_ref, .quantifier = .required },
17629 .{ .kind = .id_ref, .quantifier = .required },
17630 .{ .kind = .id_ref, .quantifier = .required },
17631 },
17632 },
17633 .{
17634 .name = "clz",
17635 .opcode = 151,
17636 .operands = &.{
17637 .{ .kind = .id_ref, .quantifier = .required },
17638 },
17639 },
17640 .{
17641 .name = "ctz",
17642 .opcode = 152,
17643 .operands = &.{
17644 .{ .kind = .id_ref, .quantifier = .required },
17645 },
17646 },
17647 .{
17648 .name = "s_mad_hi",
17649 .opcode = 153,
17650 .operands = &.{
17651 .{ .kind = .id_ref, .quantifier = .required },
17652 .{ .kind = .id_ref, .quantifier = .required },
17653 .{ .kind = .id_ref, .quantifier = .required },
17654 },
17655 },
17656 .{
17657 .name = "u_mad_sat",
17658 .opcode = 154,
17659 .operands = &.{
17660 .{ .kind = .id_ref, .quantifier = .required },
17661 .{ .kind = .id_ref, .quantifier = .required },
17662 .{ .kind = .id_ref, .quantifier = .required },
17663 },
17664 },
17665 .{
17666 .name = "s_mad_sat",
17667 .opcode = 155,
17668 .operands = &.{
17669 .{ .kind = .id_ref, .quantifier = .required },
17670 .{ .kind = .id_ref, .quantifier = .required },
17671 .{ .kind = .id_ref, .quantifier = .required },
17672 },
17673 },
17674 .{
17675 .name = "s_max",
17676 .opcode = 156,
17677 .operands = &.{
17678 .{ .kind = .id_ref, .quantifier = .required },
17679 .{ .kind = .id_ref, .quantifier = .required },
17680 },
17681 },
17682 .{
17683 .name = "u_max",
17684 .opcode = 157,
17685 .operands = &.{
17686 .{ .kind = .id_ref, .quantifier = .required },
17687 .{ .kind = .id_ref, .quantifier = .required },
17688 },
17689 },
17690 .{
17691 .name = "s_min",
17692 .opcode = 158,
17693 .operands = &.{
17694 .{ .kind = .id_ref, .quantifier = .required },
17695 .{ .kind = .id_ref, .quantifier = .required },
17696 },
17697 },
17698 .{
17699 .name = "u_min",
17700 .opcode = 159,
17701 .operands = &.{
17702 .{ .kind = .id_ref, .quantifier = .required },
17703 .{ .kind = .id_ref, .quantifier = .required },
17704 },
17705 },
17706 .{
17707 .name = "s_mul_hi",
17708 .opcode = 160,
17709 .operands = &.{
17710 .{ .kind = .id_ref, .quantifier = .required },
17711 .{ .kind = .id_ref, .quantifier = .required },
17712 },
17713 },
17714 .{
17715 .name = "rotate",
17716 .opcode = 161,
17717 .operands = &.{
17718 .{ .kind = .id_ref, .quantifier = .required },
17719 .{ .kind = .id_ref, .quantifier = .required },
17720 },
17721 },
17722 .{
17723 .name = "s_sub_sat",
17724 .opcode = 162,
17725 .operands = &.{
17726 .{ .kind = .id_ref, .quantifier = .required },
17727 .{ .kind = .id_ref, .quantifier = .required },
17728 },
17729 },
17730 .{
17731 .name = "u_sub_sat",
17732 .opcode = 163,
17733 .operands = &.{
17734 .{ .kind = .id_ref, .quantifier = .required },
17735 .{ .kind = .id_ref, .quantifier = .required },
17736 },
17737 },
17738 .{
17739 .name = "u_upsample",
17740 .opcode = 164,
17741 .operands = &.{
17742 .{ .kind = .id_ref, .quantifier = .required },
17743 .{ .kind = .id_ref, .quantifier = .required },
17744 },
17745 },
17746 .{
17747 .name = "s_upsample",
17748 .opcode = 165,
17749 .operands = &.{
17750 .{ .kind = .id_ref, .quantifier = .required },
17751 .{ .kind = .id_ref, .quantifier = .required },
17752 },
17753 },
17754 .{
17755 .name = "popcount",
17756 .opcode = 166,
17757 .operands = &.{
17758 .{ .kind = .id_ref, .quantifier = .required },
17759 },
17760 },
17761 .{
17762 .name = "s_mad24",
17763 .opcode = 167,
17764 .operands = &.{
17765 .{ .kind = .id_ref, .quantifier = .required },
17766 .{ .kind = .id_ref, .quantifier = .required },
17767 .{ .kind = .id_ref, .quantifier = .required },
17768 },
17769 },
17770 .{
17771 .name = "u_mad24",
17772 .opcode = 168,
17773 .operands = &.{
17774 .{ .kind = .id_ref, .quantifier = .required },
17775 .{ .kind = .id_ref, .quantifier = .required },
17776 .{ .kind = .id_ref, .quantifier = .required },
17777 },
17778 },
17779 .{
17780 .name = "s_mul24",
17781 .opcode = 169,
17782 .operands = &.{
17783 .{ .kind = .id_ref, .quantifier = .required },
17784 .{ .kind = .id_ref, .quantifier = .required },
17785 },
17786 },
17787 .{
17788 .name = "u_mul24",
17789 .opcode = 170,
17790 .operands = &.{
17791 .{ .kind = .id_ref, .quantifier = .required },
17792 .{ .kind = .id_ref, .quantifier = .required },
17793 },
17794 },
17795 .{
17796 .name = "vloadn",
17797 .opcode = 171,
17798 .operands = &.{
17799 .{ .kind = .id_ref, .quantifier = .required },
17800 .{ .kind = .id_ref, .quantifier = .required },
17801 .{ .kind = .literal_integer, .quantifier = .required },
17802 },
17803 },
17804 .{
17805 .name = "vstoren",
17806 .opcode = 172,
17807 .operands = &.{
17808 .{ .kind = .id_ref, .quantifier = .required },
17809 .{ .kind = .id_ref, .quantifier = .required },
17810 .{ .kind = .id_ref, .quantifier = .required },
17811 },
17812 },
17813 .{
17814 .name = "vload_half",
17815 .opcode = 173,
17816 .operands = &.{
17817 .{ .kind = .id_ref, .quantifier = .required },
17818 .{ .kind = .id_ref, .quantifier = .required },
17819 },
17820 },
17821 .{
17822 .name = "vload_halfn",
17823 .opcode = 174,
17824 .operands = &.{
17825 .{ .kind = .id_ref, .quantifier = .required },
17826 .{ .kind = .id_ref, .quantifier = .required },
17827 .{ .kind = .literal_integer, .quantifier = .required },
17828 },
17829 },
17830 .{
17831 .name = "vstore_half",
17832 .opcode = 175,
17833 .operands = &.{
17834 .{ .kind = .id_ref, .quantifier = .required },
17835 .{ .kind = .id_ref, .quantifier = .required },
17836 .{ .kind = .id_ref, .quantifier = .required },
17837 },
17838 },
17839 .{
17840 .name = "vstore_half_r",
17841 .opcode = 176,
17842 .operands = &.{
17843 .{ .kind = .id_ref, .quantifier = .required },
17844 .{ .kind = .id_ref, .quantifier = .required },
17845 .{ .kind = .id_ref, .quantifier = .required },
17846 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17847 },
17848 },
17849 .{
17850 .name = "vstore_halfn",
17851 .opcode = 177,
17852 .operands = &.{
17853 .{ .kind = .id_ref, .quantifier = .required },
17854 .{ .kind = .id_ref, .quantifier = .required },
17855 .{ .kind = .id_ref, .quantifier = .required },
17856 },
17857 },
17858 .{
17859 .name = "vstore_halfn_r",
17860 .opcode = 178,
17861 .operands = &.{
17862 .{ .kind = .id_ref, .quantifier = .required },
17863 .{ .kind = .id_ref, .quantifier = .required },
17864 .{ .kind = .id_ref, .quantifier = .required },
17865 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17866 },
17867 },
17868 .{
17869 .name = "vloada_halfn",
17870 .opcode = 179,
17871 .operands = &.{
17872 .{ .kind = .id_ref, .quantifier = .required },
17873 .{ .kind = .id_ref, .quantifier = .required },
17874 .{ .kind = .literal_integer, .quantifier = .required },
17875 },
17876 },
17877 .{
17878 .name = "vstorea_halfn",
17879 .opcode = 180,
17880 .operands = &.{
17881 .{ .kind = .id_ref, .quantifier = .required },
17882 .{ .kind = .id_ref, .quantifier = .required },
17883 .{ .kind = .id_ref, .quantifier = .required },
17884 },
17885 },
17886 .{
17887 .name = "vstorea_halfn_r",
17888 .opcode = 181,
17889 .operands = &.{
17890 .{ .kind = .id_ref, .quantifier = .required },
17891 .{ .kind = .id_ref, .quantifier = .required },
17892 .{ .kind = .id_ref, .quantifier = .required },
17893 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17894 },
17895 },
17896 .{
17897 .name = "shuffle",
17898 .opcode = 182,
17899 .operands = &.{
17900 .{ .kind = .id_ref, .quantifier = .required },
17901 .{ .kind = .id_ref, .quantifier = .required },
17902 },
17903 },
17904 .{
17905 .name = "shuffle2",
17906 .opcode = 183,
17907 .operands = &.{
17908 .{ .kind = .id_ref, .quantifier = .required },
17909 .{ .kind = .id_ref, .quantifier = .required },
17910 .{ .kind = .id_ref, .quantifier = .required },
17911 },
17912 },
17913 .{
17914 .name = "printf",
17915 .opcode = 184,
17916 .operands = &.{
17917 .{ .kind = .id_ref, .quantifier = .required },
17918 .{ .kind = .id_ref, .quantifier = .variadic },
17919 },
17920 },
17921 .{
17922 .name = "prefetch",
17923 .opcode = 185,
17924 .operands = &.{
17925 .{ .kind = .id_ref, .quantifier = .required },
17926 .{ .kind = .id_ref, .quantifier = .required },
17927 },
17928 },
17929 .{
17930 .name = "bitselect",
17931 .opcode = 186,
17932 .operands = &.{
17933 .{ .kind = .id_ref, .quantifier = .required },
17934 .{ .kind = .id_ref, .quantifier = .required },
17935 .{ .kind = .id_ref, .quantifier = .required },
17936 },
17937 },
17938 .{
17939 .name = "select",
17940 .opcode = 187,
17941 .operands = &.{
17942 .{ .kind = .id_ref, .quantifier = .required },
17943 .{ .kind = .id_ref, .quantifier = .required },
17944 .{ .kind = .id_ref, .quantifier = .required },
17945 },
17946 },
17947 .{
17948 .name = "u_abs",
17949 .opcode = 201,
17950 .operands = &.{
17951 .{ .kind = .id_ref, .quantifier = .required },
17952 },
17953 },
17954 .{
17955 .name = "u_abs_diff",
17956 .opcode = 202,
17957 .operands = &.{
17958 .{ .kind = .id_ref, .quantifier = .required },
17959 .{ .kind = .id_ref, .quantifier = .required },
17960 },
17961 },
17962 .{
17963 .name = "u_mul_hi",
17964 .opcode = 203,
17965 .operands = &.{
17966 .{ .kind = .id_ref, .quantifier = .required },
17967 .{ .kind = .id_ref, .quantifier = .required },
17968 },
17969 },
17970 .{
17971 .name = "u_mad_hi",
17972 .opcode = 204,
17973 .operands = &.{
17974 .{ .kind = .id_ref, .quantifier = .required },
17975 .{ .kind = .id_ref, .quantifier = .required },
17976 .{ .kind = .id_ref, .quantifier = .required },
17977 },
17978 },
17979 },
17980 .@"NonSemantic.Shader.DebugInfo.100" => &.{
17981 .{
17982 .name = "DebugInfoNone",
17983 .opcode = 0,
17984 .operands = &.{},
17985 },
17986 .{
17987 .name = "DebugCompilationUnit",
17988 .opcode = 1,
17989 .operands = &.{
17990 .{ .kind = .id_ref, .quantifier = .required },
17991 .{ .kind = .id_ref, .quantifier = .required },
17992 .{ .kind = .id_ref, .quantifier = .required },
17993 .{ .kind = .id_ref, .quantifier = .required },
17994 },
17995 },
17996 .{
17997 .name = "DebugTypeBasic",
17998 .opcode = 2,
17999 .operands = &.{
18000 .{ .kind = .id_ref, .quantifier = .required },
18001 .{ .kind = .id_ref, .quantifier = .required },
18002 .{ .kind = .id_ref, .quantifier = .required },
18003 .{ .kind = .id_ref, .quantifier = .required },
18004 },
18005 },
18006 .{
18007 .name = "DebugTypePointer",
18008 .opcode = 3,
18009 .operands = &.{
18010 .{ .kind = .id_ref, .quantifier = .required },
18011 .{ .kind = .id_ref, .quantifier = .required },
18012 .{ .kind = .id_ref, .quantifier = .required },
18013 },
18014 },
18015 .{
18016 .name = "DebugTypeQualifier",
18017 .opcode = 4,
18018 .operands = &.{
18019 .{ .kind = .id_ref, .quantifier = .required },
18020 .{ .kind = .id_ref, .quantifier = .required },
18021 },
18022 },
18023 .{
18024 .name = "DebugTypeArray",
18025 .opcode = 5,
18026 .operands = &.{
18027 .{ .kind = .id_ref, .quantifier = .required },
18028 .{ .kind = .id_ref, .quantifier = .variadic },
18029 },
18030 },
18031 .{
18032 .name = "DebugTypeVector",
18033 .opcode = 6,
18034 .operands = &.{
18035 .{ .kind = .id_ref, .quantifier = .required },
18036 .{ .kind = .id_ref, .quantifier = .required },
18037 },
18038 },
18039 .{
18040 .name = "DebugTypedef",
18041 .opcode = 7,
18042 .operands = &.{
18043 .{ .kind = .id_ref, .quantifier = .required },
18044 .{ .kind = .id_ref, .quantifier = .required },
18045 .{ .kind = .id_ref, .quantifier = .required },
18046 .{ .kind = .id_ref, .quantifier = .required },
18047 .{ .kind = .id_ref, .quantifier = .required },
18048 .{ .kind = .id_ref, .quantifier = .required },
18049 },
18050 },
18051 .{
18052 .name = "DebugTypeFunction",
18053 .opcode = 8,
18054 .operands = &.{
18055 .{ .kind = .id_ref, .quantifier = .required },
18056 .{ .kind = .id_ref, .quantifier = .required },
18057 .{ .kind = .id_ref, .quantifier = .variadic },
18058 },
18059 },
18060 .{
18061 .name = "DebugTypeEnum",
18062 .opcode = 9,
18063 .operands = &.{
18064 .{ .kind = .id_ref, .quantifier = .required },
18065 .{ .kind = .id_ref, .quantifier = .required },
18066 .{ .kind = .id_ref, .quantifier = .required },
18067 .{ .kind = .id_ref, .quantifier = .required },
18068 .{ .kind = .id_ref, .quantifier = .required },
18069 .{ .kind = .id_ref, .quantifier = .required },
18070 .{ .kind = .id_ref, .quantifier = .required },
18071 .{ .kind = .id_ref, .quantifier = .required },
18072 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
18073 },
18074 },
18075 .{
18076 .name = "DebugTypeComposite",
18077 .opcode = 10,
18078 .operands = &.{
18079 .{ .kind = .id_ref, .quantifier = .required },
18080 .{ .kind = .id_ref, .quantifier = .required },
18081 .{ .kind = .id_ref, .quantifier = .required },
18082 .{ .kind = .id_ref, .quantifier = .required },
18083 .{ .kind = .id_ref, .quantifier = .required },
18084 .{ .kind = .id_ref, .quantifier = .required },
18085 .{ .kind = .id_ref, .quantifier = .required },
18086 .{ .kind = .id_ref, .quantifier = .required },
18087 .{ .kind = .id_ref, .quantifier = .required },
18088 .{ .kind = .id_ref, .quantifier = .variadic },
18089 },
18090 },
18091 .{
18092 .name = "DebugTypeMember",
18093 .opcode = 11,
18094 .operands = &.{
18095 .{ .kind = .id_ref, .quantifier = .required },
18096 .{ .kind = .id_ref, .quantifier = .required },
18097 .{ .kind = .id_ref, .quantifier = .required },
18098 .{ .kind = .id_ref, .quantifier = .required },
18099 .{ .kind = .id_ref, .quantifier = .required },
18100 .{ .kind = .id_ref, .quantifier = .required },
18101 .{ .kind = .id_ref, .quantifier = .required },
18102 .{ .kind = .id_ref, .quantifier = .required },
18103 .{ .kind = .id_ref, .quantifier = .optional },
18104 },
18105 },
18106 .{
18107 .name = "DebugTypeInheritance",
18108 .opcode = 12,
18109 .operands = &.{
18110 .{ .kind = .id_ref, .quantifier = .required },
18111 .{ .kind = .id_ref, .quantifier = .required },
18112 .{ .kind = .id_ref, .quantifier = .required },
18113 .{ .kind = .id_ref, .quantifier = .required },
18114 },
18115 },
18116 .{
18117 .name = "DebugTypePtrToMember",
18118 .opcode = 13,
18119 .operands = &.{
18120 .{ .kind = .id_ref, .quantifier = .required },
18121 .{ .kind = .id_ref, .quantifier = .required },
18122 },
18123 },
18124 .{
18125 .name = "DebugTypeTemplate",
18126 .opcode = 14,
18127 .operands = &.{
18128 .{ .kind = .id_ref, .quantifier = .required },
18129 .{ .kind = .id_ref, .quantifier = .variadic },
18130 },
18131 },
18132 .{
18133 .name = "DebugTypeTemplateParameter",
18134 .opcode = 15,
18135 .operands = &.{
18136 .{ .kind = .id_ref, .quantifier = .required },
18137 .{ .kind = .id_ref, .quantifier = .required },
18138 .{ .kind = .id_ref, .quantifier = .required },
18139 .{ .kind = .id_ref, .quantifier = .required },
18140 .{ .kind = .id_ref, .quantifier = .required },
18141 .{ .kind = .id_ref, .quantifier = .required },
18142 },
18143 },
18144 .{
18145 .name = "DebugTypeTemplateTemplateParameter",
18146 .opcode = 16,
18147 .operands = &.{
18148 .{ .kind = .id_ref, .quantifier = .required },
18149 .{ .kind = .id_ref, .quantifier = .required },
18150 .{ .kind = .id_ref, .quantifier = .required },
18151 .{ .kind = .id_ref, .quantifier = .required },
18152 .{ .kind = .id_ref, .quantifier = .required },
18153 },
18154 },
18155 .{
18156 .name = "DebugTypeTemplateParameterPack",
18157 .opcode = 17,
18158 .operands = &.{
18159 .{ .kind = .id_ref, .quantifier = .required },
18160 .{ .kind = .id_ref, .quantifier = .required },
18161 .{ .kind = .id_ref, .quantifier = .required },
18162 .{ .kind = .id_ref, .quantifier = .required },
18163 .{ .kind = .id_ref, .quantifier = .variadic },
18164 },
18165 },
18166 .{
18167 .name = "DebugGlobalVariable",
18168 .opcode = 18,
18169 .operands = &.{
18170 .{ .kind = .id_ref, .quantifier = .required },
18171 .{ .kind = .id_ref, .quantifier = .required },
18172 .{ .kind = .id_ref, .quantifier = .required },
18173 .{ .kind = .id_ref, .quantifier = .required },
18174 .{ .kind = .id_ref, .quantifier = .required },
18175 .{ .kind = .id_ref, .quantifier = .required },
18176 .{ .kind = .id_ref, .quantifier = .required },
18177 .{ .kind = .id_ref, .quantifier = .required },
18178 .{ .kind = .id_ref, .quantifier = .required },
18179 .{ .kind = .id_ref, .quantifier = .optional },
18180 },
18181 },
18182 .{
18183 .name = "DebugFunctionDeclaration",
18184 .opcode = 19,
18185 .operands = &.{
18186 .{ .kind = .id_ref, .quantifier = .required },
18187 .{ .kind = .id_ref, .quantifier = .required },
18188 .{ .kind = .id_ref, .quantifier = .required },
18189 .{ .kind = .id_ref, .quantifier = .required },
18190 .{ .kind = .id_ref, .quantifier = .required },
18191 .{ .kind = .id_ref, .quantifier = .required },
18192 .{ .kind = .id_ref, .quantifier = .required },
18193 .{ .kind = .id_ref, .quantifier = .required },
18194 },
18195 },
18196 .{
18197 .name = "DebugFunction",
18198 .opcode = 20,
18199 .operands = &.{
18200 .{ .kind = .id_ref, .quantifier = .required },
18201 .{ .kind = .id_ref, .quantifier = .required },
18202 .{ .kind = .id_ref, .quantifier = .required },
18203 .{ .kind = .id_ref, .quantifier = .required },
18204 .{ .kind = .id_ref, .quantifier = .required },
18205 .{ .kind = .id_ref, .quantifier = .required },
18206 .{ .kind = .id_ref, .quantifier = .required },
18207 .{ .kind = .id_ref, .quantifier = .required },
18208 .{ .kind = .id_ref, .quantifier = .required },
18209 .{ .kind = .id_ref, .quantifier = .optional },
18210 },
18211 },
18212 .{
18213 .name = "DebugLexicalBlock",
18214 .opcode = 21,
18215 .operands = &.{
18216 .{ .kind = .id_ref, .quantifier = .required },
18217 .{ .kind = .id_ref, .quantifier = .required },
18218 .{ .kind = .id_ref, .quantifier = .required },
18219 .{ .kind = .id_ref, .quantifier = .required },
18220 .{ .kind = .id_ref, .quantifier = .optional },
18221 },
18222 },
18223 .{
18224 .name = "DebugLexicalBlockDiscriminator",
18225 .opcode = 22,
18226 .operands = &.{
18227 .{ .kind = .id_ref, .quantifier = .required },
18228 .{ .kind = .id_ref, .quantifier = .required },
18229 .{ .kind = .id_ref, .quantifier = .required },
18230 },
18231 },
18232 .{
18233 .name = "DebugScope",
18234 .opcode = 23,
18235 .operands = &.{
18236 .{ .kind = .id_ref, .quantifier = .required },
18237 .{ .kind = .id_ref, .quantifier = .optional },
18238 },
18239 },
18240 .{
18241 .name = "DebugNoScope",
18242 .opcode = 24,
18243 .operands = &.{},
18244 },
18245 .{
18246 .name = "DebugInlinedAt",
18247 .opcode = 25,
18248 .operands = &.{
18249 .{ .kind = .id_ref, .quantifier = .required },
18250 .{ .kind = .id_ref, .quantifier = .required },
18251 .{ .kind = .id_ref, .quantifier = .optional },
18252 },
18253 },
18254 .{
18255 .name = "DebugLocalVariable",
18256 .opcode = 26,
18257 .operands = &.{
18258 .{ .kind = .id_ref, .quantifier = .required },
18259 .{ .kind = .id_ref, .quantifier = .required },
18260 .{ .kind = .id_ref, .quantifier = .required },
18261 .{ .kind = .id_ref, .quantifier = .required },
18262 .{ .kind = .id_ref, .quantifier = .required },
18263 .{ .kind = .id_ref, .quantifier = .required },
18264 .{ .kind = .id_ref, .quantifier = .required },
18265 .{ .kind = .id_ref, .quantifier = .optional },
18266 },
18267 },
18268 .{
18269 .name = "DebugInlinedVariable",
18270 .opcode = 27,
18271 .operands = &.{
18272 .{ .kind = .id_ref, .quantifier = .required },
18273 .{ .kind = .id_ref, .quantifier = .required },
18274 },
18275 },
18276 .{
18277 .name = "DebugDeclare",
18278 .opcode = 28,
18279 .operands = &.{
18280 .{ .kind = .id_ref, .quantifier = .required },
18281 .{ .kind = .id_ref, .quantifier = .required },
18282 .{ .kind = .id_ref, .quantifier = .required },
18283 .{ .kind = .id_ref, .quantifier = .variadic },
18284 },
18285 },
18286 .{
18287 .name = "DebugValue",
18288 .opcode = 29,
18289 .operands = &.{
18290 .{ .kind = .id_ref, .quantifier = .required },
18291 .{ .kind = .id_ref, .quantifier = .required },
18292 .{ .kind = .id_ref, .quantifier = .required },
18293 .{ .kind = .id_ref, .quantifier = .variadic },
18294 },
18295 },
18296 .{
18297 .name = "DebugOperation",
18298 .opcode = 30,
18299 .operands = &.{
18300 .{ .kind = .id_ref, .quantifier = .required },
18301 .{ .kind = .id_ref, .quantifier = .variadic },
18302 },
18303 },
18304 .{
18305 .name = "DebugExpression",
18306 .opcode = 31,
18307 .operands = &.{
18308 .{ .kind = .id_ref, .quantifier = .variadic },
18309 },
18310 },
18311 .{
18312 .name = "DebugMacroDef",
18313 .opcode = 32,
18314 .operands = &.{
18315 .{ .kind = .id_ref, .quantifier = .required },
18316 .{ .kind = .id_ref, .quantifier = .required },
18317 .{ .kind = .id_ref, .quantifier = .required },
18318 .{ .kind = .id_ref, .quantifier = .optional },
18319 },
18320 },
18321 .{
18322 .name = "DebugMacroUndef",
18323 .opcode = 33,
18324 .operands = &.{
18325 .{ .kind = .id_ref, .quantifier = .required },
18326 .{ .kind = .id_ref, .quantifier = .required },
18327 .{ .kind = .id_ref, .quantifier = .required },
18328 },
18329 },
18330 .{
18331 .name = "DebugImportedEntity",
18332 .opcode = 34,
18333 .operands = &.{
18334 .{ .kind = .id_ref, .quantifier = .required },
18335 .{ .kind = .id_ref, .quantifier = .required },
18336 .{ .kind = .id_ref, .quantifier = .required },
18337 .{ .kind = .id_ref, .quantifier = .required },
18338 .{ .kind = .id_ref, .quantifier = .required },
18339 .{ .kind = .id_ref, .quantifier = .required },
18340 .{ .kind = .id_ref, .quantifier = .required },
18341 },
18342 },
18343 .{
18344 .name = "DebugSource",
18345 .opcode = 35,
18346 .operands = &.{
18347 .{ .kind = .id_ref, .quantifier = .required },
18348 .{ .kind = .id_ref, .quantifier = .optional },
18349 },
18350 },
18351 .{
18352 .name = "DebugFunctionDefinition",
18353 .opcode = 101,
18354 .operands = &.{
18355 .{ .kind = .id_ref, .quantifier = .required },
18356 .{ .kind = .id_ref, .quantifier = .required },
18357 },
18358 },
18359 .{
18360 .name = "DebugSourceContinued",
18361 .opcode = 102,
18362 .operands = &.{
18363 .{ .kind = .id_ref, .quantifier = .required },
18364 },
18365 },
18366 .{
18367 .name = "DebugLine",
18368 .opcode = 103,
18369 .operands = &.{
18370 .{ .kind = .id_ref, .quantifier = .required },
18371 .{ .kind = .id_ref, .quantifier = .required },
18372 .{ .kind = .id_ref, .quantifier = .required },
18373 .{ .kind = .id_ref, .quantifier = .required },
18374 .{ .kind = .id_ref, .quantifier = .required },
18375 },
18376 },
18377 .{
18378 .name = "DebugNoLine",
18379 .opcode = 104,
18380 .operands = &.{},
18381 },
18382 .{
18383 .name = "DebugBuildIdentifier",
18384 .opcode = 105,
18385 .operands = &.{
18386 .{ .kind = .id_ref, .quantifier = .required },
18387 .{ .kind = .id_ref, .quantifier = .required },
18388 },
18389 },
18390 .{
18391 .name = "DebugStoragePath",
18392 .opcode = 106,
18393 .operands = &.{
18394 .{ .kind = .id_ref, .quantifier = .required },
18395 },
18396 },
18397 .{
18398 .name = "DebugEntryPoint",
18399 .opcode = 107,
18400 .operands = &.{
18401 .{ .kind = .id_ref, .quantifier = .required },
18402 .{ .kind = .id_ref, .quantifier = .required },
18403 .{ .kind = .id_ref, .quantifier = .required },
18404 .{ .kind = .id_ref, .quantifier = .required },
18405 },
18406 },
18407 .{
18408 .name = "DebugTypeMatrix",
18409 .opcode = 108,
18410 .operands = &.{
18411 .{ .kind = .id_ref, .quantifier = .required },
18412 .{ .kind = .id_ref, .quantifier = .required },
18413 .{ .kind = .id_ref, .quantifier = .required },
18414 },
18415 },
18416 },
18417 .zig => &.{
18418 .{
18419 .name = "InvocationGlobal",
18420 .opcode = 0,
18421 .operands = &.{
18422 .{ .kind = .id_ref, .quantifier = .required },
18423 },
18424 },
18425 },
18426 };
18427 }
18428};
src/codegen.zig+1-1
...@@ -57,7 +57,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {...@@ -57,7 +57,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
57 .stage2_powerpc => unreachable,57 .stage2_powerpc => unreachable,
58 .stage2_riscv64 => @import("arch/riscv64/CodeGen.zig"),58 .stage2_riscv64 => @import("arch/riscv64/CodeGen.zig"),
59 .stage2_sparc64 => @import("arch/sparc64/CodeGen.zig"),59 .stage2_sparc64 => @import("arch/sparc64/CodeGen.zig"),
60 .stage2_spirv => @import("arch/spirv/CodeGen.zig"),60 .stage2_spirv => @import("codegen/spirv/CodeGen.zig"),
61 .stage2_wasm => @import("arch/wasm/CodeGen.zig"),61 .stage2_wasm => @import("arch/wasm/CodeGen.zig"),
62 .stage2_x86, .stage2_x86_64 => @import("arch/x86_64/CodeGen.zig"),62 .stage2_x86, .stage2_x86_64 => @import("arch/x86_64/CodeGen.zig"),
63 _ => unreachable,63 _ => unreachable,
src/codegen/spirv/Assembler.zig created+1087
...@@ -0,0 +1,1087 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const assert = std.debug.assert;
4
5const CodeGen = @import("CodeGen.zig");
6const Decl = @import("Module.zig").Decl;
7
8const spec = @import("spec.zig");
9const Opcode = spec.Opcode;
10const Word = spec.Word;
11const Id = spec.Id;
12const StorageClass = spec.StorageClass;
13
14const Assembler = @This();
15
16cg: *CodeGen,
17errors: std.ArrayListUnmanaged(ErrorMsg) = .empty,
18src: []const u8 = undefined,
19/// `self.src` tokenized.
20tokens: std.ArrayListUnmanaged(Token) = .empty,
21current_token: u32 = 0,
22/// The instruction that is currently being parsed or has just been parsed.
23inst: struct {
24 opcode: Opcode = undefined,
25 operands: std.ArrayListUnmanaged(Operand) = .empty,
26 string_bytes: std.ArrayListUnmanaged(u8) = .empty,
27
28 fn result(self: @This()) ?AsmValue.Ref {
29 for (self.operands.items[0..@min(self.operands.items.len, 2)]) |op| {
30 switch (op) {
31 .result_id => |index| return index,
32 else => {},
33 }
34 }
35 return null;
36 }
37} = .{},
38value_map: std.StringArrayHashMapUnmanaged(AsmValue) = .{},
39inst_map: std.StringArrayHashMapUnmanaged(void) = .empty,
40
41const Operand = union(enum) {
42 /// Any 'simple' 32-bit value. This could be a mask or
43 /// enumerant, etc, depending on the operands.
44 value: u32,
45 /// An int- or float literal encoded as 1 word.
46 literal32: u32,
47 /// An int- or float literal encoded as 2 words.
48 literal64: u64,
49 /// A result-id which is assigned to in this instruction.
50 /// If present, this is the first operand of the instruction.
51 result_id: AsmValue.Ref,
52 /// A result-id which referred to (not assigned to) in this instruction.
53 ref_id: AsmValue.Ref,
54 /// Offset into `inst.string_bytes`. The string ends at the next zero-terminator.
55 string: u32,
56};
57
58pub fn deinit(self: *Assembler) void {
59 const gpa = self.cg.module.gpa;
60 for (self.errors.items) |err| gpa.free(err.msg);
61 self.tokens.deinit(gpa);
62 self.errors.deinit(gpa);
63 self.inst.operands.deinit(gpa);
64 self.inst.string_bytes.deinit(gpa);
65 self.value_map.deinit(gpa);
66 self.inst_map.deinit(gpa);
67}
68
69const Error = error{ AssembleFail, OutOfMemory };
70
71pub fn assemble(self: *Assembler, src: []const u8) Error!void {
72 const gpa = self.cg.module.gpa;
73
74 self.src = src;
75 self.errors.clearRetainingCapacity();
76
77 // Populate the opcode map if it isn't already
78 if (self.inst_map.count() == 0) {
79 const instructions = spec.InstructionSet.core.instructions();
80 try self.inst_map.ensureUnusedCapacity(gpa, @intCast(instructions.len));
81 for (spec.InstructionSet.core.instructions(), 0..) |inst, i| {
82 const entry = try self.inst_map.getOrPut(gpa, inst.name);
83 assert(entry.index == i);
84 }
85 }
86
87 try self.tokenize();
88 while (!self.testToken(.eof)) {
89 try self.parseInstruction();
90 try self.processInstruction();
91 }
92
93 if (self.errors.items.len > 0) return error.AssembleFail;
94}
95
96const ErrorMsg = struct {
97 /// The offset in bytes from the start of `src` that this error occured.
98 byte_offset: u32,
99 msg: []const u8,
100};
101
102fn addError(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) !void {
103 const gpa = self.cg.module.gpa;
104 const msg = try std.fmt.allocPrint(gpa, fmt, args);
105 errdefer gpa.free(msg);
106 try self.errors.append(gpa, .{
107 .byte_offset = offset,
108 .msg = msg,
109 });
110}
111
112fn fail(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) Error {
113 try self.addError(offset, fmt, args);
114 return error.AssembleFail;
115}
116
117fn todo(self: *Assembler, comptime fmt: []const u8, args: anytype) Error {
118 return self.fail(0, "todo: " ++ fmt, args);
119}
120
121const AsmValue = union(enum) {
122 /// The results are stored in an array hash map, and can be referred
123 /// to either by name (without the %), or by values of this index type.
124 pub const Ref = u32;
125
126 /// The RHS of the current instruction.
127 just_declared,
128 /// A placeholder for ref-ids of which the result-id is not yet known.
129 /// It will be further resolved at a later stage to a more concrete forward reference.
130 unresolved_forward_reference,
131 /// A normal result produced by a different instruction.
132 value: Id,
133 /// A type registered into the module's type system.
134 ty: Id,
135 /// A pre-supplied constant integer value.
136 constant: u32,
137 string: []const u8,
138
139 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue
140 /// is of a variant that allows the result to be obtained (not an unresolved
141 /// forward declaration, not in the process of being declared, etc).
142 pub fn resultId(self: AsmValue) Id {
143 return switch (self) {
144 .just_declared,
145 .unresolved_forward_reference,
146 // TODO: Lower this value as constant?
147 .constant,
148 .string,
149 => unreachable,
150 .value => |result| result,
151 .ty => |result| result,
152 };
153 }
154};
155
156/// Attempt to process the instruction currently in `self.inst`.
157/// This for example emits the instruction in the module or function, or
158/// records type definitions.
159/// If this function returns `error.AssembleFail`, an explanatory
160/// error message has already been emitted into `self.errors`.
161fn processInstruction(self: *Assembler) !void {
162 const module = self.cg.module;
163 const result: AsmValue = switch (self.inst.opcode) {
164 .OpEntryPoint => {
165 return self.fail(self.currentToken().start, "cannot export entry points in assembly", .{});
166 },
167 .OpExecutionMode, .OpExecutionModeId => {
168 return self.fail(self.currentToken().start, "cannot set execution mode in assembly", .{});
169 },
170 .OpCapability => {
171 try module.addCapability(@enumFromInt(self.inst.operands.items[0].value));
172 return;
173 },
174 .OpExtension => {
175 const ext_name_offset = self.inst.operands.items[0].string;
176 const ext_name = std.mem.sliceTo(self.inst.string_bytes.items[ext_name_offset..], 0);
177 try module.addExtension(ext_name);
178 return;
179 },
180 .OpExtInstImport => blk: {
181 const set_name_offset = self.inst.operands.items[1].string;
182 const set_name = std.mem.sliceTo(self.inst.string_bytes.items[set_name_offset..], 0);
183 const set_tag = std.meta.stringToEnum(spec.InstructionSet, set_name) orelse {
184 return self.fail(set_name_offset, "unknown instruction set: {s}", .{set_name});
185 };
186 break :blk .{ .value = try module.importInstructionSet(set_tag) };
187 },
188 else => switch (self.inst.opcode.class()) {
189 .type_declaration => try self.processTypeInstruction(),
190 else => (try self.processGenericInstruction()) orelse return,
191 },
192 };
193
194 const result_ref = self.inst.result().?;
195 switch (self.value_map.values()[result_ref]) {
196 .just_declared => self.value_map.values()[result_ref] = result,
197 else => {
198 // TODO: Improve source location.
199 const name = self.value_map.keys()[result_ref];
200 return self.fail(0, "duplicate definition of %{s}", .{name});
201 },
202 }
203}
204
205fn processTypeInstruction(self: *Assembler) !AsmValue {
206 const gpa = self.cg.module.gpa;
207 const module = self.cg.module;
208 const operands = self.inst.operands.items;
209 const section = &module.sections.globals;
210 const id = switch (self.inst.opcode) {
211 .OpTypeVoid => try module.voidType(),
212 .OpTypeBool => try module.boolType(),
213 .OpTypeInt => blk: {
214 const signedness: std.builtin.Signedness = switch (operands[2].literal32) {
215 0 => .unsigned,
216 1 => .signed,
217 else => {
218 // TODO: Improve source location.
219 return self.fail(0, "{} is not a valid signedness (expected 0 or 1)", .{operands[2].literal32});
220 },
221 };
222 const width = std.math.cast(u16, operands[1].literal32) orelse {
223 return self.fail(0, "int type of {} bits is too large", .{operands[1].literal32});
224 };
225 break :blk try module.intType(signedness, width);
226 },
227 .OpTypeFloat => blk: {
228 const bits = operands[1].literal32;
229 switch (bits) {
230 16, 32, 64 => {},
231 else => {
232 return self.fail(0, "{} is not a valid bit count for floats (expected 16, 32 or 64)", .{bits});
233 },
234 }
235 break :blk try module.floatType(@intCast(bits));
236 },
237 .OpTypeVector => blk: {
238 const child_type = try self.resolveRefId(operands[1].ref_id);
239 break :blk try module.vectorType(operands[2].literal32, child_type);
240 },
241 .OpTypeArray => {
242 // TODO: The length of an OpTypeArray is determined by a constant (which may be a spec constant),
243 // and so some consideration must be taken when entering this in the type system.
244 return self.todo("process OpTypeArray", .{});
245 },
246 .OpTypeRuntimeArray => blk: {
247 const element_type = try self.resolveRefId(operands[1].ref_id);
248 const result_id = module.allocId();
249 try section.emit(module.gpa, .OpTypeRuntimeArray, .{
250 .id_result = result_id,
251 .element_type = element_type,
252 });
253 break :blk result_id;
254 },
255 .OpTypePointer => blk: {
256 const storage_class: StorageClass = @enumFromInt(operands[1].value);
257 const child_type = try self.resolveRefId(operands[2].ref_id);
258 const result_id = module.allocId();
259 try section.emit(module.gpa, .OpTypePointer, .{
260 .id_result = result_id,
261 .storage_class = storage_class,
262 .type = child_type,
263 });
264 break :blk result_id;
265 },
266 .OpTypeStruct => blk: {
267 const ids = try gpa.alloc(Id, operands[1..].len);
268 defer gpa.free(ids);
269 for (operands[1..], ids) |op, *id| id.* = try self.resolveRefId(op.ref_id);
270 break :blk try module.structType(ids, null, null, .none);
271 },
272 .OpTypeImage => blk: {
273 const sampled_type = try self.resolveRefId(operands[1].ref_id);
274 const result_id = module.allocId();
275 try section.emit(gpa, .OpTypeImage, .{
276 .id_result = result_id,
277 .sampled_type = sampled_type,
278 .dim = @enumFromInt(operands[2].value),
279 .depth = operands[3].literal32,
280 .arrayed = operands[4].literal32,
281 .ms = operands[5].literal32,
282 .sampled = operands[6].literal32,
283 .image_format = @enumFromInt(operands[7].value),
284 });
285 break :blk result_id;
286 },
287 .OpTypeSampler => blk: {
288 const result_id = module.allocId();
289 try section.emit(gpa, .OpTypeSampler, .{ .id_result = result_id });
290 break :blk result_id;
291 },
292 .OpTypeSampledImage => blk: {
293 const image_type = try self.resolveRefId(operands[1].ref_id);
294 const result_id = module.allocId();
295 try section.emit(gpa, .OpTypeSampledImage, .{ .id_result = result_id, .image_type = image_type });
296 break :blk result_id;
297 },
298 .OpTypeFunction => blk: {
299 const param_operands = operands[2..];
300 const return_type = try self.resolveRefId(operands[1].ref_id);
301
302 const param_types = try module.gpa.alloc(Id, param_operands.len);
303 defer module.gpa.free(param_types);
304 for (param_types, param_operands) |*param, operand| {
305 param.* = try self.resolveRefId(operand.ref_id);
306 }
307 const result_id = module.allocId();
308 try section.emit(module.gpa, .OpTypeFunction, .{
309 .id_result = result_id,
310 .return_type = return_type,
311 .id_ref_2 = param_types,
312 });
313 break :blk result_id;
314 },
315 else => return self.todo("process type instruction {s}", .{@tagName(self.inst.opcode)}),
316 };
317
318 return .{ .ty = id };
319}
320
321/// - No forward references are allowed in operands.
322/// - Target section is determined from instruction type.
323fn processGenericInstruction(self: *Assembler) !?AsmValue {
324 const module = self.cg.module;
325 const target = module.zcu.getTarget();
326 const operands = self.inst.operands.items;
327 var maybe_spv_decl_index: ?Decl.Index = null;
328 const section = switch (self.inst.opcode.class()) {
329 .constant_creation => &module.sections.globals,
330 .annotation => &module.sections.annotations,
331 .type_declaration => unreachable, // Handled elsewhere.
332 else => switch (self.inst.opcode) {
333 .OpEntryPoint => unreachable,
334 .OpExecutionMode, .OpExecutionModeId => &module.sections.execution_modes,
335 .OpVariable => section: {
336 const storage_class: spec.StorageClass = @enumFromInt(operands[2].value);
337 if (storage_class == .function) break :section &self.cg.prologue;
338 maybe_spv_decl_index = try module.allocDecl(.global);
339 if (!target.cpu.has(.spirv, .v1_4) and storage_class != .input and storage_class != .output) {
340 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
341 break :section &module.sections.globals;
342 }
343 try self.cg.decl_deps.put(module.gpa, maybe_spv_decl_index.?, {});
344 try module.declareDeclDeps(maybe_spv_decl_index.?, &.{});
345 break :section &module.sections.globals;
346 },
347 else => &self.cg.body,
348 },
349 };
350
351 var maybe_result_id: ?Id = null;
352 const first_word = section.instructions.items.len;
353 // At this point we're not quite sure how many operands this instruction is
354 // going to have, so insert 0 and patch up the actual opcode word later.
355 try section.ensureUnusedCapacity(module.gpa, 1);
356 section.writeWord(0);
357
358 for (operands) |operand| {
359 switch (operand) {
360 .value, .literal32 => |word| {
361 try section.ensureUnusedCapacity(module.gpa, 1);
362 section.writeWord(word);
363 },
364 .literal64 => |dword| {
365 try section.ensureUnusedCapacity(module.gpa, 2);
366 section.writeDoubleWord(dword);
367 },
368 .result_id => {
369 maybe_result_id = if (maybe_spv_decl_index) |spv_decl_index|
370 module.declPtr(spv_decl_index).result_id
371 else
372 module.allocId();
373 try section.ensureUnusedCapacity(module.gpa, 1);
374 section.writeOperand(Id, maybe_result_id.?);
375 },
376 .ref_id => |index| {
377 const result = try self.resolveRef(index);
378 try section.ensureUnusedCapacity(module.gpa, 1);
379 section.writeOperand(spec.Id, result.resultId());
380 },
381 .string => |offset| {
382 const text = std.mem.sliceTo(self.inst.string_bytes.items[offset..], 0);
383 const size = std.math.divCeil(usize, text.len + 1, @sizeOf(Word)) catch unreachable;
384 try section.ensureUnusedCapacity(module.gpa, size);
385 section.writeOperand(spec.LiteralString, text);
386 },
387 }
388 }
389
390 const actual_word_count = section.instructions.items.len - first_word;
391 section.instructions.items[first_word] |= @as(u32, @as(u16, @intCast(actual_word_count))) << 16 | @intFromEnum(self.inst.opcode);
392
393 if (maybe_result_id) |result| return .{ .value = result };
394 return null;
395}
396
397fn resolveMaybeForwardRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
398 const value = self.value_map.values()[ref];
399 switch (value) {
400 .just_declared => {
401 const name = self.value_map.keys()[ref];
402 // TODO: Improve source location.
403 return self.fail(0, "self-referential parameter %{s}", .{name});
404 },
405 else => return value,
406 }
407}
408
409fn resolveRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
410 const value = try self.resolveMaybeForwardRef(ref);
411 switch (value) {
412 .just_declared => unreachable,
413 .unresolved_forward_reference => {
414 const name = self.value_map.keys()[ref];
415 // TODO: Improve source location.
416 return self.fail(0, "reference to undeclared result-id %{s}", .{name});
417 },
418 else => return value,
419 }
420}
421
422fn resolveRefId(self: *Assembler, ref: AsmValue.Ref) !Id {
423 const value = try self.resolveRef(ref);
424 return value.resultId();
425}
426
427fn parseInstruction(self: *Assembler) !void {
428 const gpa = self.cg.module.gpa;
429
430 self.inst.opcode = undefined;
431 self.inst.operands.clearRetainingCapacity();
432 self.inst.string_bytes.clearRetainingCapacity();
433
434 const lhs_result_tok = self.currentToken();
435 const maybe_lhs_result: ?AsmValue.Ref = if (self.eatToken(.result_id_assign)) blk: {
436 const name = self.tokenText(lhs_result_tok)[1..];
437 const entry = try self.value_map.getOrPut(gpa, name);
438 try self.expectToken(.equals);
439 if (!entry.found_existing) {
440 entry.value_ptr.* = .just_declared;
441 }
442 break :blk @intCast(entry.index);
443 } else null;
444
445 const opcode_tok = self.currentToken();
446 if (maybe_lhs_result != null) {
447 try self.expectToken(.opcode);
448 } else if (!self.eatToken(.opcode)) {
449 return self.fail(opcode_tok.start, "expected start of instruction, found {s}", .{opcode_tok.tag.name()});
450 }
451
452 const opcode_text = self.tokenText(opcode_tok);
453 const index = self.inst_map.getIndex(opcode_text) orelse {
454 return self.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
455 };
456
457 const inst = spec.InstructionSet.core.instructions()[index];
458 self.inst.opcode = @enumFromInt(inst.opcode);
459
460 const expected_operands = inst.operands;
461 // This is a loop because the result-id is not always the first operand.
462 const requires_lhs_result = for (expected_operands) |op| {
463 if (op.kind == .id_result) break true;
464 } else false;
465
466 if (requires_lhs_result and maybe_lhs_result == null) {
467 return self.fail(opcode_tok.start, "opcode '{s}' expects result on left-hand side", .{@tagName(self.inst.opcode)});
468 } else if (!requires_lhs_result and maybe_lhs_result != null) {
469 return self.fail(
470 lhs_result_tok.start,
471 "opcode '{s}' does not expect a result-id on the left-hand side",
472 .{@tagName(self.inst.opcode)},
473 );
474 }
475
476 for (expected_operands) |operand| {
477 if (operand.kind == .id_result) {
478 try self.inst.operands.append(gpa, .{ .result_id = maybe_lhs_result.? });
479 continue;
480 }
481
482 switch (operand.quantifier) {
483 .required => if (self.isAtInstructionBoundary()) {
484 return self.fail(
485 self.currentToken().start,
486 "missing required operand", // TODO: Operand name?
487 .{},
488 );
489 } else {
490 try self.parseOperand(operand.kind);
491 },
492 .optional => if (!self.isAtInstructionBoundary()) {
493 try self.parseOperand(operand.kind);
494 },
495 .variadic => while (!self.isAtInstructionBoundary()) {
496 try self.parseOperand(operand.kind);
497 },
498 }
499 }
500}
501
502fn parseOperand(self: *Assembler, kind: spec.OperandKind) Error!void {
503 switch (kind.category()) {
504 .bit_enum => try self.parseBitEnum(kind),
505 .value_enum => try self.parseValueEnum(kind),
506 .id => try self.parseRefId(),
507 else => switch (kind) {
508 .literal_integer => try self.parseLiteralInteger(),
509 .literal_string => try self.parseString(),
510 .literal_context_dependent_number => try self.parseContextDependentNumber(),
511 .literal_ext_inst_integer => try self.parseLiteralExtInstInteger(),
512 .pair_id_ref_id_ref => try self.parsePhiSource(),
513 else => return self.todo("parse operand of type {s}", .{@tagName(kind)}),
514 },
515 }
516}
517
518/// Also handles parsing any required extra operands.
519fn parseBitEnum(self: *Assembler, kind: spec.OperandKind) !void {
520 const gpa = self.cg.module.gpa;
521
522 var tok = self.currentToken();
523 try self.expectToken(.value);
524
525 var text = self.tokenText(tok);
526 if (std.mem.eql(u8, text, "None")) {
527 try self.inst.operands.append(gpa, .{ .value = 0 });
528 return;
529 }
530
531 const enumerants = kind.enumerants();
532 var mask: u32 = 0;
533 while (true) {
534 const enumerant = for (enumerants) |enumerant| {
535 if (std.mem.eql(u8, enumerant.name, text))
536 break enumerant;
537 } else {
538 return self.fail(tok.start, "'{s}' is not a valid flag for bitmask {s}", .{ text, @tagName(kind) });
539 };
540 mask |= enumerant.value;
541 if (!self.eatToken(.pipe))
542 break;
543
544 tok = self.currentToken();
545 try self.expectToken(.value);
546 text = self.tokenText(tok);
547 }
548
549 try self.inst.operands.append(gpa, .{ .value = mask });
550
551 // Assume values are sorted.
552 // TODO: ensure in generator.
553 for (enumerants) |enumerant| {
554 if ((mask & enumerant.value) == 0)
555 continue;
556
557 for (enumerant.parameters) |param_kind| {
558 if (self.isAtInstructionBoundary()) {
559 return self.fail(self.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
560 }
561
562 try self.parseOperand(param_kind);
563 }
564 }
565}
566
567/// Also handles parsing any required extra operands.
568fn parseValueEnum(self: *Assembler, kind: spec.OperandKind) !void {
569 const gpa = self.cg.module.gpa;
570
571 const tok = self.currentToken();
572 if (self.eatToken(.placeholder)) {
573 const name = self.tokenText(tok)[1..];
574 const value = self.value_map.get(name) orelse {
575 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
576 };
577 switch (value) {
578 .constant => |literal32| {
579 try self.inst.operands.append(gpa, .{ .value = literal32 });
580 },
581 .string => |str| {
582 const enumerant = for (kind.enumerants()) |enumerant| {
583 if (std.mem.eql(u8, enumerant.name, str)) break enumerant;
584 } else {
585 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ str, @tagName(kind) });
586 };
587 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
588 },
589 else => return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name}),
590 }
591 return;
592 }
593
594 try self.expectToken(.value);
595
596 const text = self.tokenText(tok);
597 const int_value = std.fmt.parseInt(u32, text, 0) catch null;
598 const enumerant = for (kind.enumerants()) |enumerant| {
599 if (int_value) |v| {
600 if (v == enumerant.value) break enumerant;
601 } else {
602 if (std.mem.eql(u8, enumerant.name, text)) break enumerant;
603 }
604 } else {
605 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ text, @tagName(kind) });
606 };
607
608 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
609
610 for (enumerant.parameters) |param_kind| {
611 if (self.isAtInstructionBoundary()) {
612 return self.fail(self.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
613 }
614
615 try self.parseOperand(param_kind);
616 }
617}
618
619fn parseRefId(self: *Assembler) !void {
620 const gpa = self.cg.module.gpa;
621
622 const tok = self.currentToken();
623 try self.expectToken(.result_id);
624
625 const name = self.tokenText(tok)[1..];
626 const entry = try self.value_map.getOrPut(gpa, name);
627 if (!entry.found_existing) {
628 entry.value_ptr.* = .unresolved_forward_reference;
629 }
630
631 const index: AsmValue.Ref = @intCast(entry.index);
632 try self.inst.operands.append(gpa, .{ .ref_id = index });
633}
634
635fn parseLiteralInteger(self: *Assembler) !void {
636 const gpa = self.cg.module.gpa;
637
638 const tok = self.currentToken();
639 if (self.eatToken(.placeholder)) {
640 const name = self.tokenText(tok)[1..];
641 const value = self.value_map.get(name) orelse {
642 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
643 };
644 switch (value) {
645 .constant => |literal32| {
646 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
647 },
648 else => {
649 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
650 },
651 }
652 return;
653 }
654
655 try self.expectToken(.value);
656 // According to the SPIR-V machine readable grammar, a LiteralInteger
657 // may consist of one or more words. From the SPIR-V docs it seems like there
658 // only one instruction where multiple words are allowed, the literals that make up the
659 // switch cases of OpSwitch. This case is handled separately, and so we just assume
660 // everything is a 32-bit integer in this function.
661 const text = self.tokenText(tok);
662 const value = std.fmt.parseInt(u32, text, 0) catch {
663 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
664 };
665 try self.inst.operands.append(gpa, .{ .literal32 = value });
666}
667
668fn parseLiteralExtInstInteger(self: *Assembler) !void {
669 const gpa = self.cg.module.gpa;
670
671 const tok = self.currentToken();
672 if (self.eatToken(.placeholder)) {
673 const name = self.tokenText(tok)[1..];
674 const value = self.value_map.get(name) orelse {
675 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
676 };
677 switch (value) {
678 .constant => |literal32| {
679 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
680 },
681 else => {
682 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
683 },
684 }
685 return;
686 }
687
688 try self.expectToken(.value);
689 const text = self.tokenText(tok);
690 const value = std.fmt.parseInt(u32, text, 0) catch {
691 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
692 };
693 try self.inst.operands.append(gpa, .{ .literal32 = value });
694}
695
696fn parseString(self: *Assembler) !void {
697 const gpa = self.cg.module.gpa;
698
699 const tok = self.currentToken();
700 try self.expectToken(.string);
701 // Note, the string might not have a closing quote. In this case,
702 // an error is already emitted but we are trying to continue processing
703 // anyway, so in this function we have to deal with that situation.
704 const text = self.tokenText(tok);
705 assert(text.len > 0 and text[0] == '"');
706 const literal = if (text.len != 1 and text[text.len - 1] == '"')
707 text[1 .. text.len - 1]
708 else
709 text[1..];
710
711 const string_offset: u32 = @intCast(self.inst.string_bytes.items.len);
712 try self.inst.string_bytes.ensureUnusedCapacity(gpa, literal.len + 1);
713 self.inst.string_bytes.appendSliceAssumeCapacity(literal);
714 self.inst.string_bytes.appendAssumeCapacity(0);
715
716 try self.inst.operands.append(gpa, .{ .string = string_offset });
717}
718
719fn parseContextDependentNumber(self: *Assembler) !void {
720 const module = self.cg.module;
721
722 // For context dependent numbers, the actual type to parse is determined by the instruction.
723 // Currently, this operand appears in OpConstant and OpSpecConstant, where the too-be-parsed type
724 // is determined by the result type. That means that in this instructions we have to resolve the
725 // operand type early and look at the result to see how we need to proceed.
726 assert(self.inst.opcode == .OpConstant or self.inst.opcode == .OpSpecConstant);
727
728 const tok = self.currentToken();
729 const result = try self.resolveRef(self.inst.operands.items[0].ref_id);
730 const result_id = result.resultId();
731 // We are going to cheat a little bit: The types we are interested in, int and float,
732 // are added to the module and cached via module.intType and module.floatType. Therefore,
733 // we can determine the width of these types by directly checking the cache.
734 // This only works if the Assembler and codegen both use spv.intType and spv.floatType though.
735 // We don't expect there to be many of these types, so just look it up every time.
736 // TODO: Count be improved to be a little bit more efficent.
737
738 {
739 var it = module.cache.int_types.iterator();
740 while (it.next()) |entry| {
741 const id = entry.value_ptr.*;
742 if (id != result_id) continue;
743 const info = entry.key_ptr.*;
744 return try self.parseContextDependentInt(info.signedness, info.bits);
745 }
746 }
747
748 {
749 var it = module.cache.float_types.iterator();
750 while (it.next()) |entry| {
751 const id = entry.value_ptr.*;
752 if (id != result_id) continue;
753 const info = entry.key_ptr.*;
754 switch (info.bits) {
755 16 => try self.parseContextDependentFloat(16),
756 32 => try self.parseContextDependentFloat(32),
757 64 => try self.parseContextDependentFloat(64),
758 else => return self.fail(tok.start, "cannot parse {}-bit info literal", .{info.bits}),
759 }
760 }
761 }
762
763 return self.fail(tok.start, "cannot parse literal constant", .{});
764}
765
766fn parseContextDependentInt(self: *Assembler, signedness: std.builtin.Signedness, width: u32) !void {
767 const gpa = self.cg.module.gpa;
768
769 const tok = self.currentToken();
770 if (self.eatToken(.placeholder)) {
771 const name = self.tokenText(tok)[1..];
772 const value = self.value_map.get(name) orelse {
773 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
774 };
775 switch (value) {
776 .constant => |literal32| {
777 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
778 },
779 else => {
780 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
781 },
782 }
783 return;
784 }
785
786 try self.expectToken(.value);
787
788 if (width == 0 or width > 2 * @bitSizeOf(spec.Word)) {
789 return self.fail(tok.start, "cannot parse {}-bit integer literal", .{width});
790 }
791
792 const text = self.tokenText(tok);
793 invalid: {
794 // Just parse the integer as the next larger integer type, and check if it overflows afterwards.
795 const int = std.fmt.parseInt(i128, text, 0) catch break :invalid;
796 const min = switch (signedness) {
797 .unsigned => 0,
798 .signed => -(@as(i128, 1) << (@as(u7, @intCast(width)) - 1)),
799 };
800 const max = (@as(i128, 1) << (@as(u7, @intCast(width)) - @intFromBool(signedness == .signed))) - 1;
801 if (int < min or int > max) {
802 break :invalid;
803 }
804
805 // Note, we store the sign-extended version here.
806 if (width <= @bitSizeOf(spec.Word)) {
807 try self.inst.operands.append(gpa, .{ .literal32 = @truncate(@as(u128, @bitCast(int))) });
808 } else {
809 try self.inst.operands.append(gpa, .{ .literal64 = @truncate(@as(u128, @bitCast(int))) });
810 }
811 return;
812 }
813
814 return self.fail(tok.start, "'{s}' is not a valid {s} {}-bit int literal", .{ text, @tagName(signedness), width });
815}
816
817fn parseContextDependentFloat(self: *Assembler, comptime width: u16) !void {
818 const gpa = self.cg.module.gpa;
819
820 const Float = std.meta.Float(width);
821 const Int = std.meta.Int(.unsigned, width);
822
823 const tok = self.currentToken();
824 try self.expectToken(.value);
825
826 const text = self.tokenText(tok);
827
828 const value = std.fmt.parseFloat(Float, text) catch {
829 return self.fail(tok.start, "'{s}' is not a valid {}-bit float literal", .{ text, width });
830 };
831
832 const float_bits: Int = @bitCast(value);
833 if (width <= @bitSizeOf(spec.Word)) {
834 try self.inst.operands.append(gpa, .{ .literal32 = float_bits });
835 } else {
836 assert(width <= 2 * @bitSizeOf(spec.Word));
837 try self.inst.operands.append(gpa, .{ .literal64 = float_bits });
838 }
839}
840
841fn parsePhiSource(self: *Assembler) !void {
842 try self.parseRefId();
843 if (self.isAtInstructionBoundary()) {
844 return self.fail(self.currentToken().start, "missing phi block parent", .{});
845 }
846 try self.parseRefId();
847}
848
849/// Returns whether the `current_token` cursor
850/// is currently pointing at the start of a new instruction.
851fn isAtInstructionBoundary(self: Assembler) bool {
852 return switch (self.currentToken().tag) {
853 .opcode, .result_id_assign, .eof => true,
854 else => false,
855 };
856}
857
858fn expectToken(self: *Assembler, tag: Token.Tag) !void {
859 if (self.eatToken(tag))
860 return;
861
862 return self.fail(self.currentToken().start, "unexpected {s}, expected {s}", .{
863 self.currentToken().tag.name(),
864 tag.name(),
865 });
866}
867
868fn eatToken(self: *Assembler, tag: Token.Tag) bool {
869 if (self.testToken(tag)) {
870 self.current_token += 1;
871 return true;
872 }
873 return false;
874}
875
876fn testToken(self: Assembler, tag: Token.Tag) bool {
877 return self.currentToken().tag == tag;
878}
879
880fn currentToken(self: Assembler) Token {
881 return self.tokens.items[self.current_token];
882}
883
884fn tokenText(self: Assembler, tok: Token) []const u8 {
885 return self.src[tok.start..tok.end];
886}
887
888/// Tokenize `self.src` and put the tokens in `self.tokens`.
889/// Any errors encountered are appended to `self.errors`.
890fn tokenize(self: *Assembler) !void {
891 const gpa = self.cg.module.gpa;
892
893 self.tokens.clearRetainingCapacity();
894
895 var offset: u32 = 0;
896 while (true) {
897 const tok = try self.nextToken(offset);
898 // Resolve result-id assignment now.
899 // NOTE: If the previous token wasn't a result-id, just ignore it,
900 // we will catch it while parsing.
901 if (tok.tag == .equals and self.tokens.items[self.tokens.items.len - 1].tag == .result_id) {
902 self.tokens.items[self.tokens.items.len - 1].tag = .result_id_assign;
903 }
904 try self.tokens.append(gpa, tok);
905 if (tok.tag == .eof)
906 break;
907 offset = tok.end;
908 }
909}
910
911const Token = struct {
912 tag: Tag,
913 start: u32,
914 end: u32,
915
916 const Tag = enum {
917 /// Returned when there was no more input to match.
918 eof,
919 /// %identifier
920 result_id,
921 /// %identifier when appearing on the LHS of an equals sign.
922 /// While not technically a token, its relatively easy to resolve
923 /// this during lexical analysis and relieves a bunch of headaches
924 /// during parsing.
925 result_id_assign,
926 /// Mask, int, or float. These are grouped together as some
927 /// SPIR-V enumerants look a bit like integers as well (for example
928 /// "3D"), and so it is easier to just interpret them as the expected
929 /// type when resolving an instruction's operands.
930 value,
931 /// An enumerant that looks like an opcode, that is, OpXxxx.
932 /// Not necessarily a *valid* opcode.
933 opcode,
934 /// String literals.
935 /// Note, this token is also returned for unterminated
936 /// strings. In this case the closing " is not present.
937 string,
938 /// |.
939 pipe,
940 /// =.
941 equals,
942 /// $identifier. This is used (for now) for constant values, like integers.
943 /// These can be used in place of a normal `value`.
944 placeholder,
945
946 fn name(self: Tag) []const u8 {
947 return switch (self) {
948 .eof => "<end of input>",
949 .result_id => "<result-id>",
950 .result_id_assign => "<assigned result-id>",
951 .value => "<value>",
952 .opcode => "<opcode>",
953 .string => "<string literal>",
954 .pipe => "'|'",
955 .equals => "'='",
956 .placeholder => "<placeholder>",
957 };
958 }
959 };
960};
961
962/// Retrieve the next token from the input. This function will assert
963/// that the token is surrounded by whitespace if required, but will not
964/// interpret the token yet.
965/// NOTE: This function doesn't handle .result_id_assign - this is handled in tokenize().
966fn nextToken(self: *Assembler, start_offset: u32) !Token {
967 // We generally separate the input into the following types:
968 // - Whitespace. Generally ignored, but also used as delimiter for some
969 // tokens.
970 // - Values. This entails integers, floats, enums - anything that
971 // consists of alphanumeric characters, delimited by whitespace.
972 // - Result-IDs. This entails anything that consists of alphanumeric characters and _, and
973 // starts with a %. In contrast to values, this entity can be checked for complete correctness
974 // relatively easily here.
975 // - Strings. This entails quote-delimited text such as "abc".
976 // SPIR-V strings have only two escapes, \" and \\.
977 // - Sigils, = and |. In this assembler, these are not required to have whitespace
978 // around them (they act as delimiters) as they do in SPIRV-Tools.
979
980 var state: enum {
981 start,
982 value,
983 result_id,
984 string,
985 string_end,
986 escape,
987 placeholder,
988 } = .start;
989 var token_start = start_offset;
990 var offset = start_offset;
991 var tag = Token.Tag.eof;
992 while (offset < self.src.len) : (offset += 1) {
993 const c = self.src[offset];
994 switch (state) {
995 .start => switch (c) {
996 ' ', '\t', '\r', '\n' => token_start = offset + 1,
997 '"' => {
998 state = .string;
999 tag = .string;
1000 },
1001 '%' => {
1002 state = .result_id;
1003 tag = .result_id;
1004 },
1005 '|' => {
1006 tag = .pipe;
1007 offset += 1;
1008 break;
1009 },
1010 '=' => {
1011 tag = .equals;
1012 offset += 1;
1013 break;
1014 },
1015 '$' => {
1016 state = .placeholder;
1017 tag = .placeholder;
1018 },
1019 else => {
1020 state = .value;
1021 tag = .value;
1022 },
1023 },
1024 .value => switch (c) {
1025 '"' => {
1026 try self.addError(offset, "unexpected string literal", .{});
1027 // The user most likely just forgot a delimiter here - keep
1028 // the tag as value.
1029 break;
1030 },
1031 ' ', '\t', '\r', '\n', '=', '|' => break,
1032 else => {},
1033 },
1034 .result_id, .placeholder => switch (c) {
1035 '_', 'a'...'z', 'A'...'Z', '0'...'9' => {},
1036 ' ', '\t', '\r', '\n', '=', '|' => break,
1037 else => {
1038 try self.addError(offset, "illegal character in result-id or placeholder", .{});
1039 // Again, probably a forgotten delimiter here.
1040 break;
1041 },
1042 },
1043 .string => switch (c) {
1044 '\\' => state = .escape,
1045 '"' => state = .string_end,
1046 else => {}, // Note, strings may include newlines
1047 },
1048 .string_end => switch (c) {
1049 ' ', '\t', '\r', '\n', '=', '|' => break,
1050 else => {
1051 try self.addError(offset, "unexpected character after string literal", .{});
1052 // The token is still unmistakibly a string.
1053 break;
1054 },
1055 },
1056 // Escapes simply skip the next char.
1057 .escape => state = .string,
1058 }
1059 }
1060
1061 var tok: Token = .{
1062 .tag = tag,
1063 .start = token_start,
1064 .end = offset,
1065 };
1066
1067 switch (state) {
1068 .string, .escape => {
1069 try self.addError(token_start, "unterminated string", .{});
1070 },
1071 .result_id => if (offset - token_start == 1) {
1072 try self.addError(token_start, "result-id must have at least one name character", .{});
1073 },
1074 .value => {
1075 const text = self.tokenText(tok);
1076 const prefix = "Op";
1077 const looks_like_opcode = text.len > prefix.len and
1078 std.mem.startsWith(u8, text, prefix) and
1079 std.ascii.isUpper(text[prefix.len]);
1080 if (looks_like_opcode)
1081 tok.tag = .opcode;
1082 },
1083 else => {},
1084 }
1085
1086 return tok;
1087}
src/codegen/spirv/CodeGen.zig created+6168
...@@ -0,0 +1,6168 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Target = std.Target;
4const Signedness = std.builtin.Signedness;
5const assert = std.debug.assert;
6const log = std.log.scoped(.codegen);
7
8const Zcu = @import("../../Zcu.zig");
9const Type = @import("../../Type.zig");
10const Value = @import("../../Value.zig");
11const Air = @import("../../Air.zig");
12const InternPool = @import("../../InternPool.zig");
13const Section = @import("Section.zig");
14const Assembler = @import("Assembler.zig");
15
16const spec = @import("spec.zig");
17const Opcode = spec.Opcode;
18const Word = spec.Word;
19const Id = spec.Id;
20const IdRange = spec.IdRange;
21const StorageClass = spec.StorageClass;
22
23const Module = @import("Module.zig");
24const Decl = Module.Decl;
25const Repr = Module.Repr;
26const InternMap = Module.InternMap;
27const PtrTypeMap = Module.PtrTypeMap;
28
29const CodeGen = @This();
30
31pub fn legalizeFeatures(_: *const std.Target) *const Air.Legalize.Features {
32 return comptime &.initMany(&.{
33 .expand_intcast_safe,
34 .expand_int_from_float_safe,
35 .expand_int_from_float_optimized_safe,
36 .expand_add_safe,
37 .expand_sub_safe,
38 .expand_mul_safe,
39 });
40}
41
42pub const zig_call_abi_ver = 3;
43
44const ControlFlow = union(enum) {
45 const Structured = struct {
46 /// This type indicates the way that a block is terminated. The
47 /// state of a particular block is used to track how a jump from
48 /// inside the block must reach the outside.
49 const Block = union(enum) {
50 const Incoming = struct {
51 src_label: Id,
52 /// Instruction that returns an u32 value of the
53 /// `Air.Inst.Index` that control flow should jump to.
54 next_block: Id,
55 };
56
57 const SelectionMerge = struct {
58 /// Incoming block from the `then` label.
59 /// Note that hte incoming block from the `else` label is
60 /// either given by the next element in the stack.
61 incoming: Incoming,
62 /// The label id of the cond_br's merge block.
63 /// For the top-most element in the stack, this
64 /// value is undefined.
65 merge_block: Id,
66 };
67
68 /// For a `selection` type block, we cannot use early exits, and we
69 /// must generate a 'merge ladder' of OpSelection instructions. To that end,
70 /// we keep a stack of the merges that still must be closed at the end of
71 /// a block.
72 ///
73 /// This entire structure basically just resembles a tree like
74 /// a x
75 /// \ /
76 /// b o merge
77 /// \ /
78 /// c o merge
79 /// \ /
80 /// o merge
81 /// /
82 /// o jump to next block
83 selection: struct {
84 /// In order to know which merges we still need to do, we need to keep
85 /// a stack of those.
86 merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty,
87 },
88 /// For a `loop` type block, we can early-exit the block by
89 /// jumping to the loop exit node, and we don't need to generate
90 /// an entire stack of merges.
91 loop: struct {
92 /// The next block to jump to can be determined from any number
93 /// of conditions that jump to the loop exit.
94 merges: std.ArrayListUnmanaged(Incoming) = .empty,
95 /// The label id of the loop's merge block.
96 merge_block: Id,
97 },
98
99 fn deinit(block: *Structured.Block, gpa: Allocator) void {
100 switch (block.*) {
101 .selection => |*merge| merge.merge_stack.deinit(gpa),
102 .loop => |*merge| merge.merges.deinit(gpa),
103 }
104 block.* = undefined;
105 }
106 };
107 /// This determines how exits from the current block must be handled.
108 block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty,
109 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
110 };
111
112 const Unstructured = struct {
113 const Incoming = struct {
114 src_label: Id,
115 break_value_id: Id,
116 };
117
118 const Block = struct {
119 label: ?Id = null,
120 incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty,
121 };
122
123 /// We need to keep track of result ids for block labels, as well as the 'incoming'
124 /// blocks for a block.
125 blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, *Block) = .empty,
126 };
127
128 structured: Structured,
129 unstructured: Unstructured,
130
131 pub fn deinit(cg: *ControlFlow, gpa: Allocator) void {
132 switch (cg.*) {
133 .structured => |*cf| {
134 cf.block_stack.deinit(gpa);
135 cf.block_results.deinit(gpa);
136 },
137 .unstructured => |*cf| {
138 cf.blocks.deinit(gpa);
139 },
140 }
141 cg.* = undefined;
142 }
143};
144
145pt: Zcu.PerThread,
146air: Air,
147/// Note: If the declaration is not a function, this value will be undefined!
148liveness: Air.Liveness,
149owner_nav: InternPool.Nav.Index,
150module: *Module,
151control_flow: ControlFlow,
152base_line: u32,
153block_label: Id = .none,
154/// The base offset of the current decl, which is what `dbg_stmt` is relative to.
155/// An array of function argument result-ids. Each index corresponds with the
156/// function argument of the same index.
157args: std.ArrayListUnmanaged(Id) = .empty,
158/// A counter to keep track of how many `arg` instructions we've seen yet.
159next_arg_index: u32 = 0,
160/// A map keeping track of which instruction generated which result-id.
161inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
162file_path_id: Id = .none,
163prologue: Section = .{},
164body: Section = .{},
165decl_deps: std.AutoArrayHashMapUnmanaged(Decl.Index, void) = .empty,
166error_msg: ?*Zcu.ErrorMsg = null,
167
168/// Free resources owned by the CodeGen.
169pub fn deinit(cg: *CodeGen) void {
170 const gpa = cg.module.gpa;
171 cg.args.deinit(gpa);
172 cg.inst_results.deinit(gpa);
173 cg.control_flow.deinit(gpa);
174 cg.prologue.deinit(gpa);
175 cg.body.deinit(gpa);
176 cg.decl_deps.deinit(gpa);
177}
178
179const Error = error{ CodegenFail, OutOfMemory };
180
181pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void {
182 const gpa = cg.module.gpa;
183 const zcu = cg.module.zcu;
184 const ip = &zcu.intern_pool;
185 const target = zcu.getTarget();
186
187 const nav = ip.getNav(cg.owner_nav);
188 const val = zcu.navValue(cg.owner_nav);
189 const ty = val.typeOf(zcu);
190
191 if (!do_codegen and !ty.hasRuntimeBits(zcu)) return;
192
193 const spv_decl_index = try cg.module.resolveNav(ip, cg.owner_nav);
194 const result_id = cg.module.declPtr(spv_decl_index).result_id;
195
196 switch (cg.module.declPtr(spv_decl_index).kind) {
197 .func => {
198 const fn_info = zcu.typeToFunc(ty).?;
199 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
200 const is_test = zcu.test_functions.contains(cg.owner_nav);
201
202 const func_result_id = if (is_test) cg.module.allocId() else result_id;
203 const prototype_ty_id = try cg.resolveType(ty, .direct);
204 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
205 .id_result_type = return_ty_id,
206 .id_result = func_result_id,
207 .function_type = prototype_ty_id,
208 // Note: the backend will never be asked to generate an inline function
209 // (this is handled in sema), so we don't need to set function_control here.
210 .function_control = .{},
211 });
212
213 comptime assert(zig_call_abi_ver == 3);
214 try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len);
215 for (fn_info.param_types.get(ip)) |param_ty_index| {
216 const param_ty: Type = .fromInterned(param_ty_index);
217 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
218
219 const param_type_id = try cg.resolveType(param_ty, .direct);
220 const arg_result_id = cg.module.allocId();
221 try cg.prologue.emit(cg.module.gpa, .OpFunctionParameter, .{
222 .id_result_type = param_type_id,
223 .id_result = arg_result_id,
224 });
225 cg.args.appendAssumeCapacity(arg_result_id);
226 }
227
228 // TODO: This could probably be done in a better way...
229 const root_block_id = cg.module.allocId();
230
231 // The root block of a function declaration should appear before OpVariable instructions,
232 // so it is generated into the function's prologue.
233 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
234 .id_result = root_block_id,
235 });
236 cg.block_label = root_block_id;
237
238 const main_body = cg.air.getMainBody();
239 switch (cg.control_flow) {
240 .structured => {
241 _ = try cg.genStructuredBody(.selection, main_body);
242 // We always expect paths to here to end, but we still need the block
243 // to act as a dummy merge block.
244 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
245 },
246 .unstructured => {
247 try cg.genBody(main_body);
248 },
249 }
250 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
251 // Append the actual code into the functions section.
252 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
253 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
254
255 // Temporarily generate a test kernel declaration if this is a test function.
256 if (is_test) {
257 try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), spv_decl_index, func_result_id);
258 }
259
260 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
261 try cg.module.debugName(func_result_id, nav.fqn.toSlice(ip));
262 },
263 .global => {
264 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
265 .func => unreachable,
266 .variable => |variable| .fromInterned(variable.init),
267 .@"extern" => null,
268 else => val,
269 };
270 assert(maybe_init_val == null); // TODO
271
272 const storage_class = cg.module.storageClass(nav.getAddrspace());
273 assert(storage_class != .generic); // These should be instance globals
274
275 const ty_id = try cg.resolveType(ty, .indirect);
276 const ptr_ty_id = try cg.module.ptrType(ty_id, storage_class);
277
278 try cg.module.sections.globals.emit(cg.module.gpa, .OpVariable, .{
279 .id_result_type = ptr_ty_id,
280 .id_result = result_id,
281 .storage_class = storage_class,
282 });
283
284 switch (target.os.tag) {
285 .vulkan, .opengl => {
286 if (ty.zigTypeTag(zcu) == .@"struct") {
287 switch (storage_class) {
288 .uniform, .push_constant => try cg.module.decorate(ty_id, .block),
289 else => {},
290 }
291 }
292
293 switch (ip.indexToKey(ty.toIntern())) {
294 .func_type, .opaque_type => {},
295 else => {
296 try cg.module.decorate(ptr_ty_id, .{
297 .array_stride = .{ .array_stride = @intCast(ty.abiSize(zcu)) },
298 });
299 },
300 }
301 },
302 else => {},
303 }
304
305 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |builtin| {
306 try cg.module.decorate(result_id, .{ .built_in = .{ .built_in = builtin } });
307 }
308
309 try cg.module.debugName(result_id, nav.fqn.toSlice(ip));
310 try cg.module.declareDeclDeps(spv_decl_index, &.{});
311 },
312 .invocation_global => {
313 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
314 .func => unreachable,
315 .variable => |variable| .fromInterned(variable.init),
316 .@"extern" => null,
317 else => val,
318 };
319
320 try cg.module.declareDeclDeps(spv_decl_index, &.{});
321
322 const ty_id = try cg.resolveType(ty, .indirect);
323 const ptr_ty_id = try cg.module.ptrType(ty_id, .function);
324
325 if (maybe_init_val) |init_val| {
326 // TODO: Combine with resolveAnonDecl?
327 const void_ty_id = try cg.resolveType(.void, .direct);
328 const initializer_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
329
330 const initializer_id = cg.module.allocId();
331 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
332 .id_result_type = try cg.resolveType(.void, .direct),
333 .id_result = initializer_id,
334 .function_control = .{},
335 .function_type = initializer_proto_ty_id,
336 });
337
338 const root_block_id = cg.module.allocId();
339 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
340 .id_result = root_block_id,
341 });
342 cg.block_label = root_block_id;
343
344 const val_id = try cg.constant(ty, init_val, .indirect);
345 try cg.body.emit(cg.module.gpa, .OpStore, .{
346 .pointer = result_id,
347 .object = val_id,
348 });
349
350 try cg.body.emit(cg.module.gpa, .OpReturn, {});
351 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
352 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
353 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
354 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
355
356 try cg.module.debugNameFmt(initializer_id, "initializer of {f}", .{nav.fqn.fmt(ip)});
357
358 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
359 .id_result_type = ptr_ty_id,
360 .id_result = result_id,
361 .set = try cg.module.importInstructionSet(.zig),
362 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
363 .id_ref_4 = &.{initializer_id},
364 });
365 } else {
366 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
367 .id_result_type = ptr_ty_id,
368 .id_result = result_id,
369 .set = try cg.module.importInstructionSet(.zig),
370 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
371 .id_ref_4 = &.{},
372 });
373 }
374 },
375 }
376}
377
378pub fn fail(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
379 @branchHint(.cold);
380 const zcu = cg.module.zcu;
381 const src_loc = zcu.navSrcLoc(cg.owner_nav);
382 assert(cg.error_msg == null);
383 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, format, args);
384 return error.CodegenFail;
385}
386
387pub fn todo(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
388 return cg.fail("TODO (SPIR-V): " ++ format, args);
389}
390
391/// This imports the "default" extended instruction set for the target
392/// For OpenCL, OpenCL.std.100. For Vulkan and OpenGL, GLSL.std.450.
393fn importExtendedSet(cg: *CodeGen) !Id {
394 const target = cg.module.zcu.getTarget();
395 return switch (target.os.tag) {
396 .opencl, .amdhsa => try cg.module.importInstructionSet(.@"OpenCL.std"),
397 .vulkan, .opengl => try cg.module.importInstructionSet(.@"GLSL.std.450"),
398 else => unreachable,
399 };
400}
401
402/// Fetch the result-id for a previously generated instruction or constant.
403fn resolve(cg: *CodeGen, inst: Air.Inst.Ref) !Id {
404 const pt = cg.pt;
405 const zcu = cg.module.zcu;
406 const ip = &zcu.intern_pool;
407 if (try cg.air.value(inst, pt)) |val| {
408 const ty = cg.typeOf(inst);
409 if (ty.zigTypeTag(zcu) == .@"fn") {
410 const fn_nav = switch (zcu.intern_pool.indexToKey(val.ip_index)) {
411 .@"extern" => |@"extern"| @"extern".owner_nav,
412 .func => |func| func.owner_nav,
413 else => unreachable,
414 };
415 const spv_decl_index = try cg.module.resolveNav(ip, fn_nav);
416 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
417 return cg.module.declPtr(spv_decl_index).result_id;
418 }
419
420 return try cg.constant(ty, val, .direct);
421 }
422 const index = inst.toIndex().?;
423 return cg.inst_results.get(index).?; // Assertion means instruction does not dominate usage.
424}
425
426fn resolveUav(cg: *CodeGen, val: InternPool.Index) !Id {
427 const gpa = cg.module.gpa;
428
429 // TODO: This cannot be a function at this point, but it should probably be handled anyway.
430
431 const zcu = cg.module.zcu;
432 const ty: Type = .fromInterned(zcu.intern_pool.typeOf(val));
433 const ty_id = try cg.resolveType(ty, .indirect);
434
435 const spv_decl_index = blk: {
436 const entry = try cg.module.uav_link.getOrPut(cg.module.gpa, .{ val, .function });
437 if (entry.found_existing) {
438 try cg.addFunctionDep(entry.value_ptr.*, .function);
439 return cg.module.declPtr(entry.value_ptr.*).result_id;
440 }
441
442 const spv_decl_index = try cg.module.allocDecl(.invocation_global);
443 try cg.addFunctionDep(spv_decl_index, .function);
444 entry.value_ptr.* = spv_decl_index;
445 break :blk spv_decl_index;
446 };
447
448 // TODO: At some point we will be able to generate this all constant here, but then all of
449 // constant() will need to be implemented such that it doesn't generate any at-runtime code.
450 // NOTE: Because this is a global, we really only want to initialize it once. Therefore the
451 // constant lowering of this value will need to be deferred to an initializer similar to
452 // other globals.
453
454 const result_id = cg.module.declPtr(spv_decl_index).result_id;
455
456 {
457 // Save the current state so that we can temporarily generate into a different function.
458 // TODO: This should probably be made a little more robust.
459 const func_prologue = cg.prologue;
460 const func_body = cg.body;
461 const func_deps = cg.decl_deps;
462 const block_label = cg.block_label;
463 defer {
464 cg.prologue = func_prologue;
465 cg.body = func_body;
466 cg.decl_deps = func_deps;
467 cg.block_label = block_label;
468 }
469
470 cg.prologue = .{};
471 cg.body = .{};
472 cg.decl_deps = .{};
473 defer {
474 cg.prologue.deinit(gpa);
475 cg.body.deinit(gpa);
476 cg.decl_deps.deinit(gpa);
477 }
478
479 const void_ty_id = try cg.resolveType(.void, .direct);
480 const initializer_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
481
482 const initializer_id = cg.module.allocId();
483 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
484 .id_result_type = try cg.resolveType(.void, .direct),
485 .id_result = initializer_id,
486 .function_control = .{},
487 .function_type = initializer_proto_ty_id,
488 });
489 const root_block_id = cg.module.allocId();
490 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
491 .id_result = root_block_id,
492 });
493 cg.block_label = root_block_id;
494
495 const val_id = try cg.constant(ty, .fromInterned(val), .indirect);
496 try cg.body.emit(cg.module.gpa, .OpStore, .{
497 .pointer = result_id,
498 .object = val_id,
499 });
500
501 try cg.body.emit(cg.module.gpa, .OpReturn, {});
502 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
503
504 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
505 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
506 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
507
508 try cg.module.debugNameFmt(initializer_id, "initializer of __anon_{d}", .{@intFromEnum(val)});
509
510 const fn_decl_ptr_ty_id = try cg.module.ptrType(ty_id, .function);
511 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
512 .id_result_type = fn_decl_ptr_ty_id,
513 .id_result = result_id,
514 .set = try cg.module.importInstructionSet(.zig),
515 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
516 .id_ref_4 = &.{initializer_id},
517 });
518 }
519
520 return result_id;
521}
522
523fn addFunctionDep(cg: *CodeGen, decl_index: Module.Decl.Index, storage_class: StorageClass) !void {
524 const target = cg.module.zcu.getTarget();
525 if (target.cpu.has(.spirv, .v1_4)) {
526 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
527 } else {
528 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
529 if (storage_class == .input or storage_class == .output) {
530 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
531 }
532 }
533}
534
535/// Start a new SPIR-V block, Emits the label of the new block, and stores which
536/// block we are currently generating.
537/// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
538/// keep track of the previous block.
539fn beginSpvBlock(cg: *CodeGen, label: Id) !void {
540 try cg.body.emit(cg.module.gpa, .OpLabel, .{ .id_result = label });
541 cg.block_label = label;
542}
543
544/// Return the amount of bits in the largest supported integer type. This is either 32 (always supported), or 64 (if
545/// the Int64 capability is enabled).
546/// Note: The extension SPV_INTEL_arbitrary_precision_integers allows any integer size (at least up to 32 bits).
547/// In theory that could also be used, but since the spec says that it only guarantees support up to 32-bit ints there
548/// is no way of knowing whether those are actually supported.
549/// TODO: Maybe this should be cached?
550fn largestSupportedIntBits(cg: *CodeGen) u16 {
551 const target = cg.module.zcu.getTarget();
552 if (target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64) {
553 return 64;
554 }
555 return 32;
556}
557
558const ArithmeticTypeInfo = struct {
559 const Class = enum {
560 bool,
561 /// A regular, **native**, integer.
562 /// This is only returned when the backend supports this int as a native type (when
563 /// the relevant capability is enabled).
564 integer,
565 /// A regular float. These are all required to be natively supported. Floating points
566 /// for which the relevant capability is not enabled are not emulated.
567 float,
568 /// An integer of a 'strange' size (which' bit size is not the same as its backing
569 /// type. **Note**: this may **also** include power-of-2 integers for which the
570 /// relevant capability is not enabled), but still within the limits of the largest
571 /// natively supported integer type.
572 strange_integer,
573 /// An integer with more bits than the largest natively supported integer type.
574 composite_integer,
575 };
576
577 /// A classification of the inner type.
578 /// These scenarios will all have to be handled slightly different.
579 class: Class,
580 /// The number of bits in the inner type.
581 /// This is the actual number of bits of the type, not the size of the backing integer.
582 bits: u16,
583 /// The number of bits required to store the type.
584 /// For `integer` and `float`, this is equal to `bits`.
585 /// For `strange_integer` and `bool` this is the size of the backing integer.
586 /// For `composite_integer` this is the elements count.
587 backing_bits: u16,
588 /// Null if this type is a scalar, or the length of the vector otherwise.
589 vector_len: ?u32,
590 /// Whether the inner type is signed. Only relevant for integers.
591 signedness: std.builtin.Signedness,
592};
593
594fn arithmeticTypeInfo(cg: *CodeGen, ty: Type) ArithmeticTypeInfo {
595 const zcu = cg.module.zcu;
596 const target = cg.module.zcu.getTarget();
597 var scalar_ty = ty.scalarType(zcu);
598 if (scalar_ty.zigTypeTag(zcu) == .@"enum") {
599 scalar_ty = scalar_ty.intTagType(zcu);
600 }
601 const vector_len = if (ty.isVector(zcu)) ty.vectorLen(zcu) else null;
602 return switch (scalar_ty.zigTypeTag(zcu)) {
603 .bool => .{
604 .bits = 1, // Doesn't matter for this class.
605 .backing_bits = cg.module.backingIntBits(1).@"0",
606 .vector_len = vector_len,
607 .signedness = .unsigned, // Technically, but doesn't matter for this class.
608 .class = .bool,
609 },
610 .float => .{
611 .bits = scalar_ty.floatBits(target),
612 .backing_bits = scalar_ty.floatBits(target), // TODO: F80?
613 .vector_len = vector_len,
614 .signedness = .signed, // Technically, but doesn't matter for this class.
615 .class = .float,
616 },
617 .int => blk: {
618 const int_info = scalar_ty.intInfo(zcu);
619 // TODO: Maybe it's useful to also return this value.
620 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
621 break :blk .{
622 .bits = int_info.bits,
623 .backing_bits = backing_bits,
624 .vector_len = vector_len,
625 .signedness = int_info.signedness,
626 .class = class: {
627 if (big_int) break :class .composite_integer;
628 break :class if (backing_bits == int_info.bits) .integer else .strange_integer;
629 },
630 };
631 },
632 .@"enum" => unreachable,
633 .vector => unreachable,
634 else => unreachable, // Unhandled arithmetic type
635 };
636}
637
638/// Checks whether the type can be directly translated to SPIR-V vectors
639fn isSpvVector(cg: *CodeGen, ty: Type) bool {
640 const zcu = cg.module.zcu;
641 const target = cg.module.zcu.getTarget();
642 if (ty.zigTypeTag(zcu) != .vector) return false;
643
644 // TODO: This check must be expanded for types that can be represented
645 // as integers (enums / packed structs?) and types that are represented
646 // by multiple SPIR-V values.
647 const scalar_ty = ty.scalarType(zcu);
648 switch (scalar_ty.zigTypeTag(zcu)) {
649 .bool,
650 .int,
651 .float,
652 => {},
653 else => return false,
654 }
655
656 const elem_ty = ty.childType(zcu);
657 const len = ty.vectorLen(zcu);
658
659 if (elem_ty.isNumeric(zcu) or elem_ty.toIntern() == .bool_type) {
660 if (len > 1 and len <= 4) return true;
661 if (target.cpu.has(.spirv, .vector16)) return (len == 8 or len == 16);
662 }
663
664 return false;
665}
666
667/// Emits a bool constant in a particular representation.
668fn constBool(cg: *CodeGen, value: bool, repr: Repr) !Id {
669 return switch (repr) {
670 .indirect => cg.constInt(.u1, @intFromBool(value)),
671 .direct => cg.module.constBool(value),
672 };
673}
674
675/// Emits an integer constant.
676/// This function, unlike Module.constInt, takes care to bitcast
677/// the value to an unsigned int first for Kernels.
678fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {
679 const zcu = cg.module.zcu;
680 const target = cg.module.zcu.getTarget();
681 const scalar_ty = ty.scalarType(zcu);
682 const int_info = scalar_ty.intInfo(zcu);
683 // Use backing bits so that negatives are sign extended
684 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
685 assert(backing_bits != 0); // u0 is comptime
686
687 const result_ty_id = try cg.resolveType(scalar_ty, .indirect);
688 const signedness: Signedness = switch (@typeInfo(@TypeOf(value))) {
689 .int => |int| int.signedness,
690 .comptime_int => if (value < 0) .signed else .unsigned,
691 else => unreachable,
692 };
693 if (@sizeOf(@TypeOf(value)) >= 4 and big_int) {
694 const value64: u64 = switch (signedness) {
695 .signed => @bitCast(@as(i64, @intCast(value))),
696 .unsigned => @as(u64, @intCast(value)),
697 };
698 assert(backing_bits == 64);
699 return cg.constructComposite(result_ty_id, &.{
700 try cg.constInt(.u32, @as(u32, @truncate(value64))),
701 try cg.constInt(.u32, @as(u32, @truncate(value64 << 32))),
702 });
703 }
704
705 const final_value: spec.LiteralContextDependentNumber = switch (target.os.tag) {
706 .opencl, .amdhsa => blk: {
707 const value64: u64 = switch (signedness) {
708 .signed => @bitCast(@as(i64, @intCast(value))),
709 .unsigned => @as(u64, @intCast(value)),
710 };
711
712 // Manually truncate the value to the right amount of bits.
713 const truncated_value = if (backing_bits == 64)
714 value64
715 else
716 value64 & (@as(u64, 1) << @intCast(backing_bits)) - 1;
717
718 break :blk switch (backing_bits) {
719 1...32 => .{ .uint32 = @truncate(truncated_value) },
720 33...64 => .{ .uint64 = truncated_value },
721 else => unreachable,
722 };
723 },
724 else => switch (backing_bits) {
725 1...32 => if (signedness == .signed) .{ .int32 = @intCast(value) } else .{ .uint32 = @intCast(value) },
726 33...64 => if (signedness == .signed) .{ .int64 = value } else .{ .uint64 = value },
727 else => unreachable,
728 },
729 };
730
731 const result_id = try cg.module.constant(result_ty_id, final_value);
732
733 if (!ty.isVector(zcu)) return result_id;
734 return cg.constructCompositeSplat(ty, result_id);
735}
736
737pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const Id) !Id {
738 const gpa = cg.module.gpa;
739 const result_id = cg.module.allocId();
740 try cg.body.emit(gpa, .OpCompositeConstruct, .{
741 .id_result_type = result_ty_id,
742 .id_result = result_id,
743 .constituents = constituents,
744 });
745 return result_id;
746}
747
748/// Construct a composite at runtime with all lanes set to the same value.
749/// ty must be an aggregate type.
750fn constructCompositeSplat(cg: *CodeGen, ty: Type, constituent: Id) !Id {
751 const gpa = cg.module.gpa;
752 const zcu = cg.module.zcu;
753 const n: usize = @intCast(ty.arrayLen(zcu));
754
755 const constituents = try gpa.alloc(Id, n);
756 defer gpa.free(constituents);
757 @memset(constituents, constituent);
758
759 const result_ty_id = try cg.resolveType(ty, .direct);
760 return cg.constructComposite(result_ty_id, constituents);
761}
762
763/// This function generates a load for a constant in direct (ie, non-memory) representation.
764/// When the constant is simple, it can be generated directly using OpConstant instructions.
765/// When the constant is more complicated however, it needs to be constructed using multiple values. This
766/// is done by emitting a sequence of instructions that initialize the value.
767//
768/// This function should only be called during function code generation.
769fn constant(cg: *CodeGen, ty: Type, val: Value, repr: Repr) Error!Id {
770 const gpa = cg.module.gpa;
771
772 // Note: Using intern_map can only be used with constants that DO NOT generate any runtime code!!
773 // Ideally that should be all constants in the future, or it should be cleaned up somehow. For
774 // now, only use the intern_map on case-by-case basis by breaking to :cache.
775 if (cg.module.intern_map.get(.{ val.toIntern(), repr })) |id| {
776 return id;
777 }
778
779 const pt = cg.pt;
780 const zcu = cg.module.zcu;
781 const target = cg.module.zcu.getTarget();
782 const result_ty_id = try cg.resolveType(ty, repr);
783 const ip = &zcu.intern_pool;
784
785 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{ ty.fmt(pt), val.fmtValue(pt), @tagName(ip.indexToKey(val.toIntern())) });
786 if (val.isUndefDeep(zcu)) {
787 return cg.module.constUndef(result_ty_id);
788 }
789
790 const cacheable_id = cache: {
791 switch (ip.indexToKey(val.toIntern())) {
792 .int_type,
793 .ptr_type,
794 .array_type,
795 .vector_type,
796 .opt_type,
797 .anyframe_type,
798 .error_union_type,
799 .simple_type,
800 .struct_type,
801 .tuple_type,
802 .union_type,
803 .opaque_type,
804 .enum_type,
805 .func_type,
806 .error_set_type,
807 .inferred_error_set_type,
808 => unreachable, // types, not values
809
810 .undef => unreachable, // handled above
811
812 .variable,
813 .@"extern",
814 .func,
815 .enum_literal,
816 .empty_enum_value,
817 => unreachable, // non-runtime values
818
819 .simple_value => |simple_value| switch (simple_value) {
820 .undefined,
821 .void,
822 .null,
823 .empty_tuple,
824 .@"unreachable",
825 => unreachable, // non-runtime values
826
827 .false, .true => break :cache try cg.constBool(val.toBool(), repr),
828 },
829 .int => {
830 if (ty.isSignedInt(zcu)) {
831 break :cache try cg.constInt(ty, val.toSignedInt(zcu));
832 } else {
833 break :cache try cg.constInt(ty, val.toUnsignedInt(zcu));
834 }
835 },
836 .float => {
837 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
838 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
839 32 => .{ .float32 = val.toFloat(f32, zcu) },
840 64 => .{ .float64 = val.toFloat(f64, zcu) },
841 80, 128 => unreachable, // TODO
842 else => unreachable,
843 };
844 break :cache try cg.module.constant(result_ty_id, lit);
845 },
846 .err => |err| {
847 const value = try pt.getErrorValue(err.name);
848 break :cache try cg.constInt(ty, value);
849 },
850 .error_union => |error_union| {
851 // TODO: Error unions may be constructed with constant instructions if the payload type
852 // allows it. For now, just generate it here regardless.
853 const err_ty = ty.errorUnionSet(zcu);
854 const payload_ty = ty.errorUnionPayload(zcu);
855 const err_val_id = switch (error_union.val) {
856 .err_name => |err_name| try cg.constInt(
857 err_ty,
858 try pt.getErrorValue(err_name),
859 ),
860 .payload => try cg.constInt(err_ty, 0),
861 };
862 const eu_layout = cg.errorUnionLayout(payload_ty);
863 if (!eu_layout.payload_has_bits) {
864 // We use the error type directly as the type.
865 break :cache err_val_id;
866 }
867
868 const payload_val_id = switch (error_union.val) {
869 .err_name => try cg.constant(payload_ty, .undef, .indirect),
870 .payload => |p| try cg.constant(payload_ty, .fromInterned(p), .indirect),
871 };
872
873 var constituents: [2]Id = undefined;
874 var types: [2]Type = undefined;
875 if (eu_layout.error_first) {
876 constituents[0] = err_val_id;
877 constituents[1] = payload_val_id;
878 types = .{ err_ty, payload_ty };
879 } else {
880 constituents[0] = payload_val_id;
881 constituents[1] = err_val_id;
882 types = .{ payload_ty, err_ty };
883 }
884
885 const comp_ty_id = try cg.resolveType(ty, .direct);
886 return try cg.constructComposite(comp_ty_id, &constituents);
887 },
888 .enum_tag => {
889 const int_val = try val.intFromEnum(ty, pt);
890 const int_ty = ty.intTagType(zcu);
891 break :cache try cg.constant(int_ty, int_val, repr);
892 },
893 .ptr => return cg.constantPtr(val),
894 .slice => |slice| {
895 const ptr_id = try cg.constantPtr(.fromInterned(slice.ptr));
896 const len_id = try cg.constant(.usize, .fromInterned(slice.len), .indirect);
897 const comp_ty_id = try cg.resolveType(ty, .direct);
898 return try cg.constructComposite(comp_ty_id, &.{ ptr_id, len_id });
899 },
900 .opt => {
901 const payload_ty = ty.optionalChild(zcu);
902 const maybe_payload_val = val.optionalValue(zcu);
903
904 if (!payload_ty.hasRuntimeBits(zcu)) {
905 break :cache try cg.constBool(maybe_payload_val != null, .indirect);
906 } else if (ty.optionalReprIsPayload(zcu)) {
907 // Optional representation is a nullable pointer or slice.
908 if (maybe_payload_val) |payload_val| {
909 return try cg.constant(payload_ty, payload_val, .indirect);
910 } else {
911 break :cache try cg.module.constNull(result_ty_id);
912 }
913 }
914
915 // Optional representation is a structure.
916 // { Payload, Bool }
917
918 const has_pl_id = try cg.constBool(maybe_payload_val != null, .indirect);
919 const payload_id = if (maybe_payload_val) |payload_val|
920 try cg.constant(payload_ty, payload_val, .indirect)
921 else
922 try cg.module.constUndef(try cg.resolveType(payload_ty, .indirect));
923
924 const comp_ty_id = try cg.resolveType(ty, .direct);
925 return try cg.constructComposite(comp_ty_id, &.{ payload_id, has_pl_id });
926 },
927 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {
928 inline .array_type, .vector_type => |array_type, tag| {
929 const elem_ty: Type = .fromInterned(array_type.child);
930
931 const constituents = try gpa.alloc(Id, @intCast(ty.arrayLenIncludingSentinel(zcu)));
932 defer gpa.free(constituents);
933
934 const child_repr: Repr = switch (tag) {
935 .array_type => .indirect,
936 .vector_type => .direct,
937 else => unreachable,
938 };
939
940 switch (aggregate.storage) {
941 .bytes => |bytes| {
942 // TODO: This is really space inefficient, perhaps there is a better
943 // way to do it?
944 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
945 constituent.* = try cg.constInt(elem_ty, byte);
946 }
947 },
948 .elems => |elems| {
949 for (constituents, elems) |*constituent, elem| {
950 constituent.* = try cg.constant(elem_ty, .fromInterned(elem), child_repr);
951 }
952 },
953 .repeated_elem => |elem| {
954 @memset(constituents, try cg.constant(elem_ty, .fromInterned(elem), child_repr));
955 },
956 }
957
958 const comp_ty_id = try cg.resolveType(ty, .direct);
959 return cg.constructComposite(comp_ty_id, constituents);
960 },
961 .struct_type => {
962 const struct_type = zcu.typeToStruct(ty).?;
963
964 if (struct_type.layout == .@"packed") {
965 // TODO: composite int
966 // TODO: endianness
967 const bits: u16 = @intCast(ty.bitSize(zcu));
968 const bytes = std.mem.alignForward(u16, cg.module.backingIntBits(bits).@"0", 8) / 8;
969 var limbs: [8]u8 = undefined;
970 @memset(&limbs, 0);
971 val.writeToPackedMemory(ty, pt, limbs[0..bytes], 0) catch unreachable;
972 const backing_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
973 return try cg.constInt(backing_ty, @as(u64, @bitCast(limbs)));
974 }
975
976 var types = std.ArrayList(Type).init(gpa);
977 defer types.deinit();
978
979 var constituents = std.ArrayList(Id).init(gpa);
980 defer constituents.deinit();
981
982 var it = struct_type.iterateRuntimeOrder(ip);
983 while (it.next()) |field_index| {
984 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
985 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
986 // This is a zero-bit field - we only needed it for the alignment.
987 continue;
988 }
989
990 // TODO: Padding?
991 const field_val = try val.fieldValue(pt, field_index);
992 const field_id = try cg.constant(field_ty, field_val, .indirect);
993
994 try types.append(field_ty);
995 try constituents.append(field_id);
996 }
997
998 const comp_ty_id = try cg.resolveType(ty, .direct);
999 return try cg.constructComposite(comp_ty_id, constituents.items);
1000 },
1001 .tuple_type => return cg.todo("implement tuple types", .{}),
1002 else => unreachable,
1003 },
1004 .un => |un| {
1005 if (un.tag == .none) {
1006 assert(ty.containerLayout(zcu) == .@"packed"); // TODO
1007 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1008 return try cg.constInt(int_ty, Value.toUnsignedInt(.fromInterned(un.val), zcu));
1009 }
1010 const active_field = ty.unionTagFieldIndex(.fromInterned(un.tag), zcu).?;
1011 const union_obj = zcu.typeToUnion(ty).?;
1012 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[active_field]);
1013 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
1014 try cg.constant(field_ty, .fromInterned(un.val), .direct)
1015 else
1016 null;
1017 return try cg.unionInit(ty, active_field, payload);
1018 },
1019 .memoized_call => unreachable,
1020 }
1021 };
1022
1023 try cg.module.intern_map.putNoClobber(gpa, .{ val.toIntern(), repr }, cacheable_id);
1024
1025 return cacheable_id;
1026}
1027
1028fn constantPtr(cg: *CodeGen, ptr_val: Value) !Id {
1029 const pt = cg.pt;
1030 const zcu = cg.module.zcu;
1031 const gpa = cg.module.gpa;
1032
1033 if (ptr_val.isUndef(zcu)) {
1034 const result_ty = ptr_val.typeOf(zcu);
1035 const result_ty_id = try cg.resolveType(result_ty, .direct);
1036 return cg.module.constUndef(result_ty_id);
1037 }
1038
1039 var arena = std.heap.ArenaAllocator.init(gpa);
1040 defer arena.deinit();
1041
1042 const derivation = try ptr_val.pointerDerivation(arena.allocator(), pt);
1043 return cg.derivePtr(derivation);
1044}
1045
1046fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
1047 const pt = cg.pt;
1048 const zcu = cg.module.zcu;
1049 switch (derivation) {
1050 .comptime_alloc_ptr, .comptime_field_ptr => unreachable,
1051 .int => |int| {
1052 const result_ty_id = try cg.resolveType(int.ptr_ty, .direct);
1053 // TODO: This can probably be an OpSpecConstantOp Bitcast, but
1054 // that is not implemented by Mesa yet. Therefore, just generate it
1055 // as a runtime operation.
1056 const result_ptr_id = cg.module.allocId();
1057 const value_id = try cg.constInt(.usize, int.addr);
1058 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
1059 .id_result_type = result_ty_id,
1060 .id_result = result_ptr_id,
1061 .integer_value = value_id,
1062 });
1063 return result_ptr_id;
1064 },
1065 .nav_ptr => |nav| {
1066 const result_ptr_ty = try pt.navPtrType(nav);
1067 return cg.constantNavRef(result_ptr_ty, nav);
1068 },
1069 .uav_ptr => |uav| {
1070 const result_ptr_ty: Type = .fromInterned(uav.orig_ty);
1071 return cg.constantUavRef(result_ptr_ty, uav);
1072 },
1073 .eu_payload_ptr => @panic("TODO"),
1074 .opt_payload_ptr => @panic("TODO"),
1075 .field_ptr => |field| {
1076 const parent_ptr_id = try cg.derivePtr(field.parent.*);
1077 const parent_ptr_ty = try field.parent.ptrType(pt);
1078 return cg.structFieldPtr(field.result_ptr_ty, parent_ptr_ty, parent_ptr_id, field.field_idx);
1079 },
1080 .elem_ptr => |elem| {
1081 const parent_ptr_id = try cg.derivePtr(elem.parent.*);
1082 const parent_ptr_ty = try elem.parent.ptrType(pt);
1083 const index_id = try cg.constInt(.usize, elem.elem_idx);
1084 return cg.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id);
1085 },
1086 .offset_and_cast => |oac| {
1087 const parent_ptr_id = try cg.derivePtr(oac.parent.*);
1088 const parent_ptr_ty = try oac.parent.ptrType(pt);
1089 const result_ty_id = try cg.resolveType(oac.new_ptr_ty, .direct);
1090 const child_size = oac.new_ptr_ty.childType(zcu).abiSize(zcu);
1091
1092 if (parent_ptr_ty.childType(zcu).isVector(zcu) and oac.byte_offset % child_size == 0) {
1093 // Vector element ptr accesses are derived as offset_and_cast.
1094 // We can just use OpAccessChain.
1095 return cg.accessChain(
1096 result_ty_id,
1097 parent_ptr_id,
1098 &.{@intCast(@divExact(oac.byte_offset, child_size))},
1099 );
1100 }
1101
1102 if (oac.byte_offset == 0) {
1103 // Allow changing the pointer type child only to restructure arrays.
1104 // e.g. [3][2]T to T is fine, as is [2]T -> [2][1]T.
1105 const result_ptr_id = cg.module.allocId();
1106 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1107 .id_result_type = result_ty_id,
1108 .id_result = result_ptr_id,
1109 .operand = parent_ptr_id,
1110 });
1111 return result_ptr_id;
1112 }
1113
1114 return cg.fail("cannot perform pointer cast: '{f}' to '{f}'", .{
1115 parent_ptr_ty.fmt(pt),
1116 oac.new_ptr_ty.fmt(pt),
1117 });
1118 },
1119 }
1120}
1121
1122fn constantUavRef(
1123 cg: *CodeGen,
1124 ty: Type,
1125 uav: InternPool.Key.Ptr.BaseAddr.Uav,
1126) !Id {
1127 // TODO: Merge this function with constantDeclRef.
1128
1129 const zcu = cg.module.zcu;
1130 const ip = &zcu.intern_pool;
1131 const ty_id = try cg.resolveType(ty, .direct);
1132 const uav_ty: Type = .fromInterned(ip.typeOf(uav.val));
1133
1134 switch (ip.indexToKey(uav.val)) {
1135 .func => unreachable, // TODO
1136 .@"extern" => assert(!ip.isFunctionType(uav_ty.toIntern())),
1137 else => {},
1138 }
1139
1140 // const is_fn_body = decl_ty.zigTypeTag(zcu) == .@"fn";
1141 if (!uav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1142 // Pointer to nothing - return undefined
1143 return cg.module.constUndef(ty_id);
1144 }
1145
1146 // Uav refs are always generic.
1147 assert(ty.ptrAddressSpace(zcu) == .generic);
1148 const uav_ty_id = try cg.resolveType(uav_ty, .indirect);
1149 const decl_ptr_ty_id = try cg.module.ptrType(uav_ty_id, .generic);
1150 const ptr_id = try cg.resolveUav(uav.val);
1151
1152 if (decl_ptr_ty_id != ty_id) {
1153 // Differing pointer types, insert a cast.
1154 const casted_ptr_id = cg.module.allocId();
1155 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1156 .id_result_type = ty_id,
1157 .id_result = casted_ptr_id,
1158 .operand = ptr_id,
1159 });
1160 return casted_ptr_id;
1161 } else {
1162 return ptr_id;
1163 }
1164}
1165
1166fn constantNavRef(cg: *CodeGen, ty: Type, nav_index: InternPool.Nav.Index) !Id {
1167 const zcu = cg.module.zcu;
1168 const ip = &zcu.intern_pool;
1169 const ty_id = try cg.resolveType(ty, .direct);
1170 const nav = ip.getNav(nav_index);
1171 const nav_ty: Type = .fromInterned(nav.typeOf(ip));
1172
1173 switch (nav.status) {
1174 .unresolved => unreachable,
1175 .type_resolved => {}, // this is not a function or extern
1176 .fully_resolved => |r| switch (ip.indexToKey(r.val)) {
1177 .func => {
1178 // TODO: Properly lower function pointers. For now we are going to hack around it and
1179 // just generate an empty pointer. Function pointers are represented by a pointer to usize.
1180 return try cg.module.constUndef(ty_id);
1181 },
1182 .@"extern" => if (ip.isFunctionType(nav_ty.toIntern())) @panic("TODO"),
1183 else => {},
1184 },
1185 }
1186
1187 if (!nav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1188 // Pointer to nothing - return undefined.
1189 return cg.module.constUndef(ty_id);
1190 }
1191
1192 const spv_decl_index = try cg.module.resolveNav(ip, nav_index);
1193 const spv_decl = cg.module.declPtr(spv_decl_index);
1194 assert(spv_decl.kind != .func);
1195
1196 const storage_class = cg.module.storageClass(nav.getAddrspace());
1197 try cg.addFunctionDep(spv_decl_index, storage_class);
1198
1199 const nav_ty_id = try cg.resolveType(nav_ty, .indirect);
1200 const decl_ptr_ty_id = try cg.module.ptrType(nav_ty_id, storage_class);
1201
1202 if (decl_ptr_ty_id != ty_id) {
1203 // Differing pointer types, insert a cast.
1204 const casted_ptr_id = cg.module.allocId();
1205 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1206 .id_result_type = ty_id,
1207 .id_result = casted_ptr_id,
1208 .operand = spv_decl.result_id,
1209 });
1210 return casted_ptr_id;
1211 }
1212
1213 return spv_decl.result_id;
1214}
1215
1216// Turn a Zig type's name into a cache reference.
1217fn resolveTypeName(cg: *CodeGen, ty: Type) ![]const u8 {
1218 const gpa = cg.module.gpa;
1219 var aw: std.io.Writer.Allocating = .init(gpa);
1220 defer aw.deinit();
1221 ty.print(&aw.writer, cg.pt) catch |err| switch (err) {
1222 error.WriteFailed => return error.OutOfMemory,
1223 };
1224 return try aw.toOwnedSlice();
1225}
1226
1227/// Generate a union type. Union types are always generated with the
1228/// most aligned field active. If the tag alignment is greater
1229/// than that of the payload, a regular union (non-packed, with both tag and
1230/// payload), will be generated as follows:
1231/// struct {
1232/// tag: TagType,
1233/// payload: MostAlignedFieldType,
1234/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1235/// padding: [padding_size]u8,
1236/// }
1237/// If the payload alignment is greater than that of the tag:
1238/// struct {
1239/// payload: MostAlignedFieldType,
1240/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1241/// tag: TagType,
1242/// padding: [padding_size]u8,
1243/// }
1244/// If any of the fields' size is 0, it will be omitted.
1245fn resolveUnionType(cg: *CodeGen, ty: Type) !Id {
1246 const gpa = cg.module.gpa;
1247 const zcu = cg.module.zcu;
1248 const ip = &zcu.intern_pool;
1249 const union_obj = zcu.typeToUnion(ty).?;
1250
1251 if (union_obj.flagsUnordered(ip).layout == .@"packed") {
1252 return try cg.module.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1253 }
1254
1255 const layout = cg.unionLayout(ty);
1256 if (!layout.has_payload) {
1257 // No payload, so represent this as just the tag type.
1258 return try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1259 }
1260
1261 var member_types: [4]Id = undefined;
1262 var member_names: [4][]const u8 = undefined;
1263
1264 const u8_ty_id = try cg.resolveType(.u8, .direct);
1265
1266 if (layout.tag_size != 0) {
1267 const tag_ty_id = try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1268 member_types[layout.tag_index] = tag_ty_id;
1269 member_names[layout.tag_index] = "(tag)";
1270 }
1271
1272 if (layout.payload_size != 0) {
1273 const payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
1274 member_types[layout.payload_index] = payload_ty_id;
1275 member_names[layout.payload_index] = "(payload)";
1276 }
1277
1278 if (layout.payload_padding_size != 0) {
1279 const len_id = try cg.constInt(.u32, layout.payload_padding_size);
1280 const payload_padding_ty_id = try cg.module.arrayType(len_id, u8_ty_id);
1281 member_types[layout.payload_padding_index] = payload_padding_ty_id;
1282 member_names[layout.payload_padding_index] = "(payload padding)";
1283 }
1284
1285 if (layout.padding_size != 0) {
1286 const len_id = try cg.constInt(.u32, layout.padding_size);
1287 const padding_ty_id = try cg.module.arrayType(len_id, u8_ty_id);
1288 member_types[layout.padding_index] = padding_ty_id;
1289 member_names[layout.padding_index] = "(padding)";
1290 }
1291
1292 const result_id = try cg.module.structType(
1293 member_types[0..layout.total_fields],
1294 member_names[0..layout.total_fields],
1295 null,
1296 .none,
1297 );
1298
1299 const type_name = try cg.resolveTypeName(ty);
1300 defer gpa.free(type_name);
1301 try cg.module.debugName(result_id, type_name);
1302
1303 return result_id;
1304}
1305
1306fn resolveFnReturnType(cg: *CodeGen, ret_ty: Type) !Id {
1307 const zcu = cg.module.zcu;
1308 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1309 // If the return type is an error set or an error union, then we make this
1310 // anyerror return type instead, so that it can be coerced into a function
1311 // pointer type which has anyerror as the return type.
1312 if (ret_ty.isError(zcu)) {
1313 return cg.resolveType(.anyerror, .direct);
1314 } else {
1315 return cg.resolveType(.void, .direct);
1316 }
1317 }
1318
1319 return try cg.resolveType(ret_ty, .direct);
1320}
1321
1322fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
1323 const gpa = cg.module.gpa;
1324 const pt = cg.pt;
1325 const zcu = cg.module.zcu;
1326 const ip = &zcu.intern_pool;
1327 const target = cg.module.zcu.getTarget();
1328
1329 log.debug("resolveType: ty = {f}", .{ty.fmt(pt)});
1330
1331 switch (ty.zigTypeTag(zcu)) {
1332 .noreturn => {
1333 assert(repr == .direct);
1334 return try cg.module.voidType();
1335 },
1336 .void => switch (repr) {
1337 .direct => return try cg.module.voidType(),
1338 .indirect => return try cg.module.opaqueType("void"),
1339 },
1340 .bool => switch (repr) {
1341 .direct => return try cg.module.boolType(),
1342 .indirect => return try cg.resolveType(.u1, .indirect),
1343 },
1344 .int => {
1345 const int_info = ty.intInfo(zcu);
1346 if (int_info.bits == 0) {
1347 assert(repr == .indirect);
1348 return try cg.module.opaqueType("u0");
1349 }
1350 return try cg.module.intType(int_info.signedness, int_info.bits);
1351 },
1352 .@"enum" => return try cg.resolveType(ty.intTagType(zcu), repr),
1353 .float => {
1354 const bits = ty.floatBits(target);
1355 const supported = switch (bits) {
1356 16 => target.cpu.has(.spirv, .float16),
1357 32 => true,
1358 64 => target.cpu.has(.spirv, .float64),
1359 else => false,
1360 };
1361
1362 if (!supported) {
1363 return cg.fail(
1364 "floating point width of {} bits is not supported for the current SPIR-V feature set",
1365 .{bits},
1366 );
1367 }
1368
1369 return try cg.module.floatType(bits);
1370 },
1371 .array => {
1372 const elem_ty = ty.childType(zcu);
1373 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
1374 const total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(zcu)) orelse {
1375 return cg.fail("array type of {} elements is too large", .{ty.arrayLenIncludingSentinel(zcu)});
1376 };
1377
1378 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1379 assert(repr == .indirect);
1380 return try cg.module.opaqueType("zero-sized-array");
1381 } else if (total_len == 0) {
1382 // The size of the array would be 0, but that is not allowed in SPIR-V.
1383 // This path can be reached for example when there is a slicing of a pointer
1384 // that produces a zero-length array. In all cases where this type can be generated,
1385 // this should be an indirect path.
1386 assert(repr == .indirect);
1387 // In this case, we have an array of a non-zero sized type. In this case,
1388 // generate an array of 1 element instead, so that ptr_elem_ptr instructions
1389 // can be lowered to ptrAccessChain instead of manually performing the math.
1390 const len_id = try cg.constInt(.u32, 1);
1391 return try cg.module.arrayType(len_id, elem_ty_id);
1392 } else {
1393 const total_len_id = try cg.constInt(.u32, total_len);
1394 const result_id = try cg.module.arrayType(total_len_id, elem_ty_id);
1395 switch (target.os.tag) {
1396 .vulkan, .opengl => {
1397 try cg.module.decorate(result_id, .{
1398 .array_stride = .{
1399 .array_stride = @intCast(elem_ty.abiSize(zcu)),
1400 },
1401 });
1402 },
1403 else => {},
1404 }
1405 return result_id;
1406 }
1407 },
1408 .vector => {
1409 const elem_ty = ty.childType(zcu);
1410 const elem_ty_id = try cg.resolveType(elem_ty, repr);
1411 const len = ty.vectorLen(zcu);
1412 if (cg.isSpvVector(ty)) return try cg.module.vectorType(len, elem_ty_id);
1413 const len_id = try cg.constInt(.u32, len);
1414 return try cg.module.arrayType(len_id, elem_ty_id);
1415 },
1416 .@"fn" => switch (repr) {
1417 .direct => {
1418 const fn_info = zcu.typeToFunc(ty).?;
1419
1420 comptime assert(zig_call_abi_ver == 3);
1421 assert(!fn_info.is_var_args);
1422 switch (fn_info.cc) {
1423 .auto,
1424 .spirv_kernel,
1425 .spirv_fragment,
1426 .spirv_vertex,
1427 .spirv_device,
1428 => {},
1429 else => unreachable,
1430 }
1431
1432 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
1433 const param_ty_ids = try gpa.alloc(Id, fn_info.param_types.len);
1434 defer gpa.free(param_ty_ids);
1435 var param_index: usize = 0;
1436 for (fn_info.param_types.get(ip)) |param_ty_index| {
1437 const param_ty: Type = .fromInterned(param_ty_index);
1438 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1439
1440 param_ty_ids[param_index] = try cg.resolveType(param_ty, .direct);
1441 param_index += 1;
1442 }
1443
1444 return try cg.module.functionType(return_ty_id, param_ty_ids[0..param_index]);
1445 },
1446 .indirect => {
1447 // TODO: Represent function pointers properly.
1448 // For now, just use an usize type.
1449 return try cg.resolveType(.usize, .indirect);
1450 },
1451 },
1452 .pointer => {
1453 const ptr_info = ty.ptrInfo(zcu);
1454
1455 const child_ty: Type = .fromInterned(ptr_info.child);
1456 const child_ty_id = try cg.resolveType(child_ty, .indirect);
1457 const storage_class = cg.module.storageClass(ptr_info.flags.address_space);
1458 const ptr_ty_id = try cg.module.ptrType(child_ty_id, storage_class);
1459
1460 if (ptr_info.flags.size != .slice) {
1461 return ptr_ty_id;
1462 }
1463
1464 const size_ty_id = try cg.resolveType(.usize, .direct);
1465 return try cg.module.structType(
1466 &.{ ptr_ty_id, size_ty_id },
1467 &.{ "ptr", "len" },
1468 null,
1469 .none,
1470 );
1471 },
1472 .@"struct" => {
1473 const struct_type = switch (ip.indexToKey(ty.toIntern())) {
1474 .tuple_type => |tuple| {
1475 const member_types = try gpa.alloc(Id, tuple.values.len);
1476 defer gpa.free(member_types);
1477
1478 var member_index: usize = 0;
1479 for (tuple.types.get(ip), tuple.values.get(ip)) |field_ty, field_val| {
1480 if (field_val != .none or !Type.fromInterned(field_ty).hasRuntimeBits(zcu)) continue;
1481
1482 member_types[member_index] = try cg.resolveType(.fromInterned(field_ty), .indirect);
1483 member_index += 1;
1484 }
1485
1486 const result_id = try cg.module.structType(
1487 member_types[0..member_index],
1488 null,
1489 null,
1490 .none,
1491 );
1492 const type_name = try cg.resolveTypeName(ty);
1493 defer gpa.free(type_name);
1494 try cg.module.debugName(result_id, type_name);
1495 return result_id;
1496 },
1497 .struct_type => ip.loadStructType(ty.toIntern()),
1498 else => unreachable,
1499 };
1500
1501 if (struct_type.layout == .@"packed") {
1502 return try cg.resolveType(.fromInterned(struct_type.backingIntTypeUnordered(ip)), .direct);
1503 }
1504
1505 var member_types = std.ArrayList(Id).init(gpa);
1506 defer member_types.deinit();
1507
1508 var member_names = std.ArrayList([]const u8).init(gpa);
1509 defer member_names.deinit();
1510
1511 var member_offsets = std.ArrayList(u32).init(gpa);
1512 defer member_offsets.deinit();
1513
1514 var it = struct_type.iterateRuntimeOrder(ip);
1515 while (it.next()) |field_index| {
1516 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
1517 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1518
1519 const field_name = struct_type.fieldName(ip, field_index).unwrap() orelse
1520 try ip.getOrPutStringFmt(zcu.gpa, pt.tid, "{d}", .{field_index}, .no_embedded_nulls);
1521 try member_types.append(try cg.resolveType(field_ty, .indirect));
1522 try member_names.append(field_name.toSlice(ip));
1523 try member_offsets.append(@intCast(ty.structFieldOffset(field_index, zcu)));
1524 }
1525
1526 const result_id = try cg.module.structType(
1527 member_types.items,
1528 member_names.items,
1529 member_offsets.items,
1530 ty.toIntern(),
1531 );
1532
1533 const type_name = try cg.resolveTypeName(ty);
1534 defer gpa.free(type_name);
1535 try cg.module.debugName(result_id, type_name);
1536
1537 return result_id;
1538 },
1539 .optional => {
1540 const payload_ty = ty.optionalChild(zcu);
1541 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1542 // Just use a bool.
1543 // Note: Always generate the bool with indirect format, to save on some sanity
1544 // Perform the conversion to a direct bool when the field is extracted.
1545 return try cg.resolveType(.bool, .indirect);
1546 }
1547
1548 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1549 if (ty.optionalReprIsPayload(zcu)) {
1550 // Optional is actually a pointer or a slice.
1551 return payload_ty_id;
1552 }
1553
1554 const bool_ty_id = try cg.resolveType(.bool, .indirect);
1555
1556 return try cg.module.structType(
1557 &.{ payload_ty_id, bool_ty_id },
1558 &.{ "payload", "valid" },
1559 null,
1560 .none,
1561 );
1562 },
1563 .@"union" => return try cg.resolveUnionType(ty),
1564 .error_set => {
1565 const err_int_ty = try pt.errorIntType();
1566 return try cg.resolveType(err_int_ty, repr);
1567 },
1568 .error_union => {
1569 const payload_ty = ty.errorUnionPayload(zcu);
1570 const err_ty = ty.errorUnionSet(zcu);
1571 const error_ty_id = try cg.resolveType(err_ty, .indirect);
1572
1573 const eu_layout = cg.errorUnionLayout(payload_ty);
1574 if (!eu_layout.payload_has_bits) {
1575 return error_ty_id;
1576 }
1577
1578 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1579
1580 var member_types: [2]Id = undefined;
1581 var member_names: [2][]const u8 = undefined;
1582 if (eu_layout.error_first) {
1583 // Put the error first
1584 member_types = .{ error_ty_id, payload_ty_id };
1585 member_names = .{ "error", "payload" };
1586 // TODO: ABI padding?
1587 } else {
1588 // Put the payload first.
1589 member_types = .{ payload_ty_id, error_ty_id };
1590 member_names = .{ "payload", "error" };
1591 // TODO: ABI padding?
1592 }
1593
1594 return try cg.module.structType(&member_types, &member_names, null, .none);
1595 },
1596 .@"opaque" => {
1597 const type_name = try cg.resolveTypeName(ty);
1598 defer gpa.free(type_name);
1599 return try cg.module.opaqueType(type_name);
1600 },
1601
1602 .null,
1603 .undefined,
1604 .enum_literal,
1605 .comptime_float,
1606 .comptime_int,
1607 .type,
1608 => unreachable, // Must be comptime.
1609
1610 .frame, .@"anyframe" => unreachable, // TODO
1611 }
1612}
1613
1614const ErrorUnionLayout = struct {
1615 payload_has_bits: bool,
1616 error_first: bool,
1617
1618 fn errorFieldIndex(cg: @This()) u32 {
1619 assert(cg.payload_has_bits);
1620 return if (cg.error_first) 0 else 1;
1621 }
1622
1623 fn payloadFieldIndex(cg: @This()) u32 {
1624 assert(cg.payload_has_bits);
1625 return if (cg.error_first) 1 else 0;
1626 }
1627};
1628
1629fn errorUnionLayout(cg: *CodeGen, payload_ty: Type) ErrorUnionLayout {
1630 const zcu = cg.module.zcu;
1631
1632 const error_align = Type.abiAlignment(.anyerror, zcu);
1633 const payload_align = payload_ty.abiAlignment(zcu);
1634
1635 const error_first = error_align.compare(.gt, payload_align);
1636 return .{
1637 .payload_has_bits = payload_ty.hasRuntimeBitsIgnoreComptime(zcu),
1638 .error_first = error_first,
1639 };
1640}
1641
1642const UnionLayout = struct {
1643 /// If false, this union is represented
1644 /// by only an integer of the tag type.
1645 has_payload: bool,
1646 tag_size: u32,
1647 tag_index: u32,
1648 /// Note: This is the size of the payload type itcg, NOT the size of the ENTIRE payload.
1649 /// Use `has_payload` instead!!
1650 payload_ty: Type,
1651 payload_size: u32,
1652 payload_index: u32,
1653 payload_padding_size: u32,
1654 payload_padding_index: u32,
1655 padding_size: u32,
1656 padding_index: u32,
1657 total_fields: u32,
1658};
1659
1660fn unionLayout(cg: *CodeGen, ty: Type) UnionLayout {
1661 const zcu = cg.module.zcu;
1662 const ip = &zcu.intern_pool;
1663 const layout = ty.unionGetLayout(zcu);
1664 const union_obj = zcu.typeToUnion(ty).?;
1665
1666 var union_layout: UnionLayout = .{
1667 .has_payload = layout.payload_size != 0,
1668 .tag_size = @intCast(layout.tag_size),
1669 .tag_index = undefined,
1670 .payload_ty = undefined,
1671 .payload_size = undefined,
1672 .payload_index = undefined,
1673 .payload_padding_size = undefined,
1674 .payload_padding_index = undefined,
1675 .padding_size = @intCast(layout.padding),
1676 .padding_index = undefined,
1677 .total_fields = undefined,
1678 };
1679
1680 if (union_layout.has_payload) {
1681 const most_aligned_field = layout.most_aligned_field;
1682 const most_aligned_field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[most_aligned_field]);
1683 union_layout.payload_ty = most_aligned_field_ty;
1684 union_layout.payload_size = @intCast(most_aligned_field_ty.abiSize(zcu));
1685 } else {
1686 union_layout.payload_size = 0;
1687 }
1688
1689 union_layout.payload_padding_size = @intCast(layout.payload_size - union_layout.payload_size);
1690
1691 const tag_first = layout.tag_align.compare(.gte, layout.payload_align);
1692 var field_index: u32 = 0;
1693
1694 if (union_layout.tag_size != 0 and tag_first) {
1695 union_layout.tag_index = field_index;
1696 field_index += 1;
1697 }
1698
1699 if (union_layout.payload_size != 0) {
1700 union_layout.payload_index = field_index;
1701 field_index += 1;
1702 }
1703
1704 if (union_layout.payload_padding_size != 0) {
1705 union_layout.payload_padding_index = field_index;
1706 field_index += 1;
1707 }
1708
1709 if (union_layout.tag_size != 0 and !tag_first) {
1710 union_layout.tag_index = field_index;
1711 field_index += 1;
1712 }
1713
1714 if (union_layout.padding_size != 0) {
1715 union_layout.padding_index = field_index;
1716 field_index += 1;
1717 }
1718
1719 union_layout.total_fields = field_index;
1720
1721 return union_layout;
1722}
1723
1724/// This structure represents a "temporary" value: Something we are currently
1725/// operating on. It typically lives no longer than the function that
1726/// implements a particular AIR operation. These are used to easier
1727/// implement vectorizable operations (see Vectorization and the build*
1728/// functions), and typically are only used for vectors of primitive types.
1729const Temporary = struct {
1730 /// The type of the temporary. This is here mainly
1731 /// for easier bookkeeping. Because we will never really
1732 /// store Temporaries, they only cause extra stack space,
1733 /// therefore no real storage is wasted.
1734 ty: Type,
1735 /// The value that this temporary holds. This is not necessarily
1736 /// a value that is actually usable, or a single value: It is virtual
1737 /// until materialize() is called, at which point is turned into
1738 /// the usual SPIR-V representation of `cg.ty`.
1739 value: Temporary.Value,
1740
1741 const Value = union(enum) {
1742 singleton: Id,
1743 exploded_vector: IdRange,
1744 };
1745
1746 fn init(ty: Type, singleton: Id) Temporary {
1747 return .{ .ty = ty, .value = .{ .singleton = singleton } };
1748 }
1749
1750 fn materialize(temp: Temporary, cg: *CodeGen) !Id {
1751 const gpa = cg.module.gpa;
1752 const zcu = cg.module.zcu;
1753 switch (temp.value) {
1754 .singleton => |id| return id,
1755 .exploded_vector => |range| {
1756 assert(temp.ty.isVector(zcu));
1757 assert(temp.ty.vectorLen(zcu) == range.len);
1758 const constituents = try gpa.alloc(Id, range.len);
1759 defer gpa.free(constituents);
1760 for (constituents, 0..range.len) |*id, i| {
1761 id.* = range.at(i);
1762 }
1763 const result_ty_id = try cg.resolveType(temp.ty, .direct);
1764 return cg.constructComposite(result_ty_id, constituents);
1765 },
1766 }
1767 }
1768
1769 fn vectorization(temp: Temporary, cg: *CodeGen) Vectorization {
1770 return .fromType(temp.ty, cg);
1771 }
1772
1773 fn pun(temp: Temporary, new_ty: Type) Temporary {
1774 return .{
1775 .ty = new_ty,
1776 .value = temp.value,
1777 };
1778 }
1779
1780 /// 'Explode' a temporary into separate elements. This turns a vector
1781 /// into a bag of elements.
1782 fn explode(temp: Temporary, cg: *CodeGen) !IdRange {
1783 const zcu = cg.module.zcu;
1784
1785 // If the value is a scalar, then this is a no-op.
1786 if (!temp.ty.isVector(zcu)) {
1787 return switch (temp.value) {
1788 .singleton => |id| .{ .base = @intFromEnum(id), .len = 1 },
1789 .exploded_vector => |range| range,
1790 };
1791 }
1792
1793 const ty_id = try cg.resolveType(temp.ty.scalarType(zcu), .direct);
1794 const n = temp.ty.vectorLen(zcu);
1795 const results = cg.module.allocIds(n);
1796
1797 const id = switch (temp.value) {
1798 .singleton => |id| id,
1799 .exploded_vector => |range| return range,
1800 };
1801
1802 for (0..n) |i| {
1803 const indexes = [_]u32{@intCast(i)};
1804 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
1805 .id_result_type = ty_id,
1806 .id_result = results.at(i),
1807 .composite = id,
1808 .indexes = &indexes,
1809 });
1810 }
1811
1812 return results;
1813 }
1814};
1815
1816/// Initialize a `Temporary` from an AIR value.
1817fn temporary(cg: *CodeGen, inst: Air.Inst.Ref) !Temporary {
1818 return .{
1819 .ty = cg.typeOf(inst),
1820 .value = .{ .singleton = try cg.resolve(inst) },
1821 };
1822}
1823
1824/// This union describes how a particular operation should be vectorized.
1825/// That depends on the operation and number of components of the inputs.
1826const Vectorization = union(enum) {
1827 /// This is an operation between scalars.
1828 scalar,
1829 /// This operation is unrolled into separate operations.
1830 /// Inputs may still be SPIR-V vectors, for example,
1831 /// when the operation can't be vectorized in SPIR-V.
1832 /// Value is number of components.
1833 unrolled: u32,
1834
1835 /// Derive a vectorization from a particular type
1836 fn fromType(ty: Type, cg: *CodeGen) Vectorization {
1837 const zcu = cg.module.zcu;
1838 if (!ty.isVector(zcu)) return .scalar;
1839 return .{ .unrolled = ty.vectorLen(zcu) };
1840 }
1841
1842 /// Given two vectorization methods, compute a "unification": a fallback
1843 /// that works for both, according to the following rules:
1844 /// - Scalars may broadcast
1845 /// - SPIR-V vectorized operations will unroll
1846 /// - Prefer scalar > unrolled
1847 fn unify(a: Vectorization, b: Vectorization) Vectorization {
1848 if (a == .scalar and b == .scalar) return .scalar;
1849 if (a == .unrolled or b == .unrolled) {
1850 if (a == .unrolled and b == .unrolled) assert(a.components() == b.components());
1851 if (a == .unrolled) return .{ .unrolled = a.components() };
1852 return .{ .unrolled = b.components() };
1853 }
1854 unreachable;
1855 }
1856
1857 /// Query the number of components that inputs of this operation have.
1858 /// Note: for broadcasting scalars, this returns the number of elements
1859 /// that the broadcasted vector would have.
1860 fn components(vec: Vectorization) u32 {
1861 return switch (vec) {
1862 .scalar => 1,
1863 .unrolled => |n| n,
1864 };
1865 }
1866
1867 /// Turns `ty` into the result-type of the entire operation.
1868 /// `ty` may be a scalar or vector, it doesn't matter.
1869 fn resultType(vec: Vectorization, cg: *CodeGen, ty: Type) !Type {
1870 const pt = cg.pt;
1871 const zcu = cg.module.zcu;
1872 const scalar_ty = ty.scalarType(zcu);
1873 return switch (vec) {
1874 .scalar => scalar_ty,
1875 .unrolled => |n| try pt.vectorType(.{ .len = n, .child = scalar_ty.toIntern() }),
1876 };
1877 }
1878
1879 /// Before a temporary can be used, some setup may need to be one. This function implements
1880 /// this setup, and returns a new type that holds the relevant information on how to access
1881 /// elements of the input.
1882 fn prepare(vec: Vectorization, cg: *CodeGen, tmp: Temporary) !PreparedOperand {
1883 const zcu = cg.module.zcu;
1884 const is_vector = tmp.ty.isVector(zcu);
1885 const value: PreparedOperand.Value = switch (tmp.value) {
1886 .singleton => |id| switch (vec) {
1887 .scalar => blk: {
1888 assert(!is_vector);
1889 break :blk .{ .scalar = id };
1890 },
1891 .unrolled => blk: {
1892 if (is_vector) break :blk .{ .vector_exploded = try tmp.explode(cg) };
1893 break :blk .{ .scalar_broadcast = id };
1894 },
1895 },
1896 .exploded_vector => |range| switch (vec) {
1897 .scalar => unreachable,
1898 .unrolled => |n| blk: {
1899 assert(range.len == n);
1900 break :blk .{ .vector_exploded = range };
1901 },
1902 },
1903 };
1904
1905 return .{
1906 .ty = tmp.ty,
1907 .value = value,
1908 };
1909 }
1910
1911 /// Finalize the results of an operation back into a temporary. `results` is
1912 /// a list of result-ids of the operation.
1913 fn finalize(vec: Vectorization, ty: Type, results: IdRange) Temporary {
1914 assert(vec.components() == results.len);
1915 return .{
1916 .ty = ty,
1917 .value = switch (vec) {
1918 .scalar => .{ .singleton = results.at(0) },
1919 .unrolled => .{ .exploded_vector = results },
1920 },
1921 };
1922 }
1923
1924 /// This struct represents an operand that has gone through some setup, and is
1925 /// ready to be used as part of an operation.
1926 const PreparedOperand = struct {
1927 ty: Type,
1928 value: PreparedOperand.Value,
1929
1930 /// The types of value that a prepared operand can hold internally. Depends
1931 /// on the operation and input value.
1932 const Value = union(enum) {
1933 /// A single scalar value that is used by a scalar operation.
1934 scalar: Id,
1935 /// A single scalar that is broadcasted in an unrolled operation.
1936 scalar_broadcast: Id,
1937 /// A vector represented by a consecutive list of IDs that is used in an unrolled operation.
1938 vector_exploded: IdRange,
1939 };
1940
1941 /// Query the value at a particular index of the operation. Note that
1942 /// the index is *not* the component/lane, but the index of the *operation*.
1943 fn at(op: PreparedOperand, i: usize) Id {
1944 switch (op.value) {
1945 .scalar => |id| {
1946 assert(i == 0);
1947 return id;
1948 },
1949 .scalar_broadcast => |id| return id,
1950 .vector_exploded => |range| return range.at(i),
1951 }
1952 }
1953 };
1954};
1955
1956/// A utility function to compute the vectorization style of
1957/// a list of values. These values may be any of the following:
1958/// - A `Vectorization` instance
1959/// - A Type, in which case the vectorization is computed via `Vectorization.fromType`.
1960/// - A Temporary, in which case the vectorization is computed via `Temporary.vectorization`.
1961fn vectorization(cg: *CodeGen, args: anytype) Vectorization {
1962 var v: Vectorization = undefined;
1963 assert(args.len >= 1);
1964 inline for (args, 0..) |arg, i| {
1965 const iv: Vectorization = switch (@TypeOf(arg)) {
1966 Vectorization => arg,
1967 Type => Vectorization.fromType(arg, cg),
1968 Temporary => arg.vectorization(cg),
1969 else => @compileError("invalid type"),
1970 };
1971 if (i == 0) {
1972 v = iv;
1973 } else {
1974 v = v.unify(iv);
1975 }
1976 }
1977 return v;
1978}
1979
1980/// This function builds an OpSConvert of OpUConvert depending on the
1981/// signedness of the types.
1982fn buildConvert(cg: *CodeGen, dst_ty: Type, src: Temporary) !Temporary {
1983 const zcu = cg.module.zcu;
1984
1985 const dst_ty_id = try cg.resolveType(dst_ty.scalarType(zcu), .direct);
1986 const src_ty_id = try cg.resolveType(src.ty.scalarType(zcu), .direct);
1987
1988 const v = cg.vectorization(.{ dst_ty, src });
1989 const result_ty = try v.resultType(cg, dst_ty);
1990
1991 // We can directly compare integers, because those type-IDs are cached.
1992 if (dst_ty_id == src_ty_id) {
1993 // Nothing to do, type-pun to the right value.
1994 // Note, Caller guarantees that the types fit (or caller will normalize after),
1995 // so we don't have to normalize here.
1996 // Note, dst_ty may be a scalar type even if we expect a vector, so we have to
1997 // convert to the right type here.
1998 return src.pun(result_ty);
1999 }
2000
2001 const ops = v.components();
2002 const results = cg.module.allocIds(ops);
2003
2004 const op_result_ty = dst_ty.scalarType(zcu);
2005 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2006
2007 const opcode: Opcode = blk: {
2008 if (dst_ty.scalarType(zcu).isAnyFloat()) break :blk .OpFConvert;
2009 if (dst_ty.scalarType(zcu).isSignedInt(zcu)) break :blk .OpSConvert;
2010 break :blk .OpUConvert;
2011 };
2012
2013 const op_src = try v.prepare(cg, src);
2014
2015 for (0..ops) |i| {
2016 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2017 cg.body.writeOperand(Id, op_result_ty_id);
2018 cg.body.writeOperand(Id, results.at(i));
2019 cg.body.writeOperand(Id, op_src.at(i));
2020 }
2021
2022 return v.finalize(result_ty, results);
2023}
2024
2025fn buildFma(cg: *CodeGen, a: Temporary, b: Temporary, c: Temporary) !Temporary {
2026 const zcu = cg.module.zcu;
2027 const target = cg.module.zcu.getTarget();
2028
2029 const v = cg.vectorization(.{ a, b, c });
2030 const ops = v.components();
2031 const results = cg.module.allocIds(ops);
2032
2033 const op_result_ty = a.ty.scalarType(zcu);
2034 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2035 const result_ty = try v.resultType(cg, a.ty);
2036
2037 const op_a = try v.prepare(cg, a);
2038 const op_b = try v.prepare(cg, b);
2039 const op_c = try v.prepare(cg, c);
2040
2041 const set = try cg.importExtendedSet();
2042
2043 // TODO: Put these numbers in some definition
2044 const instruction: u32 = switch (target.os.tag) {
2045 .opencl => 26, // fma
2046 // NOTE: Vulkan's FMA instruction does *NOT* produce the right values!
2047 // its precision guarantees do NOT match zigs and it does NOT match OpenCLs!
2048 // it needs to be emulated!
2049 .vulkan, .opengl => return cg.todo("implement fma operation for {s} os", .{@tagName(target.os.tag)}),
2050 else => unreachable,
2051 };
2052
2053 for (0..ops) |i| {
2054 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2055 .id_result_type = op_result_ty_id,
2056 .id_result = results.at(i),
2057 .set = set,
2058 .instruction = .{ .inst = instruction },
2059 .id_ref_4 = &.{ op_a.at(i), op_b.at(i), op_c.at(i) },
2060 });
2061 }
2062
2063 return v.finalize(result_ty, results);
2064}
2065
2066fn buildSelect(cg: *CodeGen, condition: Temporary, lhs: Temporary, rhs: Temporary) !Temporary {
2067 const zcu = cg.module.zcu;
2068
2069 const v = cg.vectorization(.{ condition, lhs, rhs });
2070 const ops = v.components();
2071 const results = cg.module.allocIds(ops);
2072
2073 const op_result_ty = lhs.ty.scalarType(zcu);
2074 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2075 const result_ty = try v.resultType(cg, lhs.ty);
2076
2077 assert(condition.ty.scalarType(zcu).zigTypeTag(zcu) == .bool);
2078
2079 const cond = try v.prepare(cg, condition);
2080 const object_1 = try v.prepare(cg, lhs);
2081 const object_2 = try v.prepare(cg, rhs);
2082
2083 for (0..ops) |i| {
2084 try cg.body.emit(cg.module.gpa, .OpSelect, .{
2085 .id_result_type = op_result_ty_id,
2086 .id_result = results.at(i),
2087 .condition = cond.at(i),
2088 .object_1 = object_1.at(i),
2089 .object_2 = object_2.at(i),
2090 });
2091 }
2092
2093 return v.finalize(result_ty, results);
2094}
2095
2096fn buildCmp(cg: *CodeGen, opcode: Opcode, lhs: Temporary, rhs: Temporary) !Temporary {
2097 const v = cg.vectorization(.{ lhs, rhs });
2098 const ops = v.components();
2099 const results = cg.module.allocIds(ops);
2100
2101 const op_result_ty: Type = .bool;
2102 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2103 const result_ty = try v.resultType(cg, Type.bool);
2104
2105 const op_lhs = try v.prepare(cg, lhs);
2106 const op_rhs = try v.prepare(cg, rhs);
2107
2108 for (0..ops) |i| {
2109 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2110 cg.body.writeOperand(Id, op_result_ty_id);
2111 cg.body.writeOperand(Id, results.at(i));
2112 cg.body.writeOperand(Id, op_lhs.at(i));
2113 cg.body.writeOperand(Id, op_rhs.at(i));
2114 }
2115
2116 return v.finalize(result_ty, results);
2117}
2118
2119const UnaryOp = enum {
2120 l_not,
2121 bit_not,
2122 i_neg,
2123 f_neg,
2124 i_abs,
2125 f_abs,
2126 clz,
2127 ctz,
2128 floor,
2129 ceil,
2130 trunc,
2131 round,
2132 sqrt,
2133 sin,
2134 cos,
2135 tan,
2136 exp,
2137 exp2,
2138 log,
2139 log2,
2140 log10,
2141};
2142
2143fn buildUnary(cg: *CodeGen, op: UnaryOp, operand: Temporary) !Temporary {
2144 const zcu = cg.module.zcu;
2145 const target = cg.module.zcu.getTarget();
2146 const v = cg.vectorization(.{operand});
2147 const ops = v.components();
2148 const results = cg.module.allocIds(ops);
2149 const op_result_ty = operand.ty.scalarType(zcu);
2150 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2151 const result_ty = try v.resultType(cg, operand.ty);
2152
2153 const op_operand = try v.prepare(cg, operand);
2154
2155 if (switch (op) {
2156 .l_not => .OpLogicalNot,
2157 .bit_not => .OpNot,
2158 .i_neg => .OpSNegate,
2159 .f_neg => .OpFNegate,
2160 else => @as(?Opcode, null),
2161 }) |opcode| {
2162 for (0..ops) |i| {
2163 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2164 cg.body.writeOperand(Id, op_result_ty_id);
2165 cg.body.writeOperand(Id, results.at(i));
2166 cg.body.writeOperand(Id, op_operand.at(i));
2167 }
2168 } else {
2169 const set = try cg.importExtendedSet();
2170 const extinst: u32 = switch (target.os.tag) {
2171 .opencl => switch (op) {
2172 .i_abs => 141, // s_abs
2173 .f_abs => 23, // fabs
2174 .clz => 151, // clz
2175 .ctz => 152, // ctz
2176 .floor => 25, // floor
2177 .ceil => 12, // ceil
2178 .trunc => 66, // trunc
2179 .round => 55, // round
2180 .sqrt => 61, // sqrt
2181 .sin => 57, // sin
2182 .cos => 14, // cos
2183 .tan => 62, // tan
2184 .exp => 19, // exp
2185 .exp2 => 20, // exp2
2186 .log => 37, // log
2187 .log2 => 38, // log2
2188 .log10 => 39, // log10
2189 else => unreachable,
2190 },
2191 // Note: We'll need to check these for floating point accuracy
2192 // Vulkan does not put tight requirements on these, for correction
2193 // we might want to emulate them at some point.
2194 .vulkan, .opengl => switch (op) {
2195 .i_abs => 5, // SAbs
2196 .f_abs => 4, // FAbs
2197 .floor => 8, // Floor
2198 .ceil => 9, // Ceil
2199 .trunc => 3, // Trunc
2200 .round => 1, // Round
2201 .clz,
2202 .ctz,
2203 .sqrt,
2204 .sin,
2205 .cos,
2206 .tan,
2207 .exp,
2208 .exp2,
2209 .log,
2210 .log2,
2211 .log10,
2212 => return cg.todo(
2213 "implement unary operation '{s}' for {s} os",
2214 .{ @tagName(op), @tagName(target.os.tag) },
2215 ),
2216 else => unreachable,
2217 },
2218 else => unreachable,
2219 };
2220
2221 for (0..ops) |i| {
2222 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2223 .id_result_type = op_result_ty_id,
2224 .id_result = results.at(i),
2225 .set = set,
2226 .instruction = .{ .inst = extinst },
2227 .id_ref_4 = &.{op_operand.at(i)},
2228 });
2229 }
2230 }
2231
2232 return v.finalize(result_ty, results);
2233}
2234
2235fn buildBinary(cg: *CodeGen, opcode: Opcode, lhs: Temporary, rhs: Temporary) !Temporary {
2236 const zcu = cg.module.zcu;
2237
2238 const v = cg.vectorization(.{ lhs, rhs });
2239 const ops = v.components();
2240 const results = cg.module.allocIds(ops);
2241
2242 const op_result_ty = lhs.ty.scalarType(zcu);
2243 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2244 const result_ty = try v.resultType(cg, lhs.ty);
2245
2246 const op_lhs = try v.prepare(cg, lhs);
2247 const op_rhs = try v.prepare(cg, rhs);
2248
2249 for (0..ops) |i| {
2250 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2251 cg.body.writeOperand(Id, op_result_ty_id);
2252 cg.body.writeOperand(Id, results.at(i));
2253 cg.body.writeOperand(Id, op_lhs.at(i));
2254 cg.body.writeOperand(Id, op_rhs.at(i));
2255 }
2256
2257 return v.finalize(result_ty, results);
2258}
2259
2260/// This function builds an extended multiplication, either OpSMulExtended or OpUMulExtended on Vulkan,
2261/// or OpIMul and s_mul_hi or u_mul_hi on OpenCL.
2262fn buildWideMul(
2263 cg: *CodeGen,
2264 signedness: std.builtin.Signedness,
2265 lhs: Temporary,
2266 rhs: Temporary,
2267) !struct { Temporary, Temporary } {
2268 const pt = cg.pt;
2269 const zcu = cg.module.zcu;
2270 const target = cg.module.zcu.getTarget();
2271 const ip = &zcu.intern_pool;
2272
2273 const v = lhs.vectorization(cg).unify(rhs.vectorization(cg));
2274 const ops = v.components();
2275
2276 const arith_op_ty = lhs.ty.scalarType(zcu);
2277 const arith_op_ty_id = try cg.resolveType(arith_op_ty, .direct);
2278
2279 const lhs_op = try v.prepare(cg, lhs);
2280 const rhs_op = try v.prepare(cg, rhs);
2281
2282 const value_results = cg.module.allocIds(ops);
2283 const overflow_results = cg.module.allocIds(ops);
2284
2285 switch (target.os.tag) {
2286 .opencl => {
2287 // Currently, SPIRV-LLVM-Translator based backends cannot deal with OpSMulExtended and
2288 // OpUMulExtended. For these we will use the OpenCL s_mul_hi to compute the high-order bits
2289 // instead.
2290 const set = try cg.importExtendedSet();
2291 const overflow_inst: u32 = switch (signedness) {
2292 .signed => 160, // s_mul_hi
2293 .unsigned => 203, // u_mul_hi
2294 };
2295
2296 for (0..ops) |i| {
2297 try cg.body.emit(cg.module.gpa, .OpIMul, .{
2298 .id_result_type = arith_op_ty_id,
2299 .id_result = value_results.at(i),
2300 .operand_1 = lhs_op.at(i),
2301 .operand_2 = rhs_op.at(i),
2302 });
2303
2304 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2305 .id_result_type = arith_op_ty_id,
2306 .id_result = overflow_results.at(i),
2307 .set = set,
2308 .instruction = .{ .inst = overflow_inst },
2309 .id_ref_4 = &.{ lhs_op.at(i), rhs_op.at(i) },
2310 });
2311 }
2312 },
2313 .vulkan, .opengl => {
2314 // Operations return a struct{T, T}
2315 // where T is maybe vectorized.
2316 const op_result_ty: Type = .fromInterned(try ip.getTupleType(zcu.gpa, pt.tid, .{
2317 .types = &.{ arith_op_ty.toIntern(), arith_op_ty.toIntern() },
2318 .values = &.{ .none, .none },
2319 }));
2320 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2321
2322 const opcode: Opcode = switch (signedness) {
2323 .signed => .OpSMulExtended,
2324 .unsigned => .OpUMulExtended,
2325 };
2326
2327 for (0..ops) |i| {
2328 const op_result = cg.module.allocId();
2329
2330 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2331 cg.body.writeOperand(Id, op_result_ty_id);
2332 cg.body.writeOperand(Id, op_result);
2333 cg.body.writeOperand(Id, lhs_op.at(i));
2334 cg.body.writeOperand(Id, rhs_op.at(i));
2335
2336 // The above operation returns a struct. We might want to expand
2337 // Temporary to deal with the fact that these are structs eventually,
2338 // but for now, take the struct apart and return two separate vectors.
2339
2340 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2341 .id_result_type = arith_op_ty_id,
2342 .id_result = value_results.at(i),
2343 .composite = op_result,
2344 .indexes = &.{0},
2345 });
2346
2347 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2348 .id_result_type = arith_op_ty_id,
2349 .id_result = overflow_results.at(i),
2350 .composite = op_result,
2351 .indexes = &.{1},
2352 });
2353 }
2354 },
2355 else => unreachable,
2356 }
2357
2358 const result_ty = try v.resultType(cg, lhs.ty);
2359 return .{
2360 v.finalize(result_ty, value_results),
2361 v.finalize(result_ty, overflow_results),
2362 };
2363}
2364
2365/// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure.
2366/// In order to be able to run tests, we "temporarily" lower test kernels into separate entry-
2367/// points. The test executor will then be able to invoke these to run the tests.
2368/// Note that tests are lowered according to std.builtin.TestFn, which is `fn () anyerror!void`.
2369/// (anyerror!void has the same layout as anyerror).
2370/// Each test declaration generates a function like.
2371/// %anyerror = OpTypeInt 0 16
2372/// %p_invocation_globals_struct_ty = ...
2373/// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror
2374/// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror
2375///
2376/// %test = OpFunction %void %K
2377/// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty
2378/// %p_err = OpFunctionParameter %p_anyerror
2379/// %lbl = OpLabel
2380/// %result = OpFunctionCall %anyerror %func %p_invocation_globals
2381/// OpStore %p_err %result
2382/// OpFunctionEnd
2383/// TODO is to also write out the error as a function call parameter, and to somehow fetch
2384/// the name of an error in the text executor.
2385fn generateTestEntryPoint(
2386 cg: *CodeGen,
2387 name: []const u8,
2388 spv_decl_index: Module.Decl.Index,
2389 test_id: Id,
2390) !void {
2391 const gpa = cg.module.gpa;
2392 const zcu = cg.module.zcu;
2393 const target = cg.module.zcu.getTarget();
2394
2395 const anyerror_ty_id = try cg.resolveType(.anyerror, .direct);
2396 const ptr_anyerror_ty = try cg.pt.ptrType(.{
2397 .child = .anyerror_type,
2398 .flags = .{ .address_space = .global },
2399 });
2400 const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct);
2401
2402 const kernel_id = cg.module.declPtr(spv_decl_index).result_id;
2403
2404 const section = &cg.module.sections.functions;
2405
2406 const p_error_id = cg.module.allocId();
2407 switch (target.os.tag) {
2408 .opencl, .amdhsa => {
2409 const void_ty_id = try cg.resolveType(.void, .direct);
2410 const kernel_proto_ty_id = try cg.module.functionType(void_ty_id, &.{ptr_anyerror_ty_id});
2411
2412 try section.emit(gpa, .OpFunction, .{
2413 .id_result_type = try cg.resolveType(.void, .direct),
2414 .id_result = kernel_id,
2415 .function_control = .{},
2416 .function_type = kernel_proto_ty_id,
2417 });
2418
2419 try section.emit(gpa, .OpFunctionParameter, .{
2420 .id_result_type = ptr_anyerror_ty_id,
2421 .id_result = p_error_id,
2422 });
2423
2424 try section.emit(gpa, .OpLabel, .{
2425 .id_result = cg.module.allocId(),
2426 });
2427 },
2428 .vulkan, .opengl => {
2429 if (cg.module.error_buffer == null) {
2430 const spv_err_decl_index = try cg.module.allocDecl(.global);
2431 try cg.module.declareDeclDeps(spv_err_decl_index, &.{});
2432
2433 const buffer_struct_ty_id = try cg.module.structType(
2434 &.{anyerror_ty_id},
2435 &.{"error_out"},
2436 null,
2437 .none,
2438 );
2439 try cg.module.decorate(buffer_struct_ty_id, .block);
2440 try cg.module.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });
2441
2442 const ptr_buffer_struct_ty_id = cg.module.allocId();
2443 try cg.module.sections.globals.emit(gpa, .OpTypePointer, .{
2444 .id_result = ptr_buffer_struct_ty_id,
2445 .storage_class = cg.module.storageClass(.global),
2446 .type = buffer_struct_ty_id,
2447 });
2448
2449 const buffer_struct_id = cg.module.declPtr(spv_err_decl_index).result_id;
2450 try cg.module.sections.globals.emit(gpa, .OpVariable, .{
2451 .id_result_type = ptr_buffer_struct_ty_id,
2452 .id_result = buffer_struct_id,
2453 .storage_class = cg.module.storageClass(.global),
2454 });
2455 try cg.module.decorate(buffer_struct_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });
2456 try cg.module.decorate(buffer_struct_id, .{ .binding = .{ .binding_point = 0 } });
2457
2458 cg.module.error_buffer = spv_err_decl_index;
2459 }
2460
2461 try cg.module.sections.execution_modes.emit(gpa, .OpExecutionMode, .{
2462 .entry_point = kernel_id,
2463 .mode = .{ .local_size = .{
2464 .x_size = 1,
2465 .y_size = 1,
2466 .z_size = 1,
2467 } },
2468 });
2469
2470 const void_ty_id = try cg.resolveType(.void, .direct);
2471 const kernel_proto_ty_id = try cg.module.functionType(void_ty_id, &.{});
2472 try section.emit(gpa, .OpFunction, .{
2473 .id_result_type = try cg.resolveType(.void, .direct),
2474 .id_result = kernel_id,
2475 .function_control = .{},
2476 .function_type = kernel_proto_ty_id,
2477 });
2478 try section.emit(gpa, .OpLabel, .{
2479 .id_result = cg.module.allocId(),
2480 });
2481
2482 const spv_err_decl_index = cg.module.error_buffer.?;
2483 const buffer_id = cg.module.declPtr(spv_err_decl_index).result_id;
2484 try cg.decl_deps.put(gpa, spv_err_decl_index, {});
2485
2486 const zero_id = try cg.constInt(.u32, 0);
2487 try section.emit(gpa, .OpInBoundsAccessChain, .{
2488 .id_result_type = ptr_anyerror_ty_id,
2489 .id_result = p_error_id,
2490 .base = buffer_id,
2491 .indexes = &.{zero_id},
2492 });
2493 },
2494 else => unreachable,
2495 }
2496
2497 const error_id = cg.module.allocId();
2498 try section.emit(gpa, .OpFunctionCall, .{
2499 .id_result_type = anyerror_ty_id,
2500 .id_result = error_id,
2501 .function = test_id,
2502 });
2503 // Note: Convert to direct not required.
2504 try section.emit(gpa, .OpStore, .{
2505 .pointer = p_error_id,
2506 .object = error_id,
2507 .memory_access = .{
2508 .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) },
2509 },
2510 });
2511 try section.emit(gpa, .OpReturn, {});
2512 try section.emit(gpa, .OpFunctionEnd, {});
2513
2514 // Just generate a quick other name because the intel runtime crashes when the entry-
2515 // point name is the same as a different OpName.
2516 const test_name = try std.fmt.allocPrint(cg.module.arena, "test {s}", .{name});
2517
2518 const execution_mode: spec.ExecutionModel = switch (target.os.tag) {
2519 .vulkan, .opengl => .gl_compute,
2520 .opencl, .amdhsa => .kernel,
2521 else => unreachable,
2522 };
2523
2524 try cg.module.declareEntryPoint(spv_decl_index, test_name, execution_mode, null);
2525}
2526
2527fn intFromBool(cg: *CodeGen, value: Temporary) !Temporary {
2528 return try cg.intFromBool2(value, Type.u1);
2529}
2530
2531fn intFromBool2(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary {
2532 const zero_id = try cg.constInt(result_ty, 0);
2533 const one_id = try cg.constInt(result_ty, 1);
2534
2535 return try cg.buildSelect(
2536 value,
2537 Temporary.init(result_ty, one_id),
2538 Temporary.init(result_ty, zero_id),
2539 );
2540}
2541
2542/// Convert representation from indirect (in memory) to direct (in 'register')
2543/// This converts the argument type from resolveType(ty, .indirect) to resolveType(ty, .direct).
2544fn convertToDirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2545 const pt = cg.pt;
2546 const zcu = cg.module.zcu;
2547 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2548 .bool => {
2549 const false_id = try cg.constBool(false, .indirect);
2550 const operand_ty = blk: {
2551 if (!ty.isVector(zcu)) break :blk Type.u1;
2552 break :blk try pt.vectorType(.{
2553 .len = ty.vectorLen(zcu),
2554 .child = .u1_type,
2555 });
2556 };
2557
2558 const result = try cg.buildCmp(
2559 .OpINotEqual,
2560 Temporary.init(operand_ty, operand_id),
2561 Temporary.init(.u1, false_id),
2562 );
2563 return try result.materialize(cg);
2564 },
2565 else => return operand_id,
2566 }
2567}
2568
2569/// Convert representation from direct (in 'register) to direct (in memory)
2570/// This converts the argument type from resolveType(ty, .direct) to resolveType(ty, .indirect).
2571fn convertToIndirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2572 const zcu = cg.module.zcu;
2573 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2574 .bool => {
2575 const result = try cg.intFromBool(Temporary.init(ty, operand_id));
2576 return try result.materialize(cg);
2577 },
2578 else => return operand_id,
2579 }
2580}
2581
2582fn extractField(cg: *CodeGen, result_ty: Type, object: Id, field: u32) !Id {
2583 const result_ty_id = try cg.resolveType(result_ty, .indirect);
2584 const result_id = cg.module.allocId();
2585 const indexes = [_]u32{field};
2586 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2587 .id_result_type = result_ty_id,
2588 .id_result = result_id,
2589 .composite = object,
2590 .indexes = &indexes,
2591 });
2592 // Convert bools; direct structs have their field types as indirect values.
2593 return try cg.convertToDirect(result_ty, result_id);
2594}
2595
2596fn extractVectorComponent(cg: *CodeGen, result_ty: Type, vector_id: Id, field: u32) !Id {
2597 const result_ty_id = try cg.resolveType(result_ty, .direct);
2598 const result_id = cg.module.allocId();
2599 const indexes = [_]u32{field};
2600 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2601 .id_result_type = result_ty_id,
2602 .id_result = result_id,
2603 .composite = vector_id,
2604 .indexes = &indexes,
2605 });
2606 // Vector components are already stored in direct representation.
2607 return result_id;
2608}
2609
2610const MemoryOptions = struct {
2611 is_volatile: bool = false,
2612};
2613
2614fn load(cg: *CodeGen, value_ty: Type, ptr_id: Id, options: MemoryOptions) !Id {
2615 const zcu = cg.module.zcu;
2616 const alignment: u32 = @intCast(value_ty.abiAlignment(zcu).toByteUnits().?);
2617 const indirect_value_ty_id = try cg.resolveType(value_ty, .indirect);
2618 const result_id = cg.module.allocId();
2619 const access: spec.MemoryAccess.Extended = .{
2620 .@"volatile" = options.is_volatile,
2621 .aligned = .{ .literal_integer = alignment },
2622 };
2623 try cg.body.emit(cg.module.gpa, .OpLoad, .{
2624 .id_result_type = indirect_value_ty_id,
2625 .id_result = result_id,
2626 .pointer = ptr_id,
2627 .memory_access = access,
2628 });
2629 return try cg.convertToDirect(value_ty, result_id);
2630}
2631
2632fn store(cg: *CodeGen, value_ty: Type, ptr_id: Id, value_id: Id, options: MemoryOptions) !void {
2633 const indirect_value_id = try cg.convertToIndirect(value_ty, value_id);
2634 const access: spec.MemoryAccess.Extended = .{ .@"volatile" = options.is_volatile };
2635 try cg.body.emit(cg.module.gpa, .OpStore, .{
2636 .pointer = ptr_id,
2637 .object = indirect_value_id,
2638 .memory_access = access,
2639 });
2640}
2641
2642fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) !void {
2643 for (body) |inst| {
2644 try cg.genInst(inst);
2645 }
2646}
2647
2648fn genInst(cg: *CodeGen, inst: Air.Inst.Index) Error!void {
2649 const gpa = cg.module.gpa;
2650 const zcu = cg.module.zcu;
2651 const ip = &zcu.intern_pool;
2652 if (cg.liveness.isUnused(inst) and !cg.air.mustLower(inst, ip))
2653 return;
2654
2655 const air_tags = cg.air.instructions.items(.tag);
2656 const maybe_result_id: ?Id = switch (air_tags[@intFromEnum(inst)]) {
2657 // zig fmt: off
2658 .add, .add_wrap, .add_optimized => try cg.airArithOp(inst, .OpFAdd, .OpIAdd, .OpIAdd),
2659 .sub, .sub_wrap, .sub_optimized => try cg.airArithOp(inst, .OpFSub, .OpISub, .OpISub),
2660 .mul, .mul_wrap, .mul_optimized => try cg.airArithOp(inst, .OpFMul, .OpIMul, .OpIMul),
2661
2662 .sqrt => try cg.airUnOpSimple(inst, .sqrt),
2663 .sin => try cg.airUnOpSimple(inst, .sin),
2664 .cos => try cg.airUnOpSimple(inst, .cos),
2665 .tan => try cg.airUnOpSimple(inst, .tan),
2666 .exp => try cg.airUnOpSimple(inst, .exp),
2667 .exp2 => try cg.airUnOpSimple(inst, .exp2),
2668 .log => try cg.airUnOpSimple(inst, .log),
2669 .log2 => try cg.airUnOpSimple(inst, .log2),
2670 .log10 => try cg.airUnOpSimple(inst, .log10),
2671 .abs => try cg.airAbs(inst),
2672 .floor => try cg.airUnOpSimple(inst, .floor),
2673 .ceil => try cg.airUnOpSimple(inst, .ceil),
2674 .round => try cg.airUnOpSimple(inst, .round),
2675 .trunc_float => try cg.airUnOpSimple(inst, .trunc),
2676 .neg, .neg_optimized => try cg.airUnOpSimple(inst, .f_neg),
2677
2678 .div_float, .div_float_optimized => try cg.airArithOp(inst, .OpFDiv, .OpSDiv, .OpUDiv),
2679 .div_floor, .div_floor_optimized => try cg.airDivFloor(inst),
2680 .div_trunc, .div_trunc_optimized => try cg.airDivTrunc(inst),
2681
2682 .rem, .rem_optimized => try cg.airArithOp(inst, .OpFRem, .OpSRem, .OpUMod),
2683 .mod, .mod_optimized => try cg.airArithOp(inst, .OpFMod, .OpSMod, .OpUMod),
2684
2685 .add_with_overflow => try cg.airAddSubOverflow(inst, .OpIAdd, .OpULessThan, .OpSLessThan),
2686 .sub_with_overflow => try cg.airAddSubOverflow(inst, .OpISub, .OpUGreaterThan, .OpSGreaterThan),
2687 .mul_with_overflow => try cg.airMulOverflow(inst),
2688 .shl_with_overflow => try cg.airShlOverflow(inst),
2689
2690 .mul_add => try cg.airMulAdd(inst),
2691
2692 .ctz => try cg.airClzCtz(inst, .ctz),
2693 .clz => try cg.airClzCtz(inst, .clz),
2694
2695 .select => try cg.airSelect(inst),
2696
2697 .splat => try cg.airSplat(inst),
2698 .reduce, .reduce_optimized => try cg.airReduce(inst),
2699 .shuffle_one => try cg.airShuffleOne(inst),
2700 .shuffle_two => try cg.airShuffleTwo(inst),
2701
2702 .ptr_add => try cg.airPtrAdd(inst),
2703 .ptr_sub => try cg.airPtrSub(inst),
2704
2705 .bit_and => try cg.airBinOpSimple(inst, .OpBitwiseAnd),
2706 .bit_or => try cg.airBinOpSimple(inst, .OpBitwiseOr),
2707 .xor => try cg.airBinOpSimple(inst, .OpBitwiseXor),
2708 .bool_and => try cg.airBinOpSimple(inst, .OpLogicalAnd),
2709 .bool_or => try cg.airBinOpSimple(inst, .OpLogicalOr),
2710
2711 .shl, .shl_exact => try cg.airShift(inst, .OpShiftLeftLogical, .OpShiftLeftLogical),
2712 .shr, .shr_exact => try cg.airShift(inst, .OpShiftRightLogical, .OpShiftRightArithmetic),
2713
2714 .min => try cg.airMinMax(inst, .min),
2715 .max => try cg.airMinMax(inst, .max),
2716
2717 .bitcast => try cg.airBitCast(inst),
2718 .intcast, .trunc => try cg.airIntCast(inst),
2719 .float_from_int => try cg.airFloatFromInt(inst),
2720 .int_from_float => try cg.airIntFromFloat(inst),
2721 .fpext, .fptrunc => try cg.airFloatCast(inst),
2722 .not => try cg.airNot(inst),
2723
2724 .array_to_slice => try cg.airArrayToSlice(inst),
2725 .slice => try cg.airSlice(inst),
2726 .aggregate_init => try cg.airAggregateInit(inst),
2727 .memcpy => return cg.airMemcpy(inst),
2728 .memmove => return cg.airMemmove(inst),
2729
2730 .slice_ptr => try cg.airSliceField(inst, 0),
2731 .slice_len => try cg.airSliceField(inst, 1),
2732 .slice_elem_ptr => try cg.airSliceElemPtr(inst),
2733 .slice_elem_val => try cg.airSliceElemVal(inst),
2734 .ptr_elem_ptr => try cg.airPtrElemPtr(inst),
2735 .ptr_elem_val => try cg.airPtrElemVal(inst),
2736 .array_elem_val => try cg.airArrayElemVal(inst),
2737
2738 .vector_store_elem => return cg.airVectorStoreElem(inst),
2739
2740 .set_union_tag => return cg.airSetUnionTag(inst),
2741 .get_union_tag => try cg.airGetUnionTag(inst),
2742 .union_init => try cg.airUnionInit(inst),
2743
2744 .struct_field_val => try cg.airStructFieldVal(inst),
2745 .field_parent_ptr => try cg.airFieldParentPtr(inst),
2746
2747 .struct_field_ptr_index_0 => try cg.airStructFieldPtrIndex(inst, 0),
2748 .struct_field_ptr_index_1 => try cg.airStructFieldPtrIndex(inst, 1),
2749 .struct_field_ptr_index_2 => try cg.airStructFieldPtrIndex(inst, 2),
2750 .struct_field_ptr_index_3 => try cg.airStructFieldPtrIndex(inst, 3),
2751
2752 .cmp_eq => try cg.airCmp(inst, .eq),
2753 .cmp_neq => try cg.airCmp(inst, .neq),
2754 .cmp_gt => try cg.airCmp(inst, .gt),
2755 .cmp_gte => try cg.airCmp(inst, .gte),
2756 .cmp_lt => try cg.airCmp(inst, .lt),
2757 .cmp_lte => try cg.airCmp(inst, .lte),
2758 .cmp_vector => try cg.airVectorCmp(inst),
2759
2760 .arg => cg.airArg(),
2761 .alloc => try cg.airAlloc(inst),
2762 // TODO: We probably need to have a special implementation of this for the C abi.
2763 .ret_ptr => try cg.airAlloc(inst),
2764 .block => try cg.airBlock(inst),
2765
2766 .load => try cg.airLoad(inst),
2767 .store, .store_safe => return cg.airStore(inst),
2768
2769 .br => return cg.airBr(inst),
2770 // For now just ignore this instruction. This effectively falls back on the old implementation,
2771 // this doesn't change anything for us.
2772 .repeat => return,
2773 .breakpoint => return,
2774 .cond_br => return cg.airCondBr(inst),
2775 .loop => return cg.airLoop(inst),
2776 .ret => return cg.airRet(inst),
2777 .ret_safe => return cg.airRet(inst), // TODO
2778 .ret_load => return cg.airRetLoad(inst),
2779 .@"try" => try cg.airTry(inst),
2780 .switch_br => return cg.airSwitchBr(inst),
2781 .unreach, .trap => return cg.airUnreach(),
2782
2783 .dbg_empty_stmt => return,
2784 .dbg_stmt => return cg.airDbgStmt(inst),
2785 .dbg_inline_block => try cg.airDbgInlineBlock(inst),
2786 .dbg_var_ptr, .dbg_var_val, .dbg_arg_inline => return cg.airDbgVar(inst),
2787
2788 .unwrap_errunion_err => try cg.airErrUnionErr(inst),
2789 .unwrap_errunion_payload => try cg.airErrUnionPayload(inst),
2790 .wrap_errunion_err => try cg.airWrapErrUnionErr(inst),
2791 .wrap_errunion_payload => try cg.airWrapErrUnionPayload(inst),
2792
2793 .is_null => try cg.airIsNull(inst, false, .is_null),
2794 .is_non_null => try cg.airIsNull(inst, false, .is_non_null),
2795 .is_null_ptr => try cg.airIsNull(inst, true, .is_null),
2796 .is_non_null_ptr => try cg.airIsNull(inst, true, .is_non_null),
2797 .is_err => try cg.airIsErr(inst, .is_err),
2798 .is_non_err => try cg.airIsErr(inst, .is_non_err),
2799
2800 .optional_payload => try cg.airUnwrapOptional(inst),
2801 .optional_payload_ptr => try cg.airUnwrapOptionalPtr(inst),
2802 .wrap_optional => try cg.airWrapOptional(inst),
2803
2804 .assembly => try cg.airAssembly(inst),
2805
2806 .call => try cg.airCall(inst, .auto),
2807 .call_always_tail => try cg.airCall(inst, .always_tail),
2808 .call_never_tail => try cg.airCall(inst, .never_tail),
2809 .call_never_inline => try cg.airCall(inst, .never_inline),
2810
2811 .work_item_id => try cg.airWorkItemId(inst),
2812 .work_group_size => try cg.airWorkGroupSize(inst),
2813 .work_group_id => try cg.airWorkGroupId(inst),
2814
2815 // zig fmt: on
2816
2817 else => |tag| return cg.todo("implement AIR tag {s}", .{@tagName(tag)}),
2818 };
2819
2820 const result_id = maybe_result_id orelse return;
2821 try cg.inst_results.putNoClobber(gpa, inst, result_id);
2822}
2823
2824fn airBinOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: Opcode) !?Id {
2825 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2826 const lhs = try cg.temporary(bin_op.lhs);
2827 const rhs = try cg.temporary(bin_op.rhs);
2828
2829 const result = try cg.buildBinary(op, lhs, rhs);
2830 return try result.materialize(cg);
2831}
2832
2833fn airShift(cg: *CodeGen, inst: Air.Inst.Index, unsigned: Opcode, signed: Opcode) !?Id {
2834 const zcu = cg.module.zcu;
2835 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2836
2837 if (cg.typeOf(bin_op.lhs).isVector(zcu) and !cg.typeOf(bin_op.rhs).isVector(zcu)) {
2838 return cg.fail("vector shift with scalar rhs", .{});
2839 }
2840
2841 const base = try cg.temporary(bin_op.lhs);
2842 const shift = try cg.temporary(bin_op.rhs);
2843
2844 const result_ty = cg.typeOfIndex(inst);
2845
2846 const info = cg.arithmeticTypeInfo(result_ty);
2847 switch (info.class) {
2848 .composite_integer => return cg.todo("shift ops for composite integers", .{}),
2849 .integer, .strange_integer => {},
2850 .float, .bool => unreachable,
2851 }
2852
2853 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
2854 // so just manually upcast it if required.
2855
2856 // Note: The sign may differ here between the shift and the base type, in case
2857 // of an arithmetic right shift. SPIR-V still expects the same type,
2858 // so in that case we have to cast convert to signed.
2859 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
2860
2861 const shifted = switch (info.signedness) {
2862 .unsigned => try cg.buildBinary(unsigned, base, casted_shift),
2863 .signed => try cg.buildBinary(signed, base, casted_shift),
2864 };
2865
2866 const result = try cg.normalize(shifted, info);
2867 return try result.materialize(cg);
2868}
2869
2870const MinMax = enum { min, max };
2871
2872fn airMinMax(cg: *CodeGen, inst: Air.Inst.Index, op: MinMax) !?Id {
2873 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2874
2875 const lhs = try cg.temporary(bin_op.lhs);
2876 const rhs = try cg.temporary(bin_op.rhs);
2877
2878 const result = try cg.minMax(lhs, rhs, op);
2879 return try result.materialize(cg);
2880}
2881
2882fn minMax(cg: *CodeGen, lhs: Temporary, rhs: Temporary, op: MinMax) !Temporary {
2883 const zcu = cg.module.zcu;
2884 const target = zcu.getTarget();
2885 const info = cg.arithmeticTypeInfo(lhs.ty);
2886
2887 const v = cg.vectorization(.{ lhs, rhs });
2888 const ops = v.components();
2889 const results = cg.module.allocIds(ops);
2890
2891 const op_result_ty = lhs.ty.scalarType(zcu);
2892 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2893 const result_ty = try v.resultType(cg, lhs.ty);
2894
2895 const op_lhs = try v.prepare(cg, lhs);
2896 const op_rhs = try v.prepare(cg, rhs);
2897
2898 const ext_inst: u32 = switch (target.os.tag) {
2899 .opencl => switch (info.class) {
2900 .float => switch (op) {
2901 .min => 28, // fmin
2902 .max => 27, // fmax
2903 },
2904 .integer,
2905 .strange_integer,
2906 .composite_integer,
2907 => switch (info.signedness) {
2908 .signed => switch (op) {
2909 .min => 158, // s_min
2910 .max => 156, // s_max
2911 },
2912 .unsigned => switch (op) {
2913 .min => 159, // u_min
2914 .max => 157, // u_max
2915 },
2916 },
2917 .bool => unreachable,
2918 },
2919 .vulkan, .opengl => switch (info.class) {
2920 .float => switch (op) {
2921 .min => 37, // FMin
2922 .max => 40, // FMax
2923 },
2924 .integer,
2925 .strange_integer,
2926 .composite_integer,
2927 => switch (info.signedness) {
2928 .signed => switch (op) {
2929 .min => 39, // SMin
2930 .max => 42, // SMax
2931 },
2932 .unsigned => switch (op) {
2933 .min => 38, // UMin
2934 .max => 41, // UMax
2935 },
2936 },
2937 .bool => unreachable,
2938 },
2939 else => unreachable,
2940 };
2941
2942 const set = try cg.importExtendedSet();
2943 for (0..ops) |i| {
2944 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2945 .id_result_type = op_result_ty_id,
2946 .id_result = results.at(i),
2947 .set = set,
2948 .instruction = .{ .inst = ext_inst },
2949 .id_ref_4 = &.{ op_lhs.at(i), op_rhs.at(i) },
2950 });
2951 }
2952
2953 return v.finalize(result_ty, results);
2954}
2955
2956/// This function normalizes values to a canonical representation
2957/// after some arithmetic operation. This mostly consists of wrapping
2958/// behavior for strange integers:
2959/// - Unsigned integers are bitwise masked with a mask that only passes
2960/// the valid bits through.
2961/// - Signed integers are also sign extended if they are negative.
2962/// All other values are returned unmodified (this makes strange integer
2963/// wrapping easier to use in generic operations).
2964fn normalize(cg: *CodeGen, value: Temporary, info: ArithmeticTypeInfo) !Temporary {
2965 const zcu = cg.module.zcu;
2966 const ty = value.ty;
2967 switch (info.class) {
2968 .composite_integer, .integer, .bool, .float => return value,
2969 .strange_integer => switch (info.signedness) {
2970 .unsigned => {
2971 const mask_value = if (info.bits == 64) 0xFFFF_FFFF_FFFF_FFFF else (@as(u64, 1) << @as(u6, @intCast(info.bits))) - 1;
2972 const mask_id = try cg.constInt(ty.scalarType(zcu), mask_value);
2973 return try cg.buildBinary(.OpBitwiseAnd, value, Temporary.init(ty.scalarType(zcu), mask_id));
2974 },
2975 .signed => {
2976 // Shift left and right so that we can copy the sight bit that way.
2977 const shift_amt_id = try cg.constInt(ty.scalarType(zcu), info.backing_bits - info.bits);
2978 const shift_amt: Temporary = .init(ty.scalarType(zcu), shift_amt_id);
2979 const left = try cg.buildBinary(.OpShiftLeftLogical, value, shift_amt);
2980 return try cg.buildBinary(.OpShiftRightArithmetic, left, shift_amt);
2981 },
2982 },
2983 }
2984}
2985
2986fn airDivFloor(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
2987 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
2988
2989 const lhs = try cg.temporary(bin_op.lhs);
2990 const rhs = try cg.temporary(bin_op.rhs);
2991
2992 const info = cg.arithmeticTypeInfo(lhs.ty);
2993 switch (info.class) {
2994 .composite_integer => unreachable, // TODO
2995 .integer, .strange_integer => {
2996 switch (info.signedness) {
2997 .unsigned => {
2998 const result = try cg.buildBinary(.OpUDiv, lhs, rhs);
2999 return try result.materialize(cg);
3000 },
3001 .signed => {},
3002 }
3003
3004 // For signed integers:
3005 // (a / b) - (a % b != 0 && a < 0 != b < 0);
3006 // There shouldn't be any overflow issues.
3007
3008 const div = try cg.buildBinary(.OpSDiv, lhs, rhs);
3009 const rem = try cg.buildBinary(.OpSRem, lhs, rhs);
3010
3011 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3012
3013 const rem_is_not_zero = try cg.buildCmp(.OpINotEqual, rem, zero);
3014
3015 const result_negative = try cg.buildCmp(
3016 .OpLogicalNotEqual,
3017 try cg.buildCmp(.OpSLessThan, lhs, zero),
3018 try cg.buildCmp(.OpSLessThan, rhs, zero),
3019 );
3020 const rem_is_not_zero_and_result_is_negative = try cg.buildBinary(
3021 .OpLogicalAnd,
3022 rem_is_not_zero,
3023 result_negative,
3024 );
3025
3026 const result = try cg.buildBinary(
3027 .OpISub,
3028 div,
3029 try cg.intFromBool2(rem_is_not_zero_and_result_is_negative, div.ty),
3030 );
3031
3032 return try result.materialize(cg);
3033 },
3034 .float => {
3035 const div = try cg.buildBinary(.OpFDiv, lhs, rhs);
3036 const result = try cg.buildUnary(.floor, div);
3037 return try result.materialize(cg);
3038 },
3039 .bool => unreachable,
3040 }
3041}
3042
3043fn airDivTrunc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3044 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3045
3046 const lhs = try cg.temporary(bin_op.lhs);
3047 const rhs = try cg.temporary(bin_op.rhs);
3048
3049 const info = cg.arithmeticTypeInfo(lhs.ty);
3050 switch (info.class) {
3051 .composite_integer => unreachable, // TODO
3052 .integer, .strange_integer => switch (info.signedness) {
3053 .unsigned => {
3054 const result = try cg.buildBinary(.OpUDiv, lhs, rhs);
3055 return try result.materialize(cg);
3056 },
3057 .signed => {
3058 const result = try cg.buildBinary(.OpSDiv, lhs, rhs);
3059 return try result.materialize(cg);
3060 },
3061 },
3062 .float => {
3063 const div = try cg.buildBinary(.OpFDiv, lhs, rhs);
3064 const result = try cg.buildUnary(.trunc, div);
3065 return try result.materialize(cg);
3066 },
3067 .bool => unreachable,
3068 }
3069}
3070
3071fn airUnOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3072 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
3073 const operand = try cg.temporary(un_op);
3074 const result = try cg.buildUnary(op, operand);
3075 return try result.materialize(cg);
3076}
3077
3078fn airArithOp(
3079 cg: *CodeGen,
3080 inst: Air.Inst.Index,
3081 comptime fop: Opcode,
3082 comptime sop: Opcode,
3083 comptime uop: Opcode,
3084) !?Id {
3085 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3086
3087 const lhs = try cg.temporary(bin_op.lhs);
3088 const rhs = try cg.temporary(bin_op.rhs);
3089
3090 const info = cg.arithmeticTypeInfo(lhs.ty);
3091
3092 const result = switch (info.class) {
3093 .composite_integer => unreachable, // TODO
3094 .integer, .strange_integer => switch (info.signedness) {
3095 .signed => try cg.buildBinary(sop, lhs, rhs),
3096 .unsigned => try cg.buildBinary(uop, lhs, rhs),
3097 },
3098 .float => try cg.buildBinary(fop, lhs, rhs),
3099 .bool => unreachable,
3100 };
3101
3102 return try result.materialize(cg);
3103}
3104
3105fn airAbs(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3106 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3107 const operand = try cg.temporary(ty_op.operand);
3108 // Note: operand_ty may be signed, while ty is always unsigned!
3109 const result_ty = cg.typeOfIndex(inst);
3110 const result = try cg.abs(result_ty, operand);
3111 return try result.materialize(cg);
3112}
3113
3114fn abs(cg: *CodeGen, result_ty: Type, value: Temporary) !Temporary {
3115 const zcu = cg.module.zcu;
3116 const target = cg.module.zcu.getTarget();
3117 const operand_info = cg.arithmeticTypeInfo(value.ty);
3118
3119 switch (operand_info.class) {
3120 .float => return try cg.buildUnary(.f_abs, value),
3121 .integer, .strange_integer => {
3122 const abs_value = try cg.buildUnary(.i_abs, value);
3123
3124 switch (target.os.tag) {
3125 .vulkan, .opengl => {
3126 if (value.ty.intInfo(zcu).signedness == .signed) {
3127 return cg.todo("perform bitcast after @abs", .{});
3128 }
3129 },
3130 else => {},
3131 }
3132
3133 return try cg.normalize(abs_value, cg.arithmeticTypeInfo(result_ty));
3134 },
3135 .composite_integer => unreachable, // TODO
3136 .bool => unreachable,
3137 }
3138}
3139
3140fn airAddSubOverflow(
3141 cg: *CodeGen,
3142 inst: Air.Inst.Index,
3143 comptime add: Opcode,
3144 u_opcode: Opcode,
3145 s_opcode: Opcode,
3146) !?Id {
3147 _ = s_opcode;
3148 // Note: OpIAddCarry and OpISubBorrow are not really useful here: For unsigned numbers,
3149 // there is in both cases only one extra operation required. For signed operations,
3150 // the overflow bit is set then going from 0x80.. to 0x00.., but this doesn't actually
3151 // normally set a carry bit. So the SPIR-V overflow operations are not particularly
3152 // useful here.
3153
3154 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3155 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3156
3157 const lhs = try cg.temporary(extra.lhs);
3158 const rhs = try cg.temporary(extra.rhs);
3159
3160 const result_ty = cg.typeOfIndex(inst);
3161
3162 const info = cg.arithmeticTypeInfo(lhs.ty);
3163 switch (info.class) {
3164 .composite_integer => unreachable, // TODO
3165 .strange_integer, .integer => {},
3166 .float, .bool => unreachable,
3167 }
3168
3169 const sum = try cg.buildBinary(add, lhs, rhs);
3170 const result = try cg.normalize(sum, info);
3171
3172 const overflowed = switch (info.signedness) {
3173 // Overflow happened if the result is smaller than either of the operands. It doesn't matter which.
3174 // For subtraction the conditions need to be swapped.
3175 .unsigned => try cg.buildCmp(u_opcode, result, lhs),
3176 // For signed operations, we check the signs of the operands and the result.
3177 .signed => blk: {
3178 // Signed overflow detection using the sign bits of the operands and the result.
3179 // For addition (a + b), overflow occurs if the operands have the same sign
3180 // and the result's sign is different from the operands' sign.
3181 // (sign(a) == sign(b)) && (sign(a) != sign(result))
3182 // For subtraction (a - b), overflow occurs if the operands have different signs
3183 // and the result's sign is different from the minuend's (a's) sign.
3184 // (sign(a) != sign(b)) && (sign(a) != sign(result))
3185 const zero: Temporary = .init(rhs.ty, try cg.constInt(rhs.ty, 0));
3186
3187 const lhs_is_neg = try cg.buildCmp(.OpSLessThan, lhs, zero);
3188 const rhs_is_neg = try cg.buildCmp(.OpSLessThan, rhs, zero);
3189 const result_is_neg = try cg.buildCmp(.OpSLessThan, result, zero);
3190
3191 const signs_match = try cg.buildCmp(.OpLogicalEqual, lhs_is_neg, rhs_is_neg);
3192 const result_sign_differs = try cg.buildCmp(.OpLogicalNotEqual, lhs_is_neg, result_is_neg);
3193
3194 const overflow_condition = if (add == .OpIAdd)
3195 signs_match
3196 else // .OpISub
3197 try cg.buildUnary(.l_not, signs_match);
3198
3199 break :blk try cg.buildCmp(.OpLogicalAnd, overflow_condition, result_sign_differs);
3200 },
3201 };
3202
3203 const ov = try cg.intFromBool(overflowed);
3204
3205 const result_ty_id = try cg.resolveType(result_ty, .direct);
3206 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3207}
3208
3209fn airMulOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3210 const pt = cg.pt;
3211
3212 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3213 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3214
3215 const lhs = try cg.temporary(extra.lhs);
3216 const rhs = try cg.temporary(extra.rhs);
3217
3218 const result_ty = cg.typeOfIndex(inst);
3219
3220 const info = cg.arithmeticTypeInfo(lhs.ty);
3221 switch (info.class) {
3222 .composite_integer => unreachable, // TODO
3223 .strange_integer, .integer => {},
3224 .float, .bool => unreachable,
3225 }
3226
3227 // There are 3 cases which we have to deal with:
3228 // - If info.bits < 32 / 2, we will upcast to 32 and check the higher bits
3229 // - If info.bits > 32 / 2, we have to use extended multiplication
3230 // - Additionally, if info.bits != 32, we'll have to check the high bits
3231 // of the result too.
3232
3233 const largest_int_bits = cg.largestSupportedIntBits();
3234 // If non-null, the number of bits that the multiplication should be performed in. If
3235 // null, we have to use wide multiplication.
3236 const maybe_op_ty_bits: ?u16 = switch (info.bits) {
3237 0 => unreachable,
3238 1...16 => 32,
3239 17...32 => if (largest_int_bits > 32) 64 else null, // Upcast if we can.
3240 33...64 => null, // Always use wide multiplication.
3241 else => unreachable, // TODO: Composite integers
3242 };
3243
3244 const result, const overflowed = switch (info.signedness) {
3245 .unsigned => blk: {
3246 if (maybe_op_ty_bits) |op_ty_bits| {
3247 const op_ty = try pt.intType(.unsigned, op_ty_bits);
3248 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3249 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3250
3251 const full_result = try cg.buildBinary(.OpIMul, casted_lhs, casted_rhs);
3252
3253 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3254 const result = try cg.normalize(low_bits, info);
3255
3256 // Shift the result bits away to get the overflow bits.
3257 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits));
3258 const overflow = try cg.buildBinary(.OpShiftRightLogical, full_result, shift);
3259
3260 // Directly check if its zero in the op_ty without converting first.
3261 const zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3262 const overflowed = try cg.buildCmp(.OpINotEqual, zero, overflow);
3263
3264 break :blk .{ result, overflowed };
3265 }
3266
3267 const low_bits, const high_bits = try cg.buildWideMul(.unsigned, lhs, rhs);
3268
3269 // Truncate the result, if required.
3270 const result = try cg.normalize(low_bits, info);
3271
3272 // Overflow happened if the high-bits of the result are non-zero OR if the
3273 // high bits of the low word of the result (those outside the range of the
3274 // int) are nonzero.
3275 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3276 const high_overflowed = try cg.buildCmp(.OpINotEqual, zero, high_bits);
3277
3278 // If no overflow bits in low_bits, no extra work needs to be done.
3279 if (info.backing_bits == info.bits) break :blk .{ result, high_overflowed };
3280
3281 // Shift the result bits away to get the overflow bits.
3282 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits));
3283 const low_overflow = try cg.buildBinary(.OpShiftRightLogical, low_bits, shift);
3284 const low_overflowed = try cg.buildCmp(.OpINotEqual, zero, low_overflow);
3285
3286 const overflowed = try cg.buildCmp(.OpLogicalOr, low_overflowed, high_overflowed);
3287
3288 break :blk .{ result, overflowed };
3289 },
3290 .signed => blk: {
3291 // - lhs >= 0, rhxs >= 0: expect positive; overflow should be 0
3292 // - lhs == 0 : expect positive; overflow should be 0
3293 // - rhs == 0: expect positive; overflow should be 0
3294 // - lhs > 0, rhs < 0: expect negative; overflow should be -1
3295 // - lhs < 0, rhs > 0: expect negative; overflow should be -1
3296 // - lhs <= 0, rhs <= 0: expect positive; overflow should be 0
3297 // ------
3298 // overflow should be -1 when
3299 // (lhs > 0 && rhs < 0) || (lhs < 0 && rhs > 0)
3300
3301 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3302 const lhs_negative = try cg.buildCmp(.OpSLessThan, lhs, zero);
3303 const rhs_negative = try cg.buildCmp(.OpSLessThan, rhs, zero);
3304 const lhs_positive = try cg.buildCmp(.OpSGreaterThan, lhs, zero);
3305 const rhs_positive = try cg.buildCmp(.OpSGreaterThan, rhs, zero);
3306
3307 // Set to `true` if we expect -1.
3308 const expected_overflow_bit = try cg.buildBinary(
3309 .OpLogicalOr,
3310 try cg.buildCmp(.OpLogicalAnd, lhs_positive, rhs_negative),
3311 try cg.buildCmp(.OpLogicalAnd, lhs_negative, rhs_positive),
3312 );
3313
3314 if (maybe_op_ty_bits) |op_ty_bits| {
3315 const op_ty = try pt.intType(.signed, op_ty_bits);
3316 // Assume normalized; sign bit is set. We want a sign extend.
3317 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3318 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3319
3320 const full_result = try cg.buildBinary(.OpIMul, casted_lhs, casted_rhs);
3321
3322 // Truncate to the result type.
3323 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3324 const result = try cg.normalize(low_bits, info);
3325
3326 // Now, we need to check the overflow bits AND the sign
3327 // bit for the expected overflow bits.
3328 // To do that, shift out everything bit the sign bit and
3329 // then check what remains.
3330 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits - 1));
3331 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3332 // for negative cases.
3333 const overflow = try cg.buildBinary(.OpShiftRightArithmetic, full_result, shift);
3334
3335 const long_all_set: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, -1));
3336 const long_zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3337 const mask = try cg.buildSelect(expected_overflow_bit, long_all_set, long_zero);
3338
3339 const overflowed = try cg.buildCmp(.OpINotEqual, mask, overflow);
3340
3341 break :blk .{ result, overflowed };
3342 }
3343
3344 const low_bits, const high_bits = try cg.buildWideMul(.signed, lhs, rhs);
3345
3346 // Truncate result if required.
3347 const result = try cg.normalize(low_bits, info);
3348
3349 const all_set: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, -1));
3350 const mask = try cg.buildSelect(expected_overflow_bit, all_set, zero);
3351
3352 // Like with unsigned, overflow happened if high_bits are not the ones we expect,
3353 // and we also need to check some ones from the low bits.
3354
3355 const high_overflowed = try cg.buildCmp(.OpINotEqual, mask, high_bits);
3356
3357 // If no overflow bits in low_bits, no extra work needs to be done.
3358 // Careful, we still have to check the sign bit, so this branch
3359 // only goes for i33 and such.
3360 if (info.backing_bits == info.bits + 1) break :blk .{ result, high_overflowed };
3361
3362 // Shift the result bits away to get the overflow bits.
3363 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits - 1));
3364 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3365 // for negative cases.
3366 const low_overflow = try cg.buildBinary(.OpShiftRightArithmetic, low_bits, shift);
3367 const low_overflowed = try cg.buildCmp(.OpINotEqual, mask, low_overflow);
3368
3369 const overflowed = try cg.buildCmp(.OpLogicalOr, low_overflowed, high_overflowed);
3370
3371 break :blk .{ result, overflowed };
3372 },
3373 };
3374
3375 const ov = try cg.intFromBool(overflowed);
3376
3377 const result_ty_id = try cg.resolveType(result_ty, .direct);
3378 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3379}
3380
3381fn airShlOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3382 const zcu = cg.module.zcu;
3383
3384 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3385 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3386
3387 if (cg.typeOf(extra.lhs).isVector(zcu) and !cg.typeOf(extra.rhs).isVector(zcu)) {
3388 return cg.fail("vector shift with scalar rhs", .{});
3389 }
3390
3391 const base = try cg.temporary(extra.lhs);
3392 const shift = try cg.temporary(extra.rhs);
3393
3394 const result_ty = cg.typeOfIndex(inst);
3395
3396 const info = cg.arithmeticTypeInfo(base.ty);
3397 switch (info.class) {
3398 .composite_integer => unreachable, // TODO
3399 .integer, .strange_integer => {},
3400 .float, .bool => unreachable,
3401 }
3402
3403 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3404 // so just manually upcast it if required.
3405 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
3406
3407 const left = try cg.buildBinary(.OpShiftLeftLogical, base, casted_shift);
3408 const result = try cg.normalize(left, info);
3409
3410 const right = switch (info.signedness) {
3411 .unsigned => try cg.buildBinary(.OpShiftRightLogical, result, casted_shift),
3412 .signed => try cg.buildBinary(.OpShiftRightArithmetic, result, casted_shift),
3413 };
3414
3415 const overflowed = try cg.buildCmp(.OpINotEqual, base, right);
3416 const ov = try cg.intFromBool(overflowed);
3417
3418 const result_ty_id = try cg.resolveType(result_ty, .direct);
3419 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3420}
3421
3422fn airMulAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3423 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3424 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3425
3426 const a = try cg.temporary(extra.lhs);
3427 const b = try cg.temporary(extra.rhs);
3428 const c = try cg.temporary(pl_op.operand);
3429
3430 const result_ty = cg.typeOfIndex(inst);
3431 const info = cg.arithmeticTypeInfo(result_ty);
3432 assert(info.class == .float); // .mul_add is only emitted for floats
3433
3434 const result = try cg.buildFma(a, b, c);
3435 return try result.materialize(cg);
3436}
3437
3438fn airClzCtz(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3439 if (cg.liveness.isUnused(inst)) return null;
3440
3441 const zcu = cg.module.zcu;
3442 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3443 const operand = try cg.temporary(ty_op.operand);
3444
3445 const scalar_result_ty = cg.typeOfIndex(inst).scalarType(zcu);
3446
3447 const info = cg.arithmeticTypeInfo(operand.ty);
3448 switch (info.class) {
3449 .composite_integer => unreachable, // TODO
3450 .integer, .strange_integer => {},
3451 .float, .bool => unreachable,
3452 }
3453
3454 const count = try cg.buildUnary(op, operand);
3455
3456 // Result of OpenCL ctz/clz returns operand.ty, and we want result_ty.
3457 // result_ty is always large enough to hold the result, so we might have to down
3458 // cast it.
3459 const result = try cg.buildConvert(scalar_result_ty, count);
3460 return try result.materialize(cg);
3461}
3462
3463fn airSelect(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3464 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3465 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3466 const pred = try cg.temporary(pl_op.operand);
3467 const a = try cg.temporary(extra.lhs);
3468 const b = try cg.temporary(extra.rhs);
3469
3470 const result = try cg.buildSelect(pred, a, b);
3471 return try result.materialize(cg);
3472}
3473
3474fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3475 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3476
3477 const operand_id = try cg.resolve(ty_op.operand);
3478 const result_ty = cg.typeOfIndex(inst);
3479
3480 return try cg.constructCompositeSplat(result_ty, operand_id);
3481}
3482
3483fn airReduce(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3484 const zcu = cg.module.zcu;
3485 const reduce = cg.air.instructions.items(.data)[@intFromEnum(inst)].reduce;
3486 const operand = try cg.resolve(reduce.operand);
3487 const operand_ty = cg.typeOf(reduce.operand);
3488 const scalar_ty = operand_ty.scalarType(zcu);
3489 const scalar_ty_id = try cg.resolveType(scalar_ty, .direct);
3490 const info = cg.arithmeticTypeInfo(operand_ty);
3491 const len = operand_ty.vectorLen(zcu);
3492 const first = try cg.extractVectorComponent(scalar_ty, operand, 0);
3493
3494 switch (reduce.operation) {
3495 .Min, .Max => |op| {
3496 var result: Temporary = .init(scalar_ty, first);
3497 const cmp_op: MinMax = switch (op) {
3498 .Max => .max,
3499 .Min => .min,
3500 else => unreachable,
3501 };
3502 for (1..len) |i| {
3503 const lhs = result;
3504 const rhs_id = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3505 const rhs: Temporary = .init(scalar_ty, rhs_id);
3506
3507 result = try cg.minMax(lhs, rhs, cmp_op);
3508 }
3509
3510 return try result.materialize(cg);
3511 },
3512 else => {},
3513 }
3514
3515 var result_id = first;
3516
3517 const opcode: Opcode = switch (info.class) {
3518 .bool => switch (reduce.operation) {
3519 .And => .OpLogicalAnd,
3520 .Or => .OpLogicalOr,
3521 .Xor => .OpLogicalNotEqual,
3522 else => unreachable,
3523 },
3524 .strange_integer, .integer => switch (reduce.operation) {
3525 .And => .OpBitwiseAnd,
3526 .Or => .OpBitwiseOr,
3527 .Xor => .OpBitwiseXor,
3528 .Add => .OpIAdd,
3529 .Mul => .OpIMul,
3530 else => unreachable,
3531 },
3532 .float => switch (reduce.operation) {
3533 .Add => .OpFAdd,
3534 .Mul => .OpFMul,
3535 else => unreachable,
3536 },
3537 .composite_integer => unreachable, // TODO
3538 };
3539
3540 for (1..len) |i| {
3541 const lhs = result_id;
3542 const rhs = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3543 result_id = cg.module.allocId();
3544
3545 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
3546 cg.body.writeOperand(Id, scalar_ty_id);
3547 cg.body.writeOperand(Id, result_id);
3548 cg.body.writeOperand(Id, lhs);
3549 cg.body.writeOperand(Id, rhs);
3550 }
3551
3552 return result_id;
3553}
3554
3555fn airShuffleOne(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3556 const zcu = cg.module.zcu;
3557 const gpa = zcu.gpa;
3558
3559 const unwrapped = cg.air.unwrapShuffleOne(zcu, inst);
3560 const mask = unwrapped.mask;
3561 const result_ty = unwrapped.result_ty;
3562 const elem_ty = result_ty.childType(zcu);
3563 const operand = try cg.resolve(unwrapped.operand);
3564
3565 const constituents = try gpa.alloc(Id, mask.len);
3566 defer gpa.free(constituents);
3567
3568 for (constituents, mask) |*id, mask_elem| {
3569 id.* = switch (mask_elem.unwrap()) {
3570 .elem => |idx| try cg.extractVectorComponent(elem_ty, operand, idx),
3571 .value => |val| try cg.constant(elem_ty, .fromInterned(val), .direct),
3572 };
3573 }
3574
3575 const result_ty_id = try cg.resolveType(result_ty, .direct);
3576 return try cg.constructComposite(result_ty_id, constituents);
3577}
3578
3579fn airShuffleTwo(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3580 const zcu = cg.module.zcu;
3581 const gpa = zcu.gpa;
3582
3583 const unwrapped = cg.air.unwrapShuffleTwo(zcu, inst);
3584 const mask = unwrapped.mask;
3585 const result_ty = unwrapped.result_ty;
3586 const elem_ty = result_ty.childType(zcu);
3587 const elem_ty_id = try cg.resolveType(elem_ty, .direct);
3588 const operand_a = try cg.resolve(unwrapped.operand_a);
3589 const operand_b = try cg.resolve(unwrapped.operand_b);
3590
3591 const constituents = try gpa.alloc(Id, mask.len);
3592 defer gpa.free(constituents);
3593
3594 for (constituents, mask) |*id, mask_elem| {
3595 id.* = switch (mask_elem.unwrap()) {
3596 .a_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_a, idx),
3597 .b_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_b, idx),
3598 .undef => try cg.module.constUndef(elem_ty_id),
3599 };
3600 }
3601
3602 const result_ty_id = try cg.resolveType(result_ty, .direct);
3603 return try cg.constructComposite(result_ty_id, constituents);
3604}
3605
3606fn indicesToIds(cg: *CodeGen, indices: []const u32) ![]Id {
3607 const gpa = cg.module.gpa;
3608 const ids = try gpa.alloc(Id, indices.len);
3609 errdefer gpa.free(ids);
3610 for (indices, ids) |index, *id| {
3611 id.* = try cg.constInt(.u32, index);
3612 }
3613
3614 return ids;
3615}
3616
3617fn accessChainId(
3618 cg: *CodeGen,
3619 result_ty_id: Id,
3620 base: Id,
3621 indices: []const Id,
3622) !Id {
3623 const result_id = cg.module.allocId();
3624 try cg.body.emit(cg.module.gpa, .OpInBoundsAccessChain, .{
3625 .id_result_type = result_ty_id,
3626 .id_result = result_id,
3627 .base = base,
3628 .indexes = indices,
3629 });
3630 return result_id;
3631}
3632
3633/// AccessChain is essentially PtrAccessChain with 0 as initial argument. The effective
3634/// difference lies in whether the resulting type of the first dereference will be the
3635/// same as that of the base pointer, or that of a dereferenced base pointer. AccessChain
3636/// is the latter and PtrAccessChain is the former.
3637fn accessChain(
3638 cg: *CodeGen,
3639 result_ty_id: Id,
3640 base: Id,
3641 indices: []const u32,
3642) !Id {
3643 const gpa = cg.module.gpa;
3644 const ids = try cg.indicesToIds(indices);
3645 defer gpa.free(ids);
3646 return try cg.accessChainId(result_ty_id, base, ids);
3647}
3648
3649fn ptrAccessChain(
3650 cg: *CodeGen,
3651 result_ty_id: Id,
3652 base: Id,
3653 element: Id,
3654 indices: []const u32,
3655) !Id {
3656 const gpa = cg.module.gpa;
3657 const target = cg.module.zcu.getTarget();
3658 const ids = try cg.indicesToIds(indices);
3659 defer gpa.free(ids);
3660
3661 const result_id = cg.module.allocId();
3662 switch (target.os.tag) {
3663 .opencl, .amdhsa => {
3664 try cg.body.emit(cg.module.gpa, .OpInBoundsPtrAccessChain, .{
3665 .id_result_type = result_ty_id,
3666 .id_result = result_id,
3667 .base = base,
3668 .element = element,
3669 .indexes = ids,
3670 });
3671 },
3672 else => {
3673 try cg.body.emit(cg.module.gpa, .OpPtrAccessChain, .{
3674 .id_result_type = result_ty_id,
3675 .id_result = result_id,
3676 .base = base,
3677 .element = element,
3678 .indexes = ids,
3679 });
3680 },
3681 }
3682 return result_id;
3683}
3684
3685fn ptrAdd(cg: *CodeGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id) !Id {
3686 const zcu = cg.module.zcu;
3687 const result_ty_id = try cg.resolveType(result_ty, .direct);
3688
3689 switch (ptr_ty.ptrSize(zcu)) {
3690 .one => {
3691 // Pointer to array
3692 // TODO: Is this correct?
3693 return try cg.accessChainId(result_ty_id, ptr_id, &.{offset_id});
3694 },
3695 .c, .many => {
3696 return try cg.ptrAccessChain(result_ty_id, ptr_id, offset_id, &.{});
3697 },
3698 .slice => {
3699 // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does.
3700 const slice_ptr_id = try cg.extractField(result_ty, ptr_id, 0);
3701 return try cg.ptrAccessChain(result_ty_id, slice_ptr_id, offset_id, &.{});
3702 },
3703 }
3704}
3705
3706fn airPtrAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3707 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3708 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3709 const ptr_id = try cg.resolve(bin_op.lhs);
3710 const offset_id = try cg.resolve(bin_op.rhs);
3711 const ptr_ty = cg.typeOf(bin_op.lhs);
3712 const result_ty = cg.typeOfIndex(inst);
3713
3714 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, offset_id);
3715}
3716
3717fn airPtrSub(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3718 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3719 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3720 const ptr_id = try cg.resolve(bin_op.lhs);
3721 const ptr_ty = cg.typeOf(bin_op.lhs);
3722 const offset_id = try cg.resolve(bin_op.rhs);
3723 const offset_ty = cg.typeOf(bin_op.rhs);
3724 const offset_ty_id = try cg.resolveType(offset_ty, .direct);
3725 const result_ty = cg.typeOfIndex(inst);
3726
3727 const negative_offset_id = cg.module.allocId();
3728 try cg.body.emit(cg.module.gpa, .OpSNegate, .{
3729 .id_result_type = offset_ty_id,
3730 .id_result = negative_offset_id,
3731 .operand = offset_id,
3732 });
3733 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, negative_offset_id);
3734}
3735
3736fn cmp(
3737 cg: *CodeGen,
3738 op: std.math.CompareOperator,
3739 lhs: Temporary,
3740 rhs: Temporary,
3741) !Temporary {
3742 const pt = cg.pt;
3743 const zcu = cg.module.zcu;
3744 const ip = &zcu.intern_pool;
3745 const scalar_ty = lhs.ty.scalarType(zcu);
3746 const is_vector = lhs.ty.isVector(zcu);
3747
3748 switch (scalar_ty.zigTypeTag(zcu)) {
3749 .int, .bool, .float => {},
3750 .@"enum" => {
3751 assert(!is_vector);
3752 const ty = lhs.ty.intTagType(zcu);
3753 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
3754 },
3755 .@"struct" => {
3756 const struct_ty = zcu.typeToPackedStruct(scalar_ty).?;
3757 const ty: Type = .fromInterned(struct_ty.backingIntTypeUnordered(ip));
3758 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
3759 },
3760 .error_set => {
3761 assert(!is_vector);
3762 const err_int_ty = try pt.errorIntType();
3763 return try cg.cmp(op, lhs.pun(err_int_ty), rhs.pun(err_int_ty));
3764 },
3765 .pointer => {
3766 assert(!is_vector);
3767 // Note that while SPIR-V offers OpPtrEqual and OpPtrNotEqual, they are
3768 // currently not implemented in the SPIR-V LLVM translator. Thus, we emit these using
3769 // OpConvertPtrToU...
3770
3771 const usize_ty_id = try cg.resolveType(.usize, .direct);
3772
3773 const lhs_int_id = cg.module.allocId();
3774 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
3775 .id_result_type = usize_ty_id,
3776 .id_result = lhs_int_id,
3777 .pointer = try lhs.materialize(cg),
3778 });
3779
3780 const rhs_int_id = cg.module.allocId();
3781 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
3782 .id_result_type = usize_ty_id,
3783 .id_result = rhs_int_id,
3784 .pointer = try rhs.materialize(cg),
3785 });
3786
3787 const lhs_int: Temporary = .init(.usize, lhs_int_id);
3788 const rhs_int: Temporary = .init(.usize, rhs_int_id);
3789 return try cg.cmp(op, lhs_int, rhs_int);
3790 },
3791 .optional => {
3792 assert(!is_vector);
3793
3794 const ty = lhs.ty;
3795
3796 const payload_ty = ty.optionalChild(zcu);
3797 if (ty.optionalReprIsPayload(zcu)) {
3798 assert(payload_ty.hasRuntimeBitsIgnoreComptime(zcu));
3799 assert(!payload_ty.isSlice(zcu));
3800
3801 return try cg.cmp(op, lhs.pun(payload_ty), rhs.pun(payload_ty));
3802 }
3803
3804 const lhs_id = try lhs.materialize(cg);
3805 const rhs_id = try rhs.materialize(cg);
3806
3807 const lhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
3808 try cg.extractField(.bool, lhs_id, 1)
3809 else
3810 try cg.convertToDirect(.bool, lhs_id);
3811
3812 const rhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
3813 try cg.extractField(.bool, rhs_id, 1)
3814 else
3815 try cg.convertToDirect(.bool, rhs_id);
3816
3817 const lhs_valid: Temporary = .init(.bool, lhs_valid_id);
3818 const rhs_valid: Temporary = .init(.bool, rhs_valid_id);
3819
3820 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
3821 return try cg.cmp(op, lhs_valid, rhs_valid);
3822 }
3823
3824 // a = lhs_valid
3825 // b = rhs_valid
3826 // c = lhs_pl == rhs_pl
3827 //
3828 // For op == .eq we have:
3829 // a == b && a -> c
3830 // = a == b && (!a || c)
3831 //
3832 // For op == .neq we have
3833 // a == b && a -> c
3834 // = !(a == b && a -> c)
3835 // = a != b || !(a -> c
3836 // = a != b || !(!a || c)
3837 // = a != b || a && !c
3838
3839 const lhs_pl_id = try cg.extractField(payload_ty, lhs_id, 0);
3840 const rhs_pl_id = try cg.extractField(payload_ty, rhs_id, 0);
3841
3842 const lhs_pl: Temporary = .init(payload_ty, lhs_pl_id);
3843 const rhs_pl: Temporary = .init(payload_ty, rhs_pl_id);
3844
3845 return switch (op) {
3846 .eq => try cg.buildBinary(
3847 .OpLogicalAnd,
3848 try cg.cmp(.eq, lhs_valid, rhs_valid),
3849 try cg.buildBinary(
3850 .OpLogicalOr,
3851 try cg.buildUnary(.l_not, lhs_valid),
3852 try cg.cmp(.eq, lhs_pl, rhs_pl),
3853 ),
3854 ),
3855 .neq => try cg.buildBinary(
3856 .OpLogicalOr,
3857 try cg.cmp(.neq, lhs_valid, rhs_valid),
3858 try cg.buildBinary(
3859 .OpLogicalAnd,
3860 lhs_valid,
3861 try cg.cmp(.neq, lhs_pl, rhs_pl),
3862 ),
3863 ),
3864 else => unreachable,
3865 };
3866 },
3867 else => |ty| return cg.todo("implement cmp operation for '{s}' type", .{@tagName(ty)}),
3868 }
3869
3870 const info = cg.arithmeticTypeInfo(scalar_ty);
3871 const pred: Opcode = switch (info.class) {
3872 .composite_integer => unreachable, // TODO
3873 .float => switch (op) {
3874 .eq => .OpFOrdEqual,
3875 .neq => .OpFUnordNotEqual,
3876 .lt => .OpFOrdLessThan,
3877 .lte => .OpFOrdLessThanEqual,
3878 .gt => .OpFOrdGreaterThan,
3879 .gte => .OpFOrdGreaterThanEqual,
3880 },
3881 .bool => switch (op) {
3882 .eq => .OpLogicalEqual,
3883 .neq => .OpLogicalNotEqual,
3884 else => unreachable,
3885 },
3886 .integer, .strange_integer => switch (info.signedness) {
3887 .signed => switch (op) {
3888 .eq => .OpIEqual,
3889 .neq => .OpINotEqual,
3890 .lt => .OpSLessThan,
3891 .lte => .OpSLessThanEqual,
3892 .gt => .OpSGreaterThan,
3893 .gte => .OpSGreaterThanEqual,
3894 },
3895 .unsigned => switch (op) {
3896 .eq => .OpIEqual,
3897 .neq => .OpINotEqual,
3898 .lt => .OpULessThan,
3899 .lte => .OpULessThanEqual,
3900 .gt => .OpUGreaterThan,
3901 .gte => .OpUGreaterThanEqual,
3902 },
3903 },
3904 };
3905
3906 return try cg.buildCmp(pred, lhs, rhs);
3907}
3908
3909fn airCmp(
3910 cg: *CodeGen,
3911 inst: Air.Inst.Index,
3912 comptime op: std.math.CompareOperator,
3913) !?Id {
3914 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3915 const lhs = try cg.temporary(bin_op.lhs);
3916 const rhs = try cg.temporary(bin_op.rhs);
3917
3918 const result = try cg.cmp(op, lhs, rhs);
3919 return try result.materialize(cg);
3920}
3921
3922fn airVectorCmp(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3923 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3924 const vec_cmp = cg.air.extraData(Air.VectorCmp, ty_pl.payload).data;
3925 const lhs = try cg.temporary(vec_cmp.lhs);
3926 const rhs = try cg.temporary(vec_cmp.rhs);
3927 const op = vec_cmp.compareOperator();
3928
3929 const result = try cg.cmp(op, lhs, rhs);
3930 return try result.materialize(cg);
3931}
3932
3933/// Bitcast one type to another. Note: both types, input, output are expected in **direct** representation.
3934fn bitCast(
3935 cg: *CodeGen,
3936 dst_ty: Type,
3937 src_ty: Type,
3938 src_id: Id,
3939) !Id {
3940 const zcu = cg.module.zcu;
3941 const src_ty_id = try cg.resolveType(src_ty, .direct);
3942 const dst_ty_id = try cg.resolveType(dst_ty, .direct);
3943
3944 const result_id = blk: {
3945 if (src_ty_id == dst_ty_id) break :blk src_id;
3946
3947 // TODO: Some more cases are missing here
3948 // See fn bitCast in llvm.zig
3949
3950 if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) {
3951 const result_id = cg.module.allocId();
3952 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
3953 .id_result_type = dst_ty_id,
3954 .id_result = result_id,
3955 .integer_value = src_id,
3956 });
3957 break :blk result_id;
3958 }
3959
3960 // We can only use OpBitcast for specific conversions: between numerical types, and
3961 // between pointers. If the resolved spir-v types fall into this category then emit OpBitcast,
3962 // otherwise use a temporary and perform a pointer cast.
3963 const can_bitcast = (src_ty.isNumeric(zcu) and dst_ty.isNumeric(zcu)) or (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu));
3964 if (can_bitcast) {
3965 const result_id = cg.module.allocId();
3966 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
3967 .id_result_type = dst_ty_id,
3968 .id_result = result_id,
3969 .operand = src_id,
3970 });
3971
3972 break :blk result_id;
3973 }
3974
3975 const dst_ptr_ty_id = try cg.module.ptrType(dst_ty_id, .function);
3976
3977 const tmp_id = try cg.alloc(src_ty, .{ .storage_class = .function });
3978 try cg.store(src_ty, tmp_id, src_id, .{});
3979 const casted_ptr_id = cg.module.allocId();
3980 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
3981 .id_result_type = dst_ptr_ty_id,
3982 .id_result = casted_ptr_id,
3983 .operand = tmp_id,
3984 });
3985 break :blk try cg.load(dst_ty, casted_ptr_id, .{});
3986 };
3987
3988 // Because strange integers use sign-extended representation, we may need to normalize
3989 // the result here.
3990 // TODO: This detail could cause stuff like @as(*const i1, @ptrCast(&@as(u1, 1))) to break
3991 // should we change the representation of strange integers?
3992 if (dst_ty.zigTypeTag(zcu) == .int) {
3993 const info = cg.arithmeticTypeInfo(dst_ty);
3994 const result = try cg.normalize(Temporary.init(dst_ty, result_id), info);
3995 return try result.materialize(cg);
3996 }
3997
3998 return result_id;
3999}
4000
4001fn airBitCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4002 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4003 const operand_ty = cg.typeOf(ty_op.operand);
4004 const result_ty = cg.typeOfIndex(inst);
4005 if (operand_ty.toIntern() == .bool_type) {
4006 const operand = try cg.temporary(ty_op.operand);
4007 const result = try cg.intFromBool(operand);
4008 return try result.materialize(cg);
4009 }
4010 const operand_id = try cg.resolve(ty_op.operand);
4011 return try cg.bitCast(result_ty, operand_ty, operand_id);
4012}
4013
4014fn airIntCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4015 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4016 const src = try cg.temporary(ty_op.operand);
4017 const dst_ty = cg.typeOfIndex(inst);
4018
4019 const src_info = cg.arithmeticTypeInfo(src.ty);
4020 const dst_info = cg.arithmeticTypeInfo(dst_ty);
4021
4022 if (src_info.backing_bits == dst_info.backing_bits) {
4023 return try src.materialize(cg);
4024 }
4025
4026 const converted = try cg.buildConvert(dst_ty, src);
4027
4028 // Make sure to normalize the result if shrinking.
4029 // Because strange ints are sign extended in their backing
4030 // type, we don't need to normalize when growing the type. The
4031 // representation is already the same.
4032 const result = if (dst_info.bits < src_info.bits)
4033 try cg.normalize(converted, dst_info)
4034 else
4035 converted;
4036
4037 return try result.materialize(cg);
4038}
4039
4040fn intFromPtr(cg: *CodeGen, operand_id: Id) !Id {
4041 const result_type_id = try cg.resolveType(.usize, .direct);
4042 const result_id = cg.module.allocId();
4043 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
4044 .id_result_type = result_type_id,
4045 .id_result = result_id,
4046 .pointer = operand_id,
4047 });
4048 return result_id;
4049}
4050
4051fn airFloatFromInt(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4052 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4053 const operand_ty = cg.typeOf(ty_op.operand);
4054 const operand_id = try cg.resolve(ty_op.operand);
4055 const result_ty = cg.typeOfIndex(inst);
4056 return try cg.floatFromInt(result_ty, operand_ty, operand_id);
4057}
4058
4059fn floatFromInt(cg: *CodeGen, result_ty: Type, operand_ty: Type, operand_id: Id) !Id {
4060 const operand_info = cg.arithmeticTypeInfo(operand_ty);
4061 const result_id = cg.module.allocId();
4062 const result_ty_id = try cg.resolveType(result_ty, .direct);
4063 switch (operand_info.signedness) {
4064 .signed => try cg.body.emit(cg.module.gpa, .OpConvertSToF, .{
4065 .id_result_type = result_ty_id,
4066 .id_result = result_id,
4067 .signed_value = operand_id,
4068 }),
4069 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertUToF, .{
4070 .id_result_type = result_ty_id,
4071 .id_result = result_id,
4072 .unsigned_value = operand_id,
4073 }),
4074 }
4075 return result_id;
4076}
4077
4078fn airIntFromFloat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4079 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4080 const operand_id = try cg.resolve(ty_op.operand);
4081 const result_ty = cg.typeOfIndex(inst);
4082 return try cg.intFromFloat(result_ty, operand_id);
4083}
4084
4085fn intFromFloat(cg: *CodeGen, result_ty: Type, operand_id: Id) !Id {
4086 const result_info = cg.arithmeticTypeInfo(result_ty);
4087 const result_ty_id = try cg.resolveType(result_ty, .direct);
4088 const result_id = cg.module.allocId();
4089 switch (result_info.signedness) {
4090 .signed => try cg.body.emit(cg.module.gpa, .OpConvertFToS, .{
4091 .id_result_type = result_ty_id,
4092 .id_result = result_id,
4093 .float_value = operand_id,
4094 }),
4095 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertFToU, .{
4096 .id_result_type = result_ty_id,
4097 .id_result = result_id,
4098 .float_value = operand_id,
4099 }),
4100 }
4101 return result_id;
4102}
4103
4104fn airFloatCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4105 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4106 const operand = try cg.temporary(ty_op.operand);
4107 const dest_ty = cg.typeOfIndex(inst);
4108 const result = try cg.buildConvert(dest_ty, operand);
4109 return try result.materialize(cg);
4110}
4111
4112fn airNot(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4113 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4114 const operand = try cg.temporary(ty_op.operand);
4115 const result_ty = cg.typeOfIndex(inst);
4116 const info = cg.arithmeticTypeInfo(result_ty);
4117
4118 const result = switch (info.class) {
4119 .bool => try cg.buildUnary(.l_not, operand),
4120 .float => unreachable,
4121 .composite_integer => unreachable, // TODO
4122 .strange_integer, .integer => blk: {
4123 const complement = try cg.buildUnary(.bit_not, operand);
4124 break :blk try cg.normalize(complement, info);
4125 },
4126 };
4127
4128 return try result.materialize(cg);
4129}
4130
4131fn airArrayToSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4132 const zcu = cg.module.zcu;
4133 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4134 const array_ptr_ty = cg.typeOf(ty_op.operand);
4135 const array_ty = array_ptr_ty.childType(zcu);
4136 const slice_ty = cg.typeOfIndex(inst);
4137 const elem_ptr_ty = slice_ty.slicePtrFieldType(zcu);
4138
4139 const elem_ptr_ty_id = try cg.resolveType(elem_ptr_ty, .direct);
4140
4141 const array_ptr_id = try cg.resolve(ty_op.operand);
4142 const len_id = try cg.constInt(.usize, array_ty.arrayLen(zcu));
4143
4144 const elem_ptr_id = if (!array_ty.hasRuntimeBitsIgnoreComptime(zcu))
4145 // Note: The pointer is something like *opaque{}, so we need to bitcast it to the element type.
4146 try cg.bitCast(elem_ptr_ty, array_ptr_ty, array_ptr_id)
4147 else
4148 // Convert the pointer-to-array to a pointer to the first element.
4149 try cg.accessChain(elem_ptr_ty_id, array_ptr_id, &.{0});
4150
4151 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4152 return try cg.constructComposite(slice_ty_id, &.{ elem_ptr_id, len_id });
4153}
4154
4155fn airSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4156 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4157 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4158 const ptr_id = try cg.resolve(bin_op.lhs);
4159 const len_id = try cg.resolve(bin_op.rhs);
4160 const slice_ty = cg.typeOfIndex(inst);
4161 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4162 return try cg.constructComposite(slice_ty_id, &.{ ptr_id, len_id });
4163}
4164
4165fn airAggregateInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4166 const gpa = cg.module.gpa;
4167 const pt = cg.pt;
4168 const zcu = cg.module.zcu;
4169 const ip = &zcu.intern_pool;
4170 const target = cg.module.zcu.getTarget();
4171 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4172 const result_ty = cg.typeOfIndex(inst);
4173 const len: usize = @intCast(result_ty.arrayLen(zcu));
4174 const elements: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[ty_pl.payload..][0..len]);
4175
4176 switch (result_ty.zigTypeTag(zcu)) {
4177 .@"struct" => {
4178 if (zcu.typeToPackedStruct(result_ty)) |struct_type| {
4179 comptime assert(Type.packed_struct_layout_version == 2);
4180 const backing_int_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
4181 var running_int_id = try cg.constInt(backing_int_ty, 0);
4182 var running_bits: u16 = 0;
4183 for (struct_type.field_types.get(ip), elements) |field_ty_ip, element| {
4184 const field_ty: Type = .fromInterned(field_ty_ip);
4185 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
4186 const field_id = try cg.resolve(element);
4187 const ty_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4188 const field_int_ty = try cg.pt.intType(.unsigned, ty_bit_size);
4189 const field_int_id = blk: {
4190 if (field_ty.isPtrAtRuntime(zcu)) {
4191 assert(target.cpu.arch == .spirv64 and
4192 field_ty.ptrAddressSpace(zcu) == .storage_buffer);
4193 break :blk try cg.intFromPtr(field_id);
4194 }
4195 break :blk try cg.bitCast(field_int_ty, field_ty, field_id);
4196 };
4197 const shift_rhs = try cg.constInt(backing_int_ty, running_bits);
4198 const extended_int_conv = try cg.buildConvert(backing_int_ty, .{
4199 .ty = field_int_ty,
4200 .value = .{ .singleton = field_int_id },
4201 });
4202 const shifted = try cg.buildBinary(.OpShiftLeftLogical, extended_int_conv, .{
4203 .ty = backing_int_ty,
4204 .value = .{ .singleton = shift_rhs },
4205 });
4206 const running_int_tmp = try cg.buildBinary(
4207 .OpBitwiseOr,
4208 .{ .ty = backing_int_ty, .value = .{ .singleton = running_int_id } },
4209 shifted,
4210 );
4211 running_int_id = try running_int_tmp.materialize(cg);
4212 running_bits += ty_bit_size;
4213 }
4214 return running_int_id;
4215 }
4216
4217 const types = try gpa.alloc(Type, elements.len);
4218 defer gpa.free(types);
4219 const constituents = try gpa.alloc(Id, elements.len);
4220 defer gpa.free(constituents);
4221 var index: usize = 0;
4222
4223 switch (ip.indexToKey(result_ty.toIntern())) {
4224 .tuple_type => |tuple| {
4225 for (tuple.types.get(ip), elements, 0..) |field_ty, element, i| {
4226 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4227 assert(Type.fromInterned(field_ty).hasRuntimeBits(zcu));
4228
4229 const id = try cg.resolve(element);
4230 types[index] = .fromInterned(field_ty);
4231 constituents[index] = try cg.convertToIndirect(.fromInterned(field_ty), id);
4232 index += 1;
4233 }
4234 },
4235 .struct_type => {
4236 const struct_type = ip.loadStructType(result_ty.toIntern());
4237 var it = struct_type.iterateRuntimeOrder(ip);
4238 for (elements, 0..) |element, i| {
4239 const field_index = it.next().?;
4240 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4241 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
4242 assert(field_ty.hasRuntimeBitsIgnoreComptime(zcu));
4243
4244 const id = try cg.resolve(element);
4245 types[index] = field_ty;
4246 constituents[index] = try cg.convertToIndirect(field_ty, id);
4247 index += 1;
4248 }
4249 },
4250 else => unreachable,
4251 }
4252
4253 const result_ty_id = try cg.resolveType(result_ty, .direct);
4254 return try cg.constructComposite(result_ty_id, constituents[0..index]);
4255 },
4256 .vector => {
4257 const n_elems = result_ty.vectorLen(zcu);
4258 const elem_ids = try gpa.alloc(Id, n_elems);
4259 defer gpa.free(elem_ids);
4260
4261 for (elements, 0..) |element, i| {
4262 elem_ids[i] = try cg.resolve(element);
4263 }
4264
4265 const result_ty_id = try cg.resolveType(result_ty, .direct);
4266 return try cg.constructComposite(result_ty_id, elem_ids);
4267 },
4268 .array => {
4269 const array_info = result_ty.arrayInfo(zcu);
4270 const n_elems: usize = @intCast(result_ty.arrayLenIncludingSentinel(zcu));
4271 const elem_ids = try gpa.alloc(Id, n_elems);
4272 defer gpa.free(elem_ids);
4273
4274 for (elements, 0..) |element, i| {
4275 const id = try cg.resolve(element);
4276 elem_ids[i] = try cg.convertToIndirect(array_info.elem_type, id);
4277 }
4278
4279 if (array_info.sentinel) |sentinel_val| {
4280 elem_ids[n_elems - 1] = try cg.constant(array_info.elem_type, sentinel_val, .indirect);
4281 }
4282
4283 const result_ty_id = try cg.resolveType(result_ty, .direct);
4284 return try cg.constructComposite(result_ty_id, elem_ids);
4285 },
4286 else => unreachable,
4287 }
4288}
4289
4290fn sliceOrArrayLen(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4291 const zcu = cg.module.zcu;
4292 switch (ty.ptrSize(zcu)) {
4293 .slice => return cg.extractField(.usize, operand_id, 1),
4294 .one => {
4295 const array_ty = ty.childType(zcu);
4296 const elem_ty = array_ty.childType(zcu);
4297 const abi_size = elem_ty.abiSize(zcu);
4298 const size = array_ty.arrayLenIncludingSentinel(zcu) * abi_size;
4299 return try cg.constInt(.usize, size);
4300 },
4301 .many, .c => unreachable,
4302 }
4303}
4304
4305fn sliceOrArrayPtr(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4306 const zcu = cg.module.zcu;
4307 if (ty.isSlice(zcu)) {
4308 const ptr_ty = ty.slicePtrFieldType(zcu);
4309 return cg.extractField(ptr_ty, operand_id, 0);
4310 }
4311 return operand_id;
4312}
4313
4314fn airMemcpy(cg: *CodeGen, inst: Air.Inst.Index) !void {
4315 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4316 const dest_slice = try cg.resolve(bin_op.lhs);
4317 const src_slice = try cg.resolve(bin_op.rhs);
4318 const dest_ty = cg.typeOf(bin_op.lhs);
4319 const src_ty = cg.typeOf(bin_op.rhs);
4320 const dest_ptr = try cg.sliceOrArrayPtr(dest_slice, dest_ty);
4321 const src_ptr = try cg.sliceOrArrayPtr(src_slice, src_ty);
4322 const len = try cg.sliceOrArrayLen(dest_slice, dest_ty);
4323 try cg.body.emit(cg.module.gpa, .OpCopyMemorySized, .{
4324 .target = dest_ptr,
4325 .source = src_ptr,
4326 .size = len,
4327 });
4328}
4329
4330fn airMemmove(cg: *CodeGen, inst: Air.Inst.Index) !void {
4331 _ = inst;
4332 return cg.fail("TODO implement airMemcpy for spirv", .{});
4333}
4334
4335fn airSliceField(cg: *CodeGen, inst: Air.Inst.Index, field: u32) !?Id {
4336 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4337 const field_ty = cg.typeOfIndex(inst);
4338 const operand_id = try cg.resolve(ty_op.operand);
4339 return try cg.extractField(field_ty, operand_id, field);
4340}
4341
4342fn airSliceElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4343 const zcu = cg.module.zcu;
4344 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4345 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4346 const slice_ty = cg.typeOf(bin_op.lhs);
4347 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4348
4349 const slice_id = try cg.resolve(bin_op.lhs);
4350 const index_id = try cg.resolve(bin_op.rhs);
4351
4352 const ptr_ty = cg.typeOfIndex(inst);
4353 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4354
4355 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4356 return try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4357}
4358
4359fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4360 const zcu = cg.module.zcu;
4361 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4362 const slice_ty = cg.typeOf(bin_op.lhs);
4363 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4364
4365 const slice_id = try cg.resolve(bin_op.lhs);
4366 const index_id = try cg.resolve(bin_op.rhs);
4367
4368 const ptr_ty = slice_ty.slicePtrFieldType(zcu);
4369 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4370
4371 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4372 const elem_ptr = try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4373 return try cg.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) });
4374}
4375
4376fn ptrElemPtr(cg: *CodeGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {
4377 const zcu = cg.module.zcu;
4378 // Construct new pointer type for the resulting pointer
4379 const elem_ty = ptr_ty.elemType2(zcu); // use elemType() so that we get T for *[N]T.
4380 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
4381 const elem_ptr_ty_id = try cg.module.ptrType(elem_ty_id, cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)));
4382 if (ptr_ty.isSinglePointer(zcu)) {
4383 // Pointer-to-array. In this case, the resulting pointer is not of the same type
4384 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.
4385 return try cg.accessChainId(elem_ptr_ty_id, ptr_id, &.{index_id});
4386 } else {
4387 // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain
4388 return try cg.ptrAccessChain(elem_ptr_ty_id, ptr_id, index_id, &.{});
4389 }
4390}
4391
4392fn airPtrElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4393 const zcu = cg.module.zcu;
4394 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4395 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4396 const src_ptr_ty = cg.typeOf(bin_op.lhs);
4397 const elem_ty = src_ptr_ty.childType(zcu);
4398 const ptr_id = try cg.resolve(bin_op.lhs);
4399
4400 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4401 const dst_ptr_ty = cg.typeOfIndex(inst);
4402 return try cg.bitCast(dst_ptr_ty, src_ptr_ty, ptr_id);
4403 }
4404
4405 const index_id = try cg.resolve(bin_op.rhs);
4406 return try cg.ptrElemPtr(src_ptr_ty, ptr_id, index_id);
4407}
4408
4409fn airArrayElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4410 const zcu = cg.module.zcu;
4411 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4412 const array_ty = cg.typeOf(bin_op.lhs);
4413 const elem_ty = array_ty.childType(zcu);
4414 const array_id = try cg.resolve(bin_op.lhs);
4415 const index_id = try cg.resolve(bin_op.rhs);
4416
4417 // SPIR-V doesn't have an array indexing function for some damn reason.
4418 // For now, just generate a temporary and use that.
4419 // TODO: This backend probably also should use isByRef from llvm...
4420
4421 const is_vector = array_ty.isVector(zcu);
4422
4423 const elem_repr: Repr = if (is_vector) .direct else .indirect;
4424 const array_ty_id = try cg.resolveType(array_ty, .direct);
4425 const elem_ty_id = try cg.resolveType(elem_ty, elem_repr);
4426 const ptr_array_ty_id = try cg.module.ptrType(array_ty_id, .function);
4427 const ptr_elem_ty_id = try cg.module.ptrType(elem_ty_id, .function);
4428
4429 const tmp_id = cg.module.allocId();
4430 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
4431 .id_result_type = ptr_array_ty_id,
4432 .id_result = tmp_id,
4433 .storage_class = .function,
4434 });
4435
4436 try cg.body.emit(cg.module.gpa, .OpStore, .{
4437 .pointer = tmp_id,
4438 .object = array_id,
4439 });
4440
4441 const elem_ptr_id = try cg.accessChainId(ptr_elem_ty_id, tmp_id, &.{index_id});
4442
4443 const result_id = cg.module.allocId();
4444 try cg.body.emit(cg.module.gpa, .OpLoad, .{
4445 .id_result_type = try cg.resolveType(elem_ty, elem_repr),
4446 .id_result = result_id,
4447 .pointer = elem_ptr_id,
4448 });
4449
4450 if (is_vector) {
4451 // Result is already in direct representation
4452 return result_id;
4453 }
4454
4455 // This is an array type; the elements are stored in indirect representation.
4456 // We have to convert the type to direct.
4457
4458 return try cg.convertToDirect(elem_ty, result_id);
4459}
4460
4461fn airPtrElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4462 const zcu = cg.module.zcu;
4463 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4464 const ptr_ty = cg.typeOf(bin_op.lhs);
4465 const elem_ty = cg.typeOfIndex(inst);
4466 const ptr_id = try cg.resolve(bin_op.lhs);
4467 const index_id = try cg.resolve(bin_op.rhs);
4468 const elem_ptr_id = try cg.ptrElemPtr(ptr_ty, ptr_id, index_id);
4469 return try cg.load(elem_ty, elem_ptr_id, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
4470}
4471
4472fn airVectorStoreElem(cg: *CodeGen, inst: Air.Inst.Index) !void {
4473 const zcu = cg.module.zcu;
4474 const data = cg.air.instructions.items(.data)[@intFromEnum(inst)].vector_store_elem;
4475 const extra = cg.air.extraData(Air.Bin, data.payload).data;
4476
4477 const vector_ptr_ty = cg.typeOf(data.vector_ptr);
4478 const vector_ty = vector_ptr_ty.childType(zcu);
4479 const scalar_ty = vector_ty.scalarType(zcu);
4480
4481 const scalar_ty_id = try cg.resolveType(scalar_ty, .indirect);
4482 const storage_class = cg.module.storageClass(vector_ptr_ty.ptrAddressSpace(zcu));
4483 const scalar_ptr_ty_id = try cg.module.ptrType(scalar_ty_id, storage_class);
4484
4485 const vector_ptr = try cg.resolve(data.vector_ptr);
4486 const index = try cg.resolve(extra.lhs);
4487 const operand = try cg.resolve(extra.rhs);
4488
4489 const elem_ptr_id = try cg.accessChainId(scalar_ptr_ty_id, vector_ptr, &.{index});
4490 try cg.store(scalar_ty, elem_ptr_id, operand, .{
4491 .is_volatile = vector_ptr_ty.isVolatilePtr(zcu),
4492 });
4493}
4494
4495fn airSetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !void {
4496 const zcu = cg.module.zcu;
4497 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4498 const un_ptr_ty = cg.typeOf(bin_op.lhs);
4499 const un_ty = un_ptr_ty.childType(zcu);
4500 const layout = cg.unionLayout(un_ty);
4501
4502 if (layout.tag_size == 0) return;
4503
4504 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4505 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);
4506 const tag_ptr_ty_id = try cg.module.ptrType(tag_ty_id, cg.module.storageClass(un_ptr_ty.ptrAddressSpace(zcu)));
4507
4508 const union_ptr_id = try cg.resolve(bin_op.lhs);
4509 const new_tag_id = try cg.resolve(bin_op.rhs);
4510
4511 if (!layout.has_payload) {
4512 try cg.store(tag_ty, union_ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4513 } else {
4514 const ptr_id = try cg.accessChain(tag_ptr_ty_id, union_ptr_id, &.{layout.tag_index});
4515 try cg.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4516 }
4517}
4518
4519fn airGetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4520 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4521 const un_ty = cg.typeOf(ty_op.operand);
4522
4523 const zcu = cg.module.zcu;
4524 const layout = cg.unionLayout(un_ty);
4525 if (layout.tag_size == 0) return null;
4526
4527 const union_handle = try cg.resolve(ty_op.operand);
4528 if (!layout.has_payload) return union_handle;
4529
4530 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4531 return try cg.extractField(tag_ty, union_handle, layout.tag_index);
4532}
4533
4534fn unionInit(
4535 cg: *CodeGen,
4536 ty: Type,
4537 active_field: u32,
4538 payload: ?Id,
4539) !Id {
4540 // To initialize a union, generate a temporary variable with the
4541 // union type, then get the field pointer and pointer-cast it to the
4542 // right type to store it. Finally load the entire union.
4543
4544 // Note: The result here is not cached, because it generates runtime code.
4545
4546 const pt = cg.pt;
4547 const zcu = cg.module.zcu;
4548 const ip = &zcu.intern_pool;
4549 const union_ty = zcu.typeToUnion(ty).?;
4550 const tag_ty: Type = .fromInterned(union_ty.enum_tag_ty);
4551
4552 const layout = cg.unionLayout(ty);
4553 const payload_ty: Type = .fromInterned(union_ty.field_types.get(ip)[active_field]);
4554
4555 if (union_ty.flagsUnordered(ip).layout == .@"packed") {
4556 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4557 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
4558 return cg.constInt(int_ty, 0);
4559 }
4560
4561 assert(payload != null);
4562 if (payload_ty.isInt(zcu)) {
4563 if (ty.bitSize(zcu) == payload_ty.bitSize(zcu)) {
4564 return cg.bitCast(ty, payload_ty, payload.?);
4565 }
4566
4567 const trunc = try cg.buildConvert(ty, .{ .ty = payload_ty, .value = .{ .singleton = payload.? } });
4568 return try trunc.materialize(cg);
4569 }
4570
4571 const payload_int_ty = try pt.intType(.unsigned, @intCast(payload_ty.bitSize(zcu)));
4572 const payload_int = if (payload_ty.ip_index == .bool_type)
4573 try cg.convertToIndirect(payload_ty, payload.?)
4574 else
4575 try cg.bitCast(payload_int_ty, payload_ty, payload.?);
4576 const trunc = try cg.buildConvert(ty, .{ .ty = payload_int_ty, .value = .{ .singleton = payload_int } });
4577 return try trunc.materialize(cg);
4578 }
4579
4580 const tag_int = if (layout.tag_size != 0) blk: {
4581 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);
4582 const tag_int_val = try tag_val.intFromEnum(tag_ty, pt);
4583 break :blk tag_int_val.toUnsignedInt(zcu);
4584 } else 0;
4585
4586 if (!layout.has_payload) {
4587 return try cg.constInt(tag_ty, tag_int);
4588 }
4589
4590 const tmp_id = try cg.alloc(ty, .{ .storage_class = .function });
4591
4592 if (layout.tag_size != 0) {
4593 const tag_ty_id = try cg.resolveType(tag_ty, .indirect);
4594 const tag_ptr_ty_id = try cg.module.ptrType(tag_ty_id, .function);
4595 const ptr_id = try cg.accessChain(tag_ptr_ty_id, tmp_id, &.{@as(u32, @intCast(layout.tag_index))});
4596 const tag_id = try cg.constInt(tag_ty, tag_int);
4597 try cg.store(tag_ty, ptr_id, tag_id, .{});
4598 }
4599
4600 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4601 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4602 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, .function);
4603 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4604 const active_pl_ptr_id = if (!layout.payload_ty.eql(payload_ty, zcu)) blk: {
4605 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
4606 const active_pl_ptr_ty_id = try cg.module.ptrType(payload_ty_id, .function);
4607 const active_pl_ptr_id = cg.module.allocId();
4608 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4609 .id_result_type = active_pl_ptr_ty_id,
4610 .id_result = active_pl_ptr_id,
4611 .operand = pl_ptr_id,
4612 });
4613 break :blk active_pl_ptr_id;
4614 } else pl_ptr_id;
4615
4616 try cg.store(payload_ty, active_pl_ptr_id, payload.?, .{});
4617 } else {
4618 assert(payload == null);
4619 }
4620
4621 // Just leave the padding fields uninitialized...
4622 // TODO: Or should we initialize them with undef explicitly?
4623
4624 return try cg.load(ty, tmp_id, .{});
4625}
4626
4627fn airUnionInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4628 const zcu = cg.module.zcu;
4629 const ip = &zcu.intern_pool;
4630 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4631 const extra = cg.air.extraData(Air.UnionInit, ty_pl.payload).data;
4632 const ty = cg.typeOfIndex(inst);
4633
4634 const union_obj = zcu.typeToUnion(ty).?;
4635 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[extra.field_index]);
4636 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
4637 try cg.resolve(extra.init)
4638 else
4639 null;
4640 return try cg.unionInit(ty, extra.field_index, payload);
4641}
4642
4643fn airStructFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4644 const pt = cg.pt;
4645 const zcu = cg.module.zcu;
4646 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4647 const struct_field = cg.air.extraData(Air.StructField, ty_pl.payload).data;
4648
4649 const object_ty = cg.typeOf(struct_field.struct_operand);
4650 const object_id = try cg.resolve(struct_field.struct_operand);
4651 const field_index = struct_field.field_index;
4652 const field_ty = object_ty.fieldType(field_index, zcu);
4653
4654 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
4655
4656 switch (object_ty.zigTypeTag(zcu)) {
4657 .@"struct" => switch (object_ty.containerLayout(zcu)) {
4658 .@"packed" => {
4659 const struct_ty = zcu.typeToPackedStruct(object_ty).?;
4660 const struct_backing_int_bits = cg.module.backingIntBits(@intCast(object_ty.bitSize(zcu))).@"0";
4661 const bit_offset = zcu.structPackedFieldBitOffset(struct_ty, field_index);
4662 // We use the same int type the packed struct is backed by, because even though it would
4663 // be valid SPIR-V to use an smaller type like u16, some implementations like PoCL will complain.
4664 const bit_offset_id = try cg.constInt(object_ty, bit_offset);
4665 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4666 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4667 const field_int_ty = try pt.intType(signedness, field_bit_size);
4668 const shift_lhs: Temporary = .{ .ty = object_ty, .value = .{ .singleton = object_id } };
4669 const shift = try cg.buildBinary(.OpShiftRightLogical, shift_lhs, .{ .ty = object_ty, .value = .{ .singleton = bit_offset_id } });
4670 const mask_id = try cg.constInt(object_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4671 const masked = try cg.buildBinary(.OpBitwiseAnd, shift, .{ .ty = object_ty, .value = .{ .singleton = mask_id } });
4672 const result_id = blk: {
4673 if (cg.module.backingIntBits(field_bit_size).@"0" == struct_backing_int_bits)
4674 break :blk try cg.bitCast(field_int_ty, object_ty, try masked.materialize(cg));
4675 const trunc = try cg.buildConvert(field_int_ty, masked);
4676 break :blk try trunc.materialize(cg);
4677 };
4678 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4679 if (field_ty.isInt(zcu)) return result_id;
4680 return try cg.bitCast(field_ty, field_int_ty, result_id);
4681 },
4682 else => return try cg.extractField(field_ty, object_id, field_index),
4683 },
4684 .@"union" => switch (object_ty.containerLayout(zcu)) {
4685 .@"packed" => {
4686 const backing_int_ty = try pt.intType(.unsigned, @intCast(object_ty.bitSize(zcu)));
4687 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4688 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4689 const int_ty = try pt.intType(signedness, field_bit_size);
4690 const mask_id = try cg.constInt(backing_int_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4691 const masked = try cg.buildBinary(
4692 .OpBitwiseAnd,
4693 .{ .ty = backing_int_ty, .value = .{ .singleton = object_id } },
4694 .{ .ty = backing_int_ty, .value = .{ .singleton = mask_id } },
4695 );
4696 const result_id = blk: {
4697 if (cg.module.backingIntBits(field_bit_size).@"0" == cg.module.backingIntBits(@intCast(backing_int_ty.bitSize(zcu))).@"0")
4698 break :blk try cg.bitCast(int_ty, backing_int_ty, try masked.materialize(cg));
4699 const trunc = try cg.buildConvert(int_ty, masked);
4700 break :blk try trunc.materialize(cg);
4701 };
4702 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4703 if (field_ty.isInt(zcu)) return result_id;
4704 return try cg.bitCast(field_ty, int_ty, result_id);
4705 },
4706 else => {
4707 // Store, ptr-elem-ptr, pointer-cast, load
4708 const layout = cg.unionLayout(object_ty);
4709 assert(layout.has_payload);
4710
4711 const tmp_id = try cg.alloc(object_ty, .{ .storage_class = .function });
4712 try cg.store(object_ty, tmp_id, object_id, .{});
4713
4714 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4715 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, .function);
4716 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4717
4718 const field_ty_id = try cg.resolveType(field_ty, .indirect);
4719 const active_pl_ptr_ty_id = try cg.module.ptrType(field_ty_id, .function);
4720 const active_pl_ptr_id = cg.module.allocId();
4721 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4722 .id_result_type = active_pl_ptr_ty_id,
4723 .id_result = active_pl_ptr_id,
4724 .operand = pl_ptr_id,
4725 });
4726 return try cg.load(field_ty, active_pl_ptr_id, .{});
4727 },
4728 },
4729 else => unreachable,
4730 }
4731}
4732
4733fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4734 const zcu = cg.module.zcu;
4735 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4736 const extra = cg.air.extraData(Air.FieldParentPtr, ty_pl.payload).data;
4737
4738 const parent_ty = ty_pl.ty.toType().childType(zcu);
4739 const result_ty_id = try cg.resolveType(ty_pl.ty.toType(), .indirect);
4740
4741 const field_ptr = try cg.resolve(extra.field_ptr);
4742 const field_ptr_int = try cg.intFromPtr(field_ptr);
4743 const field_offset = parent_ty.structFieldOffset(extra.field_index, zcu);
4744
4745 const base_ptr_int = base_ptr_int: {
4746 if (field_offset == 0) break :base_ptr_int field_ptr_int;
4747
4748 const field_offset_id = try cg.constInt(.usize, field_offset);
4749 const field_ptr_tmp: Temporary = .init(.usize, field_ptr_int);
4750 const field_offset_tmp: Temporary = .init(.usize, field_offset_id);
4751 const result = try cg.buildBinary(.OpISub, field_ptr_tmp, field_offset_tmp);
4752 break :base_ptr_int try result.materialize(cg);
4753 };
4754
4755 const base_ptr = cg.module.allocId();
4756 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
4757 .id_result_type = result_ty_id,
4758 .id_result = base_ptr,
4759 .integer_value = base_ptr_int,
4760 });
4761
4762 return base_ptr;
4763}
4764
4765fn structFieldPtr(
4766 cg: *CodeGen,
4767 result_ptr_ty: Type,
4768 object_ptr_ty: Type,
4769 object_ptr: Id,
4770 field_index: u32,
4771) !Id {
4772 const result_ty_id = try cg.resolveType(result_ptr_ty, .direct);
4773
4774 const zcu = cg.module.zcu;
4775 const object_ty = object_ptr_ty.childType(zcu);
4776 switch (object_ty.zigTypeTag(zcu)) {
4777 .pointer => {
4778 assert(object_ty.isSlice(zcu));
4779 return cg.accessChain(result_ty_id, object_ptr, &.{field_index});
4780 },
4781 .@"struct" => switch (object_ty.containerLayout(zcu)) {
4782 .@"packed" => return cg.todo("implement field access for packed structs", .{}),
4783 else => {
4784 return try cg.accessChain(result_ty_id, object_ptr, &.{field_index});
4785 },
4786 },
4787 .@"union" => {
4788 const layout = cg.unionLayout(object_ty);
4789 if (!layout.has_payload) {
4790 // Asked to get a pointer to a zero-sized field. Just lower this
4791 // to undefined, there is no reason to make it be a valid pointer.
4792 return try cg.module.constUndef(result_ty_id);
4793 }
4794
4795 const storage_class = cg.module.storageClass(object_ptr_ty.ptrAddressSpace(zcu));
4796 const layout_payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
4797 const pl_ptr_ty_id = try cg.module.ptrType(layout_payload_ty_id, storage_class);
4798 const pl_ptr_id = blk: {
4799 if (object_ty.containerLayout(zcu) == .@"packed") break :blk object_ptr;
4800 break :blk try cg.accessChain(pl_ptr_ty_id, object_ptr, &.{layout.payload_index});
4801 };
4802
4803 const active_pl_ptr_id = cg.module.allocId();
4804 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4805 .id_result_type = result_ty_id,
4806 .id_result = active_pl_ptr_id,
4807 .operand = pl_ptr_id,
4808 });
4809 return active_pl_ptr_id;
4810 },
4811 else => unreachable,
4812 }
4813}
4814
4815fn airStructFieldPtrIndex(cg: *CodeGen, inst: Air.Inst.Index, field_index: u32) !?Id {
4816 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4817 const struct_ptr = try cg.resolve(ty_op.operand);
4818 const struct_ptr_ty = cg.typeOf(ty_op.operand);
4819 const result_ptr_ty = cg.typeOfIndex(inst);
4820 return try cg.structFieldPtr(result_ptr_ty, struct_ptr_ty, struct_ptr, field_index);
4821}
4822
4823const AllocOptions = struct {
4824 initializer: ?Id = null,
4825 /// The final storage class of the pointer. This may be either `.Generic` or `.Function`.
4826 /// In either case, the local is allocated in the `.Function` storage class, and optionally
4827 /// cast back to `.Generic`.
4828 storage_class: StorageClass,
4829};
4830
4831// Allocate a function-local variable, with possible initializer.
4832// This function returns a pointer to a variable of type `ty`,
4833// which is in the Generic address space. The variable is actually
4834// placed in the Function address space.
4835fn alloc(
4836 cg: *CodeGen,
4837 ty: Type,
4838 options: AllocOptions,
4839) !Id {
4840 const ty_id = try cg.resolveType(ty, .indirect);
4841 const ptr_fn_ty_id = try cg.module.ptrType(ty_id, .function);
4842
4843 // SPIR-V requires that OpVariable declarations for locals go into the first block, so we are just going to
4844 // directly generate them into func.prologue instead of the body.
4845 const var_id = cg.module.allocId();
4846 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
4847 .id_result_type = ptr_fn_ty_id,
4848 .id_result = var_id,
4849 .storage_class = .function,
4850 .initializer = options.initializer,
4851 });
4852
4853 return var_id;
4854}
4855
4856fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4857 const zcu = cg.module.zcu;
4858 const ptr_ty = cg.typeOfIndex(inst);
4859 const child_ty = ptr_ty.childType(zcu);
4860 return try cg.alloc(child_ty, .{
4861 .storage_class = cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)),
4862 });
4863}
4864
4865fn airArg(cg: *CodeGen) Id {
4866 defer cg.next_arg_index += 1;
4867 return cg.args.items[cg.next_arg_index];
4868}
4869
4870/// Given a slice of incoming block connections, returns the block-id of the next
4871/// block to jump to. This function emits instructions, so it should be emitted
4872/// inside the merge block of the block.
4873/// This function should only be called with structured control flow generation.
4874fn structuredNextBlock(cg: *CodeGen, incoming: []const ControlFlow.Structured.Block.Incoming) !Id {
4875 assert(cg.control_flow == .structured);
4876
4877 const result_id = cg.module.allocId();
4878 const block_id_ty_id = try cg.resolveType(.u32, .direct);
4879 try cg.body.emitRaw(cg.module.gpa, .OpPhi, @intCast(2 + incoming.len * 2)); // result type + result + variable/parent...
4880 cg.body.writeOperand(Id, block_id_ty_id);
4881 cg.body.writeOperand(Id, result_id);
4882
4883 for (incoming) |incoming_block| {
4884 cg.body.writeOperand(spec.PairIdRefIdRef, .{ incoming_block.next_block, incoming_block.src_label });
4885 }
4886
4887 return result_id;
4888}
4889
4890/// Jumps to the block with the target block-id. This function must only be called when
4891/// terminating a body, there should be no instructions after it.
4892/// This function should only be called with structured control flow generation.
4893fn structuredBreak(cg: *CodeGen, target_block: Id) !void {
4894 assert(cg.control_flow == .structured);
4895
4896 const gpa = cg.module.gpa;
4897 const sblock = cg.control_flow.structured.block_stack.getLast();
4898 const merge_block = switch (sblock.*) {
4899 .selection => |*merge| blk: {
4900 const merge_label = cg.module.allocId();
4901 try merge.merge_stack.append(gpa, .{
4902 .incoming = .{
4903 .src_label = cg.block_label,
4904 .next_block = target_block,
4905 },
4906 .merge_block = merge_label,
4907 });
4908 break :blk merge_label;
4909 },
4910 // Loop blocks do not end in a break. Not through a direct break,
4911 // and also not through another instruction like cond_br or unreachable (these
4912 // situations are replaced by `cond_br` in sema, or there is a `block` instruction
4913 // placed around them).
4914 .loop => unreachable,
4915 };
4916
4917 try cg.body.emitBranch(cg.module.gpa, merge_block);
4918}
4919
4920/// Generate a body in a way that exits the body using only structured constructs.
4921/// Returns the block-id of the next block to jump to. After this function, a jump
4922/// should still be emitted to the block that should follow this structured body.
4923/// This function should only be called with structured control flow generation.
4924fn genStructuredBody(
4925 cg: *CodeGen,
4926 /// This parameter defines the method that this structured body is exited with.
4927 block_merge_type: union(enum) {
4928 /// Using selection; early exits from this body are surrounded with
4929 /// if() statements.
4930 selection,
4931 /// Using loops; loops can be early exited by jumping to the merge block at
4932 /// any time.
4933 loop: struct {
4934 merge_label: Id,
4935 continue_label: Id,
4936 },
4937 },
4938 body: []const Air.Inst.Index,
4939) !Id {
4940 assert(cg.control_flow == .structured);
4941
4942 const gpa = cg.module.gpa;
4943
4944 var sblock: ControlFlow.Structured.Block = switch (block_merge_type) {
4945 .loop => |merge| .{ .loop = .{
4946 .merge_block = merge.merge_label,
4947 } },
4948 .selection => .{ .selection = .{} },
4949 };
4950 defer sblock.deinit(gpa);
4951
4952 {
4953 try cg.control_flow.structured.block_stack.append(gpa, &sblock);
4954 defer _ = cg.control_flow.structured.block_stack.pop();
4955
4956 try cg.genBody(body);
4957 }
4958
4959 switch (sblock) {
4960 .selection => |merge| {
4961 // Now generate the merge block for all merges that
4962 // still need to be performed.
4963 const merge_stack = merge.merge_stack.items;
4964
4965 // If no merges on the stack, this block didn't generate any jumps (all paths
4966 // ended with a return or an unreachable). In that case, we don't need to do
4967 // any merging.
4968 if (merge_stack.len == 0) {
4969 // We still need to return a value of a next block to jump to.
4970 // For example, if we have code like
4971 // if (x) {
4972 // if (y) return else return;
4973 // } else {}
4974 // then we still need the outer to have an OpSelectionMerge and consequently
4975 // a phi node. In that case we can just return bogus, since we know that its
4976 // path will never be taken.
4977
4978 // Make sure that we are still in a block when exiting the function.
4979 // TODO: Can we get rid of that?
4980 try cg.beginSpvBlock(cg.module.allocId());
4981 const block_id_ty_id = try cg.resolveType(.u32, .direct);
4982 return try cg.module.constUndef(block_id_ty_id);
4983 }
4984
4985 // The top-most merge actually only has a single source, the
4986 // final jump of the block, or the merge block of a sub-block, cond_br,
4987 // or loop. Therefore we just need to generate a block with a jump to the
4988 // next merge block.
4989 try cg.beginSpvBlock(merge_stack[merge_stack.len - 1].merge_block);
4990
4991 // Now generate a merge ladder for the remaining merges in the stack.
4992 var incoming: ControlFlow.Structured.Block.Incoming = .{
4993 .src_label = cg.block_label,
4994 .next_block = merge_stack[merge_stack.len - 1].incoming.next_block,
4995 };
4996 var i = merge_stack.len - 1;
4997 while (i > 0) {
4998 i -= 1;
4999 const step = merge_stack[i];
5000 try cg.body.emitBranch(cg.module.gpa, step.merge_block);
5001 try cg.beginSpvBlock(step.merge_block);
5002 const next_block = try cg.structuredNextBlock(&.{ incoming, step.incoming });
5003 incoming = .{
5004 .src_label = step.merge_block,
5005 .next_block = next_block,
5006 };
5007 }
5008
5009 return incoming.next_block;
5010 },
5011 .loop => |merge| {
5012 // Close the loop by jumping to the continue label
5013 try cg.body.emitBranch(cg.module.gpa, block_merge_type.loop.continue_label);
5014 // For blocks we must simple merge all the incoming blocks to get the next block.
5015 try cg.beginSpvBlock(merge.merge_block);
5016 return try cg.structuredNextBlock(merge.merges.items);
5017 },
5018 }
5019}
5020
5021fn airBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5022 const inst_datas = cg.air.instructions.items(.data);
5023 const extra = cg.air.extraData(Air.Block, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5024 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
5025}
5026
5027fn lowerBlock(cg: *CodeGen, inst: Air.Inst.Index, body: []const Air.Inst.Index) !?Id {
5028 // In AIR, a block doesn't really define an entry point like a block, but
5029 // more like a scope that breaks can jump out of and "return" a value from.
5030 // This cannot be directly modelled in SPIR-V, so in a block instruction,
5031 // we're going to split up the current block by first generating the code
5032 // of the block, then a label, and then generate the rest of the current
5033 // ir.Block in a different SPIR-V block.
5034
5035 const gpa = cg.module.gpa;
5036 const zcu = cg.module.zcu;
5037 const ty = cg.typeOfIndex(inst);
5038 const have_block_result = ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu);
5039
5040 const cf = switch (cg.control_flow) {
5041 .structured => |*cf| cf,
5042 .unstructured => |*cf| {
5043 var block: ControlFlow.Unstructured.Block = .{};
5044 defer block.incoming_blocks.deinit(gpa);
5045
5046 // 4 chosen as arbitrary initial capacity.
5047 try block.incoming_blocks.ensureUnusedCapacity(gpa, 4);
5048
5049 try cf.blocks.putNoClobber(gpa, inst, &block);
5050 defer assert(cf.blocks.remove(inst));
5051
5052 try cg.genBody(body);
5053
5054 // Only begin a new block if there were actually any breaks towards it.
5055 if (block.label) |label| {
5056 try cg.beginSpvBlock(label);
5057 }
5058
5059 if (!have_block_result)
5060 return null;
5061
5062 assert(block.label != null);
5063 const result_id = cg.module.allocId();
5064 const result_type_id = try cg.resolveType(ty, .direct);
5065
5066 try cg.body.emitRaw(
5067 cg.module.gpa,
5068 .OpPhi,
5069 // result type + result + variable/parent...
5070 2 + @as(u16, @intCast(block.incoming_blocks.items.len * 2)),
5071 );
5072 cg.body.writeOperand(Id, result_type_id);
5073 cg.body.writeOperand(Id, result_id);
5074
5075 for (block.incoming_blocks.items) |incoming| {
5076 cg.body.writeOperand(
5077 spec.PairIdRefIdRef,
5078 .{ incoming.break_value_id, incoming.src_label },
5079 );
5080 }
5081
5082 return result_id;
5083 },
5084 };
5085
5086 const maybe_block_result_var_id = if (have_block_result) blk: {
5087 const block_result_var_id = try cg.alloc(ty, .{ .storage_class = .function });
5088 try cf.block_results.putNoClobber(gpa, inst, block_result_var_id);
5089 break :blk block_result_var_id;
5090 } else null;
5091 defer if (have_block_result) assert(cf.block_results.remove(inst));
5092
5093 const next_block = try cg.genStructuredBody(.selection, body);
5094
5095 // When encountering a block instruction, we are always at least in the function's scope,
5096 // so there always has to be another entry.
5097 assert(cf.block_stack.items.len > 0);
5098
5099 // Check if the target of the branch was this current block.
5100 const this_block = try cg.constInt(.u32, @intFromEnum(inst));
5101 const jump_to_this_block_id = cg.module.allocId();
5102 const bool_ty_id = try cg.resolveType(.bool, .direct);
5103 try cg.body.emit(cg.module.gpa, .OpIEqual, .{
5104 .id_result_type = bool_ty_id,
5105 .id_result = jump_to_this_block_id,
5106 .operand_1 = next_block,
5107 .operand_2 = this_block,
5108 });
5109
5110 const sblock = cf.block_stack.getLast();
5111
5112 if (ty.isNoReturn(zcu)) {
5113 // If this block is noreturn, this instruction is the last of a block,
5114 // and we must simply jump to the block's merge unconditionally.
5115 try cg.structuredBreak(next_block);
5116 } else {
5117 switch (sblock.*) {
5118 .selection => |*merge| {
5119 // To jump out of a selection block, push a new entry onto its merge stack and
5120 // generate a conditional branch to there and to the instructions following this block.
5121 const merge_label = cg.module.allocId();
5122 const then_label = cg.module.allocId();
5123 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5124 .merge_block = merge_label,
5125 .selection_control = .{},
5126 });
5127 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5128 .condition = jump_to_this_block_id,
5129 .true_label = then_label,
5130 .false_label = merge_label,
5131 });
5132 try merge.merge_stack.append(gpa, .{
5133 .incoming = .{
5134 .src_label = cg.block_label,
5135 .next_block = next_block,
5136 },
5137 .merge_block = merge_label,
5138 });
5139
5140 try cg.beginSpvBlock(then_label);
5141 },
5142 .loop => |*merge| {
5143 // To jump out of a loop block, generate a conditional that exits the block
5144 // to the loop merge if the target ID is not the one of this block.
5145 const continue_label = cg.module.allocId();
5146 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5147 .condition = jump_to_this_block_id,
5148 .true_label = continue_label,
5149 .false_label = merge.merge_block,
5150 });
5151 try merge.merges.append(gpa, .{
5152 .src_label = cg.block_label,
5153 .next_block = next_block,
5154 });
5155 try cg.beginSpvBlock(continue_label);
5156 },
5157 }
5158 }
5159
5160 if (maybe_block_result_var_id) |block_result_var_id| {
5161 return try cg.load(ty, block_result_var_id, .{});
5162 }
5163
5164 return null;
5165}
5166
5167fn airBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5168 const gpa = cg.module.gpa;
5169 const zcu = cg.module.zcu;
5170 const br = cg.air.instructions.items(.data)[@intFromEnum(inst)].br;
5171 const operand_ty = cg.typeOf(br.operand);
5172
5173 switch (cg.control_flow) {
5174 .structured => |*cf| {
5175 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5176 const operand_id = try cg.resolve(br.operand);
5177 const block_result_var_id = cf.block_results.get(br.block_inst).?;
5178 try cg.store(operand_ty, block_result_var_id, operand_id, .{});
5179 }
5180
5181 const next_block = try cg.constInt(.u32, @intFromEnum(br.block_inst));
5182 try cg.structuredBreak(next_block);
5183 },
5184 .unstructured => |cf| {
5185 const block = cf.blocks.get(br.block_inst).?;
5186 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5187 const operand_id = try cg.resolve(br.operand);
5188 // block_label should not be undefined here, lest there
5189 // is a br or br_void in the function's body.
5190 try block.incoming_blocks.append(gpa, .{
5191 .src_label = cg.block_label,
5192 .break_value_id = operand_id,
5193 });
5194 }
5195
5196 if (block.label == null) {
5197 block.label = cg.module.allocId();
5198 }
5199
5200 try cg.body.emitBranch(cg.module.gpa, block.label.?);
5201 },
5202 }
5203}
5204
5205fn airCondBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5206 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5207 const cond_br = cg.air.extraData(Air.CondBr, pl_op.payload);
5208 const then_body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[cond_br.end..][0..cond_br.data.then_body_len]);
5209 const else_body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[cond_br.end + then_body.len ..][0..cond_br.data.else_body_len]);
5210 const condition_id = try cg.resolve(pl_op.operand);
5211
5212 const then_label = cg.module.allocId();
5213 const else_label = cg.module.allocId();
5214
5215 switch (cg.control_flow) {
5216 .structured => {
5217 const merge_label = cg.module.allocId();
5218
5219 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5220 .merge_block = merge_label,
5221 .selection_control = .{},
5222 });
5223 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5224 .condition = condition_id,
5225 .true_label = then_label,
5226 .false_label = else_label,
5227 });
5228
5229 try cg.beginSpvBlock(then_label);
5230 const then_next = try cg.genStructuredBody(.selection, then_body);
5231 const then_incoming: ControlFlow.Structured.Block.Incoming = .{
5232 .src_label = cg.block_label,
5233 .next_block = then_next,
5234 };
5235 try cg.body.emitBranch(cg.module.gpa, merge_label);
5236
5237 try cg.beginSpvBlock(else_label);
5238 const else_next = try cg.genStructuredBody(.selection, else_body);
5239 const else_incoming: ControlFlow.Structured.Block.Incoming = .{
5240 .src_label = cg.block_label,
5241 .next_block = else_next,
5242 };
5243 try cg.body.emitBranch(cg.module.gpa, merge_label);
5244
5245 try cg.beginSpvBlock(merge_label);
5246 const next_block = try cg.structuredNextBlock(&.{ then_incoming, else_incoming });
5247
5248 try cg.structuredBreak(next_block);
5249 },
5250 .unstructured => {
5251 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5252 .condition = condition_id,
5253 .true_label = then_label,
5254 .false_label = else_label,
5255 });
5256
5257 try cg.beginSpvBlock(then_label);
5258 try cg.genBody(then_body);
5259 try cg.beginSpvBlock(else_label);
5260 try cg.genBody(else_body);
5261 },
5262 }
5263}
5264
5265fn airLoop(cg: *CodeGen, inst: Air.Inst.Index) !void {
5266 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5267 const loop = cg.air.extraData(Air.Block, ty_pl.payload);
5268 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[loop.end..][0..loop.data.body_len]);
5269
5270 const body_label = cg.module.allocId();
5271
5272 switch (cg.control_flow) {
5273 .structured => {
5274 const header_label = cg.module.allocId();
5275 const merge_label = cg.module.allocId();
5276 const continue_label = cg.module.allocId();
5277
5278 // The back-edge must point to the loop header, so generate a separate block for the
5279 // loop header so that we don't accidentally include some instructions from there
5280 // in the loop.
5281 try cg.body.emitBranch(cg.module.gpa, header_label);
5282 try cg.beginSpvBlock(header_label);
5283
5284 // Emit loop header and jump to loop body
5285 try cg.body.emit(cg.module.gpa, .OpLoopMerge, .{
5286 .merge_block = merge_label,
5287 .continue_target = continue_label,
5288 .loop_control = .{},
5289 });
5290 try cg.body.emitBranch(cg.module.gpa, body_label);
5291
5292 try cg.beginSpvBlock(body_label);
5293
5294 const next_block = try cg.genStructuredBody(.{ .loop = .{
5295 .merge_label = merge_label,
5296 .continue_label = continue_label,
5297 } }, body);
5298 try cg.structuredBreak(next_block);
5299
5300 try cg.beginSpvBlock(continue_label);
5301 try cg.body.emitBranch(cg.module.gpa, header_label);
5302 },
5303 .unstructured => {
5304 try cg.body.emitBranch(cg.module.gpa, body_label);
5305 try cg.beginSpvBlock(body_label);
5306 try cg.genBody(body);
5307 try cg.body.emitBranch(cg.module.gpa, body_label);
5308 },
5309 }
5310}
5311
5312fn airLoad(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5313 const zcu = cg.module.zcu;
5314 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5315 const ptr_ty = cg.typeOf(ty_op.operand);
5316 const elem_ty = cg.typeOfIndex(inst);
5317 const operand = try cg.resolve(ty_op.operand);
5318 if (!ptr_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
5319
5320 return try cg.load(elem_ty, operand, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5321}
5322
5323fn airStore(cg: *CodeGen, inst: Air.Inst.Index) !void {
5324 const zcu = cg.module.zcu;
5325 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
5326 const ptr_ty = cg.typeOf(bin_op.lhs);
5327 const elem_ty = ptr_ty.childType(zcu);
5328 const ptr = try cg.resolve(bin_op.lhs);
5329 const value = try cg.resolve(bin_op.rhs);
5330
5331 try cg.store(elem_ty, ptr, value, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5332}
5333
5334fn airRet(cg: *CodeGen, inst: Air.Inst.Index) !void {
5335 const zcu = cg.module.zcu;
5336 const operand = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5337 const ret_ty = cg.typeOf(operand);
5338 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5339 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5340 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5341 // Functions with an empty error set are emitted with an error code
5342 // return type and return zero so they can be function pointers coerced
5343 // to functions that return anyerror.
5344 const no_err_id = try cg.constInt(.anyerror, 0);
5345 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5346 } else {
5347 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5348 }
5349 }
5350
5351 const operand_id = try cg.resolve(operand);
5352 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = operand_id });
5353}
5354
5355fn airRetLoad(cg: *CodeGen, inst: Air.Inst.Index) !void {
5356 const zcu = cg.module.zcu;
5357 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5358 const ptr_ty = cg.typeOf(un_op);
5359 const ret_ty = ptr_ty.childType(zcu);
5360
5361 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5362 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5363 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5364 // Functions with an empty error set are emitted with an error code
5365 // return type and return zero so they can be function pointers coerced
5366 // to functions that return anyerror.
5367 const no_err_id = try cg.constInt(.anyerror, 0);
5368 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5369 } else {
5370 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5371 }
5372 }
5373
5374 const ptr = try cg.resolve(un_op);
5375 const value = try cg.load(ret_ty, ptr, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5376 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{
5377 .value = value,
5378 });
5379}
5380
5381fn airTry(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5382 const zcu = cg.module.zcu;
5383 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5384 const err_union_id = try cg.resolve(pl_op.operand);
5385 const extra = cg.air.extraData(Air.Try, pl_op.payload);
5386 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]);
5387
5388 const err_union_ty = cg.typeOf(pl_op.operand);
5389 const payload_ty = cg.typeOfIndex(inst);
5390
5391 const bool_ty_id = try cg.resolveType(.bool, .direct);
5392
5393 const eu_layout = cg.errorUnionLayout(payload_ty);
5394
5395 if (!err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5396 const err_id = if (eu_layout.payload_has_bits)
5397 try cg.extractField(.anyerror, err_union_id, eu_layout.errorFieldIndex())
5398 else
5399 err_union_id;
5400
5401 const zero_id = try cg.constInt(.anyerror, 0);
5402 const is_err_id = cg.module.allocId();
5403 try cg.body.emit(cg.module.gpa, .OpINotEqual, .{
5404 .id_result_type = bool_ty_id,
5405 .id_result = is_err_id,
5406 .operand_1 = err_id,
5407 .operand_2 = zero_id,
5408 });
5409
5410 // When there is an error, we must evaluate `body`. Otherwise we must continue
5411 // with the current body.
5412 // Just generate a new block here, then generate a new block inline for the remainder of the body.
5413
5414 const err_block = cg.module.allocId();
5415 const ok_block = cg.module.allocId();
5416
5417 switch (cg.control_flow) {
5418 .structured => {
5419 // According to AIR documentation, this block is guaranteed
5420 // to not break and end in a return instruction. Thus,
5421 // for structured control flow, we can just naively use
5422 // the ok block as the merge block here.
5423 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5424 .merge_block = ok_block,
5425 .selection_control = .{},
5426 });
5427 },
5428 .unstructured => {},
5429 }
5430
5431 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5432 .condition = is_err_id,
5433 .true_label = err_block,
5434 .false_label = ok_block,
5435 });
5436
5437 try cg.beginSpvBlock(err_block);
5438 try cg.genBody(body);
5439
5440 try cg.beginSpvBlock(ok_block);
5441 }
5442
5443 if (!eu_layout.payload_has_bits) {
5444 return null;
5445 }
5446
5447 // Now just extract the payload, if required.
5448 return try cg.extractField(payload_ty, err_union_id, eu_layout.payloadFieldIndex());
5449}
5450
5451fn airErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5452 const zcu = cg.module.zcu;
5453 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5454 const operand_id = try cg.resolve(ty_op.operand);
5455 const err_union_ty = cg.typeOf(ty_op.operand);
5456 const err_ty_id = try cg.resolveType(.anyerror, .direct);
5457
5458 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5459 // No error possible, so just return undefined.
5460 return try cg.module.constUndef(err_ty_id);
5461 }
5462
5463 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5464 const eu_layout = cg.errorUnionLayout(payload_ty);
5465
5466 if (!eu_layout.payload_has_bits) {
5467 // If no payload, error union is represented by error set.
5468 return operand_id;
5469 }
5470
5471 return try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5472}
5473
5474fn airErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5475 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5476 const operand_id = try cg.resolve(ty_op.operand);
5477 const payload_ty = cg.typeOfIndex(inst);
5478 const eu_layout = cg.errorUnionLayout(payload_ty);
5479
5480 if (!eu_layout.payload_has_bits) {
5481 return null; // No error possible.
5482 }
5483
5484 return try cg.extractField(payload_ty, operand_id, eu_layout.payloadFieldIndex());
5485}
5486
5487fn airWrapErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5488 const zcu = cg.module.zcu;
5489 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5490 const err_union_ty = cg.typeOfIndex(inst);
5491 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5492 const operand_id = try cg.resolve(ty_op.operand);
5493 const eu_layout = cg.errorUnionLayout(payload_ty);
5494
5495 if (!eu_layout.payload_has_bits) {
5496 return operand_id;
5497 }
5498
5499 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
5500
5501 var members: [2]Id = undefined;
5502 members[eu_layout.errorFieldIndex()] = operand_id;
5503 members[eu_layout.payloadFieldIndex()] = try cg.module.constUndef(payload_ty_id);
5504
5505 var types: [2]Type = undefined;
5506 types[eu_layout.errorFieldIndex()] = .anyerror;
5507 types[eu_layout.payloadFieldIndex()] = payload_ty;
5508
5509 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5510 return try cg.constructComposite(err_union_ty_id, &members);
5511}
5512
5513fn airWrapErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5514 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5515 const err_union_ty = cg.typeOfIndex(inst);
5516 const operand_id = try cg.resolve(ty_op.operand);
5517 const payload_ty = cg.typeOf(ty_op.operand);
5518 const eu_layout = cg.errorUnionLayout(payload_ty);
5519
5520 if (!eu_layout.payload_has_bits) {
5521 return try cg.constInt(.anyerror, 0);
5522 }
5523
5524 var members: [2]Id = undefined;
5525 members[eu_layout.errorFieldIndex()] = try cg.constInt(.anyerror, 0);
5526 members[eu_layout.payloadFieldIndex()] = try cg.convertToIndirect(payload_ty, operand_id);
5527
5528 var types: [2]Type = undefined;
5529 types[eu_layout.errorFieldIndex()] = .anyerror;
5530 types[eu_layout.payloadFieldIndex()] = payload_ty;
5531
5532 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5533 return try cg.constructComposite(err_union_ty_id, &members);
5534}
5535
5536fn airIsNull(cg: *CodeGen, inst: Air.Inst.Index, is_pointer: bool, pred: enum { is_null, is_non_null }) !?Id {
5537 const zcu = cg.module.zcu;
5538 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5539 const operand_id = try cg.resolve(un_op);
5540 const operand_ty = cg.typeOf(un_op);
5541 const optional_ty = if (is_pointer) operand_ty.childType(zcu) else operand_ty;
5542 const payload_ty = optional_ty.optionalChild(zcu);
5543
5544 const bool_ty_id = try cg.resolveType(.bool, .direct);
5545
5546 if (optional_ty.optionalReprIsPayload(zcu)) {
5547 // Pointer payload represents nullability: pointer or slice.
5548 const loaded_id = if (is_pointer)
5549 try cg.load(optional_ty, operand_id, .{})
5550 else
5551 operand_id;
5552
5553 const ptr_ty = if (payload_ty.isSlice(zcu))
5554 payload_ty.slicePtrFieldType(zcu)
5555 else
5556 payload_ty;
5557
5558 const ptr_id = if (payload_ty.isSlice(zcu))
5559 try cg.extractField(ptr_ty, loaded_id, 0)
5560 else
5561 loaded_id;
5562
5563 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
5564 const null_id = try cg.module.constNull(ptr_ty_id);
5565 const null_tmp: Temporary = .init(ptr_ty, null_id);
5566 const ptr: Temporary = .init(ptr_ty, ptr_id);
5567
5568 const op: std.math.CompareOperator = switch (pred) {
5569 .is_null => .eq,
5570 .is_non_null => .neq,
5571 };
5572 const result = try cg.cmp(op, ptr, null_tmp);
5573 return try result.materialize(cg);
5574 }
5575
5576 const is_non_null_id = blk: {
5577 if (is_pointer) {
5578 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5579 const storage_class = cg.module.storageClass(operand_ty.ptrAddressSpace(zcu));
5580 const bool_indirect_ty_id = try cg.resolveType(.bool, .indirect);
5581 const bool_ptr_ty_id = try cg.module.ptrType(bool_indirect_ty_id, storage_class);
5582 const tag_ptr_id = try cg.accessChain(bool_ptr_ty_id, operand_id, &.{1});
5583 break :blk try cg.load(.bool, tag_ptr_id, .{});
5584 }
5585
5586 break :blk try cg.load(.bool, operand_id, .{});
5587 }
5588
5589 break :blk if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
5590 try cg.extractField(.bool, operand_id, 1)
5591 else
5592 // Optional representation is bool indicating whether the optional is set
5593 // Optionals with no payload are represented as an (indirect) bool, so convert
5594 // it back to the direct bool here.
5595 try cg.convertToDirect(.bool, operand_id);
5596 };
5597
5598 return switch (pred) {
5599 .is_null => blk: {
5600 // Invert condition
5601 const result_id = cg.module.allocId();
5602 try cg.body.emit(cg.module.gpa, .OpLogicalNot, .{
5603 .id_result_type = bool_ty_id,
5604 .id_result = result_id,
5605 .operand = is_non_null_id,
5606 });
5607 break :blk result_id;
5608 },
5609 .is_non_null => is_non_null_id,
5610 };
5611}
5612
5613fn airIsErr(cg: *CodeGen, inst: Air.Inst.Index, pred: enum { is_err, is_non_err }) !?Id {
5614 const zcu = cg.module.zcu;
5615 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5616 const operand_id = try cg.resolve(un_op);
5617 const err_union_ty = cg.typeOf(un_op);
5618
5619 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5620 return try cg.constBool(pred == .is_non_err, .direct);
5621 }
5622
5623 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5624 const eu_layout = cg.errorUnionLayout(payload_ty);
5625 const bool_ty_id = try cg.resolveType(.bool, .direct);
5626
5627 const error_id = if (!eu_layout.payload_has_bits)
5628 operand_id
5629 else
5630 try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5631
5632 const result_id = cg.module.allocId();
5633 switch (pred) {
5634 inline else => |pred_ct| try cg.body.emit(
5635 cg.module.gpa,
5636 switch (pred_ct) {
5637 .is_err => .OpINotEqual,
5638 .is_non_err => .OpIEqual,
5639 },
5640 .{
5641 .id_result_type = bool_ty_id,
5642 .id_result = result_id,
5643 .operand_1 = error_id,
5644 .operand_2 = try cg.constInt(.anyerror, 0),
5645 },
5646 ),
5647 }
5648 return result_id;
5649}
5650
5651fn airUnwrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5652 const zcu = cg.module.zcu;
5653 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5654 const operand_id = try cg.resolve(ty_op.operand);
5655 const optional_ty = cg.typeOf(ty_op.operand);
5656 const payload_ty = cg.typeOfIndex(inst);
5657
5658 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
5659
5660 if (optional_ty.optionalReprIsPayload(zcu)) {
5661 return operand_id;
5662 }
5663
5664 return try cg.extractField(payload_ty, operand_id, 0);
5665}
5666
5667fn airUnwrapOptionalPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5668 const zcu = cg.module.zcu;
5669 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5670 const operand_id = try cg.resolve(ty_op.operand);
5671 const operand_ty = cg.typeOf(ty_op.operand);
5672 const optional_ty = operand_ty.childType(zcu);
5673 const payload_ty = optional_ty.optionalChild(zcu);
5674 const result_ty = cg.typeOfIndex(inst);
5675 const result_ty_id = try cg.resolveType(result_ty, .direct);
5676
5677 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5678 // There is no payload, but we still need to return a valid pointer.
5679 // We can just return anything here, so just return a pointer to the operand.
5680 return try cg.bitCast(result_ty, operand_ty, operand_id);
5681 }
5682
5683 if (optional_ty.optionalReprIsPayload(zcu)) {
5684 // They are the same value.
5685 return try cg.bitCast(result_ty, operand_ty, operand_id);
5686 }
5687
5688 return try cg.accessChain(result_ty_id, operand_id, &.{0});
5689}
5690
5691fn airWrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5692 const zcu = cg.module.zcu;
5693 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5694 const payload_ty = cg.typeOf(ty_op.operand);
5695
5696 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5697 return try cg.constBool(true, .indirect);
5698 }
5699
5700 const operand_id = try cg.resolve(ty_op.operand);
5701
5702 const optional_ty = cg.typeOfIndex(inst);
5703 if (optional_ty.optionalReprIsPayload(zcu)) {
5704 return operand_id;
5705 }
5706
5707 const payload_id = try cg.convertToIndirect(payload_ty, operand_id);
5708 const members = [_]Id{ payload_id, try cg.constBool(true, .indirect) };
5709 const optional_ty_id = try cg.resolveType(optional_ty, .direct);
5710 return try cg.constructComposite(optional_ty_id, &members);
5711}
5712
5713fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5714 const gpa = cg.module.gpa;
5715 const pt = cg.pt;
5716 const zcu = cg.module.zcu;
5717 const target = cg.module.zcu.getTarget();
5718 const switch_br = cg.air.unwrapSwitch(inst);
5719 const cond_ty = cg.typeOf(switch_br.operand);
5720 const cond = try cg.resolve(switch_br.operand);
5721 var cond_indirect = try cg.convertToIndirect(cond_ty, cond);
5722
5723 const cond_words: u32 = switch (cond_ty.zigTypeTag(zcu)) {
5724 .bool, .error_set => 1,
5725 .int => blk: {
5726 const bits = cond_ty.intInfo(zcu).bits;
5727 const backing_bits, const big_int = cg.module.backingIntBits(bits);
5728 if (big_int) return cg.todo("implement composite int switch", .{});
5729 break :blk if (backing_bits <= 32) 1 else 2;
5730 },
5731 .@"enum" => blk: {
5732 const int_ty = cond_ty.intTagType(zcu);
5733 const int_info = int_ty.intInfo(zcu);
5734 const backing_bits, const big_int = cg.module.backingIntBits(int_info.bits);
5735 if (big_int) return cg.todo("implement composite int switch", .{});
5736 break :blk if (backing_bits <= 32) 1 else 2;
5737 },
5738 .pointer => blk: {
5739 cond_indirect = try cg.intFromPtr(cond_indirect);
5740 break :blk target.ptrBitWidth() / 32;
5741 },
5742 // TODO: Figure out which types apply here, and work around them as we can only do integers.
5743 else => return cg.todo("implement switch for type {s}", .{@tagName(cond_ty.zigTypeTag(zcu))}),
5744 };
5745
5746 const num_cases = switch_br.cases_len;
5747
5748 // Compute the total number of arms that we need.
5749 // Zig switches are grouped by condition, so we need to loop through all of them
5750 const num_conditions = blk: {
5751 var num_conditions: u32 = 0;
5752 var it = switch_br.iterateCases();
5753 while (it.next()) |case| {
5754 if (case.ranges.len > 0) return cg.todo("switch with ranges", .{});
5755 num_conditions += @intCast(case.items.len);
5756 }
5757 break :blk num_conditions;
5758 };
5759
5760 // First, pre-allocate the labels for the cases.
5761 const case_labels = cg.module.allocIds(num_cases);
5762 // We always need the default case - if zig has none, we will generate unreachable there.
5763 const default = cg.module.allocId();
5764
5765 const merge_label = switch (cg.control_flow) {
5766 .structured => cg.module.allocId(),
5767 .unstructured => null,
5768 };
5769
5770 if (cg.control_flow == .structured) {
5771 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5772 .merge_block = merge_label.?,
5773 .selection_control = .{},
5774 });
5775 }
5776
5777 // Emit the instruction before generating the blocks.
5778 try cg.body.emitRaw(cg.module.gpa, .OpSwitch, 2 + (cond_words + 1) * num_conditions);
5779 cg.body.writeOperand(Id, cond_indirect);
5780 cg.body.writeOperand(Id, default);
5781
5782 // Emit each of the cases
5783 {
5784 var it = switch_br.iterateCases();
5785 while (it.next()) |case| {
5786 // SPIR-V needs a literal here, which' width depends on the case condition.
5787 const label = case_labels.at(case.idx);
5788
5789 for (case.items) |item| {
5790 const value = (try cg.air.value(item, pt)) orelse unreachable;
5791 const int_val: u64 = switch (cond_ty.zigTypeTag(zcu)) {
5792 .bool, .int => if (cond_ty.isSignedInt(zcu)) @bitCast(value.toSignedInt(zcu)) else value.toUnsignedInt(zcu),
5793 .@"enum" => blk: {
5794 // TODO: figure out of cond_ty is correct (something with enum literals)
5795 break :blk (try value.intFromEnum(cond_ty, pt)).toUnsignedInt(zcu); // TODO: composite integer constants
5796 },
5797 .error_set => value.getErrorInt(zcu),
5798 .pointer => value.toUnsignedInt(zcu),
5799 else => unreachable,
5800 };
5801 const int_lit: spec.LiteralContextDependentNumber = switch (cond_words) {
5802 1 => .{ .uint32 = @intCast(int_val) },
5803 2 => .{ .uint64 = int_val },
5804 else => unreachable,
5805 };
5806 cg.body.writeOperand(spec.LiteralContextDependentNumber, int_lit);
5807 cg.body.writeOperand(Id, label);
5808 }
5809 }
5810 }
5811
5812 var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty;
5813 defer incoming_structured_blocks.deinit(gpa);
5814
5815 if (cg.control_flow == .structured) {
5816 try incoming_structured_blocks.ensureUnusedCapacity(gpa, num_cases + 1);
5817 }
5818
5819 // Now, finally, we can start emitting each of the cases.
5820 var it = switch_br.iterateCases();
5821 while (it.next()) |case| {
5822 const label = case_labels.at(case.idx);
5823
5824 try cg.beginSpvBlock(label);
5825
5826 switch (cg.control_flow) {
5827 .structured => {
5828 const next_block = try cg.genStructuredBody(.selection, case.body);
5829 incoming_structured_blocks.appendAssumeCapacity(.{
5830 .src_label = cg.block_label,
5831 .next_block = next_block,
5832 });
5833 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
5834 },
5835 .unstructured => {
5836 try cg.genBody(case.body);
5837 },
5838 }
5839 }
5840
5841 const else_body = it.elseBody();
5842 try cg.beginSpvBlock(default);
5843 if (else_body.len != 0) {
5844 switch (cg.control_flow) {
5845 .structured => {
5846 const next_block = try cg.genStructuredBody(.selection, else_body);
5847 incoming_structured_blocks.appendAssumeCapacity(.{
5848 .src_label = cg.block_label,
5849 .next_block = next_block,
5850 });
5851 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
5852 },
5853 .unstructured => {
5854 try cg.genBody(else_body);
5855 },
5856 }
5857 } else {
5858 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
5859 }
5860
5861 if (cg.control_flow == .structured) {
5862 try cg.beginSpvBlock(merge_label.?);
5863 const next_block = try cg.structuredNextBlock(incoming_structured_blocks.items);
5864 try cg.structuredBreak(next_block);
5865 }
5866}
5867
5868fn airUnreach(cg: *CodeGen) !void {
5869 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
5870}
5871
5872fn airDbgStmt(cg: *CodeGen, inst: Air.Inst.Index) !void {
5873 const zcu = cg.module.zcu;
5874 const dbg_stmt = cg.air.instructions.items(.data)[@intFromEnum(inst)].dbg_stmt;
5875 const path = zcu.navFileScope(cg.owner_nav).sub_file_path;
5876
5877 if (zcu.comp.config.root_strip) return;
5878
5879 try cg.body.emit(cg.module.gpa, .OpLine, .{
5880 .file = try cg.module.debugString(path),
5881 .line = cg.base_line + dbg_stmt.line + 1,
5882 .column = dbg_stmt.column + 1,
5883 });
5884}
5885
5886fn airDbgInlineBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5887 const zcu = cg.module.zcu;
5888 const inst_datas = cg.air.instructions.items(.data);
5889 const extra = cg.air.extraData(Air.DbgInlineBlock, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5890 const old_base_line = cg.base_line;
5891 defer cg.base_line = old_base_line;
5892 cg.base_line = zcu.navSrcLine(zcu.funcInfo(extra.data.func).owner_nav);
5893 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
5894}
5895
5896fn airDbgVar(cg: *CodeGen, inst: Air.Inst.Index) !void {
5897 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5898 const target_id = try cg.resolve(pl_op.operand);
5899 const name: Air.NullTerminatedString = @enumFromInt(pl_op.payload);
5900 try cg.module.debugName(target_id, name.toSlice(cg.air));
5901}
5902
5903fn airAssembly(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5904 const gpa = cg.module.gpa;
5905 const zcu = cg.module.zcu;
5906 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5907 const extra = cg.air.extraData(Air.Asm, ty_pl.payload);
5908
5909 const is_volatile = extra.data.flags.is_volatile;
5910 const outputs_len = extra.data.flags.outputs_len;
5911
5912 if (!is_volatile and cg.liveness.isUnused(inst)) return null;
5913
5914 var extra_i: usize = extra.end;
5915 const outputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..outputs_len]);
5916 extra_i += outputs.len;
5917 const inputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..extra.data.inputs_len]);
5918 extra_i += inputs.len;
5919
5920 if (outputs.len > 1) {
5921 return cg.todo("implement inline asm with more than 1 output", .{});
5922 }
5923
5924 var as: Assembler = .{ .cg = cg };
5925 defer as.deinit();
5926
5927 var output_extra_i = extra_i;
5928 for (outputs) |output| {
5929 if (output != .none) {
5930 return cg.todo("implement inline asm with non-returned output", .{});
5931 }
5932 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
5933 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]), 0);
5934 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
5935 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
5936 // TODO: Record output and use it somewhere.
5937 }
5938
5939 for (inputs) |input| {
5940 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
5941 const constraint = std.mem.sliceTo(extra_bytes, 0);
5942 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
5943 // This equation accounts for the fact that even if we have exactly 4 bytes
5944 // for the string, we still use the next u32 for the null terminator.
5945 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
5946
5947 const input_ty = cg.typeOf(input);
5948
5949 if (std.mem.eql(u8, constraint, "c")) {
5950 // constant
5951 const val = (try cg.air.value(input, cg.pt)) orelse {
5952 return cg.fail("assembly inputs with 'c' constraint have to be compile-time known", .{});
5953 };
5954
5955 // TODO: This entire function should be handled a bit better...
5956 const ip = &zcu.intern_pool;
5957 switch (ip.indexToKey(val.toIntern())) {
5958 .int_type,
5959 .ptr_type,
5960 .array_type,
5961 .vector_type,
5962 .opt_type,
5963 .anyframe_type,
5964 .error_union_type,
5965 .simple_type,
5966 .struct_type,
5967 .union_type,
5968 .opaque_type,
5969 .enum_type,
5970 .func_type,
5971 .error_set_type,
5972 .inferred_error_set_type,
5973 => unreachable, // types, not values
5974
5975 .undef => return cg.fail("assembly input with 'c' constraint cannot be undefined", .{}),
5976
5977 .int => try as.value_map.put(gpa, name, .{ .constant = @intCast(val.toUnsignedInt(zcu)) }),
5978 .enum_literal => |str| try as.value_map.put(gpa, name, .{ .string = str.toSlice(ip) }),
5979
5980 else => unreachable, // TODO
5981 }
5982 } else if (std.mem.eql(u8, constraint, "t")) {
5983 // type
5984 if (input_ty.zigTypeTag(zcu) == .type) {
5985 // This assembly input is a type instead of a value.
5986 // That's fine for now, just make sure to resolve it as such.
5987 const val = (try cg.air.value(input, cg.pt)).?;
5988 const ty_id = try cg.resolveType(val.toType(), .direct);
5989 try as.value_map.put(gpa, name, .{ .ty = ty_id });
5990 } else {
5991 const ty_id = try cg.resolveType(input_ty, .direct);
5992 try as.value_map.put(gpa, name, .{ .ty = ty_id });
5993 }
5994 } else {
5995 if (input_ty.zigTypeTag(zcu) == .type) {
5996 return cg.fail("use the 't' constraint to supply types to SPIR-V inline assembly", .{});
5997 }
5998
5999 const val_id = try cg.resolve(input);
6000 try as.value_map.put(gpa, name, .{ .value = val_id });
6001 }
6002 }
6003
6004 // TODO: do something with clobbers
6005 _ = extra.data.clobbers;
6006
6007 const asm_source = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..])[0..extra.data.source_len];
6008
6009 as.assemble(asm_source) catch |err| switch (err) {
6010 error.AssembleFail => {
6011 // TODO: For now the compiler only supports a single error message per decl,
6012 // so to translate the possible multiple errors from the assembler, emit
6013 // them as notes here.
6014 // TODO: Translate proper error locations.
6015 assert(as.errors.items.len != 0);
6016 assert(cg.error_msg == null);
6017 const src_loc = zcu.navSrcLoc(cg.owner_nav);
6018 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
6019 const notes = try zcu.gpa.alloc(Zcu.ErrorMsg, as.errors.items.len);
6020
6021 // Sub-scope to prevent `return error.CodegenFail` from running the errdefers.
6022 {
6023 errdefer zcu.gpa.free(notes);
6024 var i: usize = 0;
6025 errdefer for (notes[0..i]) |*note| {
6026 note.deinit(zcu.gpa);
6027 };
6028
6029 while (i < as.errors.items.len) : (i += 1) {
6030 notes[i] = try Zcu.ErrorMsg.init(zcu.gpa, src_loc, "{s}", .{as.errors.items[i].msg});
6031 }
6032 }
6033 cg.error_msg.?.notes = notes;
6034 return error.CodegenFail;
6035 },
6036 else => |others| return others,
6037 };
6038
6039 for (outputs) |output| {
6040 _ = output;
6041 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]);
6042 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]), 0);
6043 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6044 output_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6045
6046 const result = as.value_map.get(name) orelse return {
6047 return cg.fail("invalid asm output '{s}'", .{name});
6048 };
6049
6050 switch (result) {
6051 .just_declared, .unresolved_forward_reference => unreachable,
6052 .ty => return cg.fail("cannot return spir-v type as value from assembly", .{}),
6053 .value => |ref| return ref,
6054 .constant, .string => return cg.fail("cannot return constant from assembly", .{}),
6055 }
6056
6057 // TODO: Multiple results
6058 // TODO: Check that the output type from assembly is the same as the type actually expected by Zig.
6059 }
6060
6061 return null;
6062}
6063
6064fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !?Id {
6065 _ = modifier;
6066
6067 const gpa = cg.module.gpa;
6068 const zcu = cg.module.zcu;
6069 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6070 const extra = cg.air.extraData(Air.Call, pl_op.payload);
6071 const args: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.args_len]);
6072 const callee_ty = cg.typeOf(pl_op.operand);
6073 const zig_fn_ty = switch (callee_ty.zigTypeTag(zcu)) {
6074 .@"fn" => callee_ty,
6075 .pointer => return cg.fail("cannot call function pointers", .{}),
6076 else => unreachable,
6077 };
6078 const fn_info = zcu.typeToFunc(zig_fn_ty).?;
6079 const return_type = fn_info.return_type;
6080
6081 const result_type_id = try cg.resolveFnReturnType(.fromInterned(return_type));
6082 const result_id = cg.module.allocId();
6083 const callee_id = try cg.resolve(pl_op.operand);
6084
6085 comptime assert(zig_call_abi_ver == 3);
6086 const params = try gpa.alloc(Id, args.len);
6087 defer gpa.free(params);
6088 var n_params: usize = 0;
6089 for (args) |arg| {
6090 // Note: resolve() might emit instructions, so we need to call it
6091 // before starting to emit OpFunctionCall instructions. Hence the
6092 // temporary params buffer.
6093 const arg_ty = cg.typeOf(arg);
6094 if (!arg_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
6095 const arg_id = try cg.resolve(arg);
6096
6097 params[n_params] = arg_id;
6098 n_params += 1;
6099 }
6100
6101 try cg.body.emit(cg.module.gpa, .OpFunctionCall, .{
6102 .id_result_type = result_type_id,
6103 .id_result = result_id,
6104 .function = callee_id,
6105 .id_ref_3 = params[0..n_params],
6106 });
6107
6108 if (cg.liveness.isUnused(inst) or !Type.fromInterned(return_type).hasRuntimeBitsIgnoreComptime(zcu)) {
6109 return null;
6110 }
6111
6112 return result_id;
6113}
6114
6115fn builtin3D(
6116 cg: *CodeGen,
6117 result_ty: Type,
6118 builtin: spec.BuiltIn,
6119 dimension: u32,
6120 out_of_range_value: anytype,
6121) !Id {
6122 if (dimension >= 3) return try cg.constInt(result_ty, out_of_range_value);
6123 const u32_ty_id = try cg.module.intType(.unsigned, 32);
6124 const vec_ty_id = try cg.module.vectorType(3, u32_ty_id);
6125 const ptr_ty_id = try cg.module.ptrType(vec_ty_id, .input);
6126 const spv_decl_index = try cg.module.builtin(ptr_ty_id, builtin, .input);
6127 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
6128 const ptr_id = cg.module.declPtr(spv_decl_index).result_id;
6129 const vec_id = cg.module.allocId();
6130 try cg.body.emit(cg.module.gpa, .OpLoad, .{
6131 .id_result_type = vec_ty_id,
6132 .id_result = vec_id,
6133 .pointer = ptr_id,
6134 });
6135 return try cg.extractVectorComponent(result_ty, vec_id, dimension);
6136}
6137
6138fn airWorkItemId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6139 if (cg.liveness.isUnused(inst)) return null;
6140 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6141 const dimension = pl_op.payload;
6142 return try cg.builtin3D(.u32, .local_invocation_id, dimension, 0);
6143}
6144
6145// TODO: this must be an OpConstant/OpSpec but even then the driver crashes.
6146fn airWorkGroupSize(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6147 if (cg.liveness.isUnused(inst)) return null;
6148 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6149 const dimension = pl_op.payload;
6150 return try cg.builtin3D(.u32, .workgroup_id, dimension, 0);
6151}
6152
6153fn airWorkGroupId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6154 if (cg.liveness.isUnused(inst)) return null;
6155 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6156 const dimension = pl_op.payload;
6157 return try cg.builtin3D(.u32, .workgroup_id, dimension, 0);
6158}
6159
6160fn typeOf(cg: *CodeGen, inst: Air.Inst.Ref) Type {
6161 const zcu = cg.module.zcu;
6162 return cg.air.typeOf(inst, &zcu.intern_pool);
6163}
6164
6165fn typeOfIndex(cg: *CodeGen, inst: Air.Inst.Index) Type {
6166 const zcu = cg.module.zcu;
6167 return cg.air.typeOfIndex(inst, &zcu.intern_pool);
6168}
src/codegen/spirv/Module.zig created+955
...@@ -0,0 +1,955 @@
1//! This structure represents a SPIR-V (sections) module being compiled, and keeps
2//! track of all relevant information. That includes the actual instructions, the
3//! current result-id bound, and data structures for querying result-id's of data
4//! which needs to be persistent over different calls to Decl code generation.
5//!
6//! A SPIR-V binary module supports both little- and big endian layout. The layout
7//! is detected by the magic word in the header. Therefore, we can ignore any byte
8//! order throughout the implementation, and just use the host byte order, and make
9//! this a problem for the consumer.
10const std = @import("std");
11const Allocator = std.mem.Allocator;
12const assert = std.debug.assert;
13
14const Zcu = @import("../../Zcu.zig");
15const InternPool = @import("../../InternPool.zig");
16const Section = @import("Section.zig");
17const spec = @import("spec.zig");
18const Word = spec.Word;
19const Id = spec.Id;
20
21const Module = @This();
22
23gpa: Allocator,
24arena: Allocator,
25zcu: *Zcu,
26nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,
27uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,
28intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
29decls: std.ArrayListUnmanaged(Decl) = .empty,
30decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty,
31entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
32/// This map serves a dual purpose:
33/// - It keeps track of pointers that are currently being emitted, so that we can tell
34/// if they are recursive and need an OpTypeForwardPointer.
35/// - It caches pointers by child-type. This is required because sometimes we rely on
36/// ID-equality for pointers, and pointers constructed via `ptrType()` aren't interned
37/// via the usual `intern_map` mechanism.
38ptr_types: std.AutoHashMapUnmanaged(struct { Id, spec.StorageClass }, Id) = .{},
39/// For test declarations compiled for Vulkan target, we have to add a buffer.
40/// We only need to generate this once, this holds the link information related to that.
41error_buffer: ?Decl.Index = null,
42/// SPIR-V instructions return result-ids.
43/// This variable holds the module-wide counter for these.
44next_result_id: Word = 1,
45/// Some types shouldn't be emitted more than one time, but cannot be caught by
46/// the `intern_map` during codegen. Sometimes, IDs are compared to check if
47/// types are the same, so we can't delay until the dedup pass. Therefore,
48/// this is an ad-hoc structure to cache types where required.
49/// According to the SPIR-V specification, section 2.8, this includes all non-aggregate
50/// non-pointer types.
51/// Additionally, this is used for other values which can be cached, for example,
52/// built-in variables.
53cache: struct {
54 bool_type: ?Id = null,
55 void_type: ?Id = null,
56 opaque_types: std.StringHashMapUnmanaged(Id) = .empty,
57 int_types: std.AutoHashMapUnmanaged(std.builtin.Type.Int, Id) = .empty,
58 float_types: std.AutoHashMapUnmanaged(std.builtin.Type.Float, Id) = .empty,
59 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
60 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
61 struct_types: std.ArrayHashMapUnmanaged(StructType, Id, StructType.HashContext, true) = .empty,
62 fn_types: std.ArrayHashMapUnmanaged(FnType, Id, FnType.HashContext, true) = .empty,
63
64 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
65 extensions: std.StringHashMapUnmanaged(void) = .empty,
66 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
67 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
68 builtins: std.AutoHashMapUnmanaged(struct { spec.BuiltIn, spec.StorageClass }, Decl.Index) = .empty,
69 strings: std.StringArrayHashMapUnmanaged(Id) = .empty,
70
71 bool_const: [2]?Id = .{ null, null },
72 constants: std.ArrayHashMapUnmanaged(Constant, Id, Constant.HashContext, true) = .empty,
73} = .{},
74/// Module layout, according to SPIR-V Spec section 2.4, "Logical Layout of a Module".
75sections: struct {
76 capabilities: Section = .{},
77 extensions: Section = .{},
78 extended_instruction_set: Section = .{},
79 memory_model: Section = .{},
80 execution_modes: Section = .{},
81 debug_strings: Section = .{},
82 debug_names: Section = .{},
83 annotations: Section = .{},
84 globals: Section = .{},
85 functions: Section = .{},
86} = .{},
87
88pub const big_int_bits = 32;
89
90/// Data can be lowered into in two basic representations: indirect, which is when
91/// a type is stored in memory, and direct, which is how a type is stored when its
92/// a direct SPIR-V value.
93pub const Repr = enum {
94 /// A SPIR-V value as it would be used in operations.
95 direct,
96 /// A SPIR-V value as it is stored in memory.
97 indirect,
98};
99
100/// Declarations, both functions and globals, can have dependencies. These are used for 2 things:
101/// - Globals must be declared before they are used, also between globals. The compiler processes
102/// globals unordered, so we must use the dependencies here to figure out how to order the globals
103/// in the final module. The Globals structure is also used for that.
104/// - Entry points must declare the complete list of OpVariable instructions that they access.
105/// For these we use the same dependency structure.
106/// In this mechanism, globals will only depend on other globals, while functions may depend on
107/// globals or other functions.
108pub const Decl = struct {
109 /// Index to refer to a Decl by.
110 pub const Index = enum(u32) { _ };
111
112 /// Useful to tell what kind of decl this is, and hold the result-id or field index
113 /// to be used for this decl.
114 pub const Kind = enum {
115 func,
116 global,
117 invocation_global,
118 };
119
120 /// See comment on Kind
121 kind: Kind,
122 /// The result-id associated to this decl. The specific meaning of this depends on `kind`:
123 /// - For `func`, this is the result-id of the associated OpFunction instruction.
124 /// - For `global`, this is the result-id of the associated OpVariable instruction.
125 /// - For `invocation_global`, this is the result-id of the associated InvocationGlobal instruction.
126 result_id: Id,
127 /// The offset of the first dependency of this decl in the `decl_deps` array.
128 begin_dep: u32,
129 /// The past-end offset of the dependencies of this decl in the `decl_deps` array.
130 end_dep: u32,
131};
132
133/// This models a kernel entry point.
134pub const EntryPoint = struct {
135 /// The declaration that should be exported.
136 decl_index: Decl.Index,
137 /// The name of the kernel to be exported.
138 name: []const u8,
139 /// Calling Convention
140 exec_model: spec.ExecutionModel,
141 exec_mode: ?spec.ExecutionMode = null,
142};
143
144const StructType = struct {
145 fields: []const Id,
146 ip_index: InternPool.Index,
147
148 const HashContext = struct {
149 pub fn hash(_: @This(), ty: StructType) u32 {
150 var hasher = std.hash.Wyhash.init(0);
151 hasher.update(std.mem.sliceAsBytes(ty.fields));
152 hasher.update(std.mem.asBytes(&ty.ip_index));
153 return @truncate(hasher.final());
154 }
155
156 pub fn eql(_: @This(), a: StructType, b: StructType, _: usize) bool {
157 return a.ip_index == b.ip_index and std.mem.eql(Id, a.fields, b.fields);
158 }
159 };
160};
161
162const FnType = struct {
163 return_ty: Id,
164 params: []const Id,
165
166 const HashContext = struct {
167 pub fn hash(_: @This(), ty: FnType) u32 {
168 var hasher = std.hash.Wyhash.init(0);
169 hasher.update(std.mem.asBytes(&ty.return_ty));
170 hasher.update(std.mem.sliceAsBytes(ty.params));
171 return @truncate(hasher.final());
172 }
173
174 pub fn eql(_: @This(), a: FnType, b: FnType, _: usize) bool {
175 return a.return_ty == b.return_ty and
176 std.mem.eql(Id, a.params, b.params);
177 }
178 };
179};
180
181const Constant = struct {
182 ty: Id,
183 value: spec.LiteralContextDependentNumber,
184
185 const HashContext = struct {
186 pub fn hash(_: @This(), value: Constant) u32 {
187 const Tag = @typeInfo(spec.LiteralContextDependentNumber).@"union".tag_type.?;
188 var hasher = std.hash.Wyhash.init(0);
189 hasher.update(std.mem.asBytes(&value.ty));
190 hasher.update(std.mem.asBytes(&@as(Tag, value.value)));
191 switch (value.value) {
192 inline else => |v| hasher.update(std.mem.asBytes(&v)),
193 }
194 return @truncate(hasher.final());
195 }
196
197 pub fn eql(_: @This(), a: Constant, b: Constant, _: usize) bool {
198 if (a.ty != b.ty) return false;
199 const Tag = @typeInfo(spec.LiteralContextDependentNumber).@"union".tag_type.?;
200 if (@as(Tag, a.value) != @as(Tag, b.value)) return false;
201 return switch (a.value) {
202 inline else => |v, tag| v == @field(b.value, @tagName(tag)),
203 };
204 }
205 };
206};
207
208pub fn deinit(module: *Module) void {
209 module.nav_link.deinit(module.gpa);
210 module.uav_link.deinit(module.gpa);
211 module.intern_map.deinit(module.gpa);
212 module.ptr_types.deinit(module.gpa);
213
214 module.sections.capabilities.deinit(module.gpa);
215 module.sections.extensions.deinit(module.gpa);
216 module.sections.extended_instruction_set.deinit(module.gpa);
217 module.sections.memory_model.deinit(module.gpa);
218 module.sections.execution_modes.deinit(module.gpa);
219 module.sections.debug_strings.deinit(module.gpa);
220 module.sections.debug_names.deinit(module.gpa);
221 module.sections.annotations.deinit(module.gpa);
222 module.sections.globals.deinit(module.gpa);
223 module.sections.functions.deinit(module.gpa);
224
225 module.cache.opaque_types.deinit(module.gpa);
226 module.cache.int_types.deinit(module.gpa);
227 module.cache.float_types.deinit(module.gpa);
228 module.cache.vector_types.deinit(module.gpa);
229 module.cache.array_types.deinit(module.gpa);
230 module.cache.struct_types.deinit(module.gpa);
231 module.cache.fn_types.deinit(module.gpa);
232 module.cache.capabilities.deinit(module.gpa);
233 module.cache.extensions.deinit(module.gpa);
234 module.cache.extended_instruction_set.deinit(module.gpa);
235 module.cache.decorations.deinit(module.gpa);
236 module.cache.builtins.deinit(module.gpa);
237 module.cache.strings.deinit(module.gpa);
238
239 module.cache.constants.deinit(module.gpa);
240
241 module.decls.deinit(module.gpa);
242 module.decl_deps.deinit(module.gpa);
243 module.entry_points.deinit(module.gpa);
244
245 module.* = undefined;
246}
247
248/// Fetch or allocate a result id for nav index. This function also marks the nav as alive.
249/// Note: Function does not actually generate the nav, it just allocates an index.
250pub fn resolveNav(module: *Module, ip: *InternPool, nav_index: InternPool.Nav.Index) !Decl.Index {
251 const entry = try module.nav_link.getOrPut(module.gpa, nav_index);
252 if (!entry.found_existing) {
253 const nav = ip.getNav(nav_index);
254 // TODO: Extern fn?
255 const kind: Decl.Kind = if (ip.isFunctionType(nav.typeOf(ip)))
256 .func
257 else switch (nav.getAddrspace()) {
258 .generic => .invocation_global,
259 else => .global,
260 };
261
262 entry.value_ptr.* = try module.allocDecl(kind);
263 }
264
265 return entry.value_ptr.*;
266}
267
268pub fn allocIds(module: *Module, n: u32) spec.IdRange {
269 defer module.next_result_id += n;
270 return .{ .base = module.next_result_id, .len = n };
271}
272
273pub fn allocId(module: *Module) Id {
274 return module.allocIds(1).at(0);
275}
276
277pub fn idBound(module: Module) Word {
278 return module.next_result_id;
279}
280
281pub fn addEntryPointDeps(
282 module: *Module,
283 decl_index: Decl.Index,
284 seen: *std.DynamicBitSetUnmanaged,
285 interface: *std.ArrayList(Id),
286) !void {
287 const decl = module.declPtr(decl_index);
288 const deps = module.decl_deps.items[decl.begin_dep..decl.end_dep];
289
290 if (seen.isSet(@intFromEnum(decl_index))) {
291 return;
292 }
293
294 seen.set(@intFromEnum(decl_index));
295
296 if (decl.kind == .global) {
297 try interface.append(decl.result_id);
298 }
299
300 for (deps) |dep| {
301 try module.addEntryPointDeps(dep, seen, interface);
302 }
303}
304
305fn entryPoints(module: *Module) !Section {
306 const target = module.zcu.getTarget();
307
308 var entry_points = Section{};
309 errdefer entry_points.deinit(module.gpa);
310
311 var interface = std.ArrayList(Id).init(module.gpa);
312 defer interface.deinit();
313
314 var seen = try std.DynamicBitSetUnmanaged.initEmpty(module.gpa, module.decls.items.len);
315 defer seen.deinit(module.gpa);
316
317 for (module.entry_points.keys(), module.entry_points.values()) |entry_point_id, entry_point| {
318 interface.items.len = 0;
319 seen.setRangeValue(.{ .start = 0, .end = module.decls.items.len }, false);
320
321 try module.addEntryPointDeps(entry_point.decl_index, &seen, &interface);
322 try entry_points.emit(module.gpa, .OpEntryPoint, .{
323 .execution_model = entry_point.exec_model,
324 .entry_point = entry_point_id,
325 .name = entry_point.name,
326 .interface = interface.items,
327 });
328
329 if (entry_point.exec_mode == null and entry_point.exec_model == .fragment) {
330 switch (target.os.tag) {
331 .vulkan, .opengl => |tag| {
332 try module.sections.execution_modes.emit(module.gpa, .OpExecutionMode, .{
333 .entry_point = entry_point_id,
334 .mode = if (tag == .vulkan) .origin_upper_left else .origin_lower_left,
335 });
336 },
337 .opencl => {},
338 else => unreachable,
339 }
340 }
341 }
342
343 return entry_points;
344}
345
346pub fn finalize(module: *Module, gpa: Allocator) ![]Word {
347 const target = module.zcu.getTarget();
348
349 // Emit capabilities and extensions
350 switch (target.os.tag) {
351 .opengl => {
352 try module.addCapability(.shader);
353 try module.addCapability(.matrix);
354 },
355 .vulkan => {
356 try module.addCapability(.shader);
357 try module.addCapability(.matrix);
358 if (target.cpu.arch == .spirv64) {
359 try module.addExtension("SPV_KHR_physical_storage_buffer");
360 try module.addCapability(.physical_storage_buffer_addresses);
361 }
362 },
363 .opencl, .amdhsa => {
364 try module.addCapability(.kernel);
365 try module.addCapability(.addresses);
366 },
367 else => unreachable,
368 }
369 if (target.cpu.arch == .spirv64) try module.addCapability(.int64);
370 if (target.cpu.has(.spirv, .int64)) try module.addCapability(.int64);
371 if (target.cpu.has(.spirv, .float16)) {
372 if (target.os.tag == .opencl) try module.addExtension("cl_khr_fp16");
373 try module.addCapability(.float16);
374 }
375 if (target.cpu.has(.spirv, .float64)) try module.addCapability(.float64);
376 if (target.cpu.has(.spirv, .generic_pointer)) try module.addCapability(.generic_pointer);
377 if (target.cpu.has(.spirv, .vector16)) try module.addCapability(.vector16);
378 if (target.cpu.has(.spirv, .storage_push_constant16)) {
379 try module.addExtension("SPV_KHR_16bit_storage");
380 try module.addCapability(.storage_push_constant16);
381 }
382 if (target.cpu.has(.spirv, .arbitrary_precision_integers)) {
383 try module.addExtension("SPV_INTEL_arbitrary_precision_integers");
384 try module.addCapability(.arbitrary_precision_integers_intel);
385 }
386 if (target.cpu.has(.spirv, .variable_pointers)) {
387 try module.addExtension("SPV_KHR_variable_pointers");
388 try module.addCapability(.variable_pointers_storage_buffer);
389 try module.addCapability(.variable_pointers);
390 }
391 // These are well supported
392 try module.addCapability(.int8);
393 try module.addCapability(.int16);
394
395 // Emit memory model
396 const addressing_model: spec.AddressingModel = switch (target.os.tag) {
397 .opengl => .logical,
398 .vulkan => if (target.cpu.arch == .spirv32) .logical else .physical_storage_buffer64,
399 .opencl => if (target.cpu.arch == .spirv32) .physical32 else .physical64,
400 .amdhsa => .physical64,
401 else => unreachable,
402 };
403 try module.sections.memory_model.emit(module.gpa, .OpMemoryModel, .{
404 .addressing_model = addressing_model,
405 .memory_model = switch (target.os.tag) {
406 .opencl => .open_cl,
407 .vulkan, .opengl => .glsl450,
408 else => unreachable,
409 },
410 });
411
412 var entry_points = try module.entryPoints();
413 defer entry_points.deinit(module.gpa);
414
415 const version: spec.Version = .{
416 .major = 1,
417 .minor = blk: {
418 // Prefer higher versions
419 if (target.cpu.has(.spirv, .v1_6)) break :blk 6;
420 if (target.cpu.has(.spirv, .v1_5)) break :blk 5;
421 if (target.cpu.has(.spirv, .v1_4)) break :blk 4;
422 if (target.cpu.has(.spirv, .v1_3)) break :blk 3;
423 if (target.cpu.has(.spirv, .v1_2)) break :blk 2;
424 if (target.cpu.has(.spirv, .v1_1)) break :blk 1;
425 break :blk 0;
426 },
427 };
428
429 const header = [_]Word{
430 spec.magic_number,
431 version.toWord(),
432 spec.zig_generator_id,
433 module.idBound(),
434 0, // Schema (currently reserved for future use)
435 };
436
437 var source = Section{};
438 defer source.deinit(module.gpa);
439 try module.sections.debug_strings.emit(module.gpa, .OpSource, .{
440 .source_language = .zig,
441 .version = 0,
442 // We cannot emit these because the Khronos translator does not parse this instruction
443 // correctly.
444 // See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2188
445 .file = null,
446 .source = null,
447 });
448
449 // Note: needs to be kept in order according to section 2.3!
450 const buffers = &[_][]const Word{
451 &header,
452 module.sections.capabilities.toWords(),
453 module.sections.extensions.toWords(),
454 module.sections.extended_instruction_set.toWords(),
455 module.sections.memory_model.toWords(),
456 entry_points.toWords(),
457 module.sections.execution_modes.toWords(),
458 source.toWords(),
459 module.sections.debug_strings.toWords(),
460 module.sections.debug_names.toWords(),
461 module.sections.annotations.toWords(),
462 module.sections.globals.toWords(),
463 module.sections.functions.toWords(),
464 };
465
466 var total_result_size: usize = 0;
467 for (buffers) |buffer| {
468 total_result_size += buffer.len;
469 }
470 const result = try gpa.alloc(Word, total_result_size);
471 errdefer comptime unreachable;
472
473 var offset: usize = 0;
474 for (buffers) |buffer| {
475 @memcpy(result[offset..][0..buffer.len], buffer);
476 offset += buffer.len;
477 }
478
479 return result;
480}
481
482pub fn addCapability(module: *Module, cap: spec.Capability) !void {
483 const entry = try module.cache.capabilities.getOrPut(module.gpa, cap);
484 if (entry.found_existing) return;
485 try module.sections.capabilities.emit(module.gpa, .OpCapability, .{ .capability = cap });
486}
487
488pub fn addExtension(module: *Module, ext: []const u8) !void {
489 const entry = try module.cache.extensions.getOrPut(module.gpa, ext);
490 if (entry.found_existing) return;
491 try module.sections.extensions.emit(module.gpa, .OpExtension, .{ .name = ext });
492}
493
494/// Imports or returns the existing id of an extended instruction set
495pub fn importInstructionSet(module: *Module, set: spec.InstructionSet) !Id {
496 assert(set != .core);
497
498 const gop = try module.cache.extended_instruction_set.getOrPut(module.gpa, set);
499 if (gop.found_existing) return gop.value_ptr.*;
500
501 const result_id = module.allocId();
502 try module.sections.extended_instruction_set.emit(module.gpa, .OpExtInstImport, .{
503 .id_result = result_id,
504 .name = @tagName(set),
505 });
506 gop.value_ptr.* = result_id;
507
508 return result_id;
509}
510
511pub fn boolType(module: *Module) !Id {
512 if (module.cache.bool_type) |id| return id;
513
514 const result_id = module.allocId();
515 try module.sections.globals.emit(module.gpa, .OpTypeBool, .{
516 .id_result = result_id,
517 });
518 module.cache.bool_type = result_id;
519 return result_id;
520}
521
522pub fn voidType(module: *Module) !Id {
523 if (module.cache.void_type) |id| return id;
524
525 const result_id = module.allocId();
526 try module.sections.globals.emit(module.gpa, .OpTypeVoid, .{
527 .id_result = result_id,
528 });
529 module.cache.void_type = result_id;
530 try module.debugName(result_id, "void");
531 return result_id;
532}
533
534pub fn opaqueType(module: *Module, name: []const u8) !Id {
535 if (module.cache.opaque_types.get(name)) |id| return id;
536 const result_id = module.allocId();
537 const name_dup = try module.arena.dupe(u8, name);
538 try module.sections.globals.emit(module.gpa, .OpTypeOpaque, .{
539 .id_result = result_id,
540 .literal_string = name_dup,
541 });
542 try module.debugName(result_id, name_dup);
543 try module.cache.opaque_types.put(module.gpa, name_dup, result_id);
544 return result_id;
545}
546
547pub fn backingIntBits(module: *Module, bits: u16) struct { u16, bool } {
548 assert(bits != 0);
549 const target = module.zcu.getTarget();
550
551 if (target.cpu.has(.spirv, .arbitrary_precision_integers) and bits <= 32) {
552 return .{ bits, false };
553 }
554
555 // We require Int8 and Int16 capabilities and benefit Int64 when available.
556 // 32-bit integers are always supported (see spec, 2.16.1, Data rules).
557 const ints = [_]struct { bits: u16, enabled: bool }{
558 .{ .bits = 8, .enabled = true },
559 .{ .bits = 16, .enabled = true },
560 .{ .bits = 32, .enabled = true },
561 .{
562 .bits = 64,
563 .enabled = target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64,
564 },
565 };
566
567 for (ints) |int| {
568 if (bits <= int.bits and int.enabled) return .{ int.bits, false };
569 }
570
571 // Big int
572 return .{ std.mem.alignForward(u16, bits, big_int_bits), true };
573}
574
575pub fn intType(module: *Module, signedness: std.builtin.Signedness, bits: u16) !Id {
576 assert(bits > 0);
577
578 const target = module.zcu.getTarget();
579 const actual_signedness = switch (target.os.tag) {
580 // Kernel only supports unsigned ints.
581 .opencl, .amdhsa => .unsigned,
582 else => signedness,
583 };
584 const backing_bits, const big_int = module.backingIntBits(bits);
585 if (big_int) {
586 // TODO: support composite integers larger than 64 bit
587 assert(backing_bits <= 64);
588 const u32_ty = try module.intType(.unsigned, 32);
589 const len_id = try module.constant(u32_ty, .{ .uint32 = backing_bits / big_int_bits });
590 return module.arrayType(len_id, u32_ty);
591 }
592
593 const entry = try module.cache.int_types.getOrPut(module.gpa, .{ .signedness = actual_signedness, .bits = backing_bits });
594 if (!entry.found_existing) {
595 const result_id = module.allocId();
596 entry.value_ptr.* = result_id;
597 try module.sections.globals.emit(module.gpa, .OpTypeInt, .{
598 .id_result = result_id,
599 .width = backing_bits,
600 .signedness = switch (actual_signedness) {
601 .signed => 1,
602 .unsigned => 0,
603 },
604 });
605
606 switch (actual_signedness) {
607 .signed => try module.debugNameFmt(result_id, "i{}", .{backing_bits}),
608 .unsigned => try module.debugNameFmt(result_id, "u{}", .{backing_bits}),
609 }
610 }
611 return entry.value_ptr.*;
612}
613
614pub fn floatType(module: *Module, bits: u16) !Id {
615 assert(bits > 0);
616 const entry = try module.cache.float_types.getOrPut(module.gpa, .{ .bits = bits });
617 if (!entry.found_existing) {
618 const result_id = module.allocId();
619 entry.value_ptr.* = result_id;
620 try module.sections.globals.emit(module.gpa, .OpTypeFloat, .{
621 .id_result = result_id,
622 .width = bits,
623 });
624 try module.debugNameFmt(result_id, "f{}", .{bits});
625 }
626 return entry.value_ptr.*;
627}
628
629pub fn vectorType(module: *Module, len: u32, child_ty_id: Id) !Id {
630 const entry = try module.cache.vector_types.getOrPut(module.gpa, .{ child_ty_id, len });
631 if (!entry.found_existing) {
632 const result_id = module.allocId();
633 entry.value_ptr.* = result_id;
634 try module.sections.globals.emit(module.gpa, .OpTypeVector, .{
635 .id_result = result_id,
636 .component_type = child_ty_id,
637 .component_count = len,
638 });
639 }
640 return entry.value_ptr.*;
641}
642
643pub fn arrayType(module: *Module, len_id: Id, child_ty_id: Id) !Id {
644 const entry = try module.cache.array_types.getOrPut(module.gpa, .{ child_ty_id, len_id });
645 if (!entry.found_existing) {
646 const result_id = module.allocId();
647 entry.value_ptr.* = result_id;
648 try module.sections.globals.emit(module.gpa, .OpTypeArray, .{
649 .id_result = result_id,
650 .element_type = child_ty_id,
651 .length = len_id,
652 });
653 }
654 return entry.value_ptr.*;
655}
656
657pub fn ptrType(module: *Module, child_ty_id: Id, storage_class: spec.StorageClass) !Id {
658 const key = .{ child_ty_id, storage_class };
659 const gop = try module.ptr_types.getOrPut(module.gpa, key);
660 if (!gop.found_existing) {
661 gop.value_ptr.* = module.allocId();
662 try module.sections.globals.emit(module.gpa, .OpTypePointer, .{
663 .id_result = gop.value_ptr.*,
664 .storage_class = storage_class,
665 .type = child_ty_id,
666 });
667 return gop.value_ptr.*;
668 }
669 return gop.value_ptr.*;
670}
671
672pub fn structType(
673 module: *Module,
674 types: []const Id,
675 maybe_names: ?[]const []const u8,
676 maybe_offsets: ?[]const u32,
677 ip_index: InternPool.Index,
678) !Id {
679 const target = module.zcu.getTarget();
680
681 if (module.cache.struct_types.get(.{ .fields = types, .ip_index = ip_index })) |id| return id;
682 const result_id = module.allocId();
683 const types_dup = try module.arena.dupe(Id, types);
684 try module.sections.globals.emit(module.gpa, .OpTypeStruct, .{
685 .id_result = result_id,
686 .id_ref = types_dup,
687 });
688
689 if (maybe_names) |names| {
690 assert(names.len == types.len);
691 for (names, 0..) |name, i| {
692 try module.memberDebugName(result_id, @intCast(i), name);
693 }
694 }
695
696 switch (target.os.tag) {
697 .vulkan, .opengl => {
698 if (maybe_offsets) |offsets| {
699 assert(offsets.len == types.len);
700 for (offsets, 0..) |offset, i| {
701 try module.decorateMember(
702 result_id,
703 @intCast(i),
704 .{ .offset = .{ .byte_offset = offset } },
705 );
706 }
707 }
708 },
709 else => {},
710 }
711
712 try module.cache.struct_types.put(
713 module.gpa,
714 .{
715 .fields = types_dup,
716 .ip_index = if (module.zcu.comp.config.root_strip) .none else ip_index,
717 },
718 result_id,
719 );
720 return result_id;
721}
722
723pub fn functionType(module: *Module, return_ty_id: Id, param_type_ids: []const Id) !Id {
724 if (module.cache.fn_types.get(.{
725 .return_ty = return_ty_id,
726 .params = param_type_ids,
727 })) |id| return id;
728 const result_id = module.allocId();
729 const params_dup = try module.arena.dupe(Id, param_type_ids);
730 try module.sections.globals.emit(module.gpa, .OpTypeFunction, .{
731 .id_result = result_id,
732 .return_type = return_ty_id,
733 .id_ref_2 = params_dup,
734 });
735 try module.cache.fn_types.put(module.gpa, .{
736 .return_ty = return_ty_id,
737 .params = params_dup,
738 }, result_id);
739 return result_id;
740}
741
742pub fn constant(module: *Module, ty_id: Id, value: spec.LiteralContextDependentNumber) !Id {
743 const gop = try module.cache.constants.getOrPut(module.gpa, .{ .ty = ty_id, .value = value });
744 if (!gop.found_existing) {
745 gop.value_ptr.* = module.allocId();
746 try module.sections.globals.emit(module.gpa, .OpConstant, .{
747 .id_result_type = ty_id,
748 .id_result = gop.value_ptr.*,
749 .value = value,
750 });
751 }
752 return gop.value_ptr.*;
753}
754
755pub fn constBool(module: *Module, value: bool) !Id {
756 if (module.cache.bool_const[@intFromBool(value)]) |b| return b;
757
758 const result_ty_id = try module.boolType();
759 const result_id = module.allocId();
760 module.cache.bool_const[@intFromBool(value)] = result_id;
761
762 switch (value) {
763 inline else => |value_ct| try module.sections.globals.emit(
764 module.gpa,
765 if (value_ct) .OpConstantTrue else .OpConstantFalse,
766 .{
767 .id_result_type = result_ty_id,
768 .id_result = result_id,
769 },
770 ),
771 }
772
773 return result_id;
774}
775
776pub fn builtin(
777 module: *Module,
778 result_ty_id: Id,
779 spirv_builtin: spec.BuiltIn,
780 storage_class: spec.StorageClass,
781) !Decl.Index {
782 const gop = try module.cache.builtins.getOrPut(module.gpa, .{ spirv_builtin, storage_class });
783 if (!gop.found_existing) {
784 const decl_index = try module.allocDecl(.global);
785 const result_id = module.declPtr(decl_index).result_id;
786 gop.value_ptr.* = decl_index;
787 try module.sections.globals.emit(module.gpa, .OpVariable, .{
788 .id_result_type = result_ty_id,
789 .id_result = result_id,
790 .storage_class = storage_class,
791 });
792 try module.decorate(result_id, .{ .built_in = .{ .built_in = spirv_builtin } });
793 try module.declareDeclDeps(decl_index, &.{});
794 }
795 return gop.value_ptr.*;
796}
797
798pub fn constUndef(module: *Module, ty_id: Id) !Id {
799 const result_id = module.allocId();
800 try module.sections.globals.emit(module.gpa, .OpUndef, .{
801 .id_result_type = ty_id,
802 .id_result = result_id,
803 });
804 return result_id;
805}
806
807pub fn constNull(module: *Module, ty_id: Id) !Id {
808 const result_id = module.allocId();
809 try module.sections.globals.emit(module.gpa, .OpConstantNull, .{
810 .id_result_type = ty_id,
811 .id_result = result_id,
812 });
813 return result_id;
814}
815
816/// Decorate a result-id.
817pub fn decorate(
818 module: *Module,
819 target: Id,
820 decoration: spec.Decoration.Extended,
821) !void {
822 const gop = try module.cache.decorations.getOrPut(module.gpa, .{ target, decoration });
823 if (!gop.found_existing) {
824 try module.sections.annotations.emit(module.gpa, .OpDecorate, .{
825 .target = target,
826 .decoration = decoration,
827 });
828 }
829}
830
831/// Decorate a result-id which is a member of some struct.
832/// We really don't have to and shouldn't need to cache this.
833pub fn decorateMember(
834 module: *Module,
835 structure_type: Id,
836 member: u32,
837 decoration: spec.Decoration.Extended,
838) !void {
839 try module.sections.annotations.emit(module.gpa, .OpMemberDecorate, .{
840 .structure_type = structure_type,
841 .member = member,
842 .decoration = decoration,
843 });
844}
845
846pub fn allocDecl(module: *Module, kind: Decl.Kind) !Decl.Index {
847 try module.decls.append(module.gpa, .{
848 .kind = kind,
849 .result_id = module.allocId(),
850 .begin_dep = undefined,
851 .end_dep = undefined,
852 });
853
854 return @as(Decl.Index, @enumFromInt(@as(u32, @intCast(module.decls.items.len - 1))));
855}
856
857pub fn declPtr(module: *Module, index: Decl.Index) *Decl {
858 return &module.decls.items[@intFromEnum(index)];
859}
860
861/// Declare ALL dependencies for a decl.
862pub fn declareDeclDeps(module: *Module, decl_index: Decl.Index, deps: []const Decl.Index) !void {
863 const begin_dep: u32 = @intCast(module.decl_deps.items.len);
864 try module.decl_deps.appendSlice(module.gpa, deps);
865 const end_dep: u32 = @intCast(module.decl_deps.items.len);
866
867 const decl = module.declPtr(decl_index);
868 decl.begin_dep = begin_dep;
869 decl.end_dep = end_dep;
870}
871
872/// Declare a SPIR-V function as an entry point. This causes an extra wrapper
873/// function to be generated, which is then exported as the real entry point. The purpose of this
874/// wrapper is to allocate and initialize the structure holding the instance globals.
875pub fn declareEntryPoint(
876 module: *Module,
877 decl_index: Decl.Index,
878 name: []const u8,
879 exec_model: spec.ExecutionModel,
880 exec_mode: ?spec.ExecutionMode,
881) !void {
882 const gop = try module.entry_points.getOrPut(module.gpa, module.declPtr(decl_index).result_id);
883 gop.value_ptr.decl_index = decl_index;
884 gop.value_ptr.name = name;
885 gop.value_ptr.exec_model = exec_model;
886 // Might've been set by assembler
887 if (!gop.found_existing) gop.value_ptr.exec_mode = exec_mode;
888}
889
890pub fn debugName(module: *Module, target: Id, name: []const u8) !void {
891 try module.sections.debug_names.emit(module.gpa, .OpName, .{
892 .target = target,
893 .name = name,
894 });
895}
896
897pub fn debugNameFmt(module: *Module, target: Id, comptime fmt: []const u8, args: anytype) !void {
898 const name = try std.fmt.allocPrint(module.gpa, fmt, args);
899 defer module.gpa.free(name);
900 try module.debugName(target, name);
901}
902
903pub fn memberDebugName(module: *Module, target: Id, member: u32, name: []const u8) !void {
904 try module.sections.debug_names.emit(module.gpa, .OpMemberName, .{
905 .type = target,
906 .member = member,
907 .name = name,
908 });
909}
910
911pub fn debugString(module: *Module, string: []const u8) !Id {
912 const entry = try module.cache.strings.getOrPut(module.gpa, string);
913 if (!entry.found_existing) {
914 entry.value_ptr.* = module.allocId();
915 try module.sections.debug_strings.emit(module.gpa, .OpString, .{
916 .id_result = entry.value_ptr.*,
917 .string = string,
918 });
919 }
920 return entry.value_ptr.*;
921}
922
923pub fn storageClass(module: *Module, as: std.builtin.AddressSpace) spec.StorageClass {
924 const target = module.zcu.getTarget();
925 return switch (as) {
926 .generic => .function,
927 .global => switch (target.os.tag) {
928 .opencl, .amdhsa => .cross_workgroup,
929 else => .storage_buffer,
930 },
931 .push_constant => .push_constant,
932 .output => .output,
933 .uniform => .uniform,
934 .storage_buffer => .storage_buffer,
935 .physical_storage_buffer => .physical_storage_buffer,
936 .constant => .uniform_constant,
937 .shared => .workgroup,
938 .local => .function,
939 .input => .input,
940 .gs,
941 .fs,
942 .ss,
943 .param,
944 .flash,
945 .flash1,
946 .flash2,
947 .flash3,
948 .flash4,
949 .flash5,
950 .cog,
951 .lut,
952 .hub,
953 => unreachable,
954 };
955}
src/codegen/spirv/Section.zig created+282
...@@ -0,0 +1,282 @@
1//! Represents a section or subsection of instructions in a SPIR-V binary. Instructions can be append
2//! to separate sections, which can then later be merged into the final binary.
3const Section = @This();
4
5const std = @import("std");
6const Allocator = std.mem.Allocator;
7const testing = std.testing;
8
9const spec = @import("spec.zig");
10const Word = spec.Word;
11const DoubleWord = std.meta.Int(.unsigned, @bitSizeOf(Word) * 2);
12const Log2Word = std.math.Log2Int(Word);
13
14const Opcode = spec.Opcode;
15
16instructions: std.ArrayListUnmanaged(Word) = .empty,
17
18pub fn deinit(section: *Section, allocator: Allocator) void {
19 section.instructions.deinit(allocator);
20 section.* = undefined;
21}
22
23pub fn reset(section: *Section) void {
24 section.instructions.items.len = 0;
25}
26
27pub fn toWords(section: Section) []Word {
28 return section.instructions.items;
29}
30
31/// Append the instructions from another section into this section.
32pub fn append(section: *Section, allocator: Allocator, other_section: Section) !void {
33 try section.instructions.appendSlice(allocator, other_section.instructions.items);
34}
35
36pub fn ensureUnusedCapacity(
37 section: *Section,
38 allocator: Allocator,
39 words: usize,
40) !void {
41 try section.instructions.ensureUnusedCapacity(allocator, words);
42}
43
44/// Write an instruction and size, operands are to be inserted manually.
45pub fn emitRaw(
46 section: *Section,
47 allocator: Allocator,
48 opcode: Opcode,
49 operand_words: usize,
50) !void {
51 const word_count = 1 + operand_words;
52 try section.instructions.ensureUnusedCapacity(allocator, word_count);
53 section.writeWord((@as(Word, @intCast(word_count << 16))) | @intFromEnum(opcode));
54}
55
56/// Write an entire instruction, including all operands
57pub fn emitRawInstruction(
58 section: *Section,
59 allocator: Allocator,
60 opcode: Opcode,
61 operands: []const Word,
62) !void {
63 try section.emitRaw(allocator, opcode, operands.len);
64 section.writeWords(operands);
65}
66
67pub fn emitAssumeCapacity(
68 section: *Section,
69 comptime opcode: spec.Opcode,
70 operands: opcode.Operands(),
71) !void {
72 const word_count = instructionSize(opcode, operands);
73 section.writeWord(@as(Word, @intCast(word_count << 16)) | @intFromEnum(opcode));
74 section.writeOperands(opcode.Operands(), operands);
75}
76
77pub fn emit(
78 section: *Section,
79 allocator: Allocator,
80 comptime opcode: spec.Opcode,
81 operands: opcode.Operands(),
82) !void {
83 const word_count = instructionSize(opcode, operands);
84 try section.instructions.ensureUnusedCapacity(allocator, word_count);
85 section.writeWord(@as(Word, @intCast(word_count << 16)) | @intFromEnum(opcode));
86 section.writeOperands(opcode.Operands(), operands);
87}
88
89pub fn emitBranch(
90 section: *Section,
91 allocator: Allocator,
92 target_label: spec.Id,
93) !void {
94 try section.emit(allocator, .OpBranch, .{
95 .target_label = target_label,
96 });
97}
98
99pub fn writeWord(section: *Section, word: Word) void {
100 section.instructions.appendAssumeCapacity(word);
101}
102
103pub fn writeWords(section: *Section, words: []const Word) void {
104 section.instructions.appendSliceAssumeCapacity(words);
105}
106
107pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {
108 section.writeWords(&.{
109 @truncate(dword),
110 @truncate(dword >> @bitSizeOf(Word)),
111 });
112}
113
114fn writeOperands(section: *Section, comptime Operands: type, operands: Operands) void {
115 const fields = switch (@typeInfo(Operands)) {
116 .@"struct" => |info| info.fields,
117 .void => return,
118 else => unreachable,
119 };
120 inline for (fields) |field| {
121 section.writeOperand(field.type, @field(operands, field.name));
122 }
123}
124
125pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand) void {
126 switch (Operand) {
127 spec.LiteralSpecConstantOpInteger => unreachable,
128 spec.Id => section.writeWord(@intFromEnum(operand)),
129 spec.LiteralInteger => section.writeWord(operand),
130 spec.LiteralString => section.writeString(operand),
131 spec.LiteralContextDependentNumber => section.writeContextDependentNumber(operand),
132 spec.LiteralExtInstInteger => section.writeWord(operand.inst),
133 spec.PairLiteralIntegerIdRef => section.writeWords(&.{ operand.value, @enumFromInt(operand.label) }),
134 spec.PairIdRefLiteralInteger => section.writeWords(&.{ @intFromEnum(operand.target), operand.member }),
135 spec.PairIdRefIdRef => section.writeWords(&.{ @intFromEnum(operand[0]), @intFromEnum(operand[1]) }),
136 else => switch (@typeInfo(Operand)) {
137 .@"enum" => section.writeWord(@intFromEnum(operand)),
138 .optional => |info| if (operand) |child| section.writeOperand(info.child, child),
139 .pointer => |info| {
140 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
141 for (operand) |item| {
142 section.writeOperand(info.child, item);
143 }
144 },
145 .@"struct" => |info| {
146 if (info.layout == .@"packed") {
147 section.writeWord(@as(Word, @bitCast(operand)));
148 } else {
149 section.writeExtendedMask(Operand, operand);
150 }
151 },
152 .@"union" => section.writeExtendedUnion(Operand, operand),
153 else => unreachable,
154 },
155 }
156}
157
158fn writeString(section: *Section, str: []const u8) void {
159 const zero_terminated_len = str.len + 1;
160 var i: usize = 0;
161 while (i < zero_terminated_len) : (i += @sizeOf(Word)) {
162 var word: Word = 0;
163 var j: usize = 0;
164 while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) {
165 word |= @as(Word, str[i + j]) << @as(Log2Word, @intCast(j * @bitSizeOf(u8)));
166 }
167 section.instructions.appendAssumeCapacity(word);
168 }
169}
170
171fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDependentNumber) void {
172 switch (operand) {
173 .int32 => |int| section.writeWord(@bitCast(int)),
174 .uint32 => |int| section.writeWord(@bitCast(int)),
175 .int64 => |int| section.writeDoubleWord(@bitCast(int)),
176 .uint64 => |int| section.writeDoubleWord(@bitCast(int)),
177 .float32 => |float| section.writeWord(@bitCast(float)),
178 .float64 => |float| section.writeDoubleWord(@bitCast(float)),
179 }
180}
181
182fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {
183 var mask: Word = 0;
184 inline for (@typeInfo(Operand).@"struct".fields, 0..) |field, bit| {
185 switch (@typeInfo(field.type)) {
186 .optional => if (@field(operand, field.name) != null) {
187 mask |= 1 << @as(u5, @intCast(bit));
188 },
189 .bool => if (@field(operand, field.name)) {
190 mask |= 1 << @as(u5, @intCast(bit));
191 },
192 else => unreachable,
193 }
194 }
195
196 section.writeWord(mask);
197
198 inline for (@typeInfo(Operand).@"struct".fields) |field| {
199 switch (@typeInfo(field.type)) {
200 .optional => |info| if (@field(operand, field.name)) |child| {
201 section.writeOperands(info.child, child);
202 },
203 .bool => {},
204 else => unreachable,
205 }
206 }
207}
208
209fn writeExtendedUnion(section: *Section, comptime Operand: type, operand: Operand) void {
210 return switch (operand) {
211 inline else => |op, tag| {
212 section.writeWord(@intFromEnum(tag));
213 section.writeOperands(
214 @FieldType(Operand, @tagName(tag)),
215 op,
216 );
217 },
218 };
219}
220
221fn instructionSize(comptime opcode: spec.Opcode, operands: opcode.Operands()) usize {
222 return operandsSize(opcode.Operands(), operands) + 1;
223}
224
225fn operandsSize(comptime Operands: type, operands: Operands) usize {
226 const fields = switch (@typeInfo(Operands)) {
227 .@"struct" => |info| info.fields,
228 .void => return 0,
229 else => unreachable,
230 };
231
232 var total: usize = 0;
233 inline for (fields) |field| {
234 total += operandSize(field.type, @field(operands, field.name));
235 }
236
237 return total;
238}
239
240fn operandSize(comptime Operand: type, operand: Operand) usize {
241 return switch (Operand) {
242 spec.LiteralSpecConstantOpInteger => unreachable,
243 spec.Id, spec.LiteralInteger, spec.LiteralExtInstInteger => 1,
244 spec.LiteralString => std.math.divCeil(usize, operand.len + 1, @sizeOf(Word)) catch unreachable,
245 spec.LiteralContextDependentNumber => switch (operand) {
246 .int32, .uint32, .float32 => 1,
247 .int64, .uint64, .float64 => 2,
248 },
249 spec.PairLiteralIntegerIdRef, spec.PairIdRefLiteralInteger, spec.PairIdRefIdRef => 2,
250 else => switch (@typeInfo(Operand)) {
251 .@"enum" => 1,
252 .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
253 .pointer => |info| blk: {
254 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
255 var total: usize = 0;
256 for (operand) |item| {
257 total += operandSize(info.child, item);
258 }
259 break :blk total;
260 },
261 .@"struct" => |struct_info| {
262 if (struct_info.layout == .@"packed") return 1;
263
264 var total: usize = 0;
265 inline for (@typeInfo(Operand).@"struct".fields) |field| {
266 switch (@typeInfo(field.type)) {
267 .optional => |info| if (@field(operand, field.name)) |child| {
268 total += operandsSize(info.child, child);
269 },
270 .bool => {},
271 else => unreachable,
272 }
273 }
274 return total + 1; // Add one for the mask itself.
275 },
276 .@"union" => switch (operand) {
277 inline else => |op, tag| operandsSize(@FieldType(Operand, @tagName(tag)), op) + 1,
278 },
279 else => unreachable,
280 },
281 };
282}
src/codegen/spirv/extinst.zig.grammar.json created+11
...@@ -0,0 +1,11 @@
1{
2 "version": 0,
3 "revision": 0,
4 "instructions": [
5 {
6 "opname": "InvocationGlobal",
7 "opcode": 0,
8 "operands": [{ "kind": "IdRef", "name": "initializer function" }]
9 }
10 ]
11}
src/codegen/spirv/spec.zig created+18428
...@@ -0,0 +1,18428 @@
1//! This file is auto-generated by tools/gen_spirv_spec.zig.
2
3const std = @import("std");
4
5pub const Version = packed struct(Word) {
6 padding: u8 = 0,
7 minor: u8,
8 major: u8,
9 padding0: u8 = 0,
10
11 pub fn toWord(self: @This()) Word {
12 return @bitCast(self);
13 }
14};
15
16pub const Word = u32;
17pub const Id = enum(Word) {
18 none,
19 _,
20
21 pub fn format(self: Id, writer: *std.io.Writer) std.io.Writer.Error!void {
22 switch (self) {
23 .none => try writer.writeAll("(none)"),
24 else => try writer.print("%{d}", .{@intFromEnum(self)}),
25 }
26 }
27};
28
29pub const IdRange = struct {
30 base: u32,
31 len: u32,
32
33 pub fn at(range: IdRange, i: usize) Id {
34 std.debug.assert(i < range.len);
35 return @enumFromInt(range.base + i);
36 }
37};
38
39pub const LiteralInteger = Word;
40pub const LiteralFloat = Word;
41pub const LiteralString = []const u8;
42pub const LiteralContextDependentNumber = union(enum) {
43 int32: i32,
44 uint32: u32,
45 int64: i64,
46 uint64: u64,
47 float32: f32,
48 float64: f64,
49};
50pub const LiteralExtInstInteger = struct { inst: Word };
51pub const LiteralSpecConstantOpInteger = struct { opcode: Opcode };
52pub const PairLiteralIntegerIdRef = struct { value: LiteralInteger, label: Id };
53pub const PairIdRefLiteralInteger = struct { target: Id, member: LiteralInteger };
54pub const PairIdRefIdRef = [2]Id;
55
56pub const Quantifier = enum {
57 required,
58 optional,
59 variadic,
60};
61
62pub const Operand = struct {
63 kind: OperandKind,
64 quantifier: Quantifier,
65};
66
67pub const OperandCategory = enum {
68 bit_enum,
69 value_enum,
70 id,
71 literal,
72 composite,
73};
74
75pub const Enumerant = struct {
76 name: []const u8,
77 value: Word,
78 parameters: []const OperandKind,
79};
80
81pub const Instruction = struct {
82 name: []const u8,
83 opcode: Word,
84 operands: []const Operand,
85};
86
87pub const zig_generator_id: Word = 41;
88pub const version: Version = .{ .major = 1, .minor = 6, .patch = 4 };
89pub const magic_number: Word = 0x07230203;
90
91pub const Class = enum {
92 miscellaneous,
93 debug,
94 extension,
95 mode_setting,
96 type_declaration,
97 constant_creation,
98 function,
99 memory,
100 annotation,
101 composite,
102 image,
103 conversion,
104 arithmetic,
105 relational_and_logical,
106 bit,
107 derivative,
108 primitive,
109 barrier,
110 atomic,
111 control_flow,
112 group,
113 pipe,
114 device_side_enqueue,
115 non_uniform,
116 tensor,
117 graph,
118 reserved,
119};
120
121pub const OperandKind = enum {
122 opcode,
123 image_operands,
124 fp_fast_math_mode,
125 selection_control,
126 loop_control,
127 function_control,
128 memory_semantics,
129 memory_access,
130 kernel_profiling_info,
131 ray_flags,
132 fragment_shading_rate,
133 raw_access_chain_operands,
134 source_language,
135 execution_model,
136 addressing_model,
137 memory_model,
138 execution_mode,
139 storage_class,
140 dim,
141 sampler_addressing_mode,
142 sampler_filter_mode,
143 image_format,
144 image_channel_order,
145 image_channel_data_type,
146 fp_rounding_mode,
147 fp_denorm_mode,
148 quantization_modes,
149 fp_operation_mode,
150 overflow_modes,
151 linkage_type,
152 access_qualifier,
153 host_access_qualifier,
154 function_parameter_attribute,
155 decoration,
156 built_in,
157 scope,
158 group_operation,
159 kernel_enqueue_flags,
160 capability,
161 ray_query_intersection,
162 ray_query_committed_intersection_type,
163 ray_query_candidate_intersection_type,
164 packed_vector_format,
165 cooperative_matrix_operands,
166 cooperative_matrix_layout,
167 cooperative_matrix_use,
168 cooperative_matrix_reduce,
169 tensor_clamp_mode,
170 tensor_addressing_operands,
171 initialization_mode_qualifier,
172 load_cache_control,
173 store_cache_control,
174 named_maximum_number_of_registers,
175 matrix_multiply_accumulate_operands,
176 fp_encoding,
177 cooperative_vector_matrix_layout,
178 component_type,
179 id_result_type,
180 id_result,
181 id_memory_semantics,
182 id_scope,
183 id_ref,
184 literal_integer,
185 literal_string,
186 literal_float,
187 literal_context_dependent_number,
188 literal_ext_inst_integer,
189 literal_spec_constant_op_integer,
190 pair_literal_integer_id_ref,
191 pair_id_ref_literal_integer,
192 pair_id_ref_id_ref,
193 tensor_operands,
194 debug_info_debug_info_flags,
195 debug_info_debug_base_type_attribute_encoding,
196 debug_info_debug_composite_type,
197 debug_info_debug_type_qualifier,
198 debug_info_debug_operation,
199 open_cl_debug_info_100_debug_info_flags,
200 open_cl_debug_info_100_debug_base_type_attribute_encoding,
201 open_cl_debug_info_100_debug_composite_type,
202 open_cl_debug_info_100_debug_type_qualifier,
203 open_cl_debug_info_100_debug_operation,
204 open_cl_debug_info_100_debug_imported_entity,
205 non_semantic_clspv_reflection_6_kernel_property_flags,
206 non_semantic_shader_debug_info_100_debug_info_flags,
207 non_semantic_shader_debug_info_100_build_identifier_flags,
208 non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding,
209 non_semantic_shader_debug_info_100_debug_composite_type,
210 non_semantic_shader_debug_info_100_debug_type_qualifier,
211 non_semantic_shader_debug_info_100_debug_operation,
212 non_semantic_shader_debug_info_100_debug_imported_entity,
213
214 pub fn category(self: OperandKind) OperandCategory {
215 return switch (self) {
216 .opcode => .literal,
217 .image_operands => .bit_enum,
218 .fp_fast_math_mode => .bit_enum,
219 .selection_control => .bit_enum,
220 .loop_control => .bit_enum,
221 .function_control => .bit_enum,
222 .memory_semantics => .bit_enum,
223 .memory_access => .bit_enum,
224 .kernel_profiling_info => .bit_enum,
225 .ray_flags => .bit_enum,
226 .fragment_shading_rate => .bit_enum,
227 .raw_access_chain_operands => .bit_enum,
228 .source_language => .value_enum,
229 .execution_model => .value_enum,
230 .addressing_model => .value_enum,
231 .memory_model => .value_enum,
232 .execution_mode => .value_enum,
233 .storage_class => .value_enum,
234 .dim => .value_enum,
235 .sampler_addressing_mode => .value_enum,
236 .sampler_filter_mode => .value_enum,
237 .image_format => .value_enum,
238 .image_channel_order => .value_enum,
239 .image_channel_data_type => .value_enum,
240 .fp_rounding_mode => .value_enum,
241 .fp_denorm_mode => .value_enum,
242 .quantization_modes => .value_enum,
243 .fp_operation_mode => .value_enum,
244 .overflow_modes => .value_enum,
245 .linkage_type => .value_enum,
246 .access_qualifier => .value_enum,
247 .host_access_qualifier => .value_enum,
248 .function_parameter_attribute => .value_enum,
249 .decoration => .value_enum,
250 .built_in => .value_enum,
251 .scope => .value_enum,
252 .group_operation => .value_enum,
253 .kernel_enqueue_flags => .value_enum,
254 .capability => .value_enum,
255 .ray_query_intersection => .value_enum,
256 .ray_query_committed_intersection_type => .value_enum,
257 .ray_query_candidate_intersection_type => .value_enum,
258 .packed_vector_format => .value_enum,
259 .cooperative_matrix_operands => .bit_enum,
260 .cooperative_matrix_layout => .value_enum,
261 .cooperative_matrix_use => .value_enum,
262 .cooperative_matrix_reduce => .bit_enum,
263 .tensor_clamp_mode => .value_enum,
264 .tensor_addressing_operands => .bit_enum,
265 .initialization_mode_qualifier => .value_enum,
266 .load_cache_control => .value_enum,
267 .store_cache_control => .value_enum,
268 .named_maximum_number_of_registers => .value_enum,
269 .matrix_multiply_accumulate_operands => .bit_enum,
270 .fp_encoding => .value_enum,
271 .cooperative_vector_matrix_layout => .value_enum,
272 .component_type => .value_enum,
273 .id_result_type => .id,
274 .id_result => .id,
275 .id_memory_semantics => .id,
276 .id_scope => .id,
277 .id_ref => .id,
278 .literal_integer => .literal,
279 .literal_string => .literal,
280 .literal_float => .literal,
281 .literal_context_dependent_number => .literal,
282 .literal_ext_inst_integer => .literal,
283 .literal_spec_constant_op_integer => .literal,
284 .pair_literal_integer_id_ref => .composite,
285 .pair_id_ref_literal_integer => .composite,
286 .pair_id_ref_id_ref => .composite,
287 .tensor_operands => .bit_enum,
288 .debug_info_debug_info_flags => .bit_enum,
289 .debug_info_debug_base_type_attribute_encoding => .value_enum,
290 .debug_info_debug_composite_type => .value_enum,
291 .debug_info_debug_type_qualifier => .value_enum,
292 .debug_info_debug_operation => .value_enum,
293 .open_cl_debug_info_100_debug_info_flags => .bit_enum,
294 .open_cl_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
295 .open_cl_debug_info_100_debug_composite_type => .value_enum,
296 .open_cl_debug_info_100_debug_type_qualifier => .value_enum,
297 .open_cl_debug_info_100_debug_operation => .value_enum,
298 .open_cl_debug_info_100_debug_imported_entity => .value_enum,
299 .non_semantic_clspv_reflection_6_kernel_property_flags => .bit_enum,
300 .non_semantic_shader_debug_info_100_debug_info_flags => .bit_enum,
301 .non_semantic_shader_debug_info_100_build_identifier_flags => .bit_enum,
302 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
303 .non_semantic_shader_debug_info_100_debug_composite_type => .value_enum,
304 .non_semantic_shader_debug_info_100_debug_type_qualifier => .value_enum,
305 .non_semantic_shader_debug_info_100_debug_operation => .value_enum,
306 .non_semantic_shader_debug_info_100_debug_imported_entity => .value_enum,
307 };
308 }
309 pub fn enumerants(self: OperandKind) []const Enumerant {
310 return switch (self) {
311 .opcode => unreachable,
312 .image_operands => &.{
313 .{ .name = "Bias", .value = 0x0001, .parameters = &.{.id_ref} },
314 .{ .name = "Lod", .value = 0x0002, .parameters = &.{.id_ref} },
315 .{ .name = "Grad", .value = 0x0004, .parameters = &.{ .id_ref, .id_ref } },
316 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &.{.id_ref} },
317 .{ .name = "Offset", .value = 0x0010, .parameters = &.{.id_ref} },
318 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &.{.id_ref} },
319 .{ .name = "Sample", .value = 0x0040, .parameters = &.{.id_ref} },
320 .{ .name = "MinLod", .value = 0x0080, .parameters = &.{.id_ref} },
321 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &.{.id_scope} },
322 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &.{.id_scope} },
323 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &.{} },
324 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &.{} },
325 .{ .name = "SignExtend", .value = 0x1000, .parameters = &.{} },
326 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &.{} },
327 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &.{} },
328 .{ .name = "Offsets", .value = 0x10000, .parameters = &.{.id_ref} },
329 },
330 .fp_fast_math_mode => &.{
331 .{ .name = "NotNaN", .value = 0x0001, .parameters = &.{} },
332 .{ .name = "NotInf", .value = 0x0002, .parameters = &.{} },
333 .{ .name = "NSZ", .value = 0x0004, .parameters = &.{} },
334 .{ .name = "AllowRecip", .value = 0x0008, .parameters = &.{} },
335 .{ .name = "Fast", .value = 0x0010, .parameters = &.{} },
336 .{ .name = "AllowContract", .value = 0x10000, .parameters = &.{} },
337 .{ .name = "AllowReassoc", .value = 0x20000, .parameters = &.{} },
338 .{ .name = "AllowTransform", .value = 0x40000, .parameters = &.{} },
339 },
340 .selection_control => &.{
341 .{ .name = "Flatten", .value = 0x0001, .parameters = &.{} },
342 .{ .name = "DontFlatten", .value = 0x0002, .parameters = &.{} },
343 },
344 .loop_control => &.{
345 .{ .name = "Unroll", .value = 0x0001, .parameters = &.{} },
346 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &.{} },
347 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &.{} },
348 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &.{.literal_integer} },
349 .{ .name = "MinIterations", .value = 0x0010, .parameters = &.{.literal_integer} },
350 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &.{.literal_integer} },
351 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &.{.literal_integer} },
352 .{ .name = "PeelCount", .value = 0x0080, .parameters = &.{.literal_integer} },
353 .{ .name = "PartialCount", .value = 0x0100, .parameters = &.{.literal_integer} },
354 .{ .name = "InitiationIntervalINTEL", .value = 0x10000, .parameters = &.{.literal_integer} },
355 .{ .name = "MaxConcurrencyINTEL", .value = 0x20000, .parameters = &.{.literal_integer} },
356 .{ .name = "DependencyArrayINTEL", .value = 0x40000, .parameters = &.{.literal_integer} },
357 .{ .name = "PipelineEnableINTEL", .value = 0x80000, .parameters = &.{.literal_integer} },
358 .{ .name = "LoopCoalesceINTEL", .value = 0x100000, .parameters = &.{.literal_integer} },
359 .{ .name = "MaxInterleavingINTEL", .value = 0x200000, .parameters = &.{.literal_integer} },
360 .{ .name = "SpeculatedIterationsINTEL", .value = 0x400000, .parameters = &.{.literal_integer} },
361 .{ .name = "NoFusionINTEL", .value = 0x800000, .parameters = &.{} },
362 .{ .name = "LoopCountINTEL", .value = 0x1000000, .parameters = &.{.literal_integer} },
363 .{ .name = "MaxReinvocationDelayINTEL", .value = 0x2000000, .parameters = &.{.literal_integer} },
364 },
365 .function_control => &.{
366 .{ .name = "Inline", .value = 0x0001, .parameters = &.{} },
367 .{ .name = "DontInline", .value = 0x0002, .parameters = &.{} },
368 .{ .name = "Pure", .value = 0x0004, .parameters = &.{} },
369 .{ .name = "Const", .value = 0x0008, .parameters = &.{} },
370 .{ .name = "OptNoneEXT", .value = 0x10000, .parameters = &.{} },
371 },
372 .memory_semantics => &.{
373 .{ .name = "Relaxed", .value = 0x0000, .parameters = &.{} },
374 .{ .name = "Acquire", .value = 0x0002, .parameters = &.{} },
375 .{ .name = "Release", .value = 0x0004, .parameters = &.{} },
376 .{ .name = "AcquireRelease", .value = 0x0008, .parameters = &.{} },
377 .{ .name = "SequentiallyConsistent", .value = 0x0010, .parameters = &.{} },
378 .{ .name = "UniformMemory", .value = 0x0040, .parameters = &.{} },
379 .{ .name = "SubgroupMemory", .value = 0x0080, .parameters = &.{} },
380 .{ .name = "WorkgroupMemory", .value = 0x0100, .parameters = &.{} },
381 .{ .name = "CrossWorkgroupMemory", .value = 0x0200, .parameters = &.{} },
382 .{ .name = "AtomicCounterMemory", .value = 0x0400, .parameters = &.{} },
383 .{ .name = "ImageMemory", .value = 0x0800, .parameters = &.{} },
384 .{ .name = "OutputMemory", .value = 0x1000, .parameters = &.{} },
385 .{ .name = "MakeAvailable", .value = 0x2000, .parameters = &.{} },
386 .{ .name = "MakeVisible", .value = 0x4000, .parameters = &.{} },
387 .{ .name = "Volatile", .value = 0x8000, .parameters = &.{} },
388 },
389 .memory_access => &.{
390 .{ .name = "Volatile", .value = 0x0001, .parameters = &.{} },
391 .{ .name = "Aligned", .value = 0x0002, .parameters = &.{.literal_integer} },
392 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &.{} },
393 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &.{.id_scope} },
394 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &.{.id_scope} },
395 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &.{} },
396 .{ .name = "AliasScopeINTELMask", .value = 0x10000, .parameters = &.{.id_ref} },
397 .{ .name = "NoAliasINTELMask", .value = 0x20000, .parameters = &.{.id_ref} },
398 },
399 .kernel_profiling_info => &.{
400 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &.{} },
401 },
402 .ray_flags => &.{
403 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
404 .{ .name = "OpaqueKHR", .value = 0x0001, .parameters = &.{} },
405 .{ .name = "NoOpaqueKHR", .value = 0x0002, .parameters = &.{} },
406 .{ .name = "TerminateOnFirstHitKHR", .value = 0x0004, .parameters = &.{} },
407 .{ .name = "SkipClosestHitShaderKHR", .value = 0x0008, .parameters = &.{} },
408 .{ .name = "CullBackFacingTrianglesKHR", .value = 0x0010, .parameters = &.{} },
409 .{ .name = "CullFrontFacingTrianglesKHR", .value = 0x0020, .parameters = &.{} },
410 .{ .name = "CullOpaqueKHR", .value = 0x0040, .parameters = &.{} },
411 .{ .name = "CullNoOpaqueKHR", .value = 0x0080, .parameters = &.{} },
412 .{ .name = "SkipTrianglesKHR", .value = 0x0100, .parameters = &.{} },
413 .{ .name = "SkipAABBsKHR", .value = 0x0200, .parameters = &.{} },
414 .{ .name = "ForceOpacityMicromap2StateEXT", .value = 0x0400, .parameters = &.{} },
415 },
416 .fragment_shading_rate => &.{
417 .{ .name = "Vertical2Pixels", .value = 0x0001, .parameters = &.{} },
418 .{ .name = "Vertical4Pixels", .value = 0x0002, .parameters = &.{} },
419 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &.{} },
420 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &.{} },
421 },
422 .raw_access_chain_operands => &.{
423 .{ .name = "RobustnessPerComponentNV", .value = 0x0001, .parameters = &.{} },
424 .{ .name = "RobustnessPerElementNV", .value = 0x0002, .parameters = &.{} },
425 },
426 .source_language => &.{
427 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
428 .{ .name = "ESSL", .value = 1, .parameters = &.{} },
429 .{ .name = "GLSL", .value = 2, .parameters = &.{} },
430 .{ .name = "OpenCL_C", .value = 3, .parameters = &.{} },
431 .{ .name = "OpenCL_CPP", .value = 4, .parameters = &.{} },
432 .{ .name = "HLSL", .value = 5, .parameters = &.{} },
433 .{ .name = "CPP_for_OpenCL", .value = 6, .parameters = &.{} },
434 .{ .name = "SYCL", .value = 7, .parameters = &.{} },
435 .{ .name = "HERO_C", .value = 8, .parameters = &.{} },
436 .{ .name = "NZSL", .value = 9, .parameters = &.{} },
437 .{ .name = "WGSL", .value = 10, .parameters = &.{} },
438 .{ .name = "Slang", .value = 11, .parameters = &.{} },
439 .{ .name = "Zig", .value = 12, .parameters = &.{} },
440 .{ .name = "Rust", .value = 13, .parameters = &.{} },
441 },
442 .execution_model => &.{
443 .{ .name = "Vertex", .value = 0, .parameters = &.{} },
444 .{ .name = "TessellationControl", .value = 1, .parameters = &.{} },
445 .{ .name = "TessellationEvaluation", .value = 2, .parameters = &.{} },
446 .{ .name = "Geometry", .value = 3, .parameters = &.{} },
447 .{ .name = "Fragment", .value = 4, .parameters = &.{} },
448 .{ .name = "GLCompute", .value = 5, .parameters = &.{} },
449 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
450 .{ .name = "TaskNV", .value = 5267, .parameters = &.{} },
451 .{ .name = "MeshNV", .value = 5268, .parameters = &.{} },
452 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &.{} },
453 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &.{} },
454 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &.{} },
455 .{ .name = "ClosestHitKHR", .value = 5316, .parameters = &.{} },
456 .{ .name = "MissKHR", .value = 5317, .parameters = &.{} },
457 .{ .name = "CallableKHR", .value = 5318, .parameters = &.{} },
458 .{ .name = "TaskEXT", .value = 5364, .parameters = &.{} },
459 .{ .name = "MeshEXT", .value = 5365, .parameters = &.{} },
460 },
461 .addressing_model => &.{
462 .{ .name = "Logical", .value = 0, .parameters = &.{} },
463 .{ .name = "Physical32", .value = 1, .parameters = &.{} },
464 .{ .name = "Physical64", .value = 2, .parameters = &.{} },
465 .{ .name = "PhysicalStorageBuffer64", .value = 5348, .parameters = &.{} },
466 },
467 .memory_model => &.{
468 .{ .name = "Simple", .value = 0, .parameters = &.{} },
469 .{ .name = "GLSL450", .value = 1, .parameters = &.{} },
470 .{ .name = "OpenCL", .value = 2, .parameters = &.{} },
471 .{ .name = "Vulkan", .value = 3, .parameters = &.{} },
472 },
473 .execution_mode => &.{
474 .{ .name = "Invocations", .value = 0, .parameters = &.{.literal_integer} },
475 .{ .name = "SpacingEqual", .value = 1, .parameters = &.{} },
476 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &.{} },
477 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &.{} },
478 .{ .name = "VertexOrderCw", .value = 4, .parameters = &.{} },
479 .{ .name = "VertexOrderCcw", .value = 5, .parameters = &.{} },
480 .{ .name = "PixelCenterInteger", .value = 6, .parameters = &.{} },
481 .{ .name = "OriginUpperLeft", .value = 7, .parameters = &.{} },
482 .{ .name = "OriginLowerLeft", .value = 8, .parameters = &.{} },
483 .{ .name = "EarlyFragmentTests", .value = 9, .parameters = &.{} },
484 .{ .name = "PointMode", .value = 10, .parameters = &.{} },
485 .{ .name = "Xfb", .value = 11, .parameters = &.{} },
486 .{ .name = "DepthReplacing", .value = 12, .parameters = &.{} },
487 .{ .name = "DepthGreater", .value = 14, .parameters = &.{} },
488 .{ .name = "DepthLess", .value = 15, .parameters = &.{} },
489 .{ .name = "DepthUnchanged", .value = 16, .parameters = &.{} },
490 .{ .name = "LocalSize", .value = 17, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
491 .{ .name = "LocalSizeHint", .value = 18, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
492 .{ .name = "InputPoints", .value = 19, .parameters = &.{} },
493 .{ .name = "InputLines", .value = 20, .parameters = &.{} },
494 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &.{} },
495 .{ .name = "Triangles", .value = 22, .parameters = &.{} },
496 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &.{} },
497 .{ .name = "Quads", .value = 24, .parameters = &.{} },
498 .{ .name = "Isolines", .value = 25, .parameters = &.{} },
499 .{ .name = "OutputVertices", .value = 26, .parameters = &.{.literal_integer} },
500 .{ .name = "OutputPoints", .value = 27, .parameters = &.{} },
501 .{ .name = "OutputLineStrip", .value = 28, .parameters = &.{} },
502 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &.{} },
503 .{ .name = "VecTypeHint", .value = 30, .parameters = &.{.literal_integer} },
504 .{ .name = "ContractionOff", .value = 31, .parameters = &.{} },
505 .{ .name = "Initializer", .value = 33, .parameters = &.{} },
506 .{ .name = "Finalizer", .value = 34, .parameters = &.{} },
507 .{ .name = "SubgroupSize", .value = 35, .parameters = &.{.literal_integer} },
508 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &.{.literal_integer} },
509 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &.{.id_ref} },
510 .{ .name = "LocalSizeId", .value = 38, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
511 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
512 .{ .name = "NonCoherentColorAttachmentReadEXT", .value = 4169, .parameters = &.{} },
513 .{ .name = "NonCoherentDepthAttachmentReadEXT", .value = 4170, .parameters = &.{} },
514 .{ .name = "NonCoherentStencilAttachmentReadEXT", .value = 4171, .parameters = &.{} },
515 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &.{} },
516 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &.{} },
517 .{ .name = "DenormPreserve", .value = 4459, .parameters = &.{.literal_integer} },
518 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &.{.literal_integer} },
519 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &.{.literal_integer} },
520 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &.{.literal_integer} },
521 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &.{.literal_integer} },
522 .{ .name = "NonCoherentTileAttachmentReadQCOM", .value = 4489, .parameters = &.{} },
523 .{ .name = "TileShadingRateQCOM", .value = 4490, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
524 .{ .name = "EarlyAndLateFragmentTestsAMD", .value = 5017, .parameters = &.{} },
525 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &.{} },
526 .{ .name = "CoalescingAMDX", .value = 5069, .parameters = &.{} },
527 .{ .name = "IsApiEntryAMDX", .value = 5070, .parameters = &.{.id_ref} },
528 .{ .name = "MaxNodeRecursionAMDX", .value = 5071, .parameters = &.{.id_ref} },
529 .{ .name = "StaticNumWorkgroupsAMDX", .value = 5072, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
530 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{.id_ref} },
531 .{ .name = "MaxNumWorkgroupsAMDX", .value = 5077, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
532 .{ .name = "StencilRefUnchangedFrontAMD", .value = 5079, .parameters = &.{} },
533 .{ .name = "StencilRefGreaterFrontAMD", .value = 5080, .parameters = &.{} },
534 .{ .name = "StencilRefLessFrontAMD", .value = 5081, .parameters = &.{} },
535 .{ .name = "StencilRefUnchangedBackAMD", .value = 5082, .parameters = &.{} },
536 .{ .name = "StencilRefGreaterBackAMD", .value = 5083, .parameters = &.{} },
537 .{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },
538 .{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },
539 .{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },
540 .{ .name = "SharesInputWithAMDX", .value = 5102, .parameters = &.{ .id_ref, .id_ref } },
541 .{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },
542 .{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.literal_integer} },
543 .{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },
544 .{ .name = "DerivativeGroupLinearKHR", .value = 5290, .parameters = &.{} },
545 .{ .name = "OutputTrianglesEXT", .value = 5298, .parameters = &.{} },
546 .{ .name = "PixelInterlockOrderedEXT", .value = 5366, .parameters = &.{} },
547 .{ .name = "PixelInterlockUnorderedEXT", .value = 5367, .parameters = &.{} },
548 .{ .name = "SampleInterlockOrderedEXT", .value = 5368, .parameters = &.{} },
549 .{ .name = "SampleInterlockUnorderedEXT", .value = 5369, .parameters = &.{} },
550 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &.{} },
551 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &.{} },
552 .{ .name = "SharedLocalMemorySizeINTEL", .value = 5618, .parameters = &.{.literal_integer} },
553 .{ .name = "RoundingModeRTPINTEL", .value = 5620, .parameters = &.{.literal_integer} },
554 .{ .name = "RoundingModeRTNINTEL", .value = 5621, .parameters = &.{.literal_integer} },
555 .{ .name = "FloatingPointModeALTINTEL", .value = 5622, .parameters = &.{.literal_integer} },
556 .{ .name = "FloatingPointModeIEEEINTEL", .value = 5623, .parameters = &.{.literal_integer} },
557 .{ .name = "MaxWorkgroupSizeINTEL", .value = 5893, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
558 .{ .name = "MaxWorkDimINTEL", .value = 5894, .parameters = &.{.literal_integer} },
559 .{ .name = "NoGlobalOffsetINTEL", .value = 5895, .parameters = &.{} },
560 .{ .name = "NumSIMDWorkitemsINTEL", .value = 5896, .parameters = &.{.literal_integer} },
561 .{ .name = "SchedulerTargetFmaxMhzINTEL", .value = 5903, .parameters = &.{.literal_integer} },
562 .{ .name = "MaximallyReconvergesKHR", .value = 6023, .parameters = &.{} },
563 .{ .name = "FPFastMathDefault", .value = 6028, .parameters = &.{ .id_ref, .id_ref } },
564 .{ .name = "StreamingInterfaceINTEL", .value = 6154, .parameters = &.{.literal_integer} },
565 .{ .name = "RegisterMapInterfaceINTEL", .value = 6160, .parameters = &.{.literal_integer} },
566 .{ .name = "NamedBarrierCountINTEL", .value = 6417, .parameters = &.{.literal_integer} },
567 .{ .name = "MaximumRegistersINTEL", .value = 6461, .parameters = &.{.literal_integer} },
568 .{ .name = "MaximumRegistersIdINTEL", .value = 6462, .parameters = &.{.id_ref} },
569 .{ .name = "NamedMaximumRegistersINTEL", .value = 6463, .parameters = &.{.named_maximum_number_of_registers} },
570 },
571 .storage_class => &.{
572 .{ .name = "UniformConstant", .value = 0, .parameters = &.{} },
573 .{ .name = "Input", .value = 1, .parameters = &.{} },
574 .{ .name = "Uniform", .value = 2, .parameters = &.{} },
575 .{ .name = "Output", .value = 3, .parameters = &.{} },
576 .{ .name = "Workgroup", .value = 4, .parameters = &.{} },
577 .{ .name = "CrossWorkgroup", .value = 5, .parameters = &.{} },
578 .{ .name = "Private", .value = 6, .parameters = &.{} },
579 .{ .name = "Function", .value = 7, .parameters = &.{} },
580 .{ .name = "Generic", .value = 8, .parameters = &.{} },
581 .{ .name = "PushConstant", .value = 9, .parameters = &.{} },
582 .{ .name = "AtomicCounter", .value = 10, .parameters = &.{} },
583 .{ .name = "Image", .value = 11, .parameters = &.{} },
584 .{ .name = "StorageBuffer", .value = 12, .parameters = &.{} },
585 .{ .name = "TileImageEXT", .value = 4172, .parameters = &.{} },
586 .{ .name = "TileAttachmentQCOM", .value = 4491, .parameters = &.{} },
587 .{ .name = "NodePayloadAMDX", .value = 5068, .parameters = &.{} },
588 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &.{} },
589 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &.{} },
590 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &.{} },
591 .{ .name = "HitAttributeKHR", .value = 5339, .parameters = &.{} },
592 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &.{} },
593 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &.{} },
594 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &.{} },
595 .{ .name = "HitObjectAttributeNV", .value = 5385, .parameters = &.{} },
596 .{ .name = "TaskPayloadWorkgroupEXT", .value = 5402, .parameters = &.{} },
597 .{ .name = "CodeSectionINTEL", .value = 5605, .parameters = &.{} },
598 .{ .name = "DeviceOnlyINTEL", .value = 5936, .parameters = &.{} },
599 .{ .name = "HostOnlyINTEL", .value = 5937, .parameters = &.{} },
600 },
601 .dim => &.{
602 .{ .name = "1D", .value = 0, .parameters = &.{} },
603 .{ .name = "2D", .value = 1, .parameters = &.{} },
604 .{ .name = "3D", .value = 2, .parameters = &.{} },
605 .{ .name = "Cube", .value = 3, .parameters = &.{} },
606 .{ .name = "Rect", .value = 4, .parameters = &.{} },
607 .{ .name = "Buffer", .value = 5, .parameters = &.{} },
608 .{ .name = "SubpassData", .value = 6, .parameters = &.{} },
609 .{ .name = "TileImageDataEXT", .value = 4173, .parameters = &.{} },
610 },
611 .sampler_addressing_mode => &.{
612 .{ .name = "None", .value = 0, .parameters = &.{} },
613 .{ .name = "ClampToEdge", .value = 1, .parameters = &.{} },
614 .{ .name = "Clamp", .value = 2, .parameters = &.{} },
615 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
616 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
617 },
618 .sampler_filter_mode => &.{
619 .{ .name = "Nearest", .value = 0, .parameters = &.{} },
620 .{ .name = "Linear", .value = 1, .parameters = &.{} },
621 },
622 .image_format => &.{
623 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
624 .{ .name = "Rgba32f", .value = 1, .parameters = &.{} },
625 .{ .name = "Rgba16f", .value = 2, .parameters = &.{} },
626 .{ .name = "R32f", .value = 3, .parameters = &.{} },
627 .{ .name = "Rgba8", .value = 4, .parameters = &.{} },
628 .{ .name = "Rgba8Snorm", .value = 5, .parameters = &.{} },
629 .{ .name = "Rg32f", .value = 6, .parameters = &.{} },
630 .{ .name = "Rg16f", .value = 7, .parameters = &.{} },
631 .{ .name = "R11fG11fB10f", .value = 8, .parameters = &.{} },
632 .{ .name = "R16f", .value = 9, .parameters = &.{} },
633 .{ .name = "Rgba16", .value = 10, .parameters = &.{} },
634 .{ .name = "Rgb10A2", .value = 11, .parameters = &.{} },
635 .{ .name = "Rg16", .value = 12, .parameters = &.{} },
636 .{ .name = "Rg8", .value = 13, .parameters = &.{} },
637 .{ .name = "R16", .value = 14, .parameters = &.{} },
638 .{ .name = "R8", .value = 15, .parameters = &.{} },
639 .{ .name = "Rgba16Snorm", .value = 16, .parameters = &.{} },
640 .{ .name = "Rg16Snorm", .value = 17, .parameters = &.{} },
641 .{ .name = "Rg8Snorm", .value = 18, .parameters = &.{} },
642 .{ .name = "R16Snorm", .value = 19, .parameters = &.{} },
643 .{ .name = "R8Snorm", .value = 20, .parameters = &.{} },
644 .{ .name = "Rgba32i", .value = 21, .parameters = &.{} },
645 .{ .name = "Rgba16i", .value = 22, .parameters = &.{} },
646 .{ .name = "Rgba8i", .value = 23, .parameters = &.{} },
647 .{ .name = "R32i", .value = 24, .parameters = &.{} },
648 .{ .name = "Rg32i", .value = 25, .parameters = &.{} },
649 .{ .name = "Rg16i", .value = 26, .parameters = &.{} },
650 .{ .name = "Rg8i", .value = 27, .parameters = &.{} },
651 .{ .name = "R16i", .value = 28, .parameters = &.{} },
652 .{ .name = "R8i", .value = 29, .parameters = &.{} },
653 .{ .name = "Rgba32ui", .value = 30, .parameters = &.{} },
654 .{ .name = "Rgba16ui", .value = 31, .parameters = &.{} },
655 .{ .name = "Rgba8ui", .value = 32, .parameters = &.{} },
656 .{ .name = "R32ui", .value = 33, .parameters = &.{} },
657 .{ .name = "Rgb10a2ui", .value = 34, .parameters = &.{} },
658 .{ .name = "Rg32ui", .value = 35, .parameters = &.{} },
659 .{ .name = "Rg16ui", .value = 36, .parameters = &.{} },
660 .{ .name = "Rg8ui", .value = 37, .parameters = &.{} },
661 .{ .name = "R16ui", .value = 38, .parameters = &.{} },
662 .{ .name = "R8ui", .value = 39, .parameters = &.{} },
663 .{ .name = "R64ui", .value = 40, .parameters = &.{} },
664 .{ .name = "R64i", .value = 41, .parameters = &.{} },
665 },
666 .image_channel_order => &.{
667 .{ .name = "R", .value = 0, .parameters = &.{} },
668 .{ .name = "A", .value = 1, .parameters = &.{} },
669 .{ .name = "RG", .value = 2, .parameters = &.{} },
670 .{ .name = "RA", .value = 3, .parameters = &.{} },
671 .{ .name = "RGB", .value = 4, .parameters = &.{} },
672 .{ .name = "RGBA", .value = 5, .parameters = &.{} },
673 .{ .name = "BGRA", .value = 6, .parameters = &.{} },
674 .{ .name = "ARGB", .value = 7, .parameters = &.{} },
675 .{ .name = "Intensity", .value = 8, .parameters = &.{} },
676 .{ .name = "Luminance", .value = 9, .parameters = &.{} },
677 .{ .name = "Rx", .value = 10, .parameters = &.{} },
678 .{ .name = "RGx", .value = 11, .parameters = &.{} },
679 .{ .name = "RGBx", .value = 12, .parameters = &.{} },
680 .{ .name = "Depth", .value = 13, .parameters = &.{} },
681 .{ .name = "DepthStencil", .value = 14, .parameters = &.{} },
682 .{ .name = "sRGB", .value = 15, .parameters = &.{} },
683 .{ .name = "sRGBx", .value = 16, .parameters = &.{} },
684 .{ .name = "sRGBA", .value = 17, .parameters = &.{} },
685 .{ .name = "sBGRA", .value = 18, .parameters = &.{} },
686 .{ .name = "ABGR", .value = 19, .parameters = &.{} },
687 },
688 .image_channel_data_type => &.{
689 .{ .name = "SnormInt8", .value = 0, .parameters = &.{} },
690 .{ .name = "SnormInt16", .value = 1, .parameters = &.{} },
691 .{ .name = "UnormInt8", .value = 2, .parameters = &.{} },
692 .{ .name = "UnormInt16", .value = 3, .parameters = &.{} },
693 .{ .name = "UnormShort565", .value = 4, .parameters = &.{} },
694 .{ .name = "UnormShort555", .value = 5, .parameters = &.{} },
695 .{ .name = "UnormInt101010", .value = 6, .parameters = &.{} },
696 .{ .name = "SignedInt8", .value = 7, .parameters = &.{} },
697 .{ .name = "SignedInt16", .value = 8, .parameters = &.{} },
698 .{ .name = "SignedInt32", .value = 9, .parameters = &.{} },
699 .{ .name = "UnsignedInt8", .value = 10, .parameters = &.{} },
700 .{ .name = "UnsignedInt16", .value = 11, .parameters = &.{} },
701 .{ .name = "UnsignedInt32", .value = 12, .parameters = &.{} },
702 .{ .name = "HalfFloat", .value = 13, .parameters = &.{} },
703 .{ .name = "Float", .value = 14, .parameters = &.{} },
704 .{ .name = "UnormInt24", .value = 15, .parameters = &.{} },
705 .{ .name = "UnormInt101010_2", .value = 16, .parameters = &.{} },
706 .{ .name = "UnormInt10X6EXT", .value = 17, .parameters = &.{} },
707 .{ .name = "UnsignedIntRaw10EXT", .value = 19, .parameters = &.{} },
708 .{ .name = "UnsignedIntRaw12EXT", .value = 20, .parameters = &.{} },
709 .{ .name = "UnormInt2_101010EXT", .value = 21, .parameters = &.{} },
710 .{ .name = "UnsignedInt10X6EXT", .value = 22, .parameters = &.{} },
711 .{ .name = "UnsignedInt12X4EXT", .value = 23, .parameters = &.{} },
712 .{ .name = "UnsignedInt14X2EXT", .value = 24, .parameters = &.{} },
713 .{ .name = "UnormInt12X4EXT", .value = 25, .parameters = &.{} },
714 .{ .name = "UnormInt14X2EXT", .value = 26, .parameters = &.{} },
715 },
716 .fp_rounding_mode => &.{
717 .{ .name = "RTE", .value = 0, .parameters = &.{} },
718 .{ .name = "RTZ", .value = 1, .parameters = &.{} },
719 .{ .name = "RTP", .value = 2, .parameters = &.{} },
720 .{ .name = "RTN", .value = 3, .parameters = &.{} },
721 },
722 .fp_denorm_mode => &.{
723 .{ .name = "Preserve", .value = 0, .parameters = &.{} },
724 .{ .name = "FlushToZero", .value = 1, .parameters = &.{} },
725 },
726 .quantization_modes => &.{
727 .{ .name = "TRN", .value = 0, .parameters = &.{} },
728 .{ .name = "TRN_ZERO", .value = 1, .parameters = &.{} },
729 .{ .name = "RND", .value = 2, .parameters = &.{} },
730 .{ .name = "RND_ZERO", .value = 3, .parameters = &.{} },
731 .{ .name = "RND_INF", .value = 4, .parameters = &.{} },
732 .{ .name = "RND_MIN_INF", .value = 5, .parameters = &.{} },
733 .{ .name = "RND_CONV", .value = 6, .parameters = &.{} },
734 .{ .name = "RND_CONV_ODD", .value = 7, .parameters = &.{} },
735 },
736 .fp_operation_mode => &.{
737 .{ .name = "IEEE", .value = 0, .parameters = &.{} },
738 .{ .name = "ALT", .value = 1, .parameters = &.{} },
739 },
740 .overflow_modes => &.{
741 .{ .name = "WRAP", .value = 0, .parameters = &.{} },
742 .{ .name = "SAT", .value = 1, .parameters = &.{} },
743 .{ .name = "SAT_ZERO", .value = 2, .parameters = &.{} },
744 .{ .name = "SAT_SYM", .value = 3, .parameters = &.{} },
745 },
746 .linkage_type => &.{
747 .{ .name = "Export", .value = 0, .parameters = &.{} },
748 .{ .name = "Import", .value = 1, .parameters = &.{} },
749 .{ .name = "LinkOnceODR", .value = 2, .parameters = &.{} },
750 },
751 .access_qualifier => &.{
752 .{ .name = "ReadOnly", .value = 0, .parameters = &.{} },
753 .{ .name = "WriteOnly", .value = 1, .parameters = &.{} },
754 .{ .name = "ReadWrite", .value = 2, .parameters = &.{} },
755 },
756 .host_access_qualifier => &.{
757 .{ .name = "NoneINTEL", .value = 0, .parameters = &.{} },
758 .{ .name = "ReadINTEL", .value = 1, .parameters = &.{} },
759 .{ .name = "WriteINTEL", .value = 2, .parameters = &.{} },
760 .{ .name = "ReadWriteINTEL", .value = 3, .parameters = &.{} },
761 },
762 .function_parameter_attribute => &.{
763 .{ .name = "Zext", .value = 0, .parameters = &.{} },
764 .{ .name = "Sext", .value = 1, .parameters = &.{} },
765 .{ .name = "ByVal", .value = 2, .parameters = &.{} },
766 .{ .name = "Sret", .value = 3, .parameters = &.{} },
767 .{ .name = "NoAlias", .value = 4, .parameters = &.{} },
768 .{ .name = "NoCapture", .value = 5, .parameters = &.{} },
769 .{ .name = "NoWrite", .value = 6, .parameters = &.{} },
770 .{ .name = "NoReadWrite", .value = 7, .parameters = &.{} },
771 .{ .name = "RuntimeAlignedINTEL", .value = 5940, .parameters = &.{} },
772 },
773 .decoration => &.{
774 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &.{} },
775 .{ .name = "SpecId", .value = 1, .parameters = &.{.literal_integer} },
776 .{ .name = "Block", .value = 2, .parameters = &.{} },
777 .{ .name = "BufferBlock", .value = 3, .parameters = &.{} },
778 .{ .name = "RowMajor", .value = 4, .parameters = &.{} },
779 .{ .name = "ColMajor", .value = 5, .parameters = &.{} },
780 .{ .name = "ArrayStride", .value = 6, .parameters = &.{.literal_integer} },
781 .{ .name = "MatrixStride", .value = 7, .parameters = &.{.literal_integer} },
782 .{ .name = "GLSLShared", .value = 8, .parameters = &.{} },
783 .{ .name = "GLSLPacked", .value = 9, .parameters = &.{} },
784 .{ .name = "CPacked", .value = 10, .parameters = &.{} },
785 .{ .name = "BuiltIn", .value = 11, .parameters = &.{.built_in} },
786 .{ .name = "NoPerspective", .value = 13, .parameters = &.{} },
787 .{ .name = "Flat", .value = 14, .parameters = &.{} },
788 .{ .name = "Patch", .value = 15, .parameters = &.{} },
789 .{ .name = "Centroid", .value = 16, .parameters = &.{} },
790 .{ .name = "Sample", .value = 17, .parameters = &.{} },
791 .{ .name = "Invariant", .value = 18, .parameters = &.{} },
792 .{ .name = "Restrict", .value = 19, .parameters = &.{} },
793 .{ .name = "Aliased", .value = 20, .parameters = &.{} },
794 .{ .name = "Volatile", .value = 21, .parameters = &.{} },
795 .{ .name = "Constant", .value = 22, .parameters = &.{} },
796 .{ .name = "Coherent", .value = 23, .parameters = &.{} },
797 .{ .name = "NonWritable", .value = 24, .parameters = &.{} },
798 .{ .name = "NonReadable", .value = 25, .parameters = &.{} },
799 .{ .name = "Uniform", .value = 26, .parameters = &.{} },
800 .{ .name = "UniformId", .value = 27, .parameters = &.{.id_scope} },
801 .{ .name = "SaturatedConversion", .value = 28, .parameters = &.{} },
802 .{ .name = "Stream", .value = 29, .parameters = &.{.literal_integer} },
803 .{ .name = "Location", .value = 30, .parameters = &.{.literal_integer} },
804 .{ .name = "Component", .value = 31, .parameters = &.{.literal_integer} },
805 .{ .name = "Index", .value = 32, .parameters = &.{.literal_integer} },
806 .{ .name = "Binding", .value = 33, .parameters = &.{.literal_integer} },
807 .{ .name = "DescriptorSet", .value = 34, .parameters = &.{.literal_integer} },
808 .{ .name = "Offset", .value = 35, .parameters = &.{.literal_integer} },
809 .{ .name = "XfbBuffer", .value = 36, .parameters = &.{.literal_integer} },
810 .{ .name = "XfbStride", .value = 37, .parameters = &.{.literal_integer} },
811 .{ .name = "FuncParamAttr", .value = 38, .parameters = &.{.function_parameter_attribute} },
812 .{ .name = "FPRoundingMode", .value = 39, .parameters = &.{.fp_rounding_mode} },
813 .{ .name = "FPFastMathMode", .value = 40, .parameters = &.{.fp_fast_math_mode} },
814 .{ .name = "LinkageAttributes", .value = 41, .parameters = &.{ .literal_string, .linkage_type } },
815 .{ .name = "NoContraction", .value = 42, .parameters = &.{} },
816 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &.{.literal_integer} },
817 .{ .name = "Alignment", .value = 44, .parameters = &.{.literal_integer} },
818 .{ .name = "MaxByteOffset", .value = 45, .parameters = &.{.literal_integer} },
819 .{ .name = "AlignmentId", .value = 46, .parameters = &.{.id_ref} },
820 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &.{.id_ref} },
821 .{ .name = "SaturatedToLargestFloat8NormalConversionEXT", .value = 4216, .parameters = &.{} },
822 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &.{} },
823 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &.{} },
824 .{ .name = "WeightTextureQCOM", .value = 4487, .parameters = &.{} },
825 .{ .name = "BlockMatchTextureQCOM", .value = 4488, .parameters = &.{} },
826 .{ .name = "BlockMatchSamplerQCOM", .value = 4499, .parameters = &.{} },
827 .{ .name = "ExplicitInterpAMD", .value = 4999, .parameters = &.{} },
828 .{ .name = "NodeSharesPayloadLimitsWithAMDX", .value = 5019, .parameters = &.{.id_ref} },
829 .{ .name = "NodeMaxPayloadsAMDX", .value = 5020, .parameters = &.{.id_ref} },
830 .{ .name = "TrackFinishWritingAMDX", .value = 5078, .parameters = &.{} },
831 .{ .name = "PayloadNodeNameAMDX", .value = 5091, .parameters = &.{.id_ref} },
832 .{ .name = "PayloadNodeBaseIndexAMDX", .value = 5098, .parameters = &.{.id_ref} },
833 .{ .name = "PayloadNodeSparseArrayAMDX", .value = 5099, .parameters = &.{} },
834 .{ .name = "PayloadNodeArraySizeAMDX", .value = 5100, .parameters = &.{.id_ref} },
835 .{ .name = "PayloadDispatchIndirectAMDX", .value = 5105, .parameters = &.{} },
836 .{ .name = "OverrideCoverageNV", .value = 5248, .parameters = &.{} },
837 .{ .name = "PassthroughNV", .value = 5250, .parameters = &.{} },
838 .{ .name = "ViewportRelativeNV", .value = 5252, .parameters = &.{} },
839 .{ .name = "SecondaryViewportRelativeNV", .value = 5256, .parameters = &.{.literal_integer} },
840 .{ .name = "PerPrimitiveEXT", .value = 5271, .parameters = &.{} },
841 .{ .name = "PerViewNV", .value = 5272, .parameters = &.{} },
842 .{ .name = "PerTaskNV", .value = 5273, .parameters = &.{} },
843 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &.{} },
844 .{ .name = "NonUniform", .value = 5300, .parameters = &.{} },
845 .{ .name = "RestrictPointer", .value = 5355, .parameters = &.{} },
846 .{ .name = "AliasedPointer", .value = 5356, .parameters = &.{} },
847 .{ .name = "HitObjectShaderRecordBufferNV", .value = 5386, .parameters = &.{} },
848 .{ .name = "BindlessSamplerNV", .value = 5398, .parameters = &.{} },
849 .{ .name = "BindlessImageNV", .value = 5399, .parameters = &.{} },
850 .{ .name = "BoundSamplerNV", .value = 5400, .parameters = &.{} },
851 .{ .name = "BoundImageNV", .value = 5401, .parameters = &.{} },
852 .{ .name = "SIMTCallINTEL", .value = 5599, .parameters = &.{.literal_integer} },
853 .{ .name = "ReferencedIndirectlyINTEL", .value = 5602, .parameters = &.{} },
854 .{ .name = "ClobberINTEL", .value = 5607, .parameters = &.{.literal_string} },
855 .{ .name = "SideEffectsINTEL", .value = 5608, .parameters = &.{} },
856 .{ .name = "VectorComputeVariableINTEL", .value = 5624, .parameters = &.{} },
857 .{ .name = "FuncParamIOKindINTEL", .value = 5625, .parameters = &.{.literal_integer} },
858 .{ .name = "VectorComputeFunctionINTEL", .value = 5626, .parameters = &.{} },
859 .{ .name = "StackCallINTEL", .value = 5627, .parameters = &.{} },
860 .{ .name = "GlobalVariableOffsetINTEL", .value = 5628, .parameters = &.{.literal_integer} },
861 .{ .name = "CounterBuffer", .value = 5634, .parameters = &.{.id_ref} },
862 .{ .name = "UserSemantic", .value = 5635, .parameters = &.{.literal_string} },
863 .{ .name = "UserTypeGOOGLE", .value = 5636, .parameters = &.{.literal_string} },
864 .{ .name = "FunctionRoundingModeINTEL", .value = 5822, .parameters = &.{ .literal_integer, .fp_rounding_mode } },
865 .{ .name = "FunctionDenormModeINTEL", .value = 5823, .parameters = &.{ .literal_integer, .fp_denorm_mode } },
866 .{ .name = "RegisterINTEL", .value = 5825, .parameters = &.{} },
867 .{ .name = "MemoryINTEL", .value = 5826, .parameters = &.{.literal_string} },
868 .{ .name = "NumbanksINTEL", .value = 5827, .parameters = &.{.literal_integer} },
869 .{ .name = "BankwidthINTEL", .value = 5828, .parameters = &.{.literal_integer} },
870 .{ .name = "MaxPrivateCopiesINTEL", .value = 5829, .parameters = &.{.literal_integer} },
871 .{ .name = "SinglepumpINTEL", .value = 5830, .parameters = &.{} },
872 .{ .name = "DoublepumpINTEL", .value = 5831, .parameters = &.{} },
873 .{ .name = "MaxReplicatesINTEL", .value = 5832, .parameters = &.{.literal_integer} },
874 .{ .name = "SimpleDualPortINTEL", .value = 5833, .parameters = &.{} },
875 .{ .name = "MergeINTEL", .value = 5834, .parameters = &.{ .literal_string, .literal_string } },
876 .{ .name = "BankBitsINTEL", .value = 5835, .parameters = &.{.literal_integer} },
877 .{ .name = "ForcePow2DepthINTEL", .value = 5836, .parameters = &.{.literal_integer} },
878 .{ .name = "StridesizeINTEL", .value = 5883, .parameters = &.{.literal_integer} },
879 .{ .name = "WordsizeINTEL", .value = 5884, .parameters = &.{.literal_integer} },
880 .{ .name = "TrueDualPortINTEL", .value = 5885, .parameters = &.{} },
881 .{ .name = "BurstCoalesceINTEL", .value = 5899, .parameters = &.{} },
882 .{ .name = "CacheSizeINTEL", .value = 5900, .parameters = &.{.literal_integer} },
883 .{ .name = "DontStaticallyCoalesceINTEL", .value = 5901, .parameters = &.{} },
884 .{ .name = "PrefetchINTEL", .value = 5902, .parameters = &.{.literal_integer} },
885 .{ .name = "StallEnableINTEL", .value = 5905, .parameters = &.{} },
886 .{ .name = "FuseLoopsInFunctionINTEL", .value = 5907, .parameters = &.{} },
887 .{ .name = "MathOpDSPModeINTEL", .value = 5909, .parameters = &.{ .literal_integer, .literal_integer } },
888 .{ .name = "AliasScopeINTEL", .value = 5914, .parameters = &.{.id_ref} },
889 .{ .name = "NoAliasINTEL", .value = 5915, .parameters = &.{.id_ref} },
890 .{ .name = "InitiationIntervalINTEL", .value = 5917, .parameters = &.{.literal_integer} },
891 .{ .name = "MaxConcurrencyINTEL", .value = 5918, .parameters = &.{.literal_integer} },
892 .{ .name = "PipelineEnableINTEL", .value = 5919, .parameters = &.{.literal_integer} },
893 .{ .name = "BufferLocationINTEL", .value = 5921, .parameters = &.{.literal_integer} },
894 .{ .name = "IOPipeStorageINTEL", .value = 5944, .parameters = &.{.literal_integer} },
895 .{ .name = "FunctionFloatingPointModeINTEL", .value = 6080, .parameters = &.{ .literal_integer, .fp_operation_mode } },
896 .{ .name = "SingleElementVectorINTEL", .value = 6085, .parameters = &.{} },
897 .{ .name = "VectorComputeCallableFunctionINTEL", .value = 6087, .parameters = &.{} },
898 .{ .name = "MediaBlockIOINTEL", .value = 6140, .parameters = &.{} },
899 .{ .name = "StallFreeINTEL", .value = 6151, .parameters = &.{} },
900 .{ .name = "FPMaxErrorDecorationINTEL", .value = 6170, .parameters = &.{.literal_float} },
901 .{ .name = "LatencyControlLabelINTEL", .value = 6172, .parameters = &.{.literal_integer} },
902 .{ .name = "LatencyControlConstraintINTEL", .value = 6173, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
903 .{ .name = "ConduitKernelArgumentINTEL", .value = 6175, .parameters = &.{} },
904 .{ .name = "RegisterMapKernelArgumentINTEL", .value = 6176, .parameters = &.{} },
905 .{ .name = "MMHostInterfaceAddressWidthINTEL", .value = 6177, .parameters = &.{.literal_integer} },
906 .{ .name = "MMHostInterfaceDataWidthINTEL", .value = 6178, .parameters = &.{.literal_integer} },
907 .{ .name = "MMHostInterfaceLatencyINTEL", .value = 6179, .parameters = &.{.literal_integer} },
908 .{ .name = "MMHostInterfaceReadWriteModeINTEL", .value = 6180, .parameters = &.{.access_qualifier} },
909 .{ .name = "MMHostInterfaceMaxBurstINTEL", .value = 6181, .parameters = &.{.literal_integer} },
910 .{ .name = "MMHostInterfaceWaitRequestINTEL", .value = 6182, .parameters = &.{.literal_integer} },
911 .{ .name = "StableKernelArgumentINTEL", .value = 6183, .parameters = &.{} },
912 .{ .name = "HostAccessINTEL", .value = 6188, .parameters = &.{ .host_access_qualifier, .literal_string } },
913 .{ .name = "InitModeINTEL", .value = 6190, .parameters = &.{.initialization_mode_qualifier} },
914 .{ .name = "ImplementInRegisterMapINTEL", .value = 6191, .parameters = &.{.literal_integer} },
915 .{ .name = "CacheControlLoadINTEL", .value = 6442, .parameters = &.{ .literal_integer, .load_cache_control } },
916 .{ .name = "CacheControlStoreINTEL", .value = 6443, .parameters = &.{ .literal_integer, .store_cache_control } },
917 },
918 .built_in => &.{
919 .{ .name = "Position", .value = 0, .parameters = &.{} },
920 .{ .name = "PointSize", .value = 1, .parameters = &.{} },
921 .{ .name = "ClipDistance", .value = 3, .parameters = &.{} },
922 .{ .name = "CullDistance", .value = 4, .parameters = &.{} },
923 .{ .name = "VertexId", .value = 5, .parameters = &.{} },
924 .{ .name = "InstanceId", .value = 6, .parameters = &.{} },
925 .{ .name = "PrimitiveId", .value = 7, .parameters = &.{} },
926 .{ .name = "InvocationId", .value = 8, .parameters = &.{} },
927 .{ .name = "Layer", .value = 9, .parameters = &.{} },
928 .{ .name = "ViewportIndex", .value = 10, .parameters = &.{} },
929 .{ .name = "TessLevelOuter", .value = 11, .parameters = &.{} },
930 .{ .name = "TessLevelInner", .value = 12, .parameters = &.{} },
931 .{ .name = "TessCoord", .value = 13, .parameters = &.{} },
932 .{ .name = "PatchVertices", .value = 14, .parameters = &.{} },
933 .{ .name = "FragCoord", .value = 15, .parameters = &.{} },
934 .{ .name = "PointCoord", .value = 16, .parameters = &.{} },
935 .{ .name = "FrontFacing", .value = 17, .parameters = &.{} },
936 .{ .name = "SampleId", .value = 18, .parameters = &.{} },
937 .{ .name = "SamplePosition", .value = 19, .parameters = &.{} },
938 .{ .name = "SampleMask", .value = 20, .parameters = &.{} },
939 .{ .name = "FragDepth", .value = 22, .parameters = &.{} },
940 .{ .name = "HelperInvocation", .value = 23, .parameters = &.{} },
941 .{ .name = "NumWorkgroups", .value = 24, .parameters = &.{} },
942 .{ .name = "WorkgroupSize", .value = 25, .parameters = &.{} },
943 .{ .name = "WorkgroupId", .value = 26, .parameters = &.{} },
944 .{ .name = "LocalInvocationId", .value = 27, .parameters = &.{} },
945 .{ .name = "GlobalInvocationId", .value = 28, .parameters = &.{} },
946 .{ .name = "LocalInvocationIndex", .value = 29, .parameters = &.{} },
947 .{ .name = "WorkDim", .value = 30, .parameters = &.{} },
948 .{ .name = "GlobalSize", .value = 31, .parameters = &.{} },
949 .{ .name = "EnqueuedWorkgroupSize", .value = 32, .parameters = &.{} },
950 .{ .name = "GlobalOffset", .value = 33, .parameters = &.{} },
951 .{ .name = "GlobalLinearId", .value = 34, .parameters = &.{} },
952 .{ .name = "SubgroupSize", .value = 36, .parameters = &.{} },
953 .{ .name = "SubgroupMaxSize", .value = 37, .parameters = &.{} },
954 .{ .name = "NumSubgroups", .value = 38, .parameters = &.{} },
955 .{ .name = "NumEnqueuedSubgroups", .value = 39, .parameters = &.{} },
956 .{ .name = "SubgroupId", .value = 40, .parameters = &.{} },
957 .{ .name = "SubgroupLocalInvocationId", .value = 41, .parameters = &.{} },
958 .{ .name = "VertexIndex", .value = 42, .parameters = &.{} },
959 .{ .name = "InstanceIndex", .value = 43, .parameters = &.{} },
960 .{ .name = "CoreIDARM", .value = 4160, .parameters = &.{} },
961 .{ .name = "CoreCountARM", .value = 4161, .parameters = &.{} },
962 .{ .name = "CoreMaxIDARM", .value = 4162, .parameters = &.{} },
963 .{ .name = "WarpIDARM", .value = 4163, .parameters = &.{} },
964 .{ .name = "WarpMaxIDARM", .value = 4164, .parameters = &.{} },
965 .{ .name = "SubgroupEqMask", .value = 4416, .parameters = &.{} },
966 .{ .name = "SubgroupGeMask", .value = 4417, .parameters = &.{} },
967 .{ .name = "SubgroupGtMask", .value = 4418, .parameters = &.{} },
968 .{ .name = "SubgroupLeMask", .value = 4419, .parameters = &.{} },
969 .{ .name = "SubgroupLtMask", .value = 4420, .parameters = &.{} },
970 .{ .name = "BaseVertex", .value = 4424, .parameters = &.{} },
971 .{ .name = "BaseInstance", .value = 4425, .parameters = &.{} },
972 .{ .name = "DrawIndex", .value = 4426, .parameters = &.{} },
973 .{ .name = "PrimitiveShadingRateKHR", .value = 4432, .parameters = &.{} },
974 .{ .name = "DeviceIndex", .value = 4438, .parameters = &.{} },
975 .{ .name = "ViewIndex", .value = 4440, .parameters = &.{} },
976 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &.{} },
977 .{ .name = "TileOffsetQCOM", .value = 4492, .parameters = &.{} },
978 .{ .name = "TileDimensionQCOM", .value = 4493, .parameters = &.{} },
979 .{ .name = "TileApronSizeQCOM", .value = 4494, .parameters = &.{} },
980 .{ .name = "BaryCoordNoPerspAMD", .value = 4992, .parameters = &.{} },
981 .{ .name = "BaryCoordNoPerspCentroidAMD", .value = 4993, .parameters = &.{} },
982 .{ .name = "BaryCoordNoPerspSampleAMD", .value = 4994, .parameters = &.{} },
983 .{ .name = "BaryCoordSmoothAMD", .value = 4995, .parameters = &.{} },
984 .{ .name = "BaryCoordSmoothCentroidAMD", .value = 4996, .parameters = &.{} },
985 .{ .name = "BaryCoordSmoothSampleAMD", .value = 4997, .parameters = &.{} },
986 .{ .name = "BaryCoordPullModelAMD", .value = 4998, .parameters = &.{} },
987 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &.{} },
988 .{ .name = "RemainingRecursionLevelsAMDX", .value = 5021, .parameters = &.{} },
989 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{} },
990 .{ .name = "ViewportMaskNV", .value = 5253, .parameters = &.{} },
991 .{ .name = "SecondaryPositionNV", .value = 5257, .parameters = &.{} },
992 .{ .name = "SecondaryViewportMaskNV", .value = 5258, .parameters = &.{} },
993 .{ .name = "PositionPerViewNV", .value = 5261, .parameters = &.{} },
994 .{ .name = "ViewportMaskPerViewNV", .value = 5262, .parameters = &.{} },
995 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &.{} },
996 .{ .name = "TaskCountNV", .value = 5274, .parameters = &.{} },
997 .{ .name = "PrimitiveCountNV", .value = 5275, .parameters = &.{} },
998 .{ .name = "PrimitiveIndicesNV", .value = 5276, .parameters = &.{} },
999 .{ .name = "ClipDistancePerViewNV", .value = 5277, .parameters = &.{} },
1000 .{ .name = "CullDistancePerViewNV", .value = 5278, .parameters = &.{} },
1001 .{ .name = "LayerPerViewNV", .value = 5279, .parameters = &.{} },
1002 .{ .name = "MeshViewCountNV", .value = 5280, .parameters = &.{} },
1003 .{ .name = "MeshViewIndicesNV", .value = 5281, .parameters = &.{} },
1004 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &.{} },
1005 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &.{} },
1006 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &.{} },
1007 .{ .name = "FragInvocationCountEXT", .value = 5293, .parameters = &.{} },
1008 .{ .name = "PrimitivePointIndicesEXT", .value = 5294, .parameters = &.{} },
1009 .{ .name = "PrimitiveLineIndicesEXT", .value = 5295, .parameters = &.{} },
1010 .{ .name = "PrimitiveTriangleIndicesEXT", .value = 5296, .parameters = &.{} },
1011 .{ .name = "CullPrimitiveEXT", .value = 5299, .parameters = &.{} },
1012 .{ .name = "LaunchIdKHR", .value = 5319, .parameters = &.{} },
1013 .{ .name = "LaunchSizeKHR", .value = 5320, .parameters = &.{} },
1014 .{ .name = "WorldRayOriginKHR", .value = 5321, .parameters = &.{} },
1015 .{ .name = "WorldRayDirectionKHR", .value = 5322, .parameters = &.{} },
1016 .{ .name = "ObjectRayOriginKHR", .value = 5323, .parameters = &.{} },
1017 .{ .name = "ObjectRayDirectionKHR", .value = 5324, .parameters = &.{} },
1018 .{ .name = "RayTminKHR", .value = 5325, .parameters = &.{} },
1019 .{ .name = "RayTmaxKHR", .value = 5326, .parameters = &.{} },
1020 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &.{} },
1021 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &.{} },
1022 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &.{} },
1023 .{ .name = "HitTNV", .value = 5332, .parameters = &.{} },
1024 .{ .name = "HitKindKHR", .value = 5333, .parameters = &.{} },
1025 .{ .name = "CurrentRayTimeNV", .value = 5334, .parameters = &.{} },
1026 .{ .name = "HitTriangleVertexPositionsKHR", .value = 5335, .parameters = &.{} },
1027 .{ .name = "HitMicroTriangleVertexPositionsNV", .value = 5337, .parameters = &.{} },
1028 .{ .name = "HitMicroTriangleVertexBarycentricsNV", .value = 5344, .parameters = &.{} },
1029 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &.{} },
1030 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &.{} },
1031 .{ .name = "HitIsSphereNV", .value = 5359, .parameters = &.{} },
1032 .{ .name = "HitIsLSSNV", .value = 5360, .parameters = &.{} },
1033 .{ .name = "HitSpherePositionNV", .value = 5361, .parameters = &.{} },
1034 .{ .name = "WarpsPerSMNV", .value = 5374, .parameters = &.{} },
1035 .{ .name = "SMCountNV", .value = 5375, .parameters = &.{} },
1036 .{ .name = "WarpIDNV", .value = 5376, .parameters = &.{} },
1037 .{ .name = "SMIDNV", .value = 5377, .parameters = &.{} },
1038 .{ .name = "HitLSSPositionsNV", .value = 5396, .parameters = &.{} },
1039 .{ .name = "HitKindFrontFacingMicroTriangleNV", .value = 5405, .parameters = &.{} },
1040 .{ .name = "HitKindBackFacingMicroTriangleNV", .value = 5406, .parameters = &.{} },
1041 .{ .name = "HitSphereRadiusNV", .value = 5420, .parameters = &.{} },
1042 .{ .name = "HitLSSRadiiNV", .value = 5421, .parameters = &.{} },
1043 .{ .name = "ClusterIDNV", .value = 5436, .parameters = &.{} },
1044 .{ .name = "CullMaskKHR", .value = 6021, .parameters = &.{} },
1045 },
1046 .scope => &.{
1047 .{ .name = "CrossDevice", .value = 0, .parameters = &.{} },
1048 .{ .name = "Device", .value = 1, .parameters = &.{} },
1049 .{ .name = "Workgroup", .value = 2, .parameters = &.{} },
1050 .{ .name = "Subgroup", .value = 3, .parameters = &.{} },
1051 .{ .name = "Invocation", .value = 4, .parameters = &.{} },
1052 .{ .name = "QueueFamily", .value = 5, .parameters = &.{} },
1053 .{ .name = "ShaderCallKHR", .value = 6, .parameters = &.{} },
1054 },
1055 .group_operation => &.{
1056 .{ .name = "Reduce", .value = 0, .parameters = &.{} },
1057 .{ .name = "InclusiveScan", .value = 1, .parameters = &.{} },
1058 .{ .name = "ExclusiveScan", .value = 2, .parameters = &.{} },
1059 .{ .name = "ClusteredReduce", .value = 3, .parameters = &.{} },
1060 .{ .name = "PartitionedReduceNV", .value = 6, .parameters = &.{} },
1061 .{ .name = "PartitionedInclusiveScanNV", .value = 7, .parameters = &.{} },
1062 .{ .name = "PartitionedExclusiveScanNV", .value = 8, .parameters = &.{} },
1063 },
1064 .kernel_enqueue_flags => &.{
1065 .{ .name = "NoWait", .value = 0, .parameters = &.{} },
1066 .{ .name = "WaitKernel", .value = 1, .parameters = &.{} },
1067 .{ .name = "WaitWorkGroup", .value = 2, .parameters = &.{} },
1068 },
1069 .capability => &.{
1070 .{ .name = "Matrix", .value = 0, .parameters = &.{} },
1071 .{ .name = "Shader", .value = 1, .parameters = &.{} },
1072 .{ .name = "Geometry", .value = 2, .parameters = &.{} },
1073 .{ .name = "Tessellation", .value = 3, .parameters = &.{} },
1074 .{ .name = "Addresses", .value = 4, .parameters = &.{} },
1075 .{ .name = "Linkage", .value = 5, .parameters = &.{} },
1076 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
1077 .{ .name = "Vector16", .value = 7, .parameters = &.{} },
1078 .{ .name = "Float16Buffer", .value = 8, .parameters = &.{} },
1079 .{ .name = "Float16", .value = 9, .parameters = &.{} },
1080 .{ .name = "Float64", .value = 10, .parameters = &.{} },
1081 .{ .name = "Int64", .value = 11, .parameters = &.{} },
1082 .{ .name = "Int64Atomics", .value = 12, .parameters = &.{} },
1083 .{ .name = "ImageBasic", .value = 13, .parameters = &.{} },
1084 .{ .name = "ImageReadWrite", .value = 14, .parameters = &.{} },
1085 .{ .name = "ImageMipmap", .value = 15, .parameters = &.{} },
1086 .{ .name = "Pipes", .value = 17, .parameters = &.{} },
1087 .{ .name = "Groups", .value = 18, .parameters = &.{} },
1088 .{ .name = "DeviceEnqueue", .value = 19, .parameters = &.{} },
1089 .{ .name = "LiteralSampler", .value = 20, .parameters = &.{} },
1090 .{ .name = "AtomicStorage", .value = 21, .parameters = &.{} },
1091 .{ .name = "Int16", .value = 22, .parameters = &.{} },
1092 .{ .name = "TessellationPointSize", .value = 23, .parameters = &.{} },
1093 .{ .name = "GeometryPointSize", .value = 24, .parameters = &.{} },
1094 .{ .name = "ImageGatherExtended", .value = 25, .parameters = &.{} },
1095 .{ .name = "StorageImageMultisample", .value = 27, .parameters = &.{} },
1096 .{ .name = "UniformBufferArrayDynamicIndexing", .value = 28, .parameters = &.{} },
1097 .{ .name = "SampledImageArrayDynamicIndexing", .value = 29, .parameters = &.{} },
1098 .{ .name = "StorageBufferArrayDynamicIndexing", .value = 30, .parameters = &.{} },
1099 .{ .name = "StorageImageArrayDynamicIndexing", .value = 31, .parameters = &.{} },
1100 .{ .name = "ClipDistance", .value = 32, .parameters = &.{} },
1101 .{ .name = "CullDistance", .value = 33, .parameters = &.{} },
1102 .{ .name = "ImageCubeArray", .value = 34, .parameters = &.{} },
1103 .{ .name = "SampleRateShading", .value = 35, .parameters = &.{} },
1104 .{ .name = "ImageRect", .value = 36, .parameters = &.{} },
1105 .{ .name = "SampledRect", .value = 37, .parameters = &.{} },
1106 .{ .name = "GenericPointer", .value = 38, .parameters = &.{} },
1107 .{ .name = "Int8", .value = 39, .parameters = &.{} },
1108 .{ .name = "InputAttachment", .value = 40, .parameters = &.{} },
1109 .{ .name = "SparseResidency", .value = 41, .parameters = &.{} },
1110 .{ .name = "MinLod", .value = 42, .parameters = &.{} },
1111 .{ .name = "Sampled1D", .value = 43, .parameters = &.{} },
1112 .{ .name = "Image1D", .value = 44, .parameters = &.{} },
1113 .{ .name = "SampledCubeArray", .value = 45, .parameters = &.{} },
1114 .{ .name = "SampledBuffer", .value = 46, .parameters = &.{} },
1115 .{ .name = "ImageBuffer", .value = 47, .parameters = &.{} },
1116 .{ .name = "ImageMSArray", .value = 48, .parameters = &.{} },
1117 .{ .name = "StorageImageExtendedFormats", .value = 49, .parameters = &.{} },
1118 .{ .name = "ImageQuery", .value = 50, .parameters = &.{} },
1119 .{ .name = "DerivativeControl", .value = 51, .parameters = &.{} },
1120 .{ .name = "InterpolationFunction", .value = 52, .parameters = &.{} },
1121 .{ .name = "TransformFeedback", .value = 53, .parameters = &.{} },
1122 .{ .name = "GeometryStreams", .value = 54, .parameters = &.{} },
1123 .{ .name = "StorageImageReadWithoutFormat", .value = 55, .parameters = &.{} },
1124 .{ .name = "StorageImageWriteWithoutFormat", .value = 56, .parameters = &.{} },
1125 .{ .name = "MultiViewport", .value = 57, .parameters = &.{} },
1126 .{ .name = "SubgroupDispatch", .value = 58, .parameters = &.{} },
1127 .{ .name = "NamedBarrier", .value = 59, .parameters = &.{} },
1128 .{ .name = "PipeStorage", .value = 60, .parameters = &.{} },
1129 .{ .name = "GroupNonUniform", .value = 61, .parameters = &.{} },
1130 .{ .name = "GroupNonUniformVote", .value = 62, .parameters = &.{} },
1131 .{ .name = "GroupNonUniformArithmetic", .value = 63, .parameters = &.{} },
1132 .{ .name = "GroupNonUniformBallot", .value = 64, .parameters = &.{} },
1133 .{ .name = "GroupNonUniformShuffle", .value = 65, .parameters = &.{} },
1134 .{ .name = "GroupNonUniformShuffleRelative", .value = 66, .parameters = &.{} },
1135 .{ .name = "GroupNonUniformClustered", .value = 67, .parameters = &.{} },
1136 .{ .name = "GroupNonUniformQuad", .value = 68, .parameters = &.{} },
1137 .{ .name = "ShaderLayer", .value = 69, .parameters = &.{} },
1138 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &.{} },
1139 .{ .name = "UniformDecoration", .value = 71, .parameters = &.{} },
1140 .{ .name = "CoreBuiltinsARM", .value = 4165, .parameters = &.{} },
1141 .{ .name = "TileImageColorReadAccessEXT", .value = 4166, .parameters = &.{} },
1142 .{ .name = "TileImageDepthReadAccessEXT", .value = 4167, .parameters = &.{} },
1143 .{ .name = "TileImageStencilReadAccessEXT", .value = 4168, .parameters = &.{} },
1144 .{ .name = "TensorsARM", .value = 4174, .parameters = &.{} },
1145 .{ .name = "StorageTensorArrayDynamicIndexingARM", .value = 4175, .parameters = &.{} },
1146 .{ .name = "StorageTensorArrayNonUniformIndexingARM", .value = 4176, .parameters = &.{} },
1147 .{ .name = "GraphARM", .value = 4191, .parameters = &.{} },
1148 .{ .name = "CooperativeMatrixLayoutsARM", .value = 4201, .parameters = &.{} },
1149 .{ .name = "Float8EXT", .value = 4212, .parameters = &.{} },
1150 .{ .name = "Float8CooperativeMatrixEXT", .value = 4213, .parameters = &.{} },
1151 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &.{} },
1152 .{ .name = "SubgroupBallotKHR", .value = 4423, .parameters = &.{} },
1153 .{ .name = "DrawParameters", .value = 4427, .parameters = &.{} },
1154 .{ .name = "WorkgroupMemoryExplicitLayoutKHR", .value = 4428, .parameters = &.{} },
1155 .{ .name = "WorkgroupMemoryExplicitLayout8BitAccessKHR", .value = 4429, .parameters = &.{} },
1156 .{ .name = "WorkgroupMemoryExplicitLayout16BitAccessKHR", .value = 4430, .parameters = &.{} },
1157 .{ .name = "SubgroupVoteKHR", .value = 4431, .parameters = &.{} },
1158 .{ .name = "StorageBuffer16BitAccess", .value = 4433, .parameters = &.{} },
1159 .{ .name = "UniformAndStorageBuffer16BitAccess", .value = 4434, .parameters = &.{} },
1160 .{ .name = "StoragePushConstant16", .value = 4435, .parameters = &.{} },
1161 .{ .name = "StorageInputOutput16", .value = 4436, .parameters = &.{} },
1162 .{ .name = "DeviceGroup", .value = 4437, .parameters = &.{} },
1163 .{ .name = "MultiView", .value = 4439, .parameters = &.{} },
1164 .{ .name = "VariablePointersStorageBuffer", .value = 4441, .parameters = &.{} },
1165 .{ .name = "VariablePointers", .value = 4442, .parameters = &.{} },
1166 .{ .name = "AtomicStorageOps", .value = 4445, .parameters = &.{} },
1167 .{ .name = "SampleMaskPostDepthCoverage", .value = 4447, .parameters = &.{} },
1168 .{ .name = "StorageBuffer8BitAccess", .value = 4448, .parameters = &.{} },
1169 .{ .name = "UniformAndStorageBuffer8BitAccess", .value = 4449, .parameters = &.{} },
1170 .{ .name = "StoragePushConstant8", .value = 4450, .parameters = &.{} },
1171 .{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },
1172 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },
1173 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },
1174 .{ .name = "RoundingModeRTE", .value = 4467, .parameters = &.{} },
1175 .{ .name = "RoundingModeRTZ", .value = 4468, .parameters = &.{} },
1176 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },
1177 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },
1178 .{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },
1179 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },
1180 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &.{} },
1181 .{ .name = "TextureSampleWeightedQCOM", .value = 4484, .parameters = &.{} },
1182 .{ .name = "TextureBoxFilterQCOM", .value = 4485, .parameters = &.{} },
1183 .{ .name = "TextureBlockMatchQCOM", .value = 4486, .parameters = &.{} },
1184 .{ .name = "TileShadingQCOM", .value = 4495, .parameters = &.{} },
1185 .{ .name = "TextureBlockMatch2QCOM", .value = 4498, .parameters = &.{} },
1186 .{ .name = "Float16ImageAMD", .value = 5008, .parameters = &.{} },
1187 .{ .name = "ImageGatherBiasLodAMD", .value = 5009, .parameters = &.{} },
1188 .{ .name = "FragmentMaskAMD", .value = 5010, .parameters = &.{} },
1189 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &.{} },
1190 .{ .name = "ImageReadWriteLodAMD", .value = 5015, .parameters = &.{} },
1191 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &.{} },
1192 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &.{} },
1193 .{ .name = "ShaderEnqueueAMDX", .value = 5067, .parameters = &.{} },
1194 .{ .name = "QuadControlKHR", .value = 5087, .parameters = &.{} },
1195 .{ .name = "Int4TypeINTEL", .value = 5112, .parameters = &.{} },
1196 .{ .name = "Int4CooperativeMatrixINTEL", .value = 5114, .parameters = &.{} },
1197 .{ .name = "BFloat16TypeKHR", .value = 5116, .parameters = &.{} },
1198 .{ .name = "BFloat16DotProductKHR", .value = 5117, .parameters = &.{} },
1199 .{ .name = "BFloat16CooperativeMatrixKHR", .value = 5118, .parameters = &.{} },
1200 .{ .name = "SampleMaskOverrideCoverageNV", .value = 5249, .parameters = &.{} },
1201 .{ .name = "GeometryShaderPassthroughNV", .value = 5251, .parameters = &.{} },
1202 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },
1203 .{ .name = "ShaderViewportMaskNV", .value = 5255, .parameters = &.{} },
1204 .{ .name = "ShaderStereoViewNV", .value = 5259, .parameters = &.{} },
1205 .{ .name = "PerViewAttributesNV", .value = 5260, .parameters = &.{} },
1206 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },
1207 .{ .name = "MeshShadingNV", .value = 5266, .parameters = &.{} },
1208 .{ .name = "ImageFootprintNV", .value = 5282, .parameters = &.{} },
1209 .{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },
1210 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &.{} },
1211 .{ .name = "ComputeDerivativeGroupQuadsKHR", .value = 5288, .parameters = &.{} },
1212 .{ .name = "FragmentDensityEXT", .value = 5291, .parameters = &.{} },
1213 .{ .name = "GroupNonUniformPartitionedNV", .value = 5297, .parameters = &.{} },
1214 .{ .name = "ShaderNonUniform", .value = 5301, .parameters = &.{} },
1215 .{ .name = "RuntimeDescriptorArray", .value = 5302, .parameters = &.{} },
1216 .{ .name = "InputAttachmentArrayDynamicIndexing", .value = 5303, .parameters = &.{} },
1217 .{ .name = "UniformTexelBufferArrayDynamicIndexing", .value = 5304, .parameters = &.{} },
1218 .{ .name = "StorageTexelBufferArrayDynamicIndexing", .value = 5305, .parameters = &.{} },
1219 .{ .name = "UniformBufferArrayNonUniformIndexing", .value = 5306, .parameters = &.{} },
1220 .{ .name = "SampledImageArrayNonUniformIndexing", .value = 5307, .parameters = &.{} },
1221 .{ .name = "StorageBufferArrayNonUniformIndexing", .value = 5308, .parameters = &.{} },
1222 .{ .name = "StorageImageArrayNonUniformIndexing", .value = 5309, .parameters = &.{} },
1223 .{ .name = "InputAttachmentArrayNonUniformIndexing", .value = 5310, .parameters = &.{} },
1224 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &.{} },
1225 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &.{} },
1226 .{ .name = "RayTracingPositionFetchKHR", .value = 5336, .parameters = &.{} },
1227 .{ .name = "RayTracingNV", .value = 5340, .parameters = &.{} },
1228 .{ .name = "RayTracingMotionBlurNV", .value = 5341, .parameters = &.{} },
1229 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &.{} },
1230 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },
1231 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },
1232 .{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },
1233 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },
1234 .{ .name = "CooperativeMatrixNV", .value = 5357, .parameters = &.{} },
1235 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },
1236 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },
1237 .{ .name = "ShaderSMBuiltinsNV", .value = 5373, .parameters = &.{} },
1238 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },
1239 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &.{} },
1240 .{ .name = "DisplacementMicromapNV", .value = 5380, .parameters = &.{} },
1241 .{ .name = "RayTracingOpacityMicromapEXT", .value = 5381, .parameters = &.{} },
1242 .{ .name = "ShaderInvocationReorderNV", .value = 5383, .parameters = &.{} },
1243 .{ .name = "BindlessTextureNV", .value = 5390, .parameters = &.{} },
1244 .{ .name = "RayQueryPositionFetchKHR", .value = 5391, .parameters = &.{} },
1245 .{ .name = "CooperativeVectorNV", .value = 5394, .parameters = &.{} },
1246 .{ .name = "AtomicFloat16VectorNV", .value = 5404, .parameters = &.{} },
1247 .{ .name = "RayTracingDisplacementMicromapNV", .value = 5409, .parameters = &.{} },
1248 .{ .name = "RawAccessChainsNV", .value = 5414, .parameters = &.{} },
1249 .{ .name = "RayTracingSpheresGeometryNV", .value = 5418, .parameters = &.{} },
1250 .{ .name = "RayTracingLinearSweptSpheresGeometryNV", .value = 5419, .parameters = &.{} },
1251 .{ .name = "CooperativeMatrixReductionsNV", .value = 5430, .parameters = &.{} },
1252 .{ .name = "CooperativeMatrixConversionsNV", .value = 5431, .parameters = &.{} },
1253 .{ .name = "CooperativeMatrixPerElementOperationsNV", .value = 5432, .parameters = &.{} },
1254 .{ .name = "CooperativeMatrixTensorAddressingNV", .value = 5433, .parameters = &.{} },
1255 .{ .name = "CooperativeMatrixBlockLoadsNV", .value = 5434, .parameters = &.{} },
1256 .{ .name = "CooperativeVectorTrainingNV", .value = 5435, .parameters = &.{} },
1257 .{ .name = "RayTracingClusterAccelerationStructureNV", .value = 5437, .parameters = &.{} },
1258 .{ .name = "TensorAddressingNV", .value = 5439, .parameters = &.{} },
1259 .{ .name = "SubgroupShuffleINTEL", .value = 5568, .parameters = &.{} },
1260 .{ .name = "SubgroupBufferBlockIOINTEL", .value = 5569, .parameters = &.{} },
1261 .{ .name = "SubgroupImageBlockIOINTEL", .value = 5570, .parameters = &.{} },
1262 .{ .name = "SubgroupImageMediaBlockIOINTEL", .value = 5579, .parameters = &.{} },
1263 .{ .name = "RoundToInfinityINTEL", .value = 5582, .parameters = &.{} },
1264 .{ .name = "FloatingPointModeINTEL", .value = 5583, .parameters = &.{} },
1265 .{ .name = "IntegerFunctions2INTEL", .value = 5584, .parameters = &.{} },
1266 .{ .name = "FunctionPointersINTEL", .value = 5603, .parameters = &.{} },
1267 .{ .name = "IndirectReferencesINTEL", .value = 5604, .parameters = &.{} },
1268 .{ .name = "AsmINTEL", .value = 5606, .parameters = &.{} },
1269 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &.{} },
1270 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &.{} },
1271 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &.{} },
1272 .{ .name = "VectorComputeINTEL", .value = 5617, .parameters = &.{} },
1273 .{ .name = "VectorAnyINTEL", .value = 5619, .parameters = &.{} },
1274 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &.{} },
1275 .{ .name = "SubgroupAvcMotionEstimationINTEL", .value = 5696, .parameters = &.{} },
1276 .{ .name = "SubgroupAvcMotionEstimationIntraINTEL", .value = 5697, .parameters = &.{} },
1277 .{ .name = "SubgroupAvcMotionEstimationChromaINTEL", .value = 5698, .parameters = &.{} },
1278 .{ .name = "VariableLengthArrayINTEL", .value = 5817, .parameters = &.{} },
1279 .{ .name = "FunctionFloatControlINTEL", .value = 5821, .parameters = &.{} },
1280 .{ .name = "FPGAMemoryAttributesINTEL", .value = 5824, .parameters = &.{} },
1281 .{ .name = "FPFastMathModeINTEL", .value = 5837, .parameters = &.{} },
1282 .{ .name = "ArbitraryPrecisionIntegersINTEL", .value = 5844, .parameters = &.{} },
1283 .{ .name = "ArbitraryPrecisionFloatingPointINTEL", .value = 5845, .parameters = &.{} },
1284 .{ .name = "UnstructuredLoopControlsINTEL", .value = 5886, .parameters = &.{} },
1285 .{ .name = "FPGALoopControlsINTEL", .value = 5888, .parameters = &.{} },
1286 .{ .name = "KernelAttributesINTEL", .value = 5892, .parameters = &.{} },
1287 .{ .name = "FPGAKernelAttributesINTEL", .value = 5897, .parameters = &.{} },
1288 .{ .name = "FPGAMemoryAccessesINTEL", .value = 5898, .parameters = &.{} },
1289 .{ .name = "FPGAClusterAttributesINTEL", .value = 5904, .parameters = &.{} },
1290 .{ .name = "LoopFuseINTEL", .value = 5906, .parameters = &.{} },
1291 .{ .name = "FPGADSPControlINTEL", .value = 5908, .parameters = &.{} },
1292 .{ .name = "MemoryAccessAliasingINTEL", .value = 5910, .parameters = &.{} },
1293 .{ .name = "FPGAInvocationPipeliningAttributesINTEL", .value = 5916, .parameters = &.{} },
1294 .{ .name = "FPGABufferLocationINTEL", .value = 5920, .parameters = &.{} },
1295 .{ .name = "ArbitraryPrecisionFixedPointINTEL", .value = 5922, .parameters = &.{} },
1296 .{ .name = "USMStorageClassesINTEL", .value = 5935, .parameters = &.{} },
1297 .{ .name = "RuntimeAlignedAttributeINTEL", .value = 5939, .parameters = &.{} },
1298 .{ .name = "IOPipesINTEL", .value = 5943, .parameters = &.{} },
1299 .{ .name = "BlockingPipesINTEL", .value = 5945, .parameters = &.{} },
1300 .{ .name = "FPGARegINTEL", .value = 5948, .parameters = &.{} },
1301 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &.{} },
1302 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &.{} },
1303 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &.{} },
1304 .{ .name = "DotProduct", .value = 6019, .parameters = &.{} },
1305 .{ .name = "RayCullMaskKHR", .value = 6020, .parameters = &.{} },
1306 .{ .name = "CooperativeMatrixKHR", .value = 6022, .parameters = &.{} },
1307 .{ .name = "ReplicatedCompositesEXT", .value = 6024, .parameters = &.{} },
1308 .{ .name = "BitInstructions", .value = 6025, .parameters = &.{} },
1309 .{ .name = "GroupNonUniformRotateKHR", .value = 6026, .parameters = &.{} },
1310 .{ .name = "FloatControls2", .value = 6029, .parameters = &.{} },
1311 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &.{} },
1312 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &.{} },
1313 .{ .name = "LongCompositesINTEL", .value = 6089, .parameters = &.{} },
1314 .{ .name = "OptNoneEXT", .value = 6094, .parameters = &.{} },
1315 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &.{} },
1316 .{ .name = "DebugInfoModuleINTEL", .value = 6114, .parameters = &.{} },
1317 .{ .name = "BFloat16ConversionINTEL", .value = 6115, .parameters = &.{} },
1318 .{ .name = "SplitBarrierINTEL", .value = 6141, .parameters = &.{} },
1319 .{ .name = "ArithmeticFenceEXT", .value = 6144, .parameters = &.{} },
1320 .{ .name = "FPGAClusterAttributesV2INTEL", .value = 6150, .parameters = &.{} },
1321 .{ .name = "FPGAKernelAttributesv2INTEL", .value = 6161, .parameters = &.{} },
1322 .{ .name = "TaskSequenceINTEL", .value = 6162, .parameters = &.{} },
1323 .{ .name = "FPMaxErrorINTEL", .value = 6169, .parameters = &.{} },
1324 .{ .name = "FPGALatencyControlINTEL", .value = 6171, .parameters = &.{} },
1325 .{ .name = "FPGAArgumentInterfacesINTEL", .value = 6174, .parameters = &.{} },
1326 .{ .name = "GlobalVariableHostAccessINTEL", .value = 6187, .parameters = &.{} },
1327 .{ .name = "GlobalVariableFPGADecorationsINTEL", .value = 6189, .parameters = &.{} },
1328 .{ .name = "SubgroupBufferPrefetchINTEL", .value = 6220, .parameters = &.{} },
1329 .{ .name = "Subgroup2DBlockIOINTEL", .value = 6228, .parameters = &.{} },
1330 .{ .name = "Subgroup2DBlockTransformINTEL", .value = 6229, .parameters = &.{} },
1331 .{ .name = "Subgroup2DBlockTransposeINTEL", .value = 6230, .parameters = &.{} },
1332 .{ .name = "SubgroupMatrixMultiplyAccumulateINTEL", .value = 6236, .parameters = &.{} },
1333 .{ .name = "TernaryBitwiseFunctionINTEL", .value = 6241, .parameters = &.{} },
1334 .{ .name = "GroupUniformArithmeticKHR", .value = 6400, .parameters = &.{} },
1335 .{ .name = "TensorFloat32RoundingINTEL", .value = 6425, .parameters = &.{} },
1336 .{ .name = "MaskedGatherScatterINTEL", .value = 6427, .parameters = &.{} },
1337 .{ .name = "CacheControlsINTEL", .value = 6441, .parameters = &.{} },
1338 .{ .name = "RegisterLimitsINTEL", .value = 6460, .parameters = &.{} },
1339 .{ .name = "BindlessImagesINTEL", .value = 6528, .parameters = &.{} },
1340 },
1341 .ray_query_intersection => &.{
1342 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &.{} },
1343 .{ .name = "RayQueryCommittedIntersectionKHR", .value = 1, .parameters = &.{} },
1344 },
1345 .ray_query_committed_intersection_type => &.{
1346 .{ .name = "RayQueryCommittedIntersectionNoneKHR", .value = 0, .parameters = &.{} },
1347 .{ .name = "RayQueryCommittedIntersectionTriangleKHR", .value = 1, .parameters = &.{} },
1348 .{ .name = "RayQueryCommittedIntersectionGeneratedKHR", .value = 2, .parameters = &.{} },
1349 },
1350 .ray_query_candidate_intersection_type => &.{
1351 .{ .name = "RayQueryCandidateIntersectionTriangleKHR", .value = 0, .parameters = &.{} },
1352 .{ .name = "RayQueryCandidateIntersectionAABBKHR", .value = 1, .parameters = &.{} },
1353 },
1354 .packed_vector_format => &.{
1355 .{ .name = "PackedVectorFormat4x8Bit", .value = 0, .parameters = &.{} },
1356 },
1357 .cooperative_matrix_operands => &.{
1358 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
1359 .{ .name = "MatrixASignedComponentsKHR", .value = 0x0001, .parameters = &.{} },
1360 .{ .name = "MatrixBSignedComponentsKHR", .value = 0x0002, .parameters = &.{} },
1361 .{ .name = "MatrixCSignedComponentsKHR", .value = 0x0004, .parameters = &.{} },
1362 .{ .name = "MatrixResultSignedComponentsKHR", .value = 0x0008, .parameters = &.{} },
1363 .{ .name = "SaturatingAccumulationKHR", .value = 0x0010, .parameters = &.{} },
1364 },
1365 .cooperative_matrix_layout => &.{
1366 .{ .name = "RowMajorKHR", .value = 0, .parameters = &.{} },
1367 .{ .name = "ColumnMajorKHR", .value = 1, .parameters = &.{} },
1368 .{ .name = "RowBlockedInterleavedARM", .value = 4202, .parameters = &.{} },
1369 .{ .name = "ColumnBlockedInterleavedARM", .value = 4203, .parameters = &.{} },
1370 },
1371 .cooperative_matrix_use => &.{
1372 .{ .name = "MatrixAKHR", .value = 0, .parameters = &.{} },
1373 .{ .name = "MatrixBKHR", .value = 1, .parameters = &.{} },
1374 .{ .name = "MatrixAccumulatorKHR", .value = 2, .parameters = &.{} },
1375 },
1376 .cooperative_matrix_reduce => &.{
1377 .{ .name = "Row", .value = 0x0001, .parameters = &.{} },
1378 .{ .name = "Column", .value = 0x0002, .parameters = &.{} },
1379 .{ .name = "2x2", .value = 0x0004, .parameters = &.{} },
1380 },
1381 .tensor_clamp_mode => &.{
1382 .{ .name = "Undefined", .value = 0, .parameters = &.{} },
1383 .{ .name = "Constant", .value = 1, .parameters = &.{} },
1384 .{ .name = "ClampToEdge", .value = 2, .parameters = &.{} },
1385 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
1386 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
1387 },
1388 .tensor_addressing_operands => &.{
1389 .{ .name = "TensorView", .value = 0x0001, .parameters = &.{.id_ref} },
1390 .{ .name = "DecodeFunc", .value = 0x0002, .parameters = &.{.id_ref} },
1391 },
1392 .initialization_mode_qualifier => &.{
1393 .{ .name = "InitOnDeviceReprogramINTEL", .value = 0, .parameters = &.{} },
1394 .{ .name = "InitOnDeviceResetINTEL", .value = 1, .parameters = &.{} },
1395 },
1396 .load_cache_control => &.{
1397 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1398 .{ .name = "CachedINTEL", .value = 1, .parameters = &.{} },
1399 .{ .name = "StreamingINTEL", .value = 2, .parameters = &.{} },
1400 .{ .name = "InvalidateAfterReadINTEL", .value = 3, .parameters = &.{} },
1401 .{ .name = "ConstCachedINTEL", .value = 4, .parameters = &.{} },
1402 },
1403 .store_cache_control => &.{
1404 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1405 .{ .name = "WriteThroughINTEL", .value = 1, .parameters = &.{} },
1406 .{ .name = "WriteBackINTEL", .value = 2, .parameters = &.{} },
1407 .{ .name = "StreamingINTEL", .value = 3, .parameters = &.{} },
1408 },
1409 .named_maximum_number_of_registers => &.{
1410 .{ .name = "AutoINTEL", .value = 0, .parameters = &.{} },
1411 },
1412 .matrix_multiply_accumulate_operands => &.{
1413 .{ .name = "MatrixASignedComponentsINTEL", .value = 0x1, .parameters = &.{} },
1414 .{ .name = "MatrixBSignedComponentsINTEL", .value = 0x2, .parameters = &.{} },
1415 .{ .name = "MatrixCBFloat16INTEL", .value = 0x4, .parameters = &.{} },
1416 .{ .name = "MatrixResultBFloat16INTEL", .value = 0x8, .parameters = &.{} },
1417 .{ .name = "MatrixAPackedInt8INTEL", .value = 0x10, .parameters = &.{} },
1418 .{ .name = "MatrixBPackedInt8INTEL", .value = 0x20, .parameters = &.{} },
1419 .{ .name = "MatrixAPackedInt4INTEL", .value = 0x40, .parameters = &.{} },
1420 .{ .name = "MatrixBPackedInt4INTEL", .value = 0x80, .parameters = &.{} },
1421 .{ .name = "MatrixATF32INTEL", .value = 0x100, .parameters = &.{} },
1422 .{ .name = "MatrixBTF32INTEL", .value = 0x200, .parameters = &.{} },
1423 .{ .name = "MatrixAPackedFloat16INTEL", .value = 0x400, .parameters = &.{} },
1424 .{ .name = "MatrixBPackedFloat16INTEL", .value = 0x800, .parameters = &.{} },
1425 .{ .name = "MatrixAPackedBFloat16INTEL", .value = 0x1000, .parameters = &.{} },
1426 .{ .name = "MatrixBPackedBFloat16INTEL", .value = 0x2000, .parameters = &.{} },
1427 },
1428 .fp_encoding => &.{
1429 .{ .name = "BFloat16KHR", .value = 0, .parameters = &.{} },
1430 .{ .name = "Float8E4M3EXT", .value = 4214, .parameters = &.{} },
1431 .{ .name = "Float8E5M2EXT", .value = 4215, .parameters = &.{} },
1432 },
1433 .cooperative_vector_matrix_layout => &.{
1434 .{ .name = "RowMajorNV", .value = 0, .parameters = &.{} },
1435 .{ .name = "ColumnMajorNV", .value = 1, .parameters = &.{} },
1436 .{ .name = "InferencingOptimalNV", .value = 2, .parameters = &.{} },
1437 .{ .name = "TrainingOptimalNV", .value = 3, .parameters = &.{} },
1438 },
1439 .component_type => &.{
1440 .{ .name = "Float16NV", .value = 0, .parameters = &.{} },
1441 .{ .name = "Float32NV", .value = 1, .parameters = &.{} },
1442 .{ .name = "Float64NV", .value = 2, .parameters = &.{} },
1443 .{ .name = "SignedInt8NV", .value = 3, .parameters = &.{} },
1444 .{ .name = "SignedInt16NV", .value = 4, .parameters = &.{} },
1445 .{ .name = "SignedInt32NV", .value = 5, .parameters = &.{} },
1446 .{ .name = "SignedInt64NV", .value = 6, .parameters = &.{} },
1447 .{ .name = "UnsignedInt8NV", .value = 7, .parameters = &.{} },
1448 .{ .name = "UnsignedInt16NV", .value = 8, .parameters = &.{} },
1449 .{ .name = "UnsignedInt32NV", .value = 9, .parameters = &.{} },
1450 .{ .name = "UnsignedInt64NV", .value = 10, .parameters = &.{} },
1451 .{ .name = "SignedInt8PackedNV", .value = 1000491000, .parameters = &.{} },
1452 .{ .name = "UnsignedInt8PackedNV", .value = 1000491001, .parameters = &.{} },
1453 .{ .name = "FloatE4M3NV", .value = 1000491002, .parameters = &.{} },
1454 .{ .name = "FloatE5M2NV", .value = 1000491003, .parameters = &.{} },
1455 },
1456 .id_result_type => unreachable,
1457 .id_result => unreachable,
1458 .id_memory_semantics => unreachable,
1459 .id_scope => unreachable,
1460 .id_ref => unreachable,
1461 .literal_integer => unreachable,
1462 .literal_string => unreachable,
1463 .literal_float => unreachable,
1464 .literal_context_dependent_number => unreachable,
1465 .literal_ext_inst_integer => unreachable,
1466 .literal_spec_constant_op_integer => unreachable,
1467 .pair_literal_integer_id_ref => unreachable,
1468 .pair_id_ref_literal_integer => unreachable,
1469 .pair_id_ref_id_ref => unreachable,
1470 .tensor_operands => &.{
1471 .{ .name = "NoneARM", .value = 0x0000, .parameters = &.{} },
1472 .{ .name = "NontemporalARM", .value = 0x0001, .parameters = &.{} },
1473 .{ .name = "OutOfBoundsValueARM", .value = 0x0002, .parameters = &.{.id_ref} },
1474 .{ .name = "MakeElementAvailableARM", .value = 0x0004, .parameters = &.{.id_ref} },
1475 .{ .name = "MakeElementVisibleARM", .value = 0x0008, .parameters = &.{.id_ref} },
1476 .{ .name = "NonPrivateElementARM", .value = 0x0010, .parameters = &.{} },
1477 },
1478 .debug_info_debug_info_flags => &.{
1479 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1480 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1481 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1482 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1483 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1484 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1485 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1486 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1487 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1488 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1489 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1490 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1491 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1492 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1493 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1494 },
1495 .debug_info_debug_base_type_attribute_encoding => &.{
1496 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1497 .{ .name = "Address", .value = 1, .parameters = &.{} },
1498 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1499 .{ .name = "Float", .value = 4, .parameters = &.{} },
1500 .{ .name = "Signed", .value = 5, .parameters = &.{} },
1501 .{ .name = "SignedChar", .value = 6, .parameters = &.{} },
1502 .{ .name = "Unsigned", .value = 7, .parameters = &.{} },
1503 .{ .name = "UnsignedChar", .value = 8, .parameters = &.{} },
1504 },
1505 .debug_info_debug_composite_type => &.{
1506 .{ .name = "Class", .value = 0, .parameters = &.{} },
1507 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1508 .{ .name = "Union", .value = 2, .parameters = &.{} },
1509 },
1510 .debug_info_debug_type_qualifier => &.{
1511 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1512 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1513 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1514 },
1515 .debug_info_debug_operation => &.{
1516 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1517 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1518 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1519 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1520 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1521 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1522 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1523 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1524 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1525 },
1526 .open_cl_debug_info_100_debug_info_flags => &.{
1527 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1528 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1529 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1530 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1531 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1532 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1533 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1534 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1535 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1536 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1537 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1538 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1539 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1540 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1541 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1542 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1543 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1544 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1545 },
1546 .open_cl_debug_info_100_debug_base_type_attribute_encoding => &.{
1547 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1548 .{ .name = "Address", .value = 1, .parameters = &.{} },
1549 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1550 .{ .name = "Float", .value = 3, .parameters = &.{} },
1551 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1552 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1553 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1554 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1555 },
1556 .open_cl_debug_info_100_debug_composite_type => &.{
1557 .{ .name = "Class", .value = 0, .parameters = &.{} },
1558 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1559 .{ .name = "Union", .value = 2, .parameters = &.{} },
1560 },
1561 .open_cl_debug_info_100_debug_type_qualifier => &.{
1562 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1563 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1564 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1565 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1566 },
1567 .open_cl_debug_info_100_debug_operation => &.{
1568 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1569 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1570 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1571 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1572 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1573 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1574 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1575 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1576 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1577 .{ .name = "Fragment", .value = 9, .parameters = &.{ .literal_integer, .literal_integer } },
1578 },
1579 .open_cl_debug_info_100_debug_imported_entity => &.{
1580 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1581 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1582 },
1583 .non_semantic_clspv_reflection_6_kernel_property_flags => &.{
1584 .{ .name = "MayUsePrintf", .value = 0x1, .parameters = &.{} },
1585 },
1586 .non_semantic_shader_debug_info_100_debug_info_flags => &.{
1587 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1588 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1589 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1590 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1591 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1592 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1593 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1594 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1595 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1596 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1597 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1598 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1599 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1600 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1601 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1602 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1603 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1604 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1605 .{ .name = "FlagUnknownPhysicalLayout", .value = 0x20000, .parameters = &.{} },
1606 },
1607 .non_semantic_shader_debug_info_100_build_identifier_flags => &.{
1608 .{ .name = "IdentifierPossibleDuplicates", .value = 0x01, .parameters = &.{} },
1609 },
1610 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => &.{
1611 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1612 .{ .name = "Address", .value = 1, .parameters = &.{} },
1613 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1614 .{ .name = "Float", .value = 3, .parameters = &.{} },
1615 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1616 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1617 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1618 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1619 },
1620 .non_semantic_shader_debug_info_100_debug_composite_type => &.{
1621 .{ .name = "Class", .value = 0, .parameters = &.{} },
1622 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1623 .{ .name = "Union", .value = 2, .parameters = &.{} },
1624 },
1625 .non_semantic_shader_debug_info_100_debug_type_qualifier => &.{
1626 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1627 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1628 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1629 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1630 },
1631 .non_semantic_shader_debug_info_100_debug_operation => &.{
1632 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1633 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1634 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1635 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.id_ref} },
1636 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .id_ref, .id_ref } },
1637 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1638 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1639 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1640 .{ .name = "Constu", .value = 8, .parameters = &.{.id_ref} },
1641 .{ .name = "Fragment", .value = 9, .parameters = &.{ .id_ref, .id_ref } },
1642 },
1643 .non_semantic_shader_debug_info_100_debug_imported_entity => &.{
1644 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1645 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1646 },
1647 };
1648 }
1649};
1650pub const Opcode = enum(u16) {
1651 OpNop = 0,
1652 OpUndef = 1,
1653 OpSourceContinued = 2,
1654 OpSource = 3,
1655 OpSourceExtension = 4,
1656 OpName = 5,
1657 OpMemberName = 6,
1658 OpString = 7,
1659 OpLine = 8,
1660 OpExtension = 10,
1661 OpExtInstImport = 11,
1662 OpExtInst = 12,
1663 OpMemoryModel = 14,
1664 OpEntryPoint = 15,
1665 OpExecutionMode = 16,
1666 OpCapability = 17,
1667 OpTypeVoid = 19,
1668 OpTypeBool = 20,
1669 OpTypeInt = 21,
1670 OpTypeFloat = 22,
1671 OpTypeVector = 23,
1672 OpTypeMatrix = 24,
1673 OpTypeImage = 25,
1674 OpTypeSampler = 26,
1675 OpTypeSampledImage = 27,
1676 OpTypeArray = 28,
1677 OpTypeRuntimeArray = 29,
1678 OpTypeStruct = 30,
1679 OpTypeOpaque = 31,
1680 OpTypePointer = 32,
1681 OpTypeFunction = 33,
1682 OpTypeEvent = 34,
1683 OpTypeDeviceEvent = 35,
1684 OpTypeReserveId = 36,
1685 OpTypeQueue = 37,
1686 OpTypePipe = 38,
1687 OpTypeForwardPointer = 39,
1688 OpConstantTrue = 41,
1689 OpConstantFalse = 42,
1690 OpConstant = 43,
1691 OpConstantComposite = 44,
1692 OpConstantSampler = 45,
1693 OpConstantNull = 46,
1694 OpSpecConstantTrue = 48,
1695 OpSpecConstantFalse = 49,
1696 OpSpecConstant = 50,
1697 OpSpecConstantComposite = 51,
1698 OpSpecConstantOp = 52,
1699 OpFunction = 54,
1700 OpFunctionParameter = 55,
1701 OpFunctionEnd = 56,
1702 OpFunctionCall = 57,
1703 OpVariable = 59,
1704 OpImageTexelPointer = 60,
1705 OpLoad = 61,
1706 OpStore = 62,
1707 OpCopyMemory = 63,
1708 OpCopyMemorySized = 64,
1709 OpAccessChain = 65,
1710 OpInBoundsAccessChain = 66,
1711 OpPtrAccessChain = 67,
1712 OpArrayLength = 68,
1713 OpGenericPtrMemSemantics = 69,
1714 OpInBoundsPtrAccessChain = 70,
1715 OpDecorate = 71,
1716 OpMemberDecorate = 72,
1717 OpDecorationGroup = 73,
1718 OpGroupDecorate = 74,
1719 OpGroupMemberDecorate = 75,
1720 OpVectorExtractDynamic = 77,
1721 OpVectorInsertDynamic = 78,
1722 OpVectorShuffle = 79,
1723 OpCompositeConstruct = 80,
1724 OpCompositeExtract = 81,
1725 OpCompositeInsert = 82,
1726 OpCopyObject = 83,
1727 OpTranspose = 84,
1728 OpSampledImage = 86,
1729 OpImageSampleImplicitLod = 87,
1730 OpImageSampleExplicitLod = 88,
1731 OpImageSampleDrefImplicitLod = 89,
1732 OpImageSampleDrefExplicitLod = 90,
1733 OpImageSampleProjImplicitLod = 91,
1734 OpImageSampleProjExplicitLod = 92,
1735 OpImageSampleProjDrefImplicitLod = 93,
1736 OpImageSampleProjDrefExplicitLod = 94,
1737 OpImageFetch = 95,
1738 OpImageGather = 96,
1739 OpImageDrefGather = 97,
1740 OpImageRead = 98,
1741 OpImageWrite = 99,
1742 OpImage = 100,
1743 OpImageQueryFormat = 101,
1744 OpImageQueryOrder = 102,
1745 OpImageQuerySizeLod = 103,
1746 OpImageQuerySize = 104,
1747 OpImageQueryLod = 105,
1748 OpImageQueryLevels = 106,
1749 OpImageQuerySamples = 107,
1750 OpConvertFToU = 109,
1751 OpConvertFToS = 110,
1752 OpConvertSToF = 111,
1753 OpConvertUToF = 112,
1754 OpUConvert = 113,
1755 OpSConvert = 114,
1756 OpFConvert = 115,
1757 OpQuantizeToF16 = 116,
1758 OpConvertPtrToU = 117,
1759 OpSatConvertSToU = 118,
1760 OpSatConvertUToS = 119,
1761 OpConvertUToPtr = 120,
1762 OpPtrCastToGeneric = 121,
1763 OpGenericCastToPtr = 122,
1764 OpGenericCastToPtrExplicit = 123,
1765 OpBitcast = 124,
1766 OpSNegate = 126,
1767 OpFNegate = 127,
1768 OpIAdd = 128,
1769 OpFAdd = 129,
1770 OpISub = 130,
1771 OpFSub = 131,
1772 OpIMul = 132,
1773 OpFMul = 133,
1774 OpUDiv = 134,
1775 OpSDiv = 135,
1776 OpFDiv = 136,
1777 OpUMod = 137,
1778 OpSRem = 138,
1779 OpSMod = 139,
1780 OpFRem = 140,
1781 OpFMod = 141,
1782 OpVectorTimesScalar = 142,
1783 OpMatrixTimesScalar = 143,
1784 OpVectorTimesMatrix = 144,
1785 OpMatrixTimesVector = 145,
1786 OpMatrixTimesMatrix = 146,
1787 OpOuterProduct = 147,
1788 OpDot = 148,
1789 OpIAddCarry = 149,
1790 OpISubBorrow = 150,
1791 OpUMulExtended = 151,
1792 OpSMulExtended = 152,
1793 OpAny = 154,
1794 OpAll = 155,
1795 OpIsNan = 156,
1796 OpIsInf = 157,
1797 OpIsFinite = 158,
1798 OpIsNormal = 159,
1799 OpSignBitSet = 160,
1800 OpLessOrGreater = 161,
1801 OpOrdered = 162,
1802 OpUnordered = 163,
1803 OpLogicalEqual = 164,
1804 OpLogicalNotEqual = 165,
1805 OpLogicalOr = 166,
1806 OpLogicalAnd = 167,
1807 OpLogicalNot = 168,
1808 OpSelect = 169,
1809 OpIEqual = 170,
1810 OpINotEqual = 171,
1811 OpUGreaterThan = 172,
1812 OpSGreaterThan = 173,
1813 OpUGreaterThanEqual = 174,
1814 OpSGreaterThanEqual = 175,
1815 OpULessThan = 176,
1816 OpSLessThan = 177,
1817 OpULessThanEqual = 178,
1818 OpSLessThanEqual = 179,
1819 OpFOrdEqual = 180,
1820 OpFUnordEqual = 181,
1821 OpFOrdNotEqual = 182,
1822 OpFUnordNotEqual = 183,
1823 OpFOrdLessThan = 184,
1824 OpFUnordLessThan = 185,
1825 OpFOrdGreaterThan = 186,
1826 OpFUnordGreaterThan = 187,
1827 OpFOrdLessThanEqual = 188,
1828 OpFUnordLessThanEqual = 189,
1829 OpFOrdGreaterThanEqual = 190,
1830 OpFUnordGreaterThanEqual = 191,
1831 OpShiftRightLogical = 194,
1832 OpShiftRightArithmetic = 195,
1833 OpShiftLeftLogical = 196,
1834 OpBitwiseOr = 197,
1835 OpBitwiseXor = 198,
1836 OpBitwiseAnd = 199,
1837 OpNot = 200,
1838 OpBitFieldInsert = 201,
1839 OpBitFieldSExtract = 202,
1840 OpBitFieldUExtract = 203,
1841 OpBitReverse = 204,
1842 OpBitCount = 205,
1843 OpDPdx = 207,
1844 OpDPdy = 208,
1845 OpFwidth = 209,
1846 OpDPdxFine = 210,
1847 OpDPdyFine = 211,
1848 OpFwidthFine = 212,
1849 OpDPdxCoarse = 213,
1850 OpDPdyCoarse = 214,
1851 OpFwidthCoarse = 215,
1852 OpEmitVertex = 218,
1853 OpEndPrimitive = 219,
1854 OpEmitStreamVertex = 220,
1855 OpEndStreamPrimitive = 221,
1856 OpControlBarrier = 224,
1857 OpMemoryBarrier = 225,
1858 OpAtomicLoad = 227,
1859 OpAtomicStore = 228,
1860 OpAtomicExchange = 229,
1861 OpAtomicCompareExchange = 230,
1862 OpAtomicCompareExchangeWeak = 231,
1863 OpAtomicIIncrement = 232,
1864 OpAtomicIDecrement = 233,
1865 OpAtomicIAdd = 234,
1866 OpAtomicISub = 235,
1867 OpAtomicSMin = 236,
1868 OpAtomicUMin = 237,
1869 OpAtomicSMax = 238,
1870 OpAtomicUMax = 239,
1871 OpAtomicAnd = 240,
1872 OpAtomicOr = 241,
1873 OpAtomicXor = 242,
1874 OpPhi = 245,
1875 OpLoopMerge = 246,
1876 OpSelectionMerge = 247,
1877 OpLabel = 248,
1878 OpBranch = 249,
1879 OpBranchConditional = 250,
1880 OpSwitch = 251,
1881 OpKill = 252,
1882 OpReturn = 253,
1883 OpReturnValue = 254,
1884 OpUnreachable = 255,
1885 OpLifetimeStart = 256,
1886 OpLifetimeStop = 257,
1887 OpGroupAsyncCopy = 259,
1888 OpGroupWaitEvents = 260,
1889 OpGroupAll = 261,
1890 OpGroupAny = 262,
1891 OpGroupBroadcast = 263,
1892 OpGroupIAdd = 264,
1893 OpGroupFAdd = 265,
1894 OpGroupFMin = 266,
1895 OpGroupUMin = 267,
1896 OpGroupSMin = 268,
1897 OpGroupFMax = 269,
1898 OpGroupUMax = 270,
1899 OpGroupSMax = 271,
1900 OpReadPipe = 274,
1901 OpWritePipe = 275,
1902 OpReservedReadPipe = 276,
1903 OpReservedWritePipe = 277,
1904 OpReserveReadPipePackets = 278,
1905 OpReserveWritePipePackets = 279,
1906 OpCommitReadPipe = 280,
1907 OpCommitWritePipe = 281,
1908 OpIsValidReserveId = 282,
1909 OpGetNumPipePackets = 283,
1910 OpGetMaxPipePackets = 284,
1911 OpGroupReserveReadPipePackets = 285,
1912 OpGroupReserveWritePipePackets = 286,
1913 OpGroupCommitReadPipe = 287,
1914 OpGroupCommitWritePipe = 288,
1915 OpEnqueueMarker = 291,
1916 OpEnqueueKernel = 292,
1917 OpGetKernelNDrangeSubGroupCount = 293,
1918 OpGetKernelNDrangeMaxSubGroupSize = 294,
1919 OpGetKernelWorkGroupSize = 295,
1920 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
1921 OpRetainEvent = 297,
1922 OpReleaseEvent = 298,
1923 OpCreateUserEvent = 299,
1924 OpIsValidEvent = 300,
1925 OpSetUserEventStatus = 301,
1926 OpCaptureEventProfilingInfo = 302,
1927 OpGetDefaultQueue = 303,
1928 OpBuildNDRange = 304,
1929 OpImageSparseSampleImplicitLod = 305,
1930 OpImageSparseSampleExplicitLod = 306,
1931 OpImageSparseSampleDrefImplicitLod = 307,
1932 OpImageSparseSampleDrefExplicitLod = 308,
1933 OpImageSparseSampleProjImplicitLod = 309,
1934 OpImageSparseSampleProjExplicitLod = 310,
1935 OpImageSparseSampleProjDrefImplicitLod = 311,
1936 OpImageSparseSampleProjDrefExplicitLod = 312,
1937 OpImageSparseFetch = 313,
1938 OpImageSparseGather = 314,
1939 OpImageSparseDrefGather = 315,
1940 OpImageSparseTexelsResident = 316,
1941 OpNoLine = 317,
1942 OpAtomicFlagTestAndSet = 318,
1943 OpAtomicFlagClear = 319,
1944 OpImageSparseRead = 320,
1945 OpSizeOf = 321,
1946 OpTypePipeStorage = 322,
1947 OpConstantPipeStorage = 323,
1948 OpCreatePipeFromPipeStorage = 324,
1949 OpGetKernelLocalSizeForSubgroupCount = 325,
1950 OpGetKernelMaxNumSubgroups = 326,
1951 OpTypeNamedBarrier = 327,
1952 OpNamedBarrierInitialize = 328,
1953 OpMemoryNamedBarrier = 329,
1954 OpModuleProcessed = 330,
1955 OpExecutionModeId = 331,
1956 OpDecorateId = 332,
1957 OpGroupNonUniformElect = 333,
1958 OpGroupNonUniformAll = 334,
1959 OpGroupNonUniformAny = 335,
1960 OpGroupNonUniformAllEqual = 336,
1961 OpGroupNonUniformBroadcast = 337,
1962 OpGroupNonUniformBroadcastFirst = 338,
1963 OpGroupNonUniformBallot = 339,
1964 OpGroupNonUniformInverseBallot = 340,
1965 OpGroupNonUniformBallotBitExtract = 341,
1966 OpGroupNonUniformBallotBitCount = 342,
1967 OpGroupNonUniformBallotFindLSB = 343,
1968 OpGroupNonUniformBallotFindMSB = 344,
1969 OpGroupNonUniformShuffle = 345,
1970 OpGroupNonUniformShuffleXor = 346,
1971 OpGroupNonUniformShuffleUp = 347,
1972 OpGroupNonUniformShuffleDown = 348,
1973 OpGroupNonUniformIAdd = 349,
1974 OpGroupNonUniformFAdd = 350,
1975 OpGroupNonUniformIMul = 351,
1976 OpGroupNonUniformFMul = 352,
1977 OpGroupNonUniformSMin = 353,
1978 OpGroupNonUniformUMin = 354,
1979 OpGroupNonUniformFMin = 355,
1980 OpGroupNonUniformSMax = 356,
1981 OpGroupNonUniformUMax = 357,
1982 OpGroupNonUniformFMax = 358,
1983 OpGroupNonUniformBitwiseAnd = 359,
1984 OpGroupNonUniformBitwiseOr = 360,
1985 OpGroupNonUniformBitwiseXor = 361,
1986 OpGroupNonUniformLogicalAnd = 362,
1987 OpGroupNonUniformLogicalOr = 363,
1988 OpGroupNonUniformLogicalXor = 364,
1989 OpGroupNonUniformQuadBroadcast = 365,
1990 OpGroupNonUniformQuadSwap = 366,
1991 OpCopyLogical = 400,
1992 OpPtrEqual = 401,
1993 OpPtrNotEqual = 402,
1994 OpPtrDiff = 403,
1995 OpColorAttachmentReadEXT = 4160,
1996 OpDepthAttachmentReadEXT = 4161,
1997 OpStencilAttachmentReadEXT = 4162,
1998 OpTypeTensorARM = 4163,
1999 OpTensorReadARM = 4164,
2000 OpTensorWriteARM = 4165,
2001 OpTensorQuerySizeARM = 4166,
2002 OpGraphConstantARM = 4181,
2003 OpGraphEntryPointARM = 4182,
2004 OpGraphARM = 4183,
2005 OpGraphInputARM = 4184,
2006 OpGraphSetOutputARM = 4185,
2007 OpGraphEndARM = 4186,
2008 OpTypeGraphARM = 4190,
2009 OpTerminateInvocation = 4416,
2010 OpTypeUntypedPointerKHR = 4417,
2011 OpUntypedVariableKHR = 4418,
2012 OpUntypedAccessChainKHR = 4419,
2013 OpUntypedInBoundsAccessChainKHR = 4420,
2014 OpSubgroupBallotKHR = 4421,
2015 OpSubgroupFirstInvocationKHR = 4422,
2016 OpUntypedPtrAccessChainKHR = 4423,
2017 OpUntypedInBoundsPtrAccessChainKHR = 4424,
2018 OpUntypedArrayLengthKHR = 4425,
2019 OpUntypedPrefetchKHR = 4426,
2020 OpSubgroupAllKHR = 4428,
2021 OpSubgroupAnyKHR = 4429,
2022 OpSubgroupAllEqualKHR = 4430,
2023 OpGroupNonUniformRotateKHR = 4431,
2024 OpSubgroupReadInvocationKHR = 4432,
2025 OpExtInstWithForwardRefsKHR = 4433,
2026 OpTraceRayKHR = 4445,
2027 OpExecuteCallableKHR = 4446,
2028 OpConvertUToAccelerationStructureKHR = 4447,
2029 OpIgnoreIntersectionKHR = 4448,
2030 OpTerminateRayKHR = 4449,
2031 OpSDot = 4450,
2032 OpUDot = 4451,
2033 OpSUDot = 4452,
2034 OpSDotAccSat = 4453,
2035 OpUDotAccSat = 4454,
2036 OpSUDotAccSat = 4455,
2037 OpTypeCooperativeMatrixKHR = 4456,
2038 OpCooperativeMatrixLoadKHR = 4457,
2039 OpCooperativeMatrixStoreKHR = 4458,
2040 OpCooperativeMatrixMulAddKHR = 4459,
2041 OpCooperativeMatrixLengthKHR = 4460,
2042 OpConstantCompositeReplicateEXT = 4461,
2043 OpSpecConstantCompositeReplicateEXT = 4462,
2044 OpCompositeConstructReplicateEXT = 4463,
2045 OpTypeRayQueryKHR = 4472,
2046 OpRayQueryInitializeKHR = 4473,
2047 OpRayQueryTerminateKHR = 4474,
2048 OpRayQueryGenerateIntersectionKHR = 4475,
2049 OpRayQueryConfirmIntersectionKHR = 4476,
2050 OpRayQueryProceedKHR = 4477,
2051 OpRayQueryGetIntersectionTypeKHR = 4479,
2052 OpImageSampleWeightedQCOM = 4480,
2053 OpImageBoxFilterQCOM = 4481,
2054 OpImageBlockMatchSSDQCOM = 4482,
2055 OpImageBlockMatchSADQCOM = 4483,
2056 OpImageBlockMatchWindowSSDQCOM = 4500,
2057 OpImageBlockMatchWindowSADQCOM = 4501,
2058 OpImageBlockMatchGatherSSDQCOM = 4502,
2059 OpImageBlockMatchGatherSADQCOM = 4503,
2060 OpGroupIAddNonUniformAMD = 5000,
2061 OpGroupFAddNonUniformAMD = 5001,
2062 OpGroupFMinNonUniformAMD = 5002,
2063 OpGroupUMinNonUniformAMD = 5003,
2064 OpGroupSMinNonUniformAMD = 5004,
2065 OpGroupFMaxNonUniformAMD = 5005,
2066 OpGroupUMaxNonUniformAMD = 5006,
2067 OpGroupSMaxNonUniformAMD = 5007,
2068 OpFragmentMaskFetchAMD = 5011,
2069 OpFragmentFetchAMD = 5012,
2070 OpReadClockKHR = 5056,
2071 OpAllocateNodePayloadsAMDX = 5074,
2072 OpEnqueueNodePayloadsAMDX = 5075,
2073 OpTypeNodePayloadArrayAMDX = 5076,
2074 OpFinishWritingNodePayloadAMDX = 5078,
2075 OpNodePayloadArrayLengthAMDX = 5090,
2076 OpIsNodePayloadValidAMDX = 5101,
2077 OpConstantStringAMDX = 5103,
2078 OpSpecConstantStringAMDX = 5104,
2079 OpGroupNonUniformQuadAllKHR = 5110,
2080 OpGroupNonUniformQuadAnyKHR = 5111,
2081 OpHitObjectRecordHitMotionNV = 5249,
2082 OpHitObjectRecordHitWithIndexMotionNV = 5250,
2083 OpHitObjectRecordMissMotionNV = 5251,
2084 OpHitObjectGetWorldToObjectNV = 5252,
2085 OpHitObjectGetObjectToWorldNV = 5253,
2086 OpHitObjectGetObjectRayDirectionNV = 5254,
2087 OpHitObjectGetObjectRayOriginNV = 5255,
2088 OpHitObjectTraceRayMotionNV = 5256,
2089 OpHitObjectGetShaderRecordBufferHandleNV = 5257,
2090 OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
2091 OpHitObjectRecordEmptyNV = 5259,
2092 OpHitObjectTraceRayNV = 5260,
2093 OpHitObjectRecordHitNV = 5261,
2094 OpHitObjectRecordHitWithIndexNV = 5262,
2095 OpHitObjectRecordMissNV = 5263,
2096 OpHitObjectExecuteShaderNV = 5264,
2097 OpHitObjectGetCurrentTimeNV = 5265,
2098 OpHitObjectGetAttributesNV = 5266,
2099 OpHitObjectGetHitKindNV = 5267,
2100 OpHitObjectGetPrimitiveIndexNV = 5268,
2101 OpHitObjectGetGeometryIndexNV = 5269,
2102 OpHitObjectGetInstanceIdNV = 5270,
2103 OpHitObjectGetInstanceCustomIndexNV = 5271,
2104 OpHitObjectGetWorldRayDirectionNV = 5272,
2105 OpHitObjectGetWorldRayOriginNV = 5273,
2106 OpHitObjectGetRayTMaxNV = 5274,
2107 OpHitObjectGetRayTMinNV = 5275,
2108 OpHitObjectIsEmptyNV = 5276,
2109 OpHitObjectIsHitNV = 5277,
2110 OpHitObjectIsMissNV = 5278,
2111 OpReorderThreadWithHitObjectNV = 5279,
2112 OpReorderThreadWithHintNV = 5280,
2113 OpTypeHitObjectNV = 5281,
2114 OpImageSampleFootprintNV = 5283,
2115 OpTypeCooperativeVectorNV = 5288,
2116 OpCooperativeVectorMatrixMulNV = 5289,
2117 OpCooperativeVectorOuterProductAccumulateNV = 5290,
2118 OpCooperativeVectorReduceSumAccumulateNV = 5291,
2119 OpCooperativeVectorMatrixMulAddNV = 5292,
2120 OpCooperativeMatrixConvertNV = 5293,
2121 OpEmitMeshTasksEXT = 5294,
2122 OpSetMeshOutputsEXT = 5295,
2123 OpGroupNonUniformPartitionNV = 5296,
2124 OpWritePackedPrimitiveIndices4x8NV = 5299,
2125 OpFetchMicroTriangleVertexPositionNV = 5300,
2126 OpFetchMicroTriangleVertexBarycentricNV = 5301,
2127 OpCooperativeVectorLoadNV = 5302,
2128 OpCooperativeVectorStoreNV = 5303,
2129 OpReportIntersectionKHR = 5334,
2130 OpIgnoreIntersectionNV = 5335,
2131 OpTerminateRayNV = 5336,
2132 OpTraceNV = 5337,
2133 OpTraceMotionNV = 5338,
2134 OpTraceRayMotionNV = 5339,
2135 OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,
2136 OpTypeAccelerationStructureKHR = 5341,
2137 OpExecuteCallableNV = 5344,
2138 OpRayQueryGetClusterIdNV = 5345,
2139 OpHitObjectGetClusterIdNV = 5346,
2140 OpTypeCooperativeMatrixNV = 5358,
2141 OpCooperativeMatrixLoadNV = 5359,
2142 OpCooperativeMatrixStoreNV = 5360,
2143 OpCooperativeMatrixMulAddNV = 5361,
2144 OpCooperativeMatrixLengthNV = 5362,
2145 OpBeginInvocationInterlockEXT = 5364,
2146 OpEndInvocationInterlockEXT = 5365,
2147 OpCooperativeMatrixReduceNV = 5366,
2148 OpCooperativeMatrixLoadTensorNV = 5367,
2149 OpCooperativeMatrixStoreTensorNV = 5368,
2150 OpCooperativeMatrixPerElementOpNV = 5369,
2151 OpTypeTensorLayoutNV = 5370,
2152 OpTypeTensorViewNV = 5371,
2153 OpCreateTensorLayoutNV = 5372,
2154 OpTensorLayoutSetDimensionNV = 5373,
2155 OpTensorLayoutSetStrideNV = 5374,
2156 OpTensorLayoutSliceNV = 5375,
2157 OpTensorLayoutSetClampValueNV = 5376,
2158 OpCreateTensorViewNV = 5377,
2159 OpTensorViewSetDimensionNV = 5378,
2160 OpTensorViewSetStrideNV = 5379,
2161 OpDemoteToHelperInvocation = 5380,
2162 OpIsHelperInvocationEXT = 5381,
2163 OpTensorViewSetClipNV = 5382,
2164 OpTensorLayoutSetBlockSizeNV = 5384,
2165 OpCooperativeMatrixTransposeNV = 5390,
2166 OpConvertUToImageNV = 5391,
2167 OpConvertUToSamplerNV = 5392,
2168 OpConvertImageToUNV = 5393,
2169 OpConvertSamplerToUNV = 5394,
2170 OpConvertUToSampledImageNV = 5395,
2171 OpConvertSampledImageToUNV = 5396,
2172 OpSamplerImageAddressingModeNV = 5397,
2173 OpRawAccessChainNV = 5398,
2174 OpRayQueryGetIntersectionSpherePositionNV = 5427,
2175 OpRayQueryGetIntersectionSphereRadiusNV = 5428,
2176 OpRayQueryGetIntersectionLSSPositionsNV = 5429,
2177 OpRayQueryGetIntersectionLSSRadiiNV = 5430,
2178 OpRayQueryGetIntersectionLSSHitValueNV = 5431,
2179 OpHitObjectGetSpherePositionNV = 5432,
2180 OpHitObjectGetSphereRadiusNV = 5433,
2181 OpHitObjectGetLSSPositionsNV = 5434,
2182 OpHitObjectGetLSSRadiiNV = 5435,
2183 OpHitObjectIsSphereHitNV = 5436,
2184 OpHitObjectIsLSSHitNV = 5437,
2185 OpRayQueryIsSphereHitNV = 5438,
2186 OpRayQueryIsLSSHitNV = 5439,
2187 OpSubgroupShuffleINTEL = 5571,
2188 OpSubgroupShuffleDownINTEL = 5572,
2189 OpSubgroupShuffleUpINTEL = 5573,
2190 OpSubgroupShuffleXorINTEL = 5574,
2191 OpSubgroupBlockReadINTEL = 5575,
2192 OpSubgroupBlockWriteINTEL = 5576,
2193 OpSubgroupImageBlockReadINTEL = 5577,
2194 OpSubgroupImageBlockWriteINTEL = 5578,
2195 OpSubgroupImageMediaBlockReadINTEL = 5580,
2196 OpSubgroupImageMediaBlockWriteINTEL = 5581,
2197 OpUCountLeadingZerosINTEL = 5585,
2198 OpUCountTrailingZerosINTEL = 5586,
2199 OpAbsISubINTEL = 5587,
2200 OpAbsUSubINTEL = 5588,
2201 OpIAddSatINTEL = 5589,
2202 OpUAddSatINTEL = 5590,
2203 OpIAverageINTEL = 5591,
2204 OpUAverageINTEL = 5592,
2205 OpIAverageRoundedINTEL = 5593,
2206 OpUAverageRoundedINTEL = 5594,
2207 OpISubSatINTEL = 5595,
2208 OpUSubSatINTEL = 5596,
2209 OpIMul32x16INTEL = 5597,
2210 OpUMul32x16INTEL = 5598,
2211 OpAtomicFMinEXT = 5614,
2212 OpAtomicFMaxEXT = 5615,
2213 OpAssumeTrueKHR = 5630,
2214 OpExpectKHR = 5631,
2215 OpDecorateString = 5632,
2216 OpMemberDecorateString = 5633,
2217 OpLoopControlINTEL = 5887,
2218 OpReadPipeBlockingINTEL = 5946,
2219 OpWritePipeBlockingINTEL = 5947,
2220 OpFPGARegINTEL = 5949,
2221 OpRayQueryGetRayTMinKHR = 6016,
2222 OpRayQueryGetRayFlagsKHR = 6017,
2223 OpRayQueryGetIntersectionTKHR = 6018,
2224 OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
2225 OpRayQueryGetIntersectionInstanceIdKHR = 6020,
2226 OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
2227 OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
2228 OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
2229 OpRayQueryGetIntersectionBarycentricsKHR = 6024,
2230 OpRayQueryGetIntersectionFrontFaceKHR = 6025,
2231 OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
2232 OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
2233 OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
2234 OpRayQueryGetWorldRayDirectionKHR = 6029,
2235 OpRayQueryGetWorldRayOriginKHR = 6030,
2236 OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
2237 OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
2238 OpAtomicFAddEXT = 6035,
2239 OpTypeBufferSurfaceINTEL = 6086,
2240 OpTypeStructContinuedINTEL = 6090,
2241 OpConstantCompositeContinuedINTEL = 6091,
2242 OpSpecConstantCompositeContinuedINTEL = 6092,
2243 OpCompositeConstructContinuedINTEL = 6096,
2244 OpConvertFToBF16INTEL = 6116,
2245 OpConvertBF16ToFINTEL = 6117,
2246 OpControlBarrierArriveINTEL = 6142,
2247 OpControlBarrierWaitINTEL = 6143,
2248 OpArithmeticFenceEXT = 6145,
2249 OpTaskSequenceCreateINTEL = 6163,
2250 OpTaskSequenceAsyncINTEL = 6164,
2251 OpTaskSequenceGetINTEL = 6165,
2252 OpTaskSequenceReleaseINTEL = 6166,
2253 OpTypeTaskSequenceINTEL = 6199,
2254 OpSubgroupBlockPrefetchINTEL = 6221,
2255 OpSubgroup2DBlockLoadINTEL = 6231,
2256 OpSubgroup2DBlockLoadTransformINTEL = 6232,
2257 OpSubgroup2DBlockLoadTransposeINTEL = 6233,
2258 OpSubgroup2DBlockPrefetchINTEL = 6234,
2259 OpSubgroup2DBlockStoreINTEL = 6235,
2260 OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
2261 OpBitwiseFunctionINTEL = 6242,
2262 OpGroupIMulKHR = 6401,
2263 OpGroupFMulKHR = 6402,
2264 OpGroupBitwiseAndKHR = 6403,
2265 OpGroupBitwiseOrKHR = 6404,
2266 OpGroupBitwiseXorKHR = 6405,
2267 OpGroupLogicalAndKHR = 6406,
2268 OpGroupLogicalOrKHR = 6407,
2269 OpGroupLogicalXorKHR = 6408,
2270 OpRoundFToTF32INTEL = 6426,
2271 OpMaskedGatherINTEL = 6428,
2272 OpMaskedScatterINTEL = 6429,
2273 OpConvertHandleToImageINTEL = 6529,
2274 OpConvertHandleToSamplerINTEL = 6530,
2275 OpConvertHandleToSampledImageINTEL = 6531,
2276
2277 pub fn Operands(comptime self: Opcode) type {
2278 return switch (self) {
2279 .OpNop => void,
2280 .OpUndef => struct { id_result_type: Id, id_result: Id },
2281 .OpSourceContinued => struct { continued_source: LiteralString },
2282 .OpSource => struct { source_language: SourceLanguage, version: LiteralInteger, file: ?Id = null, source: ?LiteralString = null },
2283 .OpSourceExtension => struct { extension: LiteralString },
2284 .OpName => struct { target: Id, name: LiteralString },
2285 .OpMemberName => struct { type: Id, member: LiteralInteger, name: LiteralString },
2286 .OpString => struct { id_result: Id, string: LiteralString },
2287 .OpLine => struct { file: Id, line: LiteralInteger, column: LiteralInteger },
2288 .OpExtension => struct { name: LiteralString },
2289 .OpExtInstImport => struct { id_result: Id, name: LiteralString },
2290 .OpExtInst => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2291 .OpMemoryModel => struct { addressing_model: AddressingModel, memory_model: MemoryModel },
2292 .OpEntryPoint => struct { execution_model: ExecutionModel, entry_point: Id, name: LiteralString, interface: []const Id = &.{} },
2293 .OpExecutionMode => struct { entry_point: Id, mode: ExecutionMode.Extended },
2294 .OpCapability => struct { capability: Capability },
2295 .OpTypeVoid => struct { id_result: Id },
2296 .OpTypeBool => struct { id_result: Id },
2297 .OpTypeInt => struct { id_result: Id, width: LiteralInteger, signedness: LiteralInteger },
2298 .OpTypeFloat => struct { id_result: Id, width: LiteralInteger, floating_point_encoding: ?FPEncoding = null },
2299 .OpTypeVector => struct { id_result: Id, component_type: Id, component_count: LiteralInteger },
2300 .OpTypeMatrix => struct { id_result: Id, column_type: Id, column_count: LiteralInteger },
2301 .OpTypeImage => struct { id_result: Id, sampled_type: Id, dim: Dim, depth: LiteralInteger, arrayed: LiteralInteger, ms: LiteralInteger, sampled: LiteralInteger, image_format: ImageFormat, access_qualifier: ?AccessQualifier = null },
2302 .OpTypeSampler => struct { id_result: Id },
2303 .OpTypeSampledImage => struct { id_result: Id, image_type: Id },
2304 .OpTypeArray => struct { id_result: Id, element_type: Id, length: Id },
2305 .OpTypeRuntimeArray => struct { id_result: Id, element_type: Id },
2306 .OpTypeStruct => struct { id_result: Id, id_ref: []const Id = &.{} },
2307 .OpTypeOpaque => struct { id_result: Id, literal_string: LiteralString },
2308 .OpTypePointer => struct { id_result: Id, storage_class: StorageClass, type: Id },
2309 .OpTypeFunction => struct { id_result: Id, return_type: Id, id_ref_2: []const Id = &.{} },
2310 .OpTypeEvent => struct { id_result: Id },
2311 .OpTypeDeviceEvent => struct { id_result: Id },
2312 .OpTypeReserveId => struct { id_result: Id },
2313 .OpTypeQueue => struct { id_result: Id },
2314 .OpTypePipe => struct { id_result: Id, qualifier: AccessQualifier },
2315 .OpTypeForwardPointer => struct { pointer_type: Id, storage_class: StorageClass },
2316 .OpConstantTrue => struct { id_result_type: Id, id_result: Id },
2317 .OpConstantFalse => struct { id_result_type: Id, id_result: Id },
2318 .OpConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2319 .OpConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2320 .OpConstantSampler => struct { id_result_type: Id, id_result: Id, sampler_addressing_mode: SamplerAddressingMode, param: LiteralInteger, sampler_filter_mode: SamplerFilterMode },
2321 .OpConstantNull => struct { id_result_type: Id, id_result: Id },
2322 .OpSpecConstantTrue => struct { id_result_type: Id, id_result: Id },
2323 .OpSpecConstantFalse => struct { id_result_type: Id, id_result: Id },
2324 .OpSpecConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2325 .OpSpecConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2326 .OpSpecConstantOp => struct { id_result_type: Id, id_result: Id, opcode: LiteralSpecConstantOpInteger },
2327 .OpFunction => struct { id_result_type: Id, id_result: Id, function_control: FunctionControl, function_type: Id },
2328 .OpFunctionParameter => struct { id_result_type: Id, id_result: Id },
2329 .OpFunctionEnd => void,
2330 .OpFunctionCall => struct { id_result_type: Id, id_result: Id, function: Id, id_ref_3: []const Id = &.{} },
2331 .OpVariable => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, initializer: ?Id = null },
2332 .OpImageTexelPointer => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, sample: Id },
2333 .OpLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_access: ?MemoryAccess.Extended = null },
2334 .OpStore => struct { pointer: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2335 .OpCopyMemory => struct { target: Id, source: Id, memory_access_2: ?MemoryAccess.Extended = null, memory_access_3: ?MemoryAccess.Extended = null },
2336 .OpCopyMemorySized => struct { target: Id, source: Id, size: Id, memory_access_3: ?MemoryAccess.Extended = null, memory_access_4: ?MemoryAccess.Extended = null },
2337 .OpAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2338 .OpInBoundsAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2339 .OpPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2340 .OpArrayLength => struct { id_result_type: Id, id_result: Id, structure: Id, array_member: LiteralInteger },
2341 .OpGenericPtrMemSemantics => struct { id_result_type: Id, id_result: Id, pointer: Id },
2342 .OpInBoundsPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2343 .OpDecorate => struct { target: Id, decoration: Decoration.Extended },
2344 .OpMemberDecorate => struct { structure_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2345 .OpDecorationGroup => struct { id_result: Id },
2346 .OpGroupDecorate => struct { decoration_group: Id, targets: []const Id = &.{} },
2347 .OpGroupMemberDecorate => struct { decoration_group: Id, targets: []const PairIdRefLiteralInteger = &.{} },
2348 .OpVectorExtractDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, index: Id },
2349 .OpVectorInsertDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, component: Id, index: Id },
2350 .OpVectorShuffle => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, components: []const LiteralInteger = &.{} },
2351 .OpCompositeConstruct => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2352 .OpCompositeExtract => struct { id_result_type: Id, id_result: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2353 .OpCompositeInsert => struct { id_result_type: Id, id_result: Id, object: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2354 .OpCopyObject => struct { id_result_type: Id, id_result: Id, operand: Id },
2355 .OpTranspose => struct { id_result_type: Id, id_result: Id, matrix: Id },
2356 .OpSampledImage => struct { id_result_type: Id, id_result: Id, image: Id, sampler: Id },
2357 .OpImageSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2358 .OpImageSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2359 .OpImageSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2360 .OpImageSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2361 .OpImageSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2362 .OpImageSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2363 .OpImageSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2364 .OpImageSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2365 .OpImageFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2366 .OpImageGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2367 .OpImageDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2368 .OpImageRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2369 .OpImageWrite => struct { image: Id, coordinate: Id, texel: Id, image_operands: ?ImageOperands.Extended = null },
2370 .OpImage => struct { id_result_type: Id, id_result: Id, sampled_image: Id },
2371 .OpImageQueryFormat => struct { id_result_type: Id, id_result: Id, image: Id },
2372 .OpImageQueryOrder => struct { id_result_type: Id, id_result: Id, image: Id },
2373 .OpImageQuerySizeLod => struct { id_result_type: Id, id_result: Id, image: Id, level_of_detail: Id },
2374 .OpImageQuerySize => struct { id_result_type: Id, id_result: Id, image: Id },
2375 .OpImageQueryLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id },
2376 .OpImageQueryLevels => struct { id_result_type: Id, id_result: Id, image: Id },
2377 .OpImageQuerySamples => struct { id_result_type: Id, id_result: Id, image: Id },
2378 .OpConvertFToU => struct { id_result_type: Id, id_result: Id, float_value: Id },
2379 .OpConvertFToS => struct { id_result_type: Id, id_result: Id, float_value: Id },
2380 .OpConvertSToF => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2381 .OpConvertUToF => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2382 .OpUConvert => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2383 .OpSConvert => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2384 .OpFConvert => struct { id_result_type: Id, id_result: Id, float_value: Id },
2385 .OpQuantizeToF16 => struct { id_result_type: Id, id_result: Id, value: Id },
2386 .OpConvertPtrToU => struct { id_result_type: Id, id_result: Id, pointer: Id },
2387 .OpSatConvertSToU => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2388 .OpSatConvertUToS => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2389 .OpConvertUToPtr => struct { id_result_type: Id, id_result: Id, integer_value: Id },
2390 .OpPtrCastToGeneric => struct { id_result_type: Id, id_result: Id, pointer: Id },
2391 .OpGenericCastToPtr => struct { id_result_type: Id, id_result: Id, pointer: Id },
2392 .OpGenericCastToPtrExplicit => struct { id_result_type: Id, id_result: Id, pointer: Id, storage: StorageClass },
2393 .OpBitcast => struct { id_result_type: Id, id_result: Id, operand: Id },
2394 .OpSNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2395 .OpFNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2396 .OpIAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2397 .OpFAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2398 .OpISub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2399 .OpFSub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2400 .OpIMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2401 .OpFMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2402 .OpUDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2403 .OpSDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2404 .OpFDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2405 .OpUMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2406 .OpSRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2407 .OpSMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2408 .OpFRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2409 .OpFMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2410 .OpVectorTimesScalar => struct { id_result_type: Id, id_result: Id, vector: Id, scalar: Id },
2411 .OpMatrixTimesScalar => struct { id_result_type: Id, id_result: Id, matrix: Id, scalar: Id },
2412 .OpVectorTimesMatrix => struct { id_result_type: Id, id_result: Id, vector: Id, matrix: Id },
2413 .OpMatrixTimesVector => struct { id_result_type: Id, id_result: Id, matrix: Id, vector: Id },
2414 .OpMatrixTimesMatrix => struct { id_result_type: Id, id_result: Id, left_matrix: Id, right_matrix: Id },
2415 .OpOuterProduct => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2416 .OpDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2417 .OpIAddCarry => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2418 .OpISubBorrow => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2419 .OpUMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2420 .OpSMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2421 .OpAny => struct { id_result_type: Id, id_result: Id, vector: Id },
2422 .OpAll => struct { id_result_type: Id, id_result: Id, vector: Id },
2423 .OpIsNan => struct { id_result_type: Id, id_result: Id, x: Id },
2424 .OpIsInf => struct { id_result_type: Id, id_result: Id, x: Id },
2425 .OpIsFinite => struct { id_result_type: Id, id_result: Id, x: Id },
2426 .OpIsNormal => struct { id_result_type: Id, id_result: Id, x: Id },
2427 .OpSignBitSet => struct { id_result_type: Id, id_result: Id, x: Id },
2428 .OpLessOrGreater => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2429 .OpOrdered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2430 .OpUnordered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2431 .OpLogicalEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2432 .OpLogicalNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2433 .OpLogicalOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2434 .OpLogicalAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2435 .OpLogicalNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2436 .OpSelect => struct { id_result_type: Id, id_result: Id, condition: Id, object_1: Id, object_2: Id },
2437 .OpIEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2438 .OpINotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2439 .OpUGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2440 .OpSGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2441 .OpUGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2442 .OpSGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2443 .OpULessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2444 .OpSLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2445 .OpULessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2446 .OpSLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2447 .OpFOrdEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2448 .OpFUnordEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2449 .OpFOrdNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2450 .OpFUnordNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2451 .OpFOrdLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2452 .OpFUnordLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2453 .OpFOrdGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2454 .OpFUnordGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2455 .OpFOrdLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2456 .OpFUnordLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2457 .OpFOrdGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2458 .OpFUnordGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2459 .OpShiftRightLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2460 .OpShiftRightArithmetic => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2461 .OpShiftLeftLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2462 .OpBitwiseOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2463 .OpBitwiseXor => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2464 .OpBitwiseAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2465 .OpNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2466 .OpBitFieldInsert => struct { id_result_type: Id, id_result: Id, base: Id, insert: Id, offset: Id, count: Id },
2467 .OpBitFieldSExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2468 .OpBitFieldUExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2469 .OpBitReverse => struct { id_result_type: Id, id_result: Id, base: Id },
2470 .OpBitCount => struct { id_result_type: Id, id_result: Id, base: Id },
2471 .OpDPdx => struct { id_result_type: Id, id_result: Id, p: Id },
2472 .OpDPdy => struct { id_result_type: Id, id_result: Id, p: Id },
2473 .OpFwidth => struct { id_result_type: Id, id_result: Id, p: Id },
2474 .OpDPdxFine => struct { id_result_type: Id, id_result: Id, p: Id },
2475 .OpDPdyFine => struct { id_result_type: Id, id_result: Id, p: Id },
2476 .OpFwidthFine => struct { id_result_type: Id, id_result: Id, p: Id },
2477 .OpDPdxCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2478 .OpDPdyCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2479 .OpFwidthCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2480 .OpEmitVertex => void,
2481 .OpEndPrimitive => void,
2482 .OpEmitStreamVertex => struct { stream: Id },
2483 .OpEndStreamPrimitive => struct { stream: Id },
2484 .OpControlBarrier => struct { execution: Id, memory: Id, semantics: Id },
2485 .OpMemoryBarrier => struct { memory: Id, semantics: Id },
2486 .OpAtomicLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2487 .OpAtomicStore => struct { pointer: Id, memory: Id, semantics: Id, value: Id },
2488 .OpAtomicExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2489 .OpAtomicCompareExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2490 .OpAtomicCompareExchangeWeak => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2491 .OpAtomicIIncrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2492 .OpAtomicIDecrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2493 .OpAtomicIAdd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2494 .OpAtomicISub => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2495 .OpAtomicSMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2496 .OpAtomicUMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2497 .OpAtomicSMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2498 .OpAtomicUMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2499 .OpAtomicAnd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2500 .OpAtomicOr => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2501 .OpAtomicXor => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2502 .OpPhi => struct { id_result_type: Id, id_result: Id, pair_id_ref_id_ref: []const PairIdRefIdRef = &.{} },
2503 .OpLoopMerge => struct { merge_block: Id, continue_target: Id, loop_control: LoopControl.Extended },
2504 .OpSelectionMerge => struct { merge_block: Id, selection_control: SelectionControl },
2505 .OpLabel => struct { id_result: Id },
2506 .OpBranch => struct { target_label: Id },
2507 .OpBranchConditional => struct { condition: Id, true_label: Id, false_label: Id, branch_weights: []const LiteralInteger = &.{} },
2508 .OpSwitch => struct { selector: Id, default: Id, target: []const PairLiteralIntegerIdRef = &.{} },
2509 .OpKill => void,
2510 .OpReturn => void,
2511 .OpReturnValue => struct { value: Id },
2512 .OpUnreachable => void,
2513 .OpLifetimeStart => struct { pointer: Id, size: LiteralInteger },
2514 .OpLifetimeStop => struct { pointer: Id, size: LiteralInteger },
2515 .OpGroupAsyncCopy => struct { id_result_type: Id, id_result: Id, execution: Id, destination: Id, source: Id, num_elements: Id, stride: Id, event: Id },
2516 .OpGroupWaitEvents => struct { execution: Id, num_events: Id, events_list: Id },
2517 .OpGroupAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2518 .OpGroupAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2519 .OpGroupBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, local_id: Id },
2520 .OpGroupIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2521 .OpGroupFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2522 .OpGroupFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2523 .OpGroupUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2524 .OpGroupSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2525 .OpGroupFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2526 .OpGroupUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2527 .OpGroupSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2528 .OpReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2529 .OpWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2530 .OpReservedReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2531 .OpReservedWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2532 .OpReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2533 .OpReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2534 .OpCommitReadPipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2535 .OpCommitWritePipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2536 .OpIsValidReserveId => struct { id_result_type: Id, id_result: Id, reserve_id: Id },
2537 .OpGetNumPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2538 .OpGetMaxPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2539 .OpGroupReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2540 .OpGroupReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2541 .OpGroupCommitReadPipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2542 .OpGroupCommitWritePipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2543 .OpEnqueueMarker => struct { id_result_type: Id, id_result: Id, queue: Id, num_events: Id, wait_events: Id, ret_event: Id },
2544 .OpEnqueueKernel => struct { id_result_type: Id, id_result: Id, queue: Id, flags: Id, nd_range: Id, num_events: Id, wait_events: Id, ret_event: Id, invoke: Id, param: Id, param_size: Id, param_align: Id, local_size: []const Id = &.{} },
2545 .OpGetKernelNDrangeSubGroupCount => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2546 .OpGetKernelNDrangeMaxSubGroupSize => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2547 .OpGetKernelWorkGroupSize => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2548 .OpGetKernelPreferredWorkGroupSizeMultiple => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2549 .OpRetainEvent => struct { event: Id },
2550 .OpReleaseEvent => struct { event: Id },
2551 .OpCreateUserEvent => struct { id_result_type: Id, id_result: Id },
2552 .OpIsValidEvent => struct { id_result_type: Id, id_result: Id, event: Id },
2553 .OpSetUserEventStatus => struct { event: Id, status: Id },
2554 .OpCaptureEventProfilingInfo => struct { event: Id, profiling_info: Id, value: Id },
2555 .OpGetDefaultQueue => struct { id_result_type: Id, id_result: Id },
2556 .OpBuildNDRange => struct { id_result_type: Id, id_result: Id, global_work_size: Id, local_work_size: Id, global_work_offset: Id },
2557 .OpImageSparseSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2558 .OpImageSparseSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2559 .OpImageSparseSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2560 .OpImageSparseSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2561 .OpImageSparseSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2562 .OpImageSparseSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2563 .OpImageSparseSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2564 .OpImageSparseSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2565 .OpImageSparseFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2566 .OpImageSparseGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2567 .OpImageSparseDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2568 .OpImageSparseTexelsResident => struct { id_result_type: Id, id_result: Id, resident_code: Id },
2569 .OpNoLine => void,
2570 .OpAtomicFlagTestAndSet => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2571 .OpAtomicFlagClear => struct { pointer: Id, memory: Id, semantics: Id },
2572 .OpImageSparseRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2573 .OpSizeOf => struct { id_result_type: Id, id_result: Id, pointer: Id },
2574 .OpTypePipeStorage => struct { id_result: Id },
2575 .OpConstantPipeStorage => struct { id_result_type: Id, id_result: Id, packet_size: LiteralInteger, packet_alignment: LiteralInteger, capacity: LiteralInteger },
2576 .OpCreatePipeFromPipeStorage => struct { id_result_type: Id, id_result: Id, pipe_storage: Id },
2577 .OpGetKernelLocalSizeForSubgroupCount => struct { id_result_type: Id, id_result: Id, subgroup_count: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2578 .OpGetKernelMaxNumSubgroups => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2579 .OpTypeNamedBarrier => struct { id_result: Id },
2580 .OpNamedBarrierInitialize => struct { id_result_type: Id, id_result: Id, subgroup_count: Id },
2581 .OpMemoryNamedBarrier => struct { named_barrier: Id, memory: Id, semantics: Id },
2582 .OpModuleProcessed => struct { process: LiteralString },
2583 .OpExecutionModeId => struct { entry_point: Id, mode: ExecutionMode.Extended },
2584 .OpDecorateId => struct { target: Id, decoration: Decoration.Extended },
2585 .OpGroupNonUniformElect => struct { id_result_type: Id, id_result: Id, execution: Id },
2586 .OpGroupNonUniformAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2587 .OpGroupNonUniformAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2588 .OpGroupNonUniformAllEqual => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2589 .OpGroupNonUniformBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2590 .OpGroupNonUniformBroadcastFirst => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2591 .OpGroupNonUniformBallot => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2592 .OpGroupNonUniformInverseBallot => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2593 .OpGroupNonUniformBallotBitExtract => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2594 .OpGroupNonUniformBallotBitCount => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id },
2595 .OpGroupNonUniformBallotFindLSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2596 .OpGroupNonUniformBallotFindMSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2597 .OpGroupNonUniformShuffle => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2598 .OpGroupNonUniformShuffleXor => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, mask: Id },
2599 .OpGroupNonUniformShuffleUp => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2600 .OpGroupNonUniformShuffleDown => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2601 .OpGroupNonUniformIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2602 .OpGroupNonUniformFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2603 .OpGroupNonUniformIMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2604 .OpGroupNonUniformFMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2605 .OpGroupNonUniformSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2606 .OpGroupNonUniformUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2607 .OpGroupNonUniformFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2608 .OpGroupNonUniformSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2609 .OpGroupNonUniformUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2610 .OpGroupNonUniformFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2611 .OpGroupNonUniformBitwiseAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2612 .OpGroupNonUniformBitwiseOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2613 .OpGroupNonUniformBitwiseXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2614 .OpGroupNonUniformLogicalAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2615 .OpGroupNonUniformLogicalOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2616 .OpGroupNonUniformLogicalXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2617 .OpGroupNonUniformQuadBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2618 .OpGroupNonUniformQuadSwap => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, direction: Id },
2619 .OpCopyLogical => struct { id_result_type: Id, id_result: Id, operand: Id },
2620 .OpPtrEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2621 .OpPtrNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2622 .OpPtrDiff => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2623 .OpColorAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, attachment: Id, sample: ?Id = null },
2624 .OpDepthAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2625 .OpStencilAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2626 .OpTypeTensorARM => struct { id_result: Id, element_type: Id, rank: ?Id = null, shape: ?Id = null },
2627 .OpTensorReadARM => struct { id_result_type: Id, id_result: Id, tensor: Id, coordinates: Id, tensor_operands: ?TensorOperands.Extended = null },
2628 .OpTensorWriteARM => struct { tensor: Id, coordinates: Id, object: Id, tensor_operands: ?TensorOperands.Extended = null },
2629 .OpTensorQuerySizeARM => struct { id_result_type: Id, id_result: Id, tensor: Id, dimension: Id },
2630 .OpGraphConstantARM => struct { id_result_type: Id, id_result: Id, graph_constant_id: LiteralInteger },
2631 .OpGraphEntryPointARM => struct { graph: Id, name: LiteralString, interface: []const Id = &.{} },
2632 .OpGraphARM => struct { id_result_type: Id, id_result: Id },
2633 .OpGraphInputARM => struct { id_result_type: Id, id_result: Id, input_index: Id, element_index: []const Id = &.{} },
2634 .OpGraphSetOutputARM => struct { value: Id, output_index: Id, element_index: []const Id = &.{} },
2635 .OpGraphEndARM => void,
2636 .OpTypeGraphARM => struct { id_result: Id, num_inputs: LiteralInteger, in_out_types: []const Id = &.{} },
2637 .OpTerminateInvocation => void,
2638 .OpTypeUntypedPointerKHR => struct { id_result: Id, storage_class: StorageClass },
2639 .OpUntypedVariableKHR => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, data_type: ?Id = null, initializer: ?Id = null },
2640 .OpUntypedAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2641 .OpUntypedInBoundsAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2642 .OpSubgroupBallotKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2643 .OpSubgroupFirstInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id },
2644 .OpUntypedPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2645 .OpUntypedInBoundsPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2646 .OpUntypedArrayLengthKHR => struct { id_result_type: Id, id_result: Id, structure: Id, pointer: Id, array_member: LiteralInteger },
2647 .OpUntypedPrefetchKHR => struct { pointer_type: Id, num_bytes: Id, rw: ?Id = null, locality: ?Id = null, cache_type: ?Id = null },
2648 .OpSubgroupAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2649 .OpSubgroupAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2650 .OpSubgroupAllEqualKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2651 .OpGroupNonUniformRotateKHR => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id, cluster_size: ?Id = null },
2652 .OpSubgroupReadInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id, index: Id },
2653 .OpExtInstWithForwardRefsKHR => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2654 .OpTraceRayKHR => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, payload: Id },
2655 .OpExecuteCallableKHR => struct { sbt_index: Id, callable_data: Id },
2656 .OpConvertUToAccelerationStructureKHR => struct { id_result_type: Id, id_result: Id, accel: Id },
2657 .OpIgnoreIntersectionKHR => void,
2658 .OpTerminateRayKHR => void,
2659 .OpSDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2660 .OpUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2661 .OpSUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2662 .OpSDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2663 .OpUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2664 .OpSUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2665 .OpTypeCooperativeMatrixKHR => struct { id_result: Id, component_type: Id, scope: Id, rows: Id, columns: Id, use: Id },
2666 .OpCooperativeMatrixLoadKHR => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2667 .OpCooperativeMatrixStoreKHR => struct { pointer: Id, object: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2668 .OpCooperativeMatrixMulAddKHR => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2669 .OpCooperativeMatrixLengthKHR => struct { id_result_type: Id, id_result: Id, type: Id },
2670 .OpConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2671 .OpSpecConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2672 .OpCompositeConstructReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2673 .OpTypeRayQueryKHR => struct { id_result: Id },
2674 .OpRayQueryInitializeKHR => struct { ray_query: Id, accel: Id, ray_flags: Id, cull_mask: Id, ray_origin: Id, ray_t_min: Id, ray_direction: Id, ray_t_max: Id },
2675 .OpRayQueryTerminateKHR => struct { ray_query: Id },
2676 .OpRayQueryGenerateIntersectionKHR => struct { ray_query: Id, hit_t: Id },
2677 .OpRayQueryConfirmIntersectionKHR => struct { ray_query: Id },
2678 .OpRayQueryProceedKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2679 .OpRayQueryGetIntersectionTypeKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2680 .OpImageSampleWeightedQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, weights: Id },
2681 .OpImageBoxFilterQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, box_size: Id },
2682 .OpImageBlockMatchSSDQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2683 .OpImageBlockMatchSADQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2684 .OpImageBlockMatchWindowSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2685 .OpImageBlockMatchWindowSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2686 .OpImageBlockMatchGatherSSDQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2687 .OpImageBlockMatchGatherSADQCOM => struct { id_result_type: Id, id_result: Id, target_sampled_image: Id, target_coordinates: Id, reference_sampled_image: Id, reference_coordinates: Id, block_size: Id },
2688 .OpGroupIAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2689 .OpGroupFAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2690 .OpGroupFMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2691 .OpGroupUMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2692 .OpGroupSMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2693 .OpGroupFMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2694 .OpGroupUMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2695 .OpGroupSMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2696 .OpFragmentMaskFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2697 .OpFragmentFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, fragment_index: Id },
2698 .OpReadClockKHR => struct { id_result_type: Id, id_result: Id, scope: Id },
2699 .OpAllocateNodePayloadsAMDX => struct { id_result_type: Id, id_result: Id, visibility: Id, payload_count: Id, node_index: Id },
2700 .OpEnqueueNodePayloadsAMDX => struct { payload_array: Id },
2701 .OpTypeNodePayloadArrayAMDX => struct { id_result: Id, payload_type: Id },
2702 .OpFinishWritingNodePayloadAMDX => struct { id_result_type: Id, id_result: Id, payload: Id },
2703 .OpNodePayloadArrayLengthAMDX => struct { id_result_type: Id, id_result: Id, payload_array: Id },
2704 .OpIsNodePayloadValidAMDX => struct { id_result_type: Id, id_result: Id, payload_type: Id, node_index: Id },
2705 .OpConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2706 .OpSpecConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2707 .OpGroupNonUniformQuadAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2708 .OpGroupNonUniformQuadAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2709 .OpHitObjectRecordHitMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2710 .OpHitObjectRecordHitWithIndexMotionNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id, hit_object_attributes: Id },
2711 .OpHitObjectRecordMissMotionNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id },
2712 .OpHitObjectGetWorldToObjectNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2713 .OpHitObjectGetObjectToWorldNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2714 .OpHitObjectGetObjectRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2715 .OpHitObjectGetObjectRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2716 .OpHitObjectTraceRayMotionNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, time: Id, payload: Id },
2717 .OpHitObjectGetShaderRecordBufferHandleNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2718 .OpHitObjectGetShaderBindingTableRecordIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2719 .OpHitObjectRecordEmptyNV => struct { hit_object: Id },
2720 .OpHitObjectTraceRayNV => struct { hit_object: Id, acceleration_structure: Id, ray_flags: Id, cullmask: Id, sbt_record_offset: Id, sbt_record_stride: Id, miss_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, payload: Id },
2721 .OpHitObjectRecordHitNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_offset: Id, sbt_record_stride: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2722 .OpHitObjectRecordHitWithIndexNV => struct { hit_object: Id, acceleration_structure: Id, instance_id: Id, primitive_id: Id, geometry_index: Id, hit_kind: Id, sbt_record_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, hit_object_attributes: Id },
2723 .OpHitObjectRecordMissNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id },
2724 .OpHitObjectExecuteShaderNV => struct { hit_object: Id, payload: Id },
2725 .OpHitObjectGetCurrentTimeNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2726 .OpHitObjectGetAttributesNV => struct { hit_object: Id, hit_object_attribute: Id },
2727 .OpHitObjectGetHitKindNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2728 .OpHitObjectGetPrimitiveIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2729 .OpHitObjectGetGeometryIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2730 .OpHitObjectGetInstanceIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2731 .OpHitObjectGetInstanceCustomIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2732 .OpHitObjectGetWorldRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2733 .OpHitObjectGetWorldRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2734 .OpHitObjectGetRayTMaxNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2735 .OpHitObjectGetRayTMinNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2736 .OpHitObjectIsEmptyNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2737 .OpHitObjectIsHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2738 .OpHitObjectIsMissNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2739 .OpReorderThreadWithHitObjectNV => struct { hit_object: Id, hint: ?Id = null, bits: ?Id = null },
2740 .OpReorderThreadWithHintNV => struct { hint: Id, bits: Id },
2741 .OpTypeHitObjectNV => struct { id_result: Id },
2742 .OpImageSampleFootprintNV => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, granularity: Id, coarse: Id, image_operands: ?ImageOperands.Extended = null },
2743 .OpTypeCooperativeVectorNV => struct { id_result: Id, component_type: Id, component_count: Id },
2744 .OpCooperativeVectorMatrixMulNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2745 .OpCooperativeVectorOuterProductAccumulateNV => struct { pointer: Id, offset: Id, a: Id, b: Id, memory_layout: Id, matrix_interpretation: Id, matrix_stride: ?Id = null },
2746 .OpCooperativeVectorReduceSumAccumulateNV => struct { pointer: Id, offset: Id, v: Id },
2747 .OpCooperativeVectorMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, input: Id, input_interpretation: Id, matrix: Id, matrix_offset: Id, matrix_interpretation: Id, bias: Id, bias_offset: Id, bias_interpretation: Id, m: Id, k: Id, memory_layout: Id, transpose: Id, matrix_stride: ?Id = null, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2748 .OpCooperativeMatrixConvertNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2749 .OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },
2750 .OpSetMeshOutputsEXT => struct { vertex_count: Id, primitive_count: Id },
2751 .OpGroupNonUniformPartitionNV => struct { id_result_type: Id, id_result: Id, value: Id },
2752 .OpWritePackedPrimitiveIndices4x8NV => struct { index_offset: Id, packed_indices: Id },
2753 .OpFetchMicroTriangleVertexPositionNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2754 .OpFetchMicroTriangleVertexBarycentricNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2755 .OpCooperativeVectorLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, offset: Id, memory_access: ?MemoryAccess.Extended = null },
2756 .OpCooperativeVectorStoreNV => struct { pointer: Id, offset: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2757 .OpReportIntersectionKHR => struct { id_result_type: Id, id_result: Id, hit: Id, hit_kind: Id },
2758 .OpIgnoreIntersectionNV => void,
2759 .OpTerminateRayNV => void,
2760 .OpTraceNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, payload_id: Id },
2761 .OpTraceMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload_id: Id },
2762 .OpTraceRayMotionNV => struct { accel: Id, ray_flags: Id, cull_mask: Id, sbt_offset: Id, sbt_stride: Id, miss_index: Id, ray_origin: Id, ray_tmin: Id, ray_direction: Id, ray_tmax: Id, time: Id, payload: Id },
2763 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2764 .OpTypeAccelerationStructureKHR => struct { id_result: Id },
2765 .OpExecuteCallableNV => struct { sbt_index: Id, callable_data_id: Id },
2766 .OpRayQueryGetClusterIdNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2767 .OpHitObjectGetClusterIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2768 .OpTypeCooperativeMatrixNV => struct { id_result: Id, component_type: Id, execution: Id, rows: Id, columns: Id },
2769 .OpCooperativeMatrixLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2770 .OpCooperativeMatrixStoreNV => struct { pointer: Id, object: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2771 .OpCooperativeMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id },
2772 .OpCooperativeMatrixLengthNV => struct { id_result_type: Id, id_result: Id, type: Id },
2773 .OpBeginInvocationInterlockEXT => void,
2774 .OpEndInvocationInterlockEXT => void,
2775 .OpCooperativeMatrixReduceNV => struct { id_result_type: Id, id_result: Id, matrix: Id, reduce: CooperativeMatrixReduce, combine_func: Id },
2776 .OpCooperativeMatrixLoadTensorNV => struct { id_result_type: Id, id_result: Id, pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2777 .OpCooperativeMatrixStoreTensorNV => struct { pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2778 .OpCooperativeMatrixPerElementOpNV => struct { id_result_type: Id, id_result: Id, matrix: Id, func: Id, operands: []const Id = &.{} },
2779 .OpTypeTensorLayoutNV => struct { id_result: Id, dim: Id, clamp_mode: Id },
2780 .OpTypeTensorViewNV => struct { id_result: Id, dim: Id, has_dimensions: Id, p: []const Id = &.{} },
2781 .OpCreateTensorLayoutNV => struct { id_result_type: Id, id_result: Id },
2782 .OpTensorLayoutSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, dim: []const Id = &.{} },
2783 .OpTensorLayoutSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, stride: []const Id = &.{} },
2784 .OpTensorLayoutSliceNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, operands: []const Id = &.{} },
2785 .OpTensorLayoutSetClampValueNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, value: Id },
2786 .OpCreateTensorViewNV => struct { id_result_type: Id, id_result: Id },
2787 .OpTensorViewSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, dim: []const Id = &.{} },
2788 .OpTensorViewSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, stride: []const Id = &.{} },
2789 .OpDemoteToHelperInvocation => void,
2790 .OpIsHelperInvocationEXT => struct { id_result_type: Id, id_result: Id },
2791 .OpTensorViewSetClipNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, clip_row_offset: Id, clip_row_span: Id, clip_col_offset: Id, clip_col_span: Id },
2792 .OpTensorLayoutSetBlockSizeNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, block_size: []const Id = &.{} },
2793 .OpCooperativeMatrixTransposeNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2794 .OpConvertUToImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2795 .OpConvertUToSamplerNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2796 .OpConvertImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2797 .OpConvertSamplerToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2798 .OpConvertUToSampledImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2799 .OpConvertSampledImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2800 .OpSamplerImageAddressingModeNV => struct { bit_width: LiteralInteger },
2801 .OpRawAccessChainNV => struct { id_result_type: Id, id_result: Id, base: Id, byte_stride: Id, element_index: Id, byte_offset: Id, raw_access_chain_operands: ?RawAccessChainOperands = null },
2802 .OpRayQueryGetIntersectionSpherePositionNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2803 .OpRayQueryGetIntersectionSphereRadiusNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2804 .OpRayQueryGetIntersectionLSSPositionsNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2805 .OpRayQueryGetIntersectionLSSRadiiNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2806 .OpRayQueryGetIntersectionLSSHitValueNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2807 .OpHitObjectGetSpherePositionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2808 .OpHitObjectGetSphereRadiusNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2809 .OpHitObjectGetLSSPositionsNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2810 .OpHitObjectGetLSSRadiiNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2811 .OpHitObjectIsSphereHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2812 .OpHitObjectIsLSSHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2813 .OpRayQueryIsSphereHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2814 .OpRayQueryIsLSSHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2815 .OpSubgroupShuffleINTEL => struct { id_result_type: Id, id_result: Id, data: Id, invocation_id: Id },
2816 .OpSubgroupShuffleDownINTEL => struct { id_result_type: Id, id_result: Id, current: Id, next: Id, delta: Id },
2817 .OpSubgroupShuffleUpINTEL => struct { id_result_type: Id, id_result: Id, previous: Id, current: Id, delta: Id },
2818 .OpSubgroupShuffleXorINTEL => struct { id_result_type: Id, id_result: Id, data: Id, value: Id },
2819 .OpSubgroupBlockReadINTEL => struct { id_result_type: Id, id_result: Id, ptr: Id },
2820 .OpSubgroupBlockWriteINTEL => struct { ptr: Id, data: Id },
2821 .OpSubgroupImageBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2822 .OpSubgroupImageBlockWriteINTEL => struct { image: Id, coordinate: Id, data: Id },
2823 .OpSubgroupImageMediaBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, width: Id, height: Id },
2824 .OpSubgroupImageMediaBlockWriteINTEL => struct { image: Id, coordinate: Id, width: Id, height: Id, data: Id },
2825 .OpUCountLeadingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2826 .OpUCountTrailingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2827 .OpAbsISubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2828 .OpAbsUSubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2829 .OpIAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2830 .OpUAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2831 .OpIAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2832 .OpUAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2833 .OpIAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2834 .OpUAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2835 .OpISubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2836 .OpUSubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2837 .OpIMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2838 .OpUMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2839 .OpAtomicFMinEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2840 .OpAtomicFMaxEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2841 .OpAssumeTrueKHR => struct { condition: Id },
2842 .OpExpectKHR => struct { id_result_type: Id, id_result: Id, value: Id, expected_value: Id },
2843 .OpDecorateString => struct { target: Id, decoration: Decoration.Extended },
2844 .OpMemberDecorateString => struct { struct_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2845 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },
2846 .OpReadPipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2847 .OpWritePipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2848 .OpFPGARegINTEL => struct { id_result_type: Id, id_result: Id, input: Id },
2849 .OpRayQueryGetRayTMinKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2850 .OpRayQueryGetRayFlagsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2851 .OpRayQueryGetIntersectionTKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2852 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2853 .OpRayQueryGetIntersectionInstanceIdKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2854 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2855 .OpRayQueryGetIntersectionGeometryIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2856 .OpRayQueryGetIntersectionPrimitiveIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2857 .OpRayQueryGetIntersectionBarycentricsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2858 .OpRayQueryGetIntersectionFrontFaceKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2859 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2860 .OpRayQueryGetIntersectionObjectRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2861 .OpRayQueryGetIntersectionObjectRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2862 .OpRayQueryGetWorldRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2863 .OpRayQueryGetWorldRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2864 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2865 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2866 .OpAtomicFAddEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2867 .OpTypeBufferSurfaceINTEL => struct { id_result: Id, access_qualifier: AccessQualifier },
2868 .OpTypeStructContinuedINTEL => struct { id_ref: []const Id = &.{} },
2869 .OpConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2870 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2871 .OpCompositeConstructContinuedINTEL => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2872 .OpConvertFToBF16INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2873 .OpConvertBF16ToFINTEL => struct { id_result_type: Id, id_result: Id, b_float16_value: Id },
2874 .OpControlBarrierArriveINTEL => struct { execution: Id, memory: Id, semantics: Id },
2875 .OpControlBarrierWaitINTEL => struct { execution: Id, memory: Id, semantics: Id },
2876 .OpArithmeticFenceEXT => struct { id_result_type: Id, id_result: Id, target: Id },
2877 .OpTaskSequenceCreateINTEL => struct { id_result_type: Id, id_result: Id, function: Id, pipelined: LiteralInteger, use_stall_enable_clusters: LiteralInteger, get_capacity: LiteralInteger, async_capacity: LiteralInteger },
2878 .OpTaskSequenceAsyncINTEL => struct { sequence: Id, arguments: []const Id = &.{} },
2879 .OpTaskSequenceGetINTEL => struct { id_result_type: Id, id_result: Id, sequence: Id },
2880 .OpTaskSequenceReleaseINTEL => struct { sequence: Id },
2881 .OpTypeTaskSequenceINTEL => struct { id_result: Id },
2882 .OpSubgroupBlockPrefetchINTEL => struct { ptr: Id, num_bytes: Id, memory_access: ?MemoryAccess.Extended = null },
2883 .OpSubgroup2DBlockLoadINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2884 .OpSubgroup2DBlockLoadTransformINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2885 .OpSubgroup2DBlockLoadTransposeINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id, dst_pointer: Id },
2886 .OpSubgroup2DBlockPrefetchINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2887 .OpSubgroup2DBlockStoreINTEL => struct { element_size: Id, block_width: Id, block_height: Id, block_count: Id, src_pointer: Id, dst_base_pointer: Id, memory_width: Id, memory_height: Id, memory_pitch: Id, coordinate: Id },
2888 .OpSubgroupMatrixMultiplyAccumulateINTEL => struct { id_result_type: Id, id_result: Id, k_dim: Id, matrix_a: Id, matrix_b: Id, matrix_c: Id, matrix_multiply_accumulate_operands: ?MatrixMultiplyAccumulateOperands = null },
2889 .OpBitwiseFunctionINTEL => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, lut_index: Id },
2890 .OpGroupIMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2891 .OpGroupFMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2892 .OpGroupBitwiseAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2893 .OpGroupBitwiseOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2894 .OpGroupBitwiseXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2895 .OpGroupLogicalAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2896 .OpGroupLogicalOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2897 .OpGroupLogicalXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2898 .OpRoundFToTF32INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2899 .OpMaskedGatherINTEL => struct { id_result_type: Id, id_result: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id, fill_empty: Id },
2900 .OpMaskedScatterINTEL => struct { input_vector: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id },
2901 .OpConvertHandleToImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2902 .OpConvertHandleToSamplerINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2903 .OpConvertHandleToSampledImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2904 };
2905 }
2906 pub fn class(self: Opcode) Class {
2907 return switch (self) {
2908 .OpNop => .miscellaneous,
2909 .OpUndef => .miscellaneous,
2910 .OpSourceContinued => .debug,
2911 .OpSource => .debug,
2912 .OpSourceExtension => .debug,
2913 .OpName => .debug,
2914 .OpMemberName => .debug,
2915 .OpString => .debug,
2916 .OpLine => .debug,
2917 .OpExtension => .extension,
2918 .OpExtInstImport => .extension,
2919 .OpExtInst => .extension,
2920 .OpMemoryModel => .mode_setting,
2921 .OpEntryPoint => .mode_setting,
2922 .OpExecutionMode => .mode_setting,
2923 .OpCapability => .mode_setting,
2924 .OpTypeVoid => .type_declaration,
2925 .OpTypeBool => .type_declaration,
2926 .OpTypeInt => .type_declaration,
2927 .OpTypeFloat => .type_declaration,
2928 .OpTypeVector => .type_declaration,
2929 .OpTypeMatrix => .type_declaration,
2930 .OpTypeImage => .type_declaration,
2931 .OpTypeSampler => .type_declaration,
2932 .OpTypeSampledImage => .type_declaration,
2933 .OpTypeArray => .type_declaration,
2934 .OpTypeRuntimeArray => .type_declaration,
2935 .OpTypeStruct => .type_declaration,
2936 .OpTypeOpaque => .type_declaration,
2937 .OpTypePointer => .type_declaration,
2938 .OpTypeFunction => .type_declaration,
2939 .OpTypeEvent => .type_declaration,
2940 .OpTypeDeviceEvent => .type_declaration,
2941 .OpTypeReserveId => .type_declaration,
2942 .OpTypeQueue => .type_declaration,
2943 .OpTypePipe => .type_declaration,
2944 .OpTypeForwardPointer => .type_declaration,
2945 .OpConstantTrue => .constant_creation,
2946 .OpConstantFalse => .constant_creation,
2947 .OpConstant => .constant_creation,
2948 .OpConstantComposite => .constant_creation,
2949 .OpConstantSampler => .constant_creation,
2950 .OpConstantNull => .constant_creation,
2951 .OpSpecConstantTrue => .constant_creation,
2952 .OpSpecConstantFalse => .constant_creation,
2953 .OpSpecConstant => .constant_creation,
2954 .OpSpecConstantComposite => .constant_creation,
2955 .OpSpecConstantOp => .constant_creation,
2956 .OpFunction => .function,
2957 .OpFunctionParameter => .function,
2958 .OpFunctionEnd => .function,
2959 .OpFunctionCall => .function,
2960 .OpVariable => .memory,
2961 .OpImageTexelPointer => .memory,
2962 .OpLoad => .memory,
2963 .OpStore => .memory,
2964 .OpCopyMemory => .memory,
2965 .OpCopyMemorySized => .memory,
2966 .OpAccessChain => .memory,
2967 .OpInBoundsAccessChain => .memory,
2968 .OpPtrAccessChain => .memory,
2969 .OpArrayLength => .memory,
2970 .OpGenericPtrMemSemantics => .memory,
2971 .OpInBoundsPtrAccessChain => .memory,
2972 .OpDecorate => .annotation,
2973 .OpMemberDecorate => .annotation,
2974 .OpDecorationGroup => .annotation,
2975 .OpGroupDecorate => .annotation,
2976 .OpGroupMemberDecorate => .annotation,
2977 .OpVectorExtractDynamic => .composite,
2978 .OpVectorInsertDynamic => .composite,
2979 .OpVectorShuffle => .composite,
2980 .OpCompositeConstruct => .composite,
2981 .OpCompositeExtract => .composite,
2982 .OpCompositeInsert => .composite,
2983 .OpCopyObject => .composite,
2984 .OpTranspose => .composite,
2985 .OpSampledImage => .image,
2986 .OpImageSampleImplicitLod => .image,
2987 .OpImageSampleExplicitLod => .image,
2988 .OpImageSampleDrefImplicitLod => .image,
2989 .OpImageSampleDrefExplicitLod => .image,
2990 .OpImageSampleProjImplicitLod => .image,
2991 .OpImageSampleProjExplicitLod => .image,
2992 .OpImageSampleProjDrefImplicitLod => .image,
2993 .OpImageSampleProjDrefExplicitLod => .image,
2994 .OpImageFetch => .image,
2995 .OpImageGather => .image,
2996 .OpImageDrefGather => .image,
2997 .OpImageRead => .image,
2998 .OpImageWrite => .image,
2999 .OpImage => .image,
3000 .OpImageQueryFormat => .image,
3001 .OpImageQueryOrder => .image,
3002 .OpImageQuerySizeLod => .image,
3003 .OpImageQuerySize => .image,
3004 .OpImageQueryLod => .image,
3005 .OpImageQueryLevels => .image,
3006 .OpImageQuerySamples => .image,
3007 .OpConvertFToU => .conversion,
3008 .OpConvertFToS => .conversion,
3009 .OpConvertSToF => .conversion,
3010 .OpConvertUToF => .conversion,
3011 .OpUConvert => .conversion,
3012 .OpSConvert => .conversion,
3013 .OpFConvert => .conversion,
3014 .OpQuantizeToF16 => .conversion,
3015 .OpConvertPtrToU => .conversion,
3016 .OpSatConvertSToU => .conversion,
3017 .OpSatConvertUToS => .conversion,
3018 .OpConvertUToPtr => .conversion,
3019 .OpPtrCastToGeneric => .conversion,
3020 .OpGenericCastToPtr => .conversion,
3021 .OpGenericCastToPtrExplicit => .conversion,
3022 .OpBitcast => .conversion,
3023 .OpSNegate => .arithmetic,
3024 .OpFNegate => .arithmetic,
3025 .OpIAdd => .arithmetic,
3026 .OpFAdd => .arithmetic,
3027 .OpISub => .arithmetic,
3028 .OpFSub => .arithmetic,
3029 .OpIMul => .arithmetic,
3030 .OpFMul => .arithmetic,
3031 .OpUDiv => .arithmetic,
3032 .OpSDiv => .arithmetic,
3033 .OpFDiv => .arithmetic,
3034 .OpUMod => .arithmetic,
3035 .OpSRem => .arithmetic,
3036 .OpSMod => .arithmetic,
3037 .OpFRem => .arithmetic,
3038 .OpFMod => .arithmetic,
3039 .OpVectorTimesScalar => .arithmetic,
3040 .OpMatrixTimesScalar => .arithmetic,
3041 .OpVectorTimesMatrix => .arithmetic,
3042 .OpMatrixTimesVector => .arithmetic,
3043 .OpMatrixTimesMatrix => .arithmetic,
3044 .OpOuterProduct => .arithmetic,
3045 .OpDot => .arithmetic,
3046 .OpIAddCarry => .arithmetic,
3047 .OpISubBorrow => .arithmetic,
3048 .OpUMulExtended => .arithmetic,
3049 .OpSMulExtended => .arithmetic,
3050 .OpAny => .relational_and_logical,
3051 .OpAll => .relational_and_logical,
3052 .OpIsNan => .relational_and_logical,
3053 .OpIsInf => .relational_and_logical,
3054 .OpIsFinite => .relational_and_logical,
3055 .OpIsNormal => .relational_and_logical,
3056 .OpSignBitSet => .relational_and_logical,
3057 .OpLessOrGreater => .relational_and_logical,
3058 .OpOrdered => .relational_and_logical,
3059 .OpUnordered => .relational_and_logical,
3060 .OpLogicalEqual => .relational_and_logical,
3061 .OpLogicalNotEqual => .relational_and_logical,
3062 .OpLogicalOr => .relational_and_logical,
3063 .OpLogicalAnd => .relational_and_logical,
3064 .OpLogicalNot => .relational_and_logical,
3065 .OpSelect => .relational_and_logical,
3066 .OpIEqual => .relational_and_logical,
3067 .OpINotEqual => .relational_and_logical,
3068 .OpUGreaterThan => .relational_and_logical,
3069 .OpSGreaterThan => .relational_and_logical,
3070 .OpUGreaterThanEqual => .relational_and_logical,
3071 .OpSGreaterThanEqual => .relational_and_logical,
3072 .OpULessThan => .relational_and_logical,
3073 .OpSLessThan => .relational_and_logical,
3074 .OpULessThanEqual => .relational_and_logical,
3075 .OpSLessThanEqual => .relational_and_logical,
3076 .OpFOrdEqual => .relational_and_logical,
3077 .OpFUnordEqual => .relational_and_logical,
3078 .OpFOrdNotEqual => .relational_and_logical,
3079 .OpFUnordNotEqual => .relational_and_logical,
3080 .OpFOrdLessThan => .relational_and_logical,
3081 .OpFUnordLessThan => .relational_and_logical,
3082 .OpFOrdGreaterThan => .relational_and_logical,
3083 .OpFUnordGreaterThan => .relational_and_logical,
3084 .OpFOrdLessThanEqual => .relational_and_logical,
3085 .OpFUnordLessThanEqual => .relational_and_logical,
3086 .OpFOrdGreaterThanEqual => .relational_and_logical,
3087 .OpFUnordGreaterThanEqual => .relational_and_logical,
3088 .OpShiftRightLogical => .bit,
3089 .OpShiftRightArithmetic => .bit,
3090 .OpShiftLeftLogical => .bit,
3091 .OpBitwiseOr => .bit,
3092 .OpBitwiseXor => .bit,
3093 .OpBitwiseAnd => .bit,
3094 .OpNot => .bit,
3095 .OpBitFieldInsert => .bit,
3096 .OpBitFieldSExtract => .bit,
3097 .OpBitFieldUExtract => .bit,
3098 .OpBitReverse => .bit,
3099 .OpBitCount => .bit,
3100 .OpDPdx => .derivative,
3101 .OpDPdy => .derivative,
3102 .OpFwidth => .derivative,
3103 .OpDPdxFine => .derivative,
3104 .OpDPdyFine => .derivative,
3105 .OpFwidthFine => .derivative,
3106 .OpDPdxCoarse => .derivative,
3107 .OpDPdyCoarse => .derivative,
3108 .OpFwidthCoarse => .derivative,
3109 .OpEmitVertex => .primitive,
3110 .OpEndPrimitive => .primitive,
3111 .OpEmitStreamVertex => .primitive,
3112 .OpEndStreamPrimitive => .primitive,
3113 .OpControlBarrier => .barrier,
3114 .OpMemoryBarrier => .barrier,
3115 .OpAtomicLoad => .atomic,
3116 .OpAtomicStore => .atomic,
3117 .OpAtomicExchange => .atomic,
3118 .OpAtomicCompareExchange => .atomic,
3119 .OpAtomicCompareExchangeWeak => .atomic,
3120 .OpAtomicIIncrement => .atomic,
3121 .OpAtomicIDecrement => .atomic,
3122 .OpAtomicIAdd => .atomic,
3123 .OpAtomicISub => .atomic,
3124 .OpAtomicSMin => .atomic,
3125 .OpAtomicUMin => .atomic,
3126 .OpAtomicSMax => .atomic,
3127 .OpAtomicUMax => .atomic,
3128 .OpAtomicAnd => .atomic,
3129 .OpAtomicOr => .atomic,
3130 .OpAtomicXor => .atomic,
3131 .OpPhi => .control_flow,
3132 .OpLoopMerge => .control_flow,
3133 .OpSelectionMerge => .control_flow,
3134 .OpLabel => .control_flow,
3135 .OpBranch => .control_flow,
3136 .OpBranchConditional => .control_flow,
3137 .OpSwitch => .control_flow,
3138 .OpKill => .control_flow,
3139 .OpReturn => .control_flow,
3140 .OpReturnValue => .control_flow,
3141 .OpUnreachable => .control_flow,
3142 .OpLifetimeStart => .control_flow,
3143 .OpLifetimeStop => .control_flow,
3144 .OpGroupAsyncCopy => .group,
3145 .OpGroupWaitEvents => .group,
3146 .OpGroupAll => .group,
3147 .OpGroupAny => .group,
3148 .OpGroupBroadcast => .group,
3149 .OpGroupIAdd => .group,
3150 .OpGroupFAdd => .group,
3151 .OpGroupFMin => .group,
3152 .OpGroupUMin => .group,
3153 .OpGroupSMin => .group,
3154 .OpGroupFMax => .group,
3155 .OpGroupUMax => .group,
3156 .OpGroupSMax => .group,
3157 .OpReadPipe => .pipe,
3158 .OpWritePipe => .pipe,
3159 .OpReservedReadPipe => .pipe,
3160 .OpReservedWritePipe => .pipe,
3161 .OpReserveReadPipePackets => .pipe,
3162 .OpReserveWritePipePackets => .pipe,
3163 .OpCommitReadPipe => .pipe,
3164 .OpCommitWritePipe => .pipe,
3165 .OpIsValidReserveId => .pipe,
3166 .OpGetNumPipePackets => .pipe,
3167 .OpGetMaxPipePackets => .pipe,
3168 .OpGroupReserveReadPipePackets => .pipe,
3169 .OpGroupReserveWritePipePackets => .pipe,
3170 .OpGroupCommitReadPipe => .pipe,
3171 .OpGroupCommitWritePipe => .pipe,
3172 .OpEnqueueMarker => .device_side_enqueue,
3173 .OpEnqueueKernel => .device_side_enqueue,
3174 .OpGetKernelNDrangeSubGroupCount => .device_side_enqueue,
3175 .OpGetKernelNDrangeMaxSubGroupSize => .device_side_enqueue,
3176 .OpGetKernelWorkGroupSize => .device_side_enqueue,
3177 .OpGetKernelPreferredWorkGroupSizeMultiple => .device_side_enqueue,
3178 .OpRetainEvent => .device_side_enqueue,
3179 .OpReleaseEvent => .device_side_enqueue,
3180 .OpCreateUserEvent => .device_side_enqueue,
3181 .OpIsValidEvent => .device_side_enqueue,
3182 .OpSetUserEventStatus => .device_side_enqueue,
3183 .OpCaptureEventProfilingInfo => .device_side_enqueue,
3184 .OpGetDefaultQueue => .device_side_enqueue,
3185 .OpBuildNDRange => .device_side_enqueue,
3186 .OpImageSparseSampleImplicitLod => .image,
3187 .OpImageSparseSampleExplicitLod => .image,
3188 .OpImageSparseSampleDrefImplicitLod => .image,
3189 .OpImageSparseSampleDrefExplicitLod => .image,
3190 .OpImageSparseSampleProjImplicitLod => .image,
3191 .OpImageSparseSampleProjExplicitLod => .image,
3192 .OpImageSparseSampleProjDrefImplicitLod => .image,
3193 .OpImageSparseSampleProjDrefExplicitLod => .image,
3194 .OpImageSparseFetch => .image,
3195 .OpImageSparseGather => .image,
3196 .OpImageSparseDrefGather => .image,
3197 .OpImageSparseTexelsResident => .image,
3198 .OpNoLine => .debug,
3199 .OpAtomicFlagTestAndSet => .atomic,
3200 .OpAtomicFlagClear => .atomic,
3201 .OpImageSparseRead => .image,
3202 .OpSizeOf => .miscellaneous,
3203 .OpTypePipeStorage => .type_declaration,
3204 .OpConstantPipeStorage => .pipe,
3205 .OpCreatePipeFromPipeStorage => .pipe,
3206 .OpGetKernelLocalSizeForSubgroupCount => .device_side_enqueue,
3207 .OpGetKernelMaxNumSubgroups => .device_side_enqueue,
3208 .OpTypeNamedBarrier => .type_declaration,
3209 .OpNamedBarrierInitialize => .barrier,
3210 .OpMemoryNamedBarrier => .barrier,
3211 .OpModuleProcessed => .debug,
3212 .OpExecutionModeId => .mode_setting,
3213 .OpDecorateId => .annotation,
3214 .OpGroupNonUniformElect => .non_uniform,
3215 .OpGroupNonUniformAll => .non_uniform,
3216 .OpGroupNonUniformAny => .non_uniform,
3217 .OpGroupNonUniformAllEqual => .non_uniform,
3218 .OpGroupNonUniformBroadcast => .non_uniform,
3219 .OpGroupNonUniformBroadcastFirst => .non_uniform,
3220 .OpGroupNonUniformBallot => .non_uniform,
3221 .OpGroupNonUniformInverseBallot => .non_uniform,
3222 .OpGroupNonUniformBallotBitExtract => .non_uniform,
3223 .OpGroupNonUniformBallotBitCount => .non_uniform,
3224 .OpGroupNonUniformBallotFindLSB => .non_uniform,
3225 .OpGroupNonUniformBallotFindMSB => .non_uniform,
3226 .OpGroupNonUniformShuffle => .non_uniform,
3227 .OpGroupNonUniformShuffleXor => .non_uniform,
3228 .OpGroupNonUniformShuffleUp => .non_uniform,
3229 .OpGroupNonUniformShuffleDown => .non_uniform,
3230 .OpGroupNonUniformIAdd => .non_uniform,
3231 .OpGroupNonUniformFAdd => .non_uniform,
3232 .OpGroupNonUniformIMul => .non_uniform,
3233 .OpGroupNonUniformFMul => .non_uniform,
3234 .OpGroupNonUniformSMin => .non_uniform,
3235 .OpGroupNonUniformUMin => .non_uniform,
3236 .OpGroupNonUniformFMin => .non_uniform,
3237 .OpGroupNonUniformSMax => .non_uniform,
3238 .OpGroupNonUniformUMax => .non_uniform,
3239 .OpGroupNonUniformFMax => .non_uniform,
3240 .OpGroupNonUniformBitwiseAnd => .non_uniform,
3241 .OpGroupNonUniformBitwiseOr => .non_uniform,
3242 .OpGroupNonUniformBitwiseXor => .non_uniform,
3243 .OpGroupNonUniformLogicalAnd => .non_uniform,
3244 .OpGroupNonUniformLogicalOr => .non_uniform,
3245 .OpGroupNonUniformLogicalXor => .non_uniform,
3246 .OpGroupNonUniformQuadBroadcast => .non_uniform,
3247 .OpGroupNonUniformQuadSwap => .non_uniform,
3248 .OpCopyLogical => .composite,
3249 .OpPtrEqual => .memory,
3250 .OpPtrNotEqual => .memory,
3251 .OpPtrDiff => .memory,
3252 .OpColorAttachmentReadEXT => .image,
3253 .OpDepthAttachmentReadEXT => .image,
3254 .OpStencilAttachmentReadEXT => .image,
3255 .OpTypeTensorARM => .type_declaration,
3256 .OpTensorReadARM => .tensor,
3257 .OpTensorWriteARM => .tensor,
3258 .OpTensorQuerySizeARM => .tensor,
3259 .OpGraphConstantARM => .graph,
3260 .OpGraphEntryPointARM => .graph,
3261 .OpGraphARM => .graph,
3262 .OpGraphInputARM => .graph,
3263 .OpGraphSetOutputARM => .graph,
3264 .OpGraphEndARM => .graph,
3265 .OpTypeGraphARM => .type_declaration,
3266 .OpTerminateInvocation => .control_flow,
3267 .OpTypeUntypedPointerKHR => .type_declaration,
3268 .OpUntypedVariableKHR => .memory,
3269 .OpUntypedAccessChainKHR => .memory,
3270 .OpUntypedInBoundsAccessChainKHR => .memory,
3271 .OpSubgroupBallotKHR => .group,
3272 .OpSubgroupFirstInvocationKHR => .group,
3273 .OpUntypedPtrAccessChainKHR => .memory,
3274 .OpUntypedInBoundsPtrAccessChainKHR => .memory,
3275 .OpUntypedArrayLengthKHR => .memory,
3276 .OpUntypedPrefetchKHR => .memory,
3277 .OpSubgroupAllKHR => .group,
3278 .OpSubgroupAnyKHR => .group,
3279 .OpSubgroupAllEqualKHR => .group,
3280 .OpGroupNonUniformRotateKHR => .group,
3281 .OpSubgroupReadInvocationKHR => .group,
3282 .OpExtInstWithForwardRefsKHR => .extension,
3283 .OpTraceRayKHR => .reserved,
3284 .OpExecuteCallableKHR => .reserved,
3285 .OpConvertUToAccelerationStructureKHR => .reserved,
3286 .OpIgnoreIntersectionKHR => .reserved,
3287 .OpTerminateRayKHR => .reserved,
3288 .OpSDot => .arithmetic,
3289 .OpUDot => .arithmetic,
3290 .OpSUDot => .arithmetic,
3291 .OpSDotAccSat => .arithmetic,
3292 .OpUDotAccSat => .arithmetic,
3293 .OpSUDotAccSat => .arithmetic,
3294 .OpTypeCooperativeMatrixKHR => .type_declaration,
3295 .OpCooperativeMatrixLoadKHR => .memory,
3296 .OpCooperativeMatrixStoreKHR => .memory,
3297 .OpCooperativeMatrixMulAddKHR => .arithmetic,
3298 .OpCooperativeMatrixLengthKHR => .miscellaneous,
3299 .OpConstantCompositeReplicateEXT => .constant_creation,
3300 .OpSpecConstantCompositeReplicateEXT => .constant_creation,
3301 .OpCompositeConstructReplicateEXT => .composite,
3302 .OpTypeRayQueryKHR => .type_declaration,
3303 .OpRayQueryInitializeKHR => .reserved,
3304 .OpRayQueryTerminateKHR => .reserved,
3305 .OpRayQueryGenerateIntersectionKHR => .reserved,
3306 .OpRayQueryConfirmIntersectionKHR => .reserved,
3307 .OpRayQueryProceedKHR => .reserved,
3308 .OpRayQueryGetIntersectionTypeKHR => .reserved,
3309 .OpImageSampleWeightedQCOM => .image,
3310 .OpImageBoxFilterQCOM => .image,
3311 .OpImageBlockMatchSSDQCOM => .image,
3312 .OpImageBlockMatchSADQCOM => .image,
3313 .OpImageBlockMatchWindowSSDQCOM => .image,
3314 .OpImageBlockMatchWindowSADQCOM => .image,
3315 .OpImageBlockMatchGatherSSDQCOM => .image,
3316 .OpImageBlockMatchGatherSADQCOM => .image,
3317 .OpGroupIAddNonUniformAMD => .group,
3318 .OpGroupFAddNonUniformAMD => .group,
3319 .OpGroupFMinNonUniformAMD => .group,
3320 .OpGroupUMinNonUniformAMD => .group,
3321 .OpGroupSMinNonUniformAMD => .group,
3322 .OpGroupFMaxNonUniformAMD => .group,
3323 .OpGroupUMaxNonUniformAMD => .group,
3324 .OpGroupSMaxNonUniformAMD => .group,
3325 .OpFragmentMaskFetchAMD => .reserved,
3326 .OpFragmentFetchAMD => .reserved,
3327 .OpReadClockKHR => .reserved,
3328 .OpAllocateNodePayloadsAMDX => .reserved,
3329 .OpEnqueueNodePayloadsAMDX => .reserved,
3330 .OpTypeNodePayloadArrayAMDX => .reserved,
3331 .OpFinishWritingNodePayloadAMDX => .reserved,
3332 .OpNodePayloadArrayLengthAMDX => .reserved,
3333 .OpIsNodePayloadValidAMDX => .reserved,
3334 .OpConstantStringAMDX => .reserved,
3335 .OpSpecConstantStringAMDX => .reserved,
3336 .OpGroupNonUniformQuadAllKHR => .non_uniform,
3337 .OpGroupNonUniformQuadAnyKHR => .non_uniform,
3338 .OpHitObjectRecordHitMotionNV => .reserved,
3339 .OpHitObjectRecordHitWithIndexMotionNV => .reserved,
3340 .OpHitObjectRecordMissMotionNV => .reserved,
3341 .OpHitObjectGetWorldToObjectNV => .reserved,
3342 .OpHitObjectGetObjectToWorldNV => .reserved,
3343 .OpHitObjectGetObjectRayDirectionNV => .reserved,
3344 .OpHitObjectGetObjectRayOriginNV => .reserved,
3345 .OpHitObjectTraceRayMotionNV => .reserved,
3346 .OpHitObjectGetShaderRecordBufferHandleNV => .reserved,
3347 .OpHitObjectGetShaderBindingTableRecordIndexNV => .reserved,
3348 .OpHitObjectRecordEmptyNV => .reserved,
3349 .OpHitObjectTraceRayNV => .reserved,
3350 .OpHitObjectRecordHitNV => .reserved,
3351 .OpHitObjectRecordHitWithIndexNV => .reserved,
3352 .OpHitObjectRecordMissNV => .reserved,
3353 .OpHitObjectExecuteShaderNV => .reserved,
3354 .OpHitObjectGetCurrentTimeNV => .reserved,
3355 .OpHitObjectGetAttributesNV => .reserved,
3356 .OpHitObjectGetHitKindNV => .reserved,
3357 .OpHitObjectGetPrimitiveIndexNV => .reserved,
3358 .OpHitObjectGetGeometryIndexNV => .reserved,
3359 .OpHitObjectGetInstanceIdNV => .reserved,
3360 .OpHitObjectGetInstanceCustomIndexNV => .reserved,
3361 .OpHitObjectGetWorldRayDirectionNV => .reserved,
3362 .OpHitObjectGetWorldRayOriginNV => .reserved,
3363 .OpHitObjectGetRayTMaxNV => .reserved,
3364 .OpHitObjectGetRayTMinNV => .reserved,
3365 .OpHitObjectIsEmptyNV => .reserved,
3366 .OpHitObjectIsHitNV => .reserved,
3367 .OpHitObjectIsMissNV => .reserved,
3368 .OpReorderThreadWithHitObjectNV => .reserved,
3369 .OpReorderThreadWithHintNV => .reserved,
3370 .OpTypeHitObjectNV => .type_declaration,
3371 .OpImageSampleFootprintNV => .image,
3372 .OpTypeCooperativeVectorNV => .type_declaration,
3373 .OpCooperativeVectorMatrixMulNV => .reserved,
3374 .OpCooperativeVectorOuterProductAccumulateNV => .reserved,
3375 .OpCooperativeVectorReduceSumAccumulateNV => .reserved,
3376 .OpCooperativeVectorMatrixMulAddNV => .reserved,
3377 .OpCooperativeMatrixConvertNV => .conversion,
3378 .OpEmitMeshTasksEXT => .reserved,
3379 .OpSetMeshOutputsEXT => .reserved,
3380 .OpGroupNonUniformPartitionNV => .non_uniform,
3381 .OpWritePackedPrimitiveIndices4x8NV => .reserved,
3382 .OpFetchMicroTriangleVertexPositionNV => .reserved,
3383 .OpFetchMicroTriangleVertexBarycentricNV => .reserved,
3384 .OpCooperativeVectorLoadNV => .memory,
3385 .OpCooperativeVectorStoreNV => .memory,
3386 .OpReportIntersectionKHR => .reserved,
3387 .OpIgnoreIntersectionNV => .reserved,
3388 .OpTerminateRayNV => .reserved,
3389 .OpTraceNV => .reserved,
3390 .OpTraceMotionNV => .reserved,
3391 .OpTraceRayMotionNV => .reserved,
3392 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => .reserved,
3393 .OpTypeAccelerationStructureKHR => .type_declaration,
3394 .OpExecuteCallableNV => .reserved,
3395 .OpRayQueryGetClusterIdNV => .reserved,
3396 .OpHitObjectGetClusterIdNV => .reserved,
3397 .OpTypeCooperativeMatrixNV => .type_declaration,
3398 .OpCooperativeMatrixLoadNV => .reserved,
3399 .OpCooperativeMatrixStoreNV => .reserved,
3400 .OpCooperativeMatrixMulAddNV => .reserved,
3401 .OpCooperativeMatrixLengthNV => .reserved,
3402 .OpBeginInvocationInterlockEXT => .reserved,
3403 .OpEndInvocationInterlockEXT => .reserved,
3404 .OpCooperativeMatrixReduceNV => .arithmetic,
3405 .OpCooperativeMatrixLoadTensorNV => .memory,
3406 .OpCooperativeMatrixStoreTensorNV => .memory,
3407 .OpCooperativeMatrixPerElementOpNV => .function,
3408 .OpTypeTensorLayoutNV => .type_declaration,
3409 .OpTypeTensorViewNV => .type_declaration,
3410 .OpCreateTensorLayoutNV => .reserved,
3411 .OpTensorLayoutSetDimensionNV => .reserved,
3412 .OpTensorLayoutSetStrideNV => .reserved,
3413 .OpTensorLayoutSliceNV => .reserved,
3414 .OpTensorLayoutSetClampValueNV => .reserved,
3415 .OpCreateTensorViewNV => .reserved,
3416 .OpTensorViewSetDimensionNV => .reserved,
3417 .OpTensorViewSetStrideNV => .reserved,
3418 .OpDemoteToHelperInvocation => .control_flow,
3419 .OpIsHelperInvocationEXT => .reserved,
3420 .OpTensorViewSetClipNV => .reserved,
3421 .OpTensorLayoutSetBlockSizeNV => .reserved,
3422 .OpCooperativeMatrixTransposeNV => .conversion,
3423 .OpConvertUToImageNV => .reserved,
3424 .OpConvertUToSamplerNV => .reserved,
3425 .OpConvertImageToUNV => .reserved,
3426 .OpConvertSamplerToUNV => .reserved,
3427 .OpConvertUToSampledImageNV => .reserved,
3428 .OpConvertSampledImageToUNV => .reserved,
3429 .OpSamplerImageAddressingModeNV => .reserved,
3430 .OpRawAccessChainNV => .memory,
3431 .OpRayQueryGetIntersectionSpherePositionNV => .reserved,
3432 .OpRayQueryGetIntersectionSphereRadiusNV => .reserved,
3433 .OpRayQueryGetIntersectionLSSPositionsNV => .reserved,
3434 .OpRayQueryGetIntersectionLSSRadiiNV => .reserved,
3435 .OpRayQueryGetIntersectionLSSHitValueNV => .reserved,
3436 .OpHitObjectGetSpherePositionNV => .reserved,
3437 .OpHitObjectGetSphereRadiusNV => .reserved,
3438 .OpHitObjectGetLSSPositionsNV => .reserved,
3439 .OpHitObjectGetLSSRadiiNV => .reserved,
3440 .OpHitObjectIsSphereHitNV => .reserved,
3441 .OpHitObjectIsLSSHitNV => .reserved,
3442 .OpRayQueryIsSphereHitNV => .reserved,
3443 .OpRayQueryIsLSSHitNV => .reserved,
3444 .OpSubgroupShuffleINTEL => .group,
3445 .OpSubgroupShuffleDownINTEL => .group,
3446 .OpSubgroupShuffleUpINTEL => .group,
3447 .OpSubgroupShuffleXorINTEL => .group,
3448 .OpSubgroupBlockReadINTEL => .group,
3449 .OpSubgroupBlockWriteINTEL => .group,
3450 .OpSubgroupImageBlockReadINTEL => .group,
3451 .OpSubgroupImageBlockWriteINTEL => .group,
3452 .OpSubgroupImageMediaBlockReadINTEL => .group,
3453 .OpSubgroupImageMediaBlockWriteINTEL => .group,
3454 .OpUCountLeadingZerosINTEL => .reserved,
3455 .OpUCountTrailingZerosINTEL => .reserved,
3456 .OpAbsISubINTEL => .reserved,
3457 .OpAbsUSubINTEL => .reserved,
3458 .OpIAddSatINTEL => .reserved,
3459 .OpUAddSatINTEL => .reserved,
3460 .OpIAverageINTEL => .reserved,
3461 .OpUAverageINTEL => .reserved,
3462 .OpIAverageRoundedINTEL => .reserved,
3463 .OpUAverageRoundedINTEL => .reserved,
3464 .OpISubSatINTEL => .reserved,
3465 .OpUSubSatINTEL => .reserved,
3466 .OpIMul32x16INTEL => .reserved,
3467 .OpUMul32x16INTEL => .reserved,
3468 .OpAtomicFMinEXT => .atomic,
3469 .OpAtomicFMaxEXT => .atomic,
3470 .OpAssumeTrueKHR => .miscellaneous,
3471 .OpExpectKHR => .miscellaneous,
3472 .OpDecorateString => .annotation,
3473 .OpMemberDecorateString => .annotation,
3474 .OpLoopControlINTEL => .reserved,
3475 .OpReadPipeBlockingINTEL => .pipe,
3476 .OpWritePipeBlockingINTEL => .pipe,
3477 .OpFPGARegINTEL => .reserved,
3478 .OpRayQueryGetRayTMinKHR => .reserved,
3479 .OpRayQueryGetRayFlagsKHR => .reserved,
3480 .OpRayQueryGetIntersectionTKHR => .reserved,
3481 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => .reserved,
3482 .OpRayQueryGetIntersectionInstanceIdKHR => .reserved,
3483 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => .reserved,
3484 .OpRayQueryGetIntersectionGeometryIndexKHR => .reserved,
3485 .OpRayQueryGetIntersectionPrimitiveIndexKHR => .reserved,
3486 .OpRayQueryGetIntersectionBarycentricsKHR => .reserved,
3487 .OpRayQueryGetIntersectionFrontFaceKHR => .reserved,
3488 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => .reserved,
3489 .OpRayQueryGetIntersectionObjectRayDirectionKHR => .reserved,
3490 .OpRayQueryGetIntersectionObjectRayOriginKHR => .reserved,
3491 .OpRayQueryGetWorldRayDirectionKHR => .reserved,
3492 .OpRayQueryGetWorldRayOriginKHR => .reserved,
3493 .OpRayQueryGetIntersectionObjectToWorldKHR => .reserved,
3494 .OpRayQueryGetIntersectionWorldToObjectKHR => .reserved,
3495 .OpAtomicFAddEXT => .atomic,
3496 .OpTypeBufferSurfaceINTEL => .type_declaration,
3497 .OpTypeStructContinuedINTEL => .type_declaration,
3498 .OpConstantCompositeContinuedINTEL => .constant_creation,
3499 .OpSpecConstantCompositeContinuedINTEL => .constant_creation,
3500 .OpCompositeConstructContinuedINTEL => .composite,
3501 .OpConvertFToBF16INTEL => .conversion,
3502 .OpConvertBF16ToFINTEL => .conversion,
3503 .OpControlBarrierArriveINTEL => .barrier,
3504 .OpControlBarrierWaitINTEL => .barrier,
3505 .OpArithmeticFenceEXT => .miscellaneous,
3506 .OpTaskSequenceCreateINTEL => .reserved,
3507 .OpTaskSequenceAsyncINTEL => .reserved,
3508 .OpTaskSequenceGetINTEL => .reserved,
3509 .OpTaskSequenceReleaseINTEL => .reserved,
3510 .OpTypeTaskSequenceINTEL => .type_declaration,
3511 .OpSubgroupBlockPrefetchINTEL => .group,
3512 .OpSubgroup2DBlockLoadINTEL => .group,
3513 .OpSubgroup2DBlockLoadTransformINTEL => .group,
3514 .OpSubgroup2DBlockLoadTransposeINTEL => .group,
3515 .OpSubgroup2DBlockPrefetchINTEL => .group,
3516 .OpSubgroup2DBlockStoreINTEL => .group,
3517 .OpSubgroupMatrixMultiplyAccumulateINTEL => .group,
3518 .OpBitwiseFunctionINTEL => .bit,
3519 .OpGroupIMulKHR => .group,
3520 .OpGroupFMulKHR => .group,
3521 .OpGroupBitwiseAndKHR => .group,
3522 .OpGroupBitwiseOrKHR => .group,
3523 .OpGroupBitwiseXorKHR => .group,
3524 .OpGroupLogicalAndKHR => .group,
3525 .OpGroupLogicalOrKHR => .group,
3526 .OpGroupLogicalXorKHR => .group,
3527 .OpRoundFToTF32INTEL => .conversion,
3528 .OpMaskedGatherINTEL => .memory,
3529 .OpMaskedScatterINTEL => .memory,
3530 .OpConvertHandleToImageINTEL => .image,
3531 .OpConvertHandleToSamplerINTEL => .image,
3532 .OpConvertHandleToSampledImageINTEL => .image,
3533 };
3534 }
3535};
3536pub const ImageOperands = packed struct {
3537 bias: bool = false,
3538 lod: bool = false,
3539 grad: bool = false,
3540 const_offset: bool = false,
3541 offset: bool = false,
3542 const_offsets: bool = false,
3543 sample: bool = false,
3544 min_lod: bool = false,
3545 make_texel_available: bool = false,
3546 make_texel_visible: bool = false,
3547 non_private_texel: bool = false,
3548 volatile_texel: bool = false,
3549 sign_extend: bool = false,
3550 zero_extend: bool = false,
3551 nontemporal: bool = false,
3552 _reserved_bit_15: bool = false,
3553 offsets: bool = false,
3554 _reserved_bit_17: bool = false,
3555 _reserved_bit_18: bool = false,
3556 _reserved_bit_19: bool = false,
3557 _reserved_bit_20: bool = false,
3558 _reserved_bit_21: bool = false,
3559 _reserved_bit_22: bool = false,
3560 _reserved_bit_23: bool = false,
3561 _reserved_bit_24: bool = false,
3562 _reserved_bit_25: bool = false,
3563 _reserved_bit_26: bool = false,
3564 _reserved_bit_27: bool = false,
3565 _reserved_bit_28: bool = false,
3566 _reserved_bit_29: bool = false,
3567 _reserved_bit_30: bool = false,
3568 _reserved_bit_31: bool = false,
3569
3570 pub const Extended = struct {
3571 bias: ?struct { id_ref: Id } = null,
3572 lod: ?struct { id_ref: Id } = null,
3573 grad: ?struct { id_ref_0: Id, id_ref_1: Id } = null,
3574 const_offset: ?struct { id_ref: Id } = null,
3575 offset: ?struct { id_ref: Id } = null,
3576 const_offsets: ?struct { id_ref: Id } = null,
3577 sample: ?struct { id_ref: Id } = null,
3578 min_lod: ?struct { id_ref: Id } = null,
3579 make_texel_available: ?struct { id_scope: Id } = null,
3580 make_texel_visible: ?struct { id_scope: Id } = null,
3581 non_private_texel: bool = false,
3582 volatile_texel: bool = false,
3583 sign_extend: bool = false,
3584 zero_extend: bool = false,
3585 nontemporal: bool = false,
3586 _reserved_bit_15: bool = false,
3587 offsets: ?struct { id_ref: Id } = null,
3588 _reserved_bit_17: bool = false,
3589 _reserved_bit_18: bool = false,
3590 _reserved_bit_19: bool = false,
3591 _reserved_bit_20: bool = false,
3592 _reserved_bit_21: bool = false,
3593 _reserved_bit_22: bool = false,
3594 _reserved_bit_23: bool = false,
3595 _reserved_bit_24: bool = false,
3596 _reserved_bit_25: bool = false,
3597 _reserved_bit_26: bool = false,
3598 _reserved_bit_27: bool = false,
3599 _reserved_bit_28: bool = false,
3600 _reserved_bit_29: bool = false,
3601 _reserved_bit_30: bool = false,
3602 _reserved_bit_31: bool = false,
3603 };
3604};
3605pub const FPFastMathMode = packed struct {
3606 not_na_n: bool = false,
3607 not_inf: bool = false,
3608 nsz: bool = false,
3609 allow_recip: bool = false,
3610 fast: bool = false,
3611 _reserved_bit_5: bool = false,
3612 _reserved_bit_6: bool = false,
3613 _reserved_bit_7: bool = false,
3614 _reserved_bit_8: bool = false,
3615 _reserved_bit_9: bool = false,
3616 _reserved_bit_10: bool = false,
3617 _reserved_bit_11: bool = false,
3618 _reserved_bit_12: bool = false,
3619 _reserved_bit_13: bool = false,
3620 _reserved_bit_14: bool = false,
3621 _reserved_bit_15: bool = false,
3622 allow_contract: bool = false,
3623 allow_reassoc: bool = false,
3624 allow_transform: bool = false,
3625 _reserved_bit_19: bool = false,
3626 _reserved_bit_20: bool = false,
3627 _reserved_bit_21: bool = false,
3628 _reserved_bit_22: bool = false,
3629 _reserved_bit_23: bool = false,
3630 _reserved_bit_24: bool = false,
3631 _reserved_bit_25: bool = false,
3632 _reserved_bit_26: bool = false,
3633 _reserved_bit_27: bool = false,
3634 _reserved_bit_28: bool = false,
3635 _reserved_bit_29: bool = false,
3636 _reserved_bit_30: bool = false,
3637 _reserved_bit_31: bool = false,
3638};
3639pub const SelectionControl = packed struct {
3640 flatten: bool = false,
3641 dont_flatten: bool = false,
3642 _reserved_bit_2: bool = false,
3643 _reserved_bit_3: bool = false,
3644 _reserved_bit_4: bool = false,
3645 _reserved_bit_5: bool = false,
3646 _reserved_bit_6: bool = false,
3647 _reserved_bit_7: bool = false,
3648 _reserved_bit_8: bool = false,
3649 _reserved_bit_9: bool = false,
3650 _reserved_bit_10: bool = false,
3651 _reserved_bit_11: bool = false,
3652 _reserved_bit_12: bool = false,
3653 _reserved_bit_13: bool = false,
3654 _reserved_bit_14: bool = false,
3655 _reserved_bit_15: bool = false,
3656 _reserved_bit_16: bool = false,
3657 _reserved_bit_17: bool = false,
3658 _reserved_bit_18: bool = false,
3659 _reserved_bit_19: bool = false,
3660 _reserved_bit_20: bool = false,
3661 _reserved_bit_21: bool = false,
3662 _reserved_bit_22: bool = false,
3663 _reserved_bit_23: bool = false,
3664 _reserved_bit_24: bool = false,
3665 _reserved_bit_25: bool = false,
3666 _reserved_bit_26: bool = false,
3667 _reserved_bit_27: bool = false,
3668 _reserved_bit_28: bool = false,
3669 _reserved_bit_29: bool = false,
3670 _reserved_bit_30: bool = false,
3671 _reserved_bit_31: bool = false,
3672};
3673pub const LoopControl = packed struct {
3674 unroll: bool = false,
3675 dont_unroll: bool = false,
3676 dependency_infinite: bool = false,
3677 dependency_length: bool = false,
3678 min_iterations: bool = false,
3679 max_iterations: bool = false,
3680 iteration_multiple: bool = false,
3681 peel_count: bool = false,
3682 partial_count: bool = false,
3683 _reserved_bit_9: bool = false,
3684 _reserved_bit_10: bool = false,
3685 _reserved_bit_11: bool = false,
3686 _reserved_bit_12: bool = false,
3687 _reserved_bit_13: bool = false,
3688 _reserved_bit_14: bool = false,
3689 _reserved_bit_15: bool = false,
3690 initiation_interval_intel: bool = false,
3691 max_concurrency_intel: bool = false,
3692 dependency_array_intel: bool = false,
3693 pipeline_enable_intel: bool = false,
3694 loop_coalesce_intel: bool = false,
3695 max_interleaving_intel: bool = false,
3696 speculated_iterations_intel: bool = false,
3697 no_fusion_intel: bool = false,
3698 loop_count_intel: bool = false,
3699 max_reinvocation_delay_intel: bool = false,
3700 _reserved_bit_26: bool = false,
3701 _reserved_bit_27: bool = false,
3702 _reserved_bit_28: bool = false,
3703 _reserved_bit_29: bool = false,
3704 _reserved_bit_30: bool = false,
3705 _reserved_bit_31: bool = false,
3706
3707 pub const Extended = struct {
3708 unroll: bool = false,
3709 dont_unroll: bool = false,
3710 dependency_infinite: bool = false,
3711 dependency_length: ?struct { literal_integer: LiteralInteger } = null,
3712 min_iterations: ?struct { literal_integer: LiteralInteger } = null,
3713 max_iterations: ?struct { literal_integer: LiteralInteger } = null,
3714 iteration_multiple: ?struct { literal_integer: LiteralInteger } = null,
3715 peel_count: ?struct { literal_integer: LiteralInteger } = null,
3716 partial_count: ?struct { literal_integer: LiteralInteger } = null,
3717 _reserved_bit_9: bool = false,
3718 _reserved_bit_10: bool = false,
3719 _reserved_bit_11: bool = false,
3720 _reserved_bit_12: bool = false,
3721 _reserved_bit_13: bool = false,
3722 _reserved_bit_14: bool = false,
3723 _reserved_bit_15: bool = false,
3724 initiation_interval_intel: ?struct { literal_integer: LiteralInteger } = null,
3725 max_concurrency_intel: ?struct { literal_integer: LiteralInteger } = null,
3726 dependency_array_intel: ?struct { literal_integer: LiteralInteger } = null,
3727 pipeline_enable_intel: ?struct { literal_integer: LiteralInteger } = null,
3728 loop_coalesce_intel: ?struct { literal_integer: LiteralInteger } = null,
3729 max_interleaving_intel: ?struct { literal_integer: LiteralInteger } = null,
3730 speculated_iterations_intel: ?struct { literal_integer: LiteralInteger } = null,
3731 no_fusion_intel: bool = false,
3732 loop_count_intel: ?struct { literal_integer: LiteralInteger } = null,
3733 max_reinvocation_delay_intel: ?struct { literal_integer: LiteralInteger } = null,
3734 _reserved_bit_26: bool = false,
3735 _reserved_bit_27: bool = false,
3736 _reserved_bit_28: bool = false,
3737 _reserved_bit_29: bool = false,
3738 _reserved_bit_30: bool = false,
3739 _reserved_bit_31: bool = false,
3740 };
3741};
3742pub const FunctionControl = packed struct {
3743 @"inline": bool = false,
3744 dont_inline: bool = false,
3745 pure: bool = false,
3746 @"const": bool = false,
3747 _reserved_bit_4: bool = false,
3748 _reserved_bit_5: bool = false,
3749 _reserved_bit_6: bool = false,
3750 _reserved_bit_7: bool = false,
3751 _reserved_bit_8: bool = false,
3752 _reserved_bit_9: bool = false,
3753 _reserved_bit_10: bool = false,
3754 _reserved_bit_11: bool = false,
3755 _reserved_bit_12: bool = false,
3756 _reserved_bit_13: bool = false,
3757 _reserved_bit_14: bool = false,
3758 _reserved_bit_15: bool = false,
3759 opt_none_ext: bool = false,
3760 _reserved_bit_17: bool = false,
3761 _reserved_bit_18: bool = false,
3762 _reserved_bit_19: bool = false,
3763 _reserved_bit_20: bool = false,
3764 _reserved_bit_21: bool = false,
3765 _reserved_bit_22: bool = false,
3766 _reserved_bit_23: bool = false,
3767 _reserved_bit_24: bool = false,
3768 _reserved_bit_25: bool = false,
3769 _reserved_bit_26: bool = false,
3770 _reserved_bit_27: bool = false,
3771 _reserved_bit_28: bool = false,
3772 _reserved_bit_29: bool = false,
3773 _reserved_bit_30: bool = false,
3774 _reserved_bit_31: bool = false,
3775};
3776pub const MemorySemantics = packed struct {
3777 _reserved_bit_0: bool = false,
3778 acquire: bool = false,
3779 release: bool = false,
3780 acquire_release: bool = false,
3781 sequentially_consistent: bool = false,
3782 _reserved_bit_5: bool = false,
3783 uniform_memory: bool = false,
3784 subgroup_memory: bool = false,
3785 workgroup_memory: bool = false,
3786 cross_workgroup_memory: bool = false,
3787 atomic_counter_memory: bool = false,
3788 image_memory: bool = false,
3789 output_memory: bool = false,
3790 make_available: bool = false,
3791 make_visible: bool = false,
3792 @"volatile": bool = false,
3793 _reserved_bit_16: bool = false,
3794 _reserved_bit_17: bool = false,
3795 _reserved_bit_18: bool = false,
3796 _reserved_bit_19: bool = false,
3797 _reserved_bit_20: bool = false,
3798 _reserved_bit_21: bool = false,
3799 _reserved_bit_22: bool = false,
3800 _reserved_bit_23: bool = false,
3801 _reserved_bit_24: bool = false,
3802 _reserved_bit_25: bool = false,
3803 _reserved_bit_26: bool = false,
3804 _reserved_bit_27: bool = false,
3805 _reserved_bit_28: bool = false,
3806 _reserved_bit_29: bool = false,
3807 _reserved_bit_30: bool = false,
3808 _reserved_bit_31: bool = false,
3809};
3810pub const MemoryAccess = packed struct {
3811 @"volatile": bool = false,
3812 aligned: bool = false,
3813 nontemporal: bool = false,
3814 make_pointer_available: bool = false,
3815 make_pointer_visible: bool = false,
3816 non_private_pointer: bool = false,
3817 _reserved_bit_6: bool = false,
3818 _reserved_bit_7: bool = false,
3819 _reserved_bit_8: bool = false,
3820 _reserved_bit_9: bool = false,
3821 _reserved_bit_10: bool = false,
3822 _reserved_bit_11: bool = false,
3823 _reserved_bit_12: bool = false,
3824 _reserved_bit_13: bool = false,
3825 _reserved_bit_14: bool = false,
3826 _reserved_bit_15: bool = false,
3827 alias_scope_intel_mask: bool = false,
3828 no_alias_intel_mask: bool = false,
3829 _reserved_bit_18: bool = false,
3830 _reserved_bit_19: bool = false,
3831 _reserved_bit_20: bool = false,
3832 _reserved_bit_21: bool = false,
3833 _reserved_bit_22: bool = false,
3834 _reserved_bit_23: bool = false,
3835 _reserved_bit_24: bool = false,
3836 _reserved_bit_25: bool = false,
3837 _reserved_bit_26: bool = false,
3838 _reserved_bit_27: bool = false,
3839 _reserved_bit_28: bool = false,
3840 _reserved_bit_29: bool = false,
3841 _reserved_bit_30: bool = false,
3842 _reserved_bit_31: bool = false,
3843
3844 pub const Extended = struct {
3845 @"volatile": bool = false,
3846 aligned: ?struct { literal_integer: LiteralInteger } = null,
3847 nontemporal: bool = false,
3848 make_pointer_available: ?struct { id_scope: Id } = null,
3849 make_pointer_visible: ?struct { id_scope: Id } = null,
3850 non_private_pointer: bool = false,
3851 _reserved_bit_6: bool = false,
3852 _reserved_bit_7: bool = false,
3853 _reserved_bit_8: bool = false,
3854 _reserved_bit_9: bool = false,
3855 _reserved_bit_10: bool = false,
3856 _reserved_bit_11: bool = false,
3857 _reserved_bit_12: bool = false,
3858 _reserved_bit_13: bool = false,
3859 _reserved_bit_14: bool = false,
3860 _reserved_bit_15: bool = false,
3861 alias_scope_intel_mask: ?struct { id_ref: Id } = null,
3862 no_alias_intel_mask: ?struct { id_ref: Id } = null,
3863 _reserved_bit_18: bool = false,
3864 _reserved_bit_19: bool = false,
3865 _reserved_bit_20: bool = false,
3866 _reserved_bit_21: bool = false,
3867 _reserved_bit_22: bool = false,
3868 _reserved_bit_23: bool = false,
3869 _reserved_bit_24: bool = false,
3870 _reserved_bit_25: bool = false,
3871 _reserved_bit_26: bool = false,
3872 _reserved_bit_27: bool = false,
3873 _reserved_bit_28: bool = false,
3874 _reserved_bit_29: bool = false,
3875 _reserved_bit_30: bool = false,
3876 _reserved_bit_31: bool = false,
3877 };
3878};
3879pub const KernelProfilingInfo = packed struct {
3880 cmd_exec_time: bool = false,
3881 _reserved_bit_1: bool = false,
3882 _reserved_bit_2: bool = false,
3883 _reserved_bit_3: bool = false,
3884 _reserved_bit_4: bool = false,
3885 _reserved_bit_5: bool = false,
3886 _reserved_bit_6: bool = false,
3887 _reserved_bit_7: bool = false,
3888 _reserved_bit_8: bool = false,
3889 _reserved_bit_9: bool = false,
3890 _reserved_bit_10: bool = false,
3891 _reserved_bit_11: bool = false,
3892 _reserved_bit_12: bool = false,
3893 _reserved_bit_13: bool = false,
3894 _reserved_bit_14: bool = false,
3895 _reserved_bit_15: bool = false,
3896 _reserved_bit_16: bool = false,
3897 _reserved_bit_17: bool = false,
3898 _reserved_bit_18: bool = false,
3899 _reserved_bit_19: bool = false,
3900 _reserved_bit_20: bool = false,
3901 _reserved_bit_21: bool = false,
3902 _reserved_bit_22: bool = false,
3903 _reserved_bit_23: bool = false,
3904 _reserved_bit_24: bool = false,
3905 _reserved_bit_25: bool = false,
3906 _reserved_bit_26: bool = false,
3907 _reserved_bit_27: bool = false,
3908 _reserved_bit_28: bool = false,
3909 _reserved_bit_29: bool = false,
3910 _reserved_bit_30: bool = false,
3911 _reserved_bit_31: bool = false,
3912};
3913pub const RayFlags = packed struct {
3914 opaque_khr: bool = false,
3915 no_opaque_khr: bool = false,
3916 terminate_on_first_hit_khr: bool = false,
3917 skip_closest_hit_shader_khr: bool = false,
3918 cull_back_facing_triangles_khr: bool = false,
3919 cull_front_facing_triangles_khr: bool = false,
3920 cull_opaque_khr: bool = false,
3921 cull_no_opaque_khr: bool = false,
3922 skip_triangles_khr: bool = false,
3923 skip_aab_bs_khr: bool = false,
3924 force_opacity_micromap2state_ext: bool = false,
3925 _reserved_bit_11: bool = false,
3926 _reserved_bit_12: bool = false,
3927 _reserved_bit_13: bool = false,
3928 _reserved_bit_14: bool = false,
3929 _reserved_bit_15: bool = false,
3930 _reserved_bit_16: bool = false,
3931 _reserved_bit_17: bool = false,
3932 _reserved_bit_18: bool = false,
3933 _reserved_bit_19: bool = false,
3934 _reserved_bit_20: bool = false,
3935 _reserved_bit_21: bool = false,
3936 _reserved_bit_22: bool = false,
3937 _reserved_bit_23: bool = false,
3938 _reserved_bit_24: bool = false,
3939 _reserved_bit_25: bool = false,
3940 _reserved_bit_26: bool = false,
3941 _reserved_bit_27: bool = false,
3942 _reserved_bit_28: bool = false,
3943 _reserved_bit_29: bool = false,
3944 _reserved_bit_30: bool = false,
3945 _reserved_bit_31: bool = false,
3946};
3947pub const FragmentShadingRate = packed struct {
3948 vertical2pixels: bool = false,
3949 vertical4pixels: bool = false,
3950 horizontal2pixels: bool = false,
3951 horizontal4pixels: bool = false,
3952 _reserved_bit_4: bool = false,
3953 _reserved_bit_5: bool = false,
3954 _reserved_bit_6: bool = false,
3955 _reserved_bit_7: bool = false,
3956 _reserved_bit_8: bool = false,
3957 _reserved_bit_9: bool = false,
3958 _reserved_bit_10: bool = false,
3959 _reserved_bit_11: bool = false,
3960 _reserved_bit_12: bool = false,
3961 _reserved_bit_13: bool = false,
3962 _reserved_bit_14: bool = false,
3963 _reserved_bit_15: bool = false,
3964 _reserved_bit_16: bool = false,
3965 _reserved_bit_17: bool = false,
3966 _reserved_bit_18: bool = false,
3967 _reserved_bit_19: bool = false,
3968 _reserved_bit_20: bool = false,
3969 _reserved_bit_21: bool = false,
3970 _reserved_bit_22: bool = false,
3971 _reserved_bit_23: bool = false,
3972 _reserved_bit_24: bool = false,
3973 _reserved_bit_25: bool = false,
3974 _reserved_bit_26: bool = false,
3975 _reserved_bit_27: bool = false,
3976 _reserved_bit_28: bool = false,
3977 _reserved_bit_29: bool = false,
3978 _reserved_bit_30: bool = false,
3979 _reserved_bit_31: bool = false,
3980};
3981pub const RawAccessChainOperands = packed struct {
3982 robustness_per_component_nv: bool = false,
3983 robustness_per_element_nv: bool = false,
3984 _reserved_bit_2: bool = false,
3985 _reserved_bit_3: bool = false,
3986 _reserved_bit_4: bool = false,
3987 _reserved_bit_5: bool = false,
3988 _reserved_bit_6: bool = false,
3989 _reserved_bit_7: bool = false,
3990 _reserved_bit_8: bool = false,
3991 _reserved_bit_9: bool = false,
3992 _reserved_bit_10: bool = false,
3993 _reserved_bit_11: bool = false,
3994 _reserved_bit_12: bool = false,
3995 _reserved_bit_13: bool = false,
3996 _reserved_bit_14: bool = false,
3997 _reserved_bit_15: bool = false,
3998 _reserved_bit_16: bool = false,
3999 _reserved_bit_17: bool = false,
4000 _reserved_bit_18: bool = false,
4001 _reserved_bit_19: bool = false,
4002 _reserved_bit_20: bool = false,
4003 _reserved_bit_21: bool = false,
4004 _reserved_bit_22: bool = false,
4005 _reserved_bit_23: bool = false,
4006 _reserved_bit_24: bool = false,
4007 _reserved_bit_25: bool = false,
4008 _reserved_bit_26: bool = false,
4009 _reserved_bit_27: bool = false,
4010 _reserved_bit_28: bool = false,
4011 _reserved_bit_29: bool = false,
4012 _reserved_bit_30: bool = false,
4013 _reserved_bit_31: bool = false,
4014};
4015pub const SourceLanguage = enum(u32) {
4016 unknown = 0,
4017 essl = 1,
4018 glsl = 2,
4019 open_cl_c = 3,
4020 open_cl_cpp = 4,
4021 hlsl = 5,
4022 cpp_for_open_cl = 6,
4023 sycl = 7,
4024 hero_c = 8,
4025 nzsl = 9,
4026 wgsl = 10,
4027 slang = 11,
4028 zig = 12,
4029 rust = 13,
4030};
4031pub const ExecutionModel = enum(u32) {
4032 vertex = 0,
4033 tessellation_control = 1,
4034 tessellation_evaluation = 2,
4035 geometry = 3,
4036 fragment = 4,
4037 gl_compute = 5,
4038 kernel = 6,
4039 task_nv = 5267,
4040 mesh_nv = 5268,
4041 ray_generation_khr = 5313,
4042 intersection_khr = 5314,
4043 any_hit_khr = 5315,
4044 closest_hit_khr = 5316,
4045 miss_khr = 5317,
4046 callable_khr = 5318,
4047 task_ext = 5364,
4048 mesh_ext = 5365,
4049};
4050pub const AddressingModel = enum(u32) {
4051 logical = 0,
4052 physical32 = 1,
4053 physical64 = 2,
4054 physical_storage_buffer64 = 5348,
4055};
4056pub const MemoryModel = enum(u32) {
4057 simple = 0,
4058 glsl450 = 1,
4059 open_cl = 2,
4060 vulkan = 3,
4061};
4062pub const ExecutionMode = enum(u32) {
4063 invocations = 0,
4064 spacing_equal = 1,
4065 spacing_fractional_even = 2,
4066 spacing_fractional_odd = 3,
4067 vertex_order_cw = 4,
4068 vertex_order_ccw = 5,
4069 pixel_center_integer = 6,
4070 origin_upper_left = 7,
4071 origin_lower_left = 8,
4072 early_fragment_tests = 9,
4073 point_mode = 10,
4074 xfb = 11,
4075 depth_replacing = 12,
4076 depth_greater = 14,
4077 depth_less = 15,
4078 depth_unchanged = 16,
4079 local_size = 17,
4080 local_size_hint = 18,
4081 input_points = 19,
4082 input_lines = 20,
4083 input_lines_adjacency = 21,
4084 triangles = 22,
4085 input_triangles_adjacency = 23,
4086 quads = 24,
4087 isolines = 25,
4088 output_vertices = 26,
4089 output_points = 27,
4090 output_line_strip = 28,
4091 output_triangle_strip = 29,
4092 vec_type_hint = 30,
4093 contraction_off = 31,
4094 initializer = 33,
4095 finalizer = 34,
4096 subgroup_size = 35,
4097 subgroups_per_workgroup = 36,
4098 subgroups_per_workgroup_id = 37,
4099 local_size_id = 38,
4100 local_size_hint_id = 39,
4101 non_coherent_color_attachment_read_ext = 4169,
4102 non_coherent_depth_attachment_read_ext = 4170,
4103 non_coherent_stencil_attachment_read_ext = 4171,
4104 subgroup_uniform_control_flow_khr = 4421,
4105 post_depth_coverage = 4446,
4106 denorm_preserve = 4459,
4107 denorm_flush_to_zero = 4460,
4108 signed_zero_inf_nan_preserve = 4461,
4109 rounding_mode_rte = 4462,
4110 rounding_mode_rtz = 4463,
4111 non_coherent_tile_attachment_read_qcom = 4489,
4112 tile_shading_rate_qcom = 4490,
4113 early_and_late_fragment_tests_amd = 5017,
4114 stencil_ref_replacing_ext = 5027,
4115 coalescing_amdx = 5069,
4116 is_api_entry_amdx = 5070,
4117 max_node_recursion_amdx = 5071,
4118 static_num_workgroups_amdx = 5072,
4119 shader_index_amdx = 5073,
4120 max_num_workgroups_amdx = 5077,
4121 stencil_ref_unchanged_front_amd = 5079,
4122 stencil_ref_greater_front_amd = 5080,
4123 stencil_ref_less_front_amd = 5081,
4124 stencil_ref_unchanged_back_amd = 5082,
4125 stencil_ref_greater_back_amd = 5083,
4126 stencil_ref_less_back_amd = 5084,
4127 quad_derivatives_khr = 5088,
4128 require_full_quads_khr = 5089,
4129 shares_input_with_amdx = 5102,
4130 output_lines_ext = 5269,
4131 output_primitives_ext = 5270,
4132 derivative_group_quads_khr = 5289,
4133 derivative_group_linear_khr = 5290,
4134 output_triangles_ext = 5298,
4135 pixel_interlock_ordered_ext = 5366,
4136 pixel_interlock_unordered_ext = 5367,
4137 sample_interlock_ordered_ext = 5368,
4138 sample_interlock_unordered_ext = 5369,
4139 shading_rate_interlock_ordered_ext = 5370,
4140 shading_rate_interlock_unordered_ext = 5371,
4141 shared_local_memory_size_intel = 5618,
4142 rounding_mode_rtpintel = 5620,
4143 rounding_mode_rtnintel = 5621,
4144 floating_point_mode_altintel = 5622,
4145 floating_point_mode_ieeeintel = 5623,
4146 max_workgroup_size_intel = 5893,
4147 max_work_dim_intel = 5894,
4148 no_global_offset_intel = 5895,
4149 num_simd_workitems_intel = 5896,
4150 scheduler_target_fmax_mhz_intel = 5903,
4151 maximally_reconverges_khr = 6023,
4152 fp_fast_math_default = 6028,
4153 streaming_interface_intel = 6154,
4154 register_map_interface_intel = 6160,
4155 named_barrier_count_intel = 6417,
4156 maximum_registers_intel = 6461,
4157 maximum_registers_id_intel = 6462,
4158 named_maximum_registers_intel = 6463,
4159
4160 pub const Extended = union(ExecutionMode) {
4161 invocations: struct { literal_integer: LiteralInteger },
4162 spacing_equal,
4163 spacing_fractional_even,
4164 spacing_fractional_odd,
4165 vertex_order_cw,
4166 vertex_order_ccw,
4167 pixel_center_integer,
4168 origin_upper_left,
4169 origin_lower_left,
4170 early_fragment_tests,
4171 point_mode,
4172 xfb,
4173 depth_replacing,
4174 depth_greater,
4175 depth_less,
4176 depth_unchanged,
4177 local_size: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4178 local_size_hint: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4179 input_points,
4180 input_lines,
4181 input_lines_adjacency,
4182 triangles,
4183 input_triangles_adjacency,
4184 quads,
4185 isolines,
4186 output_vertices: struct { vertex_count: LiteralInteger },
4187 output_points,
4188 output_line_strip,
4189 output_triangle_strip,
4190 vec_type_hint: struct { vector_type: LiteralInteger },
4191 contraction_off,
4192 initializer,
4193 finalizer,
4194 subgroup_size: struct { subgroup_size: LiteralInteger },
4195 subgroups_per_workgroup: struct { subgroups_per_workgroup: LiteralInteger },
4196 subgroups_per_workgroup_id: struct { subgroups_per_workgroup: Id },
4197 local_size_id: struct { x_size: Id, y_size: Id, z_size: Id },
4198 local_size_hint_id: struct { x_size_hint: Id, y_size_hint: Id, z_size_hint: Id },
4199 non_coherent_color_attachment_read_ext,
4200 non_coherent_depth_attachment_read_ext,
4201 non_coherent_stencil_attachment_read_ext,
4202 subgroup_uniform_control_flow_khr,
4203 post_depth_coverage,
4204 denorm_preserve: struct { target_width: LiteralInteger },
4205 denorm_flush_to_zero: struct { target_width: LiteralInteger },
4206 signed_zero_inf_nan_preserve: struct { target_width: LiteralInteger },
4207 rounding_mode_rte: struct { target_width: LiteralInteger },
4208 rounding_mode_rtz: struct { target_width: LiteralInteger },
4209 non_coherent_tile_attachment_read_qcom,
4210 tile_shading_rate_qcom: struct { x_rate: LiteralInteger, y_rate: LiteralInteger, z_rate: LiteralInteger },
4211 early_and_late_fragment_tests_amd,
4212 stencil_ref_replacing_ext,
4213 coalescing_amdx,
4214 is_api_entry_amdx: struct { is_entry: Id },
4215 max_node_recursion_amdx: struct { number_of_recursions: Id },
4216 static_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4217 shader_index_amdx: struct { shader_index: Id },
4218 max_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4219 stencil_ref_unchanged_front_amd,
4220 stencil_ref_greater_front_amd,
4221 stencil_ref_less_front_amd,
4222 stencil_ref_unchanged_back_amd,
4223 stencil_ref_greater_back_amd,
4224 stencil_ref_less_back_amd,
4225 quad_derivatives_khr,
4226 require_full_quads_khr,
4227 shares_input_with_amdx: struct { node_name: Id, shader_index: Id },
4228 output_lines_ext,
4229 output_primitives_ext: struct { primitive_count: LiteralInteger },
4230 derivative_group_quads_khr,
4231 derivative_group_linear_khr,
4232 output_triangles_ext,
4233 pixel_interlock_ordered_ext,
4234 pixel_interlock_unordered_ext,
4235 sample_interlock_ordered_ext,
4236 sample_interlock_unordered_ext,
4237 shading_rate_interlock_ordered_ext,
4238 shading_rate_interlock_unordered_ext,
4239 shared_local_memory_size_intel: struct { size: LiteralInteger },
4240 rounding_mode_rtpintel: struct { target_width: LiteralInteger },
4241 rounding_mode_rtnintel: struct { target_width: LiteralInteger },
4242 floating_point_mode_altintel: struct { target_width: LiteralInteger },
4243 floating_point_mode_ieeeintel: struct { target_width: LiteralInteger },
4244 max_workgroup_size_intel: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger, literal_integer_2: LiteralInteger },
4245 max_work_dim_intel: struct { literal_integer: LiteralInteger },
4246 no_global_offset_intel,
4247 num_simd_workitems_intel: struct { literal_integer: LiteralInteger },
4248 scheduler_target_fmax_mhz_intel: struct { literal_integer: LiteralInteger },
4249 maximally_reconverges_khr,
4250 fp_fast_math_default: struct { target_type: Id, id_ref_1: Id },
4251 streaming_interface_intel: struct { stall_free_return: LiteralInteger },
4252 register_map_interface_intel: struct { wait_for_done_write: LiteralInteger },
4253 named_barrier_count_intel: struct { barrier_count: LiteralInteger },
4254 maximum_registers_intel: struct { number_of_registers: LiteralInteger },
4255 maximum_registers_id_intel: struct { number_of_registers: Id },
4256 named_maximum_registers_intel: struct { named_maximum_number_of_registers: NamedMaximumNumberOfRegisters },
4257 };
4258};
4259pub const StorageClass = enum(u32) {
4260 uniform_constant = 0,
4261 input = 1,
4262 uniform = 2,
4263 output = 3,
4264 workgroup = 4,
4265 cross_workgroup = 5,
4266 private = 6,
4267 function = 7,
4268 generic = 8,
4269 push_constant = 9,
4270 atomic_counter = 10,
4271 image = 11,
4272 storage_buffer = 12,
4273 tile_image_ext = 4172,
4274 tile_attachment_qcom = 4491,
4275 node_payload_amdx = 5068,
4276 callable_data_khr = 5328,
4277 incoming_callable_data_khr = 5329,
4278 ray_payload_khr = 5338,
4279 hit_attribute_khr = 5339,
4280 incoming_ray_payload_khr = 5342,
4281 shader_record_buffer_khr = 5343,
4282 physical_storage_buffer = 5349,
4283 hit_object_attribute_nv = 5385,
4284 task_payload_workgroup_ext = 5402,
4285 code_section_intel = 5605,
4286 device_only_intel = 5936,
4287 host_only_intel = 5937,
4288};
4289pub const Dim = enum(u32) {
4290 @"1d" = 0,
4291 @"2d" = 1,
4292 @"3d" = 2,
4293 cube = 3,
4294 rect = 4,
4295 buffer = 5,
4296 subpass_data = 6,
4297 tile_image_data_ext = 4173,
4298};
4299pub const SamplerAddressingMode = enum(u32) {
4300 none = 0,
4301 clamp_to_edge = 1,
4302 clamp = 2,
4303 repeat = 3,
4304 repeat_mirrored = 4,
4305};
4306pub const SamplerFilterMode = enum(u32) {
4307 nearest = 0,
4308 linear = 1,
4309};
4310pub const ImageFormat = enum(u32) {
4311 unknown = 0,
4312 rgba32f = 1,
4313 rgba16f = 2,
4314 r32f = 3,
4315 rgba8 = 4,
4316 rgba8snorm = 5,
4317 rg32f = 6,
4318 rg16f = 7,
4319 r11f_g11f_b10f = 8,
4320 r16f = 9,
4321 rgba16 = 10,
4322 rgb10a2 = 11,
4323 rg16 = 12,
4324 rg8 = 13,
4325 r16 = 14,
4326 r8 = 15,
4327 rgba16snorm = 16,
4328 rg16snorm = 17,
4329 rg8snorm = 18,
4330 r16snorm = 19,
4331 r8snorm = 20,
4332 rgba32i = 21,
4333 rgba16i = 22,
4334 rgba8i = 23,
4335 r32i = 24,
4336 rg32i = 25,
4337 rg16i = 26,
4338 rg8i = 27,
4339 r16i = 28,
4340 r8i = 29,
4341 rgba32ui = 30,
4342 rgba16ui = 31,
4343 rgba8ui = 32,
4344 r32ui = 33,
4345 rgb10a2ui = 34,
4346 rg32ui = 35,
4347 rg16ui = 36,
4348 rg8ui = 37,
4349 r16ui = 38,
4350 r8ui = 39,
4351 r64ui = 40,
4352 r64i = 41,
4353};
4354pub const ImageChannelOrder = enum(u32) {
4355 r = 0,
4356 a = 1,
4357 rg = 2,
4358 ra = 3,
4359 rgb = 4,
4360 rgba = 5,
4361 bgra = 6,
4362 argb = 7,
4363 intensity = 8,
4364 luminance = 9,
4365 rx = 10,
4366 r_gx = 11,
4367 rg_bx = 12,
4368 depth = 13,
4369 depth_stencil = 14,
4370 s_rgb = 15,
4371 s_rg_bx = 16,
4372 s_rgba = 17,
4373 s_bgra = 18,
4374 abgr = 19,
4375};
4376pub const ImageChannelDataType = enum(u32) {
4377 snorm_int8 = 0,
4378 snorm_int16 = 1,
4379 unorm_int8 = 2,
4380 unorm_int16 = 3,
4381 unorm_short565 = 4,
4382 unorm_short555 = 5,
4383 unorm_int101010 = 6,
4384 signed_int8 = 7,
4385 signed_int16 = 8,
4386 signed_int32 = 9,
4387 unsigned_int8 = 10,
4388 unsigned_int16 = 11,
4389 unsigned_int32 = 12,
4390 half_float = 13,
4391 float = 14,
4392 unorm_int24 = 15,
4393 unorm_int101010_2 = 16,
4394 unorm_int10x6ext = 17,
4395 unsigned_int_raw10ext = 19,
4396 unsigned_int_raw12ext = 20,
4397 unorm_int2_101010ext = 21,
4398 unsigned_int10x6ext = 22,
4399 unsigned_int12x4ext = 23,
4400 unsigned_int14x2ext = 24,
4401 unorm_int12x4ext = 25,
4402 unorm_int14x2ext = 26,
4403};
4404pub const FPRoundingMode = enum(u32) {
4405 rte = 0,
4406 rtz = 1,
4407 rtp = 2,
4408 rtn = 3,
4409};
4410pub const FPDenormMode = enum(u32) {
4411 preserve = 0,
4412 flush_to_zero = 1,
4413};
4414pub const QuantizationModes = enum(u32) {
4415 trn = 0,
4416 trn_zero = 1,
4417 rnd = 2,
4418 rnd_zero = 3,
4419 rnd_inf = 4,
4420 rnd_min_inf = 5,
4421 rnd_conv = 6,
4422 rnd_conv_odd = 7,
4423};
4424pub const FPOperationMode = enum(u32) {
4425 ieee = 0,
4426 alt = 1,
4427};
4428pub const OverflowModes = enum(u32) {
4429 wrap = 0,
4430 sat = 1,
4431 sat_zero = 2,
4432 sat_sym = 3,
4433};
4434pub const LinkageType = enum(u32) {
4435 @"export" = 0,
4436 import = 1,
4437 link_once_odr = 2,
4438};
4439pub const AccessQualifier = enum(u32) {
4440 read_only = 0,
4441 write_only = 1,
4442 read_write = 2,
4443};
4444pub const HostAccessQualifier = enum(u32) {
4445 none_intel = 0,
4446 read_intel = 1,
4447 write_intel = 2,
4448 read_write_intel = 3,
4449};
4450pub const FunctionParameterAttribute = enum(u32) {
4451 zext = 0,
4452 sext = 1,
4453 by_val = 2,
4454 sret = 3,
4455 no_alias = 4,
4456 no_capture = 5,
4457 no_write = 6,
4458 no_read_write = 7,
4459 runtime_aligned_intel = 5940,
4460};
4461pub const Decoration = enum(u32) {
4462 relaxed_precision = 0,
4463 spec_id = 1,
4464 block = 2,
4465 buffer_block = 3,
4466 row_major = 4,
4467 col_major = 5,
4468 array_stride = 6,
4469 matrix_stride = 7,
4470 glsl_shared = 8,
4471 glsl_packed = 9,
4472 c_packed = 10,
4473 built_in = 11,
4474 no_perspective = 13,
4475 flat = 14,
4476 patch = 15,
4477 centroid = 16,
4478 sample = 17,
4479 invariant = 18,
4480 restrict = 19,
4481 aliased = 20,
4482 @"volatile" = 21,
4483 constant = 22,
4484 coherent = 23,
4485 non_writable = 24,
4486 non_readable = 25,
4487 uniform = 26,
4488 uniform_id = 27,
4489 saturated_conversion = 28,
4490 stream = 29,
4491 location = 30,
4492 component = 31,
4493 index = 32,
4494 binding = 33,
4495 descriptor_set = 34,
4496 offset = 35,
4497 xfb_buffer = 36,
4498 xfb_stride = 37,
4499 func_param_attr = 38,
4500 fp_rounding_mode = 39,
4501 fp_fast_math_mode = 40,
4502 linkage_attributes = 41,
4503 no_contraction = 42,
4504 input_attachment_index = 43,
4505 alignment = 44,
4506 max_byte_offset = 45,
4507 alignment_id = 46,
4508 max_byte_offset_id = 47,
4509 saturated_to_largest_float8normal_conversion_ext = 4216,
4510 no_signed_wrap = 4469,
4511 no_unsigned_wrap = 4470,
4512 weight_texture_qcom = 4487,
4513 block_match_texture_qcom = 4488,
4514 block_match_sampler_qcom = 4499,
4515 explicit_interp_amd = 4999,
4516 node_shares_payload_limits_with_amdx = 5019,
4517 node_max_payloads_amdx = 5020,
4518 track_finish_writing_amdx = 5078,
4519 payload_node_name_amdx = 5091,
4520 payload_node_base_index_amdx = 5098,
4521 payload_node_sparse_array_amdx = 5099,
4522 payload_node_array_size_amdx = 5100,
4523 payload_dispatch_indirect_amdx = 5105,
4524 override_coverage_nv = 5248,
4525 passthrough_nv = 5250,
4526 viewport_relative_nv = 5252,
4527 secondary_viewport_relative_nv = 5256,
4528 per_primitive_ext = 5271,
4529 per_view_nv = 5272,
4530 per_task_nv = 5273,
4531 per_vertex_khr = 5285,
4532 non_uniform = 5300,
4533 restrict_pointer = 5355,
4534 aliased_pointer = 5356,
4535 hit_object_shader_record_buffer_nv = 5386,
4536 bindless_sampler_nv = 5398,
4537 bindless_image_nv = 5399,
4538 bound_sampler_nv = 5400,
4539 bound_image_nv = 5401,
4540 simt_call_intel = 5599,
4541 referenced_indirectly_intel = 5602,
4542 clobber_intel = 5607,
4543 side_effects_intel = 5608,
4544 vector_compute_variable_intel = 5624,
4545 func_param_io_kind_intel = 5625,
4546 vector_compute_function_intel = 5626,
4547 stack_call_intel = 5627,
4548 global_variable_offset_intel = 5628,
4549 counter_buffer = 5634,
4550 user_semantic = 5635,
4551 user_type_google = 5636,
4552 function_rounding_mode_intel = 5822,
4553 function_denorm_mode_intel = 5823,
4554 register_intel = 5825,
4555 memory_intel = 5826,
4556 numbanks_intel = 5827,
4557 bankwidth_intel = 5828,
4558 max_private_copies_intel = 5829,
4559 singlepump_intel = 5830,
4560 doublepump_intel = 5831,
4561 max_replicates_intel = 5832,
4562 simple_dual_port_intel = 5833,
4563 merge_intel = 5834,
4564 bank_bits_intel = 5835,
4565 force_pow2depth_intel = 5836,
4566 stridesize_intel = 5883,
4567 wordsize_intel = 5884,
4568 true_dual_port_intel = 5885,
4569 burst_coalesce_intel = 5899,
4570 cache_size_intel = 5900,
4571 dont_statically_coalesce_intel = 5901,
4572 prefetch_intel = 5902,
4573 stall_enable_intel = 5905,
4574 fuse_loops_in_function_intel = 5907,
4575 math_op_dsp_mode_intel = 5909,
4576 alias_scope_intel = 5914,
4577 no_alias_intel = 5915,
4578 initiation_interval_intel = 5917,
4579 max_concurrency_intel = 5918,
4580 pipeline_enable_intel = 5919,
4581 buffer_location_intel = 5921,
4582 io_pipe_storage_intel = 5944,
4583 function_floating_point_mode_intel = 6080,
4584 single_element_vector_intel = 6085,
4585 vector_compute_callable_function_intel = 6087,
4586 media_block_iointel = 6140,
4587 stall_free_intel = 6151,
4588 fp_max_error_decoration_intel = 6170,
4589 latency_control_label_intel = 6172,
4590 latency_control_constraint_intel = 6173,
4591 conduit_kernel_argument_intel = 6175,
4592 register_map_kernel_argument_intel = 6176,
4593 mm_host_interface_address_width_intel = 6177,
4594 mm_host_interface_data_width_intel = 6178,
4595 mm_host_interface_latency_intel = 6179,
4596 mm_host_interface_read_write_mode_intel = 6180,
4597 mm_host_interface_max_burst_intel = 6181,
4598 mm_host_interface_wait_request_intel = 6182,
4599 stable_kernel_argument_intel = 6183,
4600 host_access_intel = 6188,
4601 init_mode_intel = 6190,
4602 implement_in_register_map_intel = 6191,
4603 cache_control_load_intel = 6442,
4604 cache_control_store_intel = 6443,
4605
4606 pub const Extended = union(Decoration) {
4607 relaxed_precision,
4608 spec_id: struct { specialization_constant_id: LiteralInteger },
4609 block,
4610 buffer_block,
4611 row_major,
4612 col_major,
4613 array_stride: struct { array_stride: LiteralInteger },
4614 matrix_stride: struct { matrix_stride: LiteralInteger },
4615 glsl_shared,
4616 glsl_packed,
4617 c_packed,
4618 built_in: struct { built_in: BuiltIn },
4619 no_perspective,
4620 flat,
4621 patch,
4622 centroid,
4623 sample,
4624 invariant,
4625 restrict,
4626 aliased,
4627 @"volatile",
4628 constant,
4629 coherent,
4630 non_writable,
4631 non_readable,
4632 uniform,
4633 uniform_id: struct { execution: Id },
4634 saturated_conversion,
4635 stream: struct { stream_number: LiteralInteger },
4636 location: struct { location: LiteralInteger },
4637 component: struct { component: LiteralInteger },
4638 index: struct { index: LiteralInteger },
4639 binding: struct { binding_point: LiteralInteger },
4640 descriptor_set: struct { descriptor_set: LiteralInteger },
4641 offset: struct { byte_offset: LiteralInteger },
4642 xfb_buffer: struct { xfb_buffer_number: LiteralInteger },
4643 xfb_stride: struct { xfb_stride: LiteralInteger },
4644 func_param_attr: struct { function_parameter_attribute: FunctionParameterAttribute },
4645 fp_rounding_mode: struct { fp_rounding_mode: FPRoundingMode },
4646 fp_fast_math_mode: struct { fp_fast_math_mode: FPFastMathMode },
4647 linkage_attributes: struct { name: LiteralString, linkage_type: LinkageType },
4648 no_contraction,
4649 input_attachment_index: struct { attachment_index: LiteralInteger },
4650 alignment: struct { alignment: LiteralInteger },
4651 max_byte_offset: struct { max_byte_offset: LiteralInteger },
4652 alignment_id: struct { alignment: Id },
4653 max_byte_offset_id: struct { max_byte_offset: Id },
4654 saturated_to_largest_float8normal_conversion_ext,
4655 no_signed_wrap,
4656 no_unsigned_wrap,
4657 weight_texture_qcom,
4658 block_match_texture_qcom,
4659 block_match_sampler_qcom,
4660 explicit_interp_amd,
4661 node_shares_payload_limits_with_amdx: struct { payload_type: Id },
4662 node_max_payloads_amdx: struct { max_number_of_payloads: Id },
4663 track_finish_writing_amdx,
4664 payload_node_name_amdx: struct { node_name: Id },
4665 payload_node_base_index_amdx: struct { base_index: Id },
4666 payload_node_sparse_array_amdx,
4667 payload_node_array_size_amdx: struct { array_size: Id },
4668 payload_dispatch_indirect_amdx,
4669 override_coverage_nv,
4670 passthrough_nv,
4671 viewport_relative_nv,
4672 secondary_viewport_relative_nv: struct { offset: LiteralInteger },
4673 per_primitive_ext,
4674 per_view_nv,
4675 per_task_nv,
4676 per_vertex_khr,
4677 non_uniform,
4678 restrict_pointer,
4679 aliased_pointer,
4680 hit_object_shader_record_buffer_nv,
4681 bindless_sampler_nv,
4682 bindless_image_nv,
4683 bound_sampler_nv,
4684 bound_image_nv,
4685 simt_call_intel: struct { n: LiteralInteger },
4686 referenced_indirectly_intel,
4687 clobber_intel: struct { register: LiteralString },
4688 side_effects_intel,
4689 vector_compute_variable_intel,
4690 func_param_io_kind_intel: struct { kind: LiteralInteger },
4691 vector_compute_function_intel,
4692 stack_call_intel,
4693 global_variable_offset_intel: struct { offset: LiteralInteger },
4694 counter_buffer: struct { counter_buffer: Id },
4695 user_semantic: struct { semantic: LiteralString },
4696 user_type_google: struct { user_type: LiteralString },
4697 function_rounding_mode_intel: struct { target_width: LiteralInteger, fp_rounding_mode: FPRoundingMode },
4698 function_denorm_mode_intel: struct { target_width: LiteralInteger, fp_denorm_mode: FPDenormMode },
4699 register_intel,
4700 memory_intel: struct { memory_type: LiteralString },
4701 numbanks_intel: struct { banks: LiteralInteger },
4702 bankwidth_intel: struct { bank_width: LiteralInteger },
4703 max_private_copies_intel: struct { maximum_copies: LiteralInteger },
4704 singlepump_intel,
4705 doublepump_intel,
4706 max_replicates_intel: struct { maximum_replicates: LiteralInteger },
4707 simple_dual_port_intel,
4708 merge_intel: struct { merge_key: LiteralString, merge_type: LiteralString },
4709 bank_bits_intel: struct { bank_bits: []const LiteralInteger = &.{} },
4710 force_pow2depth_intel: struct { force_key: LiteralInteger },
4711 stridesize_intel: struct { stride_size: LiteralInteger },
4712 wordsize_intel: struct { word_size: LiteralInteger },
4713 true_dual_port_intel,
4714 burst_coalesce_intel,
4715 cache_size_intel: struct { cache_size_in_bytes: LiteralInteger },
4716 dont_statically_coalesce_intel,
4717 prefetch_intel: struct { prefetcher_size_in_bytes: LiteralInteger },
4718 stall_enable_intel,
4719 fuse_loops_in_function_intel,
4720 math_op_dsp_mode_intel: struct { mode: LiteralInteger, propagate: LiteralInteger },
4721 alias_scope_intel: struct { aliasing_scopes_list: Id },
4722 no_alias_intel: struct { aliasing_scopes_list: Id },
4723 initiation_interval_intel: struct { cycles: LiteralInteger },
4724 max_concurrency_intel: struct { invocations: LiteralInteger },
4725 pipeline_enable_intel: struct { enable: LiteralInteger },
4726 buffer_location_intel: struct { buffer_location_id: LiteralInteger },
4727 io_pipe_storage_intel: struct { io_pipe_id: LiteralInteger },
4728 function_floating_point_mode_intel: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },
4729 single_element_vector_intel,
4730 vector_compute_callable_function_intel,
4731 media_block_iointel,
4732 stall_free_intel,
4733 fp_max_error_decoration_intel: struct { max_error: LiteralFloat },
4734 latency_control_label_intel: struct { latency_label: LiteralInteger },
4735 latency_control_constraint_intel: struct { relative_to: LiteralInteger, control_type: LiteralInteger, relative_cycle: LiteralInteger },
4736 conduit_kernel_argument_intel,
4737 register_map_kernel_argument_intel,
4738 mm_host_interface_address_width_intel: struct { address_width: LiteralInteger },
4739 mm_host_interface_data_width_intel: struct { data_width: LiteralInteger },
4740 mm_host_interface_latency_intel: struct { latency: LiteralInteger },
4741 mm_host_interface_read_write_mode_intel: struct { read_write_mode: AccessQualifier },
4742 mm_host_interface_max_burst_intel: struct { max_burst_count: LiteralInteger },
4743 mm_host_interface_wait_request_intel: struct { waitrequest: LiteralInteger },
4744 stable_kernel_argument_intel,
4745 host_access_intel: struct { access: HostAccessQualifier, name: LiteralString },
4746 init_mode_intel: struct { trigger: InitializationModeQualifier },
4747 implement_in_register_map_intel: struct { value: LiteralInteger },
4748 cache_control_load_intel: struct { cache_level: LiteralInteger, cache_control: LoadCacheControl },
4749 cache_control_store_intel: struct { cache_level: LiteralInteger, cache_control: StoreCacheControl },
4750 };
4751};
4752pub const BuiltIn = enum(u32) {
4753 position = 0,
4754 point_size = 1,
4755 clip_distance = 3,
4756 cull_distance = 4,
4757 vertex_id = 5,
4758 instance_id = 6,
4759 primitive_id = 7,
4760 invocation_id = 8,
4761 layer = 9,
4762 viewport_index = 10,
4763 tess_level_outer = 11,
4764 tess_level_inner = 12,
4765 tess_coord = 13,
4766 patch_vertices = 14,
4767 frag_coord = 15,
4768 point_coord = 16,
4769 front_facing = 17,
4770 sample_id = 18,
4771 sample_position = 19,
4772 sample_mask = 20,
4773 frag_depth = 22,
4774 helper_invocation = 23,
4775 num_workgroups = 24,
4776 workgroup_size = 25,
4777 workgroup_id = 26,
4778 local_invocation_id = 27,
4779 global_invocation_id = 28,
4780 local_invocation_index = 29,
4781 work_dim = 30,
4782 global_size = 31,
4783 enqueued_workgroup_size = 32,
4784 global_offset = 33,
4785 global_linear_id = 34,
4786 subgroup_size = 36,
4787 subgroup_max_size = 37,
4788 num_subgroups = 38,
4789 num_enqueued_subgroups = 39,
4790 subgroup_id = 40,
4791 subgroup_local_invocation_id = 41,
4792 vertex_index = 42,
4793 instance_index = 43,
4794 core_idarm = 4160,
4795 core_count_arm = 4161,
4796 core_max_idarm = 4162,
4797 warp_idarm = 4163,
4798 warp_max_idarm = 4164,
4799 subgroup_eq_mask = 4416,
4800 subgroup_ge_mask = 4417,
4801 subgroup_gt_mask = 4418,
4802 subgroup_le_mask = 4419,
4803 subgroup_lt_mask = 4420,
4804 base_vertex = 4424,
4805 base_instance = 4425,
4806 draw_index = 4426,
4807 primitive_shading_rate_khr = 4432,
4808 device_index = 4438,
4809 view_index = 4440,
4810 shading_rate_khr = 4444,
4811 tile_offset_qcom = 4492,
4812 tile_dimension_qcom = 4493,
4813 tile_apron_size_qcom = 4494,
4814 bary_coord_no_persp_amd = 4992,
4815 bary_coord_no_persp_centroid_amd = 4993,
4816 bary_coord_no_persp_sample_amd = 4994,
4817 bary_coord_smooth_amd = 4995,
4818 bary_coord_smooth_centroid_amd = 4996,
4819 bary_coord_smooth_sample_amd = 4997,
4820 bary_coord_pull_model_amd = 4998,
4821 frag_stencil_ref_ext = 5014,
4822 remaining_recursion_levels_amdx = 5021,
4823 shader_index_amdx = 5073,
4824 viewport_mask_nv = 5253,
4825 secondary_position_nv = 5257,
4826 secondary_viewport_mask_nv = 5258,
4827 position_per_view_nv = 5261,
4828 viewport_mask_per_view_nv = 5262,
4829 fully_covered_ext = 5264,
4830 task_count_nv = 5274,
4831 primitive_count_nv = 5275,
4832 primitive_indices_nv = 5276,
4833 clip_distance_per_view_nv = 5277,
4834 cull_distance_per_view_nv = 5278,
4835 layer_per_view_nv = 5279,
4836 mesh_view_count_nv = 5280,
4837 mesh_view_indices_nv = 5281,
4838 bary_coord_khr = 5286,
4839 bary_coord_no_persp_khr = 5287,
4840 frag_size_ext = 5292,
4841 frag_invocation_count_ext = 5293,
4842 primitive_point_indices_ext = 5294,
4843 primitive_line_indices_ext = 5295,
4844 primitive_triangle_indices_ext = 5296,
4845 cull_primitive_ext = 5299,
4846 launch_id_khr = 5319,
4847 launch_size_khr = 5320,
4848 world_ray_origin_khr = 5321,
4849 world_ray_direction_khr = 5322,
4850 object_ray_origin_khr = 5323,
4851 object_ray_direction_khr = 5324,
4852 ray_tmin_khr = 5325,
4853 ray_tmax_khr = 5326,
4854 instance_custom_index_khr = 5327,
4855 object_to_world_khr = 5330,
4856 world_to_object_khr = 5331,
4857 hit_tnv = 5332,
4858 hit_kind_khr = 5333,
4859 current_ray_time_nv = 5334,
4860 hit_triangle_vertex_positions_khr = 5335,
4861 hit_micro_triangle_vertex_positions_nv = 5337,
4862 hit_micro_triangle_vertex_barycentrics_nv = 5344,
4863 incoming_ray_flags_khr = 5351,
4864 ray_geometry_index_khr = 5352,
4865 hit_is_sphere_nv = 5359,
4866 hit_is_lssnv = 5360,
4867 hit_sphere_position_nv = 5361,
4868 warps_per_smnv = 5374,
4869 sm_count_nv = 5375,
4870 warp_idnv = 5376,
4871 smidnv = 5377,
4872 hit_lss_positions_nv = 5396,
4873 hit_kind_front_facing_micro_triangle_nv = 5405,
4874 hit_kind_back_facing_micro_triangle_nv = 5406,
4875 hit_sphere_radius_nv = 5420,
4876 hit_lss_radii_nv = 5421,
4877 cluster_idnv = 5436,
4878 cull_mask_khr = 6021,
4879};
4880pub const Scope = enum(u32) {
4881 cross_device = 0,
4882 device = 1,
4883 workgroup = 2,
4884 subgroup = 3,
4885 invocation = 4,
4886 queue_family = 5,
4887 shader_call_khr = 6,
4888};
4889pub const GroupOperation = enum(u32) {
4890 reduce = 0,
4891 inclusive_scan = 1,
4892 exclusive_scan = 2,
4893 clustered_reduce = 3,
4894 partitioned_reduce_nv = 6,
4895 partitioned_inclusive_scan_nv = 7,
4896 partitioned_exclusive_scan_nv = 8,
4897};
4898pub const KernelEnqueueFlags = enum(u32) {
4899 no_wait = 0,
4900 wait_kernel = 1,
4901 wait_work_group = 2,
4902};
4903pub const Capability = enum(u32) {
4904 matrix = 0,
4905 shader = 1,
4906 geometry = 2,
4907 tessellation = 3,
4908 addresses = 4,
4909 linkage = 5,
4910 kernel = 6,
4911 vector16 = 7,
4912 float16buffer = 8,
4913 float16 = 9,
4914 float64 = 10,
4915 int64 = 11,
4916 int64atomics = 12,
4917 image_basic = 13,
4918 image_read_write = 14,
4919 image_mipmap = 15,
4920 pipes = 17,
4921 groups = 18,
4922 device_enqueue = 19,
4923 literal_sampler = 20,
4924 atomic_storage = 21,
4925 int16 = 22,
4926 tessellation_point_size = 23,
4927 geometry_point_size = 24,
4928 image_gather_extended = 25,
4929 storage_image_multisample = 27,
4930 uniform_buffer_array_dynamic_indexing = 28,
4931 sampled_image_array_dynamic_indexing = 29,
4932 storage_buffer_array_dynamic_indexing = 30,
4933 storage_image_array_dynamic_indexing = 31,
4934 clip_distance = 32,
4935 cull_distance = 33,
4936 image_cube_array = 34,
4937 sample_rate_shading = 35,
4938 image_rect = 36,
4939 sampled_rect = 37,
4940 generic_pointer = 38,
4941 int8 = 39,
4942 input_attachment = 40,
4943 sparse_residency = 41,
4944 min_lod = 42,
4945 sampled1d = 43,
4946 image1d = 44,
4947 sampled_cube_array = 45,
4948 sampled_buffer = 46,
4949 image_buffer = 47,
4950 image_ms_array = 48,
4951 storage_image_extended_formats = 49,
4952 image_query = 50,
4953 derivative_control = 51,
4954 interpolation_function = 52,
4955 transform_feedback = 53,
4956 geometry_streams = 54,
4957 storage_image_read_without_format = 55,
4958 storage_image_write_without_format = 56,
4959 multi_viewport = 57,
4960 subgroup_dispatch = 58,
4961 named_barrier = 59,
4962 pipe_storage = 60,
4963 group_non_uniform = 61,
4964 group_non_uniform_vote = 62,
4965 group_non_uniform_arithmetic = 63,
4966 group_non_uniform_ballot = 64,
4967 group_non_uniform_shuffle = 65,
4968 group_non_uniform_shuffle_relative = 66,
4969 group_non_uniform_clustered = 67,
4970 group_non_uniform_quad = 68,
4971 shader_layer = 69,
4972 shader_viewport_index = 70,
4973 uniform_decoration = 71,
4974 core_builtins_arm = 4165,
4975 tile_image_color_read_access_ext = 4166,
4976 tile_image_depth_read_access_ext = 4167,
4977 tile_image_stencil_read_access_ext = 4168,
4978 tensors_arm = 4174,
4979 storage_tensor_array_dynamic_indexing_arm = 4175,
4980 storage_tensor_array_non_uniform_indexing_arm = 4176,
4981 graph_arm = 4191,
4982 cooperative_matrix_layouts_arm = 4201,
4983 float8ext = 4212,
4984 float8cooperative_matrix_ext = 4213,
4985 fragment_shading_rate_khr = 4422,
4986 subgroup_ballot_khr = 4423,
4987 draw_parameters = 4427,
4988 workgroup_memory_explicit_layout_khr = 4428,
4989 workgroup_memory_explicit_layout8bit_access_khr = 4429,
4990 workgroup_memory_explicit_layout16bit_access_khr = 4430,
4991 subgroup_vote_khr = 4431,
4992 storage_buffer16bit_access = 4433,
4993 uniform_and_storage_buffer16bit_access = 4434,
4994 storage_push_constant16 = 4435,
4995 storage_input_output16 = 4436,
4996 device_group = 4437,
4997 multi_view = 4439,
4998 variable_pointers_storage_buffer = 4441,
4999 variable_pointers = 4442,
5000 atomic_storage_ops = 4445,
5001 sample_mask_post_depth_coverage = 4447,
5002 storage_buffer8bit_access = 4448,
5003 uniform_and_storage_buffer8bit_access = 4449,
5004 storage_push_constant8 = 4450,
5005 denorm_preserve = 4464,
5006 denorm_flush_to_zero = 4465,
5007 signed_zero_inf_nan_preserve = 4466,
5008 rounding_mode_rte = 4467,
5009 rounding_mode_rtz = 4468,
5010 ray_query_provisional_khr = 4471,
5011 ray_query_khr = 4472,
5012 untyped_pointers_khr = 4473,
5013 ray_traversal_primitive_culling_khr = 4478,
5014 ray_tracing_khr = 4479,
5015 texture_sample_weighted_qcom = 4484,
5016 texture_box_filter_qcom = 4485,
5017 texture_block_match_qcom = 4486,
5018 tile_shading_qcom = 4495,
5019 texture_block_match2qcom = 4498,
5020 float16image_amd = 5008,
5021 image_gather_bias_lod_amd = 5009,
5022 fragment_mask_amd = 5010,
5023 stencil_export_ext = 5013,
5024 image_read_write_lod_amd = 5015,
5025 int64image_ext = 5016,
5026 shader_clock_khr = 5055,
5027 shader_enqueue_amdx = 5067,
5028 quad_control_khr = 5087,
5029 int4type_intel = 5112,
5030 int4cooperative_matrix_intel = 5114,
5031 b_float16type_khr = 5116,
5032 b_float16dot_product_khr = 5117,
5033 b_float16cooperative_matrix_khr = 5118,
5034 sample_mask_override_coverage_nv = 5249,
5035 geometry_shader_passthrough_nv = 5251,
5036 shader_viewport_index_layer_ext = 5254,
5037 shader_viewport_mask_nv = 5255,
5038 shader_stereo_view_nv = 5259,
5039 per_view_attributes_nv = 5260,
5040 fragment_fully_covered_ext = 5265,
5041 mesh_shading_nv = 5266,
5042 image_footprint_nv = 5282,
5043 mesh_shading_ext = 5283,
5044 fragment_barycentric_khr = 5284,
5045 compute_derivative_group_quads_khr = 5288,
5046 fragment_density_ext = 5291,
5047 group_non_uniform_partitioned_nv = 5297,
5048 shader_non_uniform = 5301,
5049 runtime_descriptor_array = 5302,
5050 input_attachment_array_dynamic_indexing = 5303,
5051 uniform_texel_buffer_array_dynamic_indexing = 5304,
5052 storage_texel_buffer_array_dynamic_indexing = 5305,
5053 uniform_buffer_array_non_uniform_indexing = 5306,
5054 sampled_image_array_non_uniform_indexing = 5307,
5055 storage_buffer_array_non_uniform_indexing = 5308,
5056 storage_image_array_non_uniform_indexing = 5309,
5057 input_attachment_array_non_uniform_indexing = 5310,
5058 uniform_texel_buffer_array_non_uniform_indexing = 5311,
5059 storage_texel_buffer_array_non_uniform_indexing = 5312,
5060 ray_tracing_position_fetch_khr = 5336,
5061 ray_tracing_nv = 5340,
5062 ray_tracing_motion_blur_nv = 5341,
5063 vulkan_memory_model = 5345,
5064 vulkan_memory_model_device_scope = 5346,
5065 physical_storage_buffer_addresses = 5347,
5066 compute_derivative_group_linear_khr = 5350,
5067 ray_tracing_provisional_khr = 5353,
5068 cooperative_matrix_nv = 5357,
5069 fragment_shader_sample_interlock_ext = 5363,
5070 fragment_shader_shading_rate_interlock_ext = 5372,
5071 shader_sm_builtins_nv = 5373,
5072 fragment_shader_pixel_interlock_ext = 5378,
5073 demote_to_helper_invocation = 5379,
5074 displacement_micromap_nv = 5380,
5075 ray_tracing_opacity_micromap_ext = 5381,
5076 shader_invocation_reorder_nv = 5383,
5077 bindless_texture_nv = 5390,
5078 ray_query_position_fetch_khr = 5391,
5079 cooperative_vector_nv = 5394,
5080 atomic_float16vector_nv = 5404,
5081 ray_tracing_displacement_micromap_nv = 5409,
5082 raw_access_chains_nv = 5414,
5083 ray_tracing_spheres_geometry_nv = 5418,
5084 ray_tracing_linear_swept_spheres_geometry_nv = 5419,
5085 cooperative_matrix_reductions_nv = 5430,
5086 cooperative_matrix_conversions_nv = 5431,
5087 cooperative_matrix_per_element_operations_nv = 5432,
5088 cooperative_matrix_tensor_addressing_nv = 5433,
5089 cooperative_matrix_block_loads_nv = 5434,
5090 cooperative_vector_training_nv = 5435,
5091 ray_tracing_cluster_acceleration_structure_nv = 5437,
5092 tensor_addressing_nv = 5439,
5093 subgroup_shuffle_intel = 5568,
5094 subgroup_buffer_block_iointel = 5569,
5095 subgroup_image_block_iointel = 5570,
5096 subgroup_image_media_block_iointel = 5579,
5097 round_to_infinity_intel = 5582,
5098 floating_point_mode_intel = 5583,
5099 integer_functions2intel = 5584,
5100 function_pointers_intel = 5603,
5101 indirect_references_intel = 5604,
5102 asm_intel = 5606,
5103 atomic_float32min_max_ext = 5612,
5104 atomic_float64min_max_ext = 5613,
5105 atomic_float16min_max_ext = 5616,
5106 vector_compute_intel = 5617,
5107 vector_any_intel = 5619,
5108 expect_assume_khr = 5629,
5109 subgroup_avc_motion_estimation_intel = 5696,
5110 subgroup_avc_motion_estimation_intra_intel = 5697,
5111 subgroup_avc_motion_estimation_chroma_intel = 5698,
5112 variable_length_array_intel = 5817,
5113 function_float_control_intel = 5821,
5114 fpga_memory_attributes_intel = 5824,
5115 fp_fast_math_mode_intel = 5837,
5116 arbitrary_precision_integers_intel = 5844,
5117 arbitrary_precision_floating_point_intel = 5845,
5118 unstructured_loop_controls_intel = 5886,
5119 fpga_loop_controls_intel = 5888,
5120 kernel_attributes_intel = 5892,
5121 fpga_kernel_attributes_intel = 5897,
5122 fpga_memory_accesses_intel = 5898,
5123 fpga_cluster_attributes_intel = 5904,
5124 loop_fuse_intel = 5906,
5125 fpgadsp_control_intel = 5908,
5126 memory_access_aliasing_intel = 5910,
5127 fpga_invocation_pipelining_attributes_intel = 5916,
5128 fpga_buffer_location_intel = 5920,
5129 arbitrary_precision_fixed_point_intel = 5922,
5130 usm_storage_classes_intel = 5935,
5131 runtime_aligned_attribute_intel = 5939,
5132 io_pipes_intel = 5943,
5133 blocking_pipes_intel = 5945,
5134 fpga_reg_intel = 5948,
5135 dot_product_input_all = 6016,
5136 dot_product_input4x8bit = 6017,
5137 dot_product_input4x8bit_packed = 6018,
5138 dot_product = 6019,
5139 ray_cull_mask_khr = 6020,
5140 cooperative_matrix_khr = 6022,
5141 replicated_composites_ext = 6024,
5142 bit_instructions = 6025,
5143 group_non_uniform_rotate_khr = 6026,
5144 float_controls2 = 6029,
5145 atomic_float32add_ext = 6033,
5146 atomic_float64add_ext = 6034,
5147 long_composites_intel = 6089,
5148 opt_none_ext = 6094,
5149 atomic_float16add_ext = 6095,
5150 debug_info_module_intel = 6114,
5151 b_float16conversion_intel = 6115,
5152 split_barrier_intel = 6141,
5153 arithmetic_fence_ext = 6144,
5154 fpga_cluster_attributes_v2intel = 6150,
5155 fpga_kernel_attributesv2intel = 6161,
5156 task_sequence_intel = 6162,
5157 fp_max_error_intel = 6169,
5158 fpga_latency_control_intel = 6171,
5159 fpga_argument_interfaces_intel = 6174,
5160 global_variable_host_access_intel = 6187,
5161 global_variable_fpga_decorations_intel = 6189,
5162 subgroup_buffer_prefetch_intel = 6220,
5163 subgroup2d_block_iointel = 6228,
5164 subgroup2d_block_transform_intel = 6229,
5165 subgroup2d_block_transpose_intel = 6230,
5166 subgroup_matrix_multiply_accumulate_intel = 6236,
5167 ternary_bitwise_function_intel = 6241,
5168 group_uniform_arithmetic_khr = 6400,
5169 tensor_float32rounding_intel = 6425,
5170 masked_gather_scatter_intel = 6427,
5171 cache_controls_intel = 6441,
5172 register_limits_intel = 6460,
5173 bindless_images_intel = 6528,
5174};
5175pub const RayQueryIntersection = enum(u32) {
5176 ray_query_candidate_intersection_khr = 0,
5177 ray_query_committed_intersection_khr = 1,
5178};
5179pub const RayQueryCommittedIntersectionType = enum(u32) {
5180 ray_query_committed_intersection_none_khr = 0,
5181 ray_query_committed_intersection_triangle_khr = 1,
5182 ray_query_committed_intersection_generated_khr = 2,
5183};
5184pub const RayQueryCandidateIntersectionType = enum(u32) {
5185 ray_query_candidate_intersection_triangle_khr = 0,
5186 ray_query_candidate_intersection_aabbkhr = 1,
5187};
5188pub const PackedVectorFormat = enum(u32) {
5189 packed_vector_format4x8bit = 0,
5190};
5191pub const CooperativeMatrixOperands = packed struct {
5192 matrix_a_signed_components_khr: bool = false,
5193 matrix_b_signed_components_khr: bool = false,
5194 matrix_c_signed_components_khr: bool = false,
5195 matrix_result_signed_components_khr: bool = false,
5196 saturating_accumulation_khr: bool = false,
5197 _reserved_bit_5: bool = false,
5198 _reserved_bit_6: bool = false,
5199 _reserved_bit_7: bool = false,
5200 _reserved_bit_8: bool = false,
5201 _reserved_bit_9: bool = false,
5202 _reserved_bit_10: bool = false,
5203 _reserved_bit_11: bool = false,
5204 _reserved_bit_12: bool = false,
5205 _reserved_bit_13: bool = false,
5206 _reserved_bit_14: bool = false,
5207 _reserved_bit_15: bool = false,
5208 _reserved_bit_16: bool = false,
5209 _reserved_bit_17: bool = false,
5210 _reserved_bit_18: bool = false,
5211 _reserved_bit_19: bool = false,
5212 _reserved_bit_20: bool = false,
5213 _reserved_bit_21: bool = false,
5214 _reserved_bit_22: bool = false,
5215 _reserved_bit_23: bool = false,
5216 _reserved_bit_24: bool = false,
5217 _reserved_bit_25: bool = false,
5218 _reserved_bit_26: bool = false,
5219 _reserved_bit_27: bool = false,
5220 _reserved_bit_28: bool = false,
5221 _reserved_bit_29: bool = false,
5222 _reserved_bit_30: bool = false,
5223 _reserved_bit_31: bool = false,
5224};
5225pub const CooperativeMatrixLayout = enum(u32) {
5226 row_major_khr = 0,
5227 column_major_khr = 1,
5228 row_blocked_interleaved_arm = 4202,
5229 column_blocked_interleaved_arm = 4203,
5230};
5231pub const CooperativeMatrixUse = enum(u32) {
5232 matrix_akhr = 0,
5233 matrix_bkhr = 1,
5234 matrix_accumulator_khr = 2,
5235};
5236pub const CooperativeMatrixReduce = packed struct {
5237 row: bool = false,
5238 column: bool = false,
5239 @"2x2": bool = false,
5240 _reserved_bit_3: bool = false,
5241 _reserved_bit_4: bool = false,
5242 _reserved_bit_5: bool = false,
5243 _reserved_bit_6: bool = false,
5244 _reserved_bit_7: bool = false,
5245 _reserved_bit_8: bool = false,
5246 _reserved_bit_9: bool = false,
5247 _reserved_bit_10: bool = false,
5248 _reserved_bit_11: bool = false,
5249 _reserved_bit_12: bool = false,
5250 _reserved_bit_13: bool = false,
5251 _reserved_bit_14: bool = false,
5252 _reserved_bit_15: bool = false,
5253 _reserved_bit_16: bool = false,
5254 _reserved_bit_17: bool = false,
5255 _reserved_bit_18: bool = false,
5256 _reserved_bit_19: bool = false,
5257 _reserved_bit_20: bool = false,
5258 _reserved_bit_21: bool = false,
5259 _reserved_bit_22: bool = false,
5260 _reserved_bit_23: bool = false,
5261 _reserved_bit_24: bool = false,
5262 _reserved_bit_25: bool = false,
5263 _reserved_bit_26: bool = false,
5264 _reserved_bit_27: bool = false,
5265 _reserved_bit_28: bool = false,
5266 _reserved_bit_29: bool = false,
5267 _reserved_bit_30: bool = false,
5268 _reserved_bit_31: bool = false,
5269};
5270pub const TensorClampMode = enum(u32) {
5271 undefined = 0,
5272 constant = 1,
5273 clamp_to_edge = 2,
5274 repeat = 3,
5275 repeat_mirrored = 4,
5276};
5277pub const TensorAddressingOperands = packed struct {
5278 tensor_view: bool = false,
5279 decode_func: bool = false,
5280 _reserved_bit_2: bool = false,
5281 _reserved_bit_3: bool = false,
5282 _reserved_bit_4: bool = false,
5283 _reserved_bit_5: bool = false,
5284 _reserved_bit_6: bool = false,
5285 _reserved_bit_7: bool = false,
5286 _reserved_bit_8: bool = false,
5287 _reserved_bit_9: bool = false,
5288 _reserved_bit_10: bool = false,
5289 _reserved_bit_11: bool = false,
5290 _reserved_bit_12: bool = false,
5291 _reserved_bit_13: bool = false,
5292 _reserved_bit_14: bool = false,
5293 _reserved_bit_15: bool = false,
5294 _reserved_bit_16: bool = false,
5295 _reserved_bit_17: bool = false,
5296 _reserved_bit_18: bool = false,
5297 _reserved_bit_19: bool = false,
5298 _reserved_bit_20: bool = false,
5299 _reserved_bit_21: bool = false,
5300 _reserved_bit_22: bool = false,
5301 _reserved_bit_23: bool = false,
5302 _reserved_bit_24: bool = false,
5303 _reserved_bit_25: bool = false,
5304 _reserved_bit_26: bool = false,
5305 _reserved_bit_27: bool = false,
5306 _reserved_bit_28: bool = false,
5307 _reserved_bit_29: bool = false,
5308 _reserved_bit_30: bool = false,
5309 _reserved_bit_31: bool = false,
5310
5311 pub const Extended = struct {
5312 tensor_view: ?struct { id_ref: Id } = null,
5313 decode_func: ?struct { id_ref: Id } = null,
5314 _reserved_bit_2: bool = false,
5315 _reserved_bit_3: bool = false,
5316 _reserved_bit_4: bool = false,
5317 _reserved_bit_5: bool = false,
5318 _reserved_bit_6: bool = false,
5319 _reserved_bit_7: bool = false,
5320 _reserved_bit_8: bool = false,
5321 _reserved_bit_9: bool = false,
5322 _reserved_bit_10: bool = false,
5323 _reserved_bit_11: bool = false,
5324 _reserved_bit_12: bool = false,
5325 _reserved_bit_13: bool = false,
5326 _reserved_bit_14: bool = false,
5327 _reserved_bit_15: bool = false,
5328 _reserved_bit_16: bool = false,
5329 _reserved_bit_17: bool = false,
5330 _reserved_bit_18: bool = false,
5331 _reserved_bit_19: bool = false,
5332 _reserved_bit_20: bool = false,
5333 _reserved_bit_21: bool = false,
5334 _reserved_bit_22: bool = false,
5335 _reserved_bit_23: bool = false,
5336 _reserved_bit_24: bool = false,
5337 _reserved_bit_25: bool = false,
5338 _reserved_bit_26: bool = false,
5339 _reserved_bit_27: bool = false,
5340 _reserved_bit_28: bool = false,
5341 _reserved_bit_29: bool = false,
5342 _reserved_bit_30: bool = false,
5343 _reserved_bit_31: bool = false,
5344 };
5345};
5346pub const InitializationModeQualifier = enum(u32) {
5347 init_on_device_reprogram_intel = 0,
5348 init_on_device_reset_intel = 1,
5349};
5350pub const LoadCacheControl = enum(u32) {
5351 uncached_intel = 0,
5352 cached_intel = 1,
5353 streaming_intel = 2,
5354 invalidate_after_read_intel = 3,
5355 const_cached_intel = 4,
5356};
5357pub const StoreCacheControl = enum(u32) {
5358 uncached_intel = 0,
5359 write_through_intel = 1,
5360 write_back_intel = 2,
5361 streaming_intel = 3,
5362};
5363pub const NamedMaximumNumberOfRegisters = enum(u32) {
5364 auto_intel = 0,
5365};
5366pub const MatrixMultiplyAccumulateOperands = packed struct {
5367 matrix_a_signed_components_intel: bool = false,
5368 matrix_b_signed_components_intel: bool = false,
5369 matrix_cb_float16intel: bool = false,
5370 matrix_result_b_float16intel: bool = false,
5371 matrix_a_packed_int8intel: bool = false,
5372 matrix_b_packed_int8intel: bool = false,
5373 matrix_a_packed_int4intel: bool = false,
5374 matrix_b_packed_int4intel: bool = false,
5375 matrix_atf32intel: bool = false,
5376 matrix_btf32intel: bool = false,
5377 matrix_a_packed_float16intel: bool = false,
5378 matrix_b_packed_float16intel: bool = false,
5379 matrix_a_packed_b_float16intel: bool = false,
5380 matrix_b_packed_b_float16intel: bool = false,
5381 _reserved_bit_14: bool = false,
5382 _reserved_bit_15: bool = false,
5383 _reserved_bit_16: bool = false,
5384 _reserved_bit_17: bool = false,
5385 _reserved_bit_18: bool = false,
5386 _reserved_bit_19: bool = false,
5387 _reserved_bit_20: bool = false,
5388 _reserved_bit_21: bool = false,
5389 _reserved_bit_22: bool = false,
5390 _reserved_bit_23: bool = false,
5391 _reserved_bit_24: bool = false,
5392 _reserved_bit_25: bool = false,
5393 _reserved_bit_26: bool = false,
5394 _reserved_bit_27: bool = false,
5395 _reserved_bit_28: bool = false,
5396 _reserved_bit_29: bool = false,
5397 _reserved_bit_30: bool = false,
5398 _reserved_bit_31: bool = false,
5399};
5400pub const FPEncoding = enum(u32) {
5401 b_float16khr = 0,
5402 float8e4m3ext = 4214,
5403 float8e5m2ext = 4215,
5404};
5405pub const CooperativeVectorMatrixLayout = enum(u32) {
5406 row_major_nv = 0,
5407 column_major_nv = 1,
5408 inferencing_optimal_nv = 2,
5409 training_optimal_nv = 3,
5410};
5411pub const ComponentType = enum(u32) {
5412 float16nv = 0,
5413 float32nv = 1,
5414 float64nv = 2,
5415 signed_int8nv = 3,
5416 signed_int16nv = 4,
5417 signed_int32nv = 5,
5418 signed_int64nv = 6,
5419 unsigned_int8nv = 7,
5420 unsigned_int16nv = 8,
5421 unsigned_int32nv = 9,
5422 unsigned_int64nv = 10,
5423 signed_int8packed_nv = 1000491000,
5424 unsigned_int8packed_nv = 1000491001,
5425 float_e4m3nv = 1000491002,
5426 float_e5m2nv = 1000491003,
5427};
5428pub const TensorOperands = packed struct {
5429 nontemporal_arm: bool = false,
5430 out_of_bounds_value_arm: bool = false,
5431 make_element_available_arm: bool = false,
5432 make_element_visible_arm: bool = false,
5433 non_private_element_arm: bool = false,
5434 _reserved_bit_5: bool = false,
5435 _reserved_bit_6: bool = false,
5436 _reserved_bit_7: bool = false,
5437 _reserved_bit_8: bool = false,
5438 _reserved_bit_9: bool = false,
5439 _reserved_bit_10: bool = false,
5440 _reserved_bit_11: bool = false,
5441 _reserved_bit_12: bool = false,
5442 _reserved_bit_13: bool = false,
5443 _reserved_bit_14: bool = false,
5444 _reserved_bit_15: bool = false,
5445 _reserved_bit_16: bool = false,
5446 _reserved_bit_17: bool = false,
5447 _reserved_bit_18: bool = false,
5448 _reserved_bit_19: bool = false,
5449 _reserved_bit_20: bool = false,
5450 _reserved_bit_21: bool = false,
5451 _reserved_bit_22: bool = false,
5452 _reserved_bit_23: bool = false,
5453 _reserved_bit_24: bool = false,
5454 _reserved_bit_25: bool = false,
5455 _reserved_bit_26: bool = false,
5456 _reserved_bit_27: bool = false,
5457 _reserved_bit_28: bool = false,
5458 _reserved_bit_29: bool = false,
5459 _reserved_bit_30: bool = false,
5460 _reserved_bit_31: bool = false,
5461
5462 pub const Extended = struct {
5463 nontemporal_arm: bool = false,
5464 out_of_bounds_value_arm: ?struct { id_ref: Id } = null,
5465 make_element_available_arm: ?struct { id_ref: Id } = null,
5466 make_element_visible_arm: ?struct { id_ref: Id } = null,
5467 non_private_element_arm: bool = false,
5468 _reserved_bit_5: bool = false,
5469 _reserved_bit_6: bool = false,
5470 _reserved_bit_7: bool = false,
5471 _reserved_bit_8: bool = false,
5472 _reserved_bit_9: bool = false,
5473 _reserved_bit_10: bool = false,
5474 _reserved_bit_11: bool = false,
5475 _reserved_bit_12: bool = false,
5476 _reserved_bit_13: bool = false,
5477 _reserved_bit_14: bool = false,
5478 _reserved_bit_15: bool = false,
5479 _reserved_bit_16: bool = false,
5480 _reserved_bit_17: bool = false,
5481 _reserved_bit_18: bool = false,
5482 _reserved_bit_19: bool = false,
5483 _reserved_bit_20: bool = false,
5484 _reserved_bit_21: bool = false,
5485 _reserved_bit_22: bool = false,
5486 _reserved_bit_23: bool = false,
5487 _reserved_bit_24: bool = false,
5488 _reserved_bit_25: bool = false,
5489 _reserved_bit_26: bool = false,
5490 _reserved_bit_27: bool = false,
5491 _reserved_bit_28: bool = false,
5492 _reserved_bit_29: bool = false,
5493 _reserved_bit_30: bool = false,
5494 _reserved_bit_31: bool = false,
5495 };
5496};
5497pub const @"DebugInfo.DebugInfoFlags" = packed struct {
5498 flag_is_protected: bool = false,
5499 flag_is_private: bool = false,
5500 flag_is_local: bool = false,
5501 flag_is_definition: bool = false,
5502 flag_fwd_decl: bool = false,
5503 flag_artificial: bool = false,
5504 flag_explicit: bool = false,
5505 flag_prototyped: bool = false,
5506 flag_object_pointer: bool = false,
5507 flag_static_member: bool = false,
5508 flag_indirect_variable: bool = false,
5509 flag_l_value_reference: bool = false,
5510 flag_r_value_reference: bool = false,
5511 flag_is_optimized: bool = false,
5512 _reserved_bit_14: bool = false,
5513 _reserved_bit_15: bool = false,
5514 _reserved_bit_16: bool = false,
5515 _reserved_bit_17: bool = false,
5516 _reserved_bit_18: bool = false,
5517 _reserved_bit_19: bool = false,
5518 _reserved_bit_20: bool = false,
5519 _reserved_bit_21: bool = false,
5520 _reserved_bit_22: bool = false,
5521 _reserved_bit_23: bool = false,
5522 _reserved_bit_24: bool = false,
5523 _reserved_bit_25: bool = false,
5524 _reserved_bit_26: bool = false,
5525 _reserved_bit_27: bool = false,
5526 _reserved_bit_28: bool = false,
5527 _reserved_bit_29: bool = false,
5528 _reserved_bit_30: bool = false,
5529 _reserved_bit_31: bool = false,
5530};
5531pub const @"DebugInfo.DebugBaseTypeAttributeEncoding" = enum(u32) {
5532 unspecified = 0,
5533 address = 1,
5534 boolean = 2,
5535 float = 4,
5536 signed = 5,
5537 signed_char = 6,
5538 unsigned = 7,
5539 unsigned_char = 8,
5540};
5541pub const @"DebugInfo.DebugCompositeType" = enum(u32) {
5542 class = 0,
5543 structure = 1,
5544 @"union" = 2,
5545};
5546pub const @"DebugInfo.DebugTypeQualifier" = enum(u32) {
5547 const_type = 0,
5548 volatile_type = 1,
5549 restrict_type = 2,
5550};
5551pub const @"DebugInfo.DebugOperation" = enum(u32) {
5552 deref = 0,
5553 plus = 1,
5554 minus = 2,
5555 plus_uconst = 3,
5556 bit_piece = 4,
5557 swap = 5,
5558 xderef = 6,
5559 stack_value = 7,
5560 constu = 8,
5561
5562 pub const Extended = union(@"DebugInfo.DebugOperation") {
5563 deref,
5564 plus,
5565 minus,
5566 plus_uconst: struct { literal_integer: LiteralInteger },
5567 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5568 swap,
5569 xderef,
5570 stack_value,
5571 constu: struct { literal_integer: LiteralInteger },
5572 };
5573};
5574pub const @"OpenCL.DebugInfo.100.DebugInfoFlags" = packed struct {
5575 flag_is_protected: bool = false,
5576 flag_is_private: bool = false,
5577 flag_is_local: bool = false,
5578 flag_is_definition: bool = false,
5579 flag_fwd_decl: bool = false,
5580 flag_artificial: bool = false,
5581 flag_explicit: bool = false,
5582 flag_prototyped: bool = false,
5583 flag_object_pointer: bool = false,
5584 flag_static_member: bool = false,
5585 flag_indirect_variable: bool = false,
5586 flag_l_value_reference: bool = false,
5587 flag_r_value_reference: bool = false,
5588 flag_is_optimized: bool = false,
5589 flag_is_enum_class: bool = false,
5590 flag_type_pass_by_value: bool = false,
5591 flag_type_pass_by_reference: bool = false,
5592 _reserved_bit_17: bool = false,
5593 _reserved_bit_18: bool = false,
5594 _reserved_bit_19: bool = false,
5595 _reserved_bit_20: bool = false,
5596 _reserved_bit_21: bool = false,
5597 _reserved_bit_22: bool = false,
5598 _reserved_bit_23: bool = false,
5599 _reserved_bit_24: bool = false,
5600 _reserved_bit_25: bool = false,
5601 _reserved_bit_26: bool = false,
5602 _reserved_bit_27: bool = false,
5603 _reserved_bit_28: bool = false,
5604 _reserved_bit_29: bool = false,
5605 _reserved_bit_30: bool = false,
5606 _reserved_bit_31: bool = false,
5607};
5608pub const @"OpenCL.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5609 unspecified = 0,
5610 address = 1,
5611 boolean = 2,
5612 float = 3,
5613 signed = 4,
5614 signed_char = 5,
5615 unsigned = 6,
5616 unsigned_char = 7,
5617};
5618pub const @"OpenCL.DebugInfo.100.DebugCompositeType" = enum(u32) {
5619 class = 0,
5620 structure = 1,
5621 @"union" = 2,
5622};
5623pub const @"OpenCL.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5624 const_type = 0,
5625 volatile_type = 1,
5626 restrict_type = 2,
5627 atomic_type = 3,
5628};
5629pub const @"OpenCL.DebugInfo.100.DebugOperation" = enum(u32) {
5630 deref = 0,
5631 plus = 1,
5632 minus = 2,
5633 plus_uconst = 3,
5634 bit_piece = 4,
5635 swap = 5,
5636 xderef = 6,
5637 stack_value = 7,
5638 constu = 8,
5639 fragment = 9,
5640
5641 pub const Extended = union(@"OpenCL.DebugInfo.100.DebugOperation") {
5642 deref,
5643 plus,
5644 minus,
5645 plus_uconst: struct { literal_integer: LiteralInteger },
5646 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5647 swap,
5648 xderef,
5649 stack_value,
5650 constu: struct { literal_integer: LiteralInteger },
5651 fragment: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5652 };
5653};
5654pub const @"OpenCL.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5655 imported_module = 0,
5656 imported_declaration = 1,
5657};
5658pub const @"NonSemantic.ClspvReflection.6.KernelPropertyFlags" = packed struct {
5659 may_use_printf: bool = false,
5660 _reserved_bit_1: bool = false,
5661 _reserved_bit_2: bool = false,
5662 _reserved_bit_3: bool = false,
5663 _reserved_bit_4: bool = false,
5664 _reserved_bit_5: bool = false,
5665 _reserved_bit_6: bool = false,
5666 _reserved_bit_7: bool = false,
5667 _reserved_bit_8: bool = false,
5668 _reserved_bit_9: bool = false,
5669 _reserved_bit_10: bool = false,
5670 _reserved_bit_11: bool = false,
5671 _reserved_bit_12: bool = false,
5672 _reserved_bit_13: bool = false,
5673 _reserved_bit_14: bool = false,
5674 _reserved_bit_15: bool = false,
5675 _reserved_bit_16: bool = false,
5676 _reserved_bit_17: bool = false,
5677 _reserved_bit_18: bool = false,
5678 _reserved_bit_19: bool = false,
5679 _reserved_bit_20: bool = false,
5680 _reserved_bit_21: bool = false,
5681 _reserved_bit_22: bool = false,
5682 _reserved_bit_23: bool = false,
5683 _reserved_bit_24: bool = false,
5684 _reserved_bit_25: bool = false,
5685 _reserved_bit_26: bool = false,
5686 _reserved_bit_27: bool = false,
5687 _reserved_bit_28: bool = false,
5688 _reserved_bit_29: bool = false,
5689 _reserved_bit_30: bool = false,
5690 _reserved_bit_31: bool = false,
5691};
5692pub const @"NonSemantic.Shader.DebugInfo.100.DebugInfoFlags" = packed struct {
5693 flag_is_protected: bool = false,
5694 flag_is_private: bool = false,
5695 flag_is_local: bool = false,
5696 flag_is_definition: bool = false,
5697 flag_fwd_decl: bool = false,
5698 flag_artificial: bool = false,
5699 flag_explicit: bool = false,
5700 flag_prototyped: bool = false,
5701 flag_object_pointer: bool = false,
5702 flag_static_member: bool = false,
5703 flag_indirect_variable: bool = false,
5704 flag_l_value_reference: bool = false,
5705 flag_r_value_reference: bool = false,
5706 flag_is_optimized: bool = false,
5707 flag_is_enum_class: bool = false,
5708 flag_type_pass_by_value: bool = false,
5709 flag_type_pass_by_reference: bool = false,
5710 flag_unknown_physical_layout: bool = false,
5711 _reserved_bit_18: bool = false,
5712 _reserved_bit_19: bool = false,
5713 _reserved_bit_20: bool = false,
5714 _reserved_bit_21: bool = false,
5715 _reserved_bit_22: bool = false,
5716 _reserved_bit_23: bool = false,
5717 _reserved_bit_24: bool = false,
5718 _reserved_bit_25: bool = false,
5719 _reserved_bit_26: bool = false,
5720 _reserved_bit_27: bool = false,
5721 _reserved_bit_28: bool = false,
5722 _reserved_bit_29: bool = false,
5723 _reserved_bit_30: bool = false,
5724 _reserved_bit_31: bool = false,
5725};
5726pub const @"NonSemantic.Shader.DebugInfo.100.BuildIdentifierFlags" = packed struct {
5727 identifier_possible_duplicates: bool = false,
5728 _reserved_bit_1: bool = false,
5729 _reserved_bit_2: bool = false,
5730 _reserved_bit_3: bool = false,
5731 _reserved_bit_4: bool = false,
5732 _reserved_bit_5: bool = false,
5733 _reserved_bit_6: bool = false,
5734 _reserved_bit_7: bool = false,
5735 _reserved_bit_8: bool = false,
5736 _reserved_bit_9: bool = false,
5737 _reserved_bit_10: bool = false,
5738 _reserved_bit_11: bool = false,
5739 _reserved_bit_12: bool = false,
5740 _reserved_bit_13: bool = false,
5741 _reserved_bit_14: bool = false,
5742 _reserved_bit_15: bool = false,
5743 _reserved_bit_16: bool = false,
5744 _reserved_bit_17: bool = false,
5745 _reserved_bit_18: bool = false,
5746 _reserved_bit_19: bool = false,
5747 _reserved_bit_20: bool = false,
5748 _reserved_bit_21: bool = false,
5749 _reserved_bit_22: bool = false,
5750 _reserved_bit_23: bool = false,
5751 _reserved_bit_24: bool = false,
5752 _reserved_bit_25: bool = false,
5753 _reserved_bit_26: bool = false,
5754 _reserved_bit_27: bool = false,
5755 _reserved_bit_28: bool = false,
5756 _reserved_bit_29: bool = false,
5757 _reserved_bit_30: bool = false,
5758 _reserved_bit_31: bool = false,
5759};
5760pub const @"NonSemantic.Shader.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5761 unspecified = 0,
5762 address = 1,
5763 boolean = 2,
5764 float = 3,
5765 signed = 4,
5766 signed_char = 5,
5767 unsigned = 6,
5768 unsigned_char = 7,
5769};
5770pub const @"NonSemantic.Shader.DebugInfo.100.DebugCompositeType" = enum(u32) {
5771 class = 0,
5772 structure = 1,
5773 @"union" = 2,
5774};
5775pub const @"NonSemantic.Shader.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5776 const_type = 0,
5777 volatile_type = 1,
5778 restrict_type = 2,
5779 atomic_type = 3,
5780};
5781pub const @"NonSemantic.Shader.DebugInfo.100.DebugOperation" = enum(u32) {
5782 deref = 0,
5783 plus = 1,
5784 minus = 2,
5785 plus_uconst = 3,
5786 bit_piece = 4,
5787 swap = 5,
5788 xderef = 6,
5789 stack_value = 7,
5790 constu = 8,
5791 fragment = 9,
5792
5793 pub const Extended = union(@"NonSemantic.Shader.DebugInfo.100.DebugOperation") {
5794 deref,
5795 plus,
5796 minus,
5797 plus_uconst: struct { id_ref: Id },
5798 bit_piece: struct { id_ref_0: Id, id_ref_1: Id },
5799 swap,
5800 xderef,
5801 stack_value,
5802 constu: struct { id_ref: Id },
5803 fragment: struct { id_ref_0: Id, id_ref_1: Id },
5804 };
5805};
5806pub const @"NonSemantic.Shader.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5807 imported_module = 0,
5808 imported_declaration = 1,
5809};
5810pub const InstructionSet = enum {
5811 core,
5812 SPV_AMD_shader_trinary_minmax,
5813 SPV_EXT_INST_TYPE_TOSA_001000_1,
5814 @"NonSemantic.VkspReflection",
5815 SPV_AMD_shader_explicit_vertex_parameter,
5816 DebugInfo,
5817 @"NonSemantic.DebugBreak",
5818 @"OpenCL.DebugInfo.100",
5819 @"NonSemantic.ClspvReflection.6",
5820 @"GLSL.std.450",
5821 SPV_AMD_shader_ballot,
5822 @"NonSemantic.DebugPrintf",
5823 SPV_AMD_gcn_shader,
5824 @"OpenCL.std",
5825 @"NonSemantic.Shader.DebugInfo.100",
5826 zig,
5827
5828 pub fn instructions(self: InstructionSet) []const Instruction {
5829 return switch (self) {
5830 .core => &.{
5831 .{
5832 .name = "OpNop",
5833 .opcode = 0,
5834 .operands = &.{},
5835 },
5836 .{
5837 .name = "OpUndef",
5838 .opcode = 1,
5839 .operands = &.{
5840 .{ .kind = .id_result_type, .quantifier = .required },
5841 .{ .kind = .id_result, .quantifier = .required },
5842 },
5843 },
5844 .{
5845 .name = "OpSourceContinued",
5846 .opcode = 2,
5847 .operands = &.{
5848 .{ .kind = .literal_string, .quantifier = .required },
5849 },
5850 },
5851 .{
5852 .name = "OpSource",
5853 .opcode = 3,
5854 .operands = &.{
5855 .{ .kind = .source_language, .quantifier = .required },
5856 .{ .kind = .literal_integer, .quantifier = .required },
5857 .{ .kind = .id_ref, .quantifier = .optional },
5858 .{ .kind = .literal_string, .quantifier = .optional },
5859 },
5860 },
5861 .{
5862 .name = "OpSourceExtension",
5863 .opcode = 4,
5864 .operands = &.{
5865 .{ .kind = .literal_string, .quantifier = .required },
5866 },
5867 },
5868 .{
5869 .name = "OpName",
5870 .opcode = 5,
5871 .operands = &.{
5872 .{ .kind = .id_ref, .quantifier = .required },
5873 .{ .kind = .literal_string, .quantifier = .required },
5874 },
5875 },
5876 .{
5877 .name = "OpMemberName",
5878 .opcode = 6,
5879 .operands = &.{
5880 .{ .kind = .id_ref, .quantifier = .required },
5881 .{ .kind = .literal_integer, .quantifier = .required },
5882 .{ .kind = .literal_string, .quantifier = .required },
5883 },
5884 },
5885 .{
5886 .name = "OpString",
5887 .opcode = 7,
5888 .operands = &.{
5889 .{ .kind = .id_result, .quantifier = .required },
5890 .{ .kind = .literal_string, .quantifier = .required },
5891 },
5892 },
5893 .{
5894 .name = "OpLine",
5895 .opcode = 8,
5896 .operands = &.{
5897 .{ .kind = .id_ref, .quantifier = .required },
5898 .{ .kind = .literal_integer, .quantifier = .required },
5899 .{ .kind = .literal_integer, .quantifier = .required },
5900 },
5901 },
5902 .{
5903 .name = "OpExtension",
5904 .opcode = 10,
5905 .operands = &.{
5906 .{ .kind = .literal_string, .quantifier = .required },
5907 },
5908 },
5909 .{
5910 .name = "OpExtInstImport",
5911 .opcode = 11,
5912 .operands = &.{
5913 .{ .kind = .id_result, .quantifier = .required },
5914 .{ .kind = .literal_string, .quantifier = .required },
5915 },
5916 },
5917 .{
5918 .name = "OpExtInst",
5919 .opcode = 12,
5920 .operands = &.{
5921 .{ .kind = .id_result_type, .quantifier = .required },
5922 .{ .kind = .id_result, .quantifier = .required },
5923 .{ .kind = .id_ref, .quantifier = .required },
5924 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
5925 .{ .kind = .id_ref, .quantifier = .variadic },
5926 },
5927 },
5928 .{
5929 .name = "OpMemoryModel",
5930 .opcode = 14,
5931 .operands = &.{
5932 .{ .kind = .addressing_model, .quantifier = .required },
5933 .{ .kind = .memory_model, .quantifier = .required },
5934 },
5935 },
5936 .{
5937 .name = "OpEntryPoint",
5938 .opcode = 15,
5939 .operands = &.{
5940 .{ .kind = .execution_model, .quantifier = .required },
5941 .{ .kind = .id_ref, .quantifier = .required },
5942 .{ .kind = .literal_string, .quantifier = .required },
5943 .{ .kind = .id_ref, .quantifier = .variadic },
5944 },
5945 },
5946 .{
5947 .name = "OpExecutionMode",
5948 .opcode = 16,
5949 .operands = &.{
5950 .{ .kind = .id_ref, .quantifier = .required },
5951 .{ .kind = .execution_mode, .quantifier = .required },
5952 },
5953 },
5954 .{
5955 .name = "OpCapability",
5956 .opcode = 17,
5957 .operands = &.{
5958 .{ .kind = .capability, .quantifier = .required },
5959 },
5960 },
5961 .{
5962 .name = "OpTypeVoid",
5963 .opcode = 19,
5964 .operands = &.{
5965 .{ .kind = .id_result, .quantifier = .required },
5966 },
5967 },
5968 .{
5969 .name = "OpTypeBool",
5970 .opcode = 20,
5971 .operands = &.{
5972 .{ .kind = .id_result, .quantifier = .required },
5973 },
5974 },
5975 .{
5976 .name = "OpTypeInt",
5977 .opcode = 21,
5978 .operands = &.{
5979 .{ .kind = .id_result, .quantifier = .required },
5980 .{ .kind = .literal_integer, .quantifier = .required },
5981 .{ .kind = .literal_integer, .quantifier = .required },
5982 },
5983 },
5984 .{
5985 .name = "OpTypeFloat",
5986 .opcode = 22,
5987 .operands = &.{
5988 .{ .kind = .id_result, .quantifier = .required },
5989 .{ .kind = .literal_integer, .quantifier = .required },
5990 .{ .kind = .fp_encoding, .quantifier = .optional },
5991 },
5992 },
5993 .{
5994 .name = "OpTypeVector",
5995 .opcode = 23,
5996 .operands = &.{
5997 .{ .kind = .id_result, .quantifier = .required },
5998 .{ .kind = .id_ref, .quantifier = .required },
5999 .{ .kind = .literal_integer, .quantifier = .required },
6000 },
6001 },
6002 .{
6003 .name = "OpTypeMatrix",
6004 .opcode = 24,
6005 .operands = &.{
6006 .{ .kind = .id_result, .quantifier = .required },
6007 .{ .kind = .id_ref, .quantifier = .required },
6008 .{ .kind = .literal_integer, .quantifier = .required },
6009 },
6010 },
6011 .{
6012 .name = "OpTypeImage",
6013 .opcode = 25,
6014 .operands = &.{
6015 .{ .kind = .id_result, .quantifier = .required },
6016 .{ .kind = .id_ref, .quantifier = .required },
6017 .{ .kind = .dim, .quantifier = .required },
6018 .{ .kind = .literal_integer, .quantifier = .required },
6019 .{ .kind = .literal_integer, .quantifier = .required },
6020 .{ .kind = .literal_integer, .quantifier = .required },
6021 .{ .kind = .literal_integer, .quantifier = .required },
6022 .{ .kind = .image_format, .quantifier = .required },
6023 .{ .kind = .access_qualifier, .quantifier = .optional },
6024 },
6025 },
6026 .{
6027 .name = "OpTypeSampler",
6028 .opcode = 26,
6029 .operands = &.{
6030 .{ .kind = .id_result, .quantifier = .required },
6031 },
6032 },
6033 .{
6034 .name = "OpTypeSampledImage",
6035 .opcode = 27,
6036 .operands = &.{
6037 .{ .kind = .id_result, .quantifier = .required },
6038 .{ .kind = .id_ref, .quantifier = .required },
6039 },
6040 },
6041 .{
6042 .name = "OpTypeArray",
6043 .opcode = 28,
6044 .operands = &.{
6045 .{ .kind = .id_result, .quantifier = .required },
6046 .{ .kind = .id_ref, .quantifier = .required },
6047 .{ .kind = .id_ref, .quantifier = .required },
6048 },
6049 },
6050 .{
6051 .name = "OpTypeRuntimeArray",
6052 .opcode = 29,
6053 .operands = &.{
6054 .{ .kind = .id_result, .quantifier = .required },
6055 .{ .kind = .id_ref, .quantifier = .required },
6056 },
6057 },
6058 .{
6059 .name = "OpTypeStruct",
6060 .opcode = 30,
6061 .operands = &.{
6062 .{ .kind = .id_result, .quantifier = .required },
6063 .{ .kind = .id_ref, .quantifier = .variadic },
6064 },
6065 },
6066 .{
6067 .name = "OpTypeOpaque",
6068 .opcode = 31,
6069 .operands = &.{
6070 .{ .kind = .id_result, .quantifier = .required },
6071 .{ .kind = .literal_string, .quantifier = .required },
6072 },
6073 },
6074 .{
6075 .name = "OpTypePointer",
6076 .opcode = 32,
6077 .operands = &.{
6078 .{ .kind = .id_result, .quantifier = .required },
6079 .{ .kind = .storage_class, .quantifier = .required },
6080 .{ .kind = .id_ref, .quantifier = .required },
6081 },
6082 },
6083 .{
6084 .name = "OpTypeFunction",
6085 .opcode = 33,
6086 .operands = &.{
6087 .{ .kind = .id_result, .quantifier = .required },
6088 .{ .kind = .id_ref, .quantifier = .required },
6089 .{ .kind = .id_ref, .quantifier = .variadic },
6090 },
6091 },
6092 .{
6093 .name = "OpTypeEvent",
6094 .opcode = 34,
6095 .operands = &.{
6096 .{ .kind = .id_result, .quantifier = .required },
6097 },
6098 },
6099 .{
6100 .name = "OpTypeDeviceEvent",
6101 .opcode = 35,
6102 .operands = &.{
6103 .{ .kind = .id_result, .quantifier = .required },
6104 },
6105 },
6106 .{
6107 .name = "OpTypeReserveId",
6108 .opcode = 36,
6109 .operands = &.{
6110 .{ .kind = .id_result, .quantifier = .required },
6111 },
6112 },
6113 .{
6114 .name = "OpTypeQueue",
6115 .opcode = 37,
6116 .operands = &.{
6117 .{ .kind = .id_result, .quantifier = .required },
6118 },
6119 },
6120 .{
6121 .name = "OpTypePipe",
6122 .opcode = 38,
6123 .operands = &.{
6124 .{ .kind = .id_result, .quantifier = .required },
6125 .{ .kind = .access_qualifier, .quantifier = .required },
6126 },
6127 },
6128 .{
6129 .name = "OpTypeForwardPointer",
6130 .opcode = 39,
6131 .operands = &.{
6132 .{ .kind = .id_ref, .quantifier = .required },
6133 .{ .kind = .storage_class, .quantifier = .required },
6134 },
6135 },
6136 .{
6137 .name = "OpConstantTrue",
6138 .opcode = 41,
6139 .operands = &.{
6140 .{ .kind = .id_result_type, .quantifier = .required },
6141 .{ .kind = .id_result, .quantifier = .required },
6142 },
6143 },
6144 .{
6145 .name = "OpConstantFalse",
6146 .opcode = 42,
6147 .operands = &.{
6148 .{ .kind = .id_result_type, .quantifier = .required },
6149 .{ .kind = .id_result, .quantifier = .required },
6150 },
6151 },
6152 .{
6153 .name = "OpConstant",
6154 .opcode = 43,
6155 .operands = &.{
6156 .{ .kind = .id_result_type, .quantifier = .required },
6157 .{ .kind = .id_result, .quantifier = .required },
6158 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6159 },
6160 },
6161 .{
6162 .name = "OpConstantComposite",
6163 .opcode = 44,
6164 .operands = &.{
6165 .{ .kind = .id_result_type, .quantifier = .required },
6166 .{ .kind = .id_result, .quantifier = .required },
6167 .{ .kind = .id_ref, .quantifier = .variadic },
6168 },
6169 },
6170 .{
6171 .name = "OpConstantSampler",
6172 .opcode = 45,
6173 .operands = &.{
6174 .{ .kind = .id_result_type, .quantifier = .required },
6175 .{ .kind = .id_result, .quantifier = .required },
6176 .{ .kind = .sampler_addressing_mode, .quantifier = .required },
6177 .{ .kind = .literal_integer, .quantifier = .required },
6178 .{ .kind = .sampler_filter_mode, .quantifier = .required },
6179 },
6180 },
6181 .{
6182 .name = "OpConstantNull",
6183 .opcode = 46,
6184 .operands = &.{
6185 .{ .kind = .id_result_type, .quantifier = .required },
6186 .{ .kind = .id_result, .quantifier = .required },
6187 },
6188 },
6189 .{
6190 .name = "OpSpecConstantTrue",
6191 .opcode = 48,
6192 .operands = &.{
6193 .{ .kind = .id_result_type, .quantifier = .required },
6194 .{ .kind = .id_result, .quantifier = .required },
6195 },
6196 },
6197 .{
6198 .name = "OpSpecConstantFalse",
6199 .opcode = 49,
6200 .operands = &.{
6201 .{ .kind = .id_result_type, .quantifier = .required },
6202 .{ .kind = .id_result, .quantifier = .required },
6203 },
6204 },
6205 .{
6206 .name = "OpSpecConstant",
6207 .opcode = 50,
6208 .operands = &.{
6209 .{ .kind = .id_result_type, .quantifier = .required },
6210 .{ .kind = .id_result, .quantifier = .required },
6211 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6212 },
6213 },
6214 .{
6215 .name = "OpSpecConstantComposite",
6216 .opcode = 51,
6217 .operands = &.{
6218 .{ .kind = .id_result_type, .quantifier = .required },
6219 .{ .kind = .id_result, .quantifier = .required },
6220 .{ .kind = .id_ref, .quantifier = .variadic },
6221 },
6222 },
6223 .{
6224 .name = "OpSpecConstantOp",
6225 .opcode = 52,
6226 .operands = &.{
6227 .{ .kind = .id_result_type, .quantifier = .required },
6228 .{ .kind = .id_result, .quantifier = .required },
6229 .{ .kind = .literal_spec_constant_op_integer, .quantifier = .required },
6230 },
6231 },
6232 .{
6233 .name = "OpFunction",
6234 .opcode = 54,
6235 .operands = &.{
6236 .{ .kind = .id_result_type, .quantifier = .required },
6237 .{ .kind = .id_result, .quantifier = .required },
6238 .{ .kind = .function_control, .quantifier = .required },
6239 .{ .kind = .id_ref, .quantifier = .required },
6240 },
6241 },
6242 .{
6243 .name = "OpFunctionParameter",
6244 .opcode = 55,
6245 .operands = &.{
6246 .{ .kind = .id_result_type, .quantifier = .required },
6247 .{ .kind = .id_result, .quantifier = .required },
6248 },
6249 },
6250 .{
6251 .name = "OpFunctionEnd",
6252 .opcode = 56,
6253 .operands = &.{},
6254 },
6255 .{
6256 .name = "OpFunctionCall",
6257 .opcode = 57,
6258 .operands = &.{
6259 .{ .kind = .id_result_type, .quantifier = .required },
6260 .{ .kind = .id_result, .quantifier = .required },
6261 .{ .kind = .id_ref, .quantifier = .required },
6262 .{ .kind = .id_ref, .quantifier = .variadic },
6263 },
6264 },
6265 .{
6266 .name = "OpVariable",
6267 .opcode = 59,
6268 .operands = &.{
6269 .{ .kind = .id_result_type, .quantifier = .required },
6270 .{ .kind = .id_result, .quantifier = .required },
6271 .{ .kind = .storage_class, .quantifier = .required },
6272 .{ .kind = .id_ref, .quantifier = .optional },
6273 },
6274 },
6275 .{
6276 .name = "OpImageTexelPointer",
6277 .opcode = 60,
6278 .operands = &.{
6279 .{ .kind = .id_result_type, .quantifier = .required },
6280 .{ .kind = .id_result, .quantifier = .required },
6281 .{ .kind = .id_ref, .quantifier = .required },
6282 .{ .kind = .id_ref, .quantifier = .required },
6283 .{ .kind = .id_ref, .quantifier = .required },
6284 },
6285 },
6286 .{
6287 .name = "OpLoad",
6288 .opcode = 61,
6289 .operands = &.{
6290 .{ .kind = .id_result_type, .quantifier = .required },
6291 .{ .kind = .id_result, .quantifier = .required },
6292 .{ .kind = .id_ref, .quantifier = .required },
6293 .{ .kind = .memory_access, .quantifier = .optional },
6294 },
6295 },
6296 .{
6297 .name = "OpStore",
6298 .opcode = 62,
6299 .operands = &.{
6300 .{ .kind = .id_ref, .quantifier = .required },
6301 .{ .kind = .id_ref, .quantifier = .required },
6302 .{ .kind = .memory_access, .quantifier = .optional },
6303 },
6304 },
6305 .{
6306 .name = "OpCopyMemory",
6307 .opcode = 63,
6308 .operands = &.{
6309 .{ .kind = .id_ref, .quantifier = .required },
6310 .{ .kind = .id_ref, .quantifier = .required },
6311 .{ .kind = .memory_access, .quantifier = .optional },
6312 .{ .kind = .memory_access, .quantifier = .optional },
6313 },
6314 },
6315 .{
6316 .name = "OpCopyMemorySized",
6317 .opcode = 64,
6318 .operands = &.{
6319 .{ .kind = .id_ref, .quantifier = .required },
6320 .{ .kind = .id_ref, .quantifier = .required },
6321 .{ .kind = .id_ref, .quantifier = .required },
6322 .{ .kind = .memory_access, .quantifier = .optional },
6323 .{ .kind = .memory_access, .quantifier = .optional },
6324 },
6325 },
6326 .{
6327 .name = "OpAccessChain",
6328 .opcode = 65,
6329 .operands = &.{
6330 .{ .kind = .id_result_type, .quantifier = .required },
6331 .{ .kind = .id_result, .quantifier = .required },
6332 .{ .kind = .id_ref, .quantifier = .required },
6333 .{ .kind = .id_ref, .quantifier = .variadic },
6334 },
6335 },
6336 .{
6337 .name = "OpInBoundsAccessChain",
6338 .opcode = 66,
6339 .operands = &.{
6340 .{ .kind = .id_result_type, .quantifier = .required },
6341 .{ .kind = .id_result, .quantifier = .required },
6342 .{ .kind = .id_ref, .quantifier = .required },
6343 .{ .kind = .id_ref, .quantifier = .variadic },
6344 },
6345 },
6346 .{
6347 .name = "OpPtrAccessChain",
6348 .opcode = 67,
6349 .operands = &.{
6350 .{ .kind = .id_result_type, .quantifier = .required },
6351 .{ .kind = .id_result, .quantifier = .required },
6352 .{ .kind = .id_ref, .quantifier = .required },
6353 .{ .kind = .id_ref, .quantifier = .required },
6354 .{ .kind = .id_ref, .quantifier = .variadic },
6355 },
6356 },
6357 .{
6358 .name = "OpArrayLength",
6359 .opcode = 68,
6360 .operands = &.{
6361 .{ .kind = .id_result_type, .quantifier = .required },
6362 .{ .kind = .id_result, .quantifier = .required },
6363 .{ .kind = .id_ref, .quantifier = .required },
6364 .{ .kind = .literal_integer, .quantifier = .required },
6365 },
6366 },
6367 .{
6368 .name = "OpGenericPtrMemSemantics",
6369 .opcode = 69,
6370 .operands = &.{
6371 .{ .kind = .id_result_type, .quantifier = .required },
6372 .{ .kind = .id_result, .quantifier = .required },
6373 .{ .kind = .id_ref, .quantifier = .required },
6374 },
6375 },
6376 .{
6377 .name = "OpInBoundsPtrAccessChain",
6378 .opcode = 70,
6379 .operands = &.{
6380 .{ .kind = .id_result_type, .quantifier = .required },
6381 .{ .kind = .id_result, .quantifier = .required },
6382 .{ .kind = .id_ref, .quantifier = .required },
6383 .{ .kind = .id_ref, .quantifier = .required },
6384 .{ .kind = .id_ref, .quantifier = .variadic },
6385 },
6386 },
6387 .{
6388 .name = "OpDecorate",
6389 .opcode = 71,
6390 .operands = &.{
6391 .{ .kind = .id_ref, .quantifier = .required },
6392 .{ .kind = .decoration, .quantifier = .required },
6393 },
6394 },
6395 .{
6396 .name = "OpMemberDecorate",
6397 .opcode = 72,
6398 .operands = &.{
6399 .{ .kind = .id_ref, .quantifier = .required },
6400 .{ .kind = .literal_integer, .quantifier = .required },
6401 .{ .kind = .decoration, .quantifier = .required },
6402 },
6403 },
6404 .{
6405 .name = "OpDecorationGroup",
6406 .opcode = 73,
6407 .operands = &.{
6408 .{ .kind = .id_result, .quantifier = .required },
6409 },
6410 },
6411 .{
6412 .name = "OpGroupDecorate",
6413 .opcode = 74,
6414 .operands = &.{
6415 .{ .kind = .id_ref, .quantifier = .required },
6416 .{ .kind = .id_ref, .quantifier = .variadic },
6417 },
6418 },
6419 .{
6420 .name = "OpGroupMemberDecorate",
6421 .opcode = 75,
6422 .operands = &.{
6423 .{ .kind = .id_ref, .quantifier = .required },
6424 .{ .kind = .pair_id_ref_literal_integer, .quantifier = .variadic },
6425 },
6426 },
6427 .{
6428 .name = "OpVectorExtractDynamic",
6429 .opcode = 77,
6430 .operands = &.{
6431 .{ .kind = .id_result_type, .quantifier = .required },
6432 .{ .kind = .id_result, .quantifier = .required },
6433 .{ .kind = .id_ref, .quantifier = .required },
6434 .{ .kind = .id_ref, .quantifier = .required },
6435 },
6436 },
6437 .{
6438 .name = "OpVectorInsertDynamic",
6439 .opcode = 78,
6440 .operands = &.{
6441 .{ .kind = .id_result_type, .quantifier = .required },
6442 .{ .kind = .id_result, .quantifier = .required },
6443 .{ .kind = .id_ref, .quantifier = .required },
6444 .{ .kind = .id_ref, .quantifier = .required },
6445 .{ .kind = .id_ref, .quantifier = .required },
6446 },
6447 },
6448 .{
6449 .name = "OpVectorShuffle",
6450 .opcode = 79,
6451 .operands = &.{
6452 .{ .kind = .id_result_type, .quantifier = .required },
6453 .{ .kind = .id_result, .quantifier = .required },
6454 .{ .kind = .id_ref, .quantifier = .required },
6455 .{ .kind = .id_ref, .quantifier = .required },
6456 .{ .kind = .literal_integer, .quantifier = .variadic },
6457 },
6458 },
6459 .{
6460 .name = "OpCompositeConstruct",
6461 .opcode = 80,
6462 .operands = &.{
6463 .{ .kind = .id_result_type, .quantifier = .required },
6464 .{ .kind = .id_result, .quantifier = .required },
6465 .{ .kind = .id_ref, .quantifier = .variadic },
6466 },
6467 },
6468 .{
6469 .name = "OpCompositeExtract",
6470 .opcode = 81,
6471 .operands = &.{
6472 .{ .kind = .id_result_type, .quantifier = .required },
6473 .{ .kind = .id_result, .quantifier = .required },
6474 .{ .kind = .id_ref, .quantifier = .required },
6475 .{ .kind = .literal_integer, .quantifier = .variadic },
6476 },
6477 },
6478 .{
6479 .name = "OpCompositeInsert",
6480 .opcode = 82,
6481 .operands = &.{
6482 .{ .kind = .id_result_type, .quantifier = .required },
6483 .{ .kind = .id_result, .quantifier = .required },
6484 .{ .kind = .id_ref, .quantifier = .required },
6485 .{ .kind = .id_ref, .quantifier = .required },
6486 .{ .kind = .literal_integer, .quantifier = .variadic },
6487 },
6488 },
6489 .{
6490 .name = "OpCopyObject",
6491 .opcode = 83,
6492 .operands = &.{
6493 .{ .kind = .id_result_type, .quantifier = .required },
6494 .{ .kind = .id_result, .quantifier = .required },
6495 .{ .kind = .id_ref, .quantifier = .required },
6496 },
6497 },
6498 .{
6499 .name = "OpTranspose",
6500 .opcode = 84,
6501 .operands = &.{
6502 .{ .kind = .id_result_type, .quantifier = .required },
6503 .{ .kind = .id_result, .quantifier = .required },
6504 .{ .kind = .id_ref, .quantifier = .required },
6505 },
6506 },
6507 .{
6508 .name = "OpSampledImage",
6509 .opcode = 86,
6510 .operands = &.{
6511 .{ .kind = .id_result_type, .quantifier = .required },
6512 .{ .kind = .id_result, .quantifier = .required },
6513 .{ .kind = .id_ref, .quantifier = .required },
6514 .{ .kind = .id_ref, .quantifier = .required },
6515 },
6516 },
6517 .{
6518 .name = "OpImageSampleImplicitLod",
6519 .opcode = 87,
6520 .operands = &.{
6521 .{ .kind = .id_result_type, .quantifier = .required },
6522 .{ .kind = .id_result, .quantifier = .required },
6523 .{ .kind = .id_ref, .quantifier = .required },
6524 .{ .kind = .id_ref, .quantifier = .required },
6525 .{ .kind = .image_operands, .quantifier = .optional },
6526 },
6527 },
6528 .{
6529 .name = "OpImageSampleExplicitLod",
6530 .opcode = 88,
6531 .operands = &.{
6532 .{ .kind = .id_result_type, .quantifier = .required },
6533 .{ .kind = .id_result, .quantifier = .required },
6534 .{ .kind = .id_ref, .quantifier = .required },
6535 .{ .kind = .id_ref, .quantifier = .required },
6536 .{ .kind = .image_operands, .quantifier = .required },
6537 },
6538 },
6539 .{
6540 .name = "OpImageSampleDrefImplicitLod",
6541 .opcode = 89,
6542 .operands = &.{
6543 .{ .kind = .id_result_type, .quantifier = .required },
6544 .{ .kind = .id_result, .quantifier = .required },
6545 .{ .kind = .id_ref, .quantifier = .required },
6546 .{ .kind = .id_ref, .quantifier = .required },
6547 .{ .kind = .id_ref, .quantifier = .required },
6548 .{ .kind = .image_operands, .quantifier = .optional },
6549 },
6550 },
6551 .{
6552 .name = "OpImageSampleDrefExplicitLod",
6553 .opcode = 90,
6554 .operands = &.{
6555 .{ .kind = .id_result_type, .quantifier = .required },
6556 .{ .kind = .id_result, .quantifier = .required },
6557 .{ .kind = .id_ref, .quantifier = .required },
6558 .{ .kind = .id_ref, .quantifier = .required },
6559 .{ .kind = .id_ref, .quantifier = .required },
6560 .{ .kind = .image_operands, .quantifier = .required },
6561 },
6562 },
6563 .{
6564 .name = "OpImageSampleProjImplicitLod",
6565 .opcode = 91,
6566 .operands = &.{
6567 .{ .kind = .id_result_type, .quantifier = .required },
6568 .{ .kind = .id_result, .quantifier = .required },
6569 .{ .kind = .id_ref, .quantifier = .required },
6570 .{ .kind = .id_ref, .quantifier = .required },
6571 .{ .kind = .image_operands, .quantifier = .optional },
6572 },
6573 },
6574 .{
6575 .name = "OpImageSampleProjExplicitLod",
6576 .opcode = 92,
6577 .operands = &.{
6578 .{ .kind = .id_result_type, .quantifier = .required },
6579 .{ .kind = .id_result, .quantifier = .required },
6580 .{ .kind = .id_ref, .quantifier = .required },
6581 .{ .kind = .id_ref, .quantifier = .required },
6582 .{ .kind = .image_operands, .quantifier = .required },
6583 },
6584 },
6585 .{
6586 .name = "OpImageSampleProjDrefImplicitLod",
6587 .opcode = 93,
6588 .operands = &.{
6589 .{ .kind = .id_result_type, .quantifier = .required },
6590 .{ .kind = .id_result, .quantifier = .required },
6591 .{ .kind = .id_ref, .quantifier = .required },
6592 .{ .kind = .id_ref, .quantifier = .required },
6593 .{ .kind = .id_ref, .quantifier = .required },
6594 .{ .kind = .image_operands, .quantifier = .optional },
6595 },
6596 },
6597 .{
6598 .name = "OpImageSampleProjDrefExplicitLod",
6599 .opcode = 94,
6600 .operands = &.{
6601 .{ .kind = .id_result_type, .quantifier = .required },
6602 .{ .kind = .id_result, .quantifier = .required },
6603 .{ .kind = .id_ref, .quantifier = .required },
6604 .{ .kind = .id_ref, .quantifier = .required },
6605 .{ .kind = .id_ref, .quantifier = .required },
6606 .{ .kind = .image_operands, .quantifier = .required },
6607 },
6608 },
6609 .{
6610 .name = "OpImageFetch",
6611 .opcode = 95,
6612 .operands = &.{
6613 .{ .kind = .id_result_type, .quantifier = .required },
6614 .{ .kind = .id_result, .quantifier = .required },
6615 .{ .kind = .id_ref, .quantifier = .required },
6616 .{ .kind = .id_ref, .quantifier = .required },
6617 .{ .kind = .image_operands, .quantifier = .optional },
6618 },
6619 },
6620 .{
6621 .name = "OpImageGather",
6622 .opcode = 96,
6623 .operands = &.{
6624 .{ .kind = .id_result_type, .quantifier = .required },
6625 .{ .kind = .id_result, .quantifier = .required },
6626 .{ .kind = .id_ref, .quantifier = .required },
6627 .{ .kind = .id_ref, .quantifier = .required },
6628 .{ .kind = .id_ref, .quantifier = .required },
6629 .{ .kind = .image_operands, .quantifier = .optional },
6630 },
6631 },
6632 .{
6633 .name = "OpImageDrefGather",
6634 .opcode = 97,
6635 .operands = &.{
6636 .{ .kind = .id_result_type, .quantifier = .required },
6637 .{ .kind = .id_result, .quantifier = .required },
6638 .{ .kind = .id_ref, .quantifier = .required },
6639 .{ .kind = .id_ref, .quantifier = .required },
6640 .{ .kind = .id_ref, .quantifier = .required },
6641 .{ .kind = .image_operands, .quantifier = .optional },
6642 },
6643 },
6644 .{
6645 .name = "OpImageRead",
6646 .opcode = 98,
6647 .operands = &.{
6648 .{ .kind = .id_result_type, .quantifier = .required },
6649 .{ .kind = .id_result, .quantifier = .required },
6650 .{ .kind = .id_ref, .quantifier = .required },
6651 .{ .kind = .id_ref, .quantifier = .required },
6652 .{ .kind = .image_operands, .quantifier = .optional },
6653 },
6654 },
6655 .{
6656 .name = "OpImageWrite",
6657 .opcode = 99,
6658 .operands = &.{
6659 .{ .kind = .id_ref, .quantifier = .required },
6660 .{ .kind = .id_ref, .quantifier = .required },
6661 .{ .kind = .id_ref, .quantifier = .required },
6662 .{ .kind = .image_operands, .quantifier = .optional },
6663 },
6664 },
6665 .{
6666 .name = "OpImage",
6667 .opcode = 100,
6668 .operands = &.{
6669 .{ .kind = .id_result_type, .quantifier = .required },
6670 .{ .kind = .id_result, .quantifier = .required },
6671 .{ .kind = .id_ref, .quantifier = .required },
6672 },
6673 },
6674 .{
6675 .name = "OpImageQueryFormat",
6676 .opcode = 101,
6677 .operands = &.{
6678 .{ .kind = .id_result_type, .quantifier = .required },
6679 .{ .kind = .id_result, .quantifier = .required },
6680 .{ .kind = .id_ref, .quantifier = .required },
6681 },
6682 },
6683 .{
6684 .name = "OpImageQueryOrder",
6685 .opcode = 102,
6686 .operands = &.{
6687 .{ .kind = .id_result_type, .quantifier = .required },
6688 .{ .kind = .id_result, .quantifier = .required },
6689 .{ .kind = .id_ref, .quantifier = .required },
6690 },
6691 },
6692 .{
6693 .name = "OpImageQuerySizeLod",
6694 .opcode = 103,
6695 .operands = &.{
6696 .{ .kind = .id_result_type, .quantifier = .required },
6697 .{ .kind = .id_result, .quantifier = .required },
6698 .{ .kind = .id_ref, .quantifier = .required },
6699 .{ .kind = .id_ref, .quantifier = .required },
6700 },
6701 },
6702 .{
6703 .name = "OpImageQuerySize",
6704 .opcode = 104,
6705 .operands = &.{
6706 .{ .kind = .id_result_type, .quantifier = .required },
6707 .{ .kind = .id_result, .quantifier = .required },
6708 .{ .kind = .id_ref, .quantifier = .required },
6709 },
6710 },
6711 .{
6712 .name = "OpImageQueryLod",
6713 .opcode = 105,
6714 .operands = &.{
6715 .{ .kind = .id_result_type, .quantifier = .required },
6716 .{ .kind = .id_result, .quantifier = .required },
6717 .{ .kind = .id_ref, .quantifier = .required },
6718 .{ .kind = .id_ref, .quantifier = .required },
6719 },
6720 },
6721 .{
6722 .name = "OpImageQueryLevels",
6723 .opcode = 106,
6724 .operands = &.{
6725 .{ .kind = .id_result_type, .quantifier = .required },
6726 .{ .kind = .id_result, .quantifier = .required },
6727 .{ .kind = .id_ref, .quantifier = .required },
6728 },
6729 },
6730 .{
6731 .name = "OpImageQuerySamples",
6732 .opcode = 107,
6733 .operands = &.{
6734 .{ .kind = .id_result_type, .quantifier = .required },
6735 .{ .kind = .id_result, .quantifier = .required },
6736 .{ .kind = .id_ref, .quantifier = .required },
6737 },
6738 },
6739 .{
6740 .name = "OpConvertFToU",
6741 .opcode = 109,
6742 .operands = &.{
6743 .{ .kind = .id_result_type, .quantifier = .required },
6744 .{ .kind = .id_result, .quantifier = .required },
6745 .{ .kind = .id_ref, .quantifier = .required },
6746 },
6747 },
6748 .{
6749 .name = "OpConvertFToS",
6750 .opcode = 110,
6751 .operands = &.{
6752 .{ .kind = .id_result_type, .quantifier = .required },
6753 .{ .kind = .id_result, .quantifier = .required },
6754 .{ .kind = .id_ref, .quantifier = .required },
6755 },
6756 },
6757 .{
6758 .name = "OpConvertSToF",
6759 .opcode = 111,
6760 .operands = &.{
6761 .{ .kind = .id_result_type, .quantifier = .required },
6762 .{ .kind = .id_result, .quantifier = .required },
6763 .{ .kind = .id_ref, .quantifier = .required },
6764 },
6765 },
6766 .{
6767 .name = "OpConvertUToF",
6768 .opcode = 112,
6769 .operands = &.{
6770 .{ .kind = .id_result_type, .quantifier = .required },
6771 .{ .kind = .id_result, .quantifier = .required },
6772 .{ .kind = .id_ref, .quantifier = .required },
6773 },
6774 },
6775 .{
6776 .name = "OpUConvert",
6777 .opcode = 113,
6778 .operands = &.{
6779 .{ .kind = .id_result_type, .quantifier = .required },
6780 .{ .kind = .id_result, .quantifier = .required },
6781 .{ .kind = .id_ref, .quantifier = .required },
6782 },
6783 },
6784 .{
6785 .name = "OpSConvert",
6786 .opcode = 114,
6787 .operands = &.{
6788 .{ .kind = .id_result_type, .quantifier = .required },
6789 .{ .kind = .id_result, .quantifier = .required },
6790 .{ .kind = .id_ref, .quantifier = .required },
6791 },
6792 },
6793 .{
6794 .name = "OpFConvert",
6795 .opcode = 115,
6796 .operands = &.{
6797 .{ .kind = .id_result_type, .quantifier = .required },
6798 .{ .kind = .id_result, .quantifier = .required },
6799 .{ .kind = .id_ref, .quantifier = .required },
6800 },
6801 },
6802 .{
6803 .name = "OpQuantizeToF16",
6804 .opcode = 116,
6805 .operands = &.{
6806 .{ .kind = .id_result_type, .quantifier = .required },
6807 .{ .kind = .id_result, .quantifier = .required },
6808 .{ .kind = .id_ref, .quantifier = .required },
6809 },
6810 },
6811 .{
6812 .name = "OpConvertPtrToU",
6813 .opcode = 117,
6814 .operands = &.{
6815 .{ .kind = .id_result_type, .quantifier = .required },
6816 .{ .kind = .id_result, .quantifier = .required },
6817 .{ .kind = .id_ref, .quantifier = .required },
6818 },
6819 },
6820 .{
6821 .name = "OpSatConvertSToU",
6822 .opcode = 118,
6823 .operands = &.{
6824 .{ .kind = .id_result_type, .quantifier = .required },
6825 .{ .kind = .id_result, .quantifier = .required },
6826 .{ .kind = .id_ref, .quantifier = .required },
6827 },
6828 },
6829 .{
6830 .name = "OpSatConvertUToS",
6831 .opcode = 119,
6832 .operands = &.{
6833 .{ .kind = .id_result_type, .quantifier = .required },
6834 .{ .kind = .id_result, .quantifier = .required },
6835 .{ .kind = .id_ref, .quantifier = .required },
6836 },
6837 },
6838 .{
6839 .name = "OpConvertUToPtr",
6840 .opcode = 120,
6841 .operands = &.{
6842 .{ .kind = .id_result_type, .quantifier = .required },
6843 .{ .kind = .id_result, .quantifier = .required },
6844 .{ .kind = .id_ref, .quantifier = .required },
6845 },
6846 },
6847 .{
6848 .name = "OpPtrCastToGeneric",
6849 .opcode = 121,
6850 .operands = &.{
6851 .{ .kind = .id_result_type, .quantifier = .required },
6852 .{ .kind = .id_result, .quantifier = .required },
6853 .{ .kind = .id_ref, .quantifier = .required },
6854 },
6855 },
6856 .{
6857 .name = "OpGenericCastToPtr",
6858 .opcode = 122,
6859 .operands = &.{
6860 .{ .kind = .id_result_type, .quantifier = .required },
6861 .{ .kind = .id_result, .quantifier = .required },
6862 .{ .kind = .id_ref, .quantifier = .required },
6863 },
6864 },
6865 .{
6866 .name = "OpGenericCastToPtrExplicit",
6867 .opcode = 123,
6868 .operands = &.{
6869 .{ .kind = .id_result_type, .quantifier = .required },
6870 .{ .kind = .id_result, .quantifier = .required },
6871 .{ .kind = .id_ref, .quantifier = .required },
6872 .{ .kind = .storage_class, .quantifier = .required },
6873 },
6874 },
6875 .{
6876 .name = "OpBitcast",
6877 .opcode = 124,
6878 .operands = &.{
6879 .{ .kind = .id_result_type, .quantifier = .required },
6880 .{ .kind = .id_result, .quantifier = .required },
6881 .{ .kind = .id_ref, .quantifier = .required },
6882 },
6883 },
6884 .{
6885 .name = "OpSNegate",
6886 .opcode = 126,
6887 .operands = &.{
6888 .{ .kind = .id_result_type, .quantifier = .required },
6889 .{ .kind = .id_result, .quantifier = .required },
6890 .{ .kind = .id_ref, .quantifier = .required },
6891 },
6892 },
6893 .{
6894 .name = "OpFNegate",
6895 .opcode = 127,
6896 .operands = &.{
6897 .{ .kind = .id_result_type, .quantifier = .required },
6898 .{ .kind = .id_result, .quantifier = .required },
6899 .{ .kind = .id_ref, .quantifier = .required },
6900 },
6901 },
6902 .{
6903 .name = "OpIAdd",
6904 .opcode = 128,
6905 .operands = &.{
6906 .{ .kind = .id_result_type, .quantifier = .required },
6907 .{ .kind = .id_result, .quantifier = .required },
6908 .{ .kind = .id_ref, .quantifier = .required },
6909 .{ .kind = .id_ref, .quantifier = .required },
6910 },
6911 },
6912 .{
6913 .name = "OpFAdd",
6914 .opcode = 129,
6915 .operands = &.{
6916 .{ .kind = .id_result_type, .quantifier = .required },
6917 .{ .kind = .id_result, .quantifier = .required },
6918 .{ .kind = .id_ref, .quantifier = .required },
6919 .{ .kind = .id_ref, .quantifier = .required },
6920 },
6921 },
6922 .{
6923 .name = "OpISub",
6924 .opcode = 130,
6925 .operands = &.{
6926 .{ .kind = .id_result_type, .quantifier = .required },
6927 .{ .kind = .id_result, .quantifier = .required },
6928 .{ .kind = .id_ref, .quantifier = .required },
6929 .{ .kind = .id_ref, .quantifier = .required },
6930 },
6931 },
6932 .{
6933 .name = "OpFSub",
6934 .opcode = 131,
6935 .operands = &.{
6936 .{ .kind = .id_result_type, .quantifier = .required },
6937 .{ .kind = .id_result, .quantifier = .required },
6938 .{ .kind = .id_ref, .quantifier = .required },
6939 .{ .kind = .id_ref, .quantifier = .required },
6940 },
6941 },
6942 .{
6943 .name = "OpIMul",
6944 .opcode = 132,
6945 .operands = &.{
6946 .{ .kind = .id_result_type, .quantifier = .required },
6947 .{ .kind = .id_result, .quantifier = .required },
6948 .{ .kind = .id_ref, .quantifier = .required },
6949 .{ .kind = .id_ref, .quantifier = .required },
6950 },
6951 },
6952 .{
6953 .name = "OpFMul",
6954 .opcode = 133,
6955 .operands = &.{
6956 .{ .kind = .id_result_type, .quantifier = .required },
6957 .{ .kind = .id_result, .quantifier = .required },
6958 .{ .kind = .id_ref, .quantifier = .required },
6959 .{ .kind = .id_ref, .quantifier = .required },
6960 },
6961 },
6962 .{
6963 .name = "OpUDiv",
6964 .opcode = 134,
6965 .operands = &.{
6966 .{ .kind = .id_result_type, .quantifier = .required },
6967 .{ .kind = .id_result, .quantifier = .required },
6968 .{ .kind = .id_ref, .quantifier = .required },
6969 .{ .kind = .id_ref, .quantifier = .required },
6970 },
6971 },
6972 .{
6973 .name = "OpSDiv",
6974 .opcode = 135,
6975 .operands = &.{
6976 .{ .kind = .id_result_type, .quantifier = .required },
6977 .{ .kind = .id_result, .quantifier = .required },
6978 .{ .kind = .id_ref, .quantifier = .required },
6979 .{ .kind = .id_ref, .quantifier = .required },
6980 },
6981 },
6982 .{
6983 .name = "OpFDiv",
6984 .opcode = 136,
6985 .operands = &.{
6986 .{ .kind = .id_result_type, .quantifier = .required },
6987 .{ .kind = .id_result, .quantifier = .required },
6988 .{ .kind = .id_ref, .quantifier = .required },
6989 .{ .kind = .id_ref, .quantifier = .required },
6990 },
6991 },
6992 .{
6993 .name = "OpUMod",
6994 .opcode = 137,
6995 .operands = &.{
6996 .{ .kind = .id_result_type, .quantifier = .required },
6997 .{ .kind = .id_result, .quantifier = .required },
6998 .{ .kind = .id_ref, .quantifier = .required },
6999 .{ .kind = .id_ref, .quantifier = .required },
7000 },
7001 },
7002 .{
7003 .name = "OpSRem",
7004 .opcode = 138,
7005 .operands = &.{
7006 .{ .kind = .id_result_type, .quantifier = .required },
7007 .{ .kind = .id_result, .quantifier = .required },
7008 .{ .kind = .id_ref, .quantifier = .required },
7009 .{ .kind = .id_ref, .quantifier = .required },
7010 },
7011 },
7012 .{
7013 .name = "OpSMod",
7014 .opcode = 139,
7015 .operands = &.{
7016 .{ .kind = .id_result_type, .quantifier = .required },
7017 .{ .kind = .id_result, .quantifier = .required },
7018 .{ .kind = .id_ref, .quantifier = .required },
7019 .{ .kind = .id_ref, .quantifier = .required },
7020 },
7021 },
7022 .{
7023 .name = "OpFRem",
7024 .opcode = 140,
7025 .operands = &.{
7026 .{ .kind = .id_result_type, .quantifier = .required },
7027 .{ .kind = .id_result, .quantifier = .required },
7028 .{ .kind = .id_ref, .quantifier = .required },
7029 .{ .kind = .id_ref, .quantifier = .required },
7030 },
7031 },
7032 .{
7033 .name = "OpFMod",
7034 .opcode = 141,
7035 .operands = &.{
7036 .{ .kind = .id_result_type, .quantifier = .required },
7037 .{ .kind = .id_result, .quantifier = .required },
7038 .{ .kind = .id_ref, .quantifier = .required },
7039 .{ .kind = .id_ref, .quantifier = .required },
7040 },
7041 },
7042 .{
7043 .name = "OpVectorTimesScalar",
7044 .opcode = 142,
7045 .operands = &.{
7046 .{ .kind = .id_result_type, .quantifier = .required },
7047 .{ .kind = .id_result, .quantifier = .required },
7048 .{ .kind = .id_ref, .quantifier = .required },
7049 .{ .kind = .id_ref, .quantifier = .required },
7050 },
7051 },
7052 .{
7053 .name = "OpMatrixTimesScalar",
7054 .opcode = 143,
7055 .operands = &.{
7056 .{ .kind = .id_result_type, .quantifier = .required },
7057 .{ .kind = .id_result, .quantifier = .required },
7058 .{ .kind = .id_ref, .quantifier = .required },
7059 .{ .kind = .id_ref, .quantifier = .required },
7060 },
7061 },
7062 .{
7063 .name = "OpVectorTimesMatrix",
7064 .opcode = 144,
7065 .operands = &.{
7066 .{ .kind = .id_result_type, .quantifier = .required },
7067 .{ .kind = .id_result, .quantifier = .required },
7068 .{ .kind = .id_ref, .quantifier = .required },
7069 .{ .kind = .id_ref, .quantifier = .required },
7070 },
7071 },
7072 .{
7073 .name = "OpMatrixTimesVector",
7074 .opcode = 145,
7075 .operands = &.{
7076 .{ .kind = .id_result_type, .quantifier = .required },
7077 .{ .kind = .id_result, .quantifier = .required },
7078 .{ .kind = .id_ref, .quantifier = .required },
7079 .{ .kind = .id_ref, .quantifier = .required },
7080 },
7081 },
7082 .{
7083 .name = "OpMatrixTimesMatrix",
7084 .opcode = 146,
7085 .operands = &.{
7086 .{ .kind = .id_result_type, .quantifier = .required },
7087 .{ .kind = .id_result, .quantifier = .required },
7088 .{ .kind = .id_ref, .quantifier = .required },
7089 .{ .kind = .id_ref, .quantifier = .required },
7090 },
7091 },
7092 .{
7093 .name = "OpOuterProduct",
7094 .opcode = 147,
7095 .operands = &.{
7096 .{ .kind = .id_result_type, .quantifier = .required },
7097 .{ .kind = .id_result, .quantifier = .required },
7098 .{ .kind = .id_ref, .quantifier = .required },
7099 .{ .kind = .id_ref, .quantifier = .required },
7100 },
7101 },
7102 .{
7103 .name = "OpDot",
7104 .opcode = 148,
7105 .operands = &.{
7106 .{ .kind = .id_result_type, .quantifier = .required },
7107 .{ .kind = .id_result, .quantifier = .required },
7108 .{ .kind = .id_ref, .quantifier = .required },
7109 .{ .kind = .id_ref, .quantifier = .required },
7110 },
7111 },
7112 .{
7113 .name = "OpIAddCarry",
7114 .opcode = 149,
7115 .operands = &.{
7116 .{ .kind = .id_result_type, .quantifier = .required },
7117 .{ .kind = .id_result, .quantifier = .required },
7118 .{ .kind = .id_ref, .quantifier = .required },
7119 .{ .kind = .id_ref, .quantifier = .required },
7120 },
7121 },
7122 .{
7123 .name = "OpISubBorrow",
7124 .opcode = 150,
7125 .operands = &.{
7126 .{ .kind = .id_result_type, .quantifier = .required },
7127 .{ .kind = .id_result, .quantifier = .required },
7128 .{ .kind = .id_ref, .quantifier = .required },
7129 .{ .kind = .id_ref, .quantifier = .required },
7130 },
7131 },
7132 .{
7133 .name = "OpUMulExtended",
7134 .opcode = 151,
7135 .operands = &.{
7136 .{ .kind = .id_result_type, .quantifier = .required },
7137 .{ .kind = .id_result, .quantifier = .required },
7138 .{ .kind = .id_ref, .quantifier = .required },
7139 .{ .kind = .id_ref, .quantifier = .required },
7140 },
7141 },
7142 .{
7143 .name = "OpSMulExtended",
7144 .opcode = 152,
7145 .operands = &.{
7146 .{ .kind = .id_result_type, .quantifier = .required },
7147 .{ .kind = .id_result, .quantifier = .required },
7148 .{ .kind = .id_ref, .quantifier = .required },
7149 .{ .kind = .id_ref, .quantifier = .required },
7150 },
7151 },
7152 .{
7153 .name = "OpAny",
7154 .opcode = 154,
7155 .operands = &.{
7156 .{ .kind = .id_result_type, .quantifier = .required },
7157 .{ .kind = .id_result, .quantifier = .required },
7158 .{ .kind = .id_ref, .quantifier = .required },
7159 },
7160 },
7161 .{
7162 .name = "OpAll",
7163 .opcode = 155,
7164 .operands = &.{
7165 .{ .kind = .id_result_type, .quantifier = .required },
7166 .{ .kind = .id_result, .quantifier = .required },
7167 .{ .kind = .id_ref, .quantifier = .required },
7168 },
7169 },
7170 .{
7171 .name = "OpIsNan",
7172 .opcode = 156,
7173 .operands = &.{
7174 .{ .kind = .id_result_type, .quantifier = .required },
7175 .{ .kind = .id_result, .quantifier = .required },
7176 .{ .kind = .id_ref, .quantifier = .required },
7177 },
7178 },
7179 .{
7180 .name = "OpIsInf",
7181 .opcode = 157,
7182 .operands = &.{
7183 .{ .kind = .id_result_type, .quantifier = .required },
7184 .{ .kind = .id_result, .quantifier = .required },
7185 .{ .kind = .id_ref, .quantifier = .required },
7186 },
7187 },
7188 .{
7189 .name = "OpIsFinite",
7190 .opcode = 158,
7191 .operands = &.{
7192 .{ .kind = .id_result_type, .quantifier = .required },
7193 .{ .kind = .id_result, .quantifier = .required },
7194 .{ .kind = .id_ref, .quantifier = .required },
7195 },
7196 },
7197 .{
7198 .name = "OpIsNormal",
7199 .opcode = 159,
7200 .operands = &.{
7201 .{ .kind = .id_result_type, .quantifier = .required },
7202 .{ .kind = .id_result, .quantifier = .required },
7203 .{ .kind = .id_ref, .quantifier = .required },
7204 },
7205 },
7206 .{
7207 .name = "OpSignBitSet",
7208 .opcode = 160,
7209 .operands = &.{
7210 .{ .kind = .id_result_type, .quantifier = .required },
7211 .{ .kind = .id_result, .quantifier = .required },
7212 .{ .kind = .id_ref, .quantifier = .required },
7213 },
7214 },
7215 .{
7216 .name = "OpLessOrGreater",
7217 .opcode = 161,
7218 .operands = &.{
7219 .{ .kind = .id_result_type, .quantifier = .required },
7220 .{ .kind = .id_result, .quantifier = .required },
7221 .{ .kind = .id_ref, .quantifier = .required },
7222 .{ .kind = .id_ref, .quantifier = .required },
7223 },
7224 },
7225 .{
7226 .name = "OpOrdered",
7227 .opcode = 162,
7228 .operands = &.{
7229 .{ .kind = .id_result_type, .quantifier = .required },
7230 .{ .kind = .id_result, .quantifier = .required },
7231 .{ .kind = .id_ref, .quantifier = .required },
7232 .{ .kind = .id_ref, .quantifier = .required },
7233 },
7234 },
7235 .{
7236 .name = "OpUnordered",
7237 .opcode = 163,
7238 .operands = &.{
7239 .{ .kind = .id_result_type, .quantifier = .required },
7240 .{ .kind = .id_result, .quantifier = .required },
7241 .{ .kind = .id_ref, .quantifier = .required },
7242 .{ .kind = .id_ref, .quantifier = .required },
7243 },
7244 },
7245 .{
7246 .name = "OpLogicalEqual",
7247 .opcode = 164,
7248 .operands = &.{
7249 .{ .kind = .id_result_type, .quantifier = .required },
7250 .{ .kind = .id_result, .quantifier = .required },
7251 .{ .kind = .id_ref, .quantifier = .required },
7252 .{ .kind = .id_ref, .quantifier = .required },
7253 },
7254 },
7255 .{
7256 .name = "OpLogicalNotEqual",
7257 .opcode = 165,
7258 .operands = &.{
7259 .{ .kind = .id_result_type, .quantifier = .required },
7260 .{ .kind = .id_result, .quantifier = .required },
7261 .{ .kind = .id_ref, .quantifier = .required },
7262 .{ .kind = .id_ref, .quantifier = .required },
7263 },
7264 },
7265 .{
7266 .name = "OpLogicalOr",
7267 .opcode = 166,
7268 .operands = &.{
7269 .{ .kind = .id_result_type, .quantifier = .required },
7270 .{ .kind = .id_result, .quantifier = .required },
7271 .{ .kind = .id_ref, .quantifier = .required },
7272 .{ .kind = .id_ref, .quantifier = .required },
7273 },
7274 },
7275 .{
7276 .name = "OpLogicalAnd",
7277 .opcode = 167,
7278 .operands = &.{
7279 .{ .kind = .id_result_type, .quantifier = .required },
7280 .{ .kind = .id_result, .quantifier = .required },
7281 .{ .kind = .id_ref, .quantifier = .required },
7282 .{ .kind = .id_ref, .quantifier = .required },
7283 },
7284 },
7285 .{
7286 .name = "OpLogicalNot",
7287 .opcode = 168,
7288 .operands = &.{
7289 .{ .kind = .id_result_type, .quantifier = .required },
7290 .{ .kind = .id_result, .quantifier = .required },
7291 .{ .kind = .id_ref, .quantifier = .required },
7292 },
7293 },
7294 .{
7295 .name = "OpSelect",
7296 .opcode = 169,
7297 .operands = &.{
7298 .{ .kind = .id_result_type, .quantifier = .required },
7299 .{ .kind = .id_result, .quantifier = .required },
7300 .{ .kind = .id_ref, .quantifier = .required },
7301 .{ .kind = .id_ref, .quantifier = .required },
7302 .{ .kind = .id_ref, .quantifier = .required },
7303 },
7304 },
7305 .{
7306 .name = "OpIEqual",
7307 .opcode = 170,
7308 .operands = &.{
7309 .{ .kind = .id_result_type, .quantifier = .required },
7310 .{ .kind = .id_result, .quantifier = .required },
7311 .{ .kind = .id_ref, .quantifier = .required },
7312 .{ .kind = .id_ref, .quantifier = .required },
7313 },
7314 },
7315 .{
7316 .name = "OpINotEqual",
7317 .opcode = 171,
7318 .operands = &.{
7319 .{ .kind = .id_result_type, .quantifier = .required },
7320 .{ .kind = .id_result, .quantifier = .required },
7321 .{ .kind = .id_ref, .quantifier = .required },
7322 .{ .kind = .id_ref, .quantifier = .required },
7323 },
7324 },
7325 .{
7326 .name = "OpUGreaterThan",
7327 .opcode = 172,
7328 .operands = &.{
7329 .{ .kind = .id_result_type, .quantifier = .required },
7330 .{ .kind = .id_result, .quantifier = .required },
7331 .{ .kind = .id_ref, .quantifier = .required },
7332 .{ .kind = .id_ref, .quantifier = .required },
7333 },
7334 },
7335 .{
7336 .name = "OpSGreaterThan",
7337 .opcode = 173,
7338 .operands = &.{
7339 .{ .kind = .id_result_type, .quantifier = .required },
7340 .{ .kind = .id_result, .quantifier = .required },
7341 .{ .kind = .id_ref, .quantifier = .required },
7342 .{ .kind = .id_ref, .quantifier = .required },
7343 },
7344 },
7345 .{
7346 .name = "OpUGreaterThanEqual",
7347 .opcode = 174,
7348 .operands = &.{
7349 .{ .kind = .id_result_type, .quantifier = .required },
7350 .{ .kind = .id_result, .quantifier = .required },
7351 .{ .kind = .id_ref, .quantifier = .required },
7352 .{ .kind = .id_ref, .quantifier = .required },
7353 },
7354 },
7355 .{
7356 .name = "OpSGreaterThanEqual",
7357 .opcode = 175,
7358 .operands = &.{
7359 .{ .kind = .id_result_type, .quantifier = .required },
7360 .{ .kind = .id_result, .quantifier = .required },
7361 .{ .kind = .id_ref, .quantifier = .required },
7362 .{ .kind = .id_ref, .quantifier = .required },
7363 },
7364 },
7365 .{
7366 .name = "OpULessThan",
7367 .opcode = 176,
7368 .operands = &.{
7369 .{ .kind = .id_result_type, .quantifier = .required },
7370 .{ .kind = .id_result, .quantifier = .required },
7371 .{ .kind = .id_ref, .quantifier = .required },
7372 .{ .kind = .id_ref, .quantifier = .required },
7373 },
7374 },
7375 .{
7376 .name = "OpSLessThan",
7377 .opcode = 177,
7378 .operands = &.{
7379 .{ .kind = .id_result_type, .quantifier = .required },
7380 .{ .kind = .id_result, .quantifier = .required },
7381 .{ .kind = .id_ref, .quantifier = .required },
7382 .{ .kind = .id_ref, .quantifier = .required },
7383 },
7384 },
7385 .{
7386 .name = "OpULessThanEqual",
7387 .opcode = 178,
7388 .operands = &.{
7389 .{ .kind = .id_result_type, .quantifier = .required },
7390 .{ .kind = .id_result, .quantifier = .required },
7391 .{ .kind = .id_ref, .quantifier = .required },
7392 .{ .kind = .id_ref, .quantifier = .required },
7393 },
7394 },
7395 .{
7396 .name = "OpSLessThanEqual",
7397 .opcode = 179,
7398 .operands = &.{
7399 .{ .kind = .id_result_type, .quantifier = .required },
7400 .{ .kind = .id_result, .quantifier = .required },
7401 .{ .kind = .id_ref, .quantifier = .required },
7402 .{ .kind = .id_ref, .quantifier = .required },
7403 },
7404 },
7405 .{
7406 .name = "OpFOrdEqual",
7407 .opcode = 180,
7408 .operands = &.{
7409 .{ .kind = .id_result_type, .quantifier = .required },
7410 .{ .kind = .id_result, .quantifier = .required },
7411 .{ .kind = .id_ref, .quantifier = .required },
7412 .{ .kind = .id_ref, .quantifier = .required },
7413 },
7414 },
7415 .{
7416 .name = "OpFUnordEqual",
7417 .opcode = 181,
7418 .operands = &.{
7419 .{ .kind = .id_result_type, .quantifier = .required },
7420 .{ .kind = .id_result, .quantifier = .required },
7421 .{ .kind = .id_ref, .quantifier = .required },
7422 .{ .kind = .id_ref, .quantifier = .required },
7423 },
7424 },
7425 .{
7426 .name = "OpFOrdNotEqual",
7427 .opcode = 182,
7428 .operands = &.{
7429 .{ .kind = .id_result_type, .quantifier = .required },
7430 .{ .kind = .id_result, .quantifier = .required },
7431 .{ .kind = .id_ref, .quantifier = .required },
7432 .{ .kind = .id_ref, .quantifier = .required },
7433 },
7434 },
7435 .{
7436 .name = "OpFUnordNotEqual",
7437 .opcode = 183,
7438 .operands = &.{
7439 .{ .kind = .id_result_type, .quantifier = .required },
7440 .{ .kind = .id_result, .quantifier = .required },
7441 .{ .kind = .id_ref, .quantifier = .required },
7442 .{ .kind = .id_ref, .quantifier = .required },
7443 },
7444 },
7445 .{
7446 .name = "OpFOrdLessThan",
7447 .opcode = 184,
7448 .operands = &.{
7449 .{ .kind = .id_result_type, .quantifier = .required },
7450 .{ .kind = .id_result, .quantifier = .required },
7451 .{ .kind = .id_ref, .quantifier = .required },
7452 .{ .kind = .id_ref, .quantifier = .required },
7453 },
7454 },
7455 .{
7456 .name = "OpFUnordLessThan",
7457 .opcode = 185,
7458 .operands = &.{
7459 .{ .kind = .id_result_type, .quantifier = .required },
7460 .{ .kind = .id_result, .quantifier = .required },
7461 .{ .kind = .id_ref, .quantifier = .required },
7462 .{ .kind = .id_ref, .quantifier = .required },
7463 },
7464 },
7465 .{
7466 .name = "OpFOrdGreaterThan",
7467 .opcode = 186,
7468 .operands = &.{
7469 .{ .kind = .id_result_type, .quantifier = .required },
7470 .{ .kind = .id_result, .quantifier = .required },
7471 .{ .kind = .id_ref, .quantifier = .required },
7472 .{ .kind = .id_ref, .quantifier = .required },
7473 },
7474 },
7475 .{
7476 .name = "OpFUnordGreaterThan",
7477 .opcode = 187,
7478 .operands = &.{
7479 .{ .kind = .id_result_type, .quantifier = .required },
7480 .{ .kind = .id_result, .quantifier = .required },
7481 .{ .kind = .id_ref, .quantifier = .required },
7482 .{ .kind = .id_ref, .quantifier = .required },
7483 },
7484 },
7485 .{
7486 .name = "OpFOrdLessThanEqual",
7487 .opcode = 188,
7488 .operands = &.{
7489 .{ .kind = .id_result_type, .quantifier = .required },
7490 .{ .kind = .id_result, .quantifier = .required },
7491 .{ .kind = .id_ref, .quantifier = .required },
7492 .{ .kind = .id_ref, .quantifier = .required },
7493 },
7494 },
7495 .{
7496 .name = "OpFUnordLessThanEqual",
7497 .opcode = 189,
7498 .operands = &.{
7499 .{ .kind = .id_result_type, .quantifier = .required },
7500 .{ .kind = .id_result, .quantifier = .required },
7501 .{ .kind = .id_ref, .quantifier = .required },
7502 .{ .kind = .id_ref, .quantifier = .required },
7503 },
7504 },
7505 .{
7506 .name = "OpFOrdGreaterThanEqual",
7507 .opcode = 190,
7508 .operands = &.{
7509 .{ .kind = .id_result_type, .quantifier = .required },
7510 .{ .kind = .id_result, .quantifier = .required },
7511 .{ .kind = .id_ref, .quantifier = .required },
7512 .{ .kind = .id_ref, .quantifier = .required },
7513 },
7514 },
7515 .{
7516 .name = "OpFUnordGreaterThanEqual",
7517 .opcode = 191,
7518 .operands = &.{
7519 .{ .kind = .id_result_type, .quantifier = .required },
7520 .{ .kind = .id_result, .quantifier = .required },
7521 .{ .kind = .id_ref, .quantifier = .required },
7522 .{ .kind = .id_ref, .quantifier = .required },
7523 },
7524 },
7525 .{
7526 .name = "OpShiftRightLogical",
7527 .opcode = 194,
7528 .operands = &.{
7529 .{ .kind = .id_result_type, .quantifier = .required },
7530 .{ .kind = .id_result, .quantifier = .required },
7531 .{ .kind = .id_ref, .quantifier = .required },
7532 .{ .kind = .id_ref, .quantifier = .required },
7533 },
7534 },
7535 .{
7536 .name = "OpShiftRightArithmetic",
7537 .opcode = 195,
7538 .operands = &.{
7539 .{ .kind = .id_result_type, .quantifier = .required },
7540 .{ .kind = .id_result, .quantifier = .required },
7541 .{ .kind = .id_ref, .quantifier = .required },
7542 .{ .kind = .id_ref, .quantifier = .required },
7543 },
7544 },
7545 .{
7546 .name = "OpShiftLeftLogical",
7547 .opcode = 196,
7548 .operands = &.{
7549 .{ .kind = .id_result_type, .quantifier = .required },
7550 .{ .kind = .id_result, .quantifier = .required },
7551 .{ .kind = .id_ref, .quantifier = .required },
7552 .{ .kind = .id_ref, .quantifier = .required },
7553 },
7554 },
7555 .{
7556 .name = "OpBitwiseOr",
7557 .opcode = 197,
7558 .operands = &.{
7559 .{ .kind = .id_result_type, .quantifier = .required },
7560 .{ .kind = .id_result, .quantifier = .required },
7561 .{ .kind = .id_ref, .quantifier = .required },
7562 .{ .kind = .id_ref, .quantifier = .required },
7563 },
7564 },
7565 .{
7566 .name = "OpBitwiseXor",
7567 .opcode = 198,
7568 .operands = &.{
7569 .{ .kind = .id_result_type, .quantifier = .required },
7570 .{ .kind = .id_result, .quantifier = .required },
7571 .{ .kind = .id_ref, .quantifier = .required },
7572 .{ .kind = .id_ref, .quantifier = .required },
7573 },
7574 },
7575 .{
7576 .name = "OpBitwiseAnd",
7577 .opcode = 199,
7578 .operands = &.{
7579 .{ .kind = .id_result_type, .quantifier = .required },
7580 .{ .kind = .id_result, .quantifier = .required },
7581 .{ .kind = .id_ref, .quantifier = .required },
7582 .{ .kind = .id_ref, .quantifier = .required },
7583 },
7584 },
7585 .{
7586 .name = "OpNot",
7587 .opcode = 200,
7588 .operands = &.{
7589 .{ .kind = .id_result_type, .quantifier = .required },
7590 .{ .kind = .id_result, .quantifier = .required },
7591 .{ .kind = .id_ref, .quantifier = .required },
7592 },
7593 },
7594 .{
7595 .name = "OpBitFieldInsert",
7596 .opcode = 201,
7597 .operands = &.{
7598 .{ .kind = .id_result_type, .quantifier = .required },
7599 .{ .kind = .id_result, .quantifier = .required },
7600 .{ .kind = .id_ref, .quantifier = .required },
7601 .{ .kind = .id_ref, .quantifier = .required },
7602 .{ .kind = .id_ref, .quantifier = .required },
7603 .{ .kind = .id_ref, .quantifier = .required },
7604 },
7605 },
7606 .{
7607 .name = "OpBitFieldSExtract",
7608 .opcode = 202,
7609 .operands = &.{
7610 .{ .kind = .id_result_type, .quantifier = .required },
7611 .{ .kind = .id_result, .quantifier = .required },
7612 .{ .kind = .id_ref, .quantifier = .required },
7613 .{ .kind = .id_ref, .quantifier = .required },
7614 .{ .kind = .id_ref, .quantifier = .required },
7615 },
7616 },
7617 .{
7618 .name = "OpBitFieldUExtract",
7619 .opcode = 203,
7620 .operands = &.{
7621 .{ .kind = .id_result_type, .quantifier = .required },
7622 .{ .kind = .id_result, .quantifier = .required },
7623 .{ .kind = .id_ref, .quantifier = .required },
7624 .{ .kind = .id_ref, .quantifier = .required },
7625 .{ .kind = .id_ref, .quantifier = .required },
7626 },
7627 },
7628 .{
7629 .name = "OpBitReverse",
7630 .opcode = 204,
7631 .operands = &.{
7632 .{ .kind = .id_result_type, .quantifier = .required },
7633 .{ .kind = .id_result, .quantifier = .required },
7634 .{ .kind = .id_ref, .quantifier = .required },
7635 },
7636 },
7637 .{
7638 .name = "OpBitCount",
7639 .opcode = 205,
7640 .operands = &.{
7641 .{ .kind = .id_result_type, .quantifier = .required },
7642 .{ .kind = .id_result, .quantifier = .required },
7643 .{ .kind = .id_ref, .quantifier = .required },
7644 },
7645 },
7646 .{
7647 .name = "OpDPdx",
7648 .opcode = 207,
7649 .operands = &.{
7650 .{ .kind = .id_result_type, .quantifier = .required },
7651 .{ .kind = .id_result, .quantifier = .required },
7652 .{ .kind = .id_ref, .quantifier = .required },
7653 },
7654 },
7655 .{
7656 .name = "OpDPdy",
7657 .opcode = 208,
7658 .operands = &.{
7659 .{ .kind = .id_result_type, .quantifier = .required },
7660 .{ .kind = .id_result, .quantifier = .required },
7661 .{ .kind = .id_ref, .quantifier = .required },
7662 },
7663 },
7664 .{
7665 .name = "OpFwidth",
7666 .opcode = 209,
7667 .operands = &.{
7668 .{ .kind = .id_result_type, .quantifier = .required },
7669 .{ .kind = .id_result, .quantifier = .required },
7670 .{ .kind = .id_ref, .quantifier = .required },
7671 },
7672 },
7673 .{
7674 .name = "OpDPdxFine",
7675 .opcode = 210,
7676 .operands = &.{
7677 .{ .kind = .id_result_type, .quantifier = .required },
7678 .{ .kind = .id_result, .quantifier = .required },
7679 .{ .kind = .id_ref, .quantifier = .required },
7680 },
7681 },
7682 .{
7683 .name = "OpDPdyFine",
7684 .opcode = 211,
7685 .operands = &.{
7686 .{ .kind = .id_result_type, .quantifier = .required },
7687 .{ .kind = .id_result, .quantifier = .required },
7688 .{ .kind = .id_ref, .quantifier = .required },
7689 },
7690 },
7691 .{
7692 .name = "OpFwidthFine",
7693 .opcode = 212,
7694 .operands = &.{
7695 .{ .kind = .id_result_type, .quantifier = .required },
7696 .{ .kind = .id_result, .quantifier = .required },
7697 .{ .kind = .id_ref, .quantifier = .required },
7698 },
7699 },
7700 .{
7701 .name = "OpDPdxCoarse",
7702 .opcode = 213,
7703 .operands = &.{
7704 .{ .kind = .id_result_type, .quantifier = .required },
7705 .{ .kind = .id_result, .quantifier = .required },
7706 .{ .kind = .id_ref, .quantifier = .required },
7707 },
7708 },
7709 .{
7710 .name = "OpDPdyCoarse",
7711 .opcode = 214,
7712 .operands = &.{
7713 .{ .kind = .id_result_type, .quantifier = .required },
7714 .{ .kind = .id_result, .quantifier = .required },
7715 .{ .kind = .id_ref, .quantifier = .required },
7716 },
7717 },
7718 .{
7719 .name = "OpFwidthCoarse",
7720 .opcode = 215,
7721 .operands = &.{
7722 .{ .kind = .id_result_type, .quantifier = .required },
7723 .{ .kind = .id_result, .quantifier = .required },
7724 .{ .kind = .id_ref, .quantifier = .required },
7725 },
7726 },
7727 .{
7728 .name = "OpEmitVertex",
7729 .opcode = 218,
7730 .operands = &.{},
7731 },
7732 .{
7733 .name = "OpEndPrimitive",
7734 .opcode = 219,
7735 .operands = &.{},
7736 },
7737 .{
7738 .name = "OpEmitStreamVertex",
7739 .opcode = 220,
7740 .operands = &.{
7741 .{ .kind = .id_ref, .quantifier = .required },
7742 },
7743 },
7744 .{
7745 .name = "OpEndStreamPrimitive",
7746 .opcode = 221,
7747 .operands = &.{
7748 .{ .kind = .id_ref, .quantifier = .required },
7749 },
7750 },
7751 .{
7752 .name = "OpControlBarrier",
7753 .opcode = 224,
7754 .operands = &.{
7755 .{ .kind = .id_scope, .quantifier = .required },
7756 .{ .kind = .id_scope, .quantifier = .required },
7757 .{ .kind = .id_memory_semantics, .quantifier = .required },
7758 },
7759 },
7760 .{
7761 .name = "OpMemoryBarrier",
7762 .opcode = 225,
7763 .operands = &.{
7764 .{ .kind = .id_scope, .quantifier = .required },
7765 .{ .kind = .id_memory_semantics, .quantifier = .required },
7766 },
7767 },
7768 .{
7769 .name = "OpAtomicLoad",
7770 .opcode = 227,
7771 .operands = &.{
7772 .{ .kind = .id_result_type, .quantifier = .required },
7773 .{ .kind = .id_result, .quantifier = .required },
7774 .{ .kind = .id_ref, .quantifier = .required },
7775 .{ .kind = .id_scope, .quantifier = .required },
7776 .{ .kind = .id_memory_semantics, .quantifier = .required },
7777 },
7778 },
7779 .{
7780 .name = "OpAtomicStore",
7781 .opcode = 228,
7782 .operands = &.{
7783 .{ .kind = .id_ref, .quantifier = .required },
7784 .{ .kind = .id_scope, .quantifier = .required },
7785 .{ .kind = .id_memory_semantics, .quantifier = .required },
7786 .{ .kind = .id_ref, .quantifier = .required },
7787 },
7788 },
7789 .{
7790 .name = "OpAtomicExchange",
7791 .opcode = 229,
7792 .operands = &.{
7793 .{ .kind = .id_result_type, .quantifier = .required },
7794 .{ .kind = .id_result, .quantifier = .required },
7795 .{ .kind = .id_ref, .quantifier = .required },
7796 .{ .kind = .id_scope, .quantifier = .required },
7797 .{ .kind = .id_memory_semantics, .quantifier = .required },
7798 .{ .kind = .id_ref, .quantifier = .required },
7799 },
7800 },
7801 .{
7802 .name = "OpAtomicCompareExchange",
7803 .opcode = 230,
7804 .operands = &.{
7805 .{ .kind = .id_result_type, .quantifier = .required },
7806 .{ .kind = .id_result, .quantifier = .required },
7807 .{ .kind = .id_ref, .quantifier = .required },
7808 .{ .kind = .id_scope, .quantifier = .required },
7809 .{ .kind = .id_memory_semantics, .quantifier = .required },
7810 .{ .kind = .id_memory_semantics, .quantifier = .required },
7811 .{ .kind = .id_ref, .quantifier = .required },
7812 .{ .kind = .id_ref, .quantifier = .required },
7813 },
7814 },
7815 .{
7816 .name = "OpAtomicCompareExchangeWeak",
7817 .opcode = 231,
7818 .operands = &.{
7819 .{ .kind = .id_result_type, .quantifier = .required },
7820 .{ .kind = .id_result, .quantifier = .required },
7821 .{ .kind = .id_ref, .quantifier = .required },
7822 .{ .kind = .id_scope, .quantifier = .required },
7823 .{ .kind = .id_memory_semantics, .quantifier = .required },
7824 .{ .kind = .id_memory_semantics, .quantifier = .required },
7825 .{ .kind = .id_ref, .quantifier = .required },
7826 .{ .kind = .id_ref, .quantifier = .required },
7827 },
7828 },
7829 .{
7830 .name = "OpAtomicIIncrement",
7831 .opcode = 232,
7832 .operands = &.{
7833 .{ .kind = .id_result_type, .quantifier = .required },
7834 .{ .kind = .id_result, .quantifier = .required },
7835 .{ .kind = .id_ref, .quantifier = .required },
7836 .{ .kind = .id_scope, .quantifier = .required },
7837 .{ .kind = .id_memory_semantics, .quantifier = .required },
7838 },
7839 },
7840 .{
7841 .name = "OpAtomicIDecrement",
7842 .opcode = 233,
7843 .operands = &.{
7844 .{ .kind = .id_result_type, .quantifier = .required },
7845 .{ .kind = .id_result, .quantifier = .required },
7846 .{ .kind = .id_ref, .quantifier = .required },
7847 .{ .kind = .id_scope, .quantifier = .required },
7848 .{ .kind = .id_memory_semantics, .quantifier = .required },
7849 },
7850 },
7851 .{
7852 .name = "OpAtomicIAdd",
7853 .opcode = 234,
7854 .operands = &.{
7855 .{ .kind = .id_result_type, .quantifier = .required },
7856 .{ .kind = .id_result, .quantifier = .required },
7857 .{ .kind = .id_ref, .quantifier = .required },
7858 .{ .kind = .id_scope, .quantifier = .required },
7859 .{ .kind = .id_memory_semantics, .quantifier = .required },
7860 .{ .kind = .id_ref, .quantifier = .required },
7861 },
7862 },
7863 .{
7864 .name = "OpAtomicISub",
7865 .opcode = 235,
7866 .operands = &.{
7867 .{ .kind = .id_result_type, .quantifier = .required },
7868 .{ .kind = .id_result, .quantifier = .required },
7869 .{ .kind = .id_ref, .quantifier = .required },
7870 .{ .kind = .id_scope, .quantifier = .required },
7871 .{ .kind = .id_memory_semantics, .quantifier = .required },
7872 .{ .kind = .id_ref, .quantifier = .required },
7873 },
7874 },
7875 .{
7876 .name = "OpAtomicSMin",
7877 .opcode = 236,
7878 .operands = &.{
7879 .{ .kind = .id_result_type, .quantifier = .required },
7880 .{ .kind = .id_result, .quantifier = .required },
7881 .{ .kind = .id_ref, .quantifier = .required },
7882 .{ .kind = .id_scope, .quantifier = .required },
7883 .{ .kind = .id_memory_semantics, .quantifier = .required },
7884 .{ .kind = .id_ref, .quantifier = .required },
7885 },
7886 },
7887 .{
7888 .name = "OpAtomicUMin",
7889 .opcode = 237,
7890 .operands = &.{
7891 .{ .kind = .id_result_type, .quantifier = .required },
7892 .{ .kind = .id_result, .quantifier = .required },
7893 .{ .kind = .id_ref, .quantifier = .required },
7894 .{ .kind = .id_scope, .quantifier = .required },
7895 .{ .kind = .id_memory_semantics, .quantifier = .required },
7896 .{ .kind = .id_ref, .quantifier = .required },
7897 },
7898 },
7899 .{
7900 .name = "OpAtomicSMax",
7901 .opcode = 238,
7902 .operands = &.{
7903 .{ .kind = .id_result_type, .quantifier = .required },
7904 .{ .kind = .id_result, .quantifier = .required },
7905 .{ .kind = .id_ref, .quantifier = .required },
7906 .{ .kind = .id_scope, .quantifier = .required },
7907 .{ .kind = .id_memory_semantics, .quantifier = .required },
7908 .{ .kind = .id_ref, .quantifier = .required },
7909 },
7910 },
7911 .{
7912 .name = "OpAtomicUMax",
7913 .opcode = 239,
7914 .operands = &.{
7915 .{ .kind = .id_result_type, .quantifier = .required },
7916 .{ .kind = .id_result, .quantifier = .required },
7917 .{ .kind = .id_ref, .quantifier = .required },
7918 .{ .kind = .id_scope, .quantifier = .required },
7919 .{ .kind = .id_memory_semantics, .quantifier = .required },
7920 .{ .kind = .id_ref, .quantifier = .required },
7921 },
7922 },
7923 .{
7924 .name = "OpAtomicAnd",
7925 .opcode = 240,
7926 .operands = &.{
7927 .{ .kind = .id_result_type, .quantifier = .required },
7928 .{ .kind = .id_result, .quantifier = .required },
7929 .{ .kind = .id_ref, .quantifier = .required },
7930 .{ .kind = .id_scope, .quantifier = .required },
7931 .{ .kind = .id_memory_semantics, .quantifier = .required },
7932 .{ .kind = .id_ref, .quantifier = .required },
7933 },
7934 },
7935 .{
7936 .name = "OpAtomicOr",
7937 .opcode = 241,
7938 .operands = &.{
7939 .{ .kind = .id_result_type, .quantifier = .required },
7940 .{ .kind = .id_result, .quantifier = .required },
7941 .{ .kind = .id_ref, .quantifier = .required },
7942 .{ .kind = .id_scope, .quantifier = .required },
7943 .{ .kind = .id_memory_semantics, .quantifier = .required },
7944 .{ .kind = .id_ref, .quantifier = .required },
7945 },
7946 },
7947 .{
7948 .name = "OpAtomicXor",
7949 .opcode = 242,
7950 .operands = &.{
7951 .{ .kind = .id_result_type, .quantifier = .required },
7952 .{ .kind = .id_result, .quantifier = .required },
7953 .{ .kind = .id_ref, .quantifier = .required },
7954 .{ .kind = .id_scope, .quantifier = .required },
7955 .{ .kind = .id_memory_semantics, .quantifier = .required },
7956 .{ .kind = .id_ref, .quantifier = .required },
7957 },
7958 },
7959 .{
7960 .name = "OpPhi",
7961 .opcode = 245,
7962 .operands = &.{
7963 .{ .kind = .id_result_type, .quantifier = .required },
7964 .{ .kind = .id_result, .quantifier = .required },
7965 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
7966 },
7967 },
7968 .{
7969 .name = "OpLoopMerge",
7970 .opcode = 246,
7971 .operands = &.{
7972 .{ .kind = .id_ref, .quantifier = .required },
7973 .{ .kind = .id_ref, .quantifier = .required },
7974 .{ .kind = .loop_control, .quantifier = .required },
7975 },
7976 },
7977 .{
7978 .name = "OpSelectionMerge",
7979 .opcode = 247,
7980 .operands = &.{
7981 .{ .kind = .id_ref, .quantifier = .required },
7982 .{ .kind = .selection_control, .quantifier = .required },
7983 },
7984 },
7985 .{
7986 .name = "OpLabel",
7987 .opcode = 248,
7988 .operands = &.{
7989 .{ .kind = .id_result, .quantifier = .required },
7990 },
7991 },
7992 .{
7993 .name = "OpBranch",
7994 .opcode = 249,
7995 .operands = &.{
7996 .{ .kind = .id_ref, .quantifier = .required },
7997 },
7998 },
7999 .{
8000 .name = "OpBranchConditional",
8001 .opcode = 250,
8002 .operands = &.{
8003 .{ .kind = .id_ref, .quantifier = .required },
8004 .{ .kind = .id_ref, .quantifier = .required },
8005 .{ .kind = .id_ref, .quantifier = .required },
8006 .{ .kind = .literal_integer, .quantifier = .variadic },
8007 },
8008 },
8009 .{
8010 .name = "OpSwitch",
8011 .opcode = 251,
8012 .operands = &.{
8013 .{ .kind = .id_ref, .quantifier = .required },
8014 .{ .kind = .id_ref, .quantifier = .required },
8015 .{ .kind = .pair_literal_integer_id_ref, .quantifier = .variadic },
8016 },
8017 },
8018 .{
8019 .name = "OpKill",
8020 .opcode = 252,
8021 .operands = &.{},
8022 },
8023 .{
8024 .name = "OpReturn",
8025 .opcode = 253,
8026 .operands = &.{},
8027 },
8028 .{
8029 .name = "OpReturnValue",
8030 .opcode = 254,
8031 .operands = &.{
8032 .{ .kind = .id_ref, .quantifier = .required },
8033 },
8034 },
8035 .{
8036 .name = "OpUnreachable",
8037 .opcode = 255,
8038 .operands = &.{},
8039 },
8040 .{
8041 .name = "OpLifetimeStart",
8042 .opcode = 256,
8043 .operands = &.{
8044 .{ .kind = .id_ref, .quantifier = .required },
8045 .{ .kind = .literal_integer, .quantifier = .required },
8046 },
8047 },
8048 .{
8049 .name = "OpLifetimeStop",
8050 .opcode = 257,
8051 .operands = &.{
8052 .{ .kind = .id_ref, .quantifier = .required },
8053 .{ .kind = .literal_integer, .quantifier = .required },
8054 },
8055 },
8056 .{
8057 .name = "OpGroupAsyncCopy",
8058 .opcode = 259,
8059 .operands = &.{
8060 .{ .kind = .id_result_type, .quantifier = .required },
8061 .{ .kind = .id_result, .quantifier = .required },
8062 .{ .kind = .id_scope, .quantifier = .required },
8063 .{ .kind = .id_ref, .quantifier = .required },
8064 .{ .kind = .id_ref, .quantifier = .required },
8065 .{ .kind = .id_ref, .quantifier = .required },
8066 .{ .kind = .id_ref, .quantifier = .required },
8067 .{ .kind = .id_ref, .quantifier = .required },
8068 },
8069 },
8070 .{
8071 .name = "OpGroupWaitEvents",
8072 .opcode = 260,
8073 .operands = &.{
8074 .{ .kind = .id_scope, .quantifier = .required },
8075 .{ .kind = .id_ref, .quantifier = .required },
8076 .{ .kind = .id_ref, .quantifier = .required },
8077 },
8078 },
8079 .{
8080 .name = "OpGroupAll",
8081 .opcode = 261,
8082 .operands = &.{
8083 .{ .kind = .id_result_type, .quantifier = .required },
8084 .{ .kind = .id_result, .quantifier = .required },
8085 .{ .kind = .id_scope, .quantifier = .required },
8086 .{ .kind = .id_ref, .quantifier = .required },
8087 },
8088 },
8089 .{
8090 .name = "OpGroupAny",
8091 .opcode = 262,
8092 .operands = &.{
8093 .{ .kind = .id_result_type, .quantifier = .required },
8094 .{ .kind = .id_result, .quantifier = .required },
8095 .{ .kind = .id_scope, .quantifier = .required },
8096 .{ .kind = .id_ref, .quantifier = .required },
8097 },
8098 },
8099 .{
8100 .name = "OpGroupBroadcast",
8101 .opcode = 263,
8102 .operands = &.{
8103 .{ .kind = .id_result_type, .quantifier = .required },
8104 .{ .kind = .id_result, .quantifier = .required },
8105 .{ .kind = .id_scope, .quantifier = .required },
8106 .{ .kind = .id_ref, .quantifier = .required },
8107 .{ .kind = .id_ref, .quantifier = .required },
8108 },
8109 },
8110 .{
8111 .name = "OpGroupIAdd",
8112 .opcode = 264,
8113 .operands = &.{
8114 .{ .kind = .id_result_type, .quantifier = .required },
8115 .{ .kind = .id_result, .quantifier = .required },
8116 .{ .kind = .id_scope, .quantifier = .required },
8117 .{ .kind = .group_operation, .quantifier = .required },
8118 .{ .kind = .id_ref, .quantifier = .required },
8119 },
8120 },
8121 .{
8122 .name = "OpGroupFAdd",
8123 .opcode = 265,
8124 .operands = &.{
8125 .{ .kind = .id_result_type, .quantifier = .required },
8126 .{ .kind = .id_result, .quantifier = .required },
8127 .{ .kind = .id_scope, .quantifier = .required },
8128 .{ .kind = .group_operation, .quantifier = .required },
8129 .{ .kind = .id_ref, .quantifier = .required },
8130 },
8131 },
8132 .{
8133 .name = "OpGroupFMin",
8134 .opcode = 266,
8135 .operands = &.{
8136 .{ .kind = .id_result_type, .quantifier = .required },
8137 .{ .kind = .id_result, .quantifier = .required },
8138 .{ .kind = .id_scope, .quantifier = .required },
8139 .{ .kind = .group_operation, .quantifier = .required },
8140 .{ .kind = .id_ref, .quantifier = .required },
8141 },
8142 },
8143 .{
8144 .name = "OpGroupUMin",
8145 .opcode = 267,
8146 .operands = &.{
8147 .{ .kind = .id_result_type, .quantifier = .required },
8148 .{ .kind = .id_result, .quantifier = .required },
8149 .{ .kind = .id_scope, .quantifier = .required },
8150 .{ .kind = .group_operation, .quantifier = .required },
8151 .{ .kind = .id_ref, .quantifier = .required },
8152 },
8153 },
8154 .{
8155 .name = "OpGroupSMin",
8156 .opcode = 268,
8157 .operands = &.{
8158 .{ .kind = .id_result_type, .quantifier = .required },
8159 .{ .kind = .id_result, .quantifier = .required },
8160 .{ .kind = .id_scope, .quantifier = .required },
8161 .{ .kind = .group_operation, .quantifier = .required },
8162 .{ .kind = .id_ref, .quantifier = .required },
8163 },
8164 },
8165 .{
8166 .name = "OpGroupFMax",
8167 .opcode = 269,
8168 .operands = &.{
8169 .{ .kind = .id_result_type, .quantifier = .required },
8170 .{ .kind = .id_result, .quantifier = .required },
8171 .{ .kind = .id_scope, .quantifier = .required },
8172 .{ .kind = .group_operation, .quantifier = .required },
8173 .{ .kind = .id_ref, .quantifier = .required },
8174 },
8175 },
8176 .{
8177 .name = "OpGroupUMax",
8178 .opcode = 270,
8179 .operands = &.{
8180 .{ .kind = .id_result_type, .quantifier = .required },
8181 .{ .kind = .id_result, .quantifier = .required },
8182 .{ .kind = .id_scope, .quantifier = .required },
8183 .{ .kind = .group_operation, .quantifier = .required },
8184 .{ .kind = .id_ref, .quantifier = .required },
8185 },
8186 },
8187 .{
8188 .name = "OpGroupSMax",
8189 .opcode = 271,
8190 .operands = &.{
8191 .{ .kind = .id_result_type, .quantifier = .required },
8192 .{ .kind = .id_result, .quantifier = .required },
8193 .{ .kind = .id_scope, .quantifier = .required },
8194 .{ .kind = .group_operation, .quantifier = .required },
8195 .{ .kind = .id_ref, .quantifier = .required },
8196 },
8197 },
8198 .{
8199 .name = "OpReadPipe",
8200 .opcode = 274,
8201 .operands = &.{
8202 .{ .kind = .id_result_type, .quantifier = .required },
8203 .{ .kind = .id_result, .quantifier = .required },
8204 .{ .kind = .id_ref, .quantifier = .required },
8205 .{ .kind = .id_ref, .quantifier = .required },
8206 .{ .kind = .id_ref, .quantifier = .required },
8207 .{ .kind = .id_ref, .quantifier = .required },
8208 },
8209 },
8210 .{
8211 .name = "OpWritePipe",
8212 .opcode = 275,
8213 .operands = &.{
8214 .{ .kind = .id_result_type, .quantifier = .required },
8215 .{ .kind = .id_result, .quantifier = .required },
8216 .{ .kind = .id_ref, .quantifier = .required },
8217 .{ .kind = .id_ref, .quantifier = .required },
8218 .{ .kind = .id_ref, .quantifier = .required },
8219 .{ .kind = .id_ref, .quantifier = .required },
8220 },
8221 },
8222 .{
8223 .name = "OpReservedReadPipe",
8224 .opcode = 276,
8225 .operands = &.{
8226 .{ .kind = .id_result_type, .quantifier = .required },
8227 .{ .kind = .id_result, .quantifier = .required },
8228 .{ .kind = .id_ref, .quantifier = .required },
8229 .{ .kind = .id_ref, .quantifier = .required },
8230 .{ .kind = .id_ref, .quantifier = .required },
8231 .{ .kind = .id_ref, .quantifier = .required },
8232 .{ .kind = .id_ref, .quantifier = .required },
8233 .{ .kind = .id_ref, .quantifier = .required },
8234 },
8235 },
8236 .{
8237 .name = "OpReservedWritePipe",
8238 .opcode = 277,
8239 .operands = &.{
8240 .{ .kind = .id_result_type, .quantifier = .required },
8241 .{ .kind = .id_result, .quantifier = .required },
8242 .{ .kind = .id_ref, .quantifier = .required },
8243 .{ .kind = .id_ref, .quantifier = .required },
8244 .{ .kind = .id_ref, .quantifier = .required },
8245 .{ .kind = .id_ref, .quantifier = .required },
8246 .{ .kind = .id_ref, .quantifier = .required },
8247 .{ .kind = .id_ref, .quantifier = .required },
8248 },
8249 },
8250 .{
8251 .name = "OpReserveReadPipePackets",
8252 .opcode = 278,
8253 .operands = &.{
8254 .{ .kind = .id_result_type, .quantifier = .required },
8255 .{ .kind = .id_result, .quantifier = .required },
8256 .{ .kind = .id_ref, .quantifier = .required },
8257 .{ .kind = .id_ref, .quantifier = .required },
8258 .{ .kind = .id_ref, .quantifier = .required },
8259 .{ .kind = .id_ref, .quantifier = .required },
8260 },
8261 },
8262 .{
8263 .name = "OpReserveWritePipePackets",
8264 .opcode = 279,
8265 .operands = &.{
8266 .{ .kind = .id_result_type, .quantifier = .required },
8267 .{ .kind = .id_result, .quantifier = .required },
8268 .{ .kind = .id_ref, .quantifier = .required },
8269 .{ .kind = .id_ref, .quantifier = .required },
8270 .{ .kind = .id_ref, .quantifier = .required },
8271 .{ .kind = .id_ref, .quantifier = .required },
8272 },
8273 },
8274 .{
8275 .name = "OpCommitReadPipe",
8276 .opcode = 280,
8277 .operands = &.{
8278 .{ .kind = .id_ref, .quantifier = .required },
8279 .{ .kind = .id_ref, .quantifier = .required },
8280 .{ .kind = .id_ref, .quantifier = .required },
8281 .{ .kind = .id_ref, .quantifier = .required },
8282 },
8283 },
8284 .{
8285 .name = "OpCommitWritePipe",
8286 .opcode = 281,
8287 .operands = &.{
8288 .{ .kind = .id_ref, .quantifier = .required },
8289 .{ .kind = .id_ref, .quantifier = .required },
8290 .{ .kind = .id_ref, .quantifier = .required },
8291 .{ .kind = .id_ref, .quantifier = .required },
8292 },
8293 },
8294 .{
8295 .name = "OpIsValidReserveId",
8296 .opcode = 282,
8297 .operands = &.{
8298 .{ .kind = .id_result_type, .quantifier = .required },
8299 .{ .kind = .id_result, .quantifier = .required },
8300 .{ .kind = .id_ref, .quantifier = .required },
8301 },
8302 },
8303 .{
8304 .name = "OpGetNumPipePackets",
8305 .opcode = 283,
8306 .operands = &.{
8307 .{ .kind = .id_result_type, .quantifier = .required },
8308 .{ .kind = .id_result, .quantifier = .required },
8309 .{ .kind = .id_ref, .quantifier = .required },
8310 .{ .kind = .id_ref, .quantifier = .required },
8311 .{ .kind = .id_ref, .quantifier = .required },
8312 },
8313 },
8314 .{
8315 .name = "OpGetMaxPipePackets",
8316 .opcode = 284,
8317 .operands = &.{
8318 .{ .kind = .id_result_type, .quantifier = .required },
8319 .{ .kind = .id_result, .quantifier = .required },
8320 .{ .kind = .id_ref, .quantifier = .required },
8321 .{ .kind = .id_ref, .quantifier = .required },
8322 .{ .kind = .id_ref, .quantifier = .required },
8323 },
8324 },
8325 .{
8326 .name = "OpGroupReserveReadPipePackets",
8327 .opcode = 285,
8328 .operands = &.{
8329 .{ .kind = .id_result_type, .quantifier = .required },
8330 .{ .kind = .id_result, .quantifier = .required },
8331 .{ .kind = .id_scope, .quantifier = .required },
8332 .{ .kind = .id_ref, .quantifier = .required },
8333 .{ .kind = .id_ref, .quantifier = .required },
8334 .{ .kind = .id_ref, .quantifier = .required },
8335 .{ .kind = .id_ref, .quantifier = .required },
8336 },
8337 },
8338 .{
8339 .name = "OpGroupReserveWritePipePackets",
8340 .opcode = 286,
8341 .operands = &.{
8342 .{ .kind = .id_result_type, .quantifier = .required },
8343 .{ .kind = .id_result, .quantifier = .required },
8344 .{ .kind = .id_scope, .quantifier = .required },
8345 .{ .kind = .id_ref, .quantifier = .required },
8346 .{ .kind = .id_ref, .quantifier = .required },
8347 .{ .kind = .id_ref, .quantifier = .required },
8348 .{ .kind = .id_ref, .quantifier = .required },
8349 },
8350 },
8351 .{
8352 .name = "OpGroupCommitReadPipe",
8353 .opcode = 287,
8354 .operands = &.{
8355 .{ .kind = .id_scope, .quantifier = .required },
8356 .{ .kind = .id_ref, .quantifier = .required },
8357 .{ .kind = .id_ref, .quantifier = .required },
8358 .{ .kind = .id_ref, .quantifier = .required },
8359 .{ .kind = .id_ref, .quantifier = .required },
8360 },
8361 },
8362 .{
8363 .name = "OpGroupCommitWritePipe",
8364 .opcode = 288,
8365 .operands = &.{
8366 .{ .kind = .id_scope, .quantifier = .required },
8367 .{ .kind = .id_ref, .quantifier = .required },
8368 .{ .kind = .id_ref, .quantifier = .required },
8369 .{ .kind = .id_ref, .quantifier = .required },
8370 .{ .kind = .id_ref, .quantifier = .required },
8371 },
8372 },
8373 .{
8374 .name = "OpEnqueueMarker",
8375 .opcode = 291,
8376 .operands = &.{
8377 .{ .kind = .id_result_type, .quantifier = .required },
8378 .{ .kind = .id_result, .quantifier = .required },
8379 .{ .kind = .id_ref, .quantifier = .required },
8380 .{ .kind = .id_ref, .quantifier = .required },
8381 .{ .kind = .id_ref, .quantifier = .required },
8382 .{ .kind = .id_ref, .quantifier = .required },
8383 },
8384 },
8385 .{
8386 .name = "OpEnqueueKernel",
8387 .opcode = 292,
8388 .operands = &.{
8389 .{ .kind = .id_result_type, .quantifier = .required },
8390 .{ .kind = .id_result, .quantifier = .required },
8391 .{ .kind = .id_ref, .quantifier = .required },
8392 .{ .kind = .id_ref, .quantifier = .required },
8393 .{ .kind = .id_ref, .quantifier = .required },
8394 .{ .kind = .id_ref, .quantifier = .required },
8395 .{ .kind = .id_ref, .quantifier = .required },
8396 .{ .kind = .id_ref, .quantifier = .required },
8397 .{ .kind = .id_ref, .quantifier = .required },
8398 .{ .kind = .id_ref, .quantifier = .required },
8399 .{ .kind = .id_ref, .quantifier = .required },
8400 .{ .kind = .id_ref, .quantifier = .required },
8401 .{ .kind = .id_ref, .quantifier = .variadic },
8402 },
8403 },
8404 .{
8405 .name = "OpGetKernelNDrangeSubGroupCount",
8406 .opcode = 293,
8407 .operands = &.{
8408 .{ .kind = .id_result_type, .quantifier = .required },
8409 .{ .kind = .id_result, .quantifier = .required },
8410 .{ .kind = .id_ref, .quantifier = .required },
8411 .{ .kind = .id_ref, .quantifier = .required },
8412 .{ .kind = .id_ref, .quantifier = .required },
8413 .{ .kind = .id_ref, .quantifier = .required },
8414 .{ .kind = .id_ref, .quantifier = .required },
8415 },
8416 },
8417 .{
8418 .name = "OpGetKernelNDrangeMaxSubGroupSize",
8419 .opcode = 294,
8420 .operands = &.{
8421 .{ .kind = .id_result_type, .quantifier = .required },
8422 .{ .kind = .id_result, .quantifier = .required },
8423 .{ .kind = .id_ref, .quantifier = .required },
8424 .{ .kind = .id_ref, .quantifier = .required },
8425 .{ .kind = .id_ref, .quantifier = .required },
8426 .{ .kind = .id_ref, .quantifier = .required },
8427 .{ .kind = .id_ref, .quantifier = .required },
8428 },
8429 },
8430 .{
8431 .name = "OpGetKernelWorkGroupSize",
8432 .opcode = 295,
8433 .operands = &.{
8434 .{ .kind = .id_result_type, .quantifier = .required },
8435 .{ .kind = .id_result, .quantifier = .required },
8436 .{ .kind = .id_ref, .quantifier = .required },
8437 .{ .kind = .id_ref, .quantifier = .required },
8438 .{ .kind = .id_ref, .quantifier = .required },
8439 .{ .kind = .id_ref, .quantifier = .required },
8440 },
8441 },
8442 .{
8443 .name = "OpGetKernelPreferredWorkGroupSizeMultiple",
8444 .opcode = 296,
8445 .operands = &.{
8446 .{ .kind = .id_result_type, .quantifier = .required },
8447 .{ .kind = .id_result, .quantifier = .required },
8448 .{ .kind = .id_ref, .quantifier = .required },
8449 .{ .kind = .id_ref, .quantifier = .required },
8450 .{ .kind = .id_ref, .quantifier = .required },
8451 .{ .kind = .id_ref, .quantifier = .required },
8452 },
8453 },
8454 .{
8455 .name = "OpRetainEvent",
8456 .opcode = 297,
8457 .operands = &.{
8458 .{ .kind = .id_ref, .quantifier = .required },
8459 },
8460 },
8461 .{
8462 .name = "OpReleaseEvent",
8463 .opcode = 298,
8464 .operands = &.{
8465 .{ .kind = .id_ref, .quantifier = .required },
8466 },
8467 },
8468 .{
8469 .name = "OpCreateUserEvent",
8470 .opcode = 299,
8471 .operands = &.{
8472 .{ .kind = .id_result_type, .quantifier = .required },
8473 .{ .kind = .id_result, .quantifier = .required },
8474 },
8475 },
8476 .{
8477 .name = "OpIsValidEvent",
8478 .opcode = 300,
8479 .operands = &.{
8480 .{ .kind = .id_result_type, .quantifier = .required },
8481 .{ .kind = .id_result, .quantifier = .required },
8482 .{ .kind = .id_ref, .quantifier = .required },
8483 },
8484 },
8485 .{
8486 .name = "OpSetUserEventStatus",
8487 .opcode = 301,
8488 .operands = &.{
8489 .{ .kind = .id_ref, .quantifier = .required },
8490 .{ .kind = .id_ref, .quantifier = .required },
8491 },
8492 },
8493 .{
8494 .name = "OpCaptureEventProfilingInfo",
8495 .opcode = 302,
8496 .operands = &.{
8497 .{ .kind = .id_ref, .quantifier = .required },
8498 .{ .kind = .id_ref, .quantifier = .required },
8499 .{ .kind = .id_ref, .quantifier = .required },
8500 },
8501 },
8502 .{
8503 .name = "OpGetDefaultQueue",
8504 .opcode = 303,
8505 .operands = &.{
8506 .{ .kind = .id_result_type, .quantifier = .required },
8507 .{ .kind = .id_result, .quantifier = .required },
8508 },
8509 },
8510 .{
8511 .name = "OpBuildNDRange",
8512 .opcode = 304,
8513 .operands = &.{
8514 .{ .kind = .id_result_type, .quantifier = .required },
8515 .{ .kind = .id_result, .quantifier = .required },
8516 .{ .kind = .id_ref, .quantifier = .required },
8517 .{ .kind = .id_ref, .quantifier = .required },
8518 .{ .kind = .id_ref, .quantifier = .required },
8519 },
8520 },
8521 .{
8522 .name = "OpImageSparseSampleImplicitLod",
8523 .opcode = 305,
8524 .operands = &.{
8525 .{ .kind = .id_result_type, .quantifier = .required },
8526 .{ .kind = .id_result, .quantifier = .required },
8527 .{ .kind = .id_ref, .quantifier = .required },
8528 .{ .kind = .id_ref, .quantifier = .required },
8529 .{ .kind = .image_operands, .quantifier = .optional },
8530 },
8531 },
8532 .{
8533 .name = "OpImageSparseSampleExplicitLod",
8534 .opcode = 306,
8535 .operands = &.{
8536 .{ .kind = .id_result_type, .quantifier = .required },
8537 .{ .kind = .id_result, .quantifier = .required },
8538 .{ .kind = .id_ref, .quantifier = .required },
8539 .{ .kind = .id_ref, .quantifier = .required },
8540 .{ .kind = .image_operands, .quantifier = .required },
8541 },
8542 },
8543 .{
8544 .name = "OpImageSparseSampleDrefImplicitLod",
8545 .opcode = 307,
8546 .operands = &.{
8547 .{ .kind = .id_result_type, .quantifier = .required },
8548 .{ .kind = .id_result, .quantifier = .required },
8549 .{ .kind = .id_ref, .quantifier = .required },
8550 .{ .kind = .id_ref, .quantifier = .required },
8551 .{ .kind = .id_ref, .quantifier = .required },
8552 .{ .kind = .image_operands, .quantifier = .optional },
8553 },
8554 },
8555 .{
8556 .name = "OpImageSparseSampleDrefExplicitLod",
8557 .opcode = 308,
8558 .operands = &.{
8559 .{ .kind = .id_result_type, .quantifier = .required },
8560 .{ .kind = .id_result, .quantifier = .required },
8561 .{ .kind = .id_ref, .quantifier = .required },
8562 .{ .kind = .id_ref, .quantifier = .required },
8563 .{ .kind = .id_ref, .quantifier = .required },
8564 .{ .kind = .image_operands, .quantifier = .required },
8565 },
8566 },
8567 .{
8568 .name = "OpImageSparseSampleProjImplicitLod",
8569 .opcode = 309,
8570 .operands = &.{
8571 .{ .kind = .id_result_type, .quantifier = .required },
8572 .{ .kind = .id_result, .quantifier = .required },
8573 .{ .kind = .id_ref, .quantifier = .required },
8574 .{ .kind = .id_ref, .quantifier = .required },
8575 .{ .kind = .image_operands, .quantifier = .optional },
8576 },
8577 },
8578 .{
8579 .name = "OpImageSparseSampleProjExplicitLod",
8580 .opcode = 310,
8581 .operands = &.{
8582 .{ .kind = .id_result_type, .quantifier = .required },
8583 .{ .kind = .id_result, .quantifier = .required },
8584 .{ .kind = .id_ref, .quantifier = .required },
8585 .{ .kind = .id_ref, .quantifier = .required },
8586 .{ .kind = .image_operands, .quantifier = .required },
8587 },
8588 },
8589 .{
8590 .name = "OpImageSparseSampleProjDrefImplicitLod",
8591 .opcode = 311,
8592 .operands = &.{
8593 .{ .kind = .id_result_type, .quantifier = .required },
8594 .{ .kind = .id_result, .quantifier = .required },
8595 .{ .kind = .id_ref, .quantifier = .required },
8596 .{ .kind = .id_ref, .quantifier = .required },
8597 .{ .kind = .id_ref, .quantifier = .required },
8598 .{ .kind = .image_operands, .quantifier = .optional },
8599 },
8600 },
8601 .{
8602 .name = "OpImageSparseSampleProjDrefExplicitLod",
8603 .opcode = 312,
8604 .operands = &.{
8605 .{ .kind = .id_result_type, .quantifier = .required },
8606 .{ .kind = .id_result, .quantifier = .required },
8607 .{ .kind = .id_ref, .quantifier = .required },
8608 .{ .kind = .id_ref, .quantifier = .required },
8609 .{ .kind = .id_ref, .quantifier = .required },
8610 .{ .kind = .image_operands, .quantifier = .required },
8611 },
8612 },
8613 .{
8614 .name = "OpImageSparseFetch",
8615 .opcode = 313,
8616 .operands = &.{
8617 .{ .kind = .id_result_type, .quantifier = .required },
8618 .{ .kind = .id_result, .quantifier = .required },
8619 .{ .kind = .id_ref, .quantifier = .required },
8620 .{ .kind = .id_ref, .quantifier = .required },
8621 .{ .kind = .image_operands, .quantifier = .optional },
8622 },
8623 },
8624 .{
8625 .name = "OpImageSparseGather",
8626 .opcode = 314,
8627 .operands = &.{
8628 .{ .kind = .id_result_type, .quantifier = .required },
8629 .{ .kind = .id_result, .quantifier = .required },
8630 .{ .kind = .id_ref, .quantifier = .required },
8631 .{ .kind = .id_ref, .quantifier = .required },
8632 .{ .kind = .id_ref, .quantifier = .required },
8633 .{ .kind = .image_operands, .quantifier = .optional },
8634 },
8635 },
8636 .{
8637 .name = "OpImageSparseDrefGather",
8638 .opcode = 315,
8639 .operands = &.{
8640 .{ .kind = .id_result_type, .quantifier = .required },
8641 .{ .kind = .id_result, .quantifier = .required },
8642 .{ .kind = .id_ref, .quantifier = .required },
8643 .{ .kind = .id_ref, .quantifier = .required },
8644 .{ .kind = .id_ref, .quantifier = .required },
8645 .{ .kind = .image_operands, .quantifier = .optional },
8646 },
8647 },
8648 .{
8649 .name = "OpImageSparseTexelsResident",
8650 .opcode = 316,
8651 .operands = &.{
8652 .{ .kind = .id_result_type, .quantifier = .required },
8653 .{ .kind = .id_result, .quantifier = .required },
8654 .{ .kind = .id_ref, .quantifier = .required },
8655 },
8656 },
8657 .{
8658 .name = "OpNoLine",
8659 .opcode = 317,
8660 .operands = &.{},
8661 },
8662 .{
8663 .name = "OpAtomicFlagTestAndSet",
8664 .opcode = 318,
8665 .operands = &.{
8666 .{ .kind = .id_result_type, .quantifier = .required },
8667 .{ .kind = .id_result, .quantifier = .required },
8668 .{ .kind = .id_ref, .quantifier = .required },
8669 .{ .kind = .id_scope, .quantifier = .required },
8670 .{ .kind = .id_memory_semantics, .quantifier = .required },
8671 },
8672 },
8673 .{
8674 .name = "OpAtomicFlagClear",
8675 .opcode = 319,
8676 .operands = &.{
8677 .{ .kind = .id_ref, .quantifier = .required },
8678 .{ .kind = .id_scope, .quantifier = .required },
8679 .{ .kind = .id_memory_semantics, .quantifier = .required },
8680 },
8681 },
8682 .{
8683 .name = "OpImageSparseRead",
8684 .opcode = 320,
8685 .operands = &.{
8686 .{ .kind = .id_result_type, .quantifier = .required },
8687 .{ .kind = .id_result, .quantifier = .required },
8688 .{ .kind = .id_ref, .quantifier = .required },
8689 .{ .kind = .id_ref, .quantifier = .required },
8690 .{ .kind = .image_operands, .quantifier = .optional },
8691 },
8692 },
8693 .{
8694 .name = "OpSizeOf",
8695 .opcode = 321,
8696 .operands = &.{
8697 .{ .kind = .id_result_type, .quantifier = .required },
8698 .{ .kind = .id_result, .quantifier = .required },
8699 .{ .kind = .id_ref, .quantifier = .required },
8700 },
8701 },
8702 .{
8703 .name = "OpTypePipeStorage",
8704 .opcode = 322,
8705 .operands = &.{
8706 .{ .kind = .id_result, .quantifier = .required },
8707 },
8708 },
8709 .{
8710 .name = "OpConstantPipeStorage",
8711 .opcode = 323,
8712 .operands = &.{
8713 .{ .kind = .id_result_type, .quantifier = .required },
8714 .{ .kind = .id_result, .quantifier = .required },
8715 .{ .kind = .literal_integer, .quantifier = .required },
8716 .{ .kind = .literal_integer, .quantifier = .required },
8717 .{ .kind = .literal_integer, .quantifier = .required },
8718 },
8719 },
8720 .{
8721 .name = "OpCreatePipeFromPipeStorage",
8722 .opcode = 324,
8723 .operands = &.{
8724 .{ .kind = .id_result_type, .quantifier = .required },
8725 .{ .kind = .id_result, .quantifier = .required },
8726 .{ .kind = .id_ref, .quantifier = .required },
8727 },
8728 },
8729 .{
8730 .name = "OpGetKernelLocalSizeForSubgroupCount",
8731 .opcode = 325,
8732 .operands = &.{
8733 .{ .kind = .id_result_type, .quantifier = .required },
8734 .{ .kind = .id_result, .quantifier = .required },
8735 .{ .kind = .id_ref, .quantifier = .required },
8736 .{ .kind = .id_ref, .quantifier = .required },
8737 .{ .kind = .id_ref, .quantifier = .required },
8738 .{ .kind = .id_ref, .quantifier = .required },
8739 .{ .kind = .id_ref, .quantifier = .required },
8740 },
8741 },
8742 .{
8743 .name = "OpGetKernelMaxNumSubgroups",
8744 .opcode = 326,
8745 .operands = &.{
8746 .{ .kind = .id_result_type, .quantifier = .required },
8747 .{ .kind = .id_result, .quantifier = .required },
8748 .{ .kind = .id_ref, .quantifier = .required },
8749 .{ .kind = .id_ref, .quantifier = .required },
8750 .{ .kind = .id_ref, .quantifier = .required },
8751 .{ .kind = .id_ref, .quantifier = .required },
8752 },
8753 },
8754 .{
8755 .name = "OpTypeNamedBarrier",
8756 .opcode = 327,
8757 .operands = &.{
8758 .{ .kind = .id_result, .quantifier = .required },
8759 },
8760 },
8761 .{
8762 .name = "OpNamedBarrierInitialize",
8763 .opcode = 328,
8764 .operands = &.{
8765 .{ .kind = .id_result_type, .quantifier = .required },
8766 .{ .kind = .id_result, .quantifier = .required },
8767 .{ .kind = .id_ref, .quantifier = .required },
8768 },
8769 },
8770 .{
8771 .name = "OpMemoryNamedBarrier",
8772 .opcode = 329,
8773 .operands = &.{
8774 .{ .kind = .id_ref, .quantifier = .required },
8775 .{ .kind = .id_scope, .quantifier = .required },
8776 .{ .kind = .id_memory_semantics, .quantifier = .required },
8777 },
8778 },
8779 .{
8780 .name = "OpModuleProcessed",
8781 .opcode = 330,
8782 .operands = &.{
8783 .{ .kind = .literal_string, .quantifier = .required },
8784 },
8785 },
8786 .{
8787 .name = "OpExecutionModeId",
8788 .opcode = 331,
8789 .operands = &.{
8790 .{ .kind = .id_ref, .quantifier = .required },
8791 .{ .kind = .execution_mode, .quantifier = .required },
8792 },
8793 },
8794 .{
8795 .name = "OpDecorateId",
8796 .opcode = 332,
8797 .operands = &.{
8798 .{ .kind = .id_ref, .quantifier = .required },
8799 .{ .kind = .decoration, .quantifier = .required },
8800 },
8801 },
8802 .{
8803 .name = "OpGroupNonUniformElect",
8804 .opcode = 333,
8805 .operands = &.{
8806 .{ .kind = .id_result_type, .quantifier = .required },
8807 .{ .kind = .id_result, .quantifier = .required },
8808 .{ .kind = .id_scope, .quantifier = .required },
8809 },
8810 },
8811 .{
8812 .name = "OpGroupNonUniformAll",
8813 .opcode = 334,
8814 .operands = &.{
8815 .{ .kind = .id_result_type, .quantifier = .required },
8816 .{ .kind = .id_result, .quantifier = .required },
8817 .{ .kind = .id_scope, .quantifier = .required },
8818 .{ .kind = .id_ref, .quantifier = .required },
8819 },
8820 },
8821 .{
8822 .name = "OpGroupNonUniformAny",
8823 .opcode = 335,
8824 .operands = &.{
8825 .{ .kind = .id_result_type, .quantifier = .required },
8826 .{ .kind = .id_result, .quantifier = .required },
8827 .{ .kind = .id_scope, .quantifier = .required },
8828 .{ .kind = .id_ref, .quantifier = .required },
8829 },
8830 },
8831 .{
8832 .name = "OpGroupNonUniformAllEqual",
8833 .opcode = 336,
8834 .operands = &.{
8835 .{ .kind = .id_result_type, .quantifier = .required },
8836 .{ .kind = .id_result, .quantifier = .required },
8837 .{ .kind = .id_scope, .quantifier = .required },
8838 .{ .kind = .id_ref, .quantifier = .required },
8839 },
8840 },
8841 .{
8842 .name = "OpGroupNonUniformBroadcast",
8843 .opcode = 337,
8844 .operands = &.{
8845 .{ .kind = .id_result_type, .quantifier = .required },
8846 .{ .kind = .id_result, .quantifier = .required },
8847 .{ .kind = .id_scope, .quantifier = .required },
8848 .{ .kind = .id_ref, .quantifier = .required },
8849 .{ .kind = .id_ref, .quantifier = .required },
8850 },
8851 },
8852 .{
8853 .name = "OpGroupNonUniformBroadcastFirst",
8854 .opcode = 338,
8855 .operands = &.{
8856 .{ .kind = .id_result_type, .quantifier = .required },
8857 .{ .kind = .id_result, .quantifier = .required },
8858 .{ .kind = .id_scope, .quantifier = .required },
8859 .{ .kind = .id_ref, .quantifier = .required },
8860 },
8861 },
8862 .{
8863 .name = "OpGroupNonUniformBallot",
8864 .opcode = 339,
8865 .operands = &.{
8866 .{ .kind = .id_result_type, .quantifier = .required },
8867 .{ .kind = .id_result, .quantifier = .required },
8868 .{ .kind = .id_scope, .quantifier = .required },
8869 .{ .kind = .id_ref, .quantifier = .required },
8870 },
8871 },
8872 .{
8873 .name = "OpGroupNonUniformInverseBallot",
8874 .opcode = 340,
8875 .operands = &.{
8876 .{ .kind = .id_result_type, .quantifier = .required },
8877 .{ .kind = .id_result, .quantifier = .required },
8878 .{ .kind = .id_scope, .quantifier = .required },
8879 .{ .kind = .id_ref, .quantifier = .required },
8880 },
8881 },
8882 .{
8883 .name = "OpGroupNonUniformBallotBitExtract",
8884 .opcode = 341,
8885 .operands = &.{
8886 .{ .kind = .id_result_type, .quantifier = .required },
8887 .{ .kind = .id_result, .quantifier = .required },
8888 .{ .kind = .id_scope, .quantifier = .required },
8889 .{ .kind = .id_ref, .quantifier = .required },
8890 .{ .kind = .id_ref, .quantifier = .required },
8891 },
8892 },
8893 .{
8894 .name = "OpGroupNonUniformBallotBitCount",
8895 .opcode = 342,
8896 .operands = &.{
8897 .{ .kind = .id_result_type, .quantifier = .required },
8898 .{ .kind = .id_result, .quantifier = .required },
8899 .{ .kind = .id_scope, .quantifier = .required },
8900 .{ .kind = .group_operation, .quantifier = .required },
8901 .{ .kind = .id_ref, .quantifier = .required },
8902 },
8903 },
8904 .{
8905 .name = "OpGroupNonUniformBallotFindLSB",
8906 .opcode = 343,
8907 .operands = &.{
8908 .{ .kind = .id_result_type, .quantifier = .required },
8909 .{ .kind = .id_result, .quantifier = .required },
8910 .{ .kind = .id_scope, .quantifier = .required },
8911 .{ .kind = .id_ref, .quantifier = .required },
8912 },
8913 },
8914 .{
8915 .name = "OpGroupNonUniformBallotFindMSB",
8916 .opcode = 344,
8917 .operands = &.{
8918 .{ .kind = .id_result_type, .quantifier = .required },
8919 .{ .kind = .id_result, .quantifier = .required },
8920 .{ .kind = .id_scope, .quantifier = .required },
8921 .{ .kind = .id_ref, .quantifier = .required },
8922 },
8923 },
8924 .{
8925 .name = "OpGroupNonUniformShuffle",
8926 .opcode = 345,
8927 .operands = &.{
8928 .{ .kind = .id_result_type, .quantifier = .required },
8929 .{ .kind = .id_result, .quantifier = .required },
8930 .{ .kind = .id_scope, .quantifier = .required },
8931 .{ .kind = .id_ref, .quantifier = .required },
8932 .{ .kind = .id_ref, .quantifier = .required },
8933 },
8934 },
8935 .{
8936 .name = "OpGroupNonUniformShuffleXor",
8937 .opcode = 346,
8938 .operands = &.{
8939 .{ .kind = .id_result_type, .quantifier = .required },
8940 .{ .kind = .id_result, .quantifier = .required },
8941 .{ .kind = .id_scope, .quantifier = .required },
8942 .{ .kind = .id_ref, .quantifier = .required },
8943 .{ .kind = .id_ref, .quantifier = .required },
8944 },
8945 },
8946 .{
8947 .name = "OpGroupNonUniformShuffleUp",
8948 .opcode = 347,
8949 .operands = &.{
8950 .{ .kind = .id_result_type, .quantifier = .required },
8951 .{ .kind = .id_result, .quantifier = .required },
8952 .{ .kind = .id_scope, .quantifier = .required },
8953 .{ .kind = .id_ref, .quantifier = .required },
8954 .{ .kind = .id_ref, .quantifier = .required },
8955 },
8956 },
8957 .{
8958 .name = "OpGroupNonUniformShuffleDown",
8959 .opcode = 348,
8960 .operands = &.{
8961 .{ .kind = .id_result_type, .quantifier = .required },
8962 .{ .kind = .id_result, .quantifier = .required },
8963 .{ .kind = .id_scope, .quantifier = .required },
8964 .{ .kind = .id_ref, .quantifier = .required },
8965 .{ .kind = .id_ref, .quantifier = .required },
8966 },
8967 },
8968 .{
8969 .name = "OpGroupNonUniformIAdd",
8970 .opcode = 349,
8971 .operands = &.{
8972 .{ .kind = .id_result_type, .quantifier = .required },
8973 .{ .kind = .id_result, .quantifier = .required },
8974 .{ .kind = .id_scope, .quantifier = .required },
8975 .{ .kind = .group_operation, .quantifier = .required },
8976 .{ .kind = .id_ref, .quantifier = .required },
8977 .{ .kind = .id_ref, .quantifier = .optional },
8978 },
8979 },
8980 .{
8981 .name = "OpGroupNonUniformFAdd",
8982 .opcode = 350,
8983 .operands = &.{
8984 .{ .kind = .id_result_type, .quantifier = .required },
8985 .{ .kind = .id_result, .quantifier = .required },
8986 .{ .kind = .id_scope, .quantifier = .required },
8987 .{ .kind = .group_operation, .quantifier = .required },
8988 .{ .kind = .id_ref, .quantifier = .required },
8989 .{ .kind = .id_ref, .quantifier = .optional },
8990 },
8991 },
8992 .{
8993 .name = "OpGroupNonUniformIMul",
8994 .opcode = 351,
8995 .operands = &.{
8996 .{ .kind = .id_result_type, .quantifier = .required },
8997 .{ .kind = .id_result, .quantifier = .required },
8998 .{ .kind = .id_scope, .quantifier = .required },
8999 .{ .kind = .group_operation, .quantifier = .required },
9000 .{ .kind = .id_ref, .quantifier = .required },
9001 .{ .kind = .id_ref, .quantifier = .optional },
9002 },
9003 },
9004 .{
9005 .name = "OpGroupNonUniformFMul",
9006 .opcode = 352,
9007 .operands = &.{
9008 .{ .kind = .id_result_type, .quantifier = .required },
9009 .{ .kind = .id_result, .quantifier = .required },
9010 .{ .kind = .id_scope, .quantifier = .required },
9011 .{ .kind = .group_operation, .quantifier = .required },
9012 .{ .kind = .id_ref, .quantifier = .required },
9013 .{ .kind = .id_ref, .quantifier = .optional },
9014 },
9015 },
9016 .{
9017 .name = "OpGroupNonUniformSMin",
9018 .opcode = 353,
9019 .operands = &.{
9020 .{ .kind = .id_result_type, .quantifier = .required },
9021 .{ .kind = .id_result, .quantifier = .required },
9022 .{ .kind = .id_scope, .quantifier = .required },
9023 .{ .kind = .group_operation, .quantifier = .required },
9024 .{ .kind = .id_ref, .quantifier = .required },
9025 .{ .kind = .id_ref, .quantifier = .optional },
9026 },
9027 },
9028 .{
9029 .name = "OpGroupNonUniformUMin",
9030 .opcode = 354,
9031 .operands = &.{
9032 .{ .kind = .id_result_type, .quantifier = .required },
9033 .{ .kind = .id_result, .quantifier = .required },
9034 .{ .kind = .id_scope, .quantifier = .required },
9035 .{ .kind = .group_operation, .quantifier = .required },
9036 .{ .kind = .id_ref, .quantifier = .required },
9037 .{ .kind = .id_ref, .quantifier = .optional },
9038 },
9039 },
9040 .{
9041 .name = "OpGroupNonUniformFMin",
9042 .opcode = 355,
9043 .operands = &.{
9044 .{ .kind = .id_result_type, .quantifier = .required },
9045 .{ .kind = .id_result, .quantifier = .required },
9046 .{ .kind = .id_scope, .quantifier = .required },
9047 .{ .kind = .group_operation, .quantifier = .required },
9048 .{ .kind = .id_ref, .quantifier = .required },
9049 .{ .kind = .id_ref, .quantifier = .optional },
9050 },
9051 },
9052 .{
9053 .name = "OpGroupNonUniformSMax",
9054 .opcode = 356,
9055 .operands = &.{
9056 .{ .kind = .id_result_type, .quantifier = .required },
9057 .{ .kind = .id_result, .quantifier = .required },
9058 .{ .kind = .id_scope, .quantifier = .required },
9059 .{ .kind = .group_operation, .quantifier = .required },
9060 .{ .kind = .id_ref, .quantifier = .required },
9061 .{ .kind = .id_ref, .quantifier = .optional },
9062 },
9063 },
9064 .{
9065 .name = "OpGroupNonUniformUMax",
9066 .opcode = 357,
9067 .operands = &.{
9068 .{ .kind = .id_result_type, .quantifier = .required },
9069 .{ .kind = .id_result, .quantifier = .required },
9070 .{ .kind = .id_scope, .quantifier = .required },
9071 .{ .kind = .group_operation, .quantifier = .required },
9072 .{ .kind = .id_ref, .quantifier = .required },
9073 .{ .kind = .id_ref, .quantifier = .optional },
9074 },
9075 },
9076 .{
9077 .name = "OpGroupNonUniformFMax",
9078 .opcode = 358,
9079 .operands = &.{
9080 .{ .kind = .id_result_type, .quantifier = .required },
9081 .{ .kind = .id_result, .quantifier = .required },
9082 .{ .kind = .id_scope, .quantifier = .required },
9083 .{ .kind = .group_operation, .quantifier = .required },
9084 .{ .kind = .id_ref, .quantifier = .required },
9085 .{ .kind = .id_ref, .quantifier = .optional },
9086 },
9087 },
9088 .{
9089 .name = "OpGroupNonUniformBitwiseAnd",
9090 .opcode = 359,
9091 .operands = &.{
9092 .{ .kind = .id_result_type, .quantifier = .required },
9093 .{ .kind = .id_result, .quantifier = .required },
9094 .{ .kind = .id_scope, .quantifier = .required },
9095 .{ .kind = .group_operation, .quantifier = .required },
9096 .{ .kind = .id_ref, .quantifier = .required },
9097 .{ .kind = .id_ref, .quantifier = .optional },
9098 },
9099 },
9100 .{
9101 .name = "OpGroupNonUniformBitwiseOr",
9102 .opcode = 360,
9103 .operands = &.{
9104 .{ .kind = .id_result_type, .quantifier = .required },
9105 .{ .kind = .id_result, .quantifier = .required },
9106 .{ .kind = .id_scope, .quantifier = .required },
9107 .{ .kind = .group_operation, .quantifier = .required },
9108 .{ .kind = .id_ref, .quantifier = .required },
9109 .{ .kind = .id_ref, .quantifier = .optional },
9110 },
9111 },
9112 .{
9113 .name = "OpGroupNonUniformBitwiseXor",
9114 .opcode = 361,
9115 .operands = &.{
9116 .{ .kind = .id_result_type, .quantifier = .required },
9117 .{ .kind = .id_result, .quantifier = .required },
9118 .{ .kind = .id_scope, .quantifier = .required },
9119 .{ .kind = .group_operation, .quantifier = .required },
9120 .{ .kind = .id_ref, .quantifier = .required },
9121 .{ .kind = .id_ref, .quantifier = .optional },
9122 },
9123 },
9124 .{
9125 .name = "OpGroupNonUniformLogicalAnd",
9126 .opcode = 362,
9127 .operands = &.{
9128 .{ .kind = .id_result_type, .quantifier = .required },
9129 .{ .kind = .id_result, .quantifier = .required },
9130 .{ .kind = .id_scope, .quantifier = .required },
9131 .{ .kind = .group_operation, .quantifier = .required },
9132 .{ .kind = .id_ref, .quantifier = .required },
9133 .{ .kind = .id_ref, .quantifier = .optional },
9134 },
9135 },
9136 .{
9137 .name = "OpGroupNonUniformLogicalOr",
9138 .opcode = 363,
9139 .operands = &.{
9140 .{ .kind = .id_result_type, .quantifier = .required },
9141 .{ .kind = .id_result, .quantifier = .required },
9142 .{ .kind = .id_scope, .quantifier = .required },
9143 .{ .kind = .group_operation, .quantifier = .required },
9144 .{ .kind = .id_ref, .quantifier = .required },
9145 .{ .kind = .id_ref, .quantifier = .optional },
9146 },
9147 },
9148 .{
9149 .name = "OpGroupNonUniformLogicalXor",
9150 .opcode = 364,
9151 .operands = &.{
9152 .{ .kind = .id_result_type, .quantifier = .required },
9153 .{ .kind = .id_result, .quantifier = .required },
9154 .{ .kind = .id_scope, .quantifier = .required },
9155 .{ .kind = .group_operation, .quantifier = .required },
9156 .{ .kind = .id_ref, .quantifier = .required },
9157 .{ .kind = .id_ref, .quantifier = .optional },
9158 },
9159 },
9160 .{
9161 .name = "OpGroupNonUniformQuadBroadcast",
9162 .opcode = 365,
9163 .operands = &.{
9164 .{ .kind = .id_result_type, .quantifier = .required },
9165 .{ .kind = .id_result, .quantifier = .required },
9166 .{ .kind = .id_scope, .quantifier = .required },
9167 .{ .kind = .id_ref, .quantifier = .required },
9168 .{ .kind = .id_ref, .quantifier = .required },
9169 },
9170 },
9171 .{
9172 .name = "OpGroupNonUniformQuadSwap",
9173 .opcode = 366,
9174 .operands = &.{
9175 .{ .kind = .id_result_type, .quantifier = .required },
9176 .{ .kind = .id_result, .quantifier = .required },
9177 .{ .kind = .id_scope, .quantifier = .required },
9178 .{ .kind = .id_ref, .quantifier = .required },
9179 .{ .kind = .id_ref, .quantifier = .required },
9180 },
9181 },
9182 .{
9183 .name = "OpCopyLogical",
9184 .opcode = 400,
9185 .operands = &.{
9186 .{ .kind = .id_result_type, .quantifier = .required },
9187 .{ .kind = .id_result, .quantifier = .required },
9188 .{ .kind = .id_ref, .quantifier = .required },
9189 },
9190 },
9191 .{
9192 .name = "OpPtrEqual",
9193 .opcode = 401,
9194 .operands = &.{
9195 .{ .kind = .id_result_type, .quantifier = .required },
9196 .{ .kind = .id_result, .quantifier = .required },
9197 .{ .kind = .id_ref, .quantifier = .required },
9198 .{ .kind = .id_ref, .quantifier = .required },
9199 },
9200 },
9201 .{
9202 .name = "OpPtrNotEqual",
9203 .opcode = 402,
9204 .operands = &.{
9205 .{ .kind = .id_result_type, .quantifier = .required },
9206 .{ .kind = .id_result, .quantifier = .required },
9207 .{ .kind = .id_ref, .quantifier = .required },
9208 .{ .kind = .id_ref, .quantifier = .required },
9209 },
9210 },
9211 .{
9212 .name = "OpPtrDiff",
9213 .opcode = 403,
9214 .operands = &.{
9215 .{ .kind = .id_result_type, .quantifier = .required },
9216 .{ .kind = .id_result, .quantifier = .required },
9217 .{ .kind = .id_ref, .quantifier = .required },
9218 .{ .kind = .id_ref, .quantifier = .required },
9219 },
9220 },
9221 .{
9222 .name = "OpColorAttachmentReadEXT",
9223 .opcode = 4160,
9224 .operands = &.{
9225 .{ .kind = .id_result_type, .quantifier = .required },
9226 .{ .kind = .id_result, .quantifier = .required },
9227 .{ .kind = .id_ref, .quantifier = .required },
9228 .{ .kind = .id_ref, .quantifier = .optional },
9229 },
9230 },
9231 .{
9232 .name = "OpDepthAttachmentReadEXT",
9233 .opcode = 4161,
9234 .operands = &.{
9235 .{ .kind = .id_result_type, .quantifier = .required },
9236 .{ .kind = .id_result, .quantifier = .required },
9237 .{ .kind = .id_ref, .quantifier = .optional },
9238 },
9239 },
9240 .{
9241 .name = "OpStencilAttachmentReadEXT",
9242 .opcode = 4162,
9243 .operands = &.{
9244 .{ .kind = .id_result_type, .quantifier = .required },
9245 .{ .kind = .id_result, .quantifier = .required },
9246 .{ .kind = .id_ref, .quantifier = .optional },
9247 },
9248 },
9249 .{
9250 .name = "OpTypeTensorARM",
9251 .opcode = 4163,
9252 .operands = &.{
9253 .{ .kind = .id_result, .quantifier = .required },
9254 .{ .kind = .id_ref, .quantifier = .required },
9255 .{ .kind = .id_ref, .quantifier = .optional },
9256 .{ .kind = .id_ref, .quantifier = .optional },
9257 },
9258 },
9259 .{
9260 .name = "OpTensorReadARM",
9261 .opcode = 4164,
9262 .operands = &.{
9263 .{ .kind = .id_result_type, .quantifier = .required },
9264 .{ .kind = .id_result, .quantifier = .required },
9265 .{ .kind = .id_ref, .quantifier = .required },
9266 .{ .kind = .id_ref, .quantifier = .required },
9267 .{ .kind = .tensor_operands, .quantifier = .optional },
9268 },
9269 },
9270 .{
9271 .name = "OpTensorWriteARM",
9272 .opcode = 4165,
9273 .operands = &.{
9274 .{ .kind = .id_ref, .quantifier = .required },
9275 .{ .kind = .id_ref, .quantifier = .required },
9276 .{ .kind = .id_ref, .quantifier = .required },
9277 .{ .kind = .tensor_operands, .quantifier = .optional },
9278 },
9279 },
9280 .{
9281 .name = "OpTensorQuerySizeARM",
9282 .opcode = 4166,
9283 .operands = &.{
9284 .{ .kind = .id_result_type, .quantifier = .required },
9285 .{ .kind = .id_result, .quantifier = .required },
9286 .{ .kind = .id_ref, .quantifier = .required },
9287 .{ .kind = .id_ref, .quantifier = .required },
9288 },
9289 },
9290 .{
9291 .name = "OpGraphConstantARM",
9292 .opcode = 4181,
9293 .operands = &.{
9294 .{ .kind = .id_result_type, .quantifier = .required },
9295 .{ .kind = .id_result, .quantifier = .required },
9296 .{ .kind = .literal_integer, .quantifier = .required },
9297 },
9298 },
9299 .{
9300 .name = "OpGraphEntryPointARM",
9301 .opcode = 4182,
9302 .operands = &.{
9303 .{ .kind = .id_ref, .quantifier = .required },
9304 .{ .kind = .literal_string, .quantifier = .required },
9305 .{ .kind = .id_ref, .quantifier = .variadic },
9306 },
9307 },
9308 .{
9309 .name = "OpGraphARM",
9310 .opcode = 4183,
9311 .operands = &.{
9312 .{ .kind = .id_result_type, .quantifier = .required },
9313 .{ .kind = .id_result, .quantifier = .required },
9314 },
9315 },
9316 .{
9317 .name = "OpGraphInputARM",
9318 .opcode = 4184,
9319 .operands = &.{
9320 .{ .kind = .id_result_type, .quantifier = .required },
9321 .{ .kind = .id_result, .quantifier = .required },
9322 .{ .kind = .id_ref, .quantifier = .required },
9323 .{ .kind = .id_ref, .quantifier = .variadic },
9324 },
9325 },
9326 .{
9327 .name = "OpGraphSetOutputARM",
9328 .opcode = 4185,
9329 .operands = &.{
9330 .{ .kind = .id_ref, .quantifier = .required },
9331 .{ .kind = .id_ref, .quantifier = .required },
9332 .{ .kind = .id_ref, .quantifier = .variadic },
9333 },
9334 },
9335 .{
9336 .name = "OpGraphEndARM",
9337 .opcode = 4186,
9338 .operands = &.{},
9339 },
9340 .{
9341 .name = "OpTypeGraphARM",
9342 .opcode = 4190,
9343 .operands = &.{
9344 .{ .kind = .id_result, .quantifier = .required },
9345 .{ .kind = .literal_integer, .quantifier = .required },
9346 .{ .kind = .id_ref, .quantifier = .variadic },
9347 },
9348 },
9349 .{
9350 .name = "OpTerminateInvocation",
9351 .opcode = 4416,
9352 .operands = &.{},
9353 },
9354 .{
9355 .name = "OpTypeUntypedPointerKHR",
9356 .opcode = 4417,
9357 .operands = &.{
9358 .{ .kind = .id_result, .quantifier = .required },
9359 .{ .kind = .storage_class, .quantifier = .required },
9360 },
9361 },
9362 .{
9363 .name = "OpUntypedVariableKHR",
9364 .opcode = 4418,
9365 .operands = &.{
9366 .{ .kind = .id_result_type, .quantifier = .required },
9367 .{ .kind = .id_result, .quantifier = .required },
9368 .{ .kind = .storage_class, .quantifier = .required },
9369 .{ .kind = .id_ref, .quantifier = .optional },
9370 .{ .kind = .id_ref, .quantifier = .optional },
9371 },
9372 },
9373 .{
9374 .name = "OpUntypedAccessChainKHR",
9375 .opcode = 4419,
9376 .operands = &.{
9377 .{ .kind = .id_result_type, .quantifier = .required },
9378 .{ .kind = .id_result, .quantifier = .required },
9379 .{ .kind = .id_ref, .quantifier = .required },
9380 .{ .kind = .id_ref, .quantifier = .required },
9381 .{ .kind = .id_ref, .quantifier = .variadic },
9382 },
9383 },
9384 .{
9385 .name = "OpUntypedInBoundsAccessChainKHR",
9386 .opcode = 4420,
9387 .operands = &.{
9388 .{ .kind = .id_result_type, .quantifier = .required },
9389 .{ .kind = .id_result, .quantifier = .required },
9390 .{ .kind = .id_ref, .quantifier = .required },
9391 .{ .kind = .id_ref, .quantifier = .required },
9392 .{ .kind = .id_ref, .quantifier = .variadic },
9393 },
9394 },
9395 .{
9396 .name = "OpSubgroupBallotKHR",
9397 .opcode = 4421,
9398 .operands = &.{
9399 .{ .kind = .id_result_type, .quantifier = .required },
9400 .{ .kind = .id_result, .quantifier = .required },
9401 .{ .kind = .id_ref, .quantifier = .required },
9402 },
9403 },
9404 .{
9405 .name = "OpSubgroupFirstInvocationKHR",
9406 .opcode = 4422,
9407 .operands = &.{
9408 .{ .kind = .id_result_type, .quantifier = .required },
9409 .{ .kind = .id_result, .quantifier = .required },
9410 .{ .kind = .id_ref, .quantifier = .required },
9411 },
9412 },
9413 .{
9414 .name = "OpUntypedPtrAccessChainKHR",
9415 .opcode = 4423,
9416 .operands = &.{
9417 .{ .kind = .id_result_type, .quantifier = .required },
9418 .{ .kind = .id_result, .quantifier = .required },
9419 .{ .kind = .id_ref, .quantifier = .required },
9420 .{ .kind = .id_ref, .quantifier = .required },
9421 .{ .kind = .id_ref, .quantifier = .required },
9422 .{ .kind = .id_ref, .quantifier = .variadic },
9423 },
9424 },
9425 .{
9426 .name = "OpUntypedInBoundsPtrAccessChainKHR",
9427 .opcode = 4424,
9428 .operands = &.{
9429 .{ .kind = .id_result_type, .quantifier = .required },
9430 .{ .kind = .id_result, .quantifier = .required },
9431 .{ .kind = .id_ref, .quantifier = .required },
9432 .{ .kind = .id_ref, .quantifier = .required },
9433 .{ .kind = .id_ref, .quantifier = .required },
9434 .{ .kind = .id_ref, .quantifier = .variadic },
9435 },
9436 },
9437 .{
9438 .name = "OpUntypedArrayLengthKHR",
9439 .opcode = 4425,
9440 .operands = &.{
9441 .{ .kind = .id_result_type, .quantifier = .required },
9442 .{ .kind = .id_result, .quantifier = .required },
9443 .{ .kind = .id_ref, .quantifier = .required },
9444 .{ .kind = .id_ref, .quantifier = .required },
9445 .{ .kind = .literal_integer, .quantifier = .required },
9446 },
9447 },
9448 .{
9449 .name = "OpUntypedPrefetchKHR",
9450 .opcode = 4426,
9451 .operands = &.{
9452 .{ .kind = .id_ref, .quantifier = .required },
9453 .{ .kind = .id_ref, .quantifier = .required },
9454 .{ .kind = .id_ref, .quantifier = .optional },
9455 .{ .kind = .id_ref, .quantifier = .optional },
9456 .{ .kind = .id_ref, .quantifier = .optional },
9457 },
9458 },
9459 .{
9460 .name = "OpSubgroupAllKHR",
9461 .opcode = 4428,
9462 .operands = &.{
9463 .{ .kind = .id_result_type, .quantifier = .required },
9464 .{ .kind = .id_result, .quantifier = .required },
9465 .{ .kind = .id_ref, .quantifier = .required },
9466 },
9467 },
9468 .{
9469 .name = "OpSubgroupAnyKHR",
9470 .opcode = 4429,
9471 .operands = &.{
9472 .{ .kind = .id_result_type, .quantifier = .required },
9473 .{ .kind = .id_result, .quantifier = .required },
9474 .{ .kind = .id_ref, .quantifier = .required },
9475 },
9476 },
9477 .{
9478 .name = "OpSubgroupAllEqualKHR",
9479 .opcode = 4430,
9480 .operands = &.{
9481 .{ .kind = .id_result_type, .quantifier = .required },
9482 .{ .kind = .id_result, .quantifier = .required },
9483 .{ .kind = .id_ref, .quantifier = .required },
9484 },
9485 },
9486 .{
9487 .name = "OpGroupNonUniformRotateKHR",
9488 .opcode = 4431,
9489 .operands = &.{
9490 .{ .kind = .id_result_type, .quantifier = .required },
9491 .{ .kind = .id_result, .quantifier = .required },
9492 .{ .kind = .id_scope, .quantifier = .required },
9493 .{ .kind = .id_ref, .quantifier = .required },
9494 .{ .kind = .id_ref, .quantifier = .required },
9495 .{ .kind = .id_ref, .quantifier = .optional },
9496 },
9497 },
9498 .{
9499 .name = "OpSubgroupReadInvocationKHR",
9500 .opcode = 4432,
9501 .operands = &.{
9502 .{ .kind = .id_result_type, .quantifier = .required },
9503 .{ .kind = .id_result, .quantifier = .required },
9504 .{ .kind = .id_ref, .quantifier = .required },
9505 .{ .kind = .id_ref, .quantifier = .required },
9506 },
9507 },
9508 .{
9509 .name = "OpExtInstWithForwardRefsKHR",
9510 .opcode = 4433,
9511 .operands = &.{
9512 .{ .kind = .id_result_type, .quantifier = .required },
9513 .{ .kind = .id_result, .quantifier = .required },
9514 .{ .kind = .id_ref, .quantifier = .required },
9515 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
9516 .{ .kind = .id_ref, .quantifier = .variadic },
9517 },
9518 },
9519 .{
9520 .name = "OpTraceRayKHR",
9521 .opcode = 4445,
9522 .operands = &.{
9523 .{ .kind = .id_ref, .quantifier = .required },
9524 .{ .kind = .id_ref, .quantifier = .required },
9525 .{ .kind = .id_ref, .quantifier = .required },
9526 .{ .kind = .id_ref, .quantifier = .required },
9527 .{ .kind = .id_ref, .quantifier = .required },
9528 .{ .kind = .id_ref, .quantifier = .required },
9529 .{ .kind = .id_ref, .quantifier = .required },
9530 .{ .kind = .id_ref, .quantifier = .required },
9531 .{ .kind = .id_ref, .quantifier = .required },
9532 .{ .kind = .id_ref, .quantifier = .required },
9533 .{ .kind = .id_ref, .quantifier = .required },
9534 },
9535 },
9536 .{
9537 .name = "OpExecuteCallableKHR",
9538 .opcode = 4446,
9539 .operands = &.{
9540 .{ .kind = .id_ref, .quantifier = .required },
9541 .{ .kind = .id_ref, .quantifier = .required },
9542 },
9543 },
9544 .{
9545 .name = "OpConvertUToAccelerationStructureKHR",
9546 .opcode = 4447,
9547 .operands = &.{
9548 .{ .kind = .id_result_type, .quantifier = .required },
9549 .{ .kind = .id_result, .quantifier = .required },
9550 .{ .kind = .id_ref, .quantifier = .required },
9551 },
9552 },
9553 .{
9554 .name = "OpIgnoreIntersectionKHR",
9555 .opcode = 4448,
9556 .operands = &.{},
9557 },
9558 .{
9559 .name = "OpTerminateRayKHR",
9560 .opcode = 4449,
9561 .operands = &.{},
9562 },
9563 .{
9564 .name = "OpSDot",
9565 .opcode = 4450,
9566 .operands = &.{
9567 .{ .kind = .id_result_type, .quantifier = .required },
9568 .{ .kind = .id_result, .quantifier = .required },
9569 .{ .kind = .id_ref, .quantifier = .required },
9570 .{ .kind = .id_ref, .quantifier = .required },
9571 .{ .kind = .packed_vector_format, .quantifier = .optional },
9572 },
9573 },
9574 .{
9575 .name = "OpUDot",
9576 .opcode = 4451,
9577 .operands = &.{
9578 .{ .kind = .id_result_type, .quantifier = .required },
9579 .{ .kind = .id_result, .quantifier = .required },
9580 .{ .kind = .id_ref, .quantifier = .required },
9581 .{ .kind = .id_ref, .quantifier = .required },
9582 .{ .kind = .packed_vector_format, .quantifier = .optional },
9583 },
9584 },
9585 .{
9586 .name = "OpSUDot",
9587 .opcode = 4452,
9588 .operands = &.{
9589 .{ .kind = .id_result_type, .quantifier = .required },
9590 .{ .kind = .id_result, .quantifier = .required },
9591 .{ .kind = .id_ref, .quantifier = .required },
9592 .{ .kind = .id_ref, .quantifier = .required },
9593 .{ .kind = .packed_vector_format, .quantifier = .optional },
9594 },
9595 },
9596 .{
9597 .name = "OpSDotAccSat",
9598 .opcode = 4453,
9599 .operands = &.{
9600 .{ .kind = .id_result_type, .quantifier = .required },
9601 .{ .kind = .id_result, .quantifier = .required },
9602 .{ .kind = .id_ref, .quantifier = .required },
9603 .{ .kind = .id_ref, .quantifier = .required },
9604 .{ .kind = .id_ref, .quantifier = .required },
9605 .{ .kind = .packed_vector_format, .quantifier = .optional },
9606 },
9607 },
9608 .{
9609 .name = "OpUDotAccSat",
9610 .opcode = 4454,
9611 .operands = &.{
9612 .{ .kind = .id_result_type, .quantifier = .required },
9613 .{ .kind = .id_result, .quantifier = .required },
9614 .{ .kind = .id_ref, .quantifier = .required },
9615 .{ .kind = .id_ref, .quantifier = .required },
9616 .{ .kind = .id_ref, .quantifier = .required },
9617 .{ .kind = .packed_vector_format, .quantifier = .optional },
9618 },
9619 },
9620 .{
9621 .name = "OpSUDotAccSat",
9622 .opcode = 4455,
9623 .operands = &.{
9624 .{ .kind = .id_result_type, .quantifier = .required },
9625 .{ .kind = .id_result, .quantifier = .required },
9626 .{ .kind = .id_ref, .quantifier = .required },
9627 .{ .kind = .id_ref, .quantifier = .required },
9628 .{ .kind = .id_ref, .quantifier = .required },
9629 .{ .kind = .packed_vector_format, .quantifier = .optional },
9630 },
9631 },
9632 .{
9633 .name = "OpTypeCooperativeMatrixKHR",
9634 .opcode = 4456,
9635 .operands = &.{
9636 .{ .kind = .id_result, .quantifier = .required },
9637 .{ .kind = .id_ref, .quantifier = .required },
9638 .{ .kind = .id_scope, .quantifier = .required },
9639 .{ .kind = .id_ref, .quantifier = .required },
9640 .{ .kind = .id_ref, .quantifier = .required },
9641 .{ .kind = .id_ref, .quantifier = .required },
9642 },
9643 },
9644 .{
9645 .name = "OpCooperativeMatrixLoadKHR",
9646 .opcode = 4457,
9647 .operands = &.{
9648 .{ .kind = .id_result_type, .quantifier = .required },
9649 .{ .kind = .id_result, .quantifier = .required },
9650 .{ .kind = .id_ref, .quantifier = .required },
9651 .{ .kind = .id_ref, .quantifier = .required },
9652 .{ .kind = .id_ref, .quantifier = .optional },
9653 .{ .kind = .memory_access, .quantifier = .optional },
9654 },
9655 },
9656 .{
9657 .name = "OpCooperativeMatrixStoreKHR",
9658 .opcode = 4458,
9659 .operands = &.{
9660 .{ .kind = .id_ref, .quantifier = .required },
9661 .{ .kind = .id_ref, .quantifier = .required },
9662 .{ .kind = .id_ref, .quantifier = .required },
9663 .{ .kind = .id_ref, .quantifier = .optional },
9664 .{ .kind = .memory_access, .quantifier = .optional },
9665 },
9666 },
9667 .{
9668 .name = "OpCooperativeMatrixMulAddKHR",
9669 .opcode = 4459,
9670 .operands = &.{
9671 .{ .kind = .id_result_type, .quantifier = .required },
9672 .{ .kind = .id_result, .quantifier = .required },
9673 .{ .kind = .id_ref, .quantifier = .required },
9674 .{ .kind = .id_ref, .quantifier = .required },
9675 .{ .kind = .id_ref, .quantifier = .required },
9676 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
9677 },
9678 },
9679 .{
9680 .name = "OpCooperativeMatrixLengthKHR",
9681 .opcode = 4460,
9682 .operands = &.{
9683 .{ .kind = .id_result_type, .quantifier = .required },
9684 .{ .kind = .id_result, .quantifier = .required },
9685 .{ .kind = .id_ref, .quantifier = .required },
9686 },
9687 },
9688 .{
9689 .name = "OpConstantCompositeReplicateEXT",
9690 .opcode = 4461,
9691 .operands = &.{
9692 .{ .kind = .id_result_type, .quantifier = .required },
9693 .{ .kind = .id_result, .quantifier = .required },
9694 .{ .kind = .id_ref, .quantifier = .required },
9695 },
9696 },
9697 .{
9698 .name = "OpSpecConstantCompositeReplicateEXT",
9699 .opcode = 4462,
9700 .operands = &.{
9701 .{ .kind = .id_result_type, .quantifier = .required },
9702 .{ .kind = .id_result, .quantifier = .required },
9703 .{ .kind = .id_ref, .quantifier = .required },
9704 },
9705 },
9706 .{
9707 .name = "OpCompositeConstructReplicateEXT",
9708 .opcode = 4463,
9709 .operands = &.{
9710 .{ .kind = .id_result_type, .quantifier = .required },
9711 .{ .kind = .id_result, .quantifier = .required },
9712 .{ .kind = .id_ref, .quantifier = .required },
9713 },
9714 },
9715 .{
9716 .name = "OpTypeRayQueryKHR",
9717 .opcode = 4472,
9718 .operands = &.{
9719 .{ .kind = .id_result, .quantifier = .required },
9720 },
9721 },
9722 .{
9723 .name = "OpRayQueryInitializeKHR",
9724 .opcode = 4473,
9725 .operands = &.{
9726 .{ .kind = .id_ref, .quantifier = .required },
9727 .{ .kind = .id_ref, .quantifier = .required },
9728 .{ .kind = .id_ref, .quantifier = .required },
9729 .{ .kind = .id_ref, .quantifier = .required },
9730 .{ .kind = .id_ref, .quantifier = .required },
9731 .{ .kind = .id_ref, .quantifier = .required },
9732 .{ .kind = .id_ref, .quantifier = .required },
9733 .{ .kind = .id_ref, .quantifier = .required },
9734 },
9735 },
9736 .{
9737 .name = "OpRayQueryTerminateKHR",
9738 .opcode = 4474,
9739 .operands = &.{
9740 .{ .kind = .id_ref, .quantifier = .required },
9741 },
9742 },
9743 .{
9744 .name = "OpRayQueryGenerateIntersectionKHR",
9745 .opcode = 4475,
9746 .operands = &.{
9747 .{ .kind = .id_ref, .quantifier = .required },
9748 .{ .kind = .id_ref, .quantifier = .required },
9749 },
9750 },
9751 .{
9752 .name = "OpRayQueryConfirmIntersectionKHR",
9753 .opcode = 4476,
9754 .operands = &.{
9755 .{ .kind = .id_ref, .quantifier = .required },
9756 },
9757 },
9758 .{
9759 .name = "OpRayQueryProceedKHR",
9760 .opcode = 4477,
9761 .operands = &.{
9762 .{ .kind = .id_result_type, .quantifier = .required },
9763 .{ .kind = .id_result, .quantifier = .required },
9764 .{ .kind = .id_ref, .quantifier = .required },
9765 },
9766 },
9767 .{
9768 .name = "OpRayQueryGetIntersectionTypeKHR",
9769 .opcode = 4479,
9770 .operands = &.{
9771 .{ .kind = .id_result_type, .quantifier = .required },
9772 .{ .kind = .id_result, .quantifier = .required },
9773 .{ .kind = .id_ref, .quantifier = .required },
9774 .{ .kind = .id_ref, .quantifier = .required },
9775 },
9776 },
9777 .{
9778 .name = "OpImageSampleWeightedQCOM",
9779 .opcode = 4480,
9780 .operands = &.{
9781 .{ .kind = .id_result_type, .quantifier = .required },
9782 .{ .kind = .id_result, .quantifier = .required },
9783 .{ .kind = .id_ref, .quantifier = .required },
9784 .{ .kind = .id_ref, .quantifier = .required },
9785 .{ .kind = .id_ref, .quantifier = .required },
9786 },
9787 },
9788 .{
9789 .name = "OpImageBoxFilterQCOM",
9790 .opcode = 4481,
9791 .operands = &.{
9792 .{ .kind = .id_result_type, .quantifier = .required },
9793 .{ .kind = .id_result, .quantifier = .required },
9794 .{ .kind = .id_ref, .quantifier = .required },
9795 .{ .kind = .id_ref, .quantifier = .required },
9796 .{ .kind = .id_ref, .quantifier = .required },
9797 },
9798 },
9799 .{
9800 .name = "OpImageBlockMatchSSDQCOM",
9801 .opcode = 4482,
9802 .operands = &.{
9803 .{ .kind = .id_result_type, .quantifier = .required },
9804 .{ .kind = .id_result, .quantifier = .required },
9805 .{ .kind = .id_ref, .quantifier = .required },
9806 .{ .kind = .id_ref, .quantifier = .required },
9807 .{ .kind = .id_ref, .quantifier = .required },
9808 .{ .kind = .id_ref, .quantifier = .required },
9809 .{ .kind = .id_ref, .quantifier = .required },
9810 },
9811 },
9812 .{
9813 .name = "OpImageBlockMatchSADQCOM",
9814 .opcode = 4483,
9815 .operands = &.{
9816 .{ .kind = .id_result_type, .quantifier = .required },
9817 .{ .kind = .id_result, .quantifier = .required },
9818 .{ .kind = .id_ref, .quantifier = .required },
9819 .{ .kind = .id_ref, .quantifier = .required },
9820 .{ .kind = .id_ref, .quantifier = .required },
9821 .{ .kind = .id_ref, .quantifier = .required },
9822 .{ .kind = .id_ref, .quantifier = .required },
9823 },
9824 },
9825 .{
9826 .name = "OpImageBlockMatchWindowSSDQCOM",
9827 .opcode = 4500,
9828 .operands = &.{
9829 .{ .kind = .id_result_type, .quantifier = .required },
9830 .{ .kind = .id_result, .quantifier = .required },
9831 .{ .kind = .id_ref, .quantifier = .required },
9832 .{ .kind = .id_ref, .quantifier = .required },
9833 .{ .kind = .id_ref, .quantifier = .required },
9834 .{ .kind = .id_ref, .quantifier = .required },
9835 .{ .kind = .id_ref, .quantifier = .required },
9836 },
9837 },
9838 .{
9839 .name = "OpImageBlockMatchWindowSADQCOM",
9840 .opcode = 4501,
9841 .operands = &.{
9842 .{ .kind = .id_result_type, .quantifier = .required },
9843 .{ .kind = .id_result, .quantifier = .required },
9844 .{ .kind = .id_ref, .quantifier = .required },
9845 .{ .kind = .id_ref, .quantifier = .required },
9846 .{ .kind = .id_ref, .quantifier = .required },
9847 .{ .kind = .id_ref, .quantifier = .required },
9848 .{ .kind = .id_ref, .quantifier = .required },
9849 },
9850 },
9851 .{
9852 .name = "OpImageBlockMatchGatherSSDQCOM",
9853 .opcode = 4502,
9854 .operands = &.{
9855 .{ .kind = .id_result_type, .quantifier = .required },
9856 .{ .kind = .id_result, .quantifier = .required },
9857 .{ .kind = .id_ref, .quantifier = .required },
9858 .{ .kind = .id_ref, .quantifier = .required },
9859 .{ .kind = .id_ref, .quantifier = .required },
9860 .{ .kind = .id_ref, .quantifier = .required },
9861 .{ .kind = .id_ref, .quantifier = .required },
9862 },
9863 },
9864 .{
9865 .name = "OpImageBlockMatchGatherSADQCOM",
9866 .opcode = 4503,
9867 .operands = &.{
9868 .{ .kind = .id_result_type, .quantifier = .required },
9869 .{ .kind = .id_result, .quantifier = .required },
9870 .{ .kind = .id_ref, .quantifier = .required },
9871 .{ .kind = .id_ref, .quantifier = .required },
9872 .{ .kind = .id_ref, .quantifier = .required },
9873 .{ .kind = .id_ref, .quantifier = .required },
9874 .{ .kind = .id_ref, .quantifier = .required },
9875 },
9876 },
9877 .{
9878 .name = "OpGroupIAddNonUniformAMD",
9879 .opcode = 5000,
9880 .operands = &.{
9881 .{ .kind = .id_result_type, .quantifier = .required },
9882 .{ .kind = .id_result, .quantifier = .required },
9883 .{ .kind = .id_scope, .quantifier = .required },
9884 .{ .kind = .group_operation, .quantifier = .required },
9885 .{ .kind = .id_ref, .quantifier = .required },
9886 },
9887 },
9888 .{
9889 .name = "OpGroupFAddNonUniformAMD",
9890 .opcode = 5001,
9891 .operands = &.{
9892 .{ .kind = .id_result_type, .quantifier = .required },
9893 .{ .kind = .id_result, .quantifier = .required },
9894 .{ .kind = .id_scope, .quantifier = .required },
9895 .{ .kind = .group_operation, .quantifier = .required },
9896 .{ .kind = .id_ref, .quantifier = .required },
9897 },
9898 },
9899 .{
9900 .name = "OpGroupFMinNonUniformAMD",
9901 .opcode = 5002,
9902 .operands = &.{
9903 .{ .kind = .id_result_type, .quantifier = .required },
9904 .{ .kind = .id_result, .quantifier = .required },
9905 .{ .kind = .id_scope, .quantifier = .required },
9906 .{ .kind = .group_operation, .quantifier = .required },
9907 .{ .kind = .id_ref, .quantifier = .required },
9908 },
9909 },
9910 .{
9911 .name = "OpGroupUMinNonUniformAMD",
9912 .opcode = 5003,
9913 .operands = &.{
9914 .{ .kind = .id_result_type, .quantifier = .required },
9915 .{ .kind = .id_result, .quantifier = .required },
9916 .{ .kind = .id_scope, .quantifier = .required },
9917 .{ .kind = .group_operation, .quantifier = .required },
9918 .{ .kind = .id_ref, .quantifier = .required },
9919 },
9920 },
9921 .{
9922 .name = "OpGroupSMinNonUniformAMD",
9923 .opcode = 5004,
9924 .operands = &.{
9925 .{ .kind = .id_result_type, .quantifier = .required },
9926 .{ .kind = .id_result, .quantifier = .required },
9927 .{ .kind = .id_scope, .quantifier = .required },
9928 .{ .kind = .group_operation, .quantifier = .required },
9929 .{ .kind = .id_ref, .quantifier = .required },
9930 },
9931 },
9932 .{
9933 .name = "OpGroupFMaxNonUniformAMD",
9934 .opcode = 5005,
9935 .operands = &.{
9936 .{ .kind = .id_result_type, .quantifier = .required },
9937 .{ .kind = .id_result, .quantifier = .required },
9938 .{ .kind = .id_scope, .quantifier = .required },
9939 .{ .kind = .group_operation, .quantifier = .required },
9940 .{ .kind = .id_ref, .quantifier = .required },
9941 },
9942 },
9943 .{
9944 .name = "OpGroupUMaxNonUniformAMD",
9945 .opcode = 5006,
9946 .operands = &.{
9947 .{ .kind = .id_result_type, .quantifier = .required },
9948 .{ .kind = .id_result, .quantifier = .required },
9949 .{ .kind = .id_scope, .quantifier = .required },
9950 .{ .kind = .group_operation, .quantifier = .required },
9951 .{ .kind = .id_ref, .quantifier = .required },
9952 },
9953 },
9954 .{
9955 .name = "OpGroupSMaxNonUniformAMD",
9956 .opcode = 5007,
9957 .operands = &.{
9958 .{ .kind = .id_result_type, .quantifier = .required },
9959 .{ .kind = .id_result, .quantifier = .required },
9960 .{ .kind = .id_scope, .quantifier = .required },
9961 .{ .kind = .group_operation, .quantifier = .required },
9962 .{ .kind = .id_ref, .quantifier = .required },
9963 },
9964 },
9965 .{
9966 .name = "OpFragmentMaskFetchAMD",
9967 .opcode = 5011,
9968 .operands = &.{
9969 .{ .kind = .id_result_type, .quantifier = .required },
9970 .{ .kind = .id_result, .quantifier = .required },
9971 .{ .kind = .id_ref, .quantifier = .required },
9972 .{ .kind = .id_ref, .quantifier = .required },
9973 },
9974 },
9975 .{
9976 .name = "OpFragmentFetchAMD",
9977 .opcode = 5012,
9978 .operands = &.{
9979 .{ .kind = .id_result_type, .quantifier = .required },
9980 .{ .kind = .id_result, .quantifier = .required },
9981 .{ .kind = .id_ref, .quantifier = .required },
9982 .{ .kind = .id_ref, .quantifier = .required },
9983 .{ .kind = .id_ref, .quantifier = .required },
9984 },
9985 },
9986 .{
9987 .name = "OpReadClockKHR",
9988 .opcode = 5056,
9989 .operands = &.{
9990 .{ .kind = .id_result_type, .quantifier = .required },
9991 .{ .kind = .id_result, .quantifier = .required },
9992 .{ .kind = .id_scope, .quantifier = .required },
9993 },
9994 },
9995 .{
9996 .name = "OpAllocateNodePayloadsAMDX",
9997 .opcode = 5074,
9998 .operands = &.{
9999 .{ .kind = .id_result_type, .quantifier = .required },
10000 .{ .kind = .id_result, .quantifier = .required },
10001 .{ .kind = .id_scope, .quantifier = .required },
10002 .{ .kind = .id_ref, .quantifier = .required },
10003 .{ .kind = .id_ref, .quantifier = .required },
10004 },
10005 },
10006 .{
10007 .name = "OpEnqueueNodePayloadsAMDX",
10008 .opcode = 5075,
10009 .operands = &.{
10010 .{ .kind = .id_ref, .quantifier = .required },
10011 },
10012 },
10013 .{
10014 .name = "OpTypeNodePayloadArrayAMDX",
10015 .opcode = 5076,
10016 .operands = &.{
10017 .{ .kind = .id_result, .quantifier = .required },
10018 .{ .kind = .id_ref, .quantifier = .required },
10019 },
10020 },
10021 .{
10022 .name = "OpFinishWritingNodePayloadAMDX",
10023 .opcode = 5078,
10024 .operands = &.{
10025 .{ .kind = .id_result_type, .quantifier = .required },
10026 .{ .kind = .id_result, .quantifier = .required },
10027 .{ .kind = .id_ref, .quantifier = .required },
10028 },
10029 },
10030 .{
10031 .name = "OpNodePayloadArrayLengthAMDX",
10032 .opcode = 5090,
10033 .operands = &.{
10034 .{ .kind = .id_result_type, .quantifier = .required },
10035 .{ .kind = .id_result, .quantifier = .required },
10036 .{ .kind = .id_ref, .quantifier = .required },
10037 },
10038 },
10039 .{
10040 .name = "OpIsNodePayloadValidAMDX",
10041 .opcode = 5101,
10042 .operands = &.{
10043 .{ .kind = .id_result_type, .quantifier = .required },
10044 .{ .kind = .id_result, .quantifier = .required },
10045 .{ .kind = .id_ref, .quantifier = .required },
10046 .{ .kind = .id_ref, .quantifier = .required },
10047 },
10048 },
10049 .{
10050 .name = "OpConstantStringAMDX",
10051 .opcode = 5103,
10052 .operands = &.{
10053 .{ .kind = .id_result, .quantifier = .required },
10054 .{ .kind = .literal_string, .quantifier = .required },
10055 },
10056 },
10057 .{
10058 .name = "OpSpecConstantStringAMDX",
10059 .opcode = 5104,
10060 .operands = &.{
10061 .{ .kind = .id_result, .quantifier = .required },
10062 .{ .kind = .literal_string, .quantifier = .required },
10063 },
10064 },
10065 .{
10066 .name = "OpGroupNonUniformQuadAllKHR",
10067 .opcode = 5110,
10068 .operands = &.{
10069 .{ .kind = .id_result_type, .quantifier = .required },
10070 .{ .kind = .id_result, .quantifier = .required },
10071 .{ .kind = .id_ref, .quantifier = .required },
10072 },
10073 },
10074 .{
10075 .name = "OpGroupNonUniformQuadAnyKHR",
10076 .opcode = 5111,
10077 .operands = &.{
10078 .{ .kind = .id_result_type, .quantifier = .required },
10079 .{ .kind = .id_result, .quantifier = .required },
10080 .{ .kind = .id_ref, .quantifier = .required },
10081 },
10082 },
10083 .{
10084 .name = "OpHitObjectRecordHitMotionNV",
10085 .opcode = 5249,
10086 .operands = &.{
10087 .{ .kind = .id_ref, .quantifier = .required },
10088 .{ .kind = .id_ref, .quantifier = .required },
10089 .{ .kind = .id_ref, .quantifier = .required },
10090 .{ .kind = .id_ref, .quantifier = .required },
10091 .{ .kind = .id_ref, .quantifier = .required },
10092 .{ .kind = .id_ref, .quantifier = .required },
10093 .{ .kind = .id_ref, .quantifier = .required },
10094 .{ .kind = .id_ref, .quantifier = .required },
10095 .{ .kind = .id_ref, .quantifier = .required },
10096 .{ .kind = .id_ref, .quantifier = .required },
10097 .{ .kind = .id_ref, .quantifier = .required },
10098 .{ .kind = .id_ref, .quantifier = .required },
10099 .{ .kind = .id_ref, .quantifier = .required },
10100 .{ .kind = .id_ref, .quantifier = .required },
10101 },
10102 },
10103 .{
10104 .name = "OpHitObjectRecordHitWithIndexMotionNV",
10105 .opcode = 5250,
10106 .operands = &.{
10107 .{ .kind = .id_ref, .quantifier = .required },
10108 .{ .kind = .id_ref, .quantifier = .required },
10109 .{ .kind = .id_ref, .quantifier = .required },
10110 .{ .kind = .id_ref, .quantifier = .required },
10111 .{ .kind = .id_ref, .quantifier = .required },
10112 .{ .kind = .id_ref, .quantifier = .required },
10113 .{ .kind = .id_ref, .quantifier = .required },
10114 .{ .kind = .id_ref, .quantifier = .required },
10115 .{ .kind = .id_ref, .quantifier = .required },
10116 .{ .kind = .id_ref, .quantifier = .required },
10117 .{ .kind = .id_ref, .quantifier = .required },
10118 .{ .kind = .id_ref, .quantifier = .required },
10119 .{ .kind = .id_ref, .quantifier = .required },
10120 },
10121 },
10122 .{
10123 .name = "OpHitObjectRecordMissMotionNV",
10124 .opcode = 5251,
10125 .operands = &.{
10126 .{ .kind = .id_ref, .quantifier = .required },
10127 .{ .kind = .id_ref, .quantifier = .required },
10128 .{ .kind = .id_ref, .quantifier = .required },
10129 .{ .kind = .id_ref, .quantifier = .required },
10130 .{ .kind = .id_ref, .quantifier = .required },
10131 .{ .kind = .id_ref, .quantifier = .required },
10132 .{ .kind = .id_ref, .quantifier = .required },
10133 },
10134 },
10135 .{
10136 .name = "OpHitObjectGetWorldToObjectNV",
10137 .opcode = 5252,
10138 .operands = &.{
10139 .{ .kind = .id_result_type, .quantifier = .required },
10140 .{ .kind = .id_result, .quantifier = .required },
10141 .{ .kind = .id_ref, .quantifier = .required },
10142 },
10143 },
10144 .{
10145 .name = "OpHitObjectGetObjectToWorldNV",
10146 .opcode = 5253,
10147 .operands = &.{
10148 .{ .kind = .id_result_type, .quantifier = .required },
10149 .{ .kind = .id_result, .quantifier = .required },
10150 .{ .kind = .id_ref, .quantifier = .required },
10151 },
10152 },
10153 .{
10154 .name = "OpHitObjectGetObjectRayDirectionNV",
10155 .opcode = 5254,
10156 .operands = &.{
10157 .{ .kind = .id_result_type, .quantifier = .required },
10158 .{ .kind = .id_result, .quantifier = .required },
10159 .{ .kind = .id_ref, .quantifier = .required },
10160 },
10161 },
10162 .{
10163 .name = "OpHitObjectGetObjectRayOriginNV",
10164 .opcode = 5255,
10165 .operands = &.{
10166 .{ .kind = .id_result_type, .quantifier = .required },
10167 .{ .kind = .id_result, .quantifier = .required },
10168 .{ .kind = .id_ref, .quantifier = .required },
10169 },
10170 },
10171 .{
10172 .name = "OpHitObjectTraceRayMotionNV",
10173 .opcode = 5256,
10174 .operands = &.{
10175 .{ .kind = .id_ref, .quantifier = .required },
10176 .{ .kind = .id_ref, .quantifier = .required },
10177 .{ .kind = .id_ref, .quantifier = .required },
10178 .{ .kind = .id_ref, .quantifier = .required },
10179 .{ .kind = .id_ref, .quantifier = .required },
10180 .{ .kind = .id_ref, .quantifier = .required },
10181 .{ .kind = .id_ref, .quantifier = .required },
10182 .{ .kind = .id_ref, .quantifier = .required },
10183 .{ .kind = .id_ref, .quantifier = .required },
10184 .{ .kind = .id_ref, .quantifier = .required },
10185 .{ .kind = .id_ref, .quantifier = .required },
10186 .{ .kind = .id_ref, .quantifier = .required },
10187 .{ .kind = .id_ref, .quantifier = .required },
10188 },
10189 },
10190 .{
10191 .name = "OpHitObjectGetShaderRecordBufferHandleNV",
10192 .opcode = 5257,
10193 .operands = &.{
10194 .{ .kind = .id_result_type, .quantifier = .required },
10195 .{ .kind = .id_result, .quantifier = .required },
10196 .{ .kind = .id_ref, .quantifier = .required },
10197 },
10198 },
10199 .{
10200 .name = "OpHitObjectGetShaderBindingTableRecordIndexNV",
10201 .opcode = 5258,
10202 .operands = &.{
10203 .{ .kind = .id_result_type, .quantifier = .required },
10204 .{ .kind = .id_result, .quantifier = .required },
10205 .{ .kind = .id_ref, .quantifier = .required },
10206 },
10207 },
10208 .{
10209 .name = "OpHitObjectRecordEmptyNV",
10210 .opcode = 5259,
10211 .operands = &.{
10212 .{ .kind = .id_ref, .quantifier = .required },
10213 },
10214 },
10215 .{
10216 .name = "OpHitObjectTraceRayNV",
10217 .opcode = 5260,
10218 .operands = &.{
10219 .{ .kind = .id_ref, .quantifier = .required },
10220 .{ .kind = .id_ref, .quantifier = .required },
10221 .{ .kind = .id_ref, .quantifier = .required },
10222 .{ .kind = .id_ref, .quantifier = .required },
10223 .{ .kind = .id_ref, .quantifier = .required },
10224 .{ .kind = .id_ref, .quantifier = .required },
10225 .{ .kind = .id_ref, .quantifier = .required },
10226 .{ .kind = .id_ref, .quantifier = .required },
10227 .{ .kind = .id_ref, .quantifier = .required },
10228 .{ .kind = .id_ref, .quantifier = .required },
10229 .{ .kind = .id_ref, .quantifier = .required },
10230 .{ .kind = .id_ref, .quantifier = .required },
10231 },
10232 },
10233 .{
10234 .name = "OpHitObjectRecordHitNV",
10235 .opcode = 5261,
10236 .operands = &.{
10237 .{ .kind = .id_ref, .quantifier = .required },
10238 .{ .kind = .id_ref, .quantifier = .required },
10239 .{ .kind = .id_ref, .quantifier = .required },
10240 .{ .kind = .id_ref, .quantifier = .required },
10241 .{ .kind = .id_ref, .quantifier = .required },
10242 .{ .kind = .id_ref, .quantifier = .required },
10243 .{ .kind = .id_ref, .quantifier = .required },
10244 .{ .kind = .id_ref, .quantifier = .required },
10245 .{ .kind = .id_ref, .quantifier = .required },
10246 .{ .kind = .id_ref, .quantifier = .required },
10247 .{ .kind = .id_ref, .quantifier = .required },
10248 .{ .kind = .id_ref, .quantifier = .required },
10249 .{ .kind = .id_ref, .quantifier = .required },
10250 },
10251 },
10252 .{
10253 .name = "OpHitObjectRecordHitWithIndexNV",
10254 .opcode = 5262,
10255 .operands = &.{
10256 .{ .kind = .id_ref, .quantifier = .required },
10257 .{ .kind = .id_ref, .quantifier = .required },
10258 .{ .kind = .id_ref, .quantifier = .required },
10259 .{ .kind = .id_ref, .quantifier = .required },
10260 .{ .kind = .id_ref, .quantifier = .required },
10261 .{ .kind = .id_ref, .quantifier = .required },
10262 .{ .kind = .id_ref, .quantifier = .required },
10263 .{ .kind = .id_ref, .quantifier = .required },
10264 .{ .kind = .id_ref, .quantifier = .required },
10265 .{ .kind = .id_ref, .quantifier = .required },
10266 .{ .kind = .id_ref, .quantifier = .required },
10267 .{ .kind = .id_ref, .quantifier = .required },
10268 },
10269 },
10270 .{
10271 .name = "OpHitObjectRecordMissNV",
10272 .opcode = 5263,
10273 .operands = &.{
10274 .{ .kind = .id_ref, .quantifier = .required },
10275 .{ .kind = .id_ref, .quantifier = .required },
10276 .{ .kind = .id_ref, .quantifier = .required },
10277 .{ .kind = .id_ref, .quantifier = .required },
10278 .{ .kind = .id_ref, .quantifier = .required },
10279 .{ .kind = .id_ref, .quantifier = .required },
10280 },
10281 },
10282 .{
10283 .name = "OpHitObjectExecuteShaderNV",
10284 .opcode = 5264,
10285 .operands = &.{
10286 .{ .kind = .id_ref, .quantifier = .required },
10287 .{ .kind = .id_ref, .quantifier = .required },
10288 },
10289 },
10290 .{
10291 .name = "OpHitObjectGetCurrentTimeNV",
10292 .opcode = 5265,
10293 .operands = &.{
10294 .{ .kind = .id_result_type, .quantifier = .required },
10295 .{ .kind = .id_result, .quantifier = .required },
10296 .{ .kind = .id_ref, .quantifier = .required },
10297 },
10298 },
10299 .{
10300 .name = "OpHitObjectGetAttributesNV",
10301 .opcode = 5266,
10302 .operands = &.{
10303 .{ .kind = .id_ref, .quantifier = .required },
10304 .{ .kind = .id_ref, .quantifier = .required },
10305 },
10306 },
10307 .{
10308 .name = "OpHitObjectGetHitKindNV",
10309 .opcode = 5267,
10310 .operands = &.{
10311 .{ .kind = .id_result_type, .quantifier = .required },
10312 .{ .kind = .id_result, .quantifier = .required },
10313 .{ .kind = .id_ref, .quantifier = .required },
10314 },
10315 },
10316 .{
10317 .name = "OpHitObjectGetPrimitiveIndexNV",
10318 .opcode = 5268,
10319 .operands = &.{
10320 .{ .kind = .id_result_type, .quantifier = .required },
10321 .{ .kind = .id_result, .quantifier = .required },
10322 .{ .kind = .id_ref, .quantifier = .required },
10323 },
10324 },
10325 .{
10326 .name = "OpHitObjectGetGeometryIndexNV",
10327 .opcode = 5269,
10328 .operands = &.{
10329 .{ .kind = .id_result_type, .quantifier = .required },
10330 .{ .kind = .id_result, .quantifier = .required },
10331 .{ .kind = .id_ref, .quantifier = .required },
10332 },
10333 },
10334 .{
10335 .name = "OpHitObjectGetInstanceIdNV",
10336 .opcode = 5270,
10337 .operands = &.{
10338 .{ .kind = .id_result_type, .quantifier = .required },
10339 .{ .kind = .id_result, .quantifier = .required },
10340 .{ .kind = .id_ref, .quantifier = .required },
10341 },
10342 },
10343 .{
10344 .name = "OpHitObjectGetInstanceCustomIndexNV",
10345 .opcode = 5271,
10346 .operands = &.{
10347 .{ .kind = .id_result_type, .quantifier = .required },
10348 .{ .kind = .id_result, .quantifier = .required },
10349 .{ .kind = .id_ref, .quantifier = .required },
10350 },
10351 },
10352 .{
10353 .name = "OpHitObjectGetWorldRayDirectionNV",
10354 .opcode = 5272,
10355 .operands = &.{
10356 .{ .kind = .id_result_type, .quantifier = .required },
10357 .{ .kind = .id_result, .quantifier = .required },
10358 .{ .kind = .id_ref, .quantifier = .required },
10359 },
10360 },
10361 .{
10362 .name = "OpHitObjectGetWorldRayOriginNV",
10363 .opcode = 5273,
10364 .operands = &.{
10365 .{ .kind = .id_result_type, .quantifier = .required },
10366 .{ .kind = .id_result, .quantifier = .required },
10367 .{ .kind = .id_ref, .quantifier = .required },
10368 },
10369 },
10370 .{
10371 .name = "OpHitObjectGetRayTMaxNV",
10372 .opcode = 5274,
10373 .operands = &.{
10374 .{ .kind = .id_result_type, .quantifier = .required },
10375 .{ .kind = .id_result, .quantifier = .required },
10376 .{ .kind = .id_ref, .quantifier = .required },
10377 },
10378 },
10379 .{
10380 .name = "OpHitObjectGetRayTMinNV",
10381 .opcode = 5275,
10382 .operands = &.{
10383 .{ .kind = .id_result_type, .quantifier = .required },
10384 .{ .kind = .id_result, .quantifier = .required },
10385 .{ .kind = .id_ref, .quantifier = .required },
10386 },
10387 },
10388 .{
10389 .name = "OpHitObjectIsEmptyNV",
10390 .opcode = 5276,
10391 .operands = &.{
10392 .{ .kind = .id_result_type, .quantifier = .required },
10393 .{ .kind = .id_result, .quantifier = .required },
10394 .{ .kind = .id_ref, .quantifier = .required },
10395 },
10396 },
10397 .{
10398 .name = "OpHitObjectIsHitNV",
10399 .opcode = 5277,
10400 .operands = &.{
10401 .{ .kind = .id_result_type, .quantifier = .required },
10402 .{ .kind = .id_result, .quantifier = .required },
10403 .{ .kind = .id_ref, .quantifier = .required },
10404 },
10405 },
10406 .{
10407 .name = "OpHitObjectIsMissNV",
10408 .opcode = 5278,
10409 .operands = &.{
10410 .{ .kind = .id_result_type, .quantifier = .required },
10411 .{ .kind = .id_result, .quantifier = .required },
10412 .{ .kind = .id_ref, .quantifier = .required },
10413 },
10414 },
10415 .{
10416 .name = "OpReorderThreadWithHitObjectNV",
10417 .opcode = 5279,
10418 .operands = &.{
10419 .{ .kind = .id_ref, .quantifier = .required },
10420 .{ .kind = .id_ref, .quantifier = .optional },
10421 .{ .kind = .id_ref, .quantifier = .optional },
10422 },
10423 },
10424 .{
10425 .name = "OpReorderThreadWithHintNV",
10426 .opcode = 5280,
10427 .operands = &.{
10428 .{ .kind = .id_ref, .quantifier = .required },
10429 .{ .kind = .id_ref, .quantifier = .required },
10430 },
10431 },
10432 .{
10433 .name = "OpTypeHitObjectNV",
10434 .opcode = 5281,
10435 .operands = &.{
10436 .{ .kind = .id_result, .quantifier = .required },
10437 },
10438 },
10439 .{
10440 .name = "OpImageSampleFootprintNV",
10441 .opcode = 5283,
10442 .operands = &.{
10443 .{ .kind = .id_result_type, .quantifier = .required },
10444 .{ .kind = .id_result, .quantifier = .required },
10445 .{ .kind = .id_ref, .quantifier = .required },
10446 .{ .kind = .id_ref, .quantifier = .required },
10447 .{ .kind = .id_ref, .quantifier = .required },
10448 .{ .kind = .id_ref, .quantifier = .required },
10449 .{ .kind = .image_operands, .quantifier = .optional },
10450 },
10451 },
10452 .{
10453 .name = "OpTypeCooperativeVectorNV",
10454 .opcode = 5288,
10455 .operands = &.{
10456 .{ .kind = .id_result, .quantifier = .required },
10457 .{ .kind = .id_ref, .quantifier = .required },
10458 .{ .kind = .id_ref, .quantifier = .required },
10459 },
10460 },
10461 .{
10462 .name = "OpCooperativeVectorMatrixMulNV",
10463 .opcode = 5289,
10464 .operands = &.{
10465 .{ .kind = .id_result_type, .quantifier = .required },
10466 .{ .kind = .id_result, .quantifier = .required },
10467 .{ .kind = .id_ref, .quantifier = .required },
10468 .{ .kind = .id_ref, .quantifier = .required },
10469 .{ .kind = .id_ref, .quantifier = .required },
10470 .{ .kind = .id_ref, .quantifier = .required },
10471 .{ .kind = .id_ref, .quantifier = .required },
10472 .{ .kind = .id_ref, .quantifier = .required },
10473 .{ .kind = .id_ref, .quantifier = .required },
10474 .{ .kind = .id_ref, .quantifier = .required },
10475 .{ .kind = .id_ref, .quantifier = .required },
10476 .{ .kind = .id_ref, .quantifier = .optional },
10477 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10478 },
10479 },
10480 .{
10481 .name = "OpCooperativeVectorOuterProductAccumulateNV",
10482 .opcode = 5290,
10483 .operands = &.{
10484 .{ .kind = .id_ref, .quantifier = .required },
10485 .{ .kind = .id_ref, .quantifier = .required },
10486 .{ .kind = .id_ref, .quantifier = .required },
10487 .{ .kind = .id_ref, .quantifier = .required },
10488 .{ .kind = .id_ref, .quantifier = .required },
10489 .{ .kind = .id_ref, .quantifier = .required },
10490 .{ .kind = .id_ref, .quantifier = .optional },
10491 },
10492 },
10493 .{
10494 .name = "OpCooperativeVectorReduceSumAccumulateNV",
10495 .opcode = 5291,
10496 .operands = &.{
10497 .{ .kind = .id_ref, .quantifier = .required },
10498 .{ .kind = .id_ref, .quantifier = .required },
10499 .{ .kind = .id_ref, .quantifier = .required },
10500 },
10501 },
10502 .{
10503 .name = "OpCooperativeVectorMatrixMulAddNV",
10504 .opcode = 5292,
10505 .operands = &.{
10506 .{ .kind = .id_result_type, .quantifier = .required },
10507 .{ .kind = .id_result, .quantifier = .required },
10508 .{ .kind = .id_ref, .quantifier = .required },
10509 .{ .kind = .id_ref, .quantifier = .required },
10510 .{ .kind = .id_ref, .quantifier = .required },
10511 .{ .kind = .id_ref, .quantifier = .required },
10512 .{ .kind = .id_ref, .quantifier = .required },
10513 .{ .kind = .id_ref, .quantifier = .required },
10514 .{ .kind = .id_ref, .quantifier = .required },
10515 .{ .kind = .id_ref, .quantifier = .required },
10516 .{ .kind = .id_ref, .quantifier = .required },
10517 .{ .kind = .id_ref, .quantifier = .required },
10518 .{ .kind = .id_ref, .quantifier = .required },
10519 .{ .kind = .id_ref, .quantifier = .required },
10520 .{ .kind = .id_ref, .quantifier = .optional },
10521 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10522 },
10523 },
10524 .{
10525 .name = "OpCooperativeMatrixConvertNV",
10526 .opcode = 5293,
10527 .operands = &.{
10528 .{ .kind = .id_result_type, .quantifier = .required },
10529 .{ .kind = .id_result, .quantifier = .required },
10530 .{ .kind = .id_ref, .quantifier = .required },
10531 },
10532 },
10533 .{
10534 .name = "OpEmitMeshTasksEXT",
10535 .opcode = 5294,
10536 .operands = &.{
10537 .{ .kind = .id_ref, .quantifier = .required },
10538 .{ .kind = .id_ref, .quantifier = .required },
10539 .{ .kind = .id_ref, .quantifier = .required },
10540 .{ .kind = .id_ref, .quantifier = .optional },
10541 },
10542 },
10543 .{
10544 .name = "OpSetMeshOutputsEXT",
10545 .opcode = 5295,
10546 .operands = &.{
10547 .{ .kind = .id_ref, .quantifier = .required },
10548 .{ .kind = .id_ref, .quantifier = .required },
10549 },
10550 },
10551 .{
10552 .name = "OpGroupNonUniformPartitionNV",
10553 .opcode = 5296,
10554 .operands = &.{
10555 .{ .kind = .id_result_type, .quantifier = .required },
10556 .{ .kind = .id_result, .quantifier = .required },
10557 .{ .kind = .id_ref, .quantifier = .required },
10558 },
10559 },
10560 .{
10561 .name = "OpWritePackedPrimitiveIndices4x8NV",
10562 .opcode = 5299,
10563 .operands = &.{
10564 .{ .kind = .id_ref, .quantifier = .required },
10565 .{ .kind = .id_ref, .quantifier = .required },
10566 },
10567 },
10568 .{
10569 .name = "OpFetchMicroTriangleVertexPositionNV",
10570 .opcode = 5300,
10571 .operands = &.{
10572 .{ .kind = .id_result_type, .quantifier = .required },
10573 .{ .kind = .id_result, .quantifier = .required },
10574 .{ .kind = .id_ref, .quantifier = .required },
10575 .{ .kind = .id_ref, .quantifier = .required },
10576 .{ .kind = .id_ref, .quantifier = .required },
10577 .{ .kind = .id_ref, .quantifier = .required },
10578 .{ .kind = .id_ref, .quantifier = .required },
10579 },
10580 },
10581 .{
10582 .name = "OpFetchMicroTriangleVertexBarycentricNV",
10583 .opcode = 5301,
10584 .operands = &.{
10585 .{ .kind = .id_result_type, .quantifier = .required },
10586 .{ .kind = .id_result, .quantifier = .required },
10587 .{ .kind = .id_ref, .quantifier = .required },
10588 .{ .kind = .id_ref, .quantifier = .required },
10589 .{ .kind = .id_ref, .quantifier = .required },
10590 .{ .kind = .id_ref, .quantifier = .required },
10591 .{ .kind = .id_ref, .quantifier = .required },
10592 },
10593 },
10594 .{
10595 .name = "OpCooperativeVectorLoadNV",
10596 .opcode = 5302,
10597 .operands = &.{
10598 .{ .kind = .id_result_type, .quantifier = .required },
10599 .{ .kind = .id_result, .quantifier = .required },
10600 .{ .kind = .id_ref, .quantifier = .required },
10601 .{ .kind = .id_ref, .quantifier = .required },
10602 .{ .kind = .memory_access, .quantifier = .optional },
10603 },
10604 },
10605 .{
10606 .name = "OpCooperativeVectorStoreNV",
10607 .opcode = 5303,
10608 .operands = &.{
10609 .{ .kind = .id_ref, .quantifier = .required },
10610 .{ .kind = .id_ref, .quantifier = .required },
10611 .{ .kind = .id_ref, .quantifier = .required },
10612 .{ .kind = .memory_access, .quantifier = .optional },
10613 },
10614 },
10615 .{
10616 .name = "OpReportIntersectionKHR",
10617 .opcode = 5334,
10618 .operands = &.{
10619 .{ .kind = .id_result_type, .quantifier = .required },
10620 .{ .kind = .id_result, .quantifier = .required },
10621 .{ .kind = .id_ref, .quantifier = .required },
10622 .{ .kind = .id_ref, .quantifier = .required },
10623 },
10624 },
10625 .{
10626 .name = "OpIgnoreIntersectionNV",
10627 .opcode = 5335,
10628 .operands = &.{},
10629 },
10630 .{
10631 .name = "OpTerminateRayNV",
10632 .opcode = 5336,
10633 .operands = &.{},
10634 },
10635 .{
10636 .name = "OpTraceNV",
10637 .opcode = 5337,
10638 .operands = &.{
10639 .{ .kind = .id_ref, .quantifier = .required },
10640 .{ .kind = .id_ref, .quantifier = .required },
10641 .{ .kind = .id_ref, .quantifier = .required },
10642 .{ .kind = .id_ref, .quantifier = .required },
10643 .{ .kind = .id_ref, .quantifier = .required },
10644 .{ .kind = .id_ref, .quantifier = .required },
10645 .{ .kind = .id_ref, .quantifier = .required },
10646 .{ .kind = .id_ref, .quantifier = .required },
10647 .{ .kind = .id_ref, .quantifier = .required },
10648 .{ .kind = .id_ref, .quantifier = .required },
10649 .{ .kind = .id_ref, .quantifier = .required },
10650 },
10651 },
10652 .{
10653 .name = "OpTraceMotionNV",
10654 .opcode = 5338,
10655 .operands = &.{
10656 .{ .kind = .id_ref, .quantifier = .required },
10657 .{ .kind = .id_ref, .quantifier = .required },
10658 .{ .kind = .id_ref, .quantifier = .required },
10659 .{ .kind = .id_ref, .quantifier = .required },
10660 .{ .kind = .id_ref, .quantifier = .required },
10661 .{ .kind = .id_ref, .quantifier = .required },
10662 .{ .kind = .id_ref, .quantifier = .required },
10663 .{ .kind = .id_ref, .quantifier = .required },
10664 .{ .kind = .id_ref, .quantifier = .required },
10665 .{ .kind = .id_ref, .quantifier = .required },
10666 .{ .kind = .id_ref, .quantifier = .required },
10667 .{ .kind = .id_ref, .quantifier = .required },
10668 },
10669 },
10670 .{
10671 .name = "OpTraceRayMotionNV",
10672 .opcode = 5339,
10673 .operands = &.{
10674 .{ .kind = .id_ref, .quantifier = .required },
10675 .{ .kind = .id_ref, .quantifier = .required },
10676 .{ .kind = .id_ref, .quantifier = .required },
10677 .{ .kind = .id_ref, .quantifier = .required },
10678 .{ .kind = .id_ref, .quantifier = .required },
10679 .{ .kind = .id_ref, .quantifier = .required },
10680 .{ .kind = .id_ref, .quantifier = .required },
10681 .{ .kind = .id_ref, .quantifier = .required },
10682 .{ .kind = .id_ref, .quantifier = .required },
10683 .{ .kind = .id_ref, .quantifier = .required },
10684 .{ .kind = .id_ref, .quantifier = .required },
10685 .{ .kind = .id_ref, .quantifier = .required },
10686 },
10687 },
10688 .{
10689 .name = "OpRayQueryGetIntersectionTriangleVertexPositionsKHR",
10690 .opcode = 5340,
10691 .operands = &.{
10692 .{ .kind = .id_result_type, .quantifier = .required },
10693 .{ .kind = .id_result, .quantifier = .required },
10694 .{ .kind = .id_ref, .quantifier = .required },
10695 .{ .kind = .id_ref, .quantifier = .required },
10696 },
10697 },
10698 .{
10699 .name = "OpTypeAccelerationStructureKHR",
10700 .opcode = 5341,
10701 .operands = &.{
10702 .{ .kind = .id_result, .quantifier = .required },
10703 },
10704 },
10705 .{
10706 .name = "OpExecuteCallableNV",
10707 .opcode = 5344,
10708 .operands = &.{
10709 .{ .kind = .id_ref, .quantifier = .required },
10710 .{ .kind = .id_ref, .quantifier = .required },
10711 },
10712 },
10713 .{
10714 .name = "OpRayQueryGetClusterIdNV",
10715 .opcode = 5345,
10716 .operands = &.{
10717 .{ .kind = .id_result_type, .quantifier = .required },
10718 .{ .kind = .id_result, .quantifier = .required },
10719 .{ .kind = .id_ref, .quantifier = .required },
10720 .{ .kind = .id_ref, .quantifier = .required },
10721 },
10722 },
10723 .{
10724 .name = "OpHitObjectGetClusterIdNV",
10725 .opcode = 5346,
10726 .operands = &.{
10727 .{ .kind = .id_result_type, .quantifier = .required },
10728 .{ .kind = .id_result, .quantifier = .required },
10729 .{ .kind = .id_ref, .quantifier = .required },
10730 },
10731 },
10732 .{
10733 .name = "OpTypeCooperativeMatrixNV",
10734 .opcode = 5358,
10735 .operands = &.{
10736 .{ .kind = .id_result, .quantifier = .required },
10737 .{ .kind = .id_ref, .quantifier = .required },
10738 .{ .kind = .id_scope, .quantifier = .required },
10739 .{ .kind = .id_ref, .quantifier = .required },
10740 .{ .kind = .id_ref, .quantifier = .required },
10741 },
10742 },
10743 .{
10744 .name = "OpCooperativeMatrixLoadNV",
10745 .opcode = 5359,
10746 .operands = &.{
10747 .{ .kind = .id_result_type, .quantifier = .required },
10748 .{ .kind = .id_result, .quantifier = .required },
10749 .{ .kind = .id_ref, .quantifier = .required },
10750 .{ .kind = .id_ref, .quantifier = .required },
10751 .{ .kind = .id_ref, .quantifier = .required },
10752 .{ .kind = .memory_access, .quantifier = .optional },
10753 },
10754 },
10755 .{
10756 .name = "OpCooperativeMatrixStoreNV",
10757 .opcode = 5360,
10758 .operands = &.{
10759 .{ .kind = .id_ref, .quantifier = .required },
10760 .{ .kind = .id_ref, .quantifier = .required },
10761 .{ .kind = .id_ref, .quantifier = .required },
10762 .{ .kind = .id_ref, .quantifier = .required },
10763 .{ .kind = .memory_access, .quantifier = .optional },
10764 },
10765 },
10766 .{
10767 .name = "OpCooperativeMatrixMulAddNV",
10768 .opcode = 5361,
10769 .operands = &.{
10770 .{ .kind = .id_result_type, .quantifier = .required },
10771 .{ .kind = .id_result, .quantifier = .required },
10772 .{ .kind = .id_ref, .quantifier = .required },
10773 .{ .kind = .id_ref, .quantifier = .required },
10774 .{ .kind = .id_ref, .quantifier = .required },
10775 },
10776 },
10777 .{
10778 .name = "OpCooperativeMatrixLengthNV",
10779 .opcode = 5362,
10780 .operands = &.{
10781 .{ .kind = .id_result_type, .quantifier = .required },
10782 .{ .kind = .id_result, .quantifier = .required },
10783 .{ .kind = .id_ref, .quantifier = .required },
10784 },
10785 },
10786 .{
10787 .name = "OpBeginInvocationInterlockEXT",
10788 .opcode = 5364,
10789 .operands = &.{},
10790 },
10791 .{
10792 .name = "OpEndInvocationInterlockEXT",
10793 .opcode = 5365,
10794 .operands = &.{},
10795 },
10796 .{
10797 .name = "OpCooperativeMatrixReduceNV",
10798 .opcode = 5366,
10799 .operands = &.{
10800 .{ .kind = .id_result_type, .quantifier = .required },
10801 .{ .kind = .id_result, .quantifier = .required },
10802 .{ .kind = .id_ref, .quantifier = .required },
10803 .{ .kind = .cooperative_matrix_reduce, .quantifier = .required },
10804 .{ .kind = .id_ref, .quantifier = .required },
10805 },
10806 },
10807 .{
10808 .name = "OpCooperativeMatrixLoadTensorNV",
10809 .opcode = 5367,
10810 .operands = &.{
10811 .{ .kind = .id_result_type, .quantifier = .required },
10812 .{ .kind = .id_result, .quantifier = .required },
10813 .{ .kind = .id_ref, .quantifier = .required },
10814 .{ .kind = .id_ref, .quantifier = .required },
10815 .{ .kind = .id_ref, .quantifier = .required },
10816 .{ .kind = .memory_access, .quantifier = .required },
10817 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10818 },
10819 },
10820 .{
10821 .name = "OpCooperativeMatrixStoreTensorNV",
10822 .opcode = 5368,
10823 .operands = &.{
10824 .{ .kind = .id_ref, .quantifier = .required },
10825 .{ .kind = .id_ref, .quantifier = .required },
10826 .{ .kind = .id_ref, .quantifier = .required },
10827 .{ .kind = .memory_access, .quantifier = .required },
10828 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10829 },
10830 },
10831 .{
10832 .name = "OpCooperativeMatrixPerElementOpNV",
10833 .opcode = 5369,
10834 .operands = &.{
10835 .{ .kind = .id_result_type, .quantifier = .required },
10836 .{ .kind = .id_result, .quantifier = .required },
10837 .{ .kind = .id_ref, .quantifier = .required },
10838 .{ .kind = .id_ref, .quantifier = .required },
10839 .{ .kind = .id_ref, .quantifier = .variadic },
10840 },
10841 },
10842 .{
10843 .name = "OpTypeTensorLayoutNV",
10844 .opcode = 5370,
10845 .operands = &.{
10846 .{ .kind = .id_result, .quantifier = .required },
10847 .{ .kind = .id_ref, .quantifier = .required },
10848 .{ .kind = .id_ref, .quantifier = .required },
10849 },
10850 },
10851 .{
10852 .name = "OpTypeTensorViewNV",
10853 .opcode = 5371,
10854 .operands = &.{
10855 .{ .kind = .id_result, .quantifier = .required },
10856 .{ .kind = .id_ref, .quantifier = .required },
10857 .{ .kind = .id_ref, .quantifier = .required },
10858 .{ .kind = .id_ref, .quantifier = .variadic },
10859 },
10860 },
10861 .{
10862 .name = "OpCreateTensorLayoutNV",
10863 .opcode = 5372,
10864 .operands = &.{
10865 .{ .kind = .id_result_type, .quantifier = .required },
10866 .{ .kind = .id_result, .quantifier = .required },
10867 },
10868 },
10869 .{
10870 .name = "OpTensorLayoutSetDimensionNV",
10871 .opcode = 5373,
10872 .operands = &.{
10873 .{ .kind = .id_result_type, .quantifier = .required },
10874 .{ .kind = .id_result, .quantifier = .required },
10875 .{ .kind = .id_ref, .quantifier = .required },
10876 .{ .kind = .id_ref, .quantifier = .variadic },
10877 },
10878 },
10879 .{
10880 .name = "OpTensorLayoutSetStrideNV",
10881 .opcode = 5374,
10882 .operands = &.{
10883 .{ .kind = .id_result_type, .quantifier = .required },
10884 .{ .kind = .id_result, .quantifier = .required },
10885 .{ .kind = .id_ref, .quantifier = .required },
10886 .{ .kind = .id_ref, .quantifier = .variadic },
10887 },
10888 },
10889 .{
10890 .name = "OpTensorLayoutSliceNV",
10891 .opcode = 5375,
10892 .operands = &.{
10893 .{ .kind = .id_result_type, .quantifier = .required },
10894 .{ .kind = .id_result, .quantifier = .required },
10895 .{ .kind = .id_ref, .quantifier = .required },
10896 .{ .kind = .id_ref, .quantifier = .variadic },
10897 },
10898 },
10899 .{
10900 .name = "OpTensorLayoutSetClampValueNV",
10901 .opcode = 5376,
10902 .operands = &.{
10903 .{ .kind = .id_result_type, .quantifier = .required },
10904 .{ .kind = .id_result, .quantifier = .required },
10905 .{ .kind = .id_ref, .quantifier = .required },
10906 .{ .kind = .id_ref, .quantifier = .required },
10907 },
10908 },
10909 .{
10910 .name = "OpCreateTensorViewNV",
10911 .opcode = 5377,
10912 .operands = &.{
10913 .{ .kind = .id_result_type, .quantifier = .required },
10914 .{ .kind = .id_result, .quantifier = .required },
10915 },
10916 },
10917 .{
10918 .name = "OpTensorViewSetDimensionNV",
10919 .opcode = 5378,
10920 .operands = &.{
10921 .{ .kind = .id_result_type, .quantifier = .required },
10922 .{ .kind = .id_result, .quantifier = .required },
10923 .{ .kind = .id_ref, .quantifier = .required },
10924 .{ .kind = .id_ref, .quantifier = .variadic },
10925 },
10926 },
10927 .{
10928 .name = "OpTensorViewSetStrideNV",
10929 .opcode = 5379,
10930 .operands = &.{
10931 .{ .kind = .id_result_type, .quantifier = .required },
10932 .{ .kind = .id_result, .quantifier = .required },
10933 .{ .kind = .id_ref, .quantifier = .required },
10934 .{ .kind = .id_ref, .quantifier = .variadic },
10935 },
10936 },
10937 .{
10938 .name = "OpDemoteToHelperInvocation",
10939 .opcode = 5380,
10940 .operands = &.{},
10941 },
10942 .{
10943 .name = "OpIsHelperInvocationEXT",
10944 .opcode = 5381,
10945 .operands = &.{
10946 .{ .kind = .id_result_type, .quantifier = .required },
10947 .{ .kind = .id_result, .quantifier = .required },
10948 },
10949 },
10950 .{
10951 .name = "OpTensorViewSetClipNV",
10952 .opcode = 5382,
10953 .operands = &.{
10954 .{ .kind = .id_result_type, .quantifier = .required },
10955 .{ .kind = .id_result, .quantifier = .required },
10956 .{ .kind = .id_ref, .quantifier = .required },
10957 .{ .kind = .id_ref, .quantifier = .required },
10958 .{ .kind = .id_ref, .quantifier = .required },
10959 .{ .kind = .id_ref, .quantifier = .required },
10960 .{ .kind = .id_ref, .quantifier = .required },
10961 },
10962 },
10963 .{
10964 .name = "OpTensorLayoutSetBlockSizeNV",
10965 .opcode = 5384,
10966 .operands = &.{
10967 .{ .kind = .id_result_type, .quantifier = .required },
10968 .{ .kind = .id_result, .quantifier = .required },
10969 .{ .kind = .id_ref, .quantifier = .required },
10970 .{ .kind = .id_ref, .quantifier = .variadic },
10971 },
10972 },
10973 .{
10974 .name = "OpCooperativeMatrixTransposeNV",
10975 .opcode = 5390,
10976 .operands = &.{
10977 .{ .kind = .id_result_type, .quantifier = .required },
10978 .{ .kind = .id_result, .quantifier = .required },
10979 .{ .kind = .id_ref, .quantifier = .required },
10980 },
10981 },
10982 .{
10983 .name = "OpConvertUToImageNV",
10984 .opcode = 5391,
10985 .operands = &.{
10986 .{ .kind = .id_result_type, .quantifier = .required },
10987 .{ .kind = .id_result, .quantifier = .required },
10988 .{ .kind = .id_ref, .quantifier = .required },
10989 },
10990 },
10991 .{
10992 .name = "OpConvertUToSamplerNV",
10993 .opcode = 5392,
10994 .operands = &.{
10995 .{ .kind = .id_result_type, .quantifier = .required },
10996 .{ .kind = .id_result, .quantifier = .required },
10997 .{ .kind = .id_ref, .quantifier = .required },
10998 },
10999 },
11000 .{
11001 .name = "OpConvertImageToUNV",
11002 .opcode = 5393,
11003 .operands = &.{
11004 .{ .kind = .id_result_type, .quantifier = .required },
11005 .{ .kind = .id_result, .quantifier = .required },
11006 .{ .kind = .id_ref, .quantifier = .required },
11007 },
11008 },
11009 .{
11010 .name = "OpConvertSamplerToUNV",
11011 .opcode = 5394,
11012 .operands = &.{
11013 .{ .kind = .id_result_type, .quantifier = .required },
11014 .{ .kind = .id_result, .quantifier = .required },
11015 .{ .kind = .id_ref, .quantifier = .required },
11016 },
11017 },
11018 .{
11019 .name = "OpConvertUToSampledImageNV",
11020 .opcode = 5395,
11021 .operands = &.{
11022 .{ .kind = .id_result_type, .quantifier = .required },
11023 .{ .kind = .id_result, .quantifier = .required },
11024 .{ .kind = .id_ref, .quantifier = .required },
11025 },
11026 },
11027 .{
11028 .name = "OpConvertSampledImageToUNV",
11029 .opcode = 5396,
11030 .operands = &.{
11031 .{ .kind = .id_result_type, .quantifier = .required },
11032 .{ .kind = .id_result, .quantifier = .required },
11033 .{ .kind = .id_ref, .quantifier = .required },
11034 },
11035 },
11036 .{
11037 .name = "OpSamplerImageAddressingModeNV",
11038 .opcode = 5397,
11039 .operands = &.{
11040 .{ .kind = .literal_integer, .quantifier = .required },
11041 },
11042 },
11043 .{
11044 .name = "OpRawAccessChainNV",
11045 .opcode = 5398,
11046 .operands = &.{
11047 .{ .kind = .id_result_type, .quantifier = .required },
11048 .{ .kind = .id_result, .quantifier = .required },
11049 .{ .kind = .id_ref, .quantifier = .required },
11050 .{ .kind = .id_ref, .quantifier = .required },
11051 .{ .kind = .id_ref, .quantifier = .required },
11052 .{ .kind = .id_ref, .quantifier = .required },
11053 .{ .kind = .raw_access_chain_operands, .quantifier = .optional },
11054 },
11055 },
11056 .{
11057 .name = "OpRayQueryGetIntersectionSpherePositionNV",
11058 .opcode = 5427,
11059 .operands = &.{
11060 .{ .kind = .id_result_type, .quantifier = .required },
11061 .{ .kind = .id_result, .quantifier = .required },
11062 .{ .kind = .id_ref, .quantifier = .required },
11063 .{ .kind = .id_ref, .quantifier = .required },
11064 },
11065 },
11066 .{
11067 .name = "OpRayQueryGetIntersectionSphereRadiusNV",
11068 .opcode = 5428,
11069 .operands = &.{
11070 .{ .kind = .id_result_type, .quantifier = .required },
11071 .{ .kind = .id_result, .quantifier = .required },
11072 .{ .kind = .id_ref, .quantifier = .required },
11073 .{ .kind = .id_ref, .quantifier = .required },
11074 },
11075 },
11076 .{
11077 .name = "OpRayQueryGetIntersectionLSSPositionsNV",
11078 .opcode = 5429,
11079 .operands = &.{
11080 .{ .kind = .id_result_type, .quantifier = .required },
11081 .{ .kind = .id_result, .quantifier = .required },
11082 .{ .kind = .id_ref, .quantifier = .required },
11083 .{ .kind = .id_ref, .quantifier = .required },
11084 },
11085 },
11086 .{
11087 .name = "OpRayQueryGetIntersectionLSSRadiiNV",
11088 .opcode = 5430,
11089 .operands = &.{
11090 .{ .kind = .id_result_type, .quantifier = .required },
11091 .{ .kind = .id_result, .quantifier = .required },
11092 .{ .kind = .id_ref, .quantifier = .required },
11093 .{ .kind = .id_ref, .quantifier = .required },
11094 },
11095 },
11096 .{
11097 .name = "OpRayQueryGetIntersectionLSSHitValueNV",
11098 .opcode = 5431,
11099 .operands = &.{
11100 .{ .kind = .id_result_type, .quantifier = .required },
11101 .{ .kind = .id_result, .quantifier = .required },
11102 .{ .kind = .id_ref, .quantifier = .required },
11103 .{ .kind = .id_ref, .quantifier = .required },
11104 },
11105 },
11106 .{
11107 .name = "OpHitObjectGetSpherePositionNV",
11108 .opcode = 5432,
11109 .operands = &.{
11110 .{ .kind = .id_result_type, .quantifier = .required },
11111 .{ .kind = .id_result, .quantifier = .required },
11112 .{ .kind = .id_ref, .quantifier = .required },
11113 },
11114 },
11115 .{
11116 .name = "OpHitObjectGetSphereRadiusNV",
11117 .opcode = 5433,
11118 .operands = &.{
11119 .{ .kind = .id_result_type, .quantifier = .required },
11120 .{ .kind = .id_result, .quantifier = .required },
11121 .{ .kind = .id_ref, .quantifier = .required },
11122 },
11123 },
11124 .{
11125 .name = "OpHitObjectGetLSSPositionsNV",
11126 .opcode = 5434,
11127 .operands = &.{
11128 .{ .kind = .id_result_type, .quantifier = .required },
11129 .{ .kind = .id_result, .quantifier = .required },
11130 .{ .kind = .id_ref, .quantifier = .required },
11131 },
11132 },
11133 .{
11134 .name = "OpHitObjectGetLSSRadiiNV",
11135 .opcode = 5435,
11136 .operands = &.{
11137 .{ .kind = .id_result_type, .quantifier = .required },
11138 .{ .kind = .id_result, .quantifier = .required },
11139 .{ .kind = .id_ref, .quantifier = .required },
11140 },
11141 },
11142 .{
11143 .name = "OpHitObjectIsSphereHitNV",
11144 .opcode = 5436,
11145 .operands = &.{
11146 .{ .kind = .id_result_type, .quantifier = .required },
11147 .{ .kind = .id_result, .quantifier = .required },
11148 .{ .kind = .id_ref, .quantifier = .required },
11149 },
11150 },
11151 .{
11152 .name = "OpHitObjectIsLSSHitNV",
11153 .opcode = 5437,
11154 .operands = &.{
11155 .{ .kind = .id_result_type, .quantifier = .required },
11156 .{ .kind = .id_result, .quantifier = .required },
11157 .{ .kind = .id_ref, .quantifier = .required },
11158 },
11159 },
11160 .{
11161 .name = "OpRayQueryIsSphereHitNV",
11162 .opcode = 5438,
11163 .operands = &.{
11164 .{ .kind = .id_result_type, .quantifier = .required },
11165 .{ .kind = .id_result, .quantifier = .required },
11166 .{ .kind = .id_ref, .quantifier = .required },
11167 .{ .kind = .id_ref, .quantifier = .required },
11168 },
11169 },
11170 .{
11171 .name = "OpRayQueryIsLSSHitNV",
11172 .opcode = 5439,
11173 .operands = &.{
11174 .{ .kind = .id_result_type, .quantifier = .required },
11175 .{ .kind = .id_result, .quantifier = .required },
11176 .{ .kind = .id_ref, .quantifier = .required },
11177 .{ .kind = .id_ref, .quantifier = .required },
11178 },
11179 },
11180 .{
11181 .name = "OpSubgroupShuffleINTEL",
11182 .opcode = 5571,
11183 .operands = &.{
11184 .{ .kind = .id_result_type, .quantifier = .required },
11185 .{ .kind = .id_result, .quantifier = .required },
11186 .{ .kind = .id_ref, .quantifier = .required },
11187 .{ .kind = .id_ref, .quantifier = .required },
11188 },
11189 },
11190 .{
11191 .name = "OpSubgroupShuffleDownINTEL",
11192 .opcode = 5572,
11193 .operands = &.{
11194 .{ .kind = .id_result_type, .quantifier = .required },
11195 .{ .kind = .id_result, .quantifier = .required },
11196 .{ .kind = .id_ref, .quantifier = .required },
11197 .{ .kind = .id_ref, .quantifier = .required },
11198 .{ .kind = .id_ref, .quantifier = .required },
11199 },
11200 },
11201 .{
11202 .name = "OpSubgroupShuffleUpINTEL",
11203 .opcode = 5573,
11204 .operands = &.{
11205 .{ .kind = .id_result_type, .quantifier = .required },
11206 .{ .kind = .id_result, .quantifier = .required },
11207 .{ .kind = .id_ref, .quantifier = .required },
11208 .{ .kind = .id_ref, .quantifier = .required },
11209 .{ .kind = .id_ref, .quantifier = .required },
11210 },
11211 },
11212 .{
11213 .name = "OpSubgroupShuffleXorINTEL",
11214 .opcode = 5574,
11215 .operands = &.{
11216 .{ .kind = .id_result_type, .quantifier = .required },
11217 .{ .kind = .id_result, .quantifier = .required },
11218 .{ .kind = .id_ref, .quantifier = .required },
11219 .{ .kind = .id_ref, .quantifier = .required },
11220 },
11221 },
11222 .{
11223 .name = "OpSubgroupBlockReadINTEL",
11224 .opcode = 5575,
11225 .operands = &.{
11226 .{ .kind = .id_result_type, .quantifier = .required },
11227 .{ .kind = .id_result, .quantifier = .required },
11228 .{ .kind = .id_ref, .quantifier = .required },
11229 },
11230 },
11231 .{
11232 .name = "OpSubgroupBlockWriteINTEL",
11233 .opcode = 5576,
11234 .operands = &.{
11235 .{ .kind = .id_ref, .quantifier = .required },
11236 .{ .kind = .id_ref, .quantifier = .required },
11237 },
11238 },
11239 .{
11240 .name = "OpSubgroupImageBlockReadINTEL",
11241 .opcode = 5577,
11242 .operands = &.{
11243 .{ .kind = .id_result_type, .quantifier = .required },
11244 .{ .kind = .id_result, .quantifier = .required },
11245 .{ .kind = .id_ref, .quantifier = .required },
11246 .{ .kind = .id_ref, .quantifier = .required },
11247 },
11248 },
11249 .{
11250 .name = "OpSubgroupImageBlockWriteINTEL",
11251 .opcode = 5578,
11252 .operands = &.{
11253 .{ .kind = .id_ref, .quantifier = .required },
11254 .{ .kind = .id_ref, .quantifier = .required },
11255 .{ .kind = .id_ref, .quantifier = .required },
11256 },
11257 },
11258 .{
11259 .name = "OpSubgroupImageMediaBlockReadINTEL",
11260 .opcode = 5580,
11261 .operands = &.{
11262 .{ .kind = .id_result_type, .quantifier = .required },
11263 .{ .kind = .id_result, .quantifier = .required },
11264 .{ .kind = .id_ref, .quantifier = .required },
11265 .{ .kind = .id_ref, .quantifier = .required },
11266 .{ .kind = .id_ref, .quantifier = .required },
11267 .{ .kind = .id_ref, .quantifier = .required },
11268 },
11269 },
11270 .{
11271 .name = "OpSubgroupImageMediaBlockWriteINTEL",
11272 .opcode = 5581,
11273 .operands = &.{
11274 .{ .kind = .id_ref, .quantifier = .required },
11275 .{ .kind = .id_ref, .quantifier = .required },
11276 .{ .kind = .id_ref, .quantifier = .required },
11277 .{ .kind = .id_ref, .quantifier = .required },
11278 .{ .kind = .id_ref, .quantifier = .required },
11279 },
11280 },
11281 .{
11282 .name = "OpUCountLeadingZerosINTEL",
11283 .opcode = 5585,
11284 .operands = &.{
11285 .{ .kind = .id_result_type, .quantifier = .required },
11286 .{ .kind = .id_result, .quantifier = .required },
11287 .{ .kind = .id_ref, .quantifier = .required },
11288 },
11289 },
11290 .{
11291 .name = "OpUCountTrailingZerosINTEL",
11292 .opcode = 5586,
11293 .operands = &.{
11294 .{ .kind = .id_result_type, .quantifier = .required },
11295 .{ .kind = .id_result, .quantifier = .required },
11296 .{ .kind = .id_ref, .quantifier = .required },
11297 },
11298 },
11299 .{
11300 .name = "OpAbsISubINTEL",
11301 .opcode = 5587,
11302 .operands = &.{
11303 .{ .kind = .id_result_type, .quantifier = .required },
11304 .{ .kind = .id_result, .quantifier = .required },
11305 .{ .kind = .id_ref, .quantifier = .required },
11306 .{ .kind = .id_ref, .quantifier = .required },
11307 },
11308 },
11309 .{
11310 .name = "OpAbsUSubINTEL",
11311 .opcode = 5588,
11312 .operands = &.{
11313 .{ .kind = .id_result_type, .quantifier = .required },
11314 .{ .kind = .id_result, .quantifier = .required },
11315 .{ .kind = .id_ref, .quantifier = .required },
11316 .{ .kind = .id_ref, .quantifier = .required },
11317 },
11318 },
11319 .{
11320 .name = "OpIAddSatINTEL",
11321 .opcode = 5589,
11322 .operands = &.{
11323 .{ .kind = .id_result_type, .quantifier = .required },
11324 .{ .kind = .id_result, .quantifier = .required },
11325 .{ .kind = .id_ref, .quantifier = .required },
11326 .{ .kind = .id_ref, .quantifier = .required },
11327 },
11328 },
11329 .{
11330 .name = "OpUAddSatINTEL",
11331 .opcode = 5590,
11332 .operands = &.{
11333 .{ .kind = .id_result_type, .quantifier = .required },
11334 .{ .kind = .id_result, .quantifier = .required },
11335 .{ .kind = .id_ref, .quantifier = .required },
11336 .{ .kind = .id_ref, .quantifier = .required },
11337 },
11338 },
11339 .{
11340 .name = "OpIAverageINTEL",
11341 .opcode = 5591,
11342 .operands = &.{
11343 .{ .kind = .id_result_type, .quantifier = .required },
11344 .{ .kind = .id_result, .quantifier = .required },
11345 .{ .kind = .id_ref, .quantifier = .required },
11346 .{ .kind = .id_ref, .quantifier = .required },
11347 },
11348 },
11349 .{
11350 .name = "OpUAverageINTEL",
11351 .opcode = 5592,
11352 .operands = &.{
11353 .{ .kind = .id_result_type, .quantifier = .required },
11354 .{ .kind = .id_result, .quantifier = .required },
11355 .{ .kind = .id_ref, .quantifier = .required },
11356 .{ .kind = .id_ref, .quantifier = .required },
11357 },
11358 },
11359 .{
11360 .name = "OpIAverageRoundedINTEL",
11361 .opcode = 5593,
11362 .operands = &.{
11363 .{ .kind = .id_result_type, .quantifier = .required },
11364 .{ .kind = .id_result, .quantifier = .required },
11365 .{ .kind = .id_ref, .quantifier = .required },
11366 .{ .kind = .id_ref, .quantifier = .required },
11367 },
11368 },
11369 .{
11370 .name = "OpUAverageRoundedINTEL",
11371 .opcode = 5594,
11372 .operands = &.{
11373 .{ .kind = .id_result_type, .quantifier = .required },
11374 .{ .kind = .id_result, .quantifier = .required },
11375 .{ .kind = .id_ref, .quantifier = .required },
11376 .{ .kind = .id_ref, .quantifier = .required },
11377 },
11378 },
11379 .{
11380 .name = "OpISubSatINTEL",
11381 .opcode = 5595,
11382 .operands = &.{
11383 .{ .kind = .id_result_type, .quantifier = .required },
11384 .{ .kind = .id_result, .quantifier = .required },
11385 .{ .kind = .id_ref, .quantifier = .required },
11386 .{ .kind = .id_ref, .quantifier = .required },
11387 },
11388 },
11389 .{
11390 .name = "OpUSubSatINTEL",
11391 .opcode = 5596,
11392 .operands = &.{
11393 .{ .kind = .id_result_type, .quantifier = .required },
11394 .{ .kind = .id_result, .quantifier = .required },
11395 .{ .kind = .id_ref, .quantifier = .required },
11396 .{ .kind = .id_ref, .quantifier = .required },
11397 },
11398 },
11399 .{
11400 .name = "OpIMul32x16INTEL",
11401 .opcode = 5597,
11402 .operands = &.{
11403 .{ .kind = .id_result_type, .quantifier = .required },
11404 .{ .kind = .id_result, .quantifier = .required },
11405 .{ .kind = .id_ref, .quantifier = .required },
11406 .{ .kind = .id_ref, .quantifier = .required },
11407 },
11408 },
11409 .{
11410 .name = "OpUMul32x16INTEL",
11411 .opcode = 5598,
11412 .operands = &.{
11413 .{ .kind = .id_result_type, .quantifier = .required },
11414 .{ .kind = .id_result, .quantifier = .required },
11415 .{ .kind = .id_ref, .quantifier = .required },
11416 .{ .kind = .id_ref, .quantifier = .required },
11417 },
11418 },
11419 .{
11420 .name = "OpConstantFunctionPointerINTEL",
11421 .opcode = 5600,
11422 .operands = &.{
11423 .{ .kind = .id_result_type, .quantifier = .required },
11424 .{ .kind = .id_result, .quantifier = .required },
11425 .{ .kind = .id_ref, .quantifier = .required },
11426 },
11427 },
11428 .{
11429 .name = "OpFunctionPointerCallINTEL",
11430 .opcode = 5601,
11431 .operands = &.{
11432 .{ .kind = .id_result_type, .quantifier = .required },
11433 .{ .kind = .id_result, .quantifier = .required },
11434 .{ .kind = .id_ref, .quantifier = .variadic },
11435 },
11436 },
11437 .{
11438 .name = "OpAsmTargetINTEL",
11439 .opcode = 5609,
11440 .operands = &.{
11441 .{ .kind = .id_result, .quantifier = .required },
11442 .{ .kind = .literal_string, .quantifier = .required },
11443 },
11444 },
11445 .{
11446 .name = "OpAsmINTEL",
11447 .opcode = 5610,
11448 .operands = &.{
11449 .{ .kind = .id_result_type, .quantifier = .required },
11450 .{ .kind = .id_result, .quantifier = .required },
11451 .{ .kind = .id_ref, .quantifier = .required },
11452 .{ .kind = .id_ref, .quantifier = .required },
11453 .{ .kind = .literal_string, .quantifier = .required },
11454 .{ .kind = .literal_string, .quantifier = .required },
11455 },
11456 },
11457 .{
11458 .name = "OpAsmCallINTEL",
11459 .opcode = 5611,
11460 .operands = &.{
11461 .{ .kind = .id_result_type, .quantifier = .required },
11462 .{ .kind = .id_result, .quantifier = .required },
11463 .{ .kind = .id_ref, .quantifier = .required },
11464 .{ .kind = .id_ref, .quantifier = .variadic },
11465 },
11466 },
11467 .{
11468 .name = "OpAtomicFMinEXT",
11469 .opcode = 5614,
11470 .operands = &.{
11471 .{ .kind = .id_result_type, .quantifier = .required },
11472 .{ .kind = .id_result, .quantifier = .required },
11473 .{ .kind = .id_ref, .quantifier = .required },
11474 .{ .kind = .id_scope, .quantifier = .required },
11475 .{ .kind = .id_memory_semantics, .quantifier = .required },
11476 .{ .kind = .id_ref, .quantifier = .required },
11477 },
11478 },
11479 .{
11480 .name = "OpAtomicFMaxEXT",
11481 .opcode = 5615,
11482 .operands = &.{
11483 .{ .kind = .id_result_type, .quantifier = .required },
11484 .{ .kind = .id_result, .quantifier = .required },
11485 .{ .kind = .id_ref, .quantifier = .required },
11486 .{ .kind = .id_scope, .quantifier = .required },
11487 .{ .kind = .id_memory_semantics, .quantifier = .required },
11488 .{ .kind = .id_ref, .quantifier = .required },
11489 },
11490 },
11491 .{
11492 .name = "OpAssumeTrueKHR",
11493 .opcode = 5630,
11494 .operands = &.{
11495 .{ .kind = .id_ref, .quantifier = .required },
11496 },
11497 },
11498 .{
11499 .name = "OpExpectKHR",
11500 .opcode = 5631,
11501 .operands = &.{
11502 .{ .kind = .id_result_type, .quantifier = .required },
11503 .{ .kind = .id_result, .quantifier = .required },
11504 .{ .kind = .id_ref, .quantifier = .required },
11505 .{ .kind = .id_ref, .quantifier = .required },
11506 },
11507 },
11508 .{
11509 .name = "OpDecorateString",
11510 .opcode = 5632,
11511 .operands = &.{
11512 .{ .kind = .id_ref, .quantifier = .required },
11513 .{ .kind = .decoration, .quantifier = .required },
11514 },
11515 },
11516 .{
11517 .name = "OpMemberDecorateString",
11518 .opcode = 5633,
11519 .operands = &.{
11520 .{ .kind = .id_ref, .quantifier = .required },
11521 .{ .kind = .literal_integer, .quantifier = .required },
11522 .{ .kind = .decoration, .quantifier = .required },
11523 },
11524 },
11525 .{
11526 .name = "OpVmeImageINTEL",
11527 .opcode = 5699,
11528 .operands = &.{
11529 .{ .kind = .id_result_type, .quantifier = .required },
11530 .{ .kind = .id_result, .quantifier = .required },
11531 .{ .kind = .id_ref, .quantifier = .required },
11532 .{ .kind = .id_ref, .quantifier = .required },
11533 },
11534 },
11535 .{
11536 .name = "OpTypeVmeImageINTEL",
11537 .opcode = 5700,
11538 .operands = &.{
11539 .{ .kind = .id_result, .quantifier = .required },
11540 .{ .kind = .id_ref, .quantifier = .required },
11541 },
11542 },
11543 .{
11544 .name = "OpTypeAvcImePayloadINTEL",
11545 .opcode = 5701,
11546 .operands = &.{
11547 .{ .kind = .id_result, .quantifier = .required },
11548 },
11549 },
11550 .{
11551 .name = "OpTypeAvcRefPayloadINTEL",
11552 .opcode = 5702,
11553 .operands = &.{
11554 .{ .kind = .id_result, .quantifier = .required },
11555 },
11556 },
11557 .{
11558 .name = "OpTypeAvcSicPayloadINTEL",
11559 .opcode = 5703,
11560 .operands = &.{
11561 .{ .kind = .id_result, .quantifier = .required },
11562 },
11563 },
11564 .{
11565 .name = "OpTypeAvcMcePayloadINTEL",
11566 .opcode = 5704,
11567 .operands = &.{
11568 .{ .kind = .id_result, .quantifier = .required },
11569 },
11570 },
11571 .{
11572 .name = "OpTypeAvcMceResultINTEL",
11573 .opcode = 5705,
11574 .operands = &.{
11575 .{ .kind = .id_result, .quantifier = .required },
11576 },
11577 },
11578 .{
11579 .name = "OpTypeAvcImeResultINTEL",
11580 .opcode = 5706,
11581 .operands = &.{
11582 .{ .kind = .id_result, .quantifier = .required },
11583 },
11584 },
11585 .{
11586 .name = "OpTypeAvcImeResultSingleReferenceStreamoutINTEL",
11587 .opcode = 5707,
11588 .operands = &.{
11589 .{ .kind = .id_result, .quantifier = .required },
11590 },
11591 },
11592 .{
11593 .name = "OpTypeAvcImeResultDualReferenceStreamoutINTEL",
11594 .opcode = 5708,
11595 .operands = &.{
11596 .{ .kind = .id_result, .quantifier = .required },
11597 },
11598 },
11599 .{
11600 .name = "OpTypeAvcImeSingleReferenceStreaminINTEL",
11601 .opcode = 5709,
11602 .operands = &.{
11603 .{ .kind = .id_result, .quantifier = .required },
11604 },
11605 },
11606 .{
11607 .name = "OpTypeAvcImeDualReferenceStreaminINTEL",
11608 .opcode = 5710,
11609 .operands = &.{
11610 .{ .kind = .id_result, .quantifier = .required },
11611 },
11612 },
11613 .{
11614 .name = "OpTypeAvcRefResultINTEL",
11615 .opcode = 5711,
11616 .operands = &.{
11617 .{ .kind = .id_result, .quantifier = .required },
11618 },
11619 },
11620 .{
11621 .name = "OpTypeAvcSicResultINTEL",
11622 .opcode = 5712,
11623 .operands = &.{
11624 .{ .kind = .id_result, .quantifier = .required },
11625 },
11626 },
11627 .{
11628 .name = "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL",
11629 .opcode = 5713,
11630 .operands = &.{
11631 .{ .kind = .id_result_type, .quantifier = .required },
11632 .{ .kind = .id_result, .quantifier = .required },
11633 .{ .kind = .id_ref, .quantifier = .required },
11634 .{ .kind = .id_ref, .quantifier = .required },
11635 },
11636 },
11637 .{
11638 .name = "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL",
11639 .opcode = 5714,
11640 .operands = &.{
11641 .{ .kind = .id_result_type, .quantifier = .required },
11642 .{ .kind = .id_result, .quantifier = .required },
11643 .{ .kind = .id_ref, .quantifier = .required },
11644 .{ .kind = .id_ref, .quantifier = .required },
11645 },
11646 },
11647 .{
11648 .name = "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL",
11649 .opcode = 5715,
11650 .operands = &.{
11651 .{ .kind = .id_result_type, .quantifier = .required },
11652 .{ .kind = .id_result, .quantifier = .required },
11653 .{ .kind = .id_ref, .quantifier = .required },
11654 .{ .kind = .id_ref, .quantifier = .required },
11655 },
11656 },
11657 .{
11658 .name = "OpSubgroupAvcMceSetInterShapePenaltyINTEL",
11659 .opcode = 5716,
11660 .operands = &.{
11661 .{ .kind = .id_result_type, .quantifier = .required },
11662 .{ .kind = .id_result, .quantifier = .required },
11663 .{ .kind = .id_ref, .quantifier = .required },
11664 .{ .kind = .id_ref, .quantifier = .required },
11665 },
11666 },
11667 .{
11668 .name = "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL",
11669 .opcode = 5717,
11670 .operands = &.{
11671 .{ .kind = .id_result_type, .quantifier = .required },
11672 .{ .kind = .id_result, .quantifier = .required },
11673 .{ .kind = .id_ref, .quantifier = .required },
11674 .{ .kind = .id_ref, .quantifier = .required },
11675 },
11676 },
11677 .{
11678 .name = "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL",
11679 .opcode = 5718,
11680 .operands = &.{
11681 .{ .kind = .id_result_type, .quantifier = .required },
11682 .{ .kind = .id_result, .quantifier = .required },
11683 .{ .kind = .id_ref, .quantifier = .required },
11684 .{ .kind = .id_ref, .quantifier = .required },
11685 },
11686 },
11687 .{
11688 .name = "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL",
11689 .opcode = 5719,
11690 .operands = &.{
11691 .{ .kind = .id_result_type, .quantifier = .required },
11692 .{ .kind = .id_result, .quantifier = .required },
11693 .{ .kind = .id_ref, .quantifier = .required },
11694 .{ .kind = .id_ref, .quantifier = .required },
11695 },
11696 },
11697 .{
11698 .name = "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL",
11699 .opcode = 5720,
11700 .operands = &.{
11701 .{ .kind = .id_result_type, .quantifier = .required },
11702 .{ .kind = .id_result, .quantifier = .required },
11703 .{ .kind = .id_ref, .quantifier = .required },
11704 .{ .kind = .id_ref, .quantifier = .required },
11705 },
11706 },
11707 .{
11708 .name = "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL",
11709 .opcode = 5721,
11710 .operands = &.{
11711 .{ .kind = .id_result_type, .quantifier = .required },
11712 .{ .kind = .id_result, .quantifier = .required },
11713 },
11714 },
11715 .{
11716 .name = "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL",
11717 .opcode = 5722,
11718 .operands = &.{
11719 .{ .kind = .id_result_type, .quantifier = .required },
11720 .{ .kind = .id_result, .quantifier = .required },
11721 },
11722 },
11723 .{
11724 .name = "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL",
11725 .opcode = 5723,
11726 .operands = &.{
11727 .{ .kind = .id_result_type, .quantifier = .required },
11728 .{ .kind = .id_result, .quantifier = .required },
11729 },
11730 },
11731 .{
11732 .name = "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL",
11733 .opcode = 5724,
11734 .operands = &.{
11735 .{ .kind = .id_result_type, .quantifier = .required },
11736 .{ .kind = .id_result, .quantifier = .required },
11737 .{ .kind = .id_ref, .quantifier = .required },
11738 .{ .kind = .id_ref, .quantifier = .required },
11739 .{ .kind = .id_ref, .quantifier = .required },
11740 .{ .kind = .id_ref, .quantifier = .required },
11741 },
11742 },
11743 .{
11744 .name = "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL",
11745 .opcode = 5725,
11746 .operands = &.{
11747 .{ .kind = .id_result_type, .quantifier = .required },
11748 .{ .kind = .id_result, .quantifier = .required },
11749 .{ .kind = .id_ref, .quantifier = .required },
11750 .{ .kind = .id_ref, .quantifier = .required },
11751 },
11752 },
11753 .{
11754 .name = "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL",
11755 .opcode = 5726,
11756 .operands = &.{
11757 .{ .kind = .id_result_type, .quantifier = .required },
11758 .{ .kind = .id_result, .quantifier = .required },
11759 },
11760 },
11761 .{
11762 .name = "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL",
11763 .opcode = 5727,
11764 .operands = &.{
11765 .{ .kind = .id_result_type, .quantifier = .required },
11766 .{ .kind = .id_result, .quantifier = .required },
11767 },
11768 },
11769 .{
11770 .name = "OpSubgroupAvcMceSetAcOnlyHaarINTEL",
11771 .opcode = 5728,
11772 .operands = &.{
11773 .{ .kind = .id_result_type, .quantifier = .required },
11774 .{ .kind = .id_result, .quantifier = .required },
11775 .{ .kind = .id_ref, .quantifier = .required },
11776 },
11777 },
11778 .{
11779 .name = "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL",
11780 .opcode = 5729,
11781 .operands = &.{
11782 .{ .kind = .id_result_type, .quantifier = .required },
11783 .{ .kind = .id_result, .quantifier = .required },
11784 .{ .kind = .id_ref, .quantifier = .required },
11785 .{ .kind = .id_ref, .quantifier = .required },
11786 },
11787 },
11788 .{
11789 .name = "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL",
11790 .opcode = 5730,
11791 .operands = &.{
11792 .{ .kind = .id_result_type, .quantifier = .required },
11793 .{ .kind = .id_result, .quantifier = .required },
11794 .{ .kind = .id_ref, .quantifier = .required },
11795 .{ .kind = .id_ref, .quantifier = .required },
11796 },
11797 },
11798 .{
11799 .name = "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL",
11800 .opcode = 5731,
11801 .operands = &.{
11802 .{ .kind = .id_result_type, .quantifier = .required },
11803 .{ .kind = .id_result, .quantifier = .required },
11804 .{ .kind = .id_ref, .quantifier = .required },
11805 .{ .kind = .id_ref, .quantifier = .required },
11806 .{ .kind = .id_ref, .quantifier = .required },
11807 },
11808 },
11809 .{
11810 .name = "OpSubgroupAvcMceConvertToImePayloadINTEL",
11811 .opcode = 5732,
11812 .operands = &.{
11813 .{ .kind = .id_result_type, .quantifier = .required },
11814 .{ .kind = .id_result, .quantifier = .required },
11815 .{ .kind = .id_ref, .quantifier = .required },
11816 },
11817 },
11818 .{
11819 .name = "OpSubgroupAvcMceConvertToImeResultINTEL",
11820 .opcode = 5733,
11821 .operands = &.{
11822 .{ .kind = .id_result_type, .quantifier = .required },
11823 .{ .kind = .id_result, .quantifier = .required },
11824 .{ .kind = .id_ref, .quantifier = .required },
11825 },
11826 },
11827 .{
11828 .name = "OpSubgroupAvcMceConvertToRefPayloadINTEL",
11829 .opcode = 5734,
11830 .operands = &.{
11831 .{ .kind = .id_result_type, .quantifier = .required },
11832 .{ .kind = .id_result, .quantifier = .required },
11833 .{ .kind = .id_ref, .quantifier = .required },
11834 },
11835 },
11836 .{
11837 .name = "OpSubgroupAvcMceConvertToRefResultINTEL",
11838 .opcode = 5735,
11839 .operands = &.{
11840 .{ .kind = .id_result_type, .quantifier = .required },
11841 .{ .kind = .id_result, .quantifier = .required },
11842 .{ .kind = .id_ref, .quantifier = .required },
11843 },
11844 },
11845 .{
11846 .name = "OpSubgroupAvcMceConvertToSicPayloadINTEL",
11847 .opcode = 5736,
11848 .operands = &.{
11849 .{ .kind = .id_result_type, .quantifier = .required },
11850 .{ .kind = .id_result, .quantifier = .required },
11851 .{ .kind = .id_ref, .quantifier = .required },
11852 },
11853 },
11854 .{
11855 .name = "OpSubgroupAvcMceConvertToSicResultINTEL",
11856 .opcode = 5737,
11857 .operands = &.{
11858 .{ .kind = .id_result_type, .quantifier = .required },
11859 .{ .kind = .id_result, .quantifier = .required },
11860 .{ .kind = .id_ref, .quantifier = .required },
11861 },
11862 },
11863 .{
11864 .name = "OpSubgroupAvcMceGetMotionVectorsINTEL",
11865 .opcode = 5738,
11866 .operands = &.{
11867 .{ .kind = .id_result_type, .quantifier = .required },
11868 .{ .kind = .id_result, .quantifier = .required },
11869 .{ .kind = .id_ref, .quantifier = .required },
11870 },
11871 },
11872 .{
11873 .name = "OpSubgroupAvcMceGetInterDistortionsINTEL",
11874 .opcode = 5739,
11875 .operands = &.{
11876 .{ .kind = .id_result_type, .quantifier = .required },
11877 .{ .kind = .id_result, .quantifier = .required },
11878 .{ .kind = .id_ref, .quantifier = .required },
11879 },
11880 },
11881 .{
11882 .name = "OpSubgroupAvcMceGetBestInterDistortionsINTEL",
11883 .opcode = 5740,
11884 .operands = &.{
11885 .{ .kind = .id_result_type, .quantifier = .required },
11886 .{ .kind = .id_result, .quantifier = .required },
11887 .{ .kind = .id_ref, .quantifier = .required },
11888 },
11889 },
11890 .{
11891 .name = "OpSubgroupAvcMceGetInterMajorShapeINTEL",
11892 .opcode = 5741,
11893 .operands = &.{
11894 .{ .kind = .id_result_type, .quantifier = .required },
11895 .{ .kind = .id_result, .quantifier = .required },
11896 .{ .kind = .id_ref, .quantifier = .required },
11897 },
11898 },
11899 .{
11900 .name = "OpSubgroupAvcMceGetInterMinorShapeINTEL",
11901 .opcode = 5742,
11902 .operands = &.{
11903 .{ .kind = .id_result_type, .quantifier = .required },
11904 .{ .kind = .id_result, .quantifier = .required },
11905 .{ .kind = .id_ref, .quantifier = .required },
11906 },
11907 },
11908 .{
11909 .name = "OpSubgroupAvcMceGetInterDirectionsINTEL",
11910 .opcode = 5743,
11911 .operands = &.{
11912 .{ .kind = .id_result_type, .quantifier = .required },
11913 .{ .kind = .id_result, .quantifier = .required },
11914 .{ .kind = .id_ref, .quantifier = .required },
11915 },
11916 },
11917 .{
11918 .name = "OpSubgroupAvcMceGetInterMotionVectorCountINTEL",
11919 .opcode = 5744,
11920 .operands = &.{
11921 .{ .kind = .id_result_type, .quantifier = .required },
11922 .{ .kind = .id_result, .quantifier = .required },
11923 .{ .kind = .id_ref, .quantifier = .required },
11924 },
11925 },
11926 .{
11927 .name = "OpSubgroupAvcMceGetInterReferenceIdsINTEL",
11928 .opcode = 5745,
11929 .operands = &.{
11930 .{ .kind = .id_result_type, .quantifier = .required },
11931 .{ .kind = .id_result, .quantifier = .required },
11932 .{ .kind = .id_ref, .quantifier = .required },
11933 },
11934 },
11935 .{
11936 .name = "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL",
11937 .opcode = 5746,
11938 .operands = &.{
11939 .{ .kind = .id_result_type, .quantifier = .required },
11940 .{ .kind = .id_result, .quantifier = .required },
11941 .{ .kind = .id_ref, .quantifier = .required },
11942 .{ .kind = .id_ref, .quantifier = .required },
11943 .{ .kind = .id_ref, .quantifier = .required },
11944 },
11945 },
11946 .{
11947 .name = "OpSubgroupAvcImeInitializeINTEL",
11948 .opcode = 5747,
11949 .operands = &.{
11950 .{ .kind = .id_result_type, .quantifier = .required },
11951 .{ .kind = .id_result, .quantifier = .required },
11952 .{ .kind = .id_ref, .quantifier = .required },
11953 .{ .kind = .id_ref, .quantifier = .required },
11954 .{ .kind = .id_ref, .quantifier = .required },
11955 },
11956 },
11957 .{
11958 .name = "OpSubgroupAvcImeSetSingleReferenceINTEL",
11959 .opcode = 5748,
11960 .operands = &.{
11961 .{ .kind = .id_result_type, .quantifier = .required },
11962 .{ .kind = .id_result, .quantifier = .required },
11963 .{ .kind = .id_ref, .quantifier = .required },
11964 .{ .kind = .id_ref, .quantifier = .required },
11965 .{ .kind = .id_ref, .quantifier = .required },
11966 },
11967 },
11968 .{
11969 .name = "OpSubgroupAvcImeSetDualReferenceINTEL",
11970 .opcode = 5749,
11971 .operands = &.{
11972 .{ .kind = .id_result_type, .quantifier = .required },
11973 .{ .kind = .id_result, .quantifier = .required },
11974 .{ .kind = .id_ref, .quantifier = .required },
11975 .{ .kind = .id_ref, .quantifier = .required },
11976 .{ .kind = .id_ref, .quantifier = .required },
11977 .{ .kind = .id_ref, .quantifier = .required },
11978 },
11979 },
11980 .{
11981 .name = "OpSubgroupAvcImeRefWindowSizeINTEL",
11982 .opcode = 5750,
11983 .operands = &.{
11984 .{ .kind = .id_result_type, .quantifier = .required },
11985 .{ .kind = .id_result, .quantifier = .required },
11986 .{ .kind = .id_ref, .quantifier = .required },
11987 .{ .kind = .id_ref, .quantifier = .required },
11988 },
11989 },
11990 .{
11991 .name = "OpSubgroupAvcImeAdjustRefOffsetINTEL",
11992 .opcode = 5751,
11993 .operands = &.{
11994 .{ .kind = .id_result_type, .quantifier = .required },
11995 .{ .kind = .id_result, .quantifier = .required },
11996 .{ .kind = .id_ref, .quantifier = .required },
11997 .{ .kind = .id_ref, .quantifier = .required },
11998 .{ .kind = .id_ref, .quantifier = .required },
11999 .{ .kind = .id_ref, .quantifier = .required },
12000 },
12001 },
12002 .{
12003 .name = "OpSubgroupAvcImeConvertToMcePayloadINTEL",
12004 .opcode = 5752,
12005 .operands = &.{
12006 .{ .kind = .id_result_type, .quantifier = .required },
12007 .{ .kind = .id_result, .quantifier = .required },
12008 .{ .kind = .id_ref, .quantifier = .required },
12009 },
12010 },
12011 .{
12012 .name = "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL",
12013 .opcode = 5753,
12014 .operands = &.{
12015 .{ .kind = .id_result_type, .quantifier = .required },
12016 .{ .kind = .id_result, .quantifier = .required },
12017 .{ .kind = .id_ref, .quantifier = .required },
12018 .{ .kind = .id_ref, .quantifier = .required },
12019 },
12020 },
12021 .{
12022 .name = "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL",
12023 .opcode = 5754,
12024 .operands = &.{
12025 .{ .kind = .id_result_type, .quantifier = .required },
12026 .{ .kind = .id_result, .quantifier = .required },
12027 .{ .kind = .id_ref, .quantifier = .required },
12028 },
12029 },
12030 .{
12031 .name = "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL",
12032 .opcode = 5755,
12033 .operands = &.{
12034 .{ .kind = .id_result_type, .quantifier = .required },
12035 .{ .kind = .id_result, .quantifier = .required },
12036 .{ .kind = .id_ref, .quantifier = .required },
12037 .{ .kind = .id_ref, .quantifier = .required },
12038 },
12039 },
12040 .{
12041 .name = "OpSubgroupAvcImeSetWeightedSadINTEL",
12042 .opcode = 5756,
12043 .operands = &.{
12044 .{ .kind = .id_result_type, .quantifier = .required },
12045 .{ .kind = .id_result, .quantifier = .required },
12046 .{ .kind = .id_ref, .quantifier = .required },
12047 .{ .kind = .id_ref, .quantifier = .required },
12048 },
12049 },
12050 .{
12051 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL",
12052 .opcode = 5757,
12053 .operands = &.{
12054 .{ .kind = .id_result_type, .quantifier = .required },
12055 .{ .kind = .id_result, .quantifier = .required },
12056 .{ .kind = .id_ref, .quantifier = .required },
12057 .{ .kind = .id_ref, .quantifier = .required },
12058 .{ .kind = .id_ref, .quantifier = .required },
12059 },
12060 },
12061 .{
12062 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL",
12063 .opcode = 5758,
12064 .operands = &.{
12065 .{ .kind = .id_result_type, .quantifier = .required },
12066 .{ .kind = .id_result, .quantifier = .required },
12067 .{ .kind = .id_ref, .quantifier = .required },
12068 .{ .kind = .id_ref, .quantifier = .required },
12069 .{ .kind = .id_ref, .quantifier = .required },
12070 .{ .kind = .id_ref, .quantifier = .required },
12071 },
12072 },
12073 .{
12074 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL",
12075 .opcode = 5759,
12076 .operands = &.{
12077 .{ .kind = .id_result_type, .quantifier = .required },
12078 .{ .kind = .id_result, .quantifier = .required },
12079 .{ .kind = .id_ref, .quantifier = .required },
12080 .{ .kind = .id_ref, .quantifier = .required },
12081 .{ .kind = .id_ref, .quantifier = .required },
12082 .{ .kind = .id_ref, .quantifier = .required },
12083 },
12084 },
12085 .{
12086 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL",
12087 .opcode = 5760,
12088 .operands = &.{
12089 .{ .kind = .id_result_type, .quantifier = .required },
12090 .{ .kind = .id_result, .quantifier = .required },
12091 .{ .kind = .id_ref, .quantifier = .required },
12092 .{ .kind = .id_ref, .quantifier = .required },
12093 .{ .kind = .id_ref, .quantifier = .required },
12094 .{ .kind = .id_ref, .quantifier = .required },
12095 .{ .kind = .id_ref, .quantifier = .required },
12096 },
12097 },
12098 .{
12099 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL",
12100 .opcode = 5761,
12101 .operands = &.{
12102 .{ .kind = .id_result_type, .quantifier = .required },
12103 .{ .kind = .id_result, .quantifier = .required },
12104 .{ .kind = .id_ref, .quantifier = .required },
12105 .{ .kind = .id_ref, .quantifier = .required },
12106 .{ .kind = .id_ref, .quantifier = .required },
12107 },
12108 },
12109 .{
12110 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL",
12111 .opcode = 5762,
12112 .operands = &.{
12113 .{ .kind = .id_result_type, .quantifier = .required },
12114 .{ .kind = .id_result, .quantifier = .required },
12115 .{ .kind = .id_ref, .quantifier = .required },
12116 .{ .kind = .id_ref, .quantifier = .required },
12117 .{ .kind = .id_ref, .quantifier = .required },
12118 .{ .kind = .id_ref, .quantifier = .required },
12119 },
12120 },
12121 .{
12122 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL",
12123 .opcode = 5763,
12124 .operands = &.{
12125 .{ .kind = .id_result_type, .quantifier = .required },
12126 .{ .kind = .id_result, .quantifier = .required },
12127 .{ .kind = .id_ref, .quantifier = .required },
12128 .{ .kind = .id_ref, .quantifier = .required },
12129 .{ .kind = .id_ref, .quantifier = .required },
12130 .{ .kind = .id_ref, .quantifier = .required },
12131 },
12132 },
12133 .{
12134 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL",
12135 .opcode = 5764,
12136 .operands = &.{
12137 .{ .kind = .id_result_type, .quantifier = .required },
12138 .{ .kind = .id_result, .quantifier = .required },
12139 .{ .kind = .id_ref, .quantifier = .required },
12140 .{ .kind = .id_ref, .quantifier = .required },
12141 .{ .kind = .id_ref, .quantifier = .required },
12142 .{ .kind = .id_ref, .quantifier = .required },
12143 .{ .kind = .id_ref, .quantifier = .required },
12144 },
12145 },
12146 .{
12147 .name = "OpSubgroupAvcImeConvertToMceResultINTEL",
12148 .opcode = 5765,
12149 .operands = &.{
12150 .{ .kind = .id_result_type, .quantifier = .required },
12151 .{ .kind = .id_result, .quantifier = .required },
12152 .{ .kind = .id_ref, .quantifier = .required },
12153 },
12154 },
12155 .{
12156 .name = "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL",
12157 .opcode = 5766,
12158 .operands = &.{
12159 .{ .kind = .id_result_type, .quantifier = .required },
12160 .{ .kind = .id_result, .quantifier = .required },
12161 .{ .kind = .id_ref, .quantifier = .required },
12162 },
12163 },
12164 .{
12165 .name = "OpSubgroupAvcImeGetDualReferenceStreaminINTEL",
12166 .opcode = 5767,
12167 .operands = &.{
12168 .{ .kind = .id_result_type, .quantifier = .required },
12169 .{ .kind = .id_result, .quantifier = .required },
12170 .{ .kind = .id_ref, .quantifier = .required },
12171 },
12172 },
12173 .{
12174 .name = "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL",
12175 .opcode = 5768,
12176 .operands = &.{
12177 .{ .kind = .id_result_type, .quantifier = .required },
12178 .{ .kind = .id_result, .quantifier = .required },
12179 .{ .kind = .id_ref, .quantifier = .required },
12180 },
12181 },
12182 .{
12183 .name = "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL",
12184 .opcode = 5769,
12185 .operands = &.{
12186 .{ .kind = .id_result_type, .quantifier = .required },
12187 .{ .kind = .id_result, .quantifier = .required },
12188 .{ .kind = .id_ref, .quantifier = .required },
12189 },
12190 },
12191 .{
12192 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL",
12193 .opcode = 5770,
12194 .operands = &.{
12195 .{ .kind = .id_result_type, .quantifier = .required },
12196 .{ .kind = .id_result, .quantifier = .required },
12197 .{ .kind = .id_ref, .quantifier = .required },
12198 .{ .kind = .id_ref, .quantifier = .required },
12199 },
12200 },
12201 .{
12202 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL",
12203 .opcode = 5771,
12204 .operands = &.{
12205 .{ .kind = .id_result_type, .quantifier = .required },
12206 .{ .kind = .id_result, .quantifier = .required },
12207 .{ .kind = .id_ref, .quantifier = .required },
12208 .{ .kind = .id_ref, .quantifier = .required },
12209 },
12210 },
12211 .{
12212 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL",
12213 .opcode = 5772,
12214 .operands = &.{
12215 .{ .kind = .id_result_type, .quantifier = .required },
12216 .{ .kind = .id_result, .quantifier = .required },
12217 .{ .kind = .id_ref, .quantifier = .required },
12218 .{ .kind = .id_ref, .quantifier = .required },
12219 },
12220 },
12221 .{
12222 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL",
12223 .opcode = 5773,
12224 .operands = &.{
12225 .{ .kind = .id_result_type, .quantifier = .required },
12226 .{ .kind = .id_result, .quantifier = .required },
12227 .{ .kind = .id_ref, .quantifier = .required },
12228 .{ .kind = .id_ref, .quantifier = .required },
12229 .{ .kind = .id_ref, .quantifier = .required },
12230 },
12231 },
12232 .{
12233 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL",
12234 .opcode = 5774,
12235 .operands = &.{
12236 .{ .kind = .id_result_type, .quantifier = .required },
12237 .{ .kind = .id_result, .quantifier = .required },
12238 .{ .kind = .id_ref, .quantifier = .required },
12239 .{ .kind = .id_ref, .quantifier = .required },
12240 .{ .kind = .id_ref, .quantifier = .required },
12241 },
12242 },
12243 .{
12244 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL",
12245 .opcode = 5775,
12246 .operands = &.{
12247 .{ .kind = .id_result_type, .quantifier = .required },
12248 .{ .kind = .id_result, .quantifier = .required },
12249 .{ .kind = .id_ref, .quantifier = .required },
12250 .{ .kind = .id_ref, .quantifier = .required },
12251 .{ .kind = .id_ref, .quantifier = .required },
12252 },
12253 },
12254 .{
12255 .name = "OpSubgroupAvcImeGetBorderReachedINTEL",
12256 .opcode = 5776,
12257 .operands = &.{
12258 .{ .kind = .id_result_type, .quantifier = .required },
12259 .{ .kind = .id_result, .quantifier = .required },
12260 .{ .kind = .id_ref, .quantifier = .required },
12261 .{ .kind = .id_ref, .quantifier = .required },
12262 },
12263 },
12264 .{
12265 .name = "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL",
12266 .opcode = 5777,
12267 .operands = &.{
12268 .{ .kind = .id_result_type, .quantifier = .required },
12269 .{ .kind = .id_result, .quantifier = .required },
12270 .{ .kind = .id_ref, .quantifier = .required },
12271 },
12272 },
12273 .{
12274 .name = "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL",
12275 .opcode = 5778,
12276 .operands = &.{
12277 .{ .kind = .id_result_type, .quantifier = .required },
12278 .{ .kind = .id_result, .quantifier = .required },
12279 .{ .kind = .id_ref, .quantifier = .required },
12280 },
12281 },
12282 .{
12283 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL",
12284 .opcode = 5779,
12285 .operands = &.{
12286 .{ .kind = .id_result_type, .quantifier = .required },
12287 .{ .kind = .id_result, .quantifier = .required },
12288 .{ .kind = .id_ref, .quantifier = .required },
12289 },
12290 },
12291 .{
12292 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL",
12293 .opcode = 5780,
12294 .operands = &.{
12295 .{ .kind = .id_result_type, .quantifier = .required },
12296 .{ .kind = .id_result, .quantifier = .required },
12297 .{ .kind = .id_ref, .quantifier = .required },
12298 },
12299 },
12300 .{
12301 .name = "OpSubgroupAvcFmeInitializeINTEL",
12302 .opcode = 5781,
12303 .operands = &.{
12304 .{ .kind = .id_result_type, .quantifier = .required },
12305 .{ .kind = .id_result, .quantifier = .required },
12306 .{ .kind = .id_ref, .quantifier = .required },
12307 .{ .kind = .id_ref, .quantifier = .required },
12308 .{ .kind = .id_ref, .quantifier = .required },
12309 .{ .kind = .id_ref, .quantifier = .required },
12310 .{ .kind = .id_ref, .quantifier = .required },
12311 .{ .kind = .id_ref, .quantifier = .required },
12312 .{ .kind = .id_ref, .quantifier = .required },
12313 },
12314 },
12315 .{
12316 .name = "OpSubgroupAvcBmeInitializeINTEL",
12317 .opcode = 5782,
12318 .operands = &.{
12319 .{ .kind = .id_result_type, .quantifier = .required },
12320 .{ .kind = .id_result, .quantifier = .required },
12321 .{ .kind = .id_ref, .quantifier = .required },
12322 .{ .kind = .id_ref, .quantifier = .required },
12323 .{ .kind = .id_ref, .quantifier = .required },
12324 .{ .kind = .id_ref, .quantifier = .required },
12325 .{ .kind = .id_ref, .quantifier = .required },
12326 .{ .kind = .id_ref, .quantifier = .required },
12327 .{ .kind = .id_ref, .quantifier = .required },
12328 .{ .kind = .id_ref, .quantifier = .required },
12329 },
12330 },
12331 .{
12332 .name = "OpSubgroupAvcRefConvertToMcePayloadINTEL",
12333 .opcode = 5783,
12334 .operands = &.{
12335 .{ .kind = .id_result_type, .quantifier = .required },
12336 .{ .kind = .id_result, .quantifier = .required },
12337 .{ .kind = .id_ref, .quantifier = .required },
12338 },
12339 },
12340 .{
12341 .name = "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL",
12342 .opcode = 5784,
12343 .operands = &.{
12344 .{ .kind = .id_result_type, .quantifier = .required },
12345 .{ .kind = .id_result, .quantifier = .required },
12346 .{ .kind = .id_ref, .quantifier = .required },
12347 },
12348 },
12349 .{
12350 .name = "OpSubgroupAvcRefSetBilinearFilterEnableINTEL",
12351 .opcode = 5785,
12352 .operands = &.{
12353 .{ .kind = .id_result_type, .quantifier = .required },
12354 .{ .kind = .id_result, .quantifier = .required },
12355 .{ .kind = .id_ref, .quantifier = .required },
12356 },
12357 },
12358 .{
12359 .name = "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL",
12360 .opcode = 5786,
12361 .operands = &.{
12362 .{ .kind = .id_result_type, .quantifier = .required },
12363 .{ .kind = .id_result, .quantifier = .required },
12364 .{ .kind = .id_ref, .quantifier = .required },
12365 .{ .kind = .id_ref, .quantifier = .required },
12366 .{ .kind = .id_ref, .quantifier = .required },
12367 },
12368 },
12369 .{
12370 .name = "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL",
12371 .opcode = 5787,
12372 .operands = &.{
12373 .{ .kind = .id_result_type, .quantifier = .required },
12374 .{ .kind = .id_result, .quantifier = .required },
12375 .{ .kind = .id_ref, .quantifier = .required },
12376 .{ .kind = .id_ref, .quantifier = .required },
12377 .{ .kind = .id_ref, .quantifier = .required },
12378 .{ .kind = .id_ref, .quantifier = .required },
12379 },
12380 },
12381 .{
12382 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL",
12383 .opcode = 5788,
12384 .operands = &.{
12385 .{ .kind = .id_result_type, .quantifier = .required },
12386 .{ .kind = .id_result, .quantifier = .required },
12387 .{ .kind = .id_ref, .quantifier = .required },
12388 .{ .kind = .id_ref, .quantifier = .required },
12389 .{ .kind = .id_ref, .quantifier = .required },
12390 },
12391 },
12392 .{
12393 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL",
12394 .opcode = 5789,
12395 .operands = &.{
12396 .{ .kind = .id_result_type, .quantifier = .required },
12397 .{ .kind = .id_result, .quantifier = .required },
12398 .{ .kind = .id_ref, .quantifier = .required },
12399 .{ .kind = .id_ref, .quantifier = .required },
12400 .{ .kind = .id_ref, .quantifier = .required },
12401 .{ .kind = .id_ref, .quantifier = .required },
12402 },
12403 },
12404 .{
12405 .name = "OpSubgroupAvcRefConvertToMceResultINTEL",
12406 .opcode = 5790,
12407 .operands = &.{
12408 .{ .kind = .id_result_type, .quantifier = .required },
12409 .{ .kind = .id_result, .quantifier = .required },
12410 .{ .kind = .id_ref, .quantifier = .required },
12411 },
12412 },
12413 .{
12414 .name = "OpSubgroupAvcSicInitializeINTEL",
12415 .opcode = 5791,
12416 .operands = &.{
12417 .{ .kind = .id_result_type, .quantifier = .required },
12418 .{ .kind = .id_result, .quantifier = .required },
12419 .{ .kind = .id_ref, .quantifier = .required },
12420 },
12421 },
12422 .{
12423 .name = "OpSubgroupAvcSicConfigureSkcINTEL",
12424 .opcode = 5792,
12425 .operands = &.{
12426 .{ .kind = .id_result_type, .quantifier = .required },
12427 .{ .kind = .id_result, .quantifier = .required },
12428 .{ .kind = .id_ref, .quantifier = .required },
12429 .{ .kind = .id_ref, .quantifier = .required },
12430 .{ .kind = .id_ref, .quantifier = .required },
12431 .{ .kind = .id_ref, .quantifier = .required },
12432 .{ .kind = .id_ref, .quantifier = .required },
12433 .{ .kind = .id_ref, .quantifier = .required },
12434 },
12435 },
12436 .{
12437 .name = "OpSubgroupAvcSicConfigureIpeLumaINTEL",
12438 .opcode = 5793,
12439 .operands = &.{
12440 .{ .kind = .id_result_type, .quantifier = .required },
12441 .{ .kind = .id_result, .quantifier = .required },
12442 .{ .kind = .id_ref, .quantifier = .required },
12443 .{ .kind = .id_ref, .quantifier = .required },
12444 .{ .kind = .id_ref, .quantifier = .required },
12445 .{ .kind = .id_ref, .quantifier = .required },
12446 .{ .kind = .id_ref, .quantifier = .required },
12447 .{ .kind = .id_ref, .quantifier = .required },
12448 .{ .kind = .id_ref, .quantifier = .required },
12449 .{ .kind = .id_ref, .quantifier = .required },
12450 },
12451 },
12452 .{
12453 .name = "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL",
12454 .opcode = 5794,
12455 .operands = &.{
12456 .{ .kind = .id_result_type, .quantifier = .required },
12457 .{ .kind = .id_result, .quantifier = .required },
12458 .{ .kind = .id_ref, .quantifier = .required },
12459 .{ .kind = .id_ref, .quantifier = .required },
12460 .{ .kind = .id_ref, .quantifier = .required },
12461 .{ .kind = .id_ref, .quantifier = .required },
12462 .{ .kind = .id_ref, .quantifier = .required },
12463 .{ .kind = .id_ref, .quantifier = .required },
12464 .{ .kind = .id_ref, .quantifier = .required },
12465 .{ .kind = .id_ref, .quantifier = .required },
12466 .{ .kind = .id_ref, .quantifier = .required },
12467 .{ .kind = .id_ref, .quantifier = .required },
12468 .{ .kind = .id_ref, .quantifier = .required },
12469 },
12470 },
12471 .{
12472 .name = "OpSubgroupAvcSicGetMotionVectorMaskINTEL",
12473 .opcode = 5795,
12474 .operands = &.{
12475 .{ .kind = .id_result_type, .quantifier = .required },
12476 .{ .kind = .id_result, .quantifier = .required },
12477 .{ .kind = .id_ref, .quantifier = .required },
12478 .{ .kind = .id_ref, .quantifier = .required },
12479 },
12480 },
12481 .{
12482 .name = "OpSubgroupAvcSicConvertToMcePayloadINTEL",
12483 .opcode = 5796,
12484 .operands = &.{
12485 .{ .kind = .id_result_type, .quantifier = .required },
12486 .{ .kind = .id_result, .quantifier = .required },
12487 .{ .kind = .id_ref, .quantifier = .required },
12488 },
12489 },
12490 .{
12491 .name = "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL",
12492 .opcode = 5797,
12493 .operands = &.{
12494 .{ .kind = .id_result_type, .quantifier = .required },
12495 .{ .kind = .id_result, .quantifier = .required },
12496 .{ .kind = .id_ref, .quantifier = .required },
12497 .{ .kind = .id_ref, .quantifier = .required },
12498 },
12499 },
12500 .{
12501 .name = "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL",
12502 .opcode = 5798,
12503 .operands = &.{
12504 .{ .kind = .id_result_type, .quantifier = .required },
12505 .{ .kind = .id_result, .quantifier = .required },
12506 .{ .kind = .id_ref, .quantifier = .required },
12507 .{ .kind = .id_ref, .quantifier = .required },
12508 .{ .kind = .id_ref, .quantifier = .required },
12509 .{ .kind = .id_ref, .quantifier = .required },
12510 },
12511 },
12512 .{
12513 .name = "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL",
12514 .opcode = 5799,
12515 .operands = &.{
12516 .{ .kind = .id_result_type, .quantifier = .required },
12517 .{ .kind = .id_result, .quantifier = .required },
12518 .{ .kind = .id_ref, .quantifier = .required },
12519 .{ .kind = .id_ref, .quantifier = .required },
12520 },
12521 },
12522 .{
12523 .name = "OpSubgroupAvcSicSetBilinearFilterEnableINTEL",
12524 .opcode = 5800,
12525 .operands = &.{
12526 .{ .kind = .id_result_type, .quantifier = .required },
12527 .{ .kind = .id_result, .quantifier = .required },
12528 .{ .kind = .id_ref, .quantifier = .required },
12529 },
12530 },
12531 .{
12532 .name = "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL",
12533 .opcode = 5801,
12534 .operands = &.{
12535 .{ .kind = .id_result_type, .quantifier = .required },
12536 .{ .kind = .id_result, .quantifier = .required },
12537 .{ .kind = .id_ref, .quantifier = .required },
12538 .{ .kind = .id_ref, .quantifier = .required },
12539 },
12540 },
12541 .{
12542 .name = "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL",
12543 .opcode = 5802,
12544 .operands = &.{
12545 .{ .kind = .id_result_type, .quantifier = .required },
12546 .{ .kind = .id_result, .quantifier = .required },
12547 .{ .kind = .id_ref, .quantifier = .required },
12548 .{ .kind = .id_ref, .quantifier = .required },
12549 },
12550 },
12551 .{
12552 .name = "OpSubgroupAvcSicEvaluateIpeINTEL",
12553 .opcode = 5803,
12554 .operands = &.{
12555 .{ .kind = .id_result_type, .quantifier = .required },
12556 .{ .kind = .id_result, .quantifier = .required },
12557 .{ .kind = .id_ref, .quantifier = .required },
12558 .{ .kind = .id_ref, .quantifier = .required },
12559 },
12560 },
12561 .{
12562 .name = "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL",
12563 .opcode = 5804,
12564 .operands = &.{
12565 .{ .kind = .id_result_type, .quantifier = .required },
12566 .{ .kind = .id_result, .quantifier = .required },
12567 .{ .kind = .id_ref, .quantifier = .required },
12568 .{ .kind = .id_ref, .quantifier = .required },
12569 .{ .kind = .id_ref, .quantifier = .required },
12570 },
12571 },
12572 .{
12573 .name = "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL",
12574 .opcode = 5805,
12575 .operands = &.{
12576 .{ .kind = .id_result_type, .quantifier = .required },
12577 .{ .kind = .id_result, .quantifier = .required },
12578 .{ .kind = .id_ref, .quantifier = .required },
12579 .{ .kind = .id_ref, .quantifier = .required },
12580 .{ .kind = .id_ref, .quantifier = .required },
12581 .{ .kind = .id_ref, .quantifier = .required },
12582 },
12583 },
12584 .{
12585 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL",
12586 .opcode = 5806,
12587 .operands = &.{
12588 .{ .kind = .id_result_type, .quantifier = .required },
12589 .{ .kind = .id_result, .quantifier = .required },
12590 .{ .kind = .id_ref, .quantifier = .required },
12591 .{ .kind = .id_ref, .quantifier = .required },
12592 .{ .kind = .id_ref, .quantifier = .required },
12593 },
12594 },
12595 .{
12596 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL",
12597 .opcode = 5807,
12598 .operands = &.{
12599 .{ .kind = .id_result_type, .quantifier = .required },
12600 .{ .kind = .id_result, .quantifier = .required },
12601 .{ .kind = .id_ref, .quantifier = .required },
12602 .{ .kind = .id_ref, .quantifier = .required },
12603 .{ .kind = .id_ref, .quantifier = .required },
12604 .{ .kind = .id_ref, .quantifier = .required },
12605 },
12606 },
12607 .{
12608 .name = "OpSubgroupAvcSicConvertToMceResultINTEL",
12609 .opcode = 5808,
12610 .operands = &.{
12611 .{ .kind = .id_result_type, .quantifier = .required },
12612 .{ .kind = .id_result, .quantifier = .required },
12613 .{ .kind = .id_ref, .quantifier = .required },
12614 },
12615 },
12616 .{
12617 .name = "OpSubgroupAvcSicGetIpeLumaShapeINTEL",
12618 .opcode = 5809,
12619 .operands = &.{
12620 .{ .kind = .id_result_type, .quantifier = .required },
12621 .{ .kind = .id_result, .quantifier = .required },
12622 .{ .kind = .id_ref, .quantifier = .required },
12623 },
12624 },
12625 .{
12626 .name = "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL",
12627 .opcode = 5810,
12628 .operands = &.{
12629 .{ .kind = .id_result_type, .quantifier = .required },
12630 .{ .kind = .id_result, .quantifier = .required },
12631 .{ .kind = .id_ref, .quantifier = .required },
12632 },
12633 },
12634 .{
12635 .name = "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL",
12636 .opcode = 5811,
12637 .operands = &.{
12638 .{ .kind = .id_result_type, .quantifier = .required },
12639 .{ .kind = .id_result, .quantifier = .required },
12640 .{ .kind = .id_ref, .quantifier = .required },
12641 },
12642 },
12643 .{
12644 .name = "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL",
12645 .opcode = 5812,
12646 .operands = &.{
12647 .{ .kind = .id_result_type, .quantifier = .required },
12648 .{ .kind = .id_result, .quantifier = .required },
12649 .{ .kind = .id_ref, .quantifier = .required },
12650 },
12651 },
12652 .{
12653 .name = "OpSubgroupAvcSicGetIpeChromaModeINTEL",
12654 .opcode = 5813,
12655 .operands = &.{
12656 .{ .kind = .id_result_type, .quantifier = .required },
12657 .{ .kind = .id_result, .quantifier = .required },
12658 .{ .kind = .id_ref, .quantifier = .required },
12659 },
12660 },
12661 .{
12662 .name = "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL",
12663 .opcode = 5814,
12664 .operands = &.{
12665 .{ .kind = .id_result_type, .quantifier = .required },
12666 .{ .kind = .id_result, .quantifier = .required },
12667 .{ .kind = .id_ref, .quantifier = .required },
12668 },
12669 },
12670 .{
12671 .name = "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL",
12672 .opcode = 5815,
12673 .operands = &.{
12674 .{ .kind = .id_result_type, .quantifier = .required },
12675 .{ .kind = .id_result, .quantifier = .required },
12676 .{ .kind = .id_ref, .quantifier = .required },
12677 },
12678 },
12679 .{
12680 .name = "OpSubgroupAvcSicGetInterRawSadsINTEL",
12681 .opcode = 5816,
12682 .operands = &.{
12683 .{ .kind = .id_result_type, .quantifier = .required },
12684 .{ .kind = .id_result, .quantifier = .required },
12685 .{ .kind = .id_ref, .quantifier = .required },
12686 },
12687 },
12688 .{
12689 .name = "OpVariableLengthArrayINTEL",
12690 .opcode = 5818,
12691 .operands = &.{
12692 .{ .kind = .id_result_type, .quantifier = .required },
12693 .{ .kind = .id_result, .quantifier = .required },
12694 .{ .kind = .id_ref, .quantifier = .required },
12695 },
12696 },
12697 .{
12698 .name = "OpSaveMemoryINTEL",
12699 .opcode = 5819,
12700 .operands = &.{
12701 .{ .kind = .id_result_type, .quantifier = .required },
12702 .{ .kind = .id_result, .quantifier = .required },
12703 },
12704 },
12705 .{
12706 .name = "OpRestoreMemoryINTEL",
12707 .opcode = 5820,
12708 .operands = &.{
12709 .{ .kind = .id_ref, .quantifier = .required },
12710 },
12711 },
12712 .{
12713 .name = "OpArbitraryFloatSinCosPiINTEL",
12714 .opcode = 5840,
12715 .operands = &.{
12716 .{ .kind = .id_result_type, .quantifier = .required },
12717 .{ .kind = .id_result, .quantifier = .required },
12718 .{ .kind = .id_ref, .quantifier = .required },
12719 .{ .kind = .literal_integer, .quantifier = .required },
12720 .{ .kind = .literal_integer, .quantifier = .required },
12721 .{ .kind = .literal_integer, .quantifier = .required },
12722 .{ .kind = .literal_integer, .quantifier = .required },
12723 .{ .kind = .literal_integer, .quantifier = .required },
12724 },
12725 },
12726 .{
12727 .name = "OpArbitraryFloatCastINTEL",
12728 .opcode = 5841,
12729 .operands = &.{
12730 .{ .kind = .id_result_type, .quantifier = .required },
12731 .{ .kind = .id_result, .quantifier = .required },
12732 .{ .kind = .id_ref, .quantifier = .required },
12733 .{ .kind = .literal_integer, .quantifier = .required },
12734 .{ .kind = .literal_integer, .quantifier = .required },
12735 .{ .kind = .literal_integer, .quantifier = .required },
12736 .{ .kind = .literal_integer, .quantifier = .required },
12737 .{ .kind = .literal_integer, .quantifier = .required },
12738 },
12739 },
12740 .{
12741 .name = "OpArbitraryFloatCastFromIntINTEL",
12742 .opcode = 5842,
12743 .operands = &.{
12744 .{ .kind = .id_result_type, .quantifier = .required },
12745 .{ .kind = .id_result, .quantifier = .required },
12746 .{ .kind = .id_ref, .quantifier = .required },
12747 .{ .kind = .literal_integer, .quantifier = .required },
12748 .{ .kind = .literal_integer, .quantifier = .required },
12749 .{ .kind = .literal_integer, .quantifier = .required },
12750 .{ .kind = .literal_integer, .quantifier = .required },
12751 .{ .kind = .literal_integer, .quantifier = .required },
12752 },
12753 },
12754 .{
12755 .name = "OpArbitraryFloatCastToIntINTEL",
12756 .opcode = 5843,
12757 .operands = &.{
12758 .{ .kind = .id_result_type, .quantifier = .required },
12759 .{ .kind = .id_result, .quantifier = .required },
12760 .{ .kind = .id_ref, .quantifier = .required },
12761 .{ .kind = .literal_integer, .quantifier = .required },
12762 .{ .kind = .literal_integer, .quantifier = .required },
12763 .{ .kind = .literal_integer, .quantifier = .required },
12764 .{ .kind = .literal_integer, .quantifier = .required },
12765 .{ .kind = .literal_integer, .quantifier = .required },
12766 },
12767 },
12768 .{
12769 .name = "OpArbitraryFloatAddINTEL",
12770 .opcode = 5846,
12771 .operands = &.{
12772 .{ .kind = .id_result_type, .quantifier = .required },
12773 .{ .kind = .id_result, .quantifier = .required },
12774 .{ .kind = .id_ref, .quantifier = .required },
12775 .{ .kind = .literal_integer, .quantifier = .required },
12776 .{ .kind = .id_ref, .quantifier = .required },
12777 .{ .kind = .literal_integer, .quantifier = .required },
12778 .{ .kind = .literal_integer, .quantifier = .required },
12779 .{ .kind = .literal_integer, .quantifier = .required },
12780 .{ .kind = .literal_integer, .quantifier = .required },
12781 .{ .kind = .literal_integer, .quantifier = .required },
12782 },
12783 },
12784 .{
12785 .name = "OpArbitraryFloatSubINTEL",
12786 .opcode = 5847,
12787 .operands = &.{
12788 .{ .kind = .id_result_type, .quantifier = .required },
12789 .{ .kind = .id_result, .quantifier = .required },
12790 .{ .kind = .id_ref, .quantifier = .required },
12791 .{ .kind = .literal_integer, .quantifier = .required },
12792 .{ .kind = .id_ref, .quantifier = .required },
12793 .{ .kind = .literal_integer, .quantifier = .required },
12794 .{ .kind = .literal_integer, .quantifier = .required },
12795 .{ .kind = .literal_integer, .quantifier = .required },
12796 .{ .kind = .literal_integer, .quantifier = .required },
12797 .{ .kind = .literal_integer, .quantifier = .required },
12798 },
12799 },
12800 .{
12801 .name = "OpArbitraryFloatMulINTEL",
12802 .opcode = 5848,
12803 .operands = &.{
12804 .{ .kind = .id_result_type, .quantifier = .required },
12805 .{ .kind = .id_result, .quantifier = .required },
12806 .{ .kind = .id_ref, .quantifier = .required },
12807 .{ .kind = .literal_integer, .quantifier = .required },
12808 .{ .kind = .id_ref, .quantifier = .required },
12809 .{ .kind = .literal_integer, .quantifier = .required },
12810 .{ .kind = .literal_integer, .quantifier = .required },
12811 .{ .kind = .literal_integer, .quantifier = .required },
12812 .{ .kind = .literal_integer, .quantifier = .required },
12813 .{ .kind = .literal_integer, .quantifier = .required },
12814 },
12815 },
12816 .{
12817 .name = "OpArbitraryFloatDivINTEL",
12818 .opcode = 5849,
12819 .operands = &.{
12820 .{ .kind = .id_result_type, .quantifier = .required },
12821 .{ .kind = .id_result, .quantifier = .required },
12822 .{ .kind = .id_ref, .quantifier = .required },
12823 .{ .kind = .literal_integer, .quantifier = .required },
12824 .{ .kind = .id_ref, .quantifier = .required },
12825 .{ .kind = .literal_integer, .quantifier = .required },
12826 .{ .kind = .literal_integer, .quantifier = .required },
12827 .{ .kind = .literal_integer, .quantifier = .required },
12828 .{ .kind = .literal_integer, .quantifier = .required },
12829 .{ .kind = .literal_integer, .quantifier = .required },
12830 },
12831 },
12832 .{
12833 .name = "OpArbitraryFloatGTINTEL",
12834 .opcode = 5850,
12835 .operands = &.{
12836 .{ .kind = .id_result_type, .quantifier = .required },
12837 .{ .kind = .id_result, .quantifier = .required },
12838 .{ .kind = .id_ref, .quantifier = .required },
12839 .{ .kind = .literal_integer, .quantifier = .required },
12840 .{ .kind = .id_ref, .quantifier = .required },
12841 .{ .kind = .literal_integer, .quantifier = .required },
12842 },
12843 },
12844 .{
12845 .name = "OpArbitraryFloatGEINTEL",
12846 .opcode = 5851,
12847 .operands = &.{
12848 .{ .kind = .id_result_type, .quantifier = .required },
12849 .{ .kind = .id_result, .quantifier = .required },
12850 .{ .kind = .id_ref, .quantifier = .required },
12851 .{ .kind = .literal_integer, .quantifier = .required },
12852 .{ .kind = .id_ref, .quantifier = .required },
12853 .{ .kind = .literal_integer, .quantifier = .required },
12854 },
12855 },
12856 .{
12857 .name = "OpArbitraryFloatLTINTEL",
12858 .opcode = 5852,
12859 .operands = &.{
12860 .{ .kind = .id_result_type, .quantifier = .required },
12861 .{ .kind = .id_result, .quantifier = .required },
12862 .{ .kind = .id_ref, .quantifier = .required },
12863 .{ .kind = .literal_integer, .quantifier = .required },
12864 .{ .kind = .id_ref, .quantifier = .required },
12865 .{ .kind = .literal_integer, .quantifier = .required },
12866 },
12867 },
12868 .{
12869 .name = "OpArbitraryFloatLEINTEL",
12870 .opcode = 5853,
12871 .operands = &.{
12872 .{ .kind = .id_result_type, .quantifier = .required },
12873 .{ .kind = .id_result, .quantifier = .required },
12874 .{ .kind = .id_ref, .quantifier = .required },
12875 .{ .kind = .literal_integer, .quantifier = .required },
12876 .{ .kind = .id_ref, .quantifier = .required },
12877 .{ .kind = .literal_integer, .quantifier = .required },
12878 },
12879 },
12880 .{
12881 .name = "OpArbitraryFloatEQINTEL",
12882 .opcode = 5854,
12883 .operands = &.{
12884 .{ .kind = .id_result_type, .quantifier = .required },
12885 .{ .kind = .id_result, .quantifier = .required },
12886 .{ .kind = .id_ref, .quantifier = .required },
12887 .{ .kind = .literal_integer, .quantifier = .required },
12888 .{ .kind = .id_ref, .quantifier = .required },
12889 .{ .kind = .literal_integer, .quantifier = .required },
12890 },
12891 },
12892 .{
12893 .name = "OpArbitraryFloatRecipINTEL",
12894 .opcode = 5855,
12895 .operands = &.{
12896 .{ .kind = .id_result_type, .quantifier = .required },
12897 .{ .kind = .id_result, .quantifier = .required },
12898 .{ .kind = .id_ref, .quantifier = .required },
12899 .{ .kind = .literal_integer, .quantifier = .required },
12900 .{ .kind = .literal_integer, .quantifier = .required },
12901 .{ .kind = .literal_integer, .quantifier = .required },
12902 .{ .kind = .literal_integer, .quantifier = .required },
12903 .{ .kind = .literal_integer, .quantifier = .required },
12904 },
12905 },
12906 .{
12907 .name = "OpArbitraryFloatRSqrtINTEL",
12908 .opcode = 5856,
12909 .operands = &.{
12910 .{ .kind = .id_result_type, .quantifier = .required },
12911 .{ .kind = .id_result, .quantifier = .required },
12912 .{ .kind = .id_ref, .quantifier = .required },
12913 .{ .kind = .literal_integer, .quantifier = .required },
12914 .{ .kind = .literal_integer, .quantifier = .required },
12915 .{ .kind = .literal_integer, .quantifier = .required },
12916 .{ .kind = .literal_integer, .quantifier = .required },
12917 .{ .kind = .literal_integer, .quantifier = .required },
12918 },
12919 },
12920 .{
12921 .name = "OpArbitraryFloatCbrtINTEL",
12922 .opcode = 5857,
12923 .operands = &.{
12924 .{ .kind = .id_result_type, .quantifier = .required },
12925 .{ .kind = .id_result, .quantifier = .required },
12926 .{ .kind = .id_ref, .quantifier = .required },
12927 .{ .kind = .literal_integer, .quantifier = .required },
12928 .{ .kind = .literal_integer, .quantifier = .required },
12929 .{ .kind = .literal_integer, .quantifier = .required },
12930 .{ .kind = .literal_integer, .quantifier = .required },
12931 .{ .kind = .literal_integer, .quantifier = .required },
12932 },
12933 },
12934 .{
12935 .name = "OpArbitraryFloatHypotINTEL",
12936 .opcode = 5858,
12937 .operands = &.{
12938 .{ .kind = .id_result_type, .quantifier = .required },
12939 .{ .kind = .id_result, .quantifier = .required },
12940 .{ .kind = .id_ref, .quantifier = .required },
12941 .{ .kind = .literal_integer, .quantifier = .required },
12942 .{ .kind = .id_ref, .quantifier = .required },
12943 .{ .kind = .literal_integer, .quantifier = .required },
12944 .{ .kind = .literal_integer, .quantifier = .required },
12945 .{ .kind = .literal_integer, .quantifier = .required },
12946 .{ .kind = .literal_integer, .quantifier = .required },
12947 .{ .kind = .literal_integer, .quantifier = .required },
12948 },
12949 },
12950 .{
12951 .name = "OpArbitraryFloatSqrtINTEL",
12952 .opcode = 5859,
12953 .operands = &.{
12954 .{ .kind = .id_result_type, .quantifier = .required },
12955 .{ .kind = .id_result, .quantifier = .required },
12956 .{ .kind = .id_ref, .quantifier = .required },
12957 .{ .kind = .literal_integer, .quantifier = .required },
12958 .{ .kind = .literal_integer, .quantifier = .required },
12959 .{ .kind = .literal_integer, .quantifier = .required },
12960 .{ .kind = .literal_integer, .quantifier = .required },
12961 .{ .kind = .literal_integer, .quantifier = .required },
12962 },
12963 },
12964 .{
12965 .name = "OpArbitraryFloatLogINTEL",
12966 .opcode = 5860,
12967 .operands = &.{
12968 .{ .kind = .id_result_type, .quantifier = .required },
12969 .{ .kind = .id_result, .quantifier = .required },
12970 .{ .kind = .id_ref, .quantifier = .required },
12971 .{ .kind = .literal_integer, .quantifier = .required },
12972 .{ .kind = .literal_integer, .quantifier = .required },
12973 .{ .kind = .literal_integer, .quantifier = .required },
12974 .{ .kind = .literal_integer, .quantifier = .required },
12975 .{ .kind = .literal_integer, .quantifier = .required },
12976 },
12977 },
12978 .{
12979 .name = "OpArbitraryFloatLog2INTEL",
12980 .opcode = 5861,
12981 .operands = &.{
12982 .{ .kind = .id_result_type, .quantifier = .required },
12983 .{ .kind = .id_result, .quantifier = .required },
12984 .{ .kind = .id_ref, .quantifier = .required },
12985 .{ .kind = .literal_integer, .quantifier = .required },
12986 .{ .kind = .literal_integer, .quantifier = .required },
12987 .{ .kind = .literal_integer, .quantifier = .required },
12988 .{ .kind = .literal_integer, .quantifier = .required },
12989 .{ .kind = .literal_integer, .quantifier = .required },
12990 },
12991 },
12992 .{
12993 .name = "OpArbitraryFloatLog10INTEL",
12994 .opcode = 5862,
12995 .operands = &.{
12996 .{ .kind = .id_result_type, .quantifier = .required },
12997 .{ .kind = .id_result, .quantifier = .required },
12998 .{ .kind = .id_ref, .quantifier = .required },
12999 .{ .kind = .literal_integer, .quantifier = .required },
13000 .{ .kind = .literal_integer, .quantifier = .required },
13001 .{ .kind = .literal_integer, .quantifier = .required },
13002 .{ .kind = .literal_integer, .quantifier = .required },
13003 .{ .kind = .literal_integer, .quantifier = .required },
13004 },
13005 },
13006 .{
13007 .name = "OpArbitraryFloatLog1pINTEL",
13008 .opcode = 5863,
13009 .operands = &.{
13010 .{ .kind = .id_result_type, .quantifier = .required },
13011 .{ .kind = .id_result, .quantifier = .required },
13012 .{ .kind = .id_ref, .quantifier = .required },
13013 .{ .kind = .literal_integer, .quantifier = .required },
13014 .{ .kind = .literal_integer, .quantifier = .required },
13015 .{ .kind = .literal_integer, .quantifier = .required },
13016 .{ .kind = .literal_integer, .quantifier = .required },
13017 .{ .kind = .literal_integer, .quantifier = .required },
13018 },
13019 },
13020 .{
13021 .name = "OpArbitraryFloatExpINTEL",
13022 .opcode = 5864,
13023 .operands = &.{
13024 .{ .kind = .id_result_type, .quantifier = .required },
13025 .{ .kind = .id_result, .quantifier = .required },
13026 .{ .kind = .id_ref, .quantifier = .required },
13027 .{ .kind = .literal_integer, .quantifier = .required },
13028 .{ .kind = .literal_integer, .quantifier = .required },
13029 .{ .kind = .literal_integer, .quantifier = .required },
13030 .{ .kind = .literal_integer, .quantifier = .required },
13031 .{ .kind = .literal_integer, .quantifier = .required },
13032 },
13033 },
13034 .{
13035 .name = "OpArbitraryFloatExp2INTEL",
13036 .opcode = 5865,
13037 .operands = &.{
13038 .{ .kind = .id_result_type, .quantifier = .required },
13039 .{ .kind = .id_result, .quantifier = .required },
13040 .{ .kind = .id_ref, .quantifier = .required },
13041 .{ .kind = .literal_integer, .quantifier = .required },
13042 .{ .kind = .literal_integer, .quantifier = .required },
13043 .{ .kind = .literal_integer, .quantifier = .required },
13044 .{ .kind = .literal_integer, .quantifier = .required },
13045 .{ .kind = .literal_integer, .quantifier = .required },
13046 },
13047 },
13048 .{
13049 .name = "OpArbitraryFloatExp10INTEL",
13050 .opcode = 5866,
13051 .operands = &.{
13052 .{ .kind = .id_result_type, .quantifier = .required },
13053 .{ .kind = .id_result, .quantifier = .required },
13054 .{ .kind = .id_ref, .quantifier = .required },
13055 .{ .kind = .literal_integer, .quantifier = .required },
13056 .{ .kind = .literal_integer, .quantifier = .required },
13057 .{ .kind = .literal_integer, .quantifier = .required },
13058 .{ .kind = .literal_integer, .quantifier = .required },
13059 .{ .kind = .literal_integer, .quantifier = .required },
13060 },
13061 },
13062 .{
13063 .name = "OpArbitraryFloatExpm1INTEL",
13064 .opcode = 5867,
13065 .operands = &.{
13066 .{ .kind = .id_result_type, .quantifier = .required },
13067 .{ .kind = .id_result, .quantifier = .required },
13068 .{ .kind = .id_ref, .quantifier = .required },
13069 .{ .kind = .literal_integer, .quantifier = .required },
13070 .{ .kind = .literal_integer, .quantifier = .required },
13071 .{ .kind = .literal_integer, .quantifier = .required },
13072 .{ .kind = .literal_integer, .quantifier = .required },
13073 .{ .kind = .literal_integer, .quantifier = .required },
13074 },
13075 },
13076 .{
13077 .name = "OpArbitraryFloatSinINTEL",
13078 .opcode = 5868,
13079 .operands = &.{
13080 .{ .kind = .id_result_type, .quantifier = .required },
13081 .{ .kind = .id_result, .quantifier = .required },
13082 .{ .kind = .id_ref, .quantifier = .required },
13083 .{ .kind = .literal_integer, .quantifier = .required },
13084 .{ .kind = .literal_integer, .quantifier = .required },
13085 .{ .kind = .literal_integer, .quantifier = .required },
13086 .{ .kind = .literal_integer, .quantifier = .required },
13087 .{ .kind = .literal_integer, .quantifier = .required },
13088 },
13089 },
13090 .{
13091 .name = "OpArbitraryFloatCosINTEL",
13092 .opcode = 5869,
13093 .operands = &.{
13094 .{ .kind = .id_result_type, .quantifier = .required },
13095 .{ .kind = .id_result, .quantifier = .required },
13096 .{ .kind = .id_ref, .quantifier = .required },
13097 .{ .kind = .literal_integer, .quantifier = .required },
13098 .{ .kind = .literal_integer, .quantifier = .required },
13099 .{ .kind = .literal_integer, .quantifier = .required },
13100 .{ .kind = .literal_integer, .quantifier = .required },
13101 .{ .kind = .literal_integer, .quantifier = .required },
13102 },
13103 },
13104 .{
13105 .name = "OpArbitraryFloatSinCosINTEL",
13106 .opcode = 5870,
13107 .operands = &.{
13108 .{ .kind = .id_result_type, .quantifier = .required },
13109 .{ .kind = .id_result, .quantifier = .required },
13110 .{ .kind = .id_ref, .quantifier = .required },
13111 .{ .kind = .literal_integer, .quantifier = .required },
13112 .{ .kind = .literal_integer, .quantifier = .required },
13113 .{ .kind = .literal_integer, .quantifier = .required },
13114 .{ .kind = .literal_integer, .quantifier = .required },
13115 .{ .kind = .literal_integer, .quantifier = .required },
13116 },
13117 },
13118 .{
13119 .name = "OpArbitraryFloatSinPiINTEL",
13120 .opcode = 5871,
13121 .operands = &.{
13122 .{ .kind = .id_result_type, .quantifier = .required },
13123 .{ .kind = .id_result, .quantifier = .required },
13124 .{ .kind = .id_ref, .quantifier = .required },
13125 .{ .kind = .literal_integer, .quantifier = .required },
13126 .{ .kind = .literal_integer, .quantifier = .required },
13127 .{ .kind = .literal_integer, .quantifier = .required },
13128 .{ .kind = .literal_integer, .quantifier = .required },
13129 .{ .kind = .literal_integer, .quantifier = .required },
13130 },
13131 },
13132 .{
13133 .name = "OpArbitraryFloatCosPiINTEL",
13134 .opcode = 5872,
13135 .operands = &.{
13136 .{ .kind = .id_result_type, .quantifier = .required },
13137 .{ .kind = .id_result, .quantifier = .required },
13138 .{ .kind = .id_ref, .quantifier = .required },
13139 .{ .kind = .literal_integer, .quantifier = .required },
13140 .{ .kind = .literal_integer, .quantifier = .required },
13141 .{ .kind = .literal_integer, .quantifier = .required },
13142 .{ .kind = .literal_integer, .quantifier = .required },
13143 .{ .kind = .literal_integer, .quantifier = .required },
13144 },
13145 },
13146 .{
13147 .name = "OpArbitraryFloatASinINTEL",
13148 .opcode = 5873,
13149 .operands = &.{
13150 .{ .kind = .id_result_type, .quantifier = .required },
13151 .{ .kind = .id_result, .quantifier = .required },
13152 .{ .kind = .id_ref, .quantifier = .required },
13153 .{ .kind = .literal_integer, .quantifier = .required },
13154 .{ .kind = .literal_integer, .quantifier = .required },
13155 .{ .kind = .literal_integer, .quantifier = .required },
13156 .{ .kind = .literal_integer, .quantifier = .required },
13157 .{ .kind = .literal_integer, .quantifier = .required },
13158 },
13159 },
13160 .{
13161 .name = "OpArbitraryFloatASinPiINTEL",
13162 .opcode = 5874,
13163 .operands = &.{
13164 .{ .kind = .id_result_type, .quantifier = .required },
13165 .{ .kind = .id_result, .quantifier = .required },
13166 .{ .kind = .id_ref, .quantifier = .required },
13167 .{ .kind = .literal_integer, .quantifier = .required },
13168 .{ .kind = .literal_integer, .quantifier = .required },
13169 .{ .kind = .literal_integer, .quantifier = .required },
13170 .{ .kind = .literal_integer, .quantifier = .required },
13171 .{ .kind = .literal_integer, .quantifier = .required },
13172 },
13173 },
13174 .{
13175 .name = "OpArbitraryFloatACosINTEL",
13176 .opcode = 5875,
13177 .operands = &.{
13178 .{ .kind = .id_result_type, .quantifier = .required },
13179 .{ .kind = .id_result, .quantifier = .required },
13180 .{ .kind = .id_ref, .quantifier = .required },
13181 .{ .kind = .literal_integer, .quantifier = .required },
13182 .{ .kind = .literal_integer, .quantifier = .required },
13183 .{ .kind = .literal_integer, .quantifier = .required },
13184 .{ .kind = .literal_integer, .quantifier = .required },
13185 .{ .kind = .literal_integer, .quantifier = .required },
13186 },
13187 },
13188 .{
13189 .name = "OpArbitraryFloatACosPiINTEL",
13190 .opcode = 5876,
13191 .operands = &.{
13192 .{ .kind = .id_result_type, .quantifier = .required },
13193 .{ .kind = .id_result, .quantifier = .required },
13194 .{ .kind = .id_ref, .quantifier = .required },
13195 .{ .kind = .literal_integer, .quantifier = .required },
13196 .{ .kind = .literal_integer, .quantifier = .required },
13197 .{ .kind = .literal_integer, .quantifier = .required },
13198 .{ .kind = .literal_integer, .quantifier = .required },
13199 .{ .kind = .literal_integer, .quantifier = .required },
13200 },
13201 },
13202 .{
13203 .name = "OpArbitraryFloatATanINTEL",
13204 .opcode = 5877,
13205 .operands = &.{
13206 .{ .kind = .id_result_type, .quantifier = .required },
13207 .{ .kind = .id_result, .quantifier = .required },
13208 .{ .kind = .id_ref, .quantifier = .required },
13209 .{ .kind = .literal_integer, .quantifier = .required },
13210 .{ .kind = .literal_integer, .quantifier = .required },
13211 .{ .kind = .literal_integer, .quantifier = .required },
13212 .{ .kind = .literal_integer, .quantifier = .required },
13213 .{ .kind = .literal_integer, .quantifier = .required },
13214 },
13215 },
13216 .{
13217 .name = "OpArbitraryFloatATanPiINTEL",
13218 .opcode = 5878,
13219 .operands = &.{
13220 .{ .kind = .id_result_type, .quantifier = .required },
13221 .{ .kind = .id_result, .quantifier = .required },
13222 .{ .kind = .id_ref, .quantifier = .required },
13223 .{ .kind = .literal_integer, .quantifier = .required },
13224 .{ .kind = .literal_integer, .quantifier = .required },
13225 .{ .kind = .literal_integer, .quantifier = .required },
13226 .{ .kind = .literal_integer, .quantifier = .required },
13227 .{ .kind = .literal_integer, .quantifier = .required },
13228 },
13229 },
13230 .{
13231 .name = "OpArbitraryFloatATan2INTEL",
13232 .opcode = 5879,
13233 .operands = &.{
13234 .{ .kind = .id_result_type, .quantifier = .required },
13235 .{ .kind = .id_result, .quantifier = .required },
13236 .{ .kind = .id_ref, .quantifier = .required },
13237 .{ .kind = .literal_integer, .quantifier = .required },
13238 .{ .kind = .id_ref, .quantifier = .required },
13239 .{ .kind = .literal_integer, .quantifier = .required },
13240 .{ .kind = .literal_integer, .quantifier = .required },
13241 .{ .kind = .literal_integer, .quantifier = .required },
13242 .{ .kind = .literal_integer, .quantifier = .required },
13243 .{ .kind = .literal_integer, .quantifier = .required },
13244 },
13245 },
13246 .{
13247 .name = "OpArbitraryFloatPowINTEL",
13248 .opcode = 5880,
13249 .operands = &.{
13250 .{ .kind = .id_result_type, .quantifier = .required },
13251 .{ .kind = .id_result, .quantifier = .required },
13252 .{ .kind = .id_ref, .quantifier = .required },
13253 .{ .kind = .literal_integer, .quantifier = .required },
13254 .{ .kind = .id_ref, .quantifier = .required },
13255 .{ .kind = .literal_integer, .quantifier = .required },
13256 .{ .kind = .literal_integer, .quantifier = .required },
13257 .{ .kind = .literal_integer, .quantifier = .required },
13258 .{ .kind = .literal_integer, .quantifier = .required },
13259 .{ .kind = .literal_integer, .quantifier = .required },
13260 },
13261 },
13262 .{
13263 .name = "OpArbitraryFloatPowRINTEL",
13264 .opcode = 5881,
13265 .operands = &.{
13266 .{ .kind = .id_result_type, .quantifier = .required },
13267 .{ .kind = .id_result, .quantifier = .required },
13268 .{ .kind = .id_ref, .quantifier = .required },
13269 .{ .kind = .literal_integer, .quantifier = .required },
13270 .{ .kind = .id_ref, .quantifier = .required },
13271 .{ .kind = .literal_integer, .quantifier = .required },
13272 .{ .kind = .literal_integer, .quantifier = .required },
13273 .{ .kind = .literal_integer, .quantifier = .required },
13274 .{ .kind = .literal_integer, .quantifier = .required },
13275 .{ .kind = .literal_integer, .quantifier = .required },
13276 },
13277 },
13278 .{
13279 .name = "OpArbitraryFloatPowNINTEL",
13280 .opcode = 5882,
13281 .operands = &.{
13282 .{ .kind = .id_result_type, .quantifier = .required },
13283 .{ .kind = .id_result, .quantifier = .required },
13284 .{ .kind = .id_ref, .quantifier = .required },
13285 .{ .kind = .literal_integer, .quantifier = .required },
13286 .{ .kind = .id_ref, .quantifier = .required },
13287 .{ .kind = .literal_integer, .quantifier = .required },
13288 .{ .kind = .literal_integer, .quantifier = .required },
13289 .{ .kind = .literal_integer, .quantifier = .required },
13290 .{ .kind = .literal_integer, .quantifier = .required },
13291 .{ .kind = .literal_integer, .quantifier = .required },
13292 },
13293 },
13294 .{
13295 .name = "OpLoopControlINTEL",
13296 .opcode = 5887,
13297 .operands = &.{
13298 .{ .kind = .literal_integer, .quantifier = .variadic },
13299 },
13300 },
13301 .{
13302 .name = "OpAliasDomainDeclINTEL",
13303 .opcode = 5911,
13304 .operands = &.{
13305 .{ .kind = .id_result, .quantifier = .required },
13306 .{ .kind = .id_ref, .quantifier = .optional },
13307 },
13308 },
13309 .{
13310 .name = "OpAliasScopeDeclINTEL",
13311 .opcode = 5912,
13312 .operands = &.{
13313 .{ .kind = .id_result, .quantifier = .required },
13314 .{ .kind = .id_ref, .quantifier = .required },
13315 .{ .kind = .id_ref, .quantifier = .optional },
13316 },
13317 },
13318 .{
13319 .name = "OpAliasScopeListDeclINTEL",
13320 .opcode = 5913,
13321 .operands = &.{
13322 .{ .kind = .id_result, .quantifier = .required },
13323 .{ .kind = .id_ref, .quantifier = .variadic },
13324 },
13325 },
13326 .{
13327 .name = "OpFixedSqrtINTEL",
13328 .opcode = 5923,
13329 .operands = &.{
13330 .{ .kind = .id_result_type, .quantifier = .required },
13331 .{ .kind = .id_result, .quantifier = .required },
13332 .{ .kind = .id_ref, .quantifier = .required },
13333 .{ .kind = .literal_integer, .quantifier = .required },
13334 .{ .kind = .literal_integer, .quantifier = .required },
13335 .{ .kind = .literal_integer, .quantifier = .required },
13336 .{ .kind = .literal_integer, .quantifier = .required },
13337 .{ .kind = .literal_integer, .quantifier = .required },
13338 },
13339 },
13340 .{
13341 .name = "OpFixedRecipINTEL",
13342 .opcode = 5924,
13343 .operands = &.{
13344 .{ .kind = .id_result_type, .quantifier = .required },
13345 .{ .kind = .id_result, .quantifier = .required },
13346 .{ .kind = .id_ref, .quantifier = .required },
13347 .{ .kind = .literal_integer, .quantifier = .required },
13348 .{ .kind = .literal_integer, .quantifier = .required },
13349 .{ .kind = .literal_integer, .quantifier = .required },
13350 .{ .kind = .literal_integer, .quantifier = .required },
13351 .{ .kind = .literal_integer, .quantifier = .required },
13352 },
13353 },
13354 .{
13355 .name = "OpFixedRsqrtINTEL",
13356 .opcode = 5925,
13357 .operands = &.{
13358 .{ .kind = .id_result_type, .quantifier = .required },
13359 .{ .kind = .id_result, .quantifier = .required },
13360 .{ .kind = .id_ref, .quantifier = .required },
13361 .{ .kind = .literal_integer, .quantifier = .required },
13362 .{ .kind = .literal_integer, .quantifier = .required },
13363 .{ .kind = .literal_integer, .quantifier = .required },
13364 .{ .kind = .literal_integer, .quantifier = .required },
13365 .{ .kind = .literal_integer, .quantifier = .required },
13366 },
13367 },
13368 .{
13369 .name = "OpFixedSinINTEL",
13370 .opcode = 5926,
13371 .operands = &.{
13372 .{ .kind = .id_result_type, .quantifier = .required },
13373 .{ .kind = .id_result, .quantifier = .required },
13374 .{ .kind = .id_ref, .quantifier = .required },
13375 .{ .kind = .literal_integer, .quantifier = .required },
13376 .{ .kind = .literal_integer, .quantifier = .required },
13377 .{ .kind = .literal_integer, .quantifier = .required },
13378 .{ .kind = .literal_integer, .quantifier = .required },
13379 .{ .kind = .literal_integer, .quantifier = .required },
13380 },
13381 },
13382 .{
13383 .name = "OpFixedCosINTEL",
13384 .opcode = 5927,
13385 .operands = &.{
13386 .{ .kind = .id_result_type, .quantifier = .required },
13387 .{ .kind = .id_result, .quantifier = .required },
13388 .{ .kind = .id_ref, .quantifier = .required },
13389 .{ .kind = .literal_integer, .quantifier = .required },
13390 .{ .kind = .literal_integer, .quantifier = .required },
13391 .{ .kind = .literal_integer, .quantifier = .required },
13392 .{ .kind = .literal_integer, .quantifier = .required },
13393 .{ .kind = .literal_integer, .quantifier = .required },
13394 },
13395 },
13396 .{
13397 .name = "OpFixedSinCosINTEL",
13398 .opcode = 5928,
13399 .operands = &.{
13400 .{ .kind = .id_result_type, .quantifier = .required },
13401 .{ .kind = .id_result, .quantifier = .required },
13402 .{ .kind = .id_ref, .quantifier = .required },
13403 .{ .kind = .literal_integer, .quantifier = .required },
13404 .{ .kind = .literal_integer, .quantifier = .required },
13405 .{ .kind = .literal_integer, .quantifier = .required },
13406 .{ .kind = .literal_integer, .quantifier = .required },
13407 .{ .kind = .literal_integer, .quantifier = .required },
13408 },
13409 },
13410 .{
13411 .name = "OpFixedSinPiINTEL",
13412 .opcode = 5929,
13413 .operands = &.{
13414 .{ .kind = .id_result_type, .quantifier = .required },
13415 .{ .kind = .id_result, .quantifier = .required },
13416 .{ .kind = .id_ref, .quantifier = .required },
13417 .{ .kind = .literal_integer, .quantifier = .required },
13418 .{ .kind = .literal_integer, .quantifier = .required },
13419 .{ .kind = .literal_integer, .quantifier = .required },
13420 .{ .kind = .literal_integer, .quantifier = .required },
13421 .{ .kind = .literal_integer, .quantifier = .required },
13422 },
13423 },
13424 .{
13425 .name = "OpFixedCosPiINTEL",
13426 .opcode = 5930,
13427 .operands = &.{
13428 .{ .kind = .id_result_type, .quantifier = .required },
13429 .{ .kind = .id_result, .quantifier = .required },
13430 .{ .kind = .id_ref, .quantifier = .required },
13431 .{ .kind = .literal_integer, .quantifier = .required },
13432 .{ .kind = .literal_integer, .quantifier = .required },
13433 .{ .kind = .literal_integer, .quantifier = .required },
13434 .{ .kind = .literal_integer, .quantifier = .required },
13435 .{ .kind = .literal_integer, .quantifier = .required },
13436 },
13437 },
13438 .{
13439 .name = "OpFixedSinCosPiINTEL",
13440 .opcode = 5931,
13441 .operands = &.{
13442 .{ .kind = .id_result_type, .quantifier = .required },
13443 .{ .kind = .id_result, .quantifier = .required },
13444 .{ .kind = .id_ref, .quantifier = .required },
13445 .{ .kind = .literal_integer, .quantifier = .required },
13446 .{ .kind = .literal_integer, .quantifier = .required },
13447 .{ .kind = .literal_integer, .quantifier = .required },
13448 .{ .kind = .literal_integer, .quantifier = .required },
13449 .{ .kind = .literal_integer, .quantifier = .required },
13450 },
13451 },
13452 .{
13453 .name = "OpFixedLogINTEL",
13454 .opcode = 5932,
13455 .operands = &.{
13456 .{ .kind = .id_result_type, .quantifier = .required },
13457 .{ .kind = .id_result, .quantifier = .required },
13458 .{ .kind = .id_ref, .quantifier = .required },
13459 .{ .kind = .literal_integer, .quantifier = .required },
13460 .{ .kind = .literal_integer, .quantifier = .required },
13461 .{ .kind = .literal_integer, .quantifier = .required },
13462 .{ .kind = .literal_integer, .quantifier = .required },
13463 .{ .kind = .literal_integer, .quantifier = .required },
13464 },
13465 },
13466 .{
13467 .name = "OpFixedExpINTEL",
13468 .opcode = 5933,
13469 .operands = &.{
13470 .{ .kind = .id_result_type, .quantifier = .required },
13471 .{ .kind = .id_result, .quantifier = .required },
13472 .{ .kind = .id_ref, .quantifier = .required },
13473 .{ .kind = .literal_integer, .quantifier = .required },
13474 .{ .kind = .literal_integer, .quantifier = .required },
13475 .{ .kind = .literal_integer, .quantifier = .required },
13476 .{ .kind = .literal_integer, .quantifier = .required },
13477 .{ .kind = .literal_integer, .quantifier = .required },
13478 },
13479 },
13480 .{
13481 .name = "OpPtrCastToCrossWorkgroupINTEL",
13482 .opcode = 5934,
13483 .operands = &.{
13484 .{ .kind = .id_result_type, .quantifier = .required },
13485 .{ .kind = .id_result, .quantifier = .required },
13486 .{ .kind = .id_ref, .quantifier = .required },
13487 },
13488 },
13489 .{
13490 .name = "OpCrossWorkgroupCastToPtrINTEL",
13491 .opcode = 5938,
13492 .operands = &.{
13493 .{ .kind = .id_result_type, .quantifier = .required },
13494 .{ .kind = .id_result, .quantifier = .required },
13495 .{ .kind = .id_ref, .quantifier = .required },
13496 },
13497 },
13498 .{
13499 .name = "OpReadPipeBlockingINTEL",
13500 .opcode = 5946,
13501 .operands = &.{
13502 .{ .kind = .id_result_type, .quantifier = .required },
13503 .{ .kind = .id_result, .quantifier = .required },
13504 .{ .kind = .id_ref, .quantifier = .required },
13505 .{ .kind = .id_ref, .quantifier = .required },
13506 },
13507 },
13508 .{
13509 .name = "OpWritePipeBlockingINTEL",
13510 .opcode = 5947,
13511 .operands = &.{
13512 .{ .kind = .id_result_type, .quantifier = .required },
13513 .{ .kind = .id_result, .quantifier = .required },
13514 .{ .kind = .id_ref, .quantifier = .required },
13515 .{ .kind = .id_ref, .quantifier = .required },
13516 },
13517 },
13518 .{
13519 .name = "OpFPGARegINTEL",
13520 .opcode = 5949,
13521 .operands = &.{
13522 .{ .kind = .id_result_type, .quantifier = .required },
13523 .{ .kind = .id_result, .quantifier = .required },
13524 .{ .kind = .id_ref, .quantifier = .required },
13525 },
13526 },
13527 .{
13528 .name = "OpRayQueryGetRayTMinKHR",
13529 .opcode = 6016,
13530 .operands = &.{
13531 .{ .kind = .id_result_type, .quantifier = .required },
13532 .{ .kind = .id_result, .quantifier = .required },
13533 .{ .kind = .id_ref, .quantifier = .required },
13534 },
13535 },
13536 .{
13537 .name = "OpRayQueryGetRayFlagsKHR",
13538 .opcode = 6017,
13539 .operands = &.{
13540 .{ .kind = .id_result_type, .quantifier = .required },
13541 .{ .kind = .id_result, .quantifier = .required },
13542 .{ .kind = .id_ref, .quantifier = .required },
13543 },
13544 },
13545 .{
13546 .name = "OpRayQueryGetIntersectionTKHR",
13547 .opcode = 6018,
13548 .operands = &.{
13549 .{ .kind = .id_result_type, .quantifier = .required },
13550 .{ .kind = .id_result, .quantifier = .required },
13551 .{ .kind = .id_ref, .quantifier = .required },
13552 .{ .kind = .id_ref, .quantifier = .required },
13553 },
13554 },
13555 .{
13556 .name = "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
13557 .opcode = 6019,
13558 .operands = &.{
13559 .{ .kind = .id_result_type, .quantifier = .required },
13560 .{ .kind = .id_result, .quantifier = .required },
13561 .{ .kind = .id_ref, .quantifier = .required },
13562 .{ .kind = .id_ref, .quantifier = .required },
13563 },
13564 },
13565 .{
13566 .name = "OpRayQueryGetIntersectionInstanceIdKHR",
13567 .opcode = 6020,
13568 .operands = &.{
13569 .{ .kind = .id_result_type, .quantifier = .required },
13570 .{ .kind = .id_result, .quantifier = .required },
13571 .{ .kind = .id_ref, .quantifier = .required },
13572 .{ .kind = .id_ref, .quantifier = .required },
13573 },
13574 },
13575 .{
13576 .name = "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
13577 .opcode = 6021,
13578 .operands = &.{
13579 .{ .kind = .id_result_type, .quantifier = .required },
13580 .{ .kind = .id_result, .quantifier = .required },
13581 .{ .kind = .id_ref, .quantifier = .required },
13582 .{ .kind = .id_ref, .quantifier = .required },
13583 },
13584 },
13585 .{
13586 .name = "OpRayQueryGetIntersectionGeometryIndexKHR",
13587 .opcode = 6022,
13588 .operands = &.{
13589 .{ .kind = .id_result_type, .quantifier = .required },
13590 .{ .kind = .id_result, .quantifier = .required },
13591 .{ .kind = .id_ref, .quantifier = .required },
13592 .{ .kind = .id_ref, .quantifier = .required },
13593 },
13594 },
13595 .{
13596 .name = "OpRayQueryGetIntersectionPrimitiveIndexKHR",
13597 .opcode = 6023,
13598 .operands = &.{
13599 .{ .kind = .id_result_type, .quantifier = .required },
13600 .{ .kind = .id_result, .quantifier = .required },
13601 .{ .kind = .id_ref, .quantifier = .required },
13602 .{ .kind = .id_ref, .quantifier = .required },
13603 },
13604 },
13605 .{
13606 .name = "OpRayQueryGetIntersectionBarycentricsKHR",
13607 .opcode = 6024,
13608 .operands = &.{
13609 .{ .kind = .id_result_type, .quantifier = .required },
13610 .{ .kind = .id_result, .quantifier = .required },
13611 .{ .kind = .id_ref, .quantifier = .required },
13612 .{ .kind = .id_ref, .quantifier = .required },
13613 },
13614 },
13615 .{
13616 .name = "OpRayQueryGetIntersectionFrontFaceKHR",
13617 .opcode = 6025,
13618 .operands = &.{
13619 .{ .kind = .id_result_type, .quantifier = .required },
13620 .{ .kind = .id_result, .quantifier = .required },
13621 .{ .kind = .id_ref, .quantifier = .required },
13622 .{ .kind = .id_ref, .quantifier = .required },
13623 },
13624 },
13625 .{
13626 .name = "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
13627 .opcode = 6026,
13628 .operands = &.{
13629 .{ .kind = .id_result_type, .quantifier = .required },
13630 .{ .kind = .id_result, .quantifier = .required },
13631 .{ .kind = .id_ref, .quantifier = .required },
13632 },
13633 },
13634 .{
13635 .name = "OpRayQueryGetIntersectionObjectRayDirectionKHR",
13636 .opcode = 6027,
13637 .operands = &.{
13638 .{ .kind = .id_result_type, .quantifier = .required },
13639 .{ .kind = .id_result, .quantifier = .required },
13640 .{ .kind = .id_ref, .quantifier = .required },
13641 .{ .kind = .id_ref, .quantifier = .required },
13642 },
13643 },
13644 .{
13645 .name = "OpRayQueryGetIntersectionObjectRayOriginKHR",
13646 .opcode = 6028,
13647 .operands = &.{
13648 .{ .kind = .id_result_type, .quantifier = .required },
13649 .{ .kind = .id_result, .quantifier = .required },
13650 .{ .kind = .id_ref, .quantifier = .required },
13651 .{ .kind = .id_ref, .quantifier = .required },
13652 },
13653 },
13654 .{
13655 .name = "OpRayQueryGetWorldRayDirectionKHR",
13656 .opcode = 6029,
13657 .operands = &.{
13658 .{ .kind = .id_result_type, .quantifier = .required },
13659 .{ .kind = .id_result, .quantifier = .required },
13660 .{ .kind = .id_ref, .quantifier = .required },
13661 },
13662 },
13663 .{
13664 .name = "OpRayQueryGetWorldRayOriginKHR",
13665 .opcode = 6030,
13666 .operands = &.{
13667 .{ .kind = .id_result_type, .quantifier = .required },
13668 .{ .kind = .id_result, .quantifier = .required },
13669 .{ .kind = .id_ref, .quantifier = .required },
13670 },
13671 },
13672 .{
13673 .name = "OpRayQueryGetIntersectionObjectToWorldKHR",
13674 .opcode = 6031,
13675 .operands = &.{
13676 .{ .kind = .id_result_type, .quantifier = .required },
13677 .{ .kind = .id_result, .quantifier = .required },
13678 .{ .kind = .id_ref, .quantifier = .required },
13679 .{ .kind = .id_ref, .quantifier = .required },
13680 },
13681 },
13682 .{
13683 .name = "OpRayQueryGetIntersectionWorldToObjectKHR",
13684 .opcode = 6032,
13685 .operands = &.{
13686 .{ .kind = .id_result_type, .quantifier = .required },
13687 .{ .kind = .id_result, .quantifier = .required },
13688 .{ .kind = .id_ref, .quantifier = .required },
13689 .{ .kind = .id_ref, .quantifier = .required },
13690 },
13691 },
13692 .{
13693 .name = "OpAtomicFAddEXT",
13694 .opcode = 6035,
13695 .operands = &.{
13696 .{ .kind = .id_result_type, .quantifier = .required },
13697 .{ .kind = .id_result, .quantifier = .required },
13698 .{ .kind = .id_ref, .quantifier = .required },
13699 .{ .kind = .id_scope, .quantifier = .required },
13700 .{ .kind = .id_memory_semantics, .quantifier = .required },
13701 .{ .kind = .id_ref, .quantifier = .required },
13702 },
13703 },
13704 .{
13705 .name = "OpTypeBufferSurfaceINTEL",
13706 .opcode = 6086,
13707 .operands = &.{
13708 .{ .kind = .id_result, .quantifier = .required },
13709 .{ .kind = .access_qualifier, .quantifier = .required },
13710 },
13711 },
13712 .{
13713 .name = "OpTypeStructContinuedINTEL",
13714 .opcode = 6090,
13715 .operands = &.{
13716 .{ .kind = .id_ref, .quantifier = .variadic },
13717 },
13718 },
13719 .{
13720 .name = "OpConstantCompositeContinuedINTEL",
13721 .opcode = 6091,
13722 .operands = &.{
13723 .{ .kind = .id_ref, .quantifier = .variadic },
13724 },
13725 },
13726 .{
13727 .name = "OpSpecConstantCompositeContinuedINTEL",
13728 .opcode = 6092,
13729 .operands = &.{
13730 .{ .kind = .id_ref, .quantifier = .variadic },
13731 },
13732 },
13733 .{
13734 .name = "OpCompositeConstructContinuedINTEL",
13735 .opcode = 6096,
13736 .operands = &.{
13737 .{ .kind = .id_result_type, .quantifier = .required },
13738 .{ .kind = .id_result, .quantifier = .required },
13739 .{ .kind = .id_ref, .quantifier = .variadic },
13740 },
13741 },
13742 .{
13743 .name = "OpConvertFToBF16INTEL",
13744 .opcode = 6116,
13745 .operands = &.{
13746 .{ .kind = .id_result_type, .quantifier = .required },
13747 .{ .kind = .id_result, .quantifier = .required },
13748 .{ .kind = .id_ref, .quantifier = .required },
13749 },
13750 },
13751 .{
13752 .name = "OpConvertBF16ToFINTEL",
13753 .opcode = 6117,
13754 .operands = &.{
13755 .{ .kind = .id_result_type, .quantifier = .required },
13756 .{ .kind = .id_result, .quantifier = .required },
13757 .{ .kind = .id_ref, .quantifier = .required },
13758 },
13759 },
13760 .{
13761 .name = "OpControlBarrierArriveINTEL",
13762 .opcode = 6142,
13763 .operands = &.{
13764 .{ .kind = .id_scope, .quantifier = .required },
13765 .{ .kind = .id_scope, .quantifier = .required },
13766 .{ .kind = .id_memory_semantics, .quantifier = .required },
13767 },
13768 },
13769 .{
13770 .name = "OpControlBarrierWaitINTEL",
13771 .opcode = 6143,
13772 .operands = &.{
13773 .{ .kind = .id_scope, .quantifier = .required },
13774 .{ .kind = .id_scope, .quantifier = .required },
13775 .{ .kind = .id_memory_semantics, .quantifier = .required },
13776 },
13777 },
13778 .{
13779 .name = "OpArithmeticFenceEXT",
13780 .opcode = 6145,
13781 .operands = &.{
13782 .{ .kind = .id_result_type, .quantifier = .required },
13783 .{ .kind = .id_result, .quantifier = .required },
13784 .{ .kind = .id_ref, .quantifier = .required },
13785 },
13786 },
13787 .{
13788 .name = "OpTaskSequenceCreateINTEL",
13789 .opcode = 6163,
13790 .operands = &.{
13791 .{ .kind = .id_result_type, .quantifier = .required },
13792 .{ .kind = .id_result, .quantifier = .required },
13793 .{ .kind = .id_ref, .quantifier = .required },
13794 .{ .kind = .literal_integer, .quantifier = .required },
13795 .{ .kind = .literal_integer, .quantifier = .required },
13796 .{ .kind = .literal_integer, .quantifier = .required },
13797 .{ .kind = .literal_integer, .quantifier = .required },
13798 },
13799 },
13800 .{
13801 .name = "OpTaskSequenceAsyncINTEL",
13802 .opcode = 6164,
13803 .operands = &.{
13804 .{ .kind = .id_ref, .quantifier = .required },
13805 .{ .kind = .id_ref, .quantifier = .variadic },
13806 },
13807 },
13808 .{
13809 .name = "OpTaskSequenceGetINTEL",
13810 .opcode = 6165,
13811 .operands = &.{
13812 .{ .kind = .id_result_type, .quantifier = .required },
13813 .{ .kind = .id_result, .quantifier = .required },
13814 .{ .kind = .id_ref, .quantifier = .required },
13815 },
13816 },
13817 .{
13818 .name = "OpTaskSequenceReleaseINTEL",
13819 .opcode = 6166,
13820 .operands = &.{
13821 .{ .kind = .id_ref, .quantifier = .required },
13822 },
13823 },
13824 .{
13825 .name = "OpTypeTaskSequenceINTEL",
13826 .opcode = 6199,
13827 .operands = &.{
13828 .{ .kind = .id_result, .quantifier = .required },
13829 },
13830 },
13831 .{
13832 .name = "OpSubgroupBlockPrefetchINTEL",
13833 .opcode = 6221,
13834 .operands = &.{
13835 .{ .kind = .id_ref, .quantifier = .required },
13836 .{ .kind = .id_ref, .quantifier = .required },
13837 .{ .kind = .memory_access, .quantifier = .optional },
13838 },
13839 },
13840 .{
13841 .name = "OpSubgroup2DBlockLoadINTEL",
13842 .opcode = 6231,
13843 .operands = &.{
13844 .{ .kind = .id_ref, .quantifier = .required },
13845 .{ .kind = .id_ref, .quantifier = .required },
13846 .{ .kind = .id_ref, .quantifier = .required },
13847 .{ .kind = .id_ref, .quantifier = .required },
13848 .{ .kind = .id_ref, .quantifier = .required },
13849 .{ .kind = .id_ref, .quantifier = .required },
13850 .{ .kind = .id_ref, .quantifier = .required },
13851 .{ .kind = .id_ref, .quantifier = .required },
13852 .{ .kind = .id_ref, .quantifier = .required },
13853 .{ .kind = .id_ref, .quantifier = .required },
13854 },
13855 },
13856 .{
13857 .name = "OpSubgroup2DBlockLoadTransformINTEL",
13858 .opcode = 6232,
13859 .operands = &.{
13860 .{ .kind = .id_ref, .quantifier = .required },
13861 .{ .kind = .id_ref, .quantifier = .required },
13862 .{ .kind = .id_ref, .quantifier = .required },
13863 .{ .kind = .id_ref, .quantifier = .required },
13864 .{ .kind = .id_ref, .quantifier = .required },
13865 .{ .kind = .id_ref, .quantifier = .required },
13866 .{ .kind = .id_ref, .quantifier = .required },
13867 .{ .kind = .id_ref, .quantifier = .required },
13868 .{ .kind = .id_ref, .quantifier = .required },
13869 .{ .kind = .id_ref, .quantifier = .required },
13870 },
13871 },
13872 .{
13873 .name = "OpSubgroup2DBlockLoadTransposeINTEL",
13874 .opcode = 6233,
13875 .operands = &.{
13876 .{ .kind = .id_ref, .quantifier = .required },
13877 .{ .kind = .id_ref, .quantifier = .required },
13878 .{ .kind = .id_ref, .quantifier = .required },
13879 .{ .kind = .id_ref, .quantifier = .required },
13880 .{ .kind = .id_ref, .quantifier = .required },
13881 .{ .kind = .id_ref, .quantifier = .required },
13882 .{ .kind = .id_ref, .quantifier = .required },
13883 .{ .kind = .id_ref, .quantifier = .required },
13884 .{ .kind = .id_ref, .quantifier = .required },
13885 .{ .kind = .id_ref, .quantifier = .required },
13886 },
13887 },
13888 .{
13889 .name = "OpSubgroup2DBlockPrefetchINTEL",
13890 .opcode = 6234,
13891 .operands = &.{
13892 .{ .kind = .id_ref, .quantifier = .required },
13893 .{ .kind = .id_ref, .quantifier = .required },
13894 .{ .kind = .id_ref, .quantifier = .required },
13895 .{ .kind = .id_ref, .quantifier = .required },
13896 .{ .kind = .id_ref, .quantifier = .required },
13897 .{ .kind = .id_ref, .quantifier = .required },
13898 .{ .kind = .id_ref, .quantifier = .required },
13899 .{ .kind = .id_ref, .quantifier = .required },
13900 .{ .kind = .id_ref, .quantifier = .required },
13901 },
13902 },
13903 .{
13904 .name = "OpSubgroup2DBlockStoreINTEL",
13905 .opcode = 6235,
13906 .operands = &.{
13907 .{ .kind = .id_ref, .quantifier = .required },
13908 .{ .kind = .id_ref, .quantifier = .required },
13909 .{ .kind = .id_ref, .quantifier = .required },
13910 .{ .kind = .id_ref, .quantifier = .required },
13911 .{ .kind = .id_ref, .quantifier = .required },
13912 .{ .kind = .id_ref, .quantifier = .required },
13913 .{ .kind = .id_ref, .quantifier = .required },
13914 .{ .kind = .id_ref, .quantifier = .required },
13915 .{ .kind = .id_ref, .quantifier = .required },
13916 .{ .kind = .id_ref, .quantifier = .required },
13917 },
13918 },
13919 .{
13920 .name = "OpSubgroupMatrixMultiplyAccumulateINTEL",
13921 .opcode = 6237,
13922 .operands = &.{
13923 .{ .kind = .id_result_type, .quantifier = .required },
13924 .{ .kind = .id_result, .quantifier = .required },
13925 .{ .kind = .id_ref, .quantifier = .required },
13926 .{ .kind = .id_ref, .quantifier = .required },
13927 .{ .kind = .id_ref, .quantifier = .required },
13928 .{ .kind = .id_ref, .quantifier = .required },
13929 .{ .kind = .matrix_multiply_accumulate_operands, .quantifier = .optional },
13930 },
13931 },
13932 .{
13933 .name = "OpBitwiseFunctionINTEL",
13934 .opcode = 6242,
13935 .operands = &.{
13936 .{ .kind = .id_result_type, .quantifier = .required },
13937 .{ .kind = .id_result, .quantifier = .required },
13938 .{ .kind = .id_ref, .quantifier = .required },
13939 .{ .kind = .id_ref, .quantifier = .required },
13940 .{ .kind = .id_ref, .quantifier = .required },
13941 .{ .kind = .id_ref, .quantifier = .required },
13942 },
13943 },
13944 .{
13945 .name = "OpGroupIMulKHR",
13946 .opcode = 6401,
13947 .operands = &.{
13948 .{ .kind = .id_result_type, .quantifier = .required },
13949 .{ .kind = .id_result, .quantifier = .required },
13950 .{ .kind = .id_scope, .quantifier = .required },
13951 .{ .kind = .group_operation, .quantifier = .required },
13952 .{ .kind = .id_ref, .quantifier = .required },
13953 },
13954 },
13955 .{
13956 .name = "OpGroupFMulKHR",
13957 .opcode = 6402,
13958 .operands = &.{
13959 .{ .kind = .id_result_type, .quantifier = .required },
13960 .{ .kind = .id_result, .quantifier = .required },
13961 .{ .kind = .id_scope, .quantifier = .required },
13962 .{ .kind = .group_operation, .quantifier = .required },
13963 .{ .kind = .id_ref, .quantifier = .required },
13964 },
13965 },
13966 .{
13967 .name = "OpGroupBitwiseAndKHR",
13968 .opcode = 6403,
13969 .operands = &.{
13970 .{ .kind = .id_result_type, .quantifier = .required },
13971 .{ .kind = .id_result, .quantifier = .required },
13972 .{ .kind = .id_scope, .quantifier = .required },
13973 .{ .kind = .group_operation, .quantifier = .required },
13974 .{ .kind = .id_ref, .quantifier = .required },
13975 },
13976 },
13977 .{
13978 .name = "OpGroupBitwiseOrKHR",
13979 .opcode = 6404,
13980 .operands = &.{
13981 .{ .kind = .id_result_type, .quantifier = .required },
13982 .{ .kind = .id_result, .quantifier = .required },
13983 .{ .kind = .id_scope, .quantifier = .required },
13984 .{ .kind = .group_operation, .quantifier = .required },
13985 .{ .kind = .id_ref, .quantifier = .required },
13986 },
13987 },
13988 .{
13989 .name = "OpGroupBitwiseXorKHR",
13990 .opcode = 6405,
13991 .operands = &.{
13992 .{ .kind = .id_result_type, .quantifier = .required },
13993 .{ .kind = .id_result, .quantifier = .required },
13994 .{ .kind = .id_scope, .quantifier = .required },
13995 .{ .kind = .group_operation, .quantifier = .required },
13996 .{ .kind = .id_ref, .quantifier = .required },
13997 },
13998 },
13999 .{
14000 .name = "OpGroupLogicalAndKHR",
14001 .opcode = 6406,
14002 .operands = &.{
14003 .{ .kind = .id_result_type, .quantifier = .required },
14004 .{ .kind = .id_result, .quantifier = .required },
14005 .{ .kind = .id_scope, .quantifier = .required },
14006 .{ .kind = .group_operation, .quantifier = .required },
14007 .{ .kind = .id_ref, .quantifier = .required },
14008 },
14009 },
14010 .{
14011 .name = "OpGroupLogicalOrKHR",
14012 .opcode = 6407,
14013 .operands = &.{
14014 .{ .kind = .id_result_type, .quantifier = .required },
14015 .{ .kind = .id_result, .quantifier = .required },
14016 .{ .kind = .id_scope, .quantifier = .required },
14017 .{ .kind = .group_operation, .quantifier = .required },
14018 .{ .kind = .id_ref, .quantifier = .required },
14019 },
14020 },
14021 .{
14022 .name = "OpGroupLogicalXorKHR",
14023 .opcode = 6408,
14024 .operands = &.{
14025 .{ .kind = .id_result_type, .quantifier = .required },
14026 .{ .kind = .id_result, .quantifier = .required },
14027 .{ .kind = .id_scope, .quantifier = .required },
14028 .{ .kind = .group_operation, .quantifier = .required },
14029 .{ .kind = .id_ref, .quantifier = .required },
14030 },
14031 },
14032 .{
14033 .name = "OpRoundFToTF32INTEL",
14034 .opcode = 6426,
14035 .operands = &.{
14036 .{ .kind = .id_result_type, .quantifier = .required },
14037 .{ .kind = .id_result, .quantifier = .required },
14038 .{ .kind = .id_ref, .quantifier = .required },
14039 },
14040 },
14041 .{
14042 .name = "OpMaskedGatherINTEL",
14043 .opcode = 6428,
14044 .operands = &.{
14045 .{ .kind = .id_result_type, .quantifier = .required },
14046 .{ .kind = .id_result, .quantifier = .required },
14047 .{ .kind = .id_ref, .quantifier = .required },
14048 .{ .kind = .literal_integer, .quantifier = .required },
14049 .{ .kind = .id_ref, .quantifier = .required },
14050 .{ .kind = .id_ref, .quantifier = .required },
14051 },
14052 },
14053 .{
14054 .name = "OpMaskedScatterINTEL",
14055 .opcode = 6429,
14056 .operands = &.{
14057 .{ .kind = .id_ref, .quantifier = .required },
14058 .{ .kind = .id_ref, .quantifier = .required },
14059 .{ .kind = .literal_integer, .quantifier = .required },
14060 .{ .kind = .id_ref, .quantifier = .required },
14061 },
14062 },
14063 .{
14064 .name = "OpConvertHandleToImageINTEL",
14065 .opcode = 6529,
14066 .operands = &.{
14067 .{ .kind = .id_result_type, .quantifier = .required },
14068 .{ .kind = .id_result, .quantifier = .required },
14069 .{ .kind = .id_ref, .quantifier = .required },
14070 },
14071 },
14072 .{
14073 .name = "OpConvertHandleToSamplerINTEL",
14074 .opcode = 6530,
14075 .operands = &.{
14076 .{ .kind = .id_result_type, .quantifier = .required },
14077 .{ .kind = .id_result, .quantifier = .required },
14078 .{ .kind = .id_ref, .quantifier = .required },
14079 },
14080 },
14081 .{
14082 .name = "OpConvertHandleToSampledImageINTEL",
14083 .opcode = 6531,
14084 .operands = &.{
14085 .{ .kind = .id_result_type, .quantifier = .required },
14086 .{ .kind = .id_result, .quantifier = .required },
14087 .{ .kind = .id_ref, .quantifier = .required },
14088 },
14089 },
14090 },
14091 .SPV_AMD_shader_trinary_minmax => &.{
14092 .{
14093 .name = "FMin3AMD",
14094 .opcode = 1,
14095 .operands = &.{
14096 .{ .kind = .id_ref, .quantifier = .required },
14097 .{ .kind = .id_ref, .quantifier = .required },
14098 .{ .kind = .id_ref, .quantifier = .required },
14099 },
14100 },
14101 .{
14102 .name = "UMin3AMD",
14103 .opcode = 2,
14104 .operands = &.{
14105 .{ .kind = .id_ref, .quantifier = .required },
14106 .{ .kind = .id_ref, .quantifier = .required },
14107 .{ .kind = .id_ref, .quantifier = .required },
14108 },
14109 },
14110 .{
14111 .name = "SMin3AMD",
14112 .opcode = 3,
14113 .operands = &.{
14114 .{ .kind = .id_ref, .quantifier = .required },
14115 .{ .kind = .id_ref, .quantifier = .required },
14116 .{ .kind = .id_ref, .quantifier = .required },
14117 },
14118 },
14119 .{
14120 .name = "FMax3AMD",
14121 .opcode = 4,
14122 .operands = &.{
14123 .{ .kind = .id_ref, .quantifier = .required },
14124 .{ .kind = .id_ref, .quantifier = .required },
14125 .{ .kind = .id_ref, .quantifier = .required },
14126 },
14127 },
14128 .{
14129 .name = "UMax3AMD",
14130 .opcode = 5,
14131 .operands = &.{
14132 .{ .kind = .id_ref, .quantifier = .required },
14133 .{ .kind = .id_ref, .quantifier = .required },
14134 .{ .kind = .id_ref, .quantifier = .required },
14135 },
14136 },
14137 .{
14138 .name = "SMax3AMD",
14139 .opcode = 6,
14140 .operands = &.{
14141 .{ .kind = .id_ref, .quantifier = .required },
14142 .{ .kind = .id_ref, .quantifier = .required },
14143 .{ .kind = .id_ref, .quantifier = .required },
14144 },
14145 },
14146 .{
14147 .name = "FMid3AMD",
14148 .opcode = 7,
14149 .operands = &.{
14150 .{ .kind = .id_ref, .quantifier = .required },
14151 .{ .kind = .id_ref, .quantifier = .required },
14152 .{ .kind = .id_ref, .quantifier = .required },
14153 },
14154 },
14155 .{
14156 .name = "UMid3AMD",
14157 .opcode = 8,
14158 .operands = &.{
14159 .{ .kind = .id_ref, .quantifier = .required },
14160 .{ .kind = .id_ref, .quantifier = .required },
14161 .{ .kind = .id_ref, .quantifier = .required },
14162 },
14163 },
14164 .{
14165 .name = "SMid3AMD",
14166 .opcode = 9,
14167 .operands = &.{
14168 .{ .kind = .id_ref, .quantifier = .required },
14169 .{ .kind = .id_ref, .quantifier = .required },
14170 .{ .kind = .id_ref, .quantifier = .required },
14171 },
14172 },
14173 },
14174 .SPV_EXT_INST_TYPE_TOSA_001000_1 => &.{
14175 .{
14176 .name = "ARGMAX",
14177 .opcode = 0,
14178 .operands = &.{
14179 .{ .kind = .id_ref, .quantifier = .required },
14180 .{ .kind = .id_ref, .quantifier = .required },
14181 .{ .kind = .id_ref, .quantifier = .required },
14182 },
14183 },
14184 .{
14185 .name = "AVG_POOL2D",
14186 .opcode = 1,
14187 .operands = &.{
14188 .{ .kind = .id_ref, .quantifier = .required },
14189 .{ .kind = .id_ref, .quantifier = .required },
14190 .{ .kind = .id_ref, .quantifier = .required },
14191 .{ .kind = .id_ref, .quantifier = .required },
14192 .{ .kind = .id_ref, .quantifier = .required },
14193 .{ .kind = .id_ref, .quantifier = .required },
14194 .{ .kind = .id_ref, .quantifier = .required },
14195 },
14196 },
14197 .{
14198 .name = "CONV2D",
14199 .opcode = 2,
14200 .operands = &.{
14201 .{ .kind = .id_ref, .quantifier = .required },
14202 .{ .kind = .id_ref, .quantifier = .required },
14203 .{ .kind = .id_ref, .quantifier = .required },
14204 .{ .kind = .id_ref, .quantifier = .required },
14205 .{ .kind = .id_ref, .quantifier = .required },
14206 .{ .kind = .id_ref, .quantifier = .required },
14207 .{ .kind = .id_ref, .quantifier = .required },
14208 .{ .kind = .id_ref, .quantifier = .required },
14209 .{ .kind = .id_ref, .quantifier = .required },
14210 .{ .kind = .id_ref, .quantifier = .required },
14211 },
14212 },
14213 .{
14214 .name = "CONV3D",
14215 .opcode = 3,
14216 .operands = &.{
14217 .{ .kind = .id_ref, .quantifier = .required },
14218 .{ .kind = .id_ref, .quantifier = .required },
14219 .{ .kind = .id_ref, .quantifier = .required },
14220 .{ .kind = .id_ref, .quantifier = .required },
14221 .{ .kind = .id_ref, .quantifier = .required },
14222 .{ .kind = .id_ref, .quantifier = .required },
14223 .{ .kind = .id_ref, .quantifier = .required },
14224 .{ .kind = .id_ref, .quantifier = .required },
14225 .{ .kind = .id_ref, .quantifier = .required },
14226 .{ .kind = .id_ref, .quantifier = .required },
14227 },
14228 },
14229 .{
14230 .name = "DEPTHWISE_CONV2D",
14231 .opcode = 4,
14232 .operands = &.{
14233 .{ .kind = .id_ref, .quantifier = .required },
14234 .{ .kind = .id_ref, .quantifier = .required },
14235 .{ .kind = .id_ref, .quantifier = .required },
14236 .{ .kind = .id_ref, .quantifier = .required },
14237 .{ .kind = .id_ref, .quantifier = .required },
14238 .{ .kind = .id_ref, .quantifier = .required },
14239 .{ .kind = .id_ref, .quantifier = .required },
14240 .{ .kind = .id_ref, .quantifier = .required },
14241 .{ .kind = .id_ref, .quantifier = .required },
14242 .{ .kind = .id_ref, .quantifier = .required },
14243 },
14244 },
14245 .{
14246 .name = "FFT2D",
14247 .opcode = 5,
14248 .operands = &.{
14249 .{ .kind = .id_ref, .quantifier = .required },
14250 .{ .kind = .id_ref, .quantifier = .required },
14251 .{ .kind = .id_ref, .quantifier = .required },
14252 .{ .kind = .id_ref, .quantifier = .required },
14253 },
14254 },
14255 .{
14256 .name = "MATMUL",
14257 .opcode = 6,
14258 .operands = &.{
14259 .{ .kind = .id_ref, .quantifier = .required },
14260 .{ .kind = .id_ref, .quantifier = .required },
14261 .{ .kind = .id_ref, .quantifier = .required },
14262 .{ .kind = .id_ref, .quantifier = .required },
14263 },
14264 },
14265 .{
14266 .name = "MAX_POOL2D",
14267 .opcode = 7,
14268 .operands = &.{
14269 .{ .kind = .id_ref, .quantifier = .required },
14270 .{ .kind = .id_ref, .quantifier = .required },
14271 .{ .kind = .id_ref, .quantifier = .required },
14272 .{ .kind = .id_ref, .quantifier = .required },
14273 .{ .kind = .id_ref, .quantifier = .required },
14274 },
14275 },
14276 .{
14277 .name = "RFFT2D",
14278 .opcode = 8,
14279 .operands = &.{
14280 .{ .kind = .id_ref, .quantifier = .required },
14281 .{ .kind = .id_ref, .quantifier = .required },
14282 },
14283 },
14284 .{
14285 .name = "TRANSPOSE_CONV2D",
14286 .opcode = 9,
14287 .operands = &.{
14288 .{ .kind = .id_ref, .quantifier = .required },
14289 .{ .kind = .id_ref, .quantifier = .required },
14290 .{ .kind = .id_ref, .quantifier = .required },
14291 .{ .kind = .id_ref, .quantifier = .required },
14292 .{ .kind = .id_ref, .quantifier = .required },
14293 .{ .kind = .id_ref, .quantifier = .required },
14294 .{ .kind = .id_ref, .quantifier = .required },
14295 .{ .kind = .id_ref, .quantifier = .required },
14296 .{ .kind = .id_ref, .quantifier = .required },
14297 },
14298 },
14299 .{
14300 .name = "CLAMP",
14301 .opcode = 10,
14302 .operands = &.{
14303 .{ .kind = .id_ref, .quantifier = .required },
14304 .{ .kind = .id_ref, .quantifier = .required },
14305 .{ .kind = .id_ref, .quantifier = .required },
14306 .{ .kind = .id_ref, .quantifier = .required },
14307 },
14308 },
14309 .{
14310 .name = "ERF",
14311 .opcode = 11,
14312 .operands = &.{
14313 .{ .kind = .id_ref, .quantifier = .required },
14314 },
14315 },
14316 .{
14317 .name = "SIGMOID",
14318 .opcode = 12,
14319 .operands = &.{
14320 .{ .kind = .id_ref, .quantifier = .required },
14321 },
14322 },
14323 .{
14324 .name = "TANH",
14325 .opcode = 13,
14326 .operands = &.{
14327 .{ .kind = .id_ref, .quantifier = .required },
14328 },
14329 },
14330 .{
14331 .name = "ADD",
14332 .opcode = 14,
14333 .operands = &.{
14334 .{ .kind = .id_ref, .quantifier = .required },
14335 .{ .kind = .id_ref, .quantifier = .required },
14336 },
14337 },
14338 .{
14339 .name = "ARITHMETIC_RIGHT_SHIFT",
14340 .opcode = 15,
14341 .operands = &.{
14342 .{ .kind = .id_ref, .quantifier = .required },
14343 .{ .kind = .id_ref, .quantifier = .required },
14344 .{ .kind = .id_ref, .quantifier = .required },
14345 },
14346 },
14347 .{
14348 .name = "BITWISE_AND",
14349 .opcode = 16,
14350 .operands = &.{
14351 .{ .kind = .id_ref, .quantifier = .required },
14352 .{ .kind = .id_ref, .quantifier = .required },
14353 },
14354 },
14355 .{
14356 .name = "BITWISE_OR",
14357 .opcode = 17,
14358 .operands = &.{
14359 .{ .kind = .id_ref, .quantifier = .required },
14360 .{ .kind = .id_ref, .quantifier = .required },
14361 },
14362 },
14363 .{
14364 .name = "BITWISE_XOR",
14365 .opcode = 18,
14366 .operands = &.{
14367 .{ .kind = .id_ref, .quantifier = .required },
14368 .{ .kind = .id_ref, .quantifier = .required },
14369 },
14370 },
14371 .{
14372 .name = "INTDIV",
14373 .opcode = 19,
14374 .operands = &.{
14375 .{ .kind = .id_ref, .quantifier = .required },
14376 .{ .kind = .id_ref, .quantifier = .required },
14377 },
14378 },
14379 .{
14380 .name = "LOGICAL_AND",
14381 .opcode = 20,
14382 .operands = &.{
14383 .{ .kind = .id_ref, .quantifier = .required },
14384 .{ .kind = .id_ref, .quantifier = .required },
14385 },
14386 },
14387 .{
14388 .name = "LOGICAL_LEFT_SHIFT",
14389 .opcode = 21,
14390 .operands = &.{
14391 .{ .kind = .id_ref, .quantifier = .required },
14392 .{ .kind = .id_ref, .quantifier = .required },
14393 },
14394 },
14395 .{
14396 .name = "LOGICAL_RIGHT_SHIFT",
14397 .opcode = 22,
14398 .operands = &.{
14399 .{ .kind = .id_ref, .quantifier = .required },
14400 .{ .kind = .id_ref, .quantifier = .required },
14401 },
14402 },
14403 .{
14404 .name = "LOGICAL_OR",
14405 .opcode = 23,
14406 .operands = &.{
14407 .{ .kind = .id_ref, .quantifier = .required },
14408 .{ .kind = .id_ref, .quantifier = .required },
14409 },
14410 },
14411 .{
14412 .name = "LOGICAL_XOR",
14413 .opcode = 24,
14414 .operands = &.{
14415 .{ .kind = .id_ref, .quantifier = .required },
14416 .{ .kind = .id_ref, .quantifier = .required },
14417 },
14418 },
14419 .{
14420 .name = "MAXIMUM",
14421 .opcode = 25,
14422 .operands = &.{
14423 .{ .kind = .id_ref, .quantifier = .required },
14424 .{ .kind = .id_ref, .quantifier = .required },
14425 .{ .kind = .id_ref, .quantifier = .required },
14426 },
14427 },
14428 .{
14429 .name = "MINIMUM",
14430 .opcode = 26,
14431 .operands = &.{
14432 .{ .kind = .id_ref, .quantifier = .required },
14433 .{ .kind = .id_ref, .quantifier = .required },
14434 .{ .kind = .id_ref, .quantifier = .required },
14435 },
14436 },
14437 .{
14438 .name = "MUL",
14439 .opcode = 27,
14440 .operands = &.{
14441 .{ .kind = .id_ref, .quantifier = .required },
14442 .{ .kind = .id_ref, .quantifier = .required },
14443 .{ .kind = .id_ref, .quantifier = .required },
14444 },
14445 },
14446 .{
14447 .name = "POW",
14448 .opcode = 28,
14449 .operands = &.{
14450 .{ .kind = .id_ref, .quantifier = .required },
14451 .{ .kind = .id_ref, .quantifier = .required },
14452 },
14453 },
14454 .{
14455 .name = "SUB",
14456 .opcode = 29,
14457 .operands = &.{
14458 .{ .kind = .id_ref, .quantifier = .required },
14459 .{ .kind = .id_ref, .quantifier = .required },
14460 },
14461 },
14462 .{
14463 .name = "TABLE",
14464 .opcode = 30,
14465 .operands = &.{
14466 .{ .kind = .id_ref, .quantifier = .required },
14467 .{ .kind = .id_ref, .quantifier = .required },
14468 },
14469 },
14470 .{
14471 .name = "ABS",
14472 .opcode = 31,
14473 .operands = &.{
14474 .{ .kind = .id_ref, .quantifier = .required },
14475 },
14476 },
14477 .{
14478 .name = "BITWISE_NOT",
14479 .opcode = 32,
14480 .operands = &.{
14481 .{ .kind = .id_ref, .quantifier = .required },
14482 },
14483 },
14484 .{
14485 .name = "CEIL",
14486 .opcode = 33,
14487 .operands = &.{
14488 .{ .kind = .id_ref, .quantifier = .required },
14489 },
14490 },
14491 .{
14492 .name = "CLZ",
14493 .opcode = 34,
14494 .operands = &.{
14495 .{ .kind = .id_ref, .quantifier = .required },
14496 },
14497 },
14498 .{
14499 .name = "COS",
14500 .opcode = 35,
14501 .operands = &.{
14502 .{ .kind = .id_ref, .quantifier = .required },
14503 },
14504 },
14505 .{
14506 .name = "EXP",
14507 .opcode = 36,
14508 .operands = &.{
14509 .{ .kind = .id_ref, .quantifier = .required },
14510 },
14511 },
14512 .{
14513 .name = "FLOOR",
14514 .opcode = 37,
14515 .operands = &.{
14516 .{ .kind = .id_ref, .quantifier = .required },
14517 },
14518 },
14519 .{
14520 .name = "LOG",
14521 .opcode = 38,
14522 .operands = &.{
14523 .{ .kind = .id_ref, .quantifier = .required },
14524 },
14525 },
14526 .{
14527 .name = "LOGICAL_NOT",
14528 .opcode = 39,
14529 .operands = &.{
14530 .{ .kind = .id_ref, .quantifier = .required },
14531 },
14532 },
14533 .{
14534 .name = "NEGATE",
14535 .opcode = 40,
14536 .operands = &.{
14537 .{ .kind = .id_ref, .quantifier = .required },
14538 .{ .kind = .id_ref, .quantifier = .required },
14539 .{ .kind = .id_ref, .quantifier = .required },
14540 },
14541 },
14542 .{
14543 .name = "RECIPROCAL",
14544 .opcode = 41,
14545 .operands = &.{
14546 .{ .kind = .id_ref, .quantifier = .required },
14547 },
14548 },
14549 .{
14550 .name = "RSQRT",
14551 .opcode = 42,
14552 .operands = &.{
14553 .{ .kind = .id_ref, .quantifier = .required },
14554 },
14555 },
14556 .{
14557 .name = "SIN",
14558 .opcode = 43,
14559 .operands = &.{
14560 .{ .kind = .id_ref, .quantifier = .required },
14561 },
14562 },
14563 .{
14564 .name = "SELECT",
14565 .opcode = 44,
14566 .operands = &.{
14567 .{ .kind = .id_ref, .quantifier = .required },
14568 .{ .kind = .id_ref, .quantifier = .required },
14569 .{ .kind = .id_ref, .quantifier = .required },
14570 },
14571 },
14572 .{
14573 .name = "EQUAL",
14574 .opcode = 45,
14575 .operands = &.{
14576 .{ .kind = .id_ref, .quantifier = .required },
14577 .{ .kind = .id_ref, .quantifier = .required },
14578 },
14579 },
14580 .{
14581 .name = "GREATER",
14582 .opcode = 46,
14583 .operands = &.{
14584 .{ .kind = .id_ref, .quantifier = .required },
14585 .{ .kind = .id_ref, .quantifier = .required },
14586 },
14587 },
14588 .{
14589 .name = "GREATER_EQUAL",
14590 .opcode = 47,
14591 .operands = &.{
14592 .{ .kind = .id_ref, .quantifier = .required },
14593 .{ .kind = .id_ref, .quantifier = .required },
14594 },
14595 },
14596 .{
14597 .name = "REDUCE_ALL",
14598 .opcode = 48,
14599 .operands = &.{
14600 .{ .kind = .id_ref, .quantifier = .required },
14601 .{ .kind = .id_ref, .quantifier = .required },
14602 },
14603 },
14604 .{
14605 .name = "REDUCE_ANY",
14606 .opcode = 49,
14607 .operands = &.{
14608 .{ .kind = .id_ref, .quantifier = .required },
14609 .{ .kind = .id_ref, .quantifier = .required },
14610 },
14611 },
14612 .{
14613 .name = "REDUCE_MAX",
14614 .opcode = 50,
14615 .operands = &.{
14616 .{ .kind = .id_ref, .quantifier = .required },
14617 .{ .kind = .id_ref, .quantifier = .required },
14618 .{ .kind = .id_ref, .quantifier = .required },
14619 },
14620 },
14621 .{
14622 .name = "REDUCE_MIN",
14623 .opcode = 51,
14624 .operands = &.{
14625 .{ .kind = .id_ref, .quantifier = .required },
14626 .{ .kind = .id_ref, .quantifier = .required },
14627 .{ .kind = .id_ref, .quantifier = .required },
14628 },
14629 },
14630 .{
14631 .name = "REDUCE_PRODUCT",
14632 .opcode = 52,
14633 .operands = &.{
14634 .{ .kind = .id_ref, .quantifier = .required },
14635 .{ .kind = .id_ref, .quantifier = .required },
14636 },
14637 },
14638 .{
14639 .name = "REDUCE_SUM",
14640 .opcode = 53,
14641 .operands = &.{
14642 .{ .kind = .id_ref, .quantifier = .required },
14643 .{ .kind = .id_ref, .quantifier = .required },
14644 },
14645 },
14646 .{
14647 .name = "CONCAT",
14648 .opcode = 54,
14649 .operands = &.{
14650 .{ .kind = .id_ref, .quantifier = .required },
14651 .{ .kind = .id_ref, .quantifier = .variadic },
14652 },
14653 },
14654 .{
14655 .name = "PAD",
14656 .opcode = 55,
14657 .operands = &.{
14658 .{ .kind = .id_ref, .quantifier = .required },
14659 .{ .kind = .id_ref, .quantifier = .required },
14660 .{ .kind = .id_ref, .quantifier = .required },
14661 },
14662 },
14663 .{
14664 .name = "RESHAPE",
14665 .opcode = 56,
14666 .operands = &.{
14667 .{ .kind = .id_ref, .quantifier = .required },
14668 .{ .kind = .id_ref, .quantifier = .required },
14669 },
14670 },
14671 .{
14672 .name = "REVERSE",
14673 .opcode = 57,
14674 .operands = &.{
14675 .{ .kind = .id_ref, .quantifier = .required },
14676 .{ .kind = .id_ref, .quantifier = .required },
14677 },
14678 },
14679 .{
14680 .name = "SLICE",
14681 .opcode = 58,
14682 .operands = &.{
14683 .{ .kind = .id_ref, .quantifier = .required },
14684 .{ .kind = .id_ref, .quantifier = .required },
14685 .{ .kind = .id_ref, .quantifier = .required },
14686 },
14687 },
14688 .{
14689 .name = "TILE",
14690 .opcode = 59,
14691 .operands = &.{
14692 .{ .kind = .id_ref, .quantifier = .required },
14693 .{ .kind = .id_ref, .quantifier = .required },
14694 },
14695 },
14696 .{
14697 .name = "TRANSPOSE",
14698 .opcode = 60,
14699 .operands = &.{
14700 .{ .kind = .id_ref, .quantifier = .required },
14701 .{ .kind = .id_ref, .quantifier = .required },
14702 },
14703 },
14704 .{
14705 .name = "GATHER",
14706 .opcode = 61,
14707 .operands = &.{
14708 .{ .kind = .id_ref, .quantifier = .required },
14709 .{ .kind = .id_ref, .quantifier = .required },
14710 },
14711 },
14712 .{
14713 .name = "SCATTER",
14714 .opcode = 62,
14715 .operands = &.{
14716 .{ .kind = .id_ref, .quantifier = .required },
14717 .{ .kind = .id_ref, .quantifier = .required },
14718 .{ .kind = .id_ref, .quantifier = .required },
14719 },
14720 },
14721 .{
14722 .name = "RESIZE",
14723 .opcode = 63,
14724 .operands = &.{
14725 .{ .kind = .id_ref, .quantifier = .required },
14726 .{ .kind = .id_ref, .quantifier = .required },
14727 .{ .kind = .id_ref, .quantifier = .required },
14728 .{ .kind = .id_ref, .quantifier = .required },
14729 .{ .kind = .id_ref, .quantifier = .required },
14730 },
14731 },
14732 .{
14733 .name = "CAST",
14734 .opcode = 64,
14735 .operands = &.{
14736 .{ .kind = .id_ref, .quantifier = .required },
14737 },
14738 },
14739 .{
14740 .name = "RESCALE",
14741 .opcode = 65,
14742 .operands = &.{
14743 .{ .kind = .id_ref, .quantifier = .required },
14744 .{ .kind = .id_ref, .quantifier = .required },
14745 .{ .kind = .id_ref, .quantifier = .required },
14746 .{ .kind = .id_ref, .quantifier = .required },
14747 .{ .kind = .id_ref, .quantifier = .required },
14748 .{ .kind = .id_ref, .quantifier = .required },
14749 .{ .kind = .id_ref, .quantifier = .required },
14750 .{ .kind = .id_ref, .quantifier = .required },
14751 .{ .kind = .id_ref, .quantifier = .required },
14752 .{ .kind = .id_ref, .quantifier = .required },
14753 },
14754 },
14755 },
14756 .@"NonSemantic.VkspReflection" => &.{
14757 .{
14758 .name = "Configuration",
14759 .opcode = 1,
14760 .operands = &.{
14761 .{ .kind = .id_ref, .quantifier = .required },
14762 .{ .kind = .id_ref, .quantifier = .required },
14763 .{ .kind = .id_ref, .quantifier = .required },
14764 .{ .kind = .id_ref, .quantifier = .required },
14765 .{ .kind = .id_ref, .quantifier = .required },
14766 .{ .kind = .id_ref, .quantifier = .required },
14767 .{ .kind = .id_ref, .quantifier = .required },
14768 .{ .kind = .id_ref, .quantifier = .required },
14769 .{ .kind = .id_ref, .quantifier = .required },
14770 },
14771 },
14772 .{
14773 .name = "StartCounter",
14774 .opcode = 2,
14775 .operands = &.{
14776 .{ .kind = .id_ref, .quantifier = .required },
14777 },
14778 },
14779 .{
14780 .name = "StopCounter",
14781 .opcode = 3,
14782 .operands = &.{
14783 .{ .kind = .id_ref, .quantifier = .required },
14784 },
14785 },
14786 .{
14787 .name = "PushConstants",
14788 .opcode = 4,
14789 .operands = &.{
14790 .{ .kind = .id_ref, .quantifier = .required },
14791 .{ .kind = .id_ref, .quantifier = .required },
14792 .{ .kind = .id_ref, .quantifier = .required },
14793 .{ .kind = .id_ref, .quantifier = .required },
14794 },
14795 },
14796 .{
14797 .name = "SpecializationMapEntry",
14798 .opcode = 5,
14799 .operands = &.{
14800 .{ .kind = .id_ref, .quantifier = .required },
14801 .{ .kind = .id_ref, .quantifier = .required },
14802 .{ .kind = .id_ref, .quantifier = .required },
14803 },
14804 },
14805 .{
14806 .name = "DescriptorSetBuffer",
14807 .opcode = 6,
14808 .operands = &.{
14809 .{ .kind = .id_ref, .quantifier = .required },
14810 .{ .kind = .id_ref, .quantifier = .required },
14811 .{ .kind = .id_ref, .quantifier = .required },
14812 .{ .kind = .id_ref, .quantifier = .required },
14813 .{ .kind = .id_ref, .quantifier = .required },
14814 .{ .kind = .id_ref, .quantifier = .required },
14815 .{ .kind = .id_ref, .quantifier = .required },
14816 .{ .kind = .id_ref, .quantifier = .required },
14817 .{ .kind = .id_ref, .quantifier = .required },
14818 .{ .kind = .id_ref, .quantifier = .required },
14819 .{ .kind = .id_ref, .quantifier = .required },
14820 .{ .kind = .id_ref, .quantifier = .required },
14821 .{ .kind = .id_ref, .quantifier = .required },
14822 .{ .kind = .id_ref, .quantifier = .required },
14823 .{ .kind = .id_ref, .quantifier = .required },
14824 },
14825 },
14826 .{
14827 .name = "DescriptorSetImage",
14828 .opcode = 7,
14829 .operands = &.{
14830 .{ .kind = .id_ref, .quantifier = .required },
14831 .{ .kind = .id_ref, .quantifier = .required },
14832 .{ .kind = .id_ref, .quantifier = .required },
14833 .{ .kind = .id_ref, .quantifier = .required },
14834 .{ .kind = .id_ref, .quantifier = .required },
14835 .{ .kind = .id_ref, .quantifier = .required },
14836 .{ .kind = .id_ref, .quantifier = .required },
14837 .{ .kind = .id_ref, .quantifier = .required },
14838 .{ .kind = .id_ref, .quantifier = .required },
14839 .{ .kind = .id_ref, .quantifier = .required },
14840 .{ .kind = .id_ref, .quantifier = .required },
14841 .{ .kind = .id_ref, .quantifier = .required },
14842 .{ .kind = .id_ref, .quantifier = .required },
14843 .{ .kind = .id_ref, .quantifier = .required },
14844 .{ .kind = .id_ref, .quantifier = .required },
14845 .{ .kind = .id_ref, .quantifier = .required },
14846 .{ .kind = .id_ref, .quantifier = .required },
14847 .{ .kind = .id_ref, .quantifier = .required },
14848 .{ .kind = .id_ref, .quantifier = .required },
14849 .{ .kind = .id_ref, .quantifier = .required },
14850 .{ .kind = .id_ref, .quantifier = .required },
14851 .{ .kind = .id_ref, .quantifier = .required },
14852 .{ .kind = .id_ref, .quantifier = .required },
14853 .{ .kind = .id_ref, .quantifier = .required },
14854 .{ .kind = .id_ref, .quantifier = .required },
14855 .{ .kind = .id_ref, .quantifier = .required },
14856 .{ .kind = .id_ref, .quantifier = .required },
14857 .{ .kind = .id_ref, .quantifier = .required },
14858 .{ .kind = .id_ref, .quantifier = .required },
14859 .{ .kind = .id_ref, .quantifier = .required },
14860 .{ .kind = .id_ref, .quantifier = .required },
14861 .{ .kind = .id_ref, .quantifier = .required },
14862 .{ .kind = .id_ref, .quantifier = .required },
14863 },
14864 },
14865 .{
14866 .name = "DescriptorSetSampler",
14867 .opcode = 8,
14868 .operands = &.{
14869 .{ .kind = .id_ref, .quantifier = .required },
14870 .{ .kind = .id_ref, .quantifier = .required },
14871 .{ .kind = .id_ref, .quantifier = .required },
14872 .{ .kind = .id_ref, .quantifier = .required },
14873 .{ .kind = .id_ref, .quantifier = .required },
14874 .{ .kind = .id_ref, .quantifier = .required },
14875 .{ .kind = .id_ref, .quantifier = .required },
14876 .{ .kind = .id_ref, .quantifier = .required },
14877 .{ .kind = .id_ref, .quantifier = .required },
14878 .{ .kind = .id_ref, .quantifier = .required },
14879 .{ .kind = .id_ref, .quantifier = .required },
14880 .{ .kind = .id_ref, .quantifier = .required },
14881 .{ .kind = .id_ref, .quantifier = .required },
14882 .{ .kind = .id_ref, .quantifier = .required },
14883 .{ .kind = .id_ref, .quantifier = .required },
14884 .{ .kind = .id_ref, .quantifier = .required },
14885 .{ .kind = .id_ref, .quantifier = .required },
14886 .{ .kind = .id_ref, .quantifier = .required },
14887 .{ .kind = .id_ref, .quantifier = .required },
14888 },
14889 },
14890 },
14891 .SPV_AMD_shader_explicit_vertex_parameter => &.{
14892 .{
14893 .name = "InterpolateAtVertexAMD",
14894 .opcode = 1,
14895 .operands = &.{
14896 .{ .kind = .id_ref, .quantifier = .required },
14897 .{ .kind = .id_ref, .quantifier = .required },
14898 },
14899 },
14900 },
14901 .DebugInfo => &.{
14902 .{
14903 .name = "DebugInfoNone",
14904 .opcode = 0,
14905 .operands = &.{},
14906 },
14907 .{
14908 .name = "DebugCompilationUnit",
14909 .opcode = 1,
14910 .operands = &.{
14911 .{ .kind = .id_ref, .quantifier = .required },
14912 .{ .kind = .literal_integer, .quantifier = .required },
14913 .{ .kind = .literal_integer, .quantifier = .required },
14914 },
14915 },
14916 .{
14917 .name = "DebugTypeBasic",
14918 .opcode = 2,
14919 .operands = &.{
14920 .{ .kind = .id_ref, .quantifier = .required },
14921 .{ .kind = .id_ref, .quantifier = .required },
14922 .{ .kind = .debug_info_debug_base_type_attribute_encoding, .quantifier = .required },
14923 },
14924 },
14925 .{
14926 .name = "DebugTypePointer",
14927 .opcode = 3,
14928 .operands = &.{
14929 .{ .kind = .id_ref, .quantifier = .required },
14930 .{ .kind = .storage_class, .quantifier = .required },
14931 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14932 },
14933 },
14934 .{
14935 .name = "DebugTypeQualifier",
14936 .opcode = 4,
14937 .operands = &.{
14938 .{ .kind = .id_ref, .quantifier = .required },
14939 .{ .kind = .debug_info_debug_type_qualifier, .quantifier = .required },
14940 },
14941 },
14942 .{
14943 .name = "DebugTypeArray",
14944 .opcode = 5,
14945 .operands = &.{
14946 .{ .kind = .id_ref, .quantifier = .required },
14947 .{ .kind = .id_ref, .quantifier = .variadic },
14948 },
14949 },
14950 .{
14951 .name = "DebugTypeVector",
14952 .opcode = 6,
14953 .operands = &.{
14954 .{ .kind = .id_ref, .quantifier = .required },
14955 .{ .kind = .literal_integer, .quantifier = .required },
14956 },
14957 },
14958 .{
14959 .name = "DebugTypedef",
14960 .opcode = 7,
14961 .operands = &.{
14962 .{ .kind = .id_ref, .quantifier = .required },
14963 .{ .kind = .id_ref, .quantifier = .required },
14964 .{ .kind = .id_ref, .quantifier = .required },
14965 .{ .kind = .literal_integer, .quantifier = .required },
14966 .{ .kind = .literal_integer, .quantifier = .required },
14967 .{ .kind = .id_ref, .quantifier = .required },
14968 },
14969 },
14970 .{
14971 .name = "DebugTypeFunction",
14972 .opcode = 8,
14973 .operands = &.{
14974 .{ .kind = .id_ref, .quantifier = .required },
14975 .{ .kind = .id_ref, .quantifier = .variadic },
14976 },
14977 },
14978 .{
14979 .name = "DebugTypeEnum",
14980 .opcode = 9,
14981 .operands = &.{
14982 .{ .kind = .id_ref, .quantifier = .required },
14983 .{ .kind = .id_ref, .quantifier = .required },
14984 .{ .kind = .id_ref, .quantifier = .required },
14985 .{ .kind = .literal_integer, .quantifier = .required },
14986 .{ .kind = .literal_integer, .quantifier = .required },
14987 .{ .kind = .id_ref, .quantifier = .required },
14988 .{ .kind = .id_ref, .quantifier = .required },
14989 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14990 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
14991 },
14992 },
14993 .{
14994 .name = "DebugTypeComposite",
14995 .opcode = 10,
14996 .operands = &.{
14997 .{ .kind = .id_ref, .quantifier = .required },
14998 .{ .kind = .debug_info_debug_composite_type, .quantifier = .required },
14999 .{ .kind = .id_ref, .quantifier = .required },
15000 .{ .kind = .literal_integer, .quantifier = .required },
15001 .{ .kind = .literal_integer, .quantifier = .required },
15002 .{ .kind = .id_ref, .quantifier = .required },
15003 .{ .kind = .id_ref, .quantifier = .required },
15004 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15005 .{ .kind = .id_ref, .quantifier = .variadic },
15006 },
15007 },
15008 .{
15009 .name = "DebugTypeMember",
15010 .opcode = 11,
15011 .operands = &.{
15012 .{ .kind = .id_ref, .quantifier = .required },
15013 .{ .kind = .id_ref, .quantifier = .required },
15014 .{ .kind = .id_ref, .quantifier = .required },
15015 .{ .kind = .literal_integer, .quantifier = .required },
15016 .{ .kind = .literal_integer, .quantifier = .required },
15017 .{ .kind = .id_ref, .quantifier = .required },
15018 .{ .kind = .id_ref, .quantifier = .required },
15019 .{ .kind = .id_ref, .quantifier = .required },
15020 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15021 .{ .kind = .id_ref, .quantifier = .optional },
15022 },
15023 },
15024 .{
15025 .name = "DebugTypeInheritance",
15026 .opcode = 12,
15027 .operands = &.{
15028 .{ .kind = .id_ref, .quantifier = .required },
15029 .{ .kind = .id_ref, .quantifier = .required },
15030 .{ .kind = .id_ref, .quantifier = .required },
15031 .{ .kind = .id_ref, .quantifier = .required },
15032 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15033 },
15034 },
15035 .{
15036 .name = "DebugTypePtrToMember",
15037 .opcode = 13,
15038 .operands = &.{
15039 .{ .kind = .id_ref, .quantifier = .required },
15040 .{ .kind = .id_ref, .quantifier = .required },
15041 },
15042 },
15043 .{
15044 .name = "DebugTypeTemplate",
15045 .opcode = 14,
15046 .operands = &.{
15047 .{ .kind = .id_ref, .quantifier = .required },
15048 .{ .kind = .id_ref, .quantifier = .variadic },
15049 },
15050 },
15051 .{
15052 .name = "DebugTypeTemplateParameter",
15053 .opcode = 15,
15054 .operands = &.{
15055 .{ .kind = .id_ref, .quantifier = .required },
15056 .{ .kind = .id_ref, .quantifier = .required },
15057 .{ .kind = .id_ref, .quantifier = .required },
15058 .{ .kind = .id_ref, .quantifier = .required },
15059 .{ .kind = .literal_integer, .quantifier = .required },
15060 .{ .kind = .literal_integer, .quantifier = .required },
15061 },
15062 },
15063 .{
15064 .name = "DebugTypeTemplateTemplateParameter",
15065 .opcode = 16,
15066 .operands = &.{
15067 .{ .kind = .id_ref, .quantifier = .required },
15068 .{ .kind = .id_ref, .quantifier = .required },
15069 .{ .kind = .id_ref, .quantifier = .required },
15070 .{ .kind = .literal_integer, .quantifier = .required },
15071 .{ .kind = .literal_integer, .quantifier = .required },
15072 },
15073 },
15074 .{
15075 .name = "DebugTypeTemplateParameterPack",
15076 .opcode = 17,
15077 .operands = &.{
15078 .{ .kind = .id_ref, .quantifier = .required },
15079 .{ .kind = .id_ref, .quantifier = .required },
15080 .{ .kind = .literal_integer, .quantifier = .required },
15081 .{ .kind = .literal_integer, .quantifier = .required },
15082 .{ .kind = .id_ref, .quantifier = .variadic },
15083 },
15084 },
15085 .{
15086 .name = "DebugGlobalVariable",
15087 .opcode = 18,
15088 .operands = &.{
15089 .{ .kind = .id_ref, .quantifier = .required },
15090 .{ .kind = .id_ref, .quantifier = .required },
15091 .{ .kind = .id_ref, .quantifier = .required },
15092 .{ .kind = .literal_integer, .quantifier = .required },
15093 .{ .kind = .literal_integer, .quantifier = .required },
15094 .{ .kind = .id_ref, .quantifier = .required },
15095 .{ .kind = .id_ref, .quantifier = .required },
15096 .{ .kind = .id_ref, .quantifier = .required },
15097 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15098 .{ .kind = .id_ref, .quantifier = .optional },
15099 },
15100 },
15101 .{
15102 .name = "DebugFunctionDeclaration",
15103 .opcode = 19,
15104 .operands = &.{
15105 .{ .kind = .id_ref, .quantifier = .required },
15106 .{ .kind = .id_ref, .quantifier = .required },
15107 .{ .kind = .id_ref, .quantifier = .required },
15108 .{ .kind = .literal_integer, .quantifier = .required },
15109 .{ .kind = .literal_integer, .quantifier = .required },
15110 .{ .kind = .id_ref, .quantifier = .required },
15111 .{ .kind = .id_ref, .quantifier = .required },
15112 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15113 },
15114 },
15115 .{
15116 .name = "DebugFunction",
15117 .opcode = 20,
15118 .operands = &.{
15119 .{ .kind = .id_ref, .quantifier = .required },
15120 .{ .kind = .id_ref, .quantifier = .required },
15121 .{ .kind = .id_ref, .quantifier = .required },
15122 .{ .kind = .literal_integer, .quantifier = .required },
15123 .{ .kind = .literal_integer, .quantifier = .required },
15124 .{ .kind = .id_ref, .quantifier = .required },
15125 .{ .kind = .id_ref, .quantifier = .required },
15126 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15127 .{ .kind = .literal_integer, .quantifier = .required },
15128 .{ .kind = .id_ref, .quantifier = .required },
15129 .{ .kind = .id_ref, .quantifier = .optional },
15130 },
15131 },
15132 .{
15133 .name = "DebugLexicalBlock",
15134 .opcode = 21,
15135 .operands = &.{
15136 .{ .kind = .id_ref, .quantifier = .required },
15137 .{ .kind = .literal_integer, .quantifier = .required },
15138 .{ .kind = .literal_integer, .quantifier = .required },
15139 .{ .kind = .id_ref, .quantifier = .required },
15140 .{ .kind = .id_ref, .quantifier = .optional },
15141 },
15142 },
15143 .{
15144 .name = "DebugLexicalBlockDiscriminator",
15145 .opcode = 22,
15146 .operands = &.{
15147 .{ .kind = .id_ref, .quantifier = .required },
15148 .{ .kind = .literal_integer, .quantifier = .required },
15149 .{ .kind = .id_ref, .quantifier = .required },
15150 },
15151 },
15152 .{
15153 .name = "DebugScope",
15154 .opcode = 23,
15155 .operands = &.{
15156 .{ .kind = .id_ref, .quantifier = .required },
15157 .{ .kind = .id_ref, .quantifier = .optional },
15158 },
15159 },
15160 .{
15161 .name = "DebugNoScope",
15162 .opcode = 24,
15163 .operands = &.{},
15164 },
15165 .{
15166 .name = "DebugInlinedAt",
15167 .opcode = 25,
15168 .operands = &.{
15169 .{ .kind = .literal_integer, .quantifier = .required },
15170 .{ .kind = .id_ref, .quantifier = .required },
15171 .{ .kind = .id_ref, .quantifier = .optional },
15172 },
15173 },
15174 .{
15175 .name = "DebugLocalVariable",
15176 .opcode = 26,
15177 .operands = &.{
15178 .{ .kind = .id_ref, .quantifier = .required },
15179 .{ .kind = .id_ref, .quantifier = .required },
15180 .{ .kind = .id_ref, .quantifier = .required },
15181 .{ .kind = .literal_integer, .quantifier = .required },
15182 .{ .kind = .literal_integer, .quantifier = .required },
15183 .{ .kind = .id_ref, .quantifier = .required },
15184 .{ .kind = .literal_integer, .quantifier = .optional },
15185 },
15186 },
15187 .{
15188 .name = "DebugInlinedVariable",
15189 .opcode = 27,
15190 .operands = &.{
15191 .{ .kind = .id_ref, .quantifier = .required },
15192 .{ .kind = .id_ref, .quantifier = .required },
15193 },
15194 },
15195 .{
15196 .name = "DebugDeclare",
15197 .opcode = 28,
15198 .operands = &.{
15199 .{ .kind = .id_ref, .quantifier = .required },
15200 .{ .kind = .id_ref, .quantifier = .required },
15201 .{ .kind = .id_ref, .quantifier = .required },
15202 },
15203 },
15204 .{
15205 .name = "DebugValue",
15206 .opcode = 29,
15207 .operands = &.{
15208 .{ .kind = .id_ref, .quantifier = .required },
15209 .{ .kind = .id_ref, .quantifier = .required },
15210 .{ .kind = .id_ref, .quantifier = .variadic },
15211 },
15212 },
15213 .{
15214 .name = "DebugOperation",
15215 .opcode = 30,
15216 .operands = &.{
15217 .{ .kind = .debug_info_debug_operation, .quantifier = .required },
15218 .{ .kind = .literal_integer, .quantifier = .variadic },
15219 },
15220 },
15221 .{
15222 .name = "DebugExpression",
15223 .opcode = 31,
15224 .operands = &.{
15225 .{ .kind = .id_ref, .quantifier = .variadic },
15226 },
15227 },
15228 .{
15229 .name = "DebugMacroDef",
15230 .opcode = 32,
15231 .operands = &.{
15232 .{ .kind = .id_ref, .quantifier = .required },
15233 .{ .kind = .literal_integer, .quantifier = .required },
15234 .{ .kind = .id_ref, .quantifier = .required },
15235 .{ .kind = .id_ref, .quantifier = .optional },
15236 },
15237 },
15238 .{
15239 .name = "DebugMacroUndef",
15240 .opcode = 33,
15241 .operands = &.{
15242 .{ .kind = .id_ref, .quantifier = .required },
15243 .{ .kind = .literal_integer, .quantifier = .required },
15244 .{ .kind = .id_ref, .quantifier = .required },
15245 },
15246 },
15247 },
15248 .@"NonSemantic.DebugBreak" => &.{
15249 .{
15250 .name = "DebugBreak",
15251 .opcode = 1,
15252 .operands = &.{},
15253 },
15254 },
15255 .@"OpenCL.DebugInfo.100" => &.{
15256 .{
15257 .name = "DebugInfoNone",
15258 .opcode = 0,
15259 .operands = &.{},
15260 },
15261 .{
15262 .name = "DebugCompilationUnit",
15263 .opcode = 1,
15264 .operands = &.{
15265 .{ .kind = .literal_integer, .quantifier = .required },
15266 .{ .kind = .literal_integer, .quantifier = .required },
15267 .{ .kind = .id_ref, .quantifier = .required },
15268 .{ .kind = .source_language, .quantifier = .required },
15269 },
15270 },
15271 .{
15272 .name = "DebugTypeBasic",
15273 .opcode = 2,
15274 .operands = &.{
15275 .{ .kind = .id_ref, .quantifier = .required },
15276 .{ .kind = .id_ref, .quantifier = .required },
15277 .{ .kind = .open_cl_debug_info_100_debug_base_type_attribute_encoding, .quantifier = .required },
15278 },
15279 },
15280 .{
15281 .name = "DebugTypePointer",
15282 .opcode = 3,
15283 .operands = &.{
15284 .{ .kind = .id_ref, .quantifier = .required },
15285 .{ .kind = .storage_class, .quantifier = .required },
15286 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15287 },
15288 },
15289 .{
15290 .name = "DebugTypeQualifier",
15291 .opcode = 4,
15292 .operands = &.{
15293 .{ .kind = .id_ref, .quantifier = .required },
15294 .{ .kind = .open_cl_debug_info_100_debug_type_qualifier, .quantifier = .required },
15295 },
15296 },
15297 .{
15298 .name = "DebugTypeArray",
15299 .opcode = 5,
15300 .operands = &.{
15301 .{ .kind = .id_ref, .quantifier = .required },
15302 .{ .kind = .id_ref, .quantifier = .variadic },
15303 },
15304 },
15305 .{
15306 .name = "DebugTypeVector",
15307 .opcode = 6,
15308 .operands = &.{
15309 .{ .kind = .id_ref, .quantifier = .required },
15310 .{ .kind = .literal_integer, .quantifier = .required },
15311 },
15312 },
15313 .{
15314 .name = "DebugTypedef",
15315 .opcode = 7,
15316 .operands = &.{
15317 .{ .kind = .id_ref, .quantifier = .required },
15318 .{ .kind = .id_ref, .quantifier = .required },
15319 .{ .kind = .id_ref, .quantifier = .required },
15320 .{ .kind = .literal_integer, .quantifier = .required },
15321 .{ .kind = .literal_integer, .quantifier = .required },
15322 .{ .kind = .id_ref, .quantifier = .required },
15323 },
15324 },
15325 .{
15326 .name = "DebugTypeFunction",
15327 .opcode = 8,
15328 .operands = &.{
15329 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15330 .{ .kind = .id_ref, .quantifier = .required },
15331 .{ .kind = .id_ref, .quantifier = .variadic },
15332 },
15333 },
15334 .{
15335 .name = "DebugTypeEnum",
15336 .opcode = 9,
15337 .operands = &.{
15338 .{ .kind = .id_ref, .quantifier = .required },
15339 .{ .kind = .id_ref, .quantifier = .required },
15340 .{ .kind = .id_ref, .quantifier = .required },
15341 .{ .kind = .literal_integer, .quantifier = .required },
15342 .{ .kind = .literal_integer, .quantifier = .required },
15343 .{ .kind = .id_ref, .quantifier = .required },
15344 .{ .kind = .id_ref, .quantifier = .required },
15345 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15346 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
15347 },
15348 },
15349 .{
15350 .name = "DebugTypeComposite",
15351 .opcode = 10,
15352 .operands = &.{
15353 .{ .kind = .id_ref, .quantifier = .required },
15354 .{ .kind = .open_cl_debug_info_100_debug_composite_type, .quantifier = .required },
15355 .{ .kind = .id_ref, .quantifier = .required },
15356 .{ .kind = .literal_integer, .quantifier = .required },
15357 .{ .kind = .literal_integer, .quantifier = .required },
15358 .{ .kind = .id_ref, .quantifier = .required },
15359 .{ .kind = .id_ref, .quantifier = .required },
15360 .{ .kind = .id_ref, .quantifier = .required },
15361 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15362 .{ .kind = .id_ref, .quantifier = .variadic },
15363 },
15364 },
15365 .{
15366 .name = "DebugTypeMember",
15367 .opcode = 11,
15368 .operands = &.{
15369 .{ .kind = .id_ref, .quantifier = .required },
15370 .{ .kind = .id_ref, .quantifier = .required },
15371 .{ .kind = .id_ref, .quantifier = .required },
15372 .{ .kind = .literal_integer, .quantifier = .required },
15373 .{ .kind = .literal_integer, .quantifier = .required },
15374 .{ .kind = .id_ref, .quantifier = .required },
15375 .{ .kind = .id_ref, .quantifier = .required },
15376 .{ .kind = .id_ref, .quantifier = .required },
15377 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15378 .{ .kind = .id_ref, .quantifier = .optional },
15379 },
15380 },
15381 .{
15382 .name = "DebugTypeInheritance",
15383 .opcode = 12,
15384 .operands = &.{
15385 .{ .kind = .id_ref, .quantifier = .required },
15386 .{ .kind = .id_ref, .quantifier = .required },
15387 .{ .kind = .id_ref, .quantifier = .required },
15388 .{ .kind = .id_ref, .quantifier = .required },
15389 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15390 },
15391 },
15392 .{
15393 .name = "DebugTypePtrToMember",
15394 .opcode = 13,
15395 .operands = &.{
15396 .{ .kind = .id_ref, .quantifier = .required },
15397 .{ .kind = .id_ref, .quantifier = .required },
15398 },
15399 },
15400 .{
15401 .name = "DebugTypeTemplate",
15402 .opcode = 14,
15403 .operands = &.{
15404 .{ .kind = .id_ref, .quantifier = .required },
15405 .{ .kind = .id_ref, .quantifier = .variadic },
15406 },
15407 },
15408 .{
15409 .name = "DebugTypeTemplateParameter",
15410 .opcode = 15,
15411 .operands = &.{
15412 .{ .kind = .id_ref, .quantifier = .required },
15413 .{ .kind = .id_ref, .quantifier = .required },
15414 .{ .kind = .id_ref, .quantifier = .required },
15415 .{ .kind = .id_ref, .quantifier = .required },
15416 .{ .kind = .literal_integer, .quantifier = .required },
15417 .{ .kind = .literal_integer, .quantifier = .required },
15418 },
15419 },
15420 .{
15421 .name = "DebugTypeTemplateTemplateParameter",
15422 .opcode = 16,
15423 .operands = &.{
15424 .{ .kind = .id_ref, .quantifier = .required },
15425 .{ .kind = .id_ref, .quantifier = .required },
15426 .{ .kind = .id_ref, .quantifier = .required },
15427 .{ .kind = .literal_integer, .quantifier = .required },
15428 .{ .kind = .literal_integer, .quantifier = .required },
15429 },
15430 },
15431 .{
15432 .name = "DebugTypeTemplateParameterPack",
15433 .opcode = 17,
15434 .operands = &.{
15435 .{ .kind = .id_ref, .quantifier = .required },
15436 .{ .kind = .id_ref, .quantifier = .required },
15437 .{ .kind = .literal_integer, .quantifier = .required },
15438 .{ .kind = .literal_integer, .quantifier = .required },
15439 .{ .kind = .id_ref, .quantifier = .variadic },
15440 },
15441 },
15442 .{
15443 .name = "DebugGlobalVariable",
15444 .opcode = 18,
15445 .operands = &.{
15446 .{ .kind = .id_ref, .quantifier = .required },
15447 .{ .kind = .id_ref, .quantifier = .required },
15448 .{ .kind = .id_ref, .quantifier = .required },
15449 .{ .kind = .literal_integer, .quantifier = .required },
15450 .{ .kind = .literal_integer, .quantifier = .required },
15451 .{ .kind = .id_ref, .quantifier = .required },
15452 .{ .kind = .id_ref, .quantifier = .required },
15453 .{ .kind = .id_ref, .quantifier = .required },
15454 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15455 .{ .kind = .id_ref, .quantifier = .optional },
15456 },
15457 },
15458 .{
15459 .name = "DebugFunctionDeclaration",
15460 .opcode = 19,
15461 .operands = &.{
15462 .{ .kind = .id_ref, .quantifier = .required },
15463 .{ .kind = .id_ref, .quantifier = .required },
15464 .{ .kind = .id_ref, .quantifier = .required },
15465 .{ .kind = .literal_integer, .quantifier = .required },
15466 .{ .kind = .literal_integer, .quantifier = .required },
15467 .{ .kind = .id_ref, .quantifier = .required },
15468 .{ .kind = .id_ref, .quantifier = .required },
15469 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15470 },
15471 },
15472 .{
15473 .name = "DebugFunction",
15474 .opcode = 20,
15475 .operands = &.{
15476 .{ .kind = .id_ref, .quantifier = .required },
15477 .{ .kind = .id_ref, .quantifier = .required },
15478 .{ .kind = .id_ref, .quantifier = .required },
15479 .{ .kind = .literal_integer, .quantifier = .required },
15480 .{ .kind = .literal_integer, .quantifier = .required },
15481 .{ .kind = .id_ref, .quantifier = .required },
15482 .{ .kind = .id_ref, .quantifier = .required },
15483 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15484 .{ .kind = .literal_integer, .quantifier = .required },
15485 .{ .kind = .id_ref, .quantifier = .required },
15486 .{ .kind = .id_ref, .quantifier = .optional },
15487 },
15488 },
15489 .{
15490 .name = "DebugLexicalBlock",
15491 .opcode = 21,
15492 .operands = &.{
15493 .{ .kind = .id_ref, .quantifier = .required },
15494 .{ .kind = .literal_integer, .quantifier = .required },
15495 .{ .kind = .literal_integer, .quantifier = .required },
15496 .{ .kind = .id_ref, .quantifier = .required },
15497 .{ .kind = .id_ref, .quantifier = .optional },
15498 },
15499 },
15500 .{
15501 .name = "DebugLexicalBlockDiscriminator",
15502 .opcode = 22,
15503 .operands = &.{
15504 .{ .kind = .id_ref, .quantifier = .required },
15505 .{ .kind = .literal_integer, .quantifier = .required },
15506 .{ .kind = .id_ref, .quantifier = .required },
15507 },
15508 },
15509 .{
15510 .name = "DebugScope",
15511 .opcode = 23,
15512 .operands = &.{
15513 .{ .kind = .id_ref, .quantifier = .required },
15514 .{ .kind = .id_ref, .quantifier = .optional },
15515 },
15516 },
15517 .{
15518 .name = "DebugNoScope",
15519 .opcode = 24,
15520 .operands = &.{},
15521 },
15522 .{
15523 .name = "DebugInlinedAt",
15524 .opcode = 25,
15525 .operands = &.{
15526 .{ .kind = .literal_integer, .quantifier = .required },
15527 .{ .kind = .id_ref, .quantifier = .required },
15528 .{ .kind = .id_ref, .quantifier = .optional },
15529 },
15530 },
15531 .{
15532 .name = "DebugLocalVariable",
15533 .opcode = 26,
15534 .operands = &.{
15535 .{ .kind = .id_ref, .quantifier = .required },
15536 .{ .kind = .id_ref, .quantifier = .required },
15537 .{ .kind = .id_ref, .quantifier = .required },
15538 .{ .kind = .literal_integer, .quantifier = .required },
15539 .{ .kind = .literal_integer, .quantifier = .required },
15540 .{ .kind = .id_ref, .quantifier = .required },
15541 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15542 .{ .kind = .literal_integer, .quantifier = .optional },
15543 },
15544 },
15545 .{
15546 .name = "DebugInlinedVariable",
15547 .opcode = 27,
15548 .operands = &.{
15549 .{ .kind = .id_ref, .quantifier = .required },
15550 .{ .kind = .id_ref, .quantifier = .required },
15551 },
15552 },
15553 .{
15554 .name = "DebugDeclare",
15555 .opcode = 28,
15556 .operands = &.{
15557 .{ .kind = .id_ref, .quantifier = .required },
15558 .{ .kind = .id_ref, .quantifier = .required },
15559 .{ .kind = .id_ref, .quantifier = .required },
15560 },
15561 },
15562 .{
15563 .name = "DebugValue",
15564 .opcode = 29,
15565 .operands = &.{
15566 .{ .kind = .id_ref, .quantifier = .required },
15567 .{ .kind = .id_ref, .quantifier = .required },
15568 .{ .kind = .id_ref, .quantifier = .required },
15569 .{ .kind = .id_ref, .quantifier = .variadic },
15570 },
15571 },
15572 .{
15573 .name = "DebugOperation",
15574 .opcode = 30,
15575 .operands = &.{
15576 .{ .kind = .open_cl_debug_info_100_debug_operation, .quantifier = .required },
15577 .{ .kind = .literal_integer, .quantifier = .variadic },
15578 },
15579 },
15580 .{
15581 .name = "DebugExpression",
15582 .opcode = 31,
15583 .operands = &.{
15584 .{ .kind = .id_ref, .quantifier = .variadic },
15585 },
15586 },
15587 .{
15588 .name = "DebugMacroDef",
15589 .opcode = 32,
15590 .operands = &.{
15591 .{ .kind = .id_ref, .quantifier = .required },
15592 .{ .kind = .literal_integer, .quantifier = .required },
15593 .{ .kind = .id_ref, .quantifier = .required },
15594 .{ .kind = .id_ref, .quantifier = .optional },
15595 },
15596 },
15597 .{
15598 .name = "DebugMacroUndef",
15599 .opcode = 33,
15600 .operands = &.{
15601 .{ .kind = .id_ref, .quantifier = .required },
15602 .{ .kind = .literal_integer, .quantifier = .required },
15603 .{ .kind = .id_ref, .quantifier = .required },
15604 },
15605 },
15606 .{
15607 .name = "DebugImportedEntity",
15608 .opcode = 34,
15609 .operands = &.{
15610 .{ .kind = .id_ref, .quantifier = .required },
15611 .{ .kind = .open_cl_debug_info_100_debug_imported_entity, .quantifier = .required },
15612 .{ .kind = .id_ref, .quantifier = .required },
15613 .{ .kind = .id_ref, .quantifier = .required },
15614 .{ .kind = .literal_integer, .quantifier = .required },
15615 .{ .kind = .literal_integer, .quantifier = .required },
15616 .{ .kind = .id_ref, .quantifier = .required },
15617 },
15618 },
15619 .{
15620 .name = "DebugSource",
15621 .opcode = 35,
15622 .operands = &.{
15623 .{ .kind = .id_ref, .quantifier = .required },
15624 .{ .kind = .id_ref, .quantifier = .optional },
15625 },
15626 },
15627 .{
15628 .name = "DebugModuleINTEL",
15629 .opcode = 36,
15630 .operands = &.{
15631 .{ .kind = .id_ref, .quantifier = .required },
15632 .{ .kind = .id_ref, .quantifier = .required },
15633 .{ .kind = .id_ref, .quantifier = .required },
15634 .{ .kind = .literal_integer, .quantifier = .required },
15635 .{ .kind = .id_ref, .quantifier = .required },
15636 .{ .kind = .id_ref, .quantifier = .required },
15637 .{ .kind = .id_ref, .quantifier = .required },
15638 .{ .kind = .literal_integer, .quantifier = .required },
15639 },
15640 },
15641 },
15642 .@"NonSemantic.ClspvReflection.6" => &.{
15643 .{
15644 .name = "Kernel",
15645 .opcode = 1,
15646 .operands = &.{
15647 .{ .kind = .id_ref, .quantifier = .required },
15648 .{ .kind = .id_ref, .quantifier = .required },
15649 .{ .kind = .id_ref, .quantifier = .optional },
15650 .{ .kind = .id_ref, .quantifier = .optional },
15651 .{ .kind = .id_ref, .quantifier = .optional },
15652 },
15653 },
15654 .{
15655 .name = "ArgumentInfo",
15656 .opcode = 2,
15657 .operands = &.{
15658 .{ .kind = .id_ref, .quantifier = .required },
15659 .{ .kind = .id_ref, .quantifier = .optional },
15660 .{ .kind = .id_ref, .quantifier = .optional },
15661 .{ .kind = .id_ref, .quantifier = .optional },
15662 .{ .kind = .id_ref, .quantifier = .optional },
15663 },
15664 },
15665 .{
15666 .name = "ArgumentStorageBuffer",
15667 .opcode = 3,
15668 .operands = &.{
15669 .{ .kind = .id_ref, .quantifier = .required },
15670 .{ .kind = .id_ref, .quantifier = .required },
15671 .{ .kind = .id_ref, .quantifier = .required },
15672 .{ .kind = .id_ref, .quantifier = .required },
15673 .{ .kind = .id_ref, .quantifier = .optional },
15674 },
15675 },
15676 .{
15677 .name = "ArgumentUniform",
15678 .opcode = 4,
15679 .operands = &.{
15680 .{ .kind = .id_ref, .quantifier = .required },
15681 .{ .kind = .id_ref, .quantifier = .required },
15682 .{ .kind = .id_ref, .quantifier = .required },
15683 .{ .kind = .id_ref, .quantifier = .required },
15684 .{ .kind = .id_ref, .quantifier = .optional },
15685 },
15686 },
15687 .{
15688 .name = "ArgumentPodStorageBuffer",
15689 .opcode = 5,
15690 .operands = &.{
15691 .{ .kind = .id_ref, .quantifier = .required },
15692 .{ .kind = .id_ref, .quantifier = .required },
15693 .{ .kind = .id_ref, .quantifier = .required },
15694 .{ .kind = .id_ref, .quantifier = .required },
15695 .{ .kind = .id_ref, .quantifier = .required },
15696 .{ .kind = .id_ref, .quantifier = .required },
15697 .{ .kind = .id_ref, .quantifier = .optional },
15698 },
15699 },
15700 .{
15701 .name = "ArgumentPodUniform",
15702 .opcode = 6,
15703 .operands = &.{
15704 .{ .kind = .id_ref, .quantifier = .required },
15705 .{ .kind = .id_ref, .quantifier = .required },
15706 .{ .kind = .id_ref, .quantifier = .required },
15707 .{ .kind = .id_ref, .quantifier = .required },
15708 .{ .kind = .id_ref, .quantifier = .required },
15709 .{ .kind = .id_ref, .quantifier = .required },
15710 .{ .kind = .id_ref, .quantifier = .optional },
15711 },
15712 },
15713 .{
15714 .name = "ArgumentPodPushConstant",
15715 .opcode = 7,
15716 .operands = &.{
15717 .{ .kind = .id_ref, .quantifier = .required },
15718 .{ .kind = .id_ref, .quantifier = .required },
15719 .{ .kind = .id_ref, .quantifier = .required },
15720 .{ .kind = .id_ref, .quantifier = .required },
15721 .{ .kind = .id_ref, .quantifier = .optional },
15722 },
15723 },
15724 .{
15725 .name = "ArgumentSampledImage",
15726 .opcode = 8,
15727 .operands = &.{
15728 .{ .kind = .id_ref, .quantifier = .required },
15729 .{ .kind = .id_ref, .quantifier = .required },
15730 .{ .kind = .id_ref, .quantifier = .required },
15731 .{ .kind = .id_ref, .quantifier = .required },
15732 .{ .kind = .id_ref, .quantifier = .optional },
15733 },
15734 },
15735 .{
15736 .name = "ArgumentStorageImage",
15737 .opcode = 9,
15738 .operands = &.{
15739 .{ .kind = .id_ref, .quantifier = .required },
15740 .{ .kind = .id_ref, .quantifier = .required },
15741 .{ .kind = .id_ref, .quantifier = .required },
15742 .{ .kind = .id_ref, .quantifier = .required },
15743 .{ .kind = .id_ref, .quantifier = .optional },
15744 },
15745 },
15746 .{
15747 .name = "ArgumentSampler",
15748 .opcode = 10,
15749 .operands = &.{
15750 .{ .kind = .id_ref, .quantifier = .required },
15751 .{ .kind = .id_ref, .quantifier = .required },
15752 .{ .kind = .id_ref, .quantifier = .required },
15753 .{ .kind = .id_ref, .quantifier = .required },
15754 .{ .kind = .id_ref, .quantifier = .optional },
15755 },
15756 },
15757 .{
15758 .name = "ArgumentWorkgroup",
15759 .opcode = 11,
15760 .operands = &.{
15761 .{ .kind = .id_ref, .quantifier = .required },
15762 .{ .kind = .id_ref, .quantifier = .required },
15763 .{ .kind = .id_ref, .quantifier = .required },
15764 .{ .kind = .id_ref, .quantifier = .required },
15765 .{ .kind = .id_ref, .quantifier = .optional },
15766 },
15767 },
15768 .{
15769 .name = "SpecConstantWorkgroupSize",
15770 .opcode = 12,
15771 .operands = &.{
15772 .{ .kind = .id_ref, .quantifier = .required },
15773 .{ .kind = .id_ref, .quantifier = .required },
15774 .{ .kind = .id_ref, .quantifier = .required },
15775 },
15776 },
15777 .{
15778 .name = "SpecConstantGlobalOffset",
15779 .opcode = 13,
15780 .operands = &.{
15781 .{ .kind = .id_ref, .quantifier = .required },
15782 .{ .kind = .id_ref, .quantifier = .required },
15783 .{ .kind = .id_ref, .quantifier = .required },
15784 },
15785 },
15786 .{
15787 .name = "SpecConstantWorkDim",
15788 .opcode = 14,
15789 .operands = &.{
15790 .{ .kind = .id_ref, .quantifier = .required },
15791 },
15792 },
15793 .{
15794 .name = "PushConstantGlobalOffset",
15795 .opcode = 15,
15796 .operands = &.{
15797 .{ .kind = .id_ref, .quantifier = .required },
15798 .{ .kind = .id_ref, .quantifier = .required },
15799 },
15800 },
15801 .{
15802 .name = "PushConstantEnqueuedLocalSize",
15803 .opcode = 16,
15804 .operands = &.{
15805 .{ .kind = .id_ref, .quantifier = .required },
15806 .{ .kind = .id_ref, .quantifier = .required },
15807 },
15808 },
15809 .{
15810 .name = "PushConstantGlobalSize",
15811 .opcode = 17,
15812 .operands = &.{
15813 .{ .kind = .id_ref, .quantifier = .required },
15814 .{ .kind = .id_ref, .quantifier = .required },
15815 },
15816 },
15817 .{
15818 .name = "PushConstantRegionOffset",
15819 .opcode = 18,
15820 .operands = &.{
15821 .{ .kind = .id_ref, .quantifier = .required },
15822 .{ .kind = .id_ref, .quantifier = .required },
15823 },
15824 },
15825 .{
15826 .name = "PushConstantNumWorkgroups",
15827 .opcode = 19,
15828 .operands = &.{
15829 .{ .kind = .id_ref, .quantifier = .required },
15830 .{ .kind = .id_ref, .quantifier = .required },
15831 },
15832 },
15833 .{
15834 .name = "PushConstantRegionGroupOffset",
15835 .opcode = 20,
15836 .operands = &.{
15837 .{ .kind = .id_ref, .quantifier = .required },
15838 .{ .kind = .id_ref, .quantifier = .required },
15839 },
15840 },
15841 .{
15842 .name = "ConstantDataStorageBuffer",
15843 .opcode = 21,
15844 .operands = &.{
15845 .{ .kind = .id_ref, .quantifier = .required },
15846 .{ .kind = .id_ref, .quantifier = .required },
15847 .{ .kind = .id_ref, .quantifier = .required },
15848 },
15849 },
15850 .{
15851 .name = "ConstantDataUniform",
15852 .opcode = 22,
15853 .operands = &.{
15854 .{ .kind = .id_ref, .quantifier = .required },
15855 .{ .kind = .id_ref, .quantifier = .required },
15856 .{ .kind = .id_ref, .quantifier = .required },
15857 },
15858 },
15859 .{
15860 .name = "LiteralSampler",
15861 .opcode = 23,
15862 .operands = &.{
15863 .{ .kind = .id_ref, .quantifier = .required },
15864 .{ .kind = .id_ref, .quantifier = .required },
15865 .{ .kind = .id_ref, .quantifier = .required },
15866 },
15867 },
15868 .{
15869 .name = "PropertyRequiredWorkgroupSize",
15870 .opcode = 24,
15871 .operands = &.{
15872 .{ .kind = .id_ref, .quantifier = .required },
15873 .{ .kind = .id_ref, .quantifier = .required },
15874 .{ .kind = .id_ref, .quantifier = .required },
15875 .{ .kind = .id_ref, .quantifier = .required },
15876 },
15877 },
15878 .{
15879 .name = "SpecConstantSubgroupMaxSize",
15880 .opcode = 25,
15881 .operands = &.{
15882 .{ .kind = .id_ref, .quantifier = .required },
15883 },
15884 },
15885 .{
15886 .name = "ArgumentPointerPushConstant",
15887 .opcode = 26,
15888 .operands = &.{
15889 .{ .kind = .id_ref, .quantifier = .required },
15890 .{ .kind = .id_ref, .quantifier = .required },
15891 .{ .kind = .id_ref, .quantifier = .required },
15892 .{ .kind = .id_ref, .quantifier = .required },
15893 .{ .kind = .id_ref, .quantifier = .optional },
15894 },
15895 },
15896 .{
15897 .name = "ArgumentPointerUniform",
15898 .opcode = 27,
15899 .operands = &.{
15900 .{ .kind = .id_ref, .quantifier = .required },
15901 .{ .kind = .id_ref, .quantifier = .required },
15902 .{ .kind = .id_ref, .quantifier = .required },
15903 .{ .kind = .id_ref, .quantifier = .required },
15904 .{ .kind = .id_ref, .quantifier = .required },
15905 .{ .kind = .id_ref, .quantifier = .required },
15906 .{ .kind = .id_ref, .quantifier = .optional },
15907 },
15908 },
15909 .{
15910 .name = "ProgramScopeVariablesStorageBuffer",
15911 .opcode = 28,
15912 .operands = &.{
15913 .{ .kind = .id_ref, .quantifier = .required },
15914 .{ .kind = .id_ref, .quantifier = .required },
15915 .{ .kind = .id_ref, .quantifier = .required },
15916 },
15917 },
15918 .{
15919 .name = "ProgramScopeVariablePointerRelocation",
15920 .opcode = 29,
15921 .operands = &.{
15922 .{ .kind = .id_ref, .quantifier = .required },
15923 .{ .kind = .id_ref, .quantifier = .required },
15924 .{ .kind = .id_ref, .quantifier = .required },
15925 },
15926 },
15927 .{
15928 .name = "ImageArgumentInfoChannelOrderPushConstant",
15929 .opcode = 30,
15930 .operands = &.{
15931 .{ .kind = .id_ref, .quantifier = .required },
15932 .{ .kind = .id_ref, .quantifier = .required },
15933 .{ .kind = .id_ref, .quantifier = .required },
15934 .{ .kind = .id_ref, .quantifier = .required },
15935 },
15936 },
15937 .{
15938 .name = "ImageArgumentInfoChannelDataTypePushConstant",
15939 .opcode = 31,
15940 .operands = &.{
15941 .{ .kind = .id_ref, .quantifier = .required },
15942 .{ .kind = .id_ref, .quantifier = .required },
15943 .{ .kind = .id_ref, .quantifier = .required },
15944 .{ .kind = .id_ref, .quantifier = .required },
15945 },
15946 },
15947 .{
15948 .name = "ImageArgumentInfoChannelOrderUniform",
15949 .opcode = 32,
15950 .operands = &.{
15951 .{ .kind = .id_ref, .quantifier = .required },
15952 .{ .kind = .id_ref, .quantifier = .required },
15953 .{ .kind = .id_ref, .quantifier = .required },
15954 .{ .kind = .id_ref, .quantifier = .required },
15955 .{ .kind = .id_ref, .quantifier = .required },
15956 .{ .kind = .id_ref, .quantifier = .required },
15957 },
15958 },
15959 .{
15960 .name = "ImageArgumentInfoChannelDataTypeUniform",
15961 .opcode = 33,
15962 .operands = &.{
15963 .{ .kind = .id_ref, .quantifier = .required },
15964 .{ .kind = .id_ref, .quantifier = .required },
15965 .{ .kind = .id_ref, .quantifier = .required },
15966 .{ .kind = .id_ref, .quantifier = .required },
15967 .{ .kind = .id_ref, .quantifier = .required },
15968 .{ .kind = .id_ref, .quantifier = .required },
15969 },
15970 },
15971 .{
15972 .name = "ArgumentStorageTexelBuffer",
15973 .opcode = 34,
15974 .operands = &.{
15975 .{ .kind = .id_ref, .quantifier = .required },
15976 .{ .kind = .id_ref, .quantifier = .required },
15977 .{ .kind = .id_ref, .quantifier = .required },
15978 .{ .kind = .id_ref, .quantifier = .required },
15979 .{ .kind = .id_ref, .quantifier = .optional },
15980 },
15981 },
15982 .{
15983 .name = "ArgumentUniformTexelBuffer",
15984 .opcode = 35,
15985 .operands = &.{
15986 .{ .kind = .id_ref, .quantifier = .required },
15987 .{ .kind = .id_ref, .quantifier = .required },
15988 .{ .kind = .id_ref, .quantifier = .required },
15989 .{ .kind = .id_ref, .quantifier = .required },
15990 .{ .kind = .id_ref, .quantifier = .optional },
15991 },
15992 },
15993 .{
15994 .name = "ConstantDataPointerPushConstant",
15995 .opcode = 36,
15996 .operands = &.{
15997 .{ .kind = .id_ref, .quantifier = .required },
15998 .{ .kind = .id_ref, .quantifier = .required },
15999 .{ .kind = .id_ref, .quantifier = .required },
16000 },
16001 },
16002 .{
16003 .name = "ProgramScopeVariablePointerPushConstant",
16004 .opcode = 37,
16005 .operands = &.{
16006 .{ .kind = .id_ref, .quantifier = .required },
16007 .{ .kind = .id_ref, .quantifier = .required },
16008 .{ .kind = .id_ref, .quantifier = .required },
16009 },
16010 },
16011 .{
16012 .name = "PrintfInfo",
16013 .opcode = 38,
16014 .operands = &.{
16015 .{ .kind = .id_ref, .quantifier = .required },
16016 .{ .kind = .id_ref, .quantifier = .required },
16017 .{ .kind = .id_ref, .quantifier = .variadic },
16018 },
16019 },
16020 .{
16021 .name = "PrintfBufferStorageBuffer",
16022 .opcode = 39,
16023 .operands = &.{
16024 .{ .kind = .id_ref, .quantifier = .required },
16025 .{ .kind = .id_ref, .quantifier = .required },
16026 .{ .kind = .id_ref, .quantifier = .required },
16027 },
16028 },
16029 .{
16030 .name = "PrintfBufferPointerPushConstant",
16031 .opcode = 40,
16032 .operands = &.{
16033 .{ .kind = .id_ref, .quantifier = .required },
16034 .{ .kind = .id_ref, .quantifier = .required },
16035 .{ .kind = .id_ref, .quantifier = .required },
16036 },
16037 },
16038 .{
16039 .name = "NormalizedSamplerMaskPushConstant",
16040 .opcode = 41,
16041 .operands = &.{
16042 .{ .kind = .id_ref, .quantifier = .required },
16043 .{ .kind = .id_ref, .quantifier = .required },
16044 .{ .kind = .id_ref, .quantifier = .required },
16045 .{ .kind = .id_ref, .quantifier = .required },
16046 },
16047 },
16048 .{
16049 .name = "WorkgroupVariableSize",
16050 .opcode = 42,
16051 .operands = &.{
16052 .{ .kind = .id_ref, .quantifier = .required },
16053 .{ .kind = .id_ref, .quantifier = .required },
16054 },
16055 },
16056 },
16057 .@"GLSL.std.450" => &.{
16058 .{
16059 .name = "Round",
16060 .opcode = 1,
16061 .operands = &.{
16062 .{ .kind = .id_ref, .quantifier = .required },
16063 },
16064 },
16065 .{
16066 .name = "RoundEven",
16067 .opcode = 2,
16068 .operands = &.{
16069 .{ .kind = .id_ref, .quantifier = .required },
16070 },
16071 },
16072 .{
16073 .name = "Trunc",
16074 .opcode = 3,
16075 .operands = &.{
16076 .{ .kind = .id_ref, .quantifier = .required },
16077 },
16078 },
16079 .{
16080 .name = "FAbs",
16081 .opcode = 4,
16082 .operands = &.{
16083 .{ .kind = .id_ref, .quantifier = .required },
16084 },
16085 },
16086 .{
16087 .name = "SAbs",
16088 .opcode = 5,
16089 .operands = &.{
16090 .{ .kind = .id_ref, .quantifier = .required },
16091 },
16092 },
16093 .{
16094 .name = "FSign",
16095 .opcode = 6,
16096 .operands = &.{
16097 .{ .kind = .id_ref, .quantifier = .required },
16098 },
16099 },
16100 .{
16101 .name = "SSign",
16102 .opcode = 7,
16103 .operands = &.{
16104 .{ .kind = .id_ref, .quantifier = .required },
16105 },
16106 },
16107 .{
16108 .name = "Floor",
16109 .opcode = 8,
16110 .operands = &.{
16111 .{ .kind = .id_ref, .quantifier = .required },
16112 },
16113 },
16114 .{
16115 .name = "Ceil",
16116 .opcode = 9,
16117 .operands = &.{
16118 .{ .kind = .id_ref, .quantifier = .required },
16119 },
16120 },
16121 .{
16122 .name = "Fract",
16123 .opcode = 10,
16124 .operands = &.{
16125 .{ .kind = .id_ref, .quantifier = .required },
16126 },
16127 },
16128 .{
16129 .name = "Radians",
16130 .opcode = 11,
16131 .operands = &.{
16132 .{ .kind = .id_ref, .quantifier = .required },
16133 },
16134 },
16135 .{
16136 .name = "Degrees",
16137 .opcode = 12,
16138 .operands = &.{
16139 .{ .kind = .id_ref, .quantifier = .required },
16140 },
16141 },
16142 .{
16143 .name = "Sin",
16144 .opcode = 13,
16145 .operands = &.{
16146 .{ .kind = .id_ref, .quantifier = .required },
16147 },
16148 },
16149 .{
16150 .name = "Cos",
16151 .opcode = 14,
16152 .operands = &.{
16153 .{ .kind = .id_ref, .quantifier = .required },
16154 },
16155 },
16156 .{
16157 .name = "Tan",
16158 .opcode = 15,
16159 .operands = &.{
16160 .{ .kind = .id_ref, .quantifier = .required },
16161 },
16162 },
16163 .{
16164 .name = "Asin",
16165 .opcode = 16,
16166 .operands = &.{
16167 .{ .kind = .id_ref, .quantifier = .required },
16168 },
16169 },
16170 .{
16171 .name = "Acos",
16172 .opcode = 17,
16173 .operands = &.{
16174 .{ .kind = .id_ref, .quantifier = .required },
16175 },
16176 },
16177 .{
16178 .name = "Atan",
16179 .opcode = 18,
16180 .operands = &.{
16181 .{ .kind = .id_ref, .quantifier = .required },
16182 },
16183 },
16184 .{
16185 .name = "Sinh",
16186 .opcode = 19,
16187 .operands = &.{
16188 .{ .kind = .id_ref, .quantifier = .required },
16189 },
16190 },
16191 .{
16192 .name = "Cosh",
16193 .opcode = 20,
16194 .operands = &.{
16195 .{ .kind = .id_ref, .quantifier = .required },
16196 },
16197 },
16198 .{
16199 .name = "Tanh",
16200 .opcode = 21,
16201 .operands = &.{
16202 .{ .kind = .id_ref, .quantifier = .required },
16203 },
16204 },
16205 .{
16206 .name = "Asinh",
16207 .opcode = 22,
16208 .operands = &.{
16209 .{ .kind = .id_ref, .quantifier = .required },
16210 },
16211 },
16212 .{
16213 .name = "Acosh",
16214 .opcode = 23,
16215 .operands = &.{
16216 .{ .kind = .id_ref, .quantifier = .required },
16217 },
16218 },
16219 .{
16220 .name = "Atanh",
16221 .opcode = 24,
16222 .operands = &.{
16223 .{ .kind = .id_ref, .quantifier = .required },
16224 },
16225 },
16226 .{
16227 .name = "Atan2",
16228 .opcode = 25,
16229 .operands = &.{
16230 .{ .kind = .id_ref, .quantifier = .required },
16231 .{ .kind = .id_ref, .quantifier = .required },
16232 },
16233 },
16234 .{
16235 .name = "Pow",
16236 .opcode = 26,
16237 .operands = &.{
16238 .{ .kind = .id_ref, .quantifier = .required },
16239 .{ .kind = .id_ref, .quantifier = .required },
16240 },
16241 },
16242 .{
16243 .name = "Exp",
16244 .opcode = 27,
16245 .operands = &.{
16246 .{ .kind = .id_ref, .quantifier = .required },
16247 },
16248 },
16249 .{
16250 .name = "Log",
16251 .opcode = 28,
16252 .operands = &.{
16253 .{ .kind = .id_ref, .quantifier = .required },
16254 },
16255 },
16256 .{
16257 .name = "Exp2",
16258 .opcode = 29,
16259 .operands = &.{
16260 .{ .kind = .id_ref, .quantifier = .required },
16261 },
16262 },
16263 .{
16264 .name = "Log2",
16265 .opcode = 30,
16266 .operands = &.{
16267 .{ .kind = .id_ref, .quantifier = .required },
16268 },
16269 },
16270 .{
16271 .name = "Sqrt",
16272 .opcode = 31,
16273 .operands = &.{
16274 .{ .kind = .id_ref, .quantifier = .required },
16275 },
16276 },
16277 .{
16278 .name = "InverseSqrt",
16279 .opcode = 32,
16280 .operands = &.{
16281 .{ .kind = .id_ref, .quantifier = .required },
16282 },
16283 },
16284 .{
16285 .name = "Determinant",
16286 .opcode = 33,
16287 .operands = &.{
16288 .{ .kind = .id_ref, .quantifier = .required },
16289 },
16290 },
16291 .{
16292 .name = "MatrixInverse",
16293 .opcode = 34,
16294 .operands = &.{
16295 .{ .kind = .id_ref, .quantifier = .required },
16296 },
16297 },
16298 .{
16299 .name = "Modf",
16300 .opcode = 35,
16301 .operands = &.{
16302 .{ .kind = .id_ref, .quantifier = .required },
16303 .{ .kind = .id_ref, .quantifier = .required },
16304 },
16305 },
16306 .{
16307 .name = "ModfStruct",
16308 .opcode = 36,
16309 .operands = &.{
16310 .{ .kind = .id_ref, .quantifier = .required },
16311 },
16312 },
16313 .{
16314 .name = "FMin",
16315 .opcode = 37,
16316 .operands = &.{
16317 .{ .kind = .id_ref, .quantifier = .required },
16318 .{ .kind = .id_ref, .quantifier = .required },
16319 },
16320 },
16321 .{
16322 .name = "UMin",
16323 .opcode = 38,
16324 .operands = &.{
16325 .{ .kind = .id_ref, .quantifier = .required },
16326 .{ .kind = .id_ref, .quantifier = .required },
16327 },
16328 },
16329 .{
16330 .name = "SMin",
16331 .opcode = 39,
16332 .operands = &.{
16333 .{ .kind = .id_ref, .quantifier = .required },
16334 .{ .kind = .id_ref, .quantifier = .required },
16335 },
16336 },
16337 .{
16338 .name = "FMax",
16339 .opcode = 40,
16340 .operands = &.{
16341 .{ .kind = .id_ref, .quantifier = .required },
16342 .{ .kind = .id_ref, .quantifier = .required },
16343 },
16344 },
16345 .{
16346 .name = "UMax",
16347 .opcode = 41,
16348 .operands = &.{
16349 .{ .kind = .id_ref, .quantifier = .required },
16350 .{ .kind = .id_ref, .quantifier = .required },
16351 },
16352 },
16353 .{
16354 .name = "SMax",
16355 .opcode = 42,
16356 .operands = &.{
16357 .{ .kind = .id_ref, .quantifier = .required },
16358 .{ .kind = .id_ref, .quantifier = .required },
16359 },
16360 },
16361 .{
16362 .name = "FClamp",
16363 .opcode = 43,
16364 .operands = &.{
16365 .{ .kind = .id_ref, .quantifier = .required },
16366 .{ .kind = .id_ref, .quantifier = .required },
16367 .{ .kind = .id_ref, .quantifier = .required },
16368 },
16369 },
16370 .{
16371 .name = "UClamp",
16372 .opcode = 44,
16373 .operands = &.{
16374 .{ .kind = .id_ref, .quantifier = .required },
16375 .{ .kind = .id_ref, .quantifier = .required },
16376 .{ .kind = .id_ref, .quantifier = .required },
16377 },
16378 },
16379 .{
16380 .name = "SClamp",
16381 .opcode = 45,
16382 .operands = &.{
16383 .{ .kind = .id_ref, .quantifier = .required },
16384 .{ .kind = .id_ref, .quantifier = .required },
16385 .{ .kind = .id_ref, .quantifier = .required },
16386 },
16387 },
16388 .{
16389 .name = "FMix",
16390 .opcode = 46,
16391 .operands = &.{
16392 .{ .kind = .id_ref, .quantifier = .required },
16393 .{ .kind = .id_ref, .quantifier = .required },
16394 .{ .kind = .id_ref, .quantifier = .required },
16395 },
16396 },
16397 .{
16398 .name = "IMix",
16399 .opcode = 47,
16400 .operands = &.{
16401 .{ .kind = .id_ref, .quantifier = .required },
16402 .{ .kind = .id_ref, .quantifier = .required },
16403 .{ .kind = .id_ref, .quantifier = .required },
16404 },
16405 },
16406 .{
16407 .name = "Step",
16408 .opcode = 48,
16409 .operands = &.{
16410 .{ .kind = .id_ref, .quantifier = .required },
16411 .{ .kind = .id_ref, .quantifier = .required },
16412 },
16413 },
16414 .{
16415 .name = "SmoothStep",
16416 .opcode = 49,
16417 .operands = &.{
16418 .{ .kind = .id_ref, .quantifier = .required },
16419 .{ .kind = .id_ref, .quantifier = .required },
16420 .{ .kind = .id_ref, .quantifier = .required },
16421 },
16422 },
16423 .{
16424 .name = "Fma",
16425 .opcode = 50,
16426 .operands = &.{
16427 .{ .kind = .id_ref, .quantifier = .required },
16428 .{ .kind = .id_ref, .quantifier = .required },
16429 .{ .kind = .id_ref, .quantifier = .required },
16430 },
16431 },
16432 .{
16433 .name = "Frexp",
16434 .opcode = 51,
16435 .operands = &.{
16436 .{ .kind = .id_ref, .quantifier = .required },
16437 .{ .kind = .id_ref, .quantifier = .required },
16438 },
16439 },
16440 .{
16441 .name = "FrexpStruct",
16442 .opcode = 52,
16443 .operands = &.{
16444 .{ .kind = .id_ref, .quantifier = .required },
16445 },
16446 },
16447 .{
16448 .name = "Ldexp",
16449 .opcode = 53,
16450 .operands = &.{
16451 .{ .kind = .id_ref, .quantifier = .required },
16452 .{ .kind = .id_ref, .quantifier = .required },
16453 },
16454 },
16455 .{
16456 .name = "PackSnorm4x8",
16457 .opcode = 54,
16458 .operands = &.{
16459 .{ .kind = .id_ref, .quantifier = .required },
16460 },
16461 },
16462 .{
16463 .name = "PackUnorm4x8",
16464 .opcode = 55,
16465 .operands = &.{
16466 .{ .kind = .id_ref, .quantifier = .required },
16467 },
16468 },
16469 .{
16470 .name = "PackSnorm2x16",
16471 .opcode = 56,
16472 .operands = &.{
16473 .{ .kind = .id_ref, .quantifier = .required },
16474 },
16475 },
16476 .{
16477 .name = "PackUnorm2x16",
16478 .opcode = 57,
16479 .operands = &.{
16480 .{ .kind = .id_ref, .quantifier = .required },
16481 },
16482 },
16483 .{
16484 .name = "PackHalf2x16",
16485 .opcode = 58,
16486 .operands = &.{
16487 .{ .kind = .id_ref, .quantifier = .required },
16488 },
16489 },
16490 .{
16491 .name = "PackDouble2x32",
16492 .opcode = 59,
16493 .operands = &.{
16494 .{ .kind = .id_ref, .quantifier = .required },
16495 },
16496 },
16497 .{
16498 .name = "UnpackSnorm2x16",
16499 .opcode = 60,
16500 .operands = &.{
16501 .{ .kind = .id_ref, .quantifier = .required },
16502 },
16503 },
16504 .{
16505 .name = "UnpackUnorm2x16",
16506 .opcode = 61,
16507 .operands = &.{
16508 .{ .kind = .id_ref, .quantifier = .required },
16509 },
16510 },
16511 .{
16512 .name = "UnpackHalf2x16",
16513 .opcode = 62,
16514 .operands = &.{
16515 .{ .kind = .id_ref, .quantifier = .required },
16516 },
16517 },
16518 .{
16519 .name = "UnpackSnorm4x8",
16520 .opcode = 63,
16521 .operands = &.{
16522 .{ .kind = .id_ref, .quantifier = .required },
16523 },
16524 },
16525 .{
16526 .name = "UnpackUnorm4x8",
16527 .opcode = 64,
16528 .operands = &.{
16529 .{ .kind = .id_ref, .quantifier = .required },
16530 },
16531 },
16532 .{
16533 .name = "UnpackDouble2x32",
16534 .opcode = 65,
16535 .operands = &.{
16536 .{ .kind = .id_ref, .quantifier = .required },
16537 },
16538 },
16539 .{
16540 .name = "Length",
16541 .opcode = 66,
16542 .operands = &.{
16543 .{ .kind = .id_ref, .quantifier = .required },
16544 },
16545 },
16546 .{
16547 .name = "Distance",
16548 .opcode = 67,
16549 .operands = &.{
16550 .{ .kind = .id_ref, .quantifier = .required },
16551 .{ .kind = .id_ref, .quantifier = .required },
16552 },
16553 },
16554 .{
16555 .name = "Cross",
16556 .opcode = 68,
16557 .operands = &.{
16558 .{ .kind = .id_ref, .quantifier = .required },
16559 .{ .kind = .id_ref, .quantifier = .required },
16560 },
16561 },
16562 .{
16563 .name = "Normalize",
16564 .opcode = 69,
16565 .operands = &.{
16566 .{ .kind = .id_ref, .quantifier = .required },
16567 },
16568 },
16569 .{
16570 .name = "FaceForward",
16571 .opcode = 70,
16572 .operands = &.{
16573 .{ .kind = .id_ref, .quantifier = .required },
16574 .{ .kind = .id_ref, .quantifier = .required },
16575 .{ .kind = .id_ref, .quantifier = .required },
16576 },
16577 },
16578 .{
16579 .name = "Reflect",
16580 .opcode = 71,
16581 .operands = &.{
16582 .{ .kind = .id_ref, .quantifier = .required },
16583 .{ .kind = .id_ref, .quantifier = .required },
16584 },
16585 },
16586 .{
16587 .name = "Refract",
16588 .opcode = 72,
16589 .operands = &.{
16590 .{ .kind = .id_ref, .quantifier = .required },
16591 .{ .kind = .id_ref, .quantifier = .required },
16592 .{ .kind = .id_ref, .quantifier = .required },
16593 },
16594 },
16595 .{
16596 .name = "FindILsb",
16597 .opcode = 73,
16598 .operands = &.{
16599 .{ .kind = .id_ref, .quantifier = .required },
16600 },
16601 },
16602 .{
16603 .name = "FindSMsb",
16604 .opcode = 74,
16605 .operands = &.{
16606 .{ .kind = .id_ref, .quantifier = .required },
16607 },
16608 },
16609 .{
16610 .name = "FindUMsb",
16611 .opcode = 75,
16612 .operands = &.{
16613 .{ .kind = .id_ref, .quantifier = .required },
16614 },
16615 },
16616 .{
16617 .name = "InterpolateAtCentroid",
16618 .opcode = 76,
16619 .operands = &.{
16620 .{ .kind = .id_ref, .quantifier = .required },
16621 },
16622 },
16623 .{
16624 .name = "InterpolateAtSample",
16625 .opcode = 77,
16626 .operands = &.{
16627 .{ .kind = .id_ref, .quantifier = .required },
16628 .{ .kind = .id_ref, .quantifier = .required },
16629 },
16630 },
16631 .{
16632 .name = "InterpolateAtOffset",
16633 .opcode = 78,
16634 .operands = &.{
16635 .{ .kind = .id_ref, .quantifier = .required },
16636 .{ .kind = .id_ref, .quantifier = .required },
16637 },
16638 },
16639 .{
16640 .name = "NMin",
16641 .opcode = 79,
16642 .operands = &.{
16643 .{ .kind = .id_ref, .quantifier = .required },
16644 .{ .kind = .id_ref, .quantifier = .required },
16645 },
16646 },
16647 .{
16648 .name = "NMax",
16649 .opcode = 80,
16650 .operands = &.{
16651 .{ .kind = .id_ref, .quantifier = .required },
16652 .{ .kind = .id_ref, .quantifier = .required },
16653 },
16654 },
16655 .{
16656 .name = "NClamp",
16657 .opcode = 81,
16658 .operands = &.{
16659 .{ .kind = .id_ref, .quantifier = .required },
16660 .{ .kind = .id_ref, .quantifier = .required },
16661 .{ .kind = .id_ref, .quantifier = .required },
16662 },
16663 },
16664 },
16665 .SPV_AMD_shader_ballot => &.{
16666 .{
16667 .name = "SwizzleInvocationsAMD",
16668 .opcode = 1,
16669 .operands = &.{
16670 .{ .kind = .id_ref, .quantifier = .required },
16671 .{ .kind = .id_ref, .quantifier = .required },
16672 },
16673 },
16674 .{
16675 .name = "SwizzleInvocationsMaskedAMD",
16676 .opcode = 2,
16677 .operands = &.{
16678 .{ .kind = .id_ref, .quantifier = .required },
16679 .{ .kind = .id_ref, .quantifier = .required },
16680 },
16681 },
16682 .{
16683 .name = "WriteInvocationAMD",
16684 .opcode = 3,
16685 .operands = &.{
16686 .{ .kind = .id_ref, .quantifier = .required },
16687 .{ .kind = .id_ref, .quantifier = .required },
16688 .{ .kind = .id_ref, .quantifier = .required },
16689 },
16690 },
16691 .{
16692 .name = "MbcntAMD",
16693 .opcode = 4,
16694 .operands = &.{
16695 .{ .kind = .id_ref, .quantifier = .required },
16696 },
16697 },
16698 },
16699 .@"NonSemantic.DebugPrintf" => &.{
16700 .{
16701 .name = "DebugPrintf",
16702 .opcode = 1,
16703 .operands = &.{
16704 .{ .kind = .id_ref, .quantifier = .required },
16705 .{ .kind = .id_ref, .quantifier = .variadic },
16706 },
16707 },
16708 },
16709 .SPV_AMD_gcn_shader => &.{
16710 .{
16711 .name = "CubeFaceIndexAMD",
16712 .opcode = 1,
16713 .operands = &.{
16714 .{ .kind = .id_ref, .quantifier = .required },
16715 },
16716 },
16717 .{
16718 .name = "CubeFaceCoordAMD",
16719 .opcode = 2,
16720 .operands = &.{
16721 .{ .kind = .id_ref, .quantifier = .required },
16722 },
16723 },
16724 .{
16725 .name = "TimeAMD",
16726 .opcode = 3,
16727 .operands = &.{},
16728 },
16729 },
16730 .@"OpenCL.std" => &.{
16731 .{
16732 .name = "acos",
16733 .opcode = 0,
16734 .operands = &.{
16735 .{ .kind = .id_ref, .quantifier = .required },
16736 },
16737 },
16738 .{
16739 .name = "acosh",
16740 .opcode = 1,
16741 .operands = &.{
16742 .{ .kind = .id_ref, .quantifier = .required },
16743 },
16744 },
16745 .{
16746 .name = "acospi",
16747 .opcode = 2,
16748 .operands = &.{
16749 .{ .kind = .id_ref, .quantifier = .required },
16750 },
16751 },
16752 .{
16753 .name = "asin",
16754 .opcode = 3,
16755 .operands = &.{
16756 .{ .kind = .id_ref, .quantifier = .required },
16757 },
16758 },
16759 .{
16760 .name = "asinh",
16761 .opcode = 4,
16762 .operands = &.{
16763 .{ .kind = .id_ref, .quantifier = .required },
16764 },
16765 },
16766 .{
16767 .name = "asinpi",
16768 .opcode = 5,
16769 .operands = &.{
16770 .{ .kind = .id_ref, .quantifier = .required },
16771 },
16772 },
16773 .{
16774 .name = "atan",
16775 .opcode = 6,
16776 .operands = &.{
16777 .{ .kind = .id_ref, .quantifier = .required },
16778 },
16779 },
16780 .{
16781 .name = "atan2",
16782 .opcode = 7,
16783 .operands = &.{
16784 .{ .kind = .id_ref, .quantifier = .required },
16785 .{ .kind = .id_ref, .quantifier = .required },
16786 },
16787 },
16788 .{
16789 .name = "atanh",
16790 .opcode = 8,
16791 .operands = &.{
16792 .{ .kind = .id_ref, .quantifier = .required },
16793 },
16794 },
16795 .{
16796 .name = "atanpi",
16797 .opcode = 9,
16798 .operands = &.{
16799 .{ .kind = .id_ref, .quantifier = .required },
16800 },
16801 },
16802 .{
16803 .name = "atan2pi",
16804 .opcode = 10,
16805 .operands = &.{
16806 .{ .kind = .id_ref, .quantifier = .required },
16807 .{ .kind = .id_ref, .quantifier = .required },
16808 },
16809 },
16810 .{
16811 .name = "cbrt",
16812 .opcode = 11,
16813 .operands = &.{
16814 .{ .kind = .id_ref, .quantifier = .required },
16815 },
16816 },
16817 .{
16818 .name = "ceil",
16819 .opcode = 12,
16820 .operands = &.{
16821 .{ .kind = .id_ref, .quantifier = .required },
16822 },
16823 },
16824 .{
16825 .name = "copysign",
16826 .opcode = 13,
16827 .operands = &.{
16828 .{ .kind = .id_ref, .quantifier = .required },
16829 .{ .kind = .id_ref, .quantifier = .required },
16830 },
16831 },
16832 .{
16833 .name = "cos",
16834 .opcode = 14,
16835 .operands = &.{
16836 .{ .kind = .id_ref, .quantifier = .required },
16837 },
16838 },
16839 .{
16840 .name = "cosh",
16841 .opcode = 15,
16842 .operands = &.{
16843 .{ .kind = .id_ref, .quantifier = .required },
16844 },
16845 },
16846 .{
16847 .name = "cospi",
16848 .opcode = 16,
16849 .operands = &.{
16850 .{ .kind = .id_ref, .quantifier = .required },
16851 },
16852 },
16853 .{
16854 .name = "erfc",
16855 .opcode = 17,
16856 .operands = &.{
16857 .{ .kind = .id_ref, .quantifier = .required },
16858 },
16859 },
16860 .{
16861 .name = "erf",
16862 .opcode = 18,
16863 .operands = &.{
16864 .{ .kind = .id_ref, .quantifier = .required },
16865 },
16866 },
16867 .{
16868 .name = "exp",
16869 .opcode = 19,
16870 .operands = &.{
16871 .{ .kind = .id_ref, .quantifier = .required },
16872 },
16873 },
16874 .{
16875 .name = "exp2",
16876 .opcode = 20,
16877 .operands = &.{
16878 .{ .kind = .id_ref, .quantifier = .required },
16879 },
16880 },
16881 .{
16882 .name = "exp10",
16883 .opcode = 21,
16884 .operands = &.{
16885 .{ .kind = .id_ref, .quantifier = .required },
16886 },
16887 },
16888 .{
16889 .name = "expm1",
16890 .opcode = 22,
16891 .operands = &.{
16892 .{ .kind = .id_ref, .quantifier = .required },
16893 },
16894 },
16895 .{
16896 .name = "fabs",
16897 .opcode = 23,
16898 .operands = &.{
16899 .{ .kind = .id_ref, .quantifier = .required },
16900 },
16901 },
16902 .{
16903 .name = "fdim",
16904 .opcode = 24,
16905 .operands = &.{
16906 .{ .kind = .id_ref, .quantifier = .required },
16907 .{ .kind = .id_ref, .quantifier = .required },
16908 },
16909 },
16910 .{
16911 .name = "floor",
16912 .opcode = 25,
16913 .operands = &.{
16914 .{ .kind = .id_ref, .quantifier = .required },
16915 },
16916 },
16917 .{
16918 .name = "fma",
16919 .opcode = 26,
16920 .operands = &.{
16921 .{ .kind = .id_ref, .quantifier = .required },
16922 .{ .kind = .id_ref, .quantifier = .required },
16923 .{ .kind = .id_ref, .quantifier = .required },
16924 },
16925 },
16926 .{
16927 .name = "fmax",
16928 .opcode = 27,
16929 .operands = &.{
16930 .{ .kind = .id_ref, .quantifier = .required },
16931 .{ .kind = .id_ref, .quantifier = .required },
16932 },
16933 },
16934 .{
16935 .name = "fmin",
16936 .opcode = 28,
16937 .operands = &.{
16938 .{ .kind = .id_ref, .quantifier = .required },
16939 .{ .kind = .id_ref, .quantifier = .required },
16940 },
16941 },
16942 .{
16943 .name = "fmod",
16944 .opcode = 29,
16945 .operands = &.{
16946 .{ .kind = .id_ref, .quantifier = .required },
16947 .{ .kind = .id_ref, .quantifier = .required },
16948 },
16949 },
16950 .{
16951 .name = "fract",
16952 .opcode = 30,
16953 .operands = &.{
16954 .{ .kind = .id_ref, .quantifier = .required },
16955 .{ .kind = .id_ref, .quantifier = .required },
16956 },
16957 },
16958 .{
16959 .name = "frexp",
16960 .opcode = 31,
16961 .operands = &.{
16962 .{ .kind = .id_ref, .quantifier = .required },
16963 .{ .kind = .id_ref, .quantifier = .required },
16964 },
16965 },
16966 .{
16967 .name = "hypot",
16968 .opcode = 32,
16969 .operands = &.{
16970 .{ .kind = .id_ref, .quantifier = .required },
16971 .{ .kind = .id_ref, .quantifier = .required },
16972 },
16973 },
16974 .{
16975 .name = "ilogb",
16976 .opcode = 33,
16977 .operands = &.{
16978 .{ .kind = .id_ref, .quantifier = .required },
16979 },
16980 },
16981 .{
16982 .name = "ldexp",
16983 .opcode = 34,
16984 .operands = &.{
16985 .{ .kind = .id_ref, .quantifier = .required },
16986 .{ .kind = .id_ref, .quantifier = .required },
16987 },
16988 },
16989 .{
16990 .name = "lgamma",
16991 .opcode = 35,
16992 .operands = &.{
16993 .{ .kind = .id_ref, .quantifier = .required },
16994 },
16995 },
16996 .{
16997 .name = "lgamma_r",
16998 .opcode = 36,
16999 .operands = &.{
17000 .{ .kind = .id_ref, .quantifier = .required },
17001 .{ .kind = .id_ref, .quantifier = .required },
17002 },
17003 },
17004 .{
17005 .name = "log",
17006 .opcode = 37,
17007 .operands = &.{
17008 .{ .kind = .id_ref, .quantifier = .required },
17009 },
17010 },
17011 .{
17012 .name = "log2",
17013 .opcode = 38,
17014 .operands = &.{
17015 .{ .kind = .id_ref, .quantifier = .required },
17016 },
17017 },
17018 .{
17019 .name = "log10",
17020 .opcode = 39,
17021 .operands = &.{
17022 .{ .kind = .id_ref, .quantifier = .required },
17023 },
17024 },
17025 .{
17026 .name = "log1p",
17027 .opcode = 40,
17028 .operands = &.{
17029 .{ .kind = .id_ref, .quantifier = .required },
17030 },
17031 },
17032 .{
17033 .name = "logb",
17034 .opcode = 41,
17035 .operands = &.{
17036 .{ .kind = .id_ref, .quantifier = .required },
17037 },
17038 },
17039 .{
17040 .name = "mad",
17041 .opcode = 42,
17042 .operands = &.{
17043 .{ .kind = .id_ref, .quantifier = .required },
17044 .{ .kind = .id_ref, .quantifier = .required },
17045 .{ .kind = .id_ref, .quantifier = .required },
17046 },
17047 },
17048 .{
17049 .name = "maxmag",
17050 .opcode = 43,
17051 .operands = &.{
17052 .{ .kind = .id_ref, .quantifier = .required },
17053 .{ .kind = .id_ref, .quantifier = .required },
17054 },
17055 },
17056 .{
17057 .name = "minmag",
17058 .opcode = 44,
17059 .operands = &.{
17060 .{ .kind = .id_ref, .quantifier = .required },
17061 .{ .kind = .id_ref, .quantifier = .required },
17062 },
17063 },
17064 .{
17065 .name = "modf",
17066 .opcode = 45,
17067 .operands = &.{
17068 .{ .kind = .id_ref, .quantifier = .required },
17069 .{ .kind = .id_ref, .quantifier = .required },
17070 },
17071 },
17072 .{
17073 .name = "nan",
17074 .opcode = 46,
17075 .operands = &.{
17076 .{ .kind = .id_ref, .quantifier = .required },
17077 },
17078 },
17079 .{
17080 .name = "nextafter",
17081 .opcode = 47,
17082 .operands = &.{
17083 .{ .kind = .id_ref, .quantifier = .required },
17084 .{ .kind = .id_ref, .quantifier = .required },
17085 },
17086 },
17087 .{
17088 .name = "pow",
17089 .opcode = 48,
17090 .operands = &.{
17091 .{ .kind = .id_ref, .quantifier = .required },
17092 .{ .kind = .id_ref, .quantifier = .required },
17093 },
17094 },
17095 .{
17096 .name = "pown",
17097 .opcode = 49,
17098 .operands = &.{
17099 .{ .kind = .id_ref, .quantifier = .required },
17100 .{ .kind = .id_ref, .quantifier = .required },
17101 },
17102 },
17103 .{
17104 .name = "powr",
17105 .opcode = 50,
17106 .operands = &.{
17107 .{ .kind = .id_ref, .quantifier = .required },
17108 .{ .kind = .id_ref, .quantifier = .required },
17109 },
17110 },
17111 .{
17112 .name = "remainder",
17113 .opcode = 51,
17114 .operands = &.{
17115 .{ .kind = .id_ref, .quantifier = .required },
17116 .{ .kind = .id_ref, .quantifier = .required },
17117 },
17118 },
17119 .{
17120 .name = "remquo",
17121 .opcode = 52,
17122 .operands = &.{
17123 .{ .kind = .id_ref, .quantifier = .required },
17124 .{ .kind = .id_ref, .quantifier = .required },
17125 .{ .kind = .id_ref, .quantifier = .required },
17126 },
17127 },
17128 .{
17129 .name = "rint",
17130 .opcode = 53,
17131 .operands = &.{
17132 .{ .kind = .id_ref, .quantifier = .required },
17133 },
17134 },
17135 .{
17136 .name = "rootn",
17137 .opcode = 54,
17138 .operands = &.{
17139 .{ .kind = .id_ref, .quantifier = .required },
17140 .{ .kind = .id_ref, .quantifier = .required },
17141 },
17142 },
17143 .{
17144 .name = "round",
17145 .opcode = 55,
17146 .operands = &.{
17147 .{ .kind = .id_ref, .quantifier = .required },
17148 },
17149 },
17150 .{
17151 .name = "rsqrt",
17152 .opcode = 56,
17153 .operands = &.{
17154 .{ .kind = .id_ref, .quantifier = .required },
17155 },
17156 },
17157 .{
17158 .name = "sin",
17159 .opcode = 57,
17160 .operands = &.{
17161 .{ .kind = .id_ref, .quantifier = .required },
17162 },
17163 },
17164 .{
17165 .name = "sincos",
17166 .opcode = 58,
17167 .operands = &.{
17168 .{ .kind = .id_ref, .quantifier = .required },
17169 .{ .kind = .id_ref, .quantifier = .required },
17170 },
17171 },
17172 .{
17173 .name = "sinh",
17174 .opcode = 59,
17175 .operands = &.{
17176 .{ .kind = .id_ref, .quantifier = .required },
17177 },
17178 },
17179 .{
17180 .name = "sinpi",
17181 .opcode = 60,
17182 .operands = &.{
17183 .{ .kind = .id_ref, .quantifier = .required },
17184 },
17185 },
17186 .{
17187 .name = "sqrt",
17188 .opcode = 61,
17189 .operands = &.{
17190 .{ .kind = .id_ref, .quantifier = .required },
17191 },
17192 },
17193 .{
17194 .name = "tan",
17195 .opcode = 62,
17196 .operands = &.{
17197 .{ .kind = .id_ref, .quantifier = .required },
17198 },
17199 },
17200 .{
17201 .name = "tanh",
17202 .opcode = 63,
17203 .operands = &.{
17204 .{ .kind = .id_ref, .quantifier = .required },
17205 },
17206 },
17207 .{
17208 .name = "tanpi",
17209 .opcode = 64,
17210 .operands = &.{
17211 .{ .kind = .id_ref, .quantifier = .required },
17212 },
17213 },
17214 .{
17215 .name = "tgamma",
17216 .opcode = 65,
17217 .operands = &.{
17218 .{ .kind = .id_ref, .quantifier = .required },
17219 },
17220 },
17221 .{
17222 .name = "trunc",
17223 .opcode = 66,
17224 .operands = &.{
17225 .{ .kind = .id_ref, .quantifier = .required },
17226 },
17227 },
17228 .{
17229 .name = "half_cos",
17230 .opcode = 67,
17231 .operands = &.{
17232 .{ .kind = .id_ref, .quantifier = .required },
17233 },
17234 },
17235 .{
17236 .name = "half_divide",
17237 .opcode = 68,
17238 .operands = &.{
17239 .{ .kind = .id_ref, .quantifier = .required },
17240 .{ .kind = .id_ref, .quantifier = .required },
17241 },
17242 },
17243 .{
17244 .name = "half_exp",
17245 .opcode = 69,
17246 .operands = &.{
17247 .{ .kind = .id_ref, .quantifier = .required },
17248 },
17249 },
17250 .{
17251 .name = "half_exp2",
17252 .opcode = 70,
17253 .operands = &.{
17254 .{ .kind = .id_ref, .quantifier = .required },
17255 },
17256 },
17257 .{
17258 .name = "half_exp10",
17259 .opcode = 71,
17260 .operands = &.{
17261 .{ .kind = .id_ref, .quantifier = .required },
17262 },
17263 },
17264 .{
17265 .name = "half_log",
17266 .opcode = 72,
17267 .operands = &.{
17268 .{ .kind = .id_ref, .quantifier = .required },
17269 },
17270 },
17271 .{
17272 .name = "half_log2",
17273 .opcode = 73,
17274 .operands = &.{
17275 .{ .kind = .id_ref, .quantifier = .required },
17276 },
17277 },
17278 .{
17279 .name = "half_log10",
17280 .opcode = 74,
17281 .operands = &.{
17282 .{ .kind = .id_ref, .quantifier = .required },
17283 },
17284 },
17285 .{
17286 .name = "half_powr",
17287 .opcode = 75,
17288 .operands = &.{
17289 .{ .kind = .id_ref, .quantifier = .required },
17290 .{ .kind = .id_ref, .quantifier = .required },
17291 },
17292 },
17293 .{
17294 .name = "half_recip",
17295 .opcode = 76,
17296 .operands = &.{
17297 .{ .kind = .id_ref, .quantifier = .required },
17298 },
17299 },
17300 .{
17301 .name = "half_rsqrt",
17302 .opcode = 77,
17303 .operands = &.{
17304 .{ .kind = .id_ref, .quantifier = .required },
17305 },
17306 },
17307 .{
17308 .name = "half_sin",
17309 .opcode = 78,
17310 .operands = &.{
17311 .{ .kind = .id_ref, .quantifier = .required },
17312 },
17313 },
17314 .{
17315 .name = "half_sqrt",
17316 .opcode = 79,
17317 .operands = &.{
17318 .{ .kind = .id_ref, .quantifier = .required },
17319 },
17320 },
17321 .{
17322 .name = "half_tan",
17323 .opcode = 80,
17324 .operands = &.{
17325 .{ .kind = .id_ref, .quantifier = .required },
17326 },
17327 },
17328 .{
17329 .name = "native_cos",
17330 .opcode = 81,
17331 .operands = &.{
17332 .{ .kind = .id_ref, .quantifier = .required },
17333 },
17334 },
17335 .{
17336 .name = "native_divide",
17337 .opcode = 82,
17338 .operands = &.{
17339 .{ .kind = .id_ref, .quantifier = .required },
17340 .{ .kind = .id_ref, .quantifier = .required },
17341 },
17342 },
17343 .{
17344 .name = "native_exp",
17345 .opcode = 83,
17346 .operands = &.{
17347 .{ .kind = .id_ref, .quantifier = .required },
17348 },
17349 },
17350 .{
17351 .name = "native_exp2",
17352 .opcode = 84,
17353 .operands = &.{
17354 .{ .kind = .id_ref, .quantifier = .required },
17355 },
17356 },
17357 .{
17358 .name = "native_exp10",
17359 .opcode = 85,
17360 .operands = &.{
17361 .{ .kind = .id_ref, .quantifier = .required },
17362 },
17363 },
17364 .{
17365 .name = "native_log",
17366 .opcode = 86,
17367 .operands = &.{
17368 .{ .kind = .id_ref, .quantifier = .required },
17369 },
17370 },
17371 .{
17372 .name = "native_log2",
17373 .opcode = 87,
17374 .operands = &.{
17375 .{ .kind = .id_ref, .quantifier = .required },
17376 },
17377 },
17378 .{
17379 .name = "native_log10",
17380 .opcode = 88,
17381 .operands = &.{
17382 .{ .kind = .id_ref, .quantifier = .required },
17383 },
17384 },
17385 .{
17386 .name = "native_powr",
17387 .opcode = 89,
17388 .operands = &.{
17389 .{ .kind = .id_ref, .quantifier = .required },
17390 .{ .kind = .id_ref, .quantifier = .required },
17391 },
17392 },
17393 .{
17394 .name = "native_recip",
17395 .opcode = 90,
17396 .operands = &.{
17397 .{ .kind = .id_ref, .quantifier = .required },
17398 },
17399 },
17400 .{
17401 .name = "native_rsqrt",
17402 .opcode = 91,
17403 .operands = &.{
17404 .{ .kind = .id_ref, .quantifier = .required },
17405 },
17406 },
17407 .{
17408 .name = "native_sin",
17409 .opcode = 92,
17410 .operands = &.{
17411 .{ .kind = .id_ref, .quantifier = .required },
17412 },
17413 },
17414 .{
17415 .name = "native_sqrt",
17416 .opcode = 93,
17417 .operands = &.{
17418 .{ .kind = .id_ref, .quantifier = .required },
17419 },
17420 },
17421 .{
17422 .name = "native_tan",
17423 .opcode = 94,
17424 .operands = &.{
17425 .{ .kind = .id_ref, .quantifier = .required },
17426 },
17427 },
17428 .{
17429 .name = "fclamp",
17430 .opcode = 95,
17431 .operands = &.{
17432 .{ .kind = .id_ref, .quantifier = .required },
17433 .{ .kind = .id_ref, .quantifier = .required },
17434 .{ .kind = .id_ref, .quantifier = .required },
17435 },
17436 },
17437 .{
17438 .name = "degrees",
17439 .opcode = 96,
17440 .operands = &.{
17441 .{ .kind = .id_ref, .quantifier = .required },
17442 },
17443 },
17444 .{
17445 .name = "fmax_common",
17446 .opcode = 97,
17447 .operands = &.{
17448 .{ .kind = .id_ref, .quantifier = .required },
17449 .{ .kind = .id_ref, .quantifier = .required },
17450 },
17451 },
17452 .{
17453 .name = "fmin_common",
17454 .opcode = 98,
17455 .operands = &.{
17456 .{ .kind = .id_ref, .quantifier = .required },
17457 .{ .kind = .id_ref, .quantifier = .required },
17458 },
17459 },
17460 .{
17461 .name = "mix",
17462 .opcode = 99,
17463 .operands = &.{
17464 .{ .kind = .id_ref, .quantifier = .required },
17465 .{ .kind = .id_ref, .quantifier = .required },
17466 .{ .kind = .id_ref, .quantifier = .required },
17467 },
17468 },
17469 .{
17470 .name = "radians",
17471 .opcode = 100,
17472 .operands = &.{
17473 .{ .kind = .id_ref, .quantifier = .required },
17474 },
17475 },
17476 .{
17477 .name = "step",
17478 .opcode = 101,
17479 .operands = &.{
17480 .{ .kind = .id_ref, .quantifier = .required },
17481 .{ .kind = .id_ref, .quantifier = .required },
17482 },
17483 },
17484 .{
17485 .name = "smoothstep",
17486 .opcode = 102,
17487 .operands = &.{
17488 .{ .kind = .id_ref, .quantifier = .required },
17489 .{ .kind = .id_ref, .quantifier = .required },
17490 .{ .kind = .id_ref, .quantifier = .required },
17491 },
17492 },
17493 .{
17494 .name = "sign",
17495 .opcode = 103,
17496 .operands = &.{
17497 .{ .kind = .id_ref, .quantifier = .required },
17498 },
17499 },
17500 .{
17501 .name = "cross",
17502 .opcode = 104,
17503 .operands = &.{
17504 .{ .kind = .id_ref, .quantifier = .required },
17505 .{ .kind = .id_ref, .quantifier = .required },
17506 },
17507 },
17508 .{
17509 .name = "distance",
17510 .opcode = 105,
17511 .operands = &.{
17512 .{ .kind = .id_ref, .quantifier = .required },
17513 .{ .kind = .id_ref, .quantifier = .required },
17514 },
17515 },
17516 .{
17517 .name = "length",
17518 .opcode = 106,
17519 .operands = &.{
17520 .{ .kind = .id_ref, .quantifier = .required },
17521 },
17522 },
17523 .{
17524 .name = "normalize",
17525 .opcode = 107,
17526 .operands = &.{
17527 .{ .kind = .id_ref, .quantifier = .required },
17528 },
17529 },
17530 .{
17531 .name = "fast_distance",
17532 .opcode = 108,
17533 .operands = &.{
17534 .{ .kind = .id_ref, .quantifier = .required },
17535 .{ .kind = .id_ref, .quantifier = .required },
17536 },
17537 },
17538 .{
17539 .name = "fast_length",
17540 .opcode = 109,
17541 .operands = &.{
17542 .{ .kind = .id_ref, .quantifier = .required },
17543 },
17544 },
17545 .{
17546 .name = "fast_normalize",
17547 .opcode = 110,
17548 .operands = &.{
17549 .{ .kind = .id_ref, .quantifier = .required },
17550 },
17551 },
17552 .{
17553 .name = "s_abs",
17554 .opcode = 141,
17555 .operands = &.{
17556 .{ .kind = .id_ref, .quantifier = .required },
17557 },
17558 },
17559 .{
17560 .name = "s_abs_diff",
17561 .opcode = 142,
17562 .operands = &.{
17563 .{ .kind = .id_ref, .quantifier = .required },
17564 .{ .kind = .id_ref, .quantifier = .required },
17565 },
17566 },
17567 .{
17568 .name = "s_add_sat",
17569 .opcode = 143,
17570 .operands = &.{
17571 .{ .kind = .id_ref, .quantifier = .required },
17572 .{ .kind = .id_ref, .quantifier = .required },
17573 },
17574 },
17575 .{
17576 .name = "u_add_sat",
17577 .opcode = 144,
17578 .operands = &.{
17579 .{ .kind = .id_ref, .quantifier = .required },
17580 .{ .kind = .id_ref, .quantifier = .required },
17581 },
17582 },
17583 .{
17584 .name = "s_hadd",
17585 .opcode = 145,
17586 .operands = &.{
17587 .{ .kind = .id_ref, .quantifier = .required },
17588 .{ .kind = .id_ref, .quantifier = .required },
17589 },
17590 },
17591 .{
17592 .name = "u_hadd",
17593 .opcode = 146,
17594 .operands = &.{
17595 .{ .kind = .id_ref, .quantifier = .required },
17596 .{ .kind = .id_ref, .quantifier = .required },
17597 },
17598 },
17599 .{
17600 .name = "s_rhadd",
17601 .opcode = 147,
17602 .operands = &.{
17603 .{ .kind = .id_ref, .quantifier = .required },
17604 .{ .kind = .id_ref, .quantifier = .required },
17605 },
17606 },
17607 .{
17608 .name = "u_rhadd",
17609 .opcode = 148,
17610 .operands = &.{
17611 .{ .kind = .id_ref, .quantifier = .required },
17612 .{ .kind = .id_ref, .quantifier = .required },
17613 },
17614 },
17615 .{
17616 .name = "s_clamp",
17617 .opcode = 149,
17618 .operands = &.{
17619 .{ .kind = .id_ref, .quantifier = .required },
17620 .{ .kind = .id_ref, .quantifier = .required },
17621 .{ .kind = .id_ref, .quantifier = .required },
17622 },
17623 },
17624 .{
17625 .name = "u_clamp",
17626 .opcode = 150,
17627 .operands = &.{
17628 .{ .kind = .id_ref, .quantifier = .required },
17629 .{ .kind = .id_ref, .quantifier = .required },
17630 .{ .kind = .id_ref, .quantifier = .required },
17631 },
17632 },
17633 .{
17634 .name = "clz",
17635 .opcode = 151,
17636 .operands = &.{
17637 .{ .kind = .id_ref, .quantifier = .required },
17638 },
17639 },
17640 .{
17641 .name = "ctz",
17642 .opcode = 152,
17643 .operands = &.{
17644 .{ .kind = .id_ref, .quantifier = .required },
17645 },
17646 },
17647 .{
17648 .name = "s_mad_hi",
17649 .opcode = 153,
17650 .operands = &.{
17651 .{ .kind = .id_ref, .quantifier = .required },
17652 .{ .kind = .id_ref, .quantifier = .required },
17653 .{ .kind = .id_ref, .quantifier = .required },
17654 },
17655 },
17656 .{
17657 .name = "u_mad_sat",
17658 .opcode = 154,
17659 .operands = &.{
17660 .{ .kind = .id_ref, .quantifier = .required },
17661 .{ .kind = .id_ref, .quantifier = .required },
17662 .{ .kind = .id_ref, .quantifier = .required },
17663 },
17664 },
17665 .{
17666 .name = "s_mad_sat",
17667 .opcode = 155,
17668 .operands = &.{
17669 .{ .kind = .id_ref, .quantifier = .required },
17670 .{ .kind = .id_ref, .quantifier = .required },
17671 .{ .kind = .id_ref, .quantifier = .required },
17672 },
17673 },
17674 .{
17675 .name = "s_max",
17676 .opcode = 156,
17677 .operands = &.{
17678 .{ .kind = .id_ref, .quantifier = .required },
17679 .{ .kind = .id_ref, .quantifier = .required },
17680 },
17681 },
17682 .{
17683 .name = "u_max",
17684 .opcode = 157,
17685 .operands = &.{
17686 .{ .kind = .id_ref, .quantifier = .required },
17687 .{ .kind = .id_ref, .quantifier = .required },
17688 },
17689 },
17690 .{
17691 .name = "s_min",
17692 .opcode = 158,
17693 .operands = &.{
17694 .{ .kind = .id_ref, .quantifier = .required },
17695 .{ .kind = .id_ref, .quantifier = .required },
17696 },
17697 },
17698 .{
17699 .name = "u_min",
17700 .opcode = 159,
17701 .operands = &.{
17702 .{ .kind = .id_ref, .quantifier = .required },
17703 .{ .kind = .id_ref, .quantifier = .required },
17704 },
17705 },
17706 .{
17707 .name = "s_mul_hi",
17708 .opcode = 160,
17709 .operands = &.{
17710 .{ .kind = .id_ref, .quantifier = .required },
17711 .{ .kind = .id_ref, .quantifier = .required },
17712 },
17713 },
17714 .{
17715 .name = "rotate",
17716 .opcode = 161,
17717 .operands = &.{
17718 .{ .kind = .id_ref, .quantifier = .required },
17719 .{ .kind = .id_ref, .quantifier = .required },
17720 },
17721 },
17722 .{
17723 .name = "s_sub_sat",
17724 .opcode = 162,
17725 .operands = &.{
17726 .{ .kind = .id_ref, .quantifier = .required },
17727 .{ .kind = .id_ref, .quantifier = .required },
17728 },
17729 },
17730 .{
17731 .name = "u_sub_sat",
17732 .opcode = 163,
17733 .operands = &.{
17734 .{ .kind = .id_ref, .quantifier = .required },
17735 .{ .kind = .id_ref, .quantifier = .required },
17736 },
17737 },
17738 .{
17739 .name = "u_upsample",
17740 .opcode = 164,
17741 .operands = &.{
17742 .{ .kind = .id_ref, .quantifier = .required },
17743 .{ .kind = .id_ref, .quantifier = .required },
17744 },
17745 },
17746 .{
17747 .name = "s_upsample",
17748 .opcode = 165,
17749 .operands = &.{
17750 .{ .kind = .id_ref, .quantifier = .required },
17751 .{ .kind = .id_ref, .quantifier = .required },
17752 },
17753 },
17754 .{
17755 .name = "popcount",
17756 .opcode = 166,
17757 .operands = &.{
17758 .{ .kind = .id_ref, .quantifier = .required },
17759 },
17760 },
17761 .{
17762 .name = "s_mad24",
17763 .opcode = 167,
17764 .operands = &.{
17765 .{ .kind = .id_ref, .quantifier = .required },
17766 .{ .kind = .id_ref, .quantifier = .required },
17767 .{ .kind = .id_ref, .quantifier = .required },
17768 },
17769 },
17770 .{
17771 .name = "u_mad24",
17772 .opcode = 168,
17773 .operands = &.{
17774 .{ .kind = .id_ref, .quantifier = .required },
17775 .{ .kind = .id_ref, .quantifier = .required },
17776 .{ .kind = .id_ref, .quantifier = .required },
17777 },
17778 },
17779 .{
17780 .name = "s_mul24",
17781 .opcode = 169,
17782 .operands = &.{
17783 .{ .kind = .id_ref, .quantifier = .required },
17784 .{ .kind = .id_ref, .quantifier = .required },
17785 },
17786 },
17787 .{
17788 .name = "u_mul24",
17789 .opcode = 170,
17790 .operands = &.{
17791 .{ .kind = .id_ref, .quantifier = .required },
17792 .{ .kind = .id_ref, .quantifier = .required },
17793 },
17794 },
17795 .{
17796 .name = "vloadn",
17797 .opcode = 171,
17798 .operands = &.{
17799 .{ .kind = .id_ref, .quantifier = .required },
17800 .{ .kind = .id_ref, .quantifier = .required },
17801 .{ .kind = .literal_integer, .quantifier = .required },
17802 },
17803 },
17804 .{
17805 .name = "vstoren",
17806 .opcode = 172,
17807 .operands = &.{
17808 .{ .kind = .id_ref, .quantifier = .required },
17809 .{ .kind = .id_ref, .quantifier = .required },
17810 .{ .kind = .id_ref, .quantifier = .required },
17811 },
17812 },
17813 .{
17814 .name = "vload_half",
17815 .opcode = 173,
17816 .operands = &.{
17817 .{ .kind = .id_ref, .quantifier = .required },
17818 .{ .kind = .id_ref, .quantifier = .required },
17819 },
17820 },
17821 .{
17822 .name = "vload_halfn",
17823 .opcode = 174,
17824 .operands = &.{
17825 .{ .kind = .id_ref, .quantifier = .required },
17826 .{ .kind = .id_ref, .quantifier = .required },
17827 .{ .kind = .literal_integer, .quantifier = .required },
17828 },
17829 },
17830 .{
17831 .name = "vstore_half",
17832 .opcode = 175,
17833 .operands = &.{
17834 .{ .kind = .id_ref, .quantifier = .required },
17835 .{ .kind = .id_ref, .quantifier = .required },
17836 .{ .kind = .id_ref, .quantifier = .required },
17837 },
17838 },
17839 .{
17840 .name = "vstore_half_r",
17841 .opcode = 176,
17842 .operands = &.{
17843 .{ .kind = .id_ref, .quantifier = .required },
17844 .{ .kind = .id_ref, .quantifier = .required },
17845 .{ .kind = .id_ref, .quantifier = .required },
17846 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17847 },
17848 },
17849 .{
17850 .name = "vstore_halfn",
17851 .opcode = 177,
17852 .operands = &.{
17853 .{ .kind = .id_ref, .quantifier = .required },
17854 .{ .kind = .id_ref, .quantifier = .required },
17855 .{ .kind = .id_ref, .quantifier = .required },
17856 },
17857 },
17858 .{
17859 .name = "vstore_halfn_r",
17860 .opcode = 178,
17861 .operands = &.{
17862 .{ .kind = .id_ref, .quantifier = .required },
17863 .{ .kind = .id_ref, .quantifier = .required },
17864 .{ .kind = .id_ref, .quantifier = .required },
17865 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17866 },
17867 },
17868 .{
17869 .name = "vloada_halfn",
17870 .opcode = 179,
17871 .operands = &.{
17872 .{ .kind = .id_ref, .quantifier = .required },
17873 .{ .kind = .id_ref, .quantifier = .required },
17874 .{ .kind = .literal_integer, .quantifier = .required },
17875 },
17876 },
17877 .{
17878 .name = "vstorea_halfn",
17879 .opcode = 180,
17880 .operands = &.{
17881 .{ .kind = .id_ref, .quantifier = .required },
17882 .{ .kind = .id_ref, .quantifier = .required },
17883 .{ .kind = .id_ref, .quantifier = .required },
17884 },
17885 },
17886 .{
17887 .name = "vstorea_halfn_r",
17888 .opcode = 181,
17889 .operands = &.{
17890 .{ .kind = .id_ref, .quantifier = .required },
17891 .{ .kind = .id_ref, .quantifier = .required },
17892 .{ .kind = .id_ref, .quantifier = .required },
17893 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17894 },
17895 },
17896 .{
17897 .name = "shuffle",
17898 .opcode = 182,
17899 .operands = &.{
17900 .{ .kind = .id_ref, .quantifier = .required },
17901 .{ .kind = .id_ref, .quantifier = .required },
17902 },
17903 },
17904 .{
17905 .name = "shuffle2",
17906 .opcode = 183,
17907 .operands = &.{
17908 .{ .kind = .id_ref, .quantifier = .required },
17909 .{ .kind = .id_ref, .quantifier = .required },
17910 .{ .kind = .id_ref, .quantifier = .required },
17911 },
17912 },
17913 .{
17914 .name = "printf",
17915 .opcode = 184,
17916 .operands = &.{
17917 .{ .kind = .id_ref, .quantifier = .required },
17918 .{ .kind = .id_ref, .quantifier = .variadic },
17919 },
17920 },
17921 .{
17922 .name = "prefetch",
17923 .opcode = 185,
17924 .operands = &.{
17925 .{ .kind = .id_ref, .quantifier = .required },
17926 .{ .kind = .id_ref, .quantifier = .required },
17927 },
17928 },
17929 .{
17930 .name = "bitselect",
17931 .opcode = 186,
17932 .operands = &.{
17933 .{ .kind = .id_ref, .quantifier = .required },
17934 .{ .kind = .id_ref, .quantifier = .required },
17935 .{ .kind = .id_ref, .quantifier = .required },
17936 },
17937 },
17938 .{
17939 .name = "select",
17940 .opcode = 187,
17941 .operands = &.{
17942 .{ .kind = .id_ref, .quantifier = .required },
17943 .{ .kind = .id_ref, .quantifier = .required },
17944 .{ .kind = .id_ref, .quantifier = .required },
17945 },
17946 },
17947 .{
17948 .name = "u_abs",
17949 .opcode = 201,
17950 .operands = &.{
17951 .{ .kind = .id_ref, .quantifier = .required },
17952 },
17953 },
17954 .{
17955 .name = "u_abs_diff",
17956 .opcode = 202,
17957 .operands = &.{
17958 .{ .kind = .id_ref, .quantifier = .required },
17959 .{ .kind = .id_ref, .quantifier = .required },
17960 },
17961 },
17962 .{
17963 .name = "u_mul_hi",
17964 .opcode = 203,
17965 .operands = &.{
17966 .{ .kind = .id_ref, .quantifier = .required },
17967 .{ .kind = .id_ref, .quantifier = .required },
17968 },
17969 },
17970 .{
17971 .name = "u_mad_hi",
17972 .opcode = 204,
17973 .operands = &.{
17974 .{ .kind = .id_ref, .quantifier = .required },
17975 .{ .kind = .id_ref, .quantifier = .required },
17976 .{ .kind = .id_ref, .quantifier = .required },
17977 },
17978 },
17979 },
17980 .@"NonSemantic.Shader.DebugInfo.100" => &.{
17981 .{
17982 .name = "DebugInfoNone",
17983 .opcode = 0,
17984 .operands = &.{},
17985 },
17986 .{
17987 .name = "DebugCompilationUnit",
17988 .opcode = 1,
17989 .operands = &.{
17990 .{ .kind = .id_ref, .quantifier = .required },
17991 .{ .kind = .id_ref, .quantifier = .required },
17992 .{ .kind = .id_ref, .quantifier = .required },
17993 .{ .kind = .id_ref, .quantifier = .required },
17994 },
17995 },
17996 .{
17997 .name = "DebugTypeBasic",
17998 .opcode = 2,
17999 .operands = &.{
18000 .{ .kind = .id_ref, .quantifier = .required },
18001 .{ .kind = .id_ref, .quantifier = .required },
18002 .{ .kind = .id_ref, .quantifier = .required },
18003 .{ .kind = .id_ref, .quantifier = .required },
18004 },
18005 },
18006 .{
18007 .name = "DebugTypePointer",
18008 .opcode = 3,
18009 .operands = &.{
18010 .{ .kind = .id_ref, .quantifier = .required },
18011 .{ .kind = .id_ref, .quantifier = .required },
18012 .{ .kind = .id_ref, .quantifier = .required },
18013 },
18014 },
18015 .{
18016 .name = "DebugTypeQualifier",
18017 .opcode = 4,
18018 .operands = &.{
18019 .{ .kind = .id_ref, .quantifier = .required },
18020 .{ .kind = .id_ref, .quantifier = .required },
18021 },
18022 },
18023 .{
18024 .name = "DebugTypeArray",
18025 .opcode = 5,
18026 .operands = &.{
18027 .{ .kind = .id_ref, .quantifier = .required },
18028 .{ .kind = .id_ref, .quantifier = .variadic },
18029 },
18030 },
18031 .{
18032 .name = "DebugTypeVector",
18033 .opcode = 6,
18034 .operands = &.{
18035 .{ .kind = .id_ref, .quantifier = .required },
18036 .{ .kind = .id_ref, .quantifier = .required },
18037 },
18038 },
18039 .{
18040 .name = "DebugTypedef",
18041 .opcode = 7,
18042 .operands = &.{
18043 .{ .kind = .id_ref, .quantifier = .required },
18044 .{ .kind = .id_ref, .quantifier = .required },
18045 .{ .kind = .id_ref, .quantifier = .required },
18046 .{ .kind = .id_ref, .quantifier = .required },
18047 .{ .kind = .id_ref, .quantifier = .required },
18048 .{ .kind = .id_ref, .quantifier = .required },
18049 },
18050 },
18051 .{
18052 .name = "DebugTypeFunction",
18053 .opcode = 8,
18054 .operands = &.{
18055 .{ .kind = .id_ref, .quantifier = .required },
18056 .{ .kind = .id_ref, .quantifier = .required },
18057 .{ .kind = .id_ref, .quantifier = .variadic },
18058 },
18059 },
18060 .{
18061 .name = "DebugTypeEnum",
18062 .opcode = 9,
18063 .operands = &.{
18064 .{ .kind = .id_ref, .quantifier = .required },
18065 .{ .kind = .id_ref, .quantifier = .required },
18066 .{ .kind = .id_ref, .quantifier = .required },
18067 .{ .kind = .id_ref, .quantifier = .required },
18068 .{ .kind = .id_ref, .quantifier = .required },
18069 .{ .kind = .id_ref, .quantifier = .required },
18070 .{ .kind = .id_ref, .quantifier = .required },
18071 .{ .kind = .id_ref, .quantifier = .required },
18072 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
18073 },
18074 },
18075 .{
18076 .name = "DebugTypeComposite",
18077 .opcode = 10,
18078 .operands = &.{
18079 .{ .kind = .id_ref, .quantifier = .required },
18080 .{ .kind = .id_ref, .quantifier = .required },
18081 .{ .kind = .id_ref, .quantifier = .required },
18082 .{ .kind = .id_ref, .quantifier = .required },
18083 .{ .kind = .id_ref, .quantifier = .required },
18084 .{ .kind = .id_ref, .quantifier = .required },
18085 .{ .kind = .id_ref, .quantifier = .required },
18086 .{ .kind = .id_ref, .quantifier = .required },
18087 .{ .kind = .id_ref, .quantifier = .required },
18088 .{ .kind = .id_ref, .quantifier = .variadic },
18089 },
18090 },
18091 .{
18092 .name = "DebugTypeMember",
18093 .opcode = 11,
18094 .operands = &.{
18095 .{ .kind = .id_ref, .quantifier = .required },
18096 .{ .kind = .id_ref, .quantifier = .required },
18097 .{ .kind = .id_ref, .quantifier = .required },
18098 .{ .kind = .id_ref, .quantifier = .required },
18099 .{ .kind = .id_ref, .quantifier = .required },
18100 .{ .kind = .id_ref, .quantifier = .required },
18101 .{ .kind = .id_ref, .quantifier = .required },
18102 .{ .kind = .id_ref, .quantifier = .required },
18103 .{ .kind = .id_ref, .quantifier = .optional },
18104 },
18105 },
18106 .{
18107 .name = "DebugTypeInheritance",
18108 .opcode = 12,
18109 .operands = &.{
18110 .{ .kind = .id_ref, .quantifier = .required },
18111 .{ .kind = .id_ref, .quantifier = .required },
18112 .{ .kind = .id_ref, .quantifier = .required },
18113 .{ .kind = .id_ref, .quantifier = .required },
18114 },
18115 },
18116 .{
18117 .name = "DebugTypePtrToMember",
18118 .opcode = 13,
18119 .operands = &.{
18120 .{ .kind = .id_ref, .quantifier = .required },
18121 .{ .kind = .id_ref, .quantifier = .required },
18122 },
18123 },
18124 .{
18125 .name = "DebugTypeTemplate",
18126 .opcode = 14,
18127 .operands = &.{
18128 .{ .kind = .id_ref, .quantifier = .required },
18129 .{ .kind = .id_ref, .quantifier = .variadic },
18130 },
18131 },
18132 .{
18133 .name = "DebugTypeTemplateParameter",
18134 .opcode = 15,
18135 .operands = &.{
18136 .{ .kind = .id_ref, .quantifier = .required },
18137 .{ .kind = .id_ref, .quantifier = .required },
18138 .{ .kind = .id_ref, .quantifier = .required },
18139 .{ .kind = .id_ref, .quantifier = .required },
18140 .{ .kind = .id_ref, .quantifier = .required },
18141 .{ .kind = .id_ref, .quantifier = .required },
18142 },
18143 },
18144 .{
18145 .name = "DebugTypeTemplateTemplateParameter",
18146 .opcode = 16,
18147 .operands = &.{
18148 .{ .kind = .id_ref, .quantifier = .required },
18149 .{ .kind = .id_ref, .quantifier = .required },
18150 .{ .kind = .id_ref, .quantifier = .required },
18151 .{ .kind = .id_ref, .quantifier = .required },
18152 .{ .kind = .id_ref, .quantifier = .required },
18153 },
18154 },
18155 .{
18156 .name = "DebugTypeTemplateParameterPack",
18157 .opcode = 17,
18158 .operands = &.{
18159 .{ .kind = .id_ref, .quantifier = .required },
18160 .{ .kind = .id_ref, .quantifier = .required },
18161 .{ .kind = .id_ref, .quantifier = .required },
18162 .{ .kind = .id_ref, .quantifier = .required },
18163 .{ .kind = .id_ref, .quantifier = .variadic },
18164 },
18165 },
18166 .{
18167 .name = "DebugGlobalVariable",
18168 .opcode = 18,
18169 .operands = &.{
18170 .{ .kind = .id_ref, .quantifier = .required },
18171 .{ .kind = .id_ref, .quantifier = .required },
18172 .{ .kind = .id_ref, .quantifier = .required },
18173 .{ .kind = .id_ref, .quantifier = .required },
18174 .{ .kind = .id_ref, .quantifier = .required },
18175 .{ .kind = .id_ref, .quantifier = .required },
18176 .{ .kind = .id_ref, .quantifier = .required },
18177 .{ .kind = .id_ref, .quantifier = .required },
18178 .{ .kind = .id_ref, .quantifier = .required },
18179 .{ .kind = .id_ref, .quantifier = .optional },
18180 },
18181 },
18182 .{
18183 .name = "DebugFunctionDeclaration",
18184 .opcode = 19,
18185 .operands = &.{
18186 .{ .kind = .id_ref, .quantifier = .required },
18187 .{ .kind = .id_ref, .quantifier = .required },
18188 .{ .kind = .id_ref, .quantifier = .required },
18189 .{ .kind = .id_ref, .quantifier = .required },
18190 .{ .kind = .id_ref, .quantifier = .required },
18191 .{ .kind = .id_ref, .quantifier = .required },
18192 .{ .kind = .id_ref, .quantifier = .required },
18193 .{ .kind = .id_ref, .quantifier = .required },
18194 },
18195 },
18196 .{
18197 .name = "DebugFunction",
18198 .opcode = 20,
18199 .operands = &.{
18200 .{ .kind = .id_ref, .quantifier = .required },
18201 .{ .kind = .id_ref, .quantifier = .required },
18202 .{ .kind = .id_ref, .quantifier = .required },
18203 .{ .kind = .id_ref, .quantifier = .required },
18204 .{ .kind = .id_ref, .quantifier = .required },
18205 .{ .kind = .id_ref, .quantifier = .required },
18206 .{ .kind = .id_ref, .quantifier = .required },
18207 .{ .kind = .id_ref, .quantifier = .required },
18208 .{ .kind = .id_ref, .quantifier = .required },
18209 .{ .kind = .id_ref, .quantifier = .optional },
18210 },
18211 },
18212 .{
18213 .name = "DebugLexicalBlock",
18214 .opcode = 21,
18215 .operands = &.{
18216 .{ .kind = .id_ref, .quantifier = .required },
18217 .{ .kind = .id_ref, .quantifier = .required },
18218 .{ .kind = .id_ref, .quantifier = .required },
18219 .{ .kind = .id_ref, .quantifier = .required },
18220 .{ .kind = .id_ref, .quantifier = .optional },
18221 },
18222 },
18223 .{
18224 .name = "DebugLexicalBlockDiscriminator",
18225 .opcode = 22,
18226 .operands = &.{
18227 .{ .kind = .id_ref, .quantifier = .required },
18228 .{ .kind = .id_ref, .quantifier = .required },
18229 .{ .kind = .id_ref, .quantifier = .required },
18230 },
18231 },
18232 .{
18233 .name = "DebugScope",
18234 .opcode = 23,
18235 .operands = &.{
18236 .{ .kind = .id_ref, .quantifier = .required },
18237 .{ .kind = .id_ref, .quantifier = .optional },
18238 },
18239 },
18240 .{
18241 .name = "DebugNoScope",
18242 .opcode = 24,
18243 .operands = &.{},
18244 },
18245 .{
18246 .name = "DebugInlinedAt",
18247 .opcode = 25,
18248 .operands = &.{
18249 .{ .kind = .id_ref, .quantifier = .required },
18250 .{ .kind = .id_ref, .quantifier = .required },
18251 .{ .kind = .id_ref, .quantifier = .optional },
18252 },
18253 },
18254 .{
18255 .name = "DebugLocalVariable",
18256 .opcode = 26,
18257 .operands = &.{
18258 .{ .kind = .id_ref, .quantifier = .required },
18259 .{ .kind = .id_ref, .quantifier = .required },
18260 .{ .kind = .id_ref, .quantifier = .required },
18261 .{ .kind = .id_ref, .quantifier = .required },
18262 .{ .kind = .id_ref, .quantifier = .required },
18263 .{ .kind = .id_ref, .quantifier = .required },
18264 .{ .kind = .id_ref, .quantifier = .required },
18265 .{ .kind = .id_ref, .quantifier = .optional },
18266 },
18267 },
18268 .{
18269 .name = "DebugInlinedVariable",
18270 .opcode = 27,
18271 .operands = &.{
18272 .{ .kind = .id_ref, .quantifier = .required },
18273 .{ .kind = .id_ref, .quantifier = .required },
18274 },
18275 },
18276 .{
18277 .name = "DebugDeclare",
18278 .opcode = 28,
18279 .operands = &.{
18280 .{ .kind = .id_ref, .quantifier = .required },
18281 .{ .kind = .id_ref, .quantifier = .required },
18282 .{ .kind = .id_ref, .quantifier = .required },
18283 .{ .kind = .id_ref, .quantifier = .variadic },
18284 },
18285 },
18286 .{
18287 .name = "DebugValue",
18288 .opcode = 29,
18289 .operands = &.{
18290 .{ .kind = .id_ref, .quantifier = .required },
18291 .{ .kind = .id_ref, .quantifier = .required },
18292 .{ .kind = .id_ref, .quantifier = .required },
18293 .{ .kind = .id_ref, .quantifier = .variadic },
18294 },
18295 },
18296 .{
18297 .name = "DebugOperation",
18298 .opcode = 30,
18299 .operands = &.{
18300 .{ .kind = .id_ref, .quantifier = .required },
18301 .{ .kind = .id_ref, .quantifier = .variadic },
18302 },
18303 },
18304 .{
18305 .name = "DebugExpression",
18306 .opcode = 31,
18307 .operands = &.{
18308 .{ .kind = .id_ref, .quantifier = .variadic },
18309 },
18310 },
18311 .{
18312 .name = "DebugMacroDef",
18313 .opcode = 32,
18314 .operands = &.{
18315 .{ .kind = .id_ref, .quantifier = .required },
18316 .{ .kind = .id_ref, .quantifier = .required },
18317 .{ .kind = .id_ref, .quantifier = .required },
18318 .{ .kind = .id_ref, .quantifier = .optional },
18319 },
18320 },
18321 .{
18322 .name = "DebugMacroUndef",
18323 .opcode = 33,
18324 .operands = &.{
18325 .{ .kind = .id_ref, .quantifier = .required },
18326 .{ .kind = .id_ref, .quantifier = .required },
18327 .{ .kind = .id_ref, .quantifier = .required },
18328 },
18329 },
18330 .{
18331 .name = "DebugImportedEntity",
18332 .opcode = 34,
18333 .operands = &.{
18334 .{ .kind = .id_ref, .quantifier = .required },
18335 .{ .kind = .id_ref, .quantifier = .required },
18336 .{ .kind = .id_ref, .quantifier = .required },
18337 .{ .kind = .id_ref, .quantifier = .required },
18338 .{ .kind = .id_ref, .quantifier = .required },
18339 .{ .kind = .id_ref, .quantifier = .required },
18340 .{ .kind = .id_ref, .quantifier = .required },
18341 },
18342 },
18343 .{
18344 .name = "DebugSource",
18345 .opcode = 35,
18346 .operands = &.{
18347 .{ .kind = .id_ref, .quantifier = .required },
18348 .{ .kind = .id_ref, .quantifier = .optional },
18349 },
18350 },
18351 .{
18352 .name = "DebugFunctionDefinition",
18353 .opcode = 101,
18354 .operands = &.{
18355 .{ .kind = .id_ref, .quantifier = .required },
18356 .{ .kind = .id_ref, .quantifier = .required },
18357 },
18358 },
18359 .{
18360 .name = "DebugSourceContinued",
18361 .opcode = 102,
18362 .operands = &.{
18363 .{ .kind = .id_ref, .quantifier = .required },
18364 },
18365 },
18366 .{
18367 .name = "DebugLine",
18368 .opcode = 103,
18369 .operands = &.{
18370 .{ .kind = .id_ref, .quantifier = .required },
18371 .{ .kind = .id_ref, .quantifier = .required },
18372 .{ .kind = .id_ref, .quantifier = .required },
18373 .{ .kind = .id_ref, .quantifier = .required },
18374 .{ .kind = .id_ref, .quantifier = .required },
18375 },
18376 },
18377 .{
18378 .name = "DebugNoLine",
18379 .opcode = 104,
18380 .operands = &.{},
18381 },
18382 .{
18383 .name = "DebugBuildIdentifier",
18384 .opcode = 105,
18385 .operands = &.{
18386 .{ .kind = .id_ref, .quantifier = .required },
18387 .{ .kind = .id_ref, .quantifier = .required },
18388 },
18389 },
18390 .{
18391 .name = "DebugStoragePath",
18392 .opcode = 106,
18393 .operands = &.{
18394 .{ .kind = .id_ref, .quantifier = .required },
18395 },
18396 },
18397 .{
18398 .name = "DebugEntryPoint",
18399 .opcode = 107,
18400 .operands = &.{
18401 .{ .kind = .id_ref, .quantifier = .required },
18402 .{ .kind = .id_ref, .quantifier = .required },
18403 .{ .kind = .id_ref, .quantifier = .required },
18404 .{ .kind = .id_ref, .quantifier = .required },
18405 },
18406 },
18407 .{
18408 .name = "DebugTypeMatrix",
18409 .opcode = 108,
18410 .operands = &.{
18411 .{ .kind = .id_ref, .quantifier = .required },
18412 .{ .kind = .id_ref, .quantifier = .required },
18413 .{ .kind = .id_ref, .quantifier = .required },
18414 },
18415 },
18416 },
18417 .zig => &.{
18418 .{
18419 .name = "InvocationGlobal",
18420 .opcode = 0,
18421 .operands = &.{
18422 .{ .kind = .id_ref, .quantifier = .required },
18423 },
18424 },
18425 },
18426 };
18427 }
18428};
src/link/SpirV.zig+4-5
...@@ -11,19 +11,18 @@ const link = @import("../link.zig");...@@ -11,19 +11,18 @@ const link = @import("../link.zig");
11const Air = @import("../Air.zig");11const Air = @import("../Air.zig");
12const Type = @import("../Type.zig");12const Type = @import("../Type.zig");
13const BinaryModule = @import("SpirV/BinaryModule.zig");13const BinaryModule = @import("SpirV/BinaryModule.zig");
14const CodeGen = @import("../arch/spirv/CodeGen.zig");14const CodeGen = @import("../codegen/spirv/CodeGen.zig");
15const SpvModule = @import("../arch/spirv/Module.zig");15const Module = @import("../codegen/spirv/Module.zig");
16const Section = @import("../arch/spirv/Section.zig");
17const trace = @import("../tracy.zig").trace;16const trace = @import("../tracy.zig").trace;
1817
19const spec = @import("../arch/spirv/spec.zig");18const spec = @import("../codegen/spirv/spec.zig");
20const Id = spec.Id;19const Id = spec.Id;
21const Word = spec.Word;20const Word = spec.Word;
2221
23const Linker = @This();22const Linker = @This();
2423
25base: link.File,24base: link.File,
26module: SpvModule,25module: Module,
2726
28pub fn createEmpty(27pub fn createEmpty(
29 arena: Allocator,28 arena: Allocator,
src/link/SpirV/BinaryModule.zig+1-1
...@@ -3,7 +3,7 @@ const assert = std.debug.assert;...@@ -3,7 +3,7 @@ const assert = std.debug.assert;
3const Allocator = std.mem.Allocator;3const Allocator = std.mem.Allocator;
4const log = std.log.scoped(.spirv_parse);4const log = std.log.scoped(.spirv_parse);
55
6const spec = @import("../../arch/spirv/spec.zig");6const spec = @import("../../codegen/spirv/spec.zig");
7const Opcode = spec.Opcode;7const Opcode = spec.Opcode;
8const Word = spec.Word;8const Word = spec.Word;
9const InstructionSet = spec.InstructionSet;9const InstructionSet = spec.InstructionSet;
src/link/SpirV/lower_invocation_globals.zig+2-2
...@@ -4,8 +4,8 @@ const assert = std.debug.assert;...@@ -4,8 +4,8 @@ const assert = std.debug.assert;
4const log = std.log.scoped(.spirv_link);4const log = std.log.scoped(.spirv_link);
55
6const BinaryModule = @import("BinaryModule.zig");6const BinaryModule = @import("BinaryModule.zig");
7const Section = @import("../../arch/spirv/Section.zig");7const Section = @import("../../codegen/spirv/Section.zig");
8const spec = @import("../../arch/spirv/spec.zig");8const spec = @import("../../codegen/spirv/spec.zig");
9const ResultId = spec.Id;9const ResultId = spec.Id;
10const Word = spec.Word;10const Word = spec.Word;
1111
src/link/SpirV/prune_unused.zig+2-2
...@@ -12,8 +12,8 @@ const assert = std.debug.assert;...@@ -12,8 +12,8 @@ const assert = std.debug.assert;
12const log = std.log.scoped(.spirv_link);12const log = std.log.scoped(.spirv_link);
1313
14const BinaryModule = @import("BinaryModule.zig");14const BinaryModule = @import("BinaryModule.zig");
15const Section = @import("../../arch/spirv/Section.zig");15const Section = @import("../../codegen/spirv/Section.zig");
16const spec = @import("../../arch/spirv/spec.zig");16const spec = @import("../../codegen/spirv/spec.zig");
17const Opcode = spec.Opcode;17const Opcode = spec.Opcode;
18const ResultId = spec.Id;18const ResultId = spec.Id;
19const Word = spec.Word;19const Word = spec.Word;