authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-02 04:16:01+03:30
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-08-02 04:16:01+03:30
log31de2c873fa206a8fd491f7c9c959845fb86b0a1
treebea6a7f47e58b557e0d2483d707f9e2af1c2f459
parent982c387753c33a9eb42349c109fc4a6ed0675165
signaturelock-open Commit is signed but in an unrecognized format.

spirv: refactor


23 files changed, 27137 insertions(+), 27537 deletions(-)

src/Zcu/PerThread.zig+2-5
......@@ -4398,13 +4398,10 @@ fn runCodegenInner(pt: Zcu.PerThread, func_index: InternPool.Index, air: *Air) e
43984398
43994399 const lf = comp.bin_file orelse return error.NoLinkFile;
44004400
4401 // TODO: self-hosted codegen should always have a type of MIR; codegen should produce that MIR,
4402 // and the linker should consume it. However, our SPIR-V backend is currently tightly coupled
4403 // with our SPIR-V linker, so needs to work more like the LLVM backend. This should be fixed to
4404 // unblock threaded codegen for SPIR-V.
4401 // Just like LLVM, the SPIR-V backend can't multi-threaded due to SPIR-V design limitations.
44054402 if (lf.cast(.spirv)) |spirv_file| {
44064403 assert(pt.tid == .main); // SPIR-V has a lot of shared state
4407 spirv_file.object.updateFunc(pt, func_index, air, &liveness) catch |err| {
4404 spirv_file.updateFunc(pt, func_index, air, &liveness) catch |err| {
44084405 switch (err) {
44094406 error.OutOfMemory => comp.link_diags.setAllocFailure(),
44104407 }
src/arch/spirv/Assembler.zig created+1088
......@@ -0,0 +1,1088 @@
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 const result_id = module.allocId();
271 try module.structType(result_id, ids, null);
272 break :blk result_id;
273 },
274 .OpTypeImage => blk: {
275 const sampled_type = try self.resolveRefId(operands[1].ref_id);
276 const result_id = module.allocId();
277 try section.emit(gpa, .OpTypeImage, .{
278 .id_result = result_id,
279 .sampled_type = sampled_type,
280 .dim = @enumFromInt(operands[2].value),
281 .depth = operands[3].literal32,
282 .arrayed = operands[4].literal32,
283 .ms = operands[5].literal32,
284 .sampled = operands[6].literal32,
285 .image_format = @enumFromInt(operands[7].value),
286 });
287 break :blk result_id;
288 },
289 .OpTypeSampler => blk: {
290 const result_id = module.allocId();
291 try section.emit(gpa, .OpTypeSampler, .{ .id_result = result_id });
292 break :blk result_id;
293 },
294 .OpTypeSampledImage => blk: {
295 const image_type = try self.resolveRefId(operands[1].ref_id);
296 const result_id = module.allocId();
297 try section.emit(gpa, .OpTypeSampledImage, .{ .id_result = result_id, .image_type = image_type });
298 break :blk result_id;
299 },
300 .OpTypeFunction => blk: {
301 const param_operands = operands[2..];
302 const return_type = try self.resolveRefId(operands[1].ref_id);
303
304 const param_types = try module.gpa.alloc(Id, param_operands.len);
305 defer module.gpa.free(param_types);
306 for (param_types, param_operands) |*param, operand| {
307 param.* = try self.resolveRefId(operand.ref_id);
308 }
309 const result_id = module.allocId();
310 try section.emit(module.gpa, .OpTypeFunction, .{
311 .id_result = result_id,
312 .return_type = return_type,
313 .id_ref_2 = param_types,
314 });
315 break :blk result_id;
316 },
317 else => return self.todo("process type instruction {s}", .{@tagName(self.inst.opcode)}),
318 };
319
320 return .{ .ty = id };
321}
322
323/// - No forward references are allowed in operands.
324/// - Target section is determined from instruction type.
325fn processGenericInstruction(self: *Assembler) !?AsmValue {
326 const module = self.cg.module;
327 const operands = self.inst.operands.items;
328 var maybe_spv_decl_index: ?Decl.Index = null;
329 const section = switch (self.inst.opcode.class()) {
330 .constant_creation => &module.sections.globals,
331 .annotation => &module.sections.annotations,
332 .type_declaration => unreachable, // Handled elsewhere.
333 else => switch (self.inst.opcode) {
334 .OpEntryPoint => unreachable,
335 .OpExecutionMode, .OpExecutionModeId => &module.sections.execution_modes,
336 .OpVariable => section: {
337 const storage_class: spec.StorageClass = @enumFromInt(operands[2].value);
338 if (storage_class == .function) break :section &self.cg.prologue;
339 maybe_spv_decl_index = try module.allocDecl(.global);
340 if (!module.target.cpu.has(.spirv, .v1_4) and storage_class != .input and storage_class != .output) {
341 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
342 break :section &module.sections.globals;
343 }
344 try self.cg.decl_deps.put(module.gpa, maybe_spv_decl_index.?, {});
345 try module.declareDeclDeps(maybe_spv_decl_index.?, &.{});
346 break :section &module.sections.globals;
347 },
348 else => &self.cg.body,
349 },
350 };
351
352 var maybe_result_id: ?Id = null;
353 const first_word = section.instructions.items.len;
354 // At this point we're not quite sure how many operands this instruction is
355 // going to have, so insert 0 and patch up the actual opcode word later.
356 try section.ensureUnusedCapacity(module.gpa, 1);
357 section.writeWord(0);
358
359 for (operands) |operand| {
360 switch (operand) {
361 .value, .literal32 => |word| {
362 try section.ensureUnusedCapacity(module.gpa, 1);
363 section.writeWord(word);
364 },
365 .literal64 => |dword| {
366 try section.ensureUnusedCapacity(module.gpa, 2);
367 section.writeDoubleWord(dword);
368 },
369 .result_id => {
370 maybe_result_id = if (maybe_spv_decl_index) |spv_decl_index|
371 module.declPtr(spv_decl_index).result_id
372 else
373 module.allocId();
374 try section.ensureUnusedCapacity(module.gpa, 1);
375 section.writeOperand(Id, maybe_result_id.?);
376 },
377 .ref_id => |index| {
378 const result = try self.resolveRef(index);
379 try section.ensureUnusedCapacity(module.gpa, 1);
380 section.writeOperand(spec.Id, result.resultId());
381 },
382 .string => |offset| {
383 const text = std.mem.sliceTo(self.inst.string_bytes.items[offset..], 0);
384 const size = std.math.divCeil(usize, text.len + 1, @sizeOf(Word)) catch unreachable;
385 try section.ensureUnusedCapacity(module.gpa, size);
386 section.writeOperand(spec.LiteralString, text);
387 },
388 }
389 }
390
391 const actual_word_count = section.instructions.items.len - first_word;
392 section.instructions.items[first_word] |= @as(u32, @as(u16, @intCast(actual_word_count))) << 16 | @intFromEnum(self.inst.opcode);
393
394 if (maybe_result_id) |result| return .{ .value = result };
395 return null;
396}
397
398fn resolveMaybeForwardRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
399 const value = self.value_map.values()[ref];
400 switch (value) {
401 .just_declared => {
402 const name = self.value_map.keys()[ref];
403 // TODO: Improve source location.
404 return self.fail(0, "self-referential parameter %{s}", .{name});
405 },
406 else => return value,
407 }
408}
409
410fn resolveRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
411 const value = try self.resolveMaybeForwardRef(ref);
412 switch (value) {
413 .just_declared => unreachable,
414 .unresolved_forward_reference => {
415 const name = self.value_map.keys()[ref];
416 // TODO: Improve source location.
417 return self.fail(0, "reference to undeclared result-id %{s}", .{name});
418 },
419 else => return value,
420 }
421}
422
423fn resolveRefId(self: *Assembler, ref: AsmValue.Ref) !Id {
424 const value = try self.resolveRef(ref);
425 return value.resultId();
426}
427
428fn parseInstruction(self: *Assembler) !void {
429 const gpa = self.cg.module.gpa;
430
431 self.inst.opcode = undefined;
432 self.inst.operands.clearRetainingCapacity();
433 self.inst.string_bytes.clearRetainingCapacity();
434
435 const lhs_result_tok = self.currentToken();
436 const maybe_lhs_result: ?AsmValue.Ref = if (self.eatToken(.result_id_assign)) blk: {
437 const name = self.tokenText(lhs_result_tok)[1..];
438 const entry = try self.value_map.getOrPut(gpa, name);
439 try self.expectToken(.equals);
440 if (!entry.found_existing) {
441 entry.value_ptr.* = .just_declared;
442 }
443 break :blk @intCast(entry.index);
444 } else null;
445
446 const opcode_tok = self.currentToken();
447 if (maybe_lhs_result != null) {
448 try self.expectToken(.opcode);
449 } else if (!self.eatToken(.opcode)) {
450 return self.fail(opcode_tok.start, "expected start of instruction, found {s}", .{opcode_tok.tag.name()});
451 }
452
453 const opcode_text = self.tokenText(opcode_tok);
454 const index = self.inst_map.getIndex(opcode_text) orelse {
455 return self.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
456 };
457
458 const inst = spec.InstructionSet.core.instructions()[index];
459 self.inst.opcode = @enumFromInt(inst.opcode);
460
461 const expected_operands = inst.operands;
462 // This is a loop because the result-id is not always the first operand.
463 const requires_lhs_result = for (expected_operands) |op| {
464 if (op.kind == .id_result) break true;
465 } else false;
466
467 if (requires_lhs_result and maybe_lhs_result == null) {
468 return self.fail(opcode_tok.start, "opcode '{s}' expects result on left-hand side", .{@tagName(self.inst.opcode)});
469 } else if (!requires_lhs_result and maybe_lhs_result != null) {
470 return self.fail(
471 lhs_result_tok.start,
472 "opcode '{s}' does not expect a result-id on the left-hand side",
473 .{@tagName(self.inst.opcode)},
474 );
475 }
476
477 for (expected_operands) |operand| {
478 if (operand.kind == .id_result) {
479 try self.inst.operands.append(gpa, .{ .result_id = maybe_lhs_result.? });
480 continue;
481 }
482
483 switch (operand.quantifier) {
484 .required => if (self.isAtInstructionBoundary()) {
485 return self.fail(
486 self.currentToken().start,
487 "missing required operand", // TODO: Operand name?
488 .{},
489 );
490 } else {
491 try self.parseOperand(operand.kind);
492 },
493 .optional => if (!self.isAtInstructionBoundary()) {
494 try self.parseOperand(operand.kind);
495 },
496 .variadic => while (!self.isAtInstructionBoundary()) {
497 try self.parseOperand(operand.kind);
498 },
499 }
500 }
501}
502
503fn parseOperand(self: *Assembler, kind: spec.OperandKind) Error!void {
504 switch (kind.category()) {
505 .bit_enum => try self.parseBitEnum(kind),
506 .value_enum => try self.parseValueEnum(kind),
507 .id => try self.parseRefId(),
508 else => switch (kind) {
509 .literal_integer => try self.parseLiteralInteger(),
510 .literal_string => try self.parseString(),
511 .literal_context_dependent_number => try self.parseContextDependentNumber(),
512 .literal_ext_inst_integer => try self.parseLiteralExtInstInteger(),
513 .pair_id_ref_id_ref => try self.parsePhiSource(),
514 else => return self.todo("parse operand of type {s}", .{@tagName(kind)}),
515 },
516 }
517}
518
519/// Also handles parsing any required extra operands.
520fn parseBitEnum(self: *Assembler, kind: spec.OperandKind) !void {
521 const gpa = self.cg.module.gpa;
522
523 var tok = self.currentToken();
524 try self.expectToken(.value);
525
526 var text = self.tokenText(tok);
527 if (std.mem.eql(u8, text, "None")) {
528 try self.inst.operands.append(gpa, .{ .value = 0 });
529 return;
530 }
531
532 const enumerants = kind.enumerants();
533 var mask: u32 = 0;
534 while (true) {
535 const enumerant = for (enumerants) |enumerant| {
536 if (std.mem.eql(u8, enumerant.name, text))
537 break enumerant;
538 } else {
539 return self.fail(tok.start, "'{s}' is not a valid flag for bitmask {s}", .{ text, @tagName(kind) });
540 };
541 mask |= enumerant.value;
542 if (!self.eatToken(.pipe))
543 break;
544
545 tok = self.currentToken();
546 try self.expectToken(.value);
547 text = self.tokenText(tok);
548 }
549
550 try self.inst.operands.append(gpa, .{ .value = mask });
551
552 // Assume values are sorted.
553 // TODO: ensure in generator.
554 for (enumerants) |enumerant| {
555 if ((mask & enumerant.value) == 0)
556 continue;
557
558 for (enumerant.parameters) |param_kind| {
559 if (self.isAtInstructionBoundary()) {
560 return self.fail(self.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
561 }
562
563 try self.parseOperand(param_kind);
564 }
565 }
566}
567
568/// Also handles parsing any required extra operands.
569fn parseValueEnum(self: *Assembler, kind: spec.OperandKind) !void {
570 const gpa = self.cg.module.gpa;
571
572 const tok = self.currentToken();
573 if (self.eatToken(.placeholder)) {
574 const name = self.tokenText(tok)[1..];
575 const value = self.value_map.get(name) orelse {
576 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
577 };
578 switch (value) {
579 .constant => |literal32| {
580 try self.inst.operands.append(gpa, .{ .value = literal32 });
581 },
582 .string => |str| {
583 const enumerant = for (kind.enumerants()) |enumerant| {
584 if (std.mem.eql(u8, enumerant.name, str)) break enumerant;
585 } else {
586 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ str, @tagName(kind) });
587 };
588 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
589 },
590 else => return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name}),
591 }
592 return;
593 }
594
595 try self.expectToken(.value);
596
597 const text = self.tokenText(tok);
598 const int_value = std.fmt.parseInt(u32, text, 0) catch null;
599 const enumerant = for (kind.enumerants()) |enumerant| {
600 if (int_value) |v| {
601 if (v == enumerant.value) break enumerant;
602 } else {
603 if (std.mem.eql(u8, enumerant.name, text)) break enumerant;
604 }
605 } else {
606 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ text, @tagName(kind) });
607 };
608
609 try self.inst.operands.append(gpa, .{ .value = enumerant.value });
610
611 for (enumerant.parameters) |param_kind| {
612 if (self.isAtInstructionBoundary()) {
613 return self.fail(self.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
614 }
615
616 try self.parseOperand(param_kind);
617 }
618}
619
620fn parseRefId(self: *Assembler) !void {
621 const gpa = self.cg.module.gpa;
622
623 const tok = self.currentToken();
624 try self.expectToken(.result_id);
625
626 const name = self.tokenText(tok)[1..];
627 const entry = try self.value_map.getOrPut(gpa, name);
628 if (!entry.found_existing) {
629 entry.value_ptr.* = .unresolved_forward_reference;
630 }
631
632 const index: AsmValue.Ref = @intCast(entry.index);
633 try self.inst.operands.append(gpa, .{ .ref_id = index });
634}
635
636fn parseLiteralInteger(self: *Assembler) !void {
637 const gpa = self.cg.module.gpa;
638
639 const tok = self.currentToken();
640 if (self.eatToken(.placeholder)) {
641 const name = self.tokenText(tok)[1..];
642 const value = self.value_map.get(name) orelse {
643 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
644 };
645 switch (value) {
646 .constant => |literal32| {
647 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
648 },
649 else => {
650 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
651 },
652 }
653 return;
654 }
655
656 try self.expectToken(.value);
657 // According to the SPIR-V machine readable grammar, a LiteralInteger
658 // may consist of one or more words. From the SPIR-V docs it seems like there
659 // only one instruction where multiple words are allowed, the literals that make up the
660 // switch cases of OpSwitch. This case is handled separately, and so we just assume
661 // everything is a 32-bit integer in this function.
662 const text = self.tokenText(tok);
663 const value = std.fmt.parseInt(u32, text, 0) catch {
664 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
665 };
666 try self.inst.operands.append(gpa, .{ .literal32 = value });
667}
668
669fn parseLiteralExtInstInteger(self: *Assembler) !void {
670 const gpa = self.cg.module.gpa;
671
672 const tok = self.currentToken();
673 if (self.eatToken(.placeholder)) {
674 const name = self.tokenText(tok)[1..];
675 const value = self.value_map.get(name) orelse {
676 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
677 };
678 switch (value) {
679 .constant => |literal32| {
680 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
681 },
682 else => {
683 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
684 },
685 }
686 return;
687 }
688
689 try self.expectToken(.value);
690 const text = self.tokenText(tok);
691 const value = std.fmt.parseInt(u32, text, 0) catch {
692 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
693 };
694 try self.inst.operands.append(gpa, .{ .literal32 = value });
695}
696
697fn parseString(self: *Assembler) !void {
698 const gpa = self.cg.module.gpa;
699
700 const tok = self.currentToken();
701 try self.expectToken(.string);
702 // Note, the string might not have a closing quote. In this case,
703 // an error is already emitted but we are trying to continue processing
704 // anyway, so in this function we have to deal with that situation.
705 const text = self.tokenText(tok);
706 assert(text.len > 0 and text[0] == '"');
707 const literal = if (text.len != 1 and text[text.len - 1] == '"')
708 text[1 .. text.len - 1]
709 else
710 text[1..];
711
712 const string_offset: u32 = @intCast(self.inst.string_bytes.items.len);
713 try self.inst.string_bytes.ensureUnusedCapacity(gpa, literal.len + 1);
714 self.inst.string_bytes.appendSliceAssumeCapacity(literal);
715 self.inst.string_bytes.appendAssumeCapacity(0);
716
717 try self.inst.operands.append(gpa, .{ .string = string_offset });
718}
719
720fn parseContextDependentNumber(self: *Assembler) !void {
721 const module = self.cg.module;
722
723 // For context dependent numbers, the actual type to parse is determined by the instruction.
724 // Currently, this operand appears in OpConstant and OpSpecConstant, where the too-be-parsed type
725 // is determined by the result type. That means that in this instructions we have to resolve the
726 // operand type early and look at the result to see how we need to proceed.
727 assert(self.inst.opcode == .OpConstant or self.inst.opcode == .OpSpecConstant);
728
729 const tok = self.currentToken();
730 const result = try self.resolveRef(self.inst.operands.items[0].ref_id);
731 const result_id = result.resultId();
732 // We are going to cheat a little bit: The types we are interested in, int and float,
733 // are added to the module and cached via module.intType and module.floatType. Therefore,
734 // we can determine the width of these types by directly checking the cache.
735 // This only works if the Assembler and codegen both use spv.intType and spv.floatType though.
736 // We don't expect there to be many of these types, so just look it up every time.
737 // TODO: Count be improved to be a little bit more efficent.
738
739 {
740 var it = module.cache.int_types.iterator();
741 while (it.next()) |entry| {
742 const id = entry.value_ptr.*;
743 if (id != result_id) continue;
744 const info = entry.key_ptr.*;
745 return try self.parseContextDependentInt(info.signedness, info.bits);
746 }
747 }
748
749 {
750 var it = module.cache.float_types.iterator();
751 while (it.next()) |entry| {
752 const id = entry.value_ptr.*;
753 if (id != result_id) continue;
754 const info = entry.key_ptr.*;
755 switch (info.bits) {
756 16 => try self.parseContextDependentFloat(16),
757 32 => try self.parseContextDependentFloat(32),
758 64 => try self.parseContextDependentFloat(64),
759 else => return self.fail(tok.start, "cannot parse {}-bit info literal", .{info.bits}),
760 }
761 }
762 }
763
764 return self.fail(tok.start, "cannot parse literal constant", .{});
765}
766
767fn parseContextDependentInt(self: *Assembler, signedness: std.builtin.Signedness, width: u32) !void {
768 const gpa = self.cg.module.gpa;
769
770 const tok = self.currentToken();
771 if (self.eatToken(.placeholder)) {
772 const name = self.tokenText(tok)[1..];
773 const value = self.value_map.get(name) orelse {
774 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
775 };
776 switch (value) {
777 .constant => |literal32| {
778 try self.inst.operands.append(gpa, .{ .literal32 = literal32 });
779 },
780 else => {
781 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
782 },
783 }
784 return;
785 }
786
787 try self.expectToken(.value);
788
789 if (width == 0 or width > 2 * @bitSizeOf(spec.Word)) {
790 return self.fail(tok.start, "cannot parse {}-bit integer literal", .{width});
791 }
792
793 const text = self.tokenText(tok);
794 invalid: {
795 // Just parse the integer as the next larger integer type, and check if it overflows afterwards.
796 const int = std.fmt.parseInt(i128, text, 0) catch break :invalid;
797 const min = switch (signedness) {
798 .unsigned => 0,
799 .signed => -(@as(i128, 1) << (@as(u7, @intCast(width)) - 1)),
800 };
801 const max = (@as(i128, 1) << (@as(u7, @intCast(width)) - @intFromBool(signedness == .signed))) - 1;
802 if (int < min or int > max) {
803 break :invalid;
804 }
805
806 // Note, we store the sign-extended version here.
807 if (width <= @bitSizeOf(spec.Word)) {
808 try self.inst.operands.append(gpa, .{ .literal32 = @truncate(@as(u128, @bitCast(int))) });
809 } else {
810 try self.inst.operands.append(gpa, .{ .literal64 = @truncate(@as(u128, @bitCast(int))) });
811 }
812 return;
813 }
814
815 return self.fail(tok.start, "'{s}' is not a valid {s} {}-bit int literal", .{ text, @tagName(signedness), width });
816}
817
818fn parseContextDependentFloat(self: *Assembler, comptime width: u16) !void {
819 const gpa = self.cg.module.gpa;
820
821 const Float = std.meta.Float(width);
822 const Int = std.meta.Int(.unsigned, width);
823
824 const tok = self.currentToken();
825 try self.expectToken(.value);
826
827 const text = self.tokenText(tok);
828
829 const value = std.fmt.parseFloat(Float, text) catch {
830 return self.fail(tok.start, "'{s}' is not a valid {}-bit float literal", .{ text, width });
831 };
832
833 const float_bits: Int = @bitCast(value);
834 if (width <= @bitSizeOf(spec.Word)) {
835 try self.inst.operands.append(gpa, .{ .literal32 = float_bits });
836 } else {
837 assert(width <= 2 * @bitSizeOf(spec.Word));
838 try self.inst.operands.append(gpa, .{ .literal64 = float_bits });
839 }
840}
841
842fn parsePhiSource(self: *Assembler) !void {
843 try self.parseRefId();
844 if (self.isAtInstructionBoundary()) {
845 return self.fail(self.currentToken().start, "missing phi block parent", .{});
846 }
847 try self.parseRefId();
848}
849
850/// Returns whether the `current_token` cursor
851/// is currently pointing at the start of a new instruction.
852fn isAtInstructionBoundary(self: Assembler) bool {
853 return switch (self.currentToken().tag) {
854 .opcode, .result_id_assign, .eof => true,
855 else => false,
856 };
857}
858
859fn expectToken(self: *Assembler, tag: Token.Tag) !void {
860 if (self.eatToken(tag))
861 return;
862
863 return self.fail(self.currentToken().start, "unexpected {s}, expected {s}", .{
864 self.currentToken().tag.name(),
865 tag.name(),
866 });
867}
868
869fn eatToken(self: *Assembler, tag: Token.Tag) bool {
870 if (self.testToken(tag)) {
871 self.current_token += 1;
872 return true;
873 }
874 return false;
875}
876
877fn testToken(self: Assembler, tag: Token.Tag) bool {
878 return self.currentToken().tag == tag;
879}
880
881fn currentToken(self: Assembler) Token {
882 return self.tokens.items[self.current_token];
883}
884
885fn tokenText(self: Assembler, tok: Token) []const u8 {
886 return self.src[tok.start..tok.end];
887}
888
889/// Tokenize `self.src` and put the tokens in `self.tokens`.
890/// Any errors encountered are appended to `self.errors`.
891fn tokenize(self: *Assembler) !void {
892 const gpa = self.cg.module.gpa;
893
894 self.tokens.clearRetainingCapacity();
895
896 var offset: u32 = 0;
897 while (true) {
898 const tok = try self.nextToken(offset);
899 // Resolve result-id assignment now.
900 // NOTE: If the previous token wasn't a result-id, just ignore it,
901 // we will catch it while parsing.
902 if (tok.tag == .equals and self.tokens.items[self.tokens.items.len - 1].tag == .result_id) {
903 self.tokens.items[self.tokens.items.len - 1].tag = .result_id_assign;
904 }
905 try self.tokens.append(gpa, tok);
906 if (tok.tag == .eof)
907 break;
908 offset = tok.end;
909 }
910}
911
912const Token = struct {
913 tag: Tag,
914 start: u32,
915 end: u32,
916
917 const Tag = enum {
918 /// Returned when there was no more input to match.
919 eof,
920 /// %identifier
921 result_id,
922 /// %identifier when appearing on the LHS of an equals sign.
923 /// While not technically a token, its relatively easy to resolve
924 /// this during lexical analysis and relieves a bunch of headaches
925 /// during parsing.
926 result_id_assign,
927 /// Mask, int, or float. These are grouped together as some
928 /// SPIR-V enumerants look a bit like integers as well (for example
929 /// "3D"), and so it is easier to just interpret them as the expected
930 /// type when resolving an instruction's operands.
931 value,
932 /// An enumerant that looks like an opcode, that is, OpXxxx.
933 /// Not necessarily a *valid* opcode.
934 opcode,
935 /// String literals.
936 /// Note, this token is also returned for unterminated
937 /// strings. In this case the closing " is not present.
938 string,
939 /// |.
940 pipe,
941 /// =.
942 equals,
943 /// $identifier. This is used (for now) for constant values, like integers.
944 /// These can be used in place of a normal `value`.
945 placeholder,
946
947 fn name(self: Tag) []const u8 {
948 return switch (self) {
949 .eof => "<end of input>",
950 .result_id => "<result-id>",
951 .result_id_assign => "<assigned result-id>",
952 .value => "<value>",
953 .opcode => "<opcode>",
954 .string => "<string literal>",
955 .pipe => "'|'",
956 .equals => "'='",
957 .placeholder => "<placeholder>",
958 };
959 }
960 };
961};
962
963/// Retrieve the next token from the input. This function will assert
964/// that the token is surrounded by whitespace if required, but will not
965/// interpret the token yet.
966/// NOTE: This function doesn't handle .result_id_assign - this is handled in tokenize().
967fn nextToken(self: *Assembler, start_offset: u32) !Token {
968 // We generally separate the input into the following types:
969 // - Whitespace. Generally ignored, but also used as delimiter for some
970 // tokens.
971 // - Values. This entails integers, floats, enums - anything that
972 // consists of alphanumeric characters, delimited by whitespace.
973 // - Result-IDs. This entails anything that consists of alphanumeric characters and _, and
974 // starts with a %. In contrast to values, this entity can be checked for complete correctness
975 // relatively easily here.
976 // - Strings. This entails quote-delimited text such as "abc".
977 // SPIR-V strings have only two escapes, \" and \\.
978 // - Sigils, = and |. In this assembler, these are not required to have whitespace
979 // around them (they act as delimiters) as they do in SPIRV-Tools.
980
981 var state: enum {
982 start,
983 value,
984 result_id,
985 string,
986 string_end,
987 escape,
988 placeholder,
989 } = .start;
990 var token_start = start_offset;
991 var offset = start_offset;
992 var tag = Token.Tag.eof;
993 while (offset < self.src.len) : (offset += 1) {
994 const c = self.src[offset];
995 switch (state) {
996 .start => switch (c) {
997 ' ', '\t', '\r', '\n' => token_start = offset + 1,
998 '"' => {
999 state = .string;
1000 tag = .string;
1001 },
1002 '%' => {
1003 state = .result_id;
1004 tag = .result_id;
1005 },
1006 '|' => {
1007 tag = .pipe;
1008 offset += 1;
1009 break;
1010 },
1011 '=' => {
1012 tag = .equals;
1013 offset += 1;
1014 break;
1015 },
1016 '$' => {
1017 state = .placeholder;
1018 tag = .placeholder;
1019 },
1020 else => {
1021 state = .value;
1022 tag = .value;
1023 },
1024 },
1025 .value => switch (c) {
1026 '"' => {
1027 try self.addError(offset, "unexpected string literal", .{});
1028 // The user most likely just forgot a delimiter here - keep
1029 // the tag as value.
1030 break;
1031 },
1032 ' ', '\t', '\r', '\n', '=', '|' => break,
1033 else => {},
1034 },
1035 .result_id, .placeholder => switch (c) {
1036 '_', 'a'...'z', 'A'...'Z', '0'...'9' => {},
1037 ' ', '\t', '\r', '\n', '=', '|' => break,
1038 else => {
1039 try self.addError(offset, "illegal character in result-id or placeholder", .{});
1040 // Again, probably a forgotten delimiter here.
1041 break;
1042 },
1043 },
1044 .string => switch (c) {
1045 '\\' => state = .escape,
1046 '"' => state = .string_end,
1047 else => {}, // Note, strings may include newlines
1048 },
1049 .string_end => switch (c) {
1050 ' ', '\t', '\r', '\n', '=', '|' => break,
1051 else => {
1052 try self.addError(offset, "unexpected character after string literal", .{});
1053 // The token is still unmistakibly a string.
1054 break;
1055 },
1056 },
1057 // Escapes simply skip the next char.
1058 .escape => state = .string,
1059 }
1060 }
1061
1062 var tok: Token = .{
1063 .tag = tag,
1064 .start = token_start,
1065 .end = offset,
1066 };
1067
1068 switch (state) {
1069 .string, .escape => {
1070 try self.addError(token_start, "unterminated string", .{});
1071 },
1072 .result_id => if (offset - token_start == 1) {
1073 try self.addError(token_start, "result-id must have at least one name character", .{});
1074 },
1075 .value => {
1076 const text = self.tokenText(tok);
1077 const prefix = "Op";
1078 const looks_like_opcode = text.len > prefix.len and
1079 std.mem.startsWith(u8, text, prefix) and
1080 std.ascii.isUpper(text[prefix.len]);
1081 if (looks_like_opcode)
1082 tok.tag = .opcode;
1083 },
1084 else => {},
1085 }
1086
1087 return tok;
1088}
src/arch/spirv/CodeGen.zig created+6465
......@@ -0,0 +1,6465 @@
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;
43pub const big_int_bits = 32;
44
45const ControlFlow = union(enum) {
46 const Structured = struct {
47 /// This type indicates the way that a block is terminated. The
48 /// state of a particular block is used to track how a jump from
49 /// inside the block must reach the outside.
50 const Block = union(enum) {
51 const Incoming = struct {
52 src_label: Id,
53 /// Instruction that returns an u32 value of the
54 /// `Air.Inst.Index` that control flow should jump to.
55 next_block: Id,
56 };
57
58 const SelectionMerge = struct {
59 /// Incoming block from the `then` label.
60 /// Note that hte incoming block from the `else` label is
61 /// either given by the next element in the stack.
62 incoming: Incoming,
63 /// The label id of the cond_br's merge block.
64 /// For the top-most element in the stack, this
65 /// value is undefined.
66 merge_block: Id,
67 };
68
69 /// For a `selection` type block, we cannot use early exits, and we
70 /// must generate a 'merge ladder' of OpSelection instructions. To that end,
71 /// we keep a stack of the merges that still must be closed at the end of
72 /// a block.
73 ///
74 /// This entire structure basically just resembles a tree like
75 /// a x
76 /// \ /
77 /// b o merge
78 /// \ /
79 /// c o merge
80 /// \ /
81 /// o merge
82 /// /
83 /// o jump to next block
84 selection: struct {
85 /// In order to know which merges we still need to do, we need to keep
86 /// a stack of those.
87 merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty,
88 },
89 /// For a `loop` type block, we can early-exit the block by
90 /// jumping to the loop exit node, and we don't need to generate
91 /// an entire stack of merges.
92 loop: struct {
93 /// The next block to jump to can be determined from any number
94 /// of conditions that jump to the loop exit.
95 merges: std.ArrayListUnmanaged(Incoming) = .empty,
96 /// The label id of the loop's merge block.
97 merge_block: Id,
98 },
99
100 fn deinit(block: *Structured.Block, gpa: Allocator) void {
101 switch (block.*) {
102 .selection => |*merge| merge.merge_stack.deinit(gpa),
103 .loop => |*merge| merge.merges.deinit(gpa),
104 }
105 block.* = undefined;
106 }
107 };
108 /// This determines how exits from the current block must be handled.
109 block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty,
110 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
111 };
112
113 const Unstructured = struct {
114 const Incoming = struct {
115 src_label: Id,
116 break_value_id: Id,
117 };
118
119 const Block = struct {
120 label: ?Id = null,
121 incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty,
122 };
123
124 /// We need to keep track of result ids for block labels, as well as the 'incoming'
125 /// blocks for a block.
126 blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, *Block) = .empty,
127 };
128
129 structured: Structured,
130 unstructured: Unstructured,
131
132 pub fn deinit(cg: *ControlFlow, gpa: Allocator) void {
133 switch (cg.*) {
134 .structured => |*cf| {
135 cf.block_stack.deinit(gpa);
136 cf.block_results.deinit(gpa);
137 },
138 .unstructured => |*cf| {
139 cf.blocks.deinit(gpa);
140 },
141 }
142 cg.* = undefined;
143 }
144};
145
146pt: Zcu.PerThread,
147air: Air,
148/// Note: If the declaration is not a function, this value will be undefined!
149liveness: Air.Liveness,
150owner_nav: InternPool.Nav.Index,
151module: *Module,
152control_flow: ControlFlow,
153base_line: u32,
154block_label: Id = .none,
155/// The base offset of the current decl, which is what `dbg_stmt` is relative to.
156/// An array of function argument result-ids. Each index corresponds with the
157/// function argument of the same index.
158args: std.ArrayListUnmanaged(Id) = .empty,
159/// A counter to keep track of how many `arg` instructions we've seen yet.
160next_arg_index: u32 = 0,
161/// A map keeping track of which instruction generated which result-id.
162inst_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
163file_path_id: Id = .none,
164prologue: Section = .{},
165body: Section = .{},
166decl_deps: std.AutoArrayHashMapUnmanaged(Decl.Index, void) = .empty,
167error_msg: ?*Zcu.ErrorMsg = null,
168
169/// Free resources owned by the CodeGen.
170pub fn deinit(cg: *CodeGen) void {
171 const gpa = cg.module.gpa;
172 cg.args.deinit(gpa);
173 cg.inst_results.deinit(gpa);
174 cg.control_flow.deinit(gpa);
175 cg.prologue.deinit(gpa);
176 cg.body.deinit(gpa);
177 cg.decl_deps.deinit(gpa);
178}
179
180const Error = error{ CodegenFail, OutOfMemory };
181
182pub fn genNav(cg: *CodeGen, do_codegen: bool) Error!void {
183 const gpa = cg.module.gpa;
184 const pt = cg.pt;
185 const zcu = pt.zcu;
186 const ip = &zcu.intern_pool;
187
188 const nav = ip.getNav(cg.owner_nav);
189 const val = zcu.navValue(cg.owner_nav);
190 const ty = val.typeOf(zcu);
191
192 if (!do_codegen and !ty.hasRuntimeBits(zcu)) return;
193
194 const spv_decl_index = try cg.module.resolveNav(ip, cg.owner_nav);
195 const result_id = cg.module.declPtr(spv_decl_index).result_id;
196
197 switch (cg.module.declPtr(spv_decl_index).kind) {
198 .func => {
199 const fn_info = zcu.typeToFunc(ty).?;
200 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
201 const is_test = cg.pt.zcu.test_functions.contains(cg.owner_nav);
202
203 const func_result_id = if (is_test) cg.module.allocId() else result_id;
204 const prototype_ty_id = try cg.resolveType(ty, .direct);
205 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
206 .id_result_type = return_ty_id,
207 .id_result = func_result_id,
208 .function_type = prototype_ty_id,
209 // Note: the backend will never be asked to generate an inline function
210 // (this is handled in sema), so we don't need to set function_control here.
211 .function_control = .{},
212 });
213
214 comptime assert(zig_call_abi_ver == 3);
215 try cg.args.ensureUnusedCapacity(gpa, fn_info.param_types.len);
216 for (fn_info.param_types.get(ip)) |param_ty_index| {
217 const param_ty: Type = .fromInterned(param_ty_index);
218 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
219
220 const param_type_id = try cg.resolveType(param_ty, .direct);
221 const arg_result_id = cg.module.allocId();
222 try cg.prologue.emit(cg.module.gpa, .OpFunctionParameter, .{
223 .id_result_type = param_type_id,
224 .id_result = arg_result_id,
225 });
226 cg.args.appendAssumeCapacity(arg_result_id);
227 }
228
229 // TODO: This could probably be done in a better way...
230 const root_block_id = cg.module.allocId();
231
232 // The root block of a function declaration should appear before OpVariable instructions,
233 // so it is generated into the function's prologue.
234 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
235 .id_result = root_block_id,
236 });
237 cg.block_label = root_block_id;
238
239 const main_body = cg.air.getMainBody();
240 switch (cg.control_flow) {
241 .structured => {
242 _ = try cg.genStructuredBody(.selection, main_body);
243 // We always expect paths to here to end, but we still need the block
244 // to act as a dummy merge block.
245 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
246 },
247 .unstructured => {
248 try cg.genBody(main_body);
249 },
250 }
251 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
252 // Append the actual code into the functions section.
253 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
254 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
255 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
256
257 try cg.module.debugName(func_result_id, nav.fqn.toSlice(ip));
258
259 // Temporarily generate a test kernel declaration if this is a test function.
260 if (is_test) {
261 try cg.generateTestEntryPoint(nav.fqn.toSlice(ip), spv_decl_index, func_result_id);
262 }
263 },
264 .global => {
265 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
266 .func => unreachable,
267 .variable => |variable| Value.fromInterned(variable.init),
268 .@"extern" => null,
269 else => val,
270 };
271 assert(maybe_init_val == null); // TODO
272
273 const storage_class = cg.module.storageClass(nav.getAddrspace());
274 assert(storage_class != .generic); // These should be instance globals
275
276 const ptr_ty_id = try cg.ptrType(ty, storage_class, .indirect);
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 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |builtin| {
285 try cg.module.decorate(result_id, .{ .built_in = .{ .built_in = builtin } });
286 }
287
288 try cg.module.debugName(result_id, nav.fqn.toSlice(ip));
289 try cg.module.declareDeclDeps(spv_decl_index, &.{});
290 },
291 .invocation_global => {
292 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
293 .func => unreachable,
294 .variable => |variable| Value.fromInterned(variable.init),
295 .@"extern" => null,
296 else => val,
297 };
298
299 try cg.module.declareDeclDeps(spv_decl_index, &.{});
300
301 const ptr_ty_id = try cg.ptrType(ty, .function, .indirect);
302
303 if (maybe_init_val) |init_val| {
304 // TODO: Combine with resolveAnonDecl?
305 const initializer_proto_ty_id = try cg.functionType(.void, &.{});
306
307 const initializer_id = cg.module.allocId();
308 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
309 .id_result_type = try cg.resolveType(.void, .direct),
310 .id_result = initializer_id,
311 .function_control = .{},
312 .function_type = initializer_proto_ty_id,
313 });
314
315 const root_block_id = cg.module.allocId();
316 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
317 .id_result = root_block_id,
318 });
319 cg.block_label = root_block_id;
320
321 const val_id = try cg.constant(ty, init_val, .indirect);
322 try cg.body.emit(cg.module.gpa, .OpStore, .{
323 .pointer = result_id,
324 .object = val_id,
325 });
326
327 try cg.body.emit(cg.module.gpa, .OpReturn, {});
328 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
329 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
330 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
331 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
332
333 try cg.module.debugNameFmt(initializer_id, "initializer of {f}", .{nav.fqn.fmt(ip)});
334
335 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
336 .id_result_type = ptr_ty_id,
337 .id_result = result_id,
338 .set = try cg.module.importInstructionSet(.zig),
339 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
340 .id_ref_4 = &.{initializer_id},
341 });
342 } else {
343 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
344 .id_result_type = ptr_ty_id,
345 .id_result = result_id,
346 .set = try cg.module.importInstructionSet(.zig),
347 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
348 .id_ref_4 = &.{},
349 });
350 }
351 },
352 }
353}
354
355pub fn fail(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
356 @branchHint(.cold);
357 const zcu = cg.pt.zcu;
358 const src_loc = zcu.navSrcLoc(cg.owner_nav);
359 assert(cg.error_msg == null);
360 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, format, args);
361 return error.CodegenFail;
362}
363
364pub fn todo(cg: *CodeGen, comptime format: []const u8, args: anytype) Error {
365 return cg.fail("TODO (SPIR-V): " ++ format, args);
366}
367
368/// This imports the "default" extended instruction set for the target
369/// For OpenCL, OpenCL.std.100. For Vulkan and OpenGL, GLSL.std.450.
370fn importExtendedSet(cg: *CodeGen) !Id {
371 const target = cg.module.target;
372 return switch (target.os.tag) {
373 .opencl, .amdhsa => try cg.module.importInstructionSet(.@"OpenCL.std"),
374 .vulkan, .opengl => try cg.module.importInstructionSet(.@"GLSL.std.450"),
375 else => unreachable,
376 };
377}
378
379/// Fetch the result-id for a previously generated instruction or constant.
380fn resolve(cg: *CodeGen, inst: Air.Inst.Ref) !Id {
381 const pt = cg.pt;
382 const zcu = pt.zcu;
383 const ip = &zcu.intern_pool;
384 if (try cg.air.value(inst, pt)) |val| {
385 const ty = cg.typeOf(inst);
386 if (ty.zigTypeTag(zcu) == .@"fn") {
387 const fn_nav = switch (zcu.intern_pool.indexToKey(val.ip_index)) {
388 .@"extern" => |@"extern"| @"extern".owner_nav,
389 .func => |func| func.owner_nav,
390 else => unreachable,
391 };
392 const spv_decl_index = try cg.module.resolveNav(ip, fn_nav);
393 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
394 return cg.module.declPtr(spv_decl_index).result_id;
395 }
396
397 return try cg.constant(ty, val, .direct);
398 }
399 const index = inst.toIndex().?;
400 return cg.inst_results.get(index).?; // Assertion means instruction does not dominate usage.
401}
402
403fn resolveUav(cg: *CodeGen, val: InternPool.Index) !Id {
404 const gpa = cg.module.gpa;
405
406 // TODO: This cannot be a function at this point, but it should probably be handled anyway.
407
408 const zcu = cg.pt.zcu;
409 const ty: Type = .fromInterned(zcu.intern_pool.typeOf(val));
410 const decl_ptr_ty_id = try cg.ptrType(ty, cg.module.storageClass(.generic), .indirect);
411
412 const spv_decl_index = blk: {
413 const entry = try cg.module.uav_link.getOrPut(cg.module.gpa, .{ val, .function });
414 if (entry.found_existing) {
415 try cg.addFunctionDep(entry.value_ptr.*, .function);
416
417 const result_id = cg.module.declPtr(entry.value_ptr.*).result_id;
418 return try cg.castToGeneric(decl_ptr_ty_id, result_id);
419 }
420
421 const spv_decl_index = try cg.module.allocDecl(.invocation_global);
422 try cg.addFunctionDep(spv_decl_index, .function);
423 entry.value_ptr.* = spv_decl_index;
424 break :blk spv_decl_index;
425 };
426
427 // TODO: At some point we will be able to generate this all constant here, but then all of
428 // constant() will need to be implemented such that it doesn't generate any at-runtime code.
429 // NOTE: Because this is a global, we really only want to initialize it once. Therefore the
430 // constant lowering of this value will need to be deferred to an initializer similar to
431 // other globals.
432
433 const result_id = cg.module.declPtr(spv_decl_index).result_id;
434
435 {
436 // Save the current state so that we can temporarily generate into a different function.
437 // TODO: This should probably be made a little more robust.
438 const func_prologue = cg.prologue;
439 const func_body = cg.body;
440 const func_deps = cg.decl_deps;
441 const block_label = cg.block_label;
442 defer {
443 cg.prologue = func_prologue;
444 cg.body = func_body;
445 cg.decl_deps = func_deps;
446 cg.block_label = block_label;
447 }
448
449 cg.prologue = .{};
450 cg.body = .{};
451 cg.decl_deps = .{};
452 defer {
453 cg.prologue.deinit(gpa);
454 cg.body.deinit(gpa);
455 cg.decl_deps.deinit(gpa);
456 }
457
458 const initializer_proto_ty_id = try cg.functionType(.void, &.{});
459
460 const initializer_id = cg.module.allocId();
461 try cg.prologue.emit(cg.module.gpa, .OpFunction, .{
462 .id_result_type = try cg.resolveType(.void, .direct),
463 .id_result = initializer_id,
464 .function_control = .{},
465 .function_type = initializer_proto_ty_id,
466 });
467 const root_block_id = cg.module.allocId();
468 try cg.prologue.emit(cg.module.gpa, .OpLabel, .{
469 .id_result = root_block_id,
470 });
471 cg.block_label = root_block_id;
472
473 const val_id = try cg.constant(ty, Value.fromInterned(val), .indirect);
474 try cg.body.emit(cg.module.gpa, .OpStore, .{
475 .pointer = result_id,
476 .object = val_id,
477 });
478
479 try cg.body.emit(cg.module.gpa, .OpReturn, {});
480 try cg.body.emit(cg.module.gpa, .OpFunctionEnd, {});
481
482 try cg.module.sections.functions.append(cg.module.gpa, cg.prologue);
483 try cg.module.sections.functions.append(cg.module.gpa, cg.body);
484 try cg.module.declareDeclDeps(spv_decl_index, cg.decl_deps.keys());
485
486 try cg.module.debugNameFmt(initializer_id, "initializer of __anon_{d}", .{@intFromEnum(val)});
487
488 const fn_decl_ptr_ty_id = try cg.ptrType(ty, .function, .indirect);
489 try cg.module.sections.globals.emit(cg.module.gpa, .OpExtInst, .{
490 .id_result_type = fn_decl_ptr_ty_id,
491 .id_result = result_id,
492 .set = try cg.module.importInstructionSet(.zig),
493 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
494 .id_ref_4 = &.{initializer_id},
495 });
496 }
497
498 return try cg.castToGeneric(decl_ptr_ty_id, result_id);
499}
500
501fn addFunctionDep(cg: *CodeGen, decl_index: Module.Decl.Index, storage_class: StorageClass) !void {
502 if (cg.module.target.cpu.has(.spirv, .v1_4)) {
503 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
504 } else {
505 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
506 if (storage_class == .input or storage_class == .output) {
507 try cg.decl_deps.put(cg.module.gpa, decl_index, {});
508 }
509 }
510}
511
512fn castToGeneric(cg: *CodeGen, type_id: Id, ptr_id: Id) !Id {
513 if (cg.module.target.cpu.has(.spirv, .generic_pointer)) {
514 const result_id = cg.module.allocId();
515 try cg.body.emit(cg.module.gpa, .OpPtrCastToGeneric, .{
516 .id_result_type = type_id,
517 .id_result = result_id,
518 .pointer = ptr_id,
519 });
520 return result_id;
521 }
522
523 return ptr_id;
524}
525
526/// Start a new SPIR-V block, Emits the label of the new block, and stores which
527/// block we are currently generating.
528/// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
529/// keep track of the previous block.
530fn beginSpvBlock(cg: *CodeGen, label: Id) !void {
531 try cg.body.emit(cg.module.gpa, .OpLabel, .{ .id_result = label });
532 cg.block_label = label;
533}
534
535/// SPIR-V requires enabling specific integer sizes through capabilities, and so if they are not enabled, we need
536/// to emulate them in other instructions/types. This function returns, given an integer bit width (signed or unsigned, sign
537/// included), the width of the underlying type which represents it, given the enabled features for the current target.
538/// If the result is `null`, the largest type the target platform supports natively is not able to perform computations using
539/// that size. In this case, multiple elements of the largest type should be used.
540/// The backing type will be chosen as the smallest supported integer larger or equal to it in number of bits.
541/// The result is valid to be used with OpTypeInt.
542/// TODO: Should the result of this function be cached?
543fn backingIntBits(cg: *CodeGen, bits: u16) struct { u16, bool } {
544 // The backend will never be asked to compiler a 0-bit integer, so we won't have to handle those in this function.
545 assert(bits != 0);
546
547 if (cg.module.target.cpu.has(.spirv, .arbitrary_precision_integers) and bits <= 32) {
548 return .{ bits, false };
549 }
550
551 // We require Int8 and Int16 capabilities and benefit Int64 when available.
552 // 32-bit integers are always supported (see spec, 2.16.1, Data rules).
553 const ints = [_]struct { bits: u16, enabled: bool }{
554 .{ .bits = 8, .enabled = true },
555 .{ .bits = 16, .enabled = true },
556 .{ .bits = 32, .enabled = true },
557 .{
558 .bits = 64,
559 .enabled = cg.module.target.cpu.has(.spirv, .int64) or cg.module.target.cpu.arch == .spirv64,
560 },
561 };
562
563 for (ints) |int| {
564 if (bits <= int.bits and int.enabled) return .{ int.bits, false };
565 }
566
567 // Big int
568 return .{ std.mem.alignForward(u16, bits, big_int_bits), true };
569}
570
571/// Return the amount of bits in the largest supported integer type. This is either 32 (always supported), or 64 (if
572/// the Int64 capability is enabled).
573/// Note: The extension SPV_INTEL_arbitrary_precision_integers allows any integer size (at least up to 32 bits).
574/// In theory that could also be used, but since the spec says that it only guarantees support up to 32-bit ints there
575/// is no way of knowing whether those are actually supported.
576/// TODO: Maybe this should be cached?
577fn largestSupportedIntBits(cg: *CodeGen) u16 {
578 if (cg.module.target.cpu.has(.spirv, .int64) or cg.module.target.cpu.arch == .spirv64) {
579 return 64;
580 }
581 return 32;
582}
583
584const ArithmeticTypeInfo = struct {
585 const Class = enum {
586 bool,
587 /// A regular, **native**, integer.
588 /// This is only returned when the backend supports this int as a native type (when
589 /// the relevant capability is enabled).
590 integer,
591 /// A regular float. These are all required to be natively supported. Floating points
592 /// for which the relevant capability is not enabled are not emulated.
593 float,
594 /// An integer of a 'strange' size (which' bit size is not the same as its backing
595 /// type. **Note**: this may **also** include power-of-2 integers for which the
596 /// relevant capability is not enabled), but still within the limits of the largest
597 /// natively supported integer type.
598 strange_integer,
599 /// An integer with more bits than the largest natively supported integer type.
600 composite_integer,
601 };
602
603 /// A classification of the inner type.
604 /// These scenarios will all have to be handled slightly different.
605 class: Class,
606 /// The number of bits in the inner type.
607 /// This is the actual number of bits of the type, not the size of the backing integer.
608 bits: u16,
609 /// The number of bits required to store the type.
610 /// For `integer` and `float`, this is equal to `bits`.
611 /// For `strange_integer` and `bool` this is the size of the backing integer.
612 /// For `composite_integer` this is the elements count.
613 backing_bits: u16,
614 /// Null if this type is a scalar, or the length of the vector otherwise.
615 vector_len: ?u32,
616 /// Whether the inner type is signed. Only relevant for integers.
617 signedness: std.builtin.Signedness,
618};
619
620fn arithmeticTypeInfo(cg: *CodeGen, ty: Type) ArithmeticTypeInfo {
621 const zcu = cg.pt.zcu;
622 const target = cg.module.target;
623 var scalar_ty = ty.scalarType(zcu);
624 if (scalar_ty.zigTypeTag(zcu) == .@"enum") {
625 scalar_ty = scalar_ty.intTagType(zcu);
626 }
627 const vector_len = if (ty.isVector(zcu)) ty.vectorLen(zcu) else null;
628 return switch (scalar_ty.zigTypeTag(zcu)) {
629 .bool => .{
630 .bits = 1, // Doesn't matter for this class.
631 .backing_bits = cg.backingIntBits(1).@"0",
632 .vector_len = vector_len,
633 .signedness = .unsigned, // Technically, but doesn't matter for this class.
634 .class = .bool,
635 },
636 .float => .{
637 .bits = scalar_ty.floatBits(target),
638 .backing_bits = scalar_ty.floatBits(target), // TODO: F80?
639 .vector_len = vector_len,
640 .signedness = .signed, // Technically, but doesn't matter for this class.
641 .class = .float,
642 },
643 .int => blk: {
644 const int_info = scalar_ty.intInfo(zcu);
645 // TODO: Maybe it's useful to also return this value.
646 const backing_bits, const big_int = cg.backingIntBits(int_info.bits);
647 break :blk .{
648 .bits = int_info.bits,
649 .backing_bits = backing_bits,
650 .vector_len = vector_len,
651 .signedness = int_info.signedness,
652 .class = class: {
653 if (big_int) break :class .composite_integer;
654 break :class if (backing_bits == int_info.bits) .integer else .strange_integer;
655 },
656 };
657 },
658 .@"enum" => unreachable,
659 .vector => unreachable,
660 else => unreachable, // Unhandled arithmetic type
661 };
662}
663
664/// Checks whether the type can be directly translated to SPIR-V vectors
665fn isSpvVector(cg: *CodeGen, ty: Type) bool {
666 const zcu = cg.pt.zcu;
667 if (ty.zigTypeTag(zcu) != .vector) return false;
668
669 // TODO: This check must be expanded for types that can be represented
670 // as integers (enums / packed structs?) and types that are represented
671 // by multiple SPIR-V values.
672 const scalar_ty = ty.scalarType(zcu);
673 switch (scalar_ty.zigTypeTag(zcu)) {
674 .bool,
675 .int,
676 .float,
677 => {},
678 else => return false,
679 }
680
681 const elem_ty = ty.childType(zcu);
682 const len = ty.vectorLen(zcu);
683
684 if (elem_ty.isNumeric(zcu) or elem_ty.toIntern() == .bool_type) {
685 if (len > 1 and len <= 4) return true;
686 if (cg.module.target.cpu.has(.spirv, .vector16)) return (len == 8 or len == 16);
687 }
688
689 return false;
690}
691
692/// Emits a bool constant in a particular representation.
693fn constBool(cg: *CodeGen, value: bool, repr: Repr) !Id {
694 return switch (repr) {
695 .indirect => cg.constInt(.u1, @intFromBool(value)),
696 .direct => cg.module.constBool(value),
697 };
698}
699
700/// Emits an integer constant.
701/// This function, unlike Module.constInt, takes care to bitcast
702/// the value to an unsigned int first for Kernels.
703fn constInt(cg: *CodeGen, ty: Type, value: anytype) !Id {
704 const zcu = cg.pt.zcu;
705 const scalar_ty = ty.scalarType(zcu);
706 const int_info = scalar_ty.intInfo(zcu);
707 // Use backing bits so that negatives are sign extended
708 const backing_bits, const big_int = cg.backingIntBits(int_info.bits);
709 assert(backing_bits != 0); // u0 is comptime
710
711 const result_ty_id = try cg.resolveType(scalar_ty, .indirect);
712 const signedness: Signedness = switch (@typeInfo(@TypeOf(value))) {
713 .int => |int| int.signedness,
714 .comptime_int => if (value < 0) .signed else .unsigned,
715 else => unreachable,
716 };
717 if (@sizeOf(@TypeOf(value)) >= 4 and big_int) {
718 const value64: u64 = switch (signedness) {
719 .signed => @bitCast(@as(i64, @intCast(value))),
720 .unsigned => @as(u64, @intCast(value)),
721 };
722 assert(backing_bits == 64);
723 return cg.constructComposite(result_ty_id, &.{
724 try cg.constInt(.u32, @as(u32, @truncate(value64))),
725 try cg.constInt(.u32, @as(u32, @truncate(value64 << 32))),
726 });
727 }
728
729 const final_value: spec.LiteralContextDependentNumber = switch (cg.module.target.os.tag) {
730 .opencl, .amdhsa => blk: {
731 const value64: u64 = switch (signedness) {
732 .signed => @bitCast(@as(i64, @intCast(value))),
733 .unsigned => @as(u64, @intCast(value)),
734 };
735
736 // Manually truncate the value to the right amount of bits.
737 const truncated_value = if (backing_bits == 64)
738 value64
739 else
740 value64 & (@as(u64, 1) << @intCast(backing_bits)) - 1;
741
742 break :blk switch (backing_bits) {
743 1...32 => .{ .uint32 = @truncate(truncated_value) },
744 33...64 => .{ .uint64 = truncated_value },
745 else => unreachable,
746 };
747 },
748 else => switch (backing_bits) {
749 1...32 => if (signedness == .signed) .{ .int32 = @intCast(value) } else .{ .uint32 = @intCast(value) },
750 33...64 => if (signedness == .signed) .{ .int64 = value } else .{ .uint64 = value },
751 else => unreachable,
752 },
753 };
754
755 const result_id = try cg.module.constant(result_ty_id, final_value);
756
757 if (!ty.isVector(zcu)) return result_id;
758 return cg.constructCompositeSplat(ty, result_id);
759}
760
761pub fn constructComposite(cg: *CodeGen, result_ty_id: Id, constituents: []const Id) !Id {
762 const gpa = cg.module.gpa;
763 const result_id = cg.module.allocId();
764 try cg.body.emit(gpa, .OpCompositeConstruct, .{
765 .id_result_type = result_ty_id,
766 .id_result = result_id,
767 .constituents = constituents,
768 });
769 return result_id;
770}
771
772/// Construct a composite at runtime with all lanes set to the same value.
773/// ty must be an aggregate type.
774fn constructCompositeSplat(cg: *CodeGen, ty: Type, constituent: Id) !Id {
775 const gpa = cg.module.gpa;
776 const zcu = cg.pt.zcu;
777 const n: usize = @intCast(ty.arrayLen(zcu));
778
779 const constituents = try gpa.alloc(Id, n);
780 defer gpa.free(constituents);
781 @memset(constituents, constituent);
782
783 const result_ty_id = try cg.resolveType(ty, .direct);
784 return cg.constructComposite(result_ty_id, constituents);
785}
786
787/// This function generates a load for a constant in direct (ie, non-memory) representation.
788/// When the constant is simple, it can be generated directly using OpConstant instructions.
789/// When the constant is more complicated however, it needs to be constructed using multiple values. This
790/// is done by emitting a sequence of instructions that initialize the value.
791//
792/// This function should only be called during function code generation.
793fn constant(cg: *CodeGen, ty: Type, val: Value, repr: Repr) Error!Id {
794 const gpa = cg.module.gpa;
795
796 // Note: Using intern_map can only be used with constants that DO NOT generate any runtime code!!
797 // Ideally that should be all constants in the future, or it should be cleaned up somehow. For
798 // now, only use the intern_map on case-by-case basis by breaking to :cache.
799 if (cg.module.intern_map.get(.{ val.toIntern(), repr })) |id| {
800 return id;
801 }
802
803 const pt = cg.pt;
804 const zcu = pt.zcu;
805 const target = cg.module.target;
806 const result_ty_id = try cg.resolveType(ty, repr);
807 const ip = &zcu.intern_pool;
808
809 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{ ty.fmt(pt), val.fmtValue(pt), @tagName(ip.indexToKey(val.toIntern())) });
810 if (val.isUndefDeep(zcu)) {
811 return cg.module.constUndef(result_ty_id);
812 }
813
814 const cacheable_id = cache: {
815 switch (ip.indexToKey(val.toIntern())) {
816 .int_type,
817 .ptr_type,
818 .array_type,
819 .vector_type,
820 .opt_type,
821 .anyframe_type,
822 .error_union_type,
823 .simple_type,
824 .struct_type,
825 .tuple_type,
826 .union_type,
827 .opaque_type,
828 .enum_type,
829 .func_type,
830 .error_set_type,
831 .inferred_error_set_type,
832 => unreachable, // types, not values
833
834 .undef => unreachable, // handled above
835
836 .variable,
837 .@"extern",
838 .func,
839 .enum_literal,
840 .empty_enum_value,
841 => unreachable, // non-runtime values
842
843 .simple_value => |simple_value| switch (simple_value) {
844 .undefined,
845 .void,
846 .null,
847 .empty_tuple,
848 .@"unreachable",
849 => unreachable, // non-runtime values
850
851 .false, .true => break :cache try cg.constBool(val.toBool(), repr),
852 },
853 .int => {
854 if (ty.isSignedInt(zcu)) {
855 break :cache try cg.constInt(ty, val.toSignedInt(zcu));
856 } else {
857 break :cache try cg.constInt(ty, val.toUnsignedInt(zcu));
858 }
859 },
860 .float => {
861 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
862 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
863 32 => .{ .float32 = val.toFloat(f32, zcu) },
864 64 => .{ .float64 = val.toFloat(f64, zcu) },
865 80, 128 => unreachable, // TODO
866 else => unreachable,
867 };
868 break :cache try cg.module.constant(result_ty_id, lit);
869 },
870 .err => |err| {
871 const value = try pt.getErrorValue(err.name);
872 break :cache try cg.constInt(ty, value);
873 },
874 .error_union => |error_union| {
875 // TODO: Error unions may be constructed with constant instructions if the payload type
876 // allows it. For now, just generate it here regardless.
877 const err_int_ty = try pt.errorIntType();
878 const err_ty = switch (error_union.val) {
879 .err_name => ty.errorUnionSet(zcu),
880 .payload => err_int_ty,
881 };
882 const err_val = switch (error_union.val) {
883 .err_name => |err_name| Value.fromInterned(try pt.intern(.{ .err = .{
884 .ty = ty.errorUnionSet(zcu).toIntern(),
885 .name = err_name,
886 } })),
887 .payload => try pt.intValue(err_int_ty, 0),
888 };
889 const payload_ty = ty.errorUnionPayload(zcu);
890 const eu_layout = cg.errorUnionLayout(payload_ty);
891 if (!eu_layout.payload_has_bits) {
892 // We use the error type directly as the type.
893 break :cache try cg.constant(err_ty, err_val, .indirect);
894 }
895
896 const payload_val: Value = .fromInterned(switch (error_union.val) {
897 .err_name => try pt.intern(.{ .undef = payload_ty.toIntern() }),
898 .payload => |payload| payload,
899 });
900
901 var constituents: [2]Id = undefined;
902 var types: [2]Type = undefined;
903 if (eu_layout.error_first) {
904 constituents[0] = try cg.constant(err_ty, err_val, .indirect);
905 constituents[1] = try cg.constant(payload_ty, payload_val, .indirect);
906 types = .{ err_ty, payload_ty };
907 } else {
908 constituents[0] = try cg.constant(payload_ty, payload_val, .indirect);
909 constituents[1] = try cg.constant(err_ty, err_val, .indirect);
910 types = .{ payload_ty, err_ty };
911 }
912
913 const comp_ty_id = try cg.resolveType(ty, .direct);
914 return try cg.constructComposite(comp_ty_id, &constituents);
915 },
916 .enum_tag => {
917 const int_val = try val.intFromEnum(ty, pt);
918 const int_ty = ty.intTagType(zcu);
919 break :cache try cg.constant(int_ty, int_val, repr);
920 },
921 .ptr => return cg.constantPtr(val),
922 .slice => |slice| {
923 const ptr_id = try cg.constantPtr(Value.fromInterned(slice.ptr));
924 const len_id = try cg.constant(.usize, Value.fromInterned(slice.len), .indirect);
925 const comp_ty_id = try cg.resolveType(ty, .direct);
926 return try cg.constructComposite(comp_ty_id, &.{ ptr_id, len_id });
927 },
928 .opt => {
929 const payload_ty = ty.optionalChild(zcu);
930 const maybe_payload_val = val.optionalValue(zcu);
931
932 if (!payload_ty.hasRuntimeBits(zcu)) {
933 break :cache try cg.constBool(maybe_payload_val != null, .indirect);
934 } else if (ty.optionalReprIsPayload(zcu)) {
935 // Optional representation is a nullable pointer or slice.
936 if (maybe_payload_val) |payload_val| {
937 return try cg.constant(payload_ty, payload_val, .indirect);
938 } else {
939 break :cache try cg.module.constNull(result_ty_id);
940 }
941 }
942
943 // Optional representation is a structure.
944 // { Payload, Bool }
945
946 const has_pl_id = try cg.constBool(maybe_payload_val != null, .indirect);
947 const payload_id = if (maybe_payload_val) |payload_val|
948 try cg.constant(payload_ty, payload_val, .indirect)
949 else
950 try cg.module.constUndef(try cg.resolveType(payload_ty, .indirect));
951
952 const comp_ty_id = try cg.resolveType(ty, .direct);
953 return try cg.constructComposite(comp_ty_id, &.{ payload_id, has_pl_id });
954 },
955 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {
956 inline .array_type, .vector_type => |array_type, tag| {
957 const elem_ty: Type = .fromInterned(array_type.child);
958
959 const constituents = try gpa.alloc(Id, @intCast(ty.arrayLenIncludingSentinel(zcu)));
960 defer gpa.free(constituents);
961
962 const child_repr: Repr = switch (tag) {
963 .array_type => .indirect,
964 .vector_type => .direct,
965 else => unreachable,
966 };
967
968 switch (aggregate.storage) {
969 .bytes => |bytes| {
970 // TODO: This is really space inefficient, perhaps there is a better
971 // way to do it?
972 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
973 constituent.* = try cg.constInt(elem_ty, byte);
974 }
975 },
976 .elems => |elems| {
977 for (constituents, elems) |*constituent, elem| {
978 constituent.* = try cg.constant(elem_ty, Value.fromInterned(elem), child_repr);
979 }
980 },
981 .repeated_elem => |elem| {
982 @memset(constituents, try cg.constant(elem_ty, Value.fromInterned(elem), child_repr));
983 },
984 }
985
986 const comp_ty_id = try cg.resolveType(ty, .direct);
987 return cg.constructComposite(comp_ty_id, constituents);
988 },
989 .struct_type => {
990 const struct_type = zcu.typeToStruct(ty).?;
991
992 if (struct_type.layout == .@"packed") {
993 // TODO: composite int
994 // TODO: endianness
995 const bits: u16 = @intCast(ty.bitSize(zcu));
996 const bytes = std.mem.alignForward(u16, cg.backingIntBits(bits).@"0", 8) / 8;
997 var limbs: [8]u8 = undefined;
998 @memset(&limbs, 0);
999 val.writeToPackedMemory(ty, pt, limbs[0..bytes], 0) catch unreachable;
1000 const backing_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
1001 return try cg.constInt(backing_ty, @as(u64, @bitCast(limbs)));
1002 }
1003
1004 var types = std.ArrayList(Type).init(gpa);
1005 defer types.deinit();
1006
1007 var constituents = std.ArrayList(Id).init(gpa);
1008 defer constituents.deinit();
1009
1010 var it = struct_type.iterateRuntimeOrder(ip);
1011 while (it.next()) |field_index| {
1012 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
1013 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1014 // This is a zero-bit field - we only needed it for the alignment.
1015 continue;
1016 }
1017
1018 // TODO: Padding?
1019 const field_val = try val.fieldValue(pt, field_index);
1020 const field_id = try cg.constant(field_ty, field_val, .indirect);
1021
1022 try types.append(field_ty);
1023 try constituents.append(field_id);
1024 }
1025
1026 const comp_ty_id = try cg.resolveType(ty, .direct);
1027 return try cg.constructComposite(comp_ty_id, constituents.items);
1028 },
1029 .tuple_type => return cg.todo("implement tuple types", .{}),
1030 else => unreachable,
1031 },
1032 .un => |un| {
1033 if (un.tag == .none) {
1034 assert(ty.containerLayout(zcu) == .@"packed"); // TODO
1035 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1036 return try cg.constant(int_ty, Value.fromInterned(un.val), .direct);
1037 }
1038 const active_field = ty.unionTagFieldIndex(Value.fromInterned(un.tag), zcu).?;
1039 const union_obj = zcu.typeToUnion(ty).?;
1040 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[active_field]);
1041 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
1042 try cg.constant(field_ty, Value.fromInterned(un.val), .direct)
1043 else
1044 null;
1045 return try cg.unionInit(ty, active_field, payload);
1046 },
1047 .memoized_call => unreachable,
1048 }
1049 };
1050
1051 try cg.module.intern_map.putNoClobber(gpa, .{ val.toIntern(), repr }, cacheable_id);
1052
1053 return cacheable_id;
1054}
1055
1056fn constantPtr(cg: *CodeGen, ptr_val: Value) !Id {
1057 const pt = cg.pt;
1058 const gpa = cg.module.gpa;
1059
1060 if (ptr_val.isUndef(pt.zcu)) {
1061 const result_ty = ptr_val.typeOf(pt.zcu);
1062 const result_ty_id = try cg.resolveType(result_ty, .direct);
1063 return cg.module.constUndef(result_ty_id);
1064 }
1065
1066 var arena = std.heap.ArenaAllocator.init(gpa);
1067 defer arena.deinit();
1068
1069 const derivation = try ptr_val.pointerDerivation(arena.allocator(), pt);
1070 return cg.derivePtr(derivation);
1071}
1072
1073fn derivePtr(cg: *CodeGen, derivation: Value.PointerDeriveStep) !Id {
1074 const pt = cg.pt;
1075 const zcu = pt.zcu;
1076 switch (derivation) {
1077 .comptime_alloc_ptr, .comptime_field_ptr => unreachable,
1078 .int => |int| {
1079 const result_ty_id = try cg.resolveType(int.ptr_ty, .direct);
1080 // TODO: This can probably be an OpSpecConstantOp Bitcast, but
1081 // that is not implemented by Mesa yet. Therefore, just generate it
1082 // as a runtime operation.
1083 const result_ptr_id = cg.module.allocId();
1084 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
1085 .id_result_type = result_ty_id,
1086 .id_result = result_ptr_id,
1087 .integer_value = try cg.constant(.usize, try pt.intValue(.usize, int.addr), .direct),
1088 });
1089 return result_ptr_id;
1090 },
1091 .nav_ptr => |nav| {
1092 const result_ptr_ty = try pt.navPtrType(nav);
1093 return cg.constantNavRef(result_ptr_ty, nav);
1094 },
1095 .uav_ptr => |uav| {
1096 const result_ptr_ty: Type = .fromInterned(uav.orig_ty);
1097 return cg.constantUavRef(result_ptr_ty, uav);
1098 },
1099 .eu_payload_ptr => @panic("TODO"),
1100 .opt_payload_ptr => @panic("TODO"),
1101 .field_ptr => |field| {
1102 const parent_ptr_id = try cg.derivePtr(field.parent.*);
1103 const parent_ptr_ty = try field.parent.ptrType(pt);
1104 return cg.structFieldPtr(field.result_ptr_ty, parent_ptr_ty, parent_ptr_id, field.field_idx);
1105 },
1106 .elem_ptr => |elem| {
1107 const parent_ptr_id = try cg.derivePtr(elem.parent.*);
1108 const parent_ptr_ty = try elem.parent.ptrType(pt);
1109 const index_id = try cg.constInt(.usize, elem.elem_idx);
1110 return cg.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id);
1111 },
1112 .offset_and_cast => |oac| {
1113 const parent_ptr_id = try cg.derivePtr(oac.parent.*);
1114 const parent_ptr_ty = try oac.parent.ptrType(pt);
1115 const result_ty_id = try cg.resolveType(oac.new_ptr_ty, .direct);
1116 const child_size = oac.new_ptr_ty.childType(zcu).abiSize(zcu);
1117
1118 if (parent_ptr_ty.childType(zcu).isVector(zcu) and oac.byte_offset % child_size == 0) {
1119 // Vector element ptr accesses are derived as offset_and_cast.
1120 // We can just use OpAccessChain.
1121 return cg.accessChain(
1122 result_ty_id,
1123 parent_ptr_id,
1124 &.{@intCast(@divExact(oac.byte_offset, child_size))},
1125 );
1126 }
1127
1128 if (oac.byte_offset == 0) {
1129 // Allow changing the pointer type child only to restructure arrays.
1130 // e.g. [3][2]T to T is fine, as is [2]T -> [2][1]T.
1131 const result_ptr_id = cg.module.allocId();
1132 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1133 .id_result_type = result_ty_id,
1134 .id_result = result_ptr_id,
1135 .operand = parent_ptr_id,
1136 });
1137 return result_ptr_id;
1138 }
1139
1140 return cg.fail("cannot perform pointer cast: '{f}' to '{f}'", .{
1141 parent_ptr_ty.fmt(pt),
1142 oac.new_ptr_ty.fmt(pt),
1143 });
1144 },
1145 }
1146}
1147
1148fn constantUavRef(
1149 cg: *CodeGen,
1150 ty: Type,
1151 uav: InternPool.Key.Ptr.BaseAddr.Uav,
1152) !Id {
1153 // TODO: Merge this function with constantDeclRef.
1154
1155 const pt = cg.pt;
1156 const zcu = pt.zcu;
1157 const ip = &zcu.intern_pool;
1158 const ty_id = try cg.resolveType(ty, .direct);
1159 const uav_ty: Type = .fromInterned(ip.typeOf(uav.val));
1160
1161 switch (ip.indexToKey(uav.val)) {
1162 .func => unreachable, // TODO
1163 .@"extern" => assert(!ip.isFunctionType(uav_ty.toIntern())),
1164 else => {},
1165 }
1166
1167 // const is_fn_body = decl_ty.zigTypeTag(zcu) == .@"fn";
1168 if (!uav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1169 // Pointer to nothing - return undefined
1170 return cg.module.constUndef(ty_id);
1171 }
1172
1173 // Uav refs are always generic.
1174 assert(ty.ptrAddressSpace(zcu) == .generic);
1175 const decl_ptr_ty_id = try cg.ptrType(uav_ty, .generic, .indirect);
1176 const ptr_id = try cg.resolveUav(uav.val);
1177
1178 if (decl_ptr_ty_id != ty_id) {
1179 // Differing pointer types, insert a cast.
1180 const casted_ptr_id = cg.module.allocId();
1181 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1182 .id_result_type = ty_id,
1183 .id_result = casted_ptr_id,
1184 .operand = ptr_id,
1185 });
1186 return casted_ptr_id;
1187 } else {
1188 return ptr_id;
1189 }
1190}
1191
1192fn constantNavRef(cg: *CodeGen, ty: Type, nav_index: InternPool.Nav.Index) !Id {
1193 const pt = cg.pt;
1194 const zcu = pt.zcu;
1195 const ip = &zcu.intern_pool;
1196 const ty_id = try cg.resolveType(ty, .direct);
1197 const nav = ip.getNav(nav_index);
1198 const nav_ty: Type = .fromInterned(nav.typeOf(ip));
1199
1200 switch (nav.status) {
1201 .unresolved => unreachable,
1202 .type_resolved => {}, // this is not a function or extern
1203 .fully_resolved => |r| switch (ip.indexToKey(r.val)) {
1204 .func => {
1205 // TODO: Properly lower function pointers. For now we are going to hack around it and
1206 // just generate an empty pointer. Function pointers are represented by a pointer to usize.
1207 return try cg.module.constUndef(ty_id);
1208 },
1209 .@"extern" => if (ip.isFunctionType(nav_ty.toIntern())) @panic("TODO"),
1210 else => {},
1211 },
1212 }
1213
1214 if (!nav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1215 // Pointer to nothing - return undefined.
1216 return cg.module.constUndef(ty_id);
1217 }
1218
1219 const spv_decl_index = try cg.module.resolveNav(ip, nav_index);
1220 const spv_decl = cg.module.declPtr(spv_decl_index);
1221
1222 const decl_id = switch (spv_decl.kind) {
1223 .func => unreachable, // TODO: Is this possible?
1224 .global, .invocation_global => spv_decl.result_id,
1225 };
1226
1227 const storage_class = cg.module.storageClass(nav.getAddrspace());
1228 try cg.addFunctionDep(spv_decl_index, storage_class);
1229
1230 const decl_ptr_ty_id = try cg.ptrType(nav_ty, storage_class, .indirect);
1231
1232 const ptr_id = switch (storage_class) {
1233 .generic => try cg.castToGeneric(decl_ptr_ty_id, decl_id),
1234 else => decl_id,
1235 };
1236
1237 if (decl_ptr_ty_id != ty_id) {
1238 // Differing pointer types, insert a cast.
1239 const casted_ptr_id = cg.module.allocId();
1240 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
1241 .id_result_type = ty_id,
1242 .id_result = casted_ptr_id,
1243 .operand = ptr_id,
1244 });
1245 return casted_ptr_id;
1246 } else {
1247 return ptr_id;
1248 }
1249}
1250
1251// Turn a Zig type's name into a cache reference.
1252fn resolveTypeName(cg: *CodeGen, ty: Type) ![]const u8 {
1253 const gpa = cg.module.gpa;
1254 var aw: std.io.Writer.Allocating = .init(gpa);
1255 defer aw.deinit();
1256 ty.print(&aw.writer, cg.pt) catch |err| switch (err) {
1257 error.WriteFailed => return error.OutOfMemory,
1258 };
1259 return try aw.toOwnedSlice();
1260}
1261
1262/// Create an integer type suitable for storing at least 'bits' bits.
1263/// The integer type that is returned by this function is the type that is used to perform
1264/// actual operations (as well as store) a Zig type of a particular number of bits. To create
1265/// a type with an exact size, use Module.intType.
1266fn intType(cg: *CodeGen, signedness: std.builtin.Signedness, bits: u16) !Id {
1267 const backing_bits, const big_int = cg.backingIntBits(bits);
1268 if (big_int) {
1269 if (backing_bits > 64) {
1270 return cg.fail("composite integers larger than 64bit aren't supported", .{});
1271 }
1272 const int_ty = try cg.resolveType(.u32, .direct);
1273 return cg.arrayType(backing_bits / big_int_bits, int_ty);
1274 }
1275
1276 return switch (cg.module.target.os.tag) {
1277 // Kernel only supports unsigned ints.
1278 .opencl, .amdhsa => return cg.module.intType(.unsigned, backing_bits),
1279 else => cg.module.intType(signedness, backing_bits),
1280 };
1281}
1282
1283fn arrayType(cg: *CodeGen, len: u32, child_ty: Id) !Id {
1284 const len_id = try cg.constInt(.u32, len);
1285 return cg.module.arrayType(len_id, child_ty);
1286}
1287
1288fn ptrType(cg: *CodeGen, child_ty: Type, storage_class: StorageClass, child_repr: Repr) !Id {
1289 const gpa = cg.module.gpa;
1290 const zcu = cg.pt.zcu;
1291 const ip = &zcu.intern_pool;
1292 const key = .{ child_ty.toIntern(), storage_class, child_repr };
1293 const entry = try cg.module.ptr_types.getOrPut(gpa, key);
1294 if (entry.found_existing) {
1295 const fwd_id = entry.value_ptr.ty_id;
1296 if (!entry.value_ptr.fwd_emitted) {
1297 try cg.module.sections.globals.emit(cg.module.gpa, .OpTypeForwardPointer, .{
1298 .pointer_type = fwd_id,
1299 .storage_class = storage_class,
1300 });
1301 entry.value_ptr.fwd_emitted = true;
1302 }
1303 return fwd_id;
1304 }
1305
1306 const result_id = cg.module.allocId();
1307 entry.value_ptr.* = .{
1308 .ty_id = result_id,
1309 .fwd_emitted = false,
1310 };
1311
1312 const child_ty_id = try cg.resolveType(child_ty, child_repr);
1313
1314 switch (cg.module.target.os.tag) {
1315 .vulkan, .opengl => {
1316 if (child_ty.zigTypeTag(zcu) == .@"struct") {
1317 switch (storage_class) {
1318 .uniform, .push_constant => try cg.module.decorate(child_ty_id, .block),
1319 else => {},
1320 }
1321 }
1322
1323 switch (ip.indexToKey(child_ty.toIntern())) {
1324 .func_type, .opaque_type => {},
1325 else => {
1326 try cg.module.decorate(result_id, .{ .array_stride = .{ .array_stride = @intCast(child_ty.abiSize(zcu)) } });
1327 },
1328 }
1329 },
1330 else => {},
1331 }
1332
1333 try cg.module.sections.globals.emit(cg.module.gpa, .OpTypePointer, .{
1334 .id_result = result_id,
1335 .storage_class = storage_class,
1336 .type = child_ty_id,
1337 });
1338
1339 cg.module.ptr_types.getPtr(key).?.fwd_emitted = true;
1340
1341 return result_id;
1342}
1343
1344fn functionType(cg: *CodeGen, return_ty: Type, param_types: []const Type) !Id {
1345 const gpa = cg.module.gpa;
1346 const return_ty_id = try cg.resolveFnReturnType(return_ty);
1347 const param_ids = try gpa.alloc(Id, param_types.len);
1348 defer gpa.free(param_ids);
1349
1350 for (param_types, param_ids) |param_ty, *param_id| {
1351 param_id.* = try cg.resolveType(param_ty, .direct);
1352 }
1353
1354 return cg.module.functionType(return_ty_id, param_ids);
1355}
1356
1357/// Generate a union type. Union types are always generated with the
1358/// most aligned field active. If the tag alignment is greater
1359/// than that of the payload, a regular union (non-packed, with both tag and
1360/// payload), will be generated as follows:
1361/// struct {
1362/// tag: TagType,
1363/// payload: MostAlignedFieldType,
1364/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1365/// padding: [padding_size]u8,
1366/// }
1367/// If the payload alignment is greater than that of the tag:
1368/// struct {
1369/// payload: MostAlignedFieldType,
1370/// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1371/// tag: TagType,
1372/// padding: [padding_size]u8,
1373/// }
1374/// If any of the fields' size is 0, it will be omitted.
1375fn resolveUnionType(cg: *CodeGen, ty: Type) !Id {
1376 const gpa = cg.module.gpa;
1377 const zcu = cg.pt.zcu;
1378 const ip = &zcu.intern_pool;
1379 const union_obj = zcu.typeToUnion(ty).?;
1380
1381 if (union_obj.flagsUnordered(ip).layout == .@"packed") {
1382 return try cg.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1383 }
1384
1385 const layout = cg.unionLayout(ty);
1386 if (!layout.has_payload) {
1387 // No payload, so represent this as just the tag type.
1388 return try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1389 }
1390
1391 var member_types: [4]Id = undefined;
1392 var member_names: [4][]const u8 = undefined;
1393
1394 const u8_ty_id = try cg.resolveType(.u8, .direct);
1395
1396 if (layout.tag_size != 0) {
1397 const tag_ty_id = try cg.resolveType(.fromInterned(union_obj.enum_tag_ty), .indirect);
1398 member_types[layout.tag_index] = tag_ty_id;
1399 member_names[layout.tag_index] = "(tag)";
1400 }
1401
1402 if (layout.payload_size != 0) {
1403 const payload_ty_id = try cg.resolveType(layout.payload_ty, .indirect);
1404 member_types[layout.payload_index] = payload_ty_id;
1405 member_names[layout.payload_index] = "(payload)";
1406 }
1407
1408 if (layout.payload_padding_size != 0) {
1409 const payload_padding_ty_id = try cg.arrayType(@intCast(layout.payload_padding_size), u8_ty_id);
1410 member_types[layout.payload_padding_index] = payload_padding_ty_id;
1411 member_names[layout.payload_padding_index] = "(payload padding)";
1412 }
1413
1414 if (layout.padding_size != 0) {
1415 const padding_ty_id = try cg.arrayType(@intCast(layout.padding_size), u8_ty_id);
1416 member_types[layout.padding_index] = padding_ty_id;
1417 member_names[layout.padding_index] = "(padding)";
1418 }
1419
1420 const result_id = cg.module.allocId();
1421 try cg.module.structType(result_id, member_types[0..layout.total_fields], member_names[0..layout.total_fields]);
1422
1423 const type_name = try cg.resolveTypeName(ty);
1424 defer gpa.free(type_name);
1425 try cg.module.debugName(result_id, type_name);
1426
1427 return result_id;
1428}
1429
1430fn resolveFnReturnType(cg: *CodeGen, ret_ty: Type) !Id {
1431 const zcu = cg.pt.zcu;
1432 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1433 // If the return type is an error set or an error union, then we make this
1434 // anyerror return type instead, so that it can be coerced into a function
1435 // pointer type which has anyerror as the return type.
1436 if (ret_ty.isError(zcu)) {
1437 return cg.resolveType(.anyerror, .direct);
1438 } else {
1439 return cg.resolveType(.void, .direct);
1440 }
1441 }
1442
1443 return try cg.resolveType(ret_ty, .direct);
1444}
1445
1446/// Turn a Zig type into a SPIR-V Type, and return a reference to it.
1447fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) !Id {
1448 const gpa = cg.module.gpa;
1449
1450 if (cg.module.intern_map.get(.{ ty.toIntern(), repr })) |id| {
1451 return id;
1452 }
1453
1454 const id = try cg.resolveTypeInner(ty, repr);
1455 try cg.module.intern_map.put(gpa, .{ ty.toIntern(), repr }, id);
1456 return id;
1457}
1458
1459fn resolveTypeInner(cg: *CodeGen, ty: Type, repr: Repr) Error!Id {
1460 const gpa = cg.module.gpa;
1461 const pt = cg.pt;
1462 const zcu = pt.zcu;
1463 const ip = &zcu.intern_pool;
1464 log.debug("resolveType: ty = {f}", .{ty.fmt(pt)});
1465 const target = cg.module.target;
1466
1467 const section = &cg.module.sections.globals;
1468
1469 switch (ty.zigTypeTag(zcu)) {
1470 .noreturn => {
1471 assert(repr == .direct);
1472 return try cg.module.voidType();
1473 },
1474 .void => switch (repr) {
1475 .direct => {
1476 return try cg.module.voidType();
1477 },
1478 // Pointers to void
1479 .indirect => {
1480 const result_id = cg.module.allocId();
1481 try section.emit(cg.module.gpa, .OpTypeOpaque, .{
1482 .id_result = result_id,
1483 .literal_string = "void",
1484 });
1485 return result_id;
1486 },
1487 },
1488 .bool => switch (repr) {
1489 .direct => return try cg.module.boolType(),
1490 .indirect => return try cg.resolveType(.u1, .indirect),
1491 },
1492 .int => {
1493 const int_info = ty.intInfo(zcu);
1494 if (int_info.bits == 0) {
1495 // Some times, the backend will be asked to generate a pointer to i0. OpTypeInt
1496 // with 0 bits is invalid, so return an opaque type in this case.
1497 assert(repr == .indirect);
1498 const result_id = cg.module.allocId();
1499 try section.emit(cg.module.gpa, .OpTypeOpaque, .{
1500 .id_result = result_id,
1501 .literal_string = "u0",
1502 });
1503 return result_id;
1504 }
1505 return try cg.intType(int_info.signedness, int_info.bits);
1506 },
1507 .@"enum" => {
1508 const tag_ty = ty.intTagType(zcu);
1509 return try cg.resolveType(tag_ty, repr);
1510 },
1511 .float => {
1512 // We can (and want) not really emulate floating points with other floating point types like with the integer types,
1513 // so if the float is not supported, just return an error.
1514 const bits = ty.floatBits(target);
1515 const supported = switch (bits) {
1516 16 => cg.module.target.cpu.has(.spirv, .float16),
1517 // 32-bit floats are always supported (see spec, 2.16.1, Data rules).
1518 32 => true,
1519 64 => cg.module.target.cpu.has(.spirv, .float64),
1520 else => false,
1521 };
1522
1523 if (!supported) {
1524 return cg.fail("Floating point width of {} bits is not supported for the current SPIR-V feature set", .{bits});
1525 }
1526
1527 return try cg.module.floatType(bits);
1528 },
1529 .array => {
1530 const elem_ty = ty.childType(zcu);
1531 const elem_ty_id = try cg.resolveType(elem_ty, .indirect);
1532 const total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(zcu)) orelse {
1533 return cg.fail("array type of {} elements is too large", .{ty.arrayLenIncludingSentinel(zcu)});
1534 };
1535
1536 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1537 // The size of the array would be 0, but that is not allowed in SPIR-V.
1538 // This path can be reached when the backend is asked to generate a pointer to
1539 // an array of some zero-bit type. This should always be an indirect path.
1540 assert(repr == .indirect);
1541
1542 // We cannot use the child type here, so just use an opaque type.
1543 const result_id = cg.module.allocId();
1544 try section.emit(cg.module.gpa, .OpTypeOpaque, .{
1545 .id_result = result_id,
1546 .literal_string = "zero-sized array",
1547 });
1548 return result_id;
1549 } else if (total_len == 0) {
1550 // The size of the array would be 0, but that is not allowed in SPIR-V.
1551 // This path can be reached for example when there is a slicing of a pointer
1552 // that produces a zero-length array. In all cases where this type can be generated,
1553 // this should be an indirect path.
1554 assert(repr == .indirect);
1555
1556 // In this case, we have an array of a non-zero sized type. In this case,
1557 // generate an array of 1 element instead, so that ptr_elem_ptr instructions
1558 // can be lowered to ptrAccessChain instead of manually performing the math.
1559 return try cg.arrayType(1, elem_ty_id);
1560 } else {
1561 const result_id = try cg.arrayType(total_len, elem_ty_id);
1562 switch (cg.module.target.os.tag) {
1563 .vulkan, .opengl => {
1564 try cg.module.decorate(result_id, .{ .array_stride = .{
1565 .array_stride = @intCast(elem_ty.abiSize(zcu)),
1566 } });
1567 },
1568 else => {},
1569 }
1570 return result_id;
1571 }
1572 },
1573 .vector => {
1574 const elem_ty = ty.childType(zcu);
1575 const elem_ty_id = try cg.resolveType(elem_ty, repr);
1576 const len = ty.vectorLen(zcu);
1577
1578 if (cg.isSpvVector(ty)) {
1579 return try cg.module.vectorType(len, elem_ty_id);
1580 } else {
1581 return try cg.arrayType(len, elem_ty_id);
1582 }
1583 },
1584 .@"fn" => switch (repr) {
1585 .direct => {
1586 const fn_info = zcu.typeToFunc(ty).?;
1587
1588 comptime assert(zig_call_abi_ver == 3);
1589 switch (fn_info.cc) {
1590 .auto,
1591 .spirv_kernel,
1592 .spirv_fragment,
1593 .spirv_vertex,
1594 .spirv_device,
1595 => {},
1596 else => unreachable,
1597 }
1598
1599 // Guaranteed by callConvSupportsVarArgs, there are no SPIR-V CCs which support
1600 // varargs.
1601 assert(!fn_info.is_var_args);
1602
1603 // Note: Logic is different from functionType().
1604 const param_ty_ids = try gpa.alloc(Id, fn_info.param_types.len);
1605 defer gpa.free(param_ty_ids);
1606 var param_index: usize = 0;
1607 for (fn_info.param_types.get(ip)) |param_ty_index| {
1608 const param_ty: Type = .fromInterned(param_ty_index);
1609 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1610
1611 param_ty_ids[param_index] = try cg.resolveType(param_ty, .direct);
1612 param_index += 1;
1613 }
1614
1615 const return_ty_id = try cg.resolveFnReturnType(.fromInterned(fn_info.return_type));
1616
1617 const result_id = cg.module.allocId();
1618 try section.emit(cg.module.gpa, .OpTypeFunction, .{
1619 .id_result = result_id,
1620 .return_type = return_ty_id,
1621 .id_ref_2 = param_ty_ids[0..param_index],
1622 });
1623
1624 return result_id;
1625 },
1626 .indirect => {
1627 // TODO: Represent function pointers properly.
1628 // For now, just use an usize type.
1629 return try cg.resolveType(.usize, .indirect);
1630 },
1631 },
1632 .pointer => {
1633 const ptr_info = ty.ptrInfo(zcu);
1634
1635 const child_ty: Type = .fromInterned(ptr_info.child);
1636 const storage_class = cg.module.storageClass(ptr_info.flags.address_space);
1637 const ptr_ty_id = try cg.ptrType(child_ty, storage_class, .indirect);
1638
1639 if (ptr_info.flags.size != .slice) {
1640 return ptr_ty_id;
1641 }
1642
1643 const size_ty_id = try cg.resolveType(.usize, .direct);
1644 const result_id = cg.module.allocId();
1645 try cg.module.structType(
1646 result_id,
1647 &.{ ptr_ty_id, size_ty_id },
1648 &.{ "ptr", "len" },
1649 );
1650 return result_id;
1651 },
1652 .@"struct" => {
1653 const struct_type = switch (ip.indexToKey(ty.toIntern())) {
1654 .tuple_type => |tuple| {
1655 const member_types = try gpa.alloc(Id, tuple.values.len);
1656 defer gpa.free(member_types);
1657
1658 var member_index: usize = 0;
1659 for (tuple.types.get(ip), tuple.values.get(ip)) |field_ty, field_val| {
1660 if (field_val != .none or !Type.fromInterned(field_ty).hasRuntimeBits(zcu)) continue;
1661
1662 member_types[member_index] = try cg.resolveType(.fromInterned(field_ty), .indirect);
1663 member_index += 1;
1664 }
1665
1666 const result_id = cg.module.allocId();
1667 try cg.module.structType(result_id, member_types[0..member_index], null);
1668
1669 const type_name = try cg.resolveTypeName(ty);
1670 defer gpa.free(type_name);
1671 try cg.module.debugName(result_id, type_name);
1672
1673 return result_id;
1674 },
1675 .struct_type => ip.loadStructType(ty.toIntern()),
1676 else => unreachable,
1677 };
1678
1679 if (struct_type.layout == .@"packed") {
1680 return try cg.resolveType(.fromInterned(struct_type.backingIntTypeUnordered(ip)), .direct);
1681 }
1682
1683 var member_types = std.ArrayList(Id).init(gpa);
1684 defer member_types.deinit();
1685
1686 var member_names = std.ArrayList([]const u8).init(gpa);
1687 defer member_names.deinit();
1688
1689 var index: u32 = 0;
1690 var it = struct_type.iterateRuntimeOrder(ip);
1691 const result_id = cg.module.allocId();
1692 while (it.next()) |field_index| {
1693 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
1694 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1695 // This is a zero-bit field - we only needed it for the alignment.
1696 continue;
1697 }
1698
1699 switch (cg.module.target.os.tag) {
1700 .vulkan, .opengl => {
1701 try cg.module.decorateMember(result_id, index, .{ .offset = .{
1702 .byte_offset = @intCast(ty.structFieldOffset(field_index, zcu)),
1703 } });
1704 },
1705 else => {},
1706 }
1707
1708 const field_name = struct_type.fieldName(ip, field_index).unwrap() orelse
1709 try ip.getOrPutStringFmt(zcu.gpa, pt.tid, "{d}", .{field_index}, .no_embedded_nulls);
1710 try member_types.append(try cg.resolveType(field_ty, .indirect));
1711 try member_names.append(field_name.toSlice(ip));
1712
1713 index += 1;
1714 }
1715
1716 try cg.module.structType(result_id, member_types.items, member_names.items);
1717
1718 const type_name = try cg.resolveTypeName(ty);
1719 defer gpa.free(type_name);
1720 try cg.module.debugName(result_id, type_name);
1721
1722 return result_id;
1723 },
1724 .optional => {
1725 const payload_ty = ty.optionalChild(zcu);
1726 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1727 // Just use a bool.
1728 // Note: Always generate the bool with indirect format, to save on some sanity
1729 // Perform the conversion to a direct bool when the field is extracted.
1730 return try cg.resolveType(.bool, .indirect);
1731 }
1732
1733 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1734 if (ty.optionalReprIsPayload(zcu)) {
1735 // Optional is actually a pointer or a slice.
1736 return payload_ty_id;
1737 }
1738
1739 const bool_ty_id = try cg.resolveType(.bool, .indirect);
1740
1741 const result_id = cg.module.allocId();
1742 try cg.module.structType(
1743 result_id,
1744 &.{ payload_ty_id, bool_ty_id },
1745 &.{ "payload", "valid" },
1746 );
1747 return result_id;
1748 },
1749 .@"union" => return try cg.resolveUnionType(ty),
1750 .error_set => {
1751 const err_int_ty = try pt.errorIntType();
1752 return try cg.resolveType(err_int_ty, repr);
1753 },
1754 .error_union => {
1755 const payload_ty = ty.errorUnionPayload(zcu);
1756 const error_ty_id = try cg.resolveType(.anyerror, .indirect);
1757
1758 const eu_layout = cg.errorUnionLayout(payload_ty);
1759 if (!eu_layout.payload_has_bits) {
1760 return error_ty_id;
1761 }
1762
1763 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
1764
1765 var member_types: [2]Id = undefined;
1766 var member_names: [2][]const u8 = undefined;
1767 if (eu_layout.error_first) {
1768 // Put the error first
1769 member_types = .{ error_ty_id, payload_ty_id };
1770 member_names = .{ "error", "payload" };
1771 // TODO: ABI padding?
1772 } else {
1773 // Put the payload first.
1774 member_types = .{ payload_ty_id, error_ty_id };
1775 member_names = .{ "payload", "error" };
1776 // TODO: ABI padding?
1777 }
1778
1779 const result_id = cg.module.allocId();
1780 try cg.module.structType(result_id, &member_types, &member_names);
1781 return result_id;
1782 },
1783 .@"opaque" => {
1784 const type_name = try cg.resolveTypeName(ty);
1785 defer gpa.free(type_name);
1786
1787 const result_id = cg.module.allocId();
1788 try section.emit(cg.module.gpa, .OpTypeOpaque, .{
1789 .id_result = result_id,
1790 .literal_string = type_name,
1791 });
1792 return result_id;
1793 },
1794
1795 .null,
1796 .undefined,
1797 .enum_literal,
1798 .comptime_float,
1799 .comptime_int,
1800 .type,
1801 => unreachable, // Must be comptime.
1802
1803 .frame, .@"anyframe" => unreachable, // TODO
1804 }
1805}
1806
1807const ErrorUnionLayout = struct {
1808 payload_has_bits: bool,
1809 error_first: bool,
1810
1811 fn errorFieldIndex(cg: @This()) u32 {
1812 assert(cg.payload_has_bits);
1813 return if (cg.error_first) 0 else 1;
1814 }
1815
1816 fn payloadFieldIndex(cg: @This()) u32 {
1817 assert(cg.payload_has_bits);
1818 return if (cg.error_first) 1 else 0;
1819 }
1820};
1821
1822fn errorUnionLayout(cg: *CodeGen, payload_ty: Type) ErrorUnionLayout {
1823 const pt = cg.pt;
1824 const zcu = pt.zcu;
1825
1826 const error_align = Type.abiAlignment(.anyerror, zcu);
1827 const payload_align = payload_ty.abiAlignment(zcu);
1828
1829 const error_first = error_align.compare(.gt, payload_align);
1830 return .{
1831 .payload_has_bits = payload_ty.hasRuntimeBitsIgnoreComptime(zcu),
1832 .error_first = error_first,
1833 };
1834}
1835
1836const UnionLayout = struct {
1837 /// If false, this union is represented
1838 /// by only an integer of the tag type.
1839 has_payload: bool,
1840 tag_size: u32,
1841 tag_index: u32,
1842 /// Note: This is the size of the payload type itcg, NOT the size of the ENTIRE payload.
1843 /// Use `has_payload` instead!!
1844 payload_ty: Type,
1845 payload_size: u32,
1846 payload_index: u32,
1847 payload_padding_size: u32,
1848 payload_padding_index: u32,
1849 padding_size: u32,
1850 padding_index: u32,
1851 total_fields: u32,
1852};
1853
1854fn unionLayout(cg: *CodeGen, ty: Type) UnionLayout {
1855 const pt = cg.pt;
1856 const zcu = pt.zcu;
1857 const ip = &zcu.intern_pool;
1858 const layout = ty.unionGetLayout(zcu);
1859 const union_obj = zcu.typeToUnion(ty).?;
1860
1861 var union_layout: UnionLayout = .{
1862 .has_payload = layout.payload_size != 0,
1863 .tag_size = @intCast(layout.tag_size),
1864 .tag_index = undefined,
1865 .payload_ty = undefined,
1866 .payload_size = undefined,
1867 .payload_index = undefined,
1868 .payload_padding_size = undefined,
1869 .payload_padding_index = undefined,
1870 .padding_size = @intCast(layout.padding),
1871 .padding_index = undefined,
1872 .total_fields = undefined,
1873 };
1874
1875 if (union_layout.has_payload) {
1876 const most_aligned_field = layout.most_aligned_field;
1877 const most_aligned_field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[most_aligned_field]);
1878 union_layout.payload_ty = most_aligned_field_ty;
1879 union_layout.payload_size = @intCast(most_aligned_field_ty.abiSize(zcu));
1880 } else {
1881 union_layout.payload_size = 0;
1882 }
1883
1884 union_layout.payload_padding_size = @intCast(layout.payload_size - union_layout.payload_size);
1885
1886 const tag_first = layout.tag_align.compare(.gte, layout.payload_align);
1887 var field_index: u32 = 0;
1888
1889 if (union_layout.tag_size != 0 and tag_first) {
1890 union_layout.tag_index = field_index;
1891 field_index += 1;
1892 }
1893
1894 if (union_layout.payload_size != 0) {
1895 union_layout.payload_index = field_index;
1896 field_index += 1;
1897 }
1898
1899 if (union_layout.payload_padding_size != 0) {
1900 union_layout.payload_padding_index = field_index;
1901 field_index += 1;
1902 }
1903
1904 if (union_layout.tag_size != 0 and !tag_first) {
1905 union_layout.tag_index = field_index;
1906 field_index += 1;
1907 }
1908
1909 if (union_layout.padding_size != 0) {
1910 union_layout.padding_index = field_index;
1911 field_index += 1;
1912 }
1913
1914 union_layout.total_fields = field_index;
1915
1916 return union_layout;
1917}
1918
1919/// This structure represents a "temporary" value: Something we are currently
1920/// operating on. It typically lives no longer than the function that
1921/// implements a particular AIR operation. These are used to easier
1922/// implement vectorizable operations (see Vectorization and the build*
1923/// functions), and typically are only used for vectors of primitive types.
1924const Temporary = struct {
1925 /// The type of the temporary. This is here mainly
1926 /// for easier bookkeeping. Because we will never really
1927 /// store Temporaries, they only cause extra stack space,
1928 /// therefore no real storage is wasted.
1929 ty: Type,
1930 /// The value that this temporary holds. This is not necessarily
1931 /// a value that is actually usable, or a single value: It is virtual
1932 /// until materialize() is called, at which point is turned into
1933 /// the usual SPIR-V representation of `cg.ty`.
1934 value: Temporary.Value,
1935
1936 const Value = union(enum) {
1937 singleton: Id,
1938 exploded_vector: IdRange,
1939 };
1940
1941 fn init(ty: Type, singleton: Id) Temporary {
1942 return .{ .ty = ty, .value = .{ .singleton = singleton } };
1943 }
1944
1945 fn materialize(temp: Temporary, cg: *CodeGen) !Id {
1946 const gpa = cg.module.gpa;
1947 const zcu = cg.pt.zcu;
1948 switch (temp.value) {
1949 .singleton => |id| return id,
1950 .exploded_vector => |range| {
1951 assert(temp.ty.isVector(zcu));
1952 assert(temp.ty.vectorLen(zcu) == range.len);
1953 const constituents = try gpa.alloc(Id, range.len);
1954 defer gpa.free(constituents);
1955 for (constituents, 0..range.len) |*id, i| {
1956 id.* = range.at(i);
1957 }
1958 const result_ty_id = try cg.resolveType(temp.ty, .direct);
1959 return cg.constructComposite(result_ty_id, constituents);
1960 },
1961 }
1962 }
1963
1964 fn vectorization(temp: Temporary, cg: *CodeGen) Vectorization {
1965 return .fromType(temp.ty, cg);
1966 }
1967
1968 fn pun(temp: Temporary, new_ty: Type) Temporary {
1969 return .{
1970 .ty = new_ty,
1971 .value = temp.value,
1972 };
1973 }
1974
1975 /// 'Explode' a temporary into separate elements. This turns a vector
1976 /// into a bag of elements.
1977 fn explode(temp: Temporary, cg: *CodeGen) !IdRange {
1978 const zcu = cg.pt.zcu;
1979
1980 // If the value is a scalar, then this is a no-op.
1981 if (!temp.ty.isVector(zcu)) {
1982 return switch (temp.value) {
1983 .singleton => |id| .{ .base = @intFromEnum(id), .len = 1 },
1984 .exploded_vector => |range| range,
1985 };
1986 }
1987
1988 const ty_id = try cg.resolveType(temp.ty.scalarType(zcu), .direct);
1989 const n = temp.ty.vectorLen(zcu);
1990 const results = cg.module.allocIds(n);
1991
1992 const id = switch (temp.value) {
1993 .singleton => |id| id,
1994 .exploded_vector => |range| return range,
1995 };
1996
1997 for (0..n) |i| {
1998 const indexes = [_]u32{@intCast(i)};
1999 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2000 .id_result_type = ty_id,
2001 .id_result = results.at(i),
2002 .composite = id,
2003 .indexes = &indexes,
2004 });
2005 }
2006
2007 return results;
2008 }
2009};
2010
2011/// Initialize a `Temporary` from an AIR value.
2012fn temporary(cg: *CodeGen, inst: Air.Inst.Ref) !Temporary {
2013 return .{
2014 .ty = cg.typeOf(inst),
2015 .value = .{ .singleton = try cg.resolve(inst) },
2016 };
2017}
2018
2019/// This union describes how a particular operation should be vectorized.
2020/// That depends on the operation and number of components of the inputs.
2021const Vectorization = union(enum) {
2022 /// This is an operation between scalars.
2023 scalar,
2024 /// This operation is unrolled into separate operations.
2025 /// Inputs may still be SPIR-V vectors, for example,
2026 /// when the operation can't be vectorized in SPIR-V.
2027 /// Value is number of components.
2028 unrolled: u32,
2029
2030 /// Derive a vectorization from a particular type
2031 fn fromType(ty: Type, cg: *CodeGen) Vectorization {
2032 const zcu = cg.pt.zcu;
2033 if (!ty.isVector(zcu)) return .scalar;
2034 return .{ .unrolled = ty.vectorLen(zcu) };
2035 }
2036
2037 /// Given two vectorization methods, compute a "unification": a fallback
2038 /// that works for both, according to the following rules:
2039 /// - Scalars may broadcast
2040 /// - SPIR-V vectorized operations will unroll
2041 /// - Prefer scalar > unrolled
2042 fn unify(a: Vectorization, b: Vectorization) Vectorization {
2043 if (a == .scalar and b == .scalar) return .scalar;
2044 if (a == .unrolled or b == .unrolled) {
2045 if (a == .unrolled and b == .unrolled) assert(a.components() == b.components());
2046 if (a == .unrolled) return .{ .unrolled = a.components() };
2047 return .{ .unrolled = b.components() };
2048 }
2049 unreachable;
2050 }
2051
2052 /// Query the number of components that inputs of this operation have.
2053 /// Note: for broadcasting scalars, this returns the number of elements
2054 /// that the broadcasted vector would have.
2055 fn components(vec: Vectorization) u32 {
2056 return switch (vec) {
2057 .scalar => 1,
2058 .unrolled => |n| n,
2059 };
2060 }
2061
2062 /// Turns `ty` into the result-type of the entire operation.
2063 /// `ty` may be a scalar or vector, it doesn't matter.
2064 fn resultType(vec: Vectorization, cg: *CodeGen, ty: Type) !Type {
2065 const pt = cg.pt;
2066 const scalar_ty = ty.scalarType(pt.zcu);
2067 return switch (vec) {
2068 .scalar => scalar_ty,
2069 .unrolled => |n| try pt.vectorType(.{ .len = n, .child = scalar_ty.toIntern() }),
2070 };
2071 }
2072
2073 /// Before a temporary can be used, some setup may need to be one. This function implements
2074 /// this setup, and returns a new type that holds the relevant information on how to access
2075 /// elements of the input.
2076 fn prepare(vec: Vectorization, cg: *CodeGen, tmp: Temporary) !PreparedOperand {
2077 const pt = cg.pt;
2078 const is_vector = tmp.ty.isVector(pt.zcu);
2079 const value: PreparedOperand.Value = switch (tmp.value) {
2080 .singleton => |id| switch (vec) {
2081 .scalar => blk: {
2082 assert(!is_vector);
2083 break :blk .{ .scalar = id };
2084 },
2085 .unrolled => blk: {
2086 if (is_vector) break :blk .{ .vector_exploded = try tmp.explode(cg) };
2087 break :blk .{ .scalar_broadcast = id };
2088 },
2089 },
2090 .exploded_vector => |range| switch (vec) {
2091 .scalar => unreachable,
2092 .unrolled => |n| blk: {
2093 assert(range.len == n);
2094 break :blk .{ .vector_exploded = range };
2095 },
2096 },
2097 };
2098
2099 return .{
2100 .ty = tmp.ty,
2101 .value = value,
2102 };
2103 }
2104
2105 /// Finalize the results of an operation back into a temporary. `results` is
2106 /// a list of result-ids of the operation.
2107 fn finalize(vec: Vectorization, ty: Type, results: IdRange) Temporary {
2108 assert(vec.components() == results.len);
2109 return .{
2110 .ty = ty,
2111 .value = switch (vec) {
2112 .scalar => .{ .singleton = results.at(0) },
2113 .unrolled => .{ .exploded_vector = results },
2114 },
2115 };
2116 }
2117
2118 /// This struct represents an operand that has gone through some setup, and is
2119 /// ready to be used as part of an operation.
2120 const PreparedOperand = struct {
2121 ty: Type,
2122 value: PreparedOperand.Value,
2123
2124 /// The types of value that a prepared operand can hold internally. Depends
2125 /// on the operation and input value.
2126 const Value = union(enum) {
2127 /// A single scalar value that is used by a scalar operation.
2128 scalar: Id,
2129 /// A single scalar that is broadcasted in an unrolled operation.
2130 scalar_broadcast: Id,
2131 /// A vector represented by a consecutive list of IDs that is used in an unrolled operation.
2132 vector_exploded: IdRange,
2133 };
2134
2135 /// Query the value at a particular index of the operation. Note that
2136 /// the index is *not* the component/lane, but the index of the *operation*.
2137 fn at(op: PreparedOperand, i: usize) Id {
2138 switch (op.value) {
2139 .scalar => |id| {
2140 assert(i == 0);
2141 return id;
2142 },
2143 .scalar_broadcast => |id| return id,
2144 .vector_exploded => |range| return range.at(i),
2145 }
2146 }
2147 };
2148};
2149
2150/// A utility function to compute the vectorization style of
2151/// a list of values. These values may be any of the following:
2152/// - A `Vectorization` instance
2153/// - A Type, in which case the vectorization is computed via `Vectorization.fromType`.
2154/// - A Temporary, in which case the vectorization is computed via `Temporary.vectorization`.
2155fn vectorization(cg: *CodeGen, args: anytype) Vectorization {
2156 var v: Vectorization = undefined;
2157 assert(args.len >= 1);
2158 inline for (args, 0..) |arg, i| {
2159 const iv: Vectorization = switch (@TypeOf(arg)) {
2160 Vectorization => arg,
2161 Type => Vectorization.fromType(arg, cg),
2162 Temporary => arg.vectorization(cg),
2163 else => @compileError("invalid type"),
2164 };
2165 if (i == 0) {
2166 v = iv;
2167 } else {
2168 v = v.unify(iv);
2169 }
2170 }
2171 return v;
2172}
2173
2174/// This function builds an OpSConvert of OpUConvert depending on the
2175/// signedness of the types.
2176fn buildConvert(cg: *CodeGen, dst_ty: Type, src: Temporary) !Temporary {
2177 const zcu = cg.pt.zcu;
2178
2179 const dst_ty_id = try cg.resolveType(dst_ty.scalarType(zcu), .direct);
2180 const src_ty_id = try cg.resolveType(src.ty.scalarType(zcu), .direct);
2181
2182 const v = cg.vectorization(.{ dst_ty, src });
2183 const result_ty = try v.resultType(cg, dst_ty);
2184
2185 // We can directly compare integers, because those type-IDs are cached.
2186 if (dst_ty_id == src_ty_id) {
2187 // Nothing to do, type-pun to the right value.
2188 // Note, Caller guarantees that the types fit (or caller will normalize after),
2189 // so we don't have to normalize here.
2190 // Note, dst_ty may be a scalar type even if we expect a vector, so we have to
2191 // convert to the right type here.
2192 return src.pun(result_ty);
2193 }
2194
2195 const ops = v.components();
2196 const results = cg.module.allocIds(ops);
2197
2198 const op_result_ty = dst_ty.scalarType(zcu);
2199 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2200
2201 const opcode: Opcode = blk: {
2202 if (dst_ty.scalarType(zcu).isAnyFloat()) break :blk .OpFConvert;
2203 if (dst_ty.scalarType(zcu).isSignedInt(zcu)) break :blk .OpSConvert;
2204 break :blk .OpUConvert;
2205 };
2206
2207 const op_src = try v.prepare(cg, src);
2208
2209 for (0..ops) |i| {
2210 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2211 cg.body.writeOperand(spec.Id, op_result_ty_id);
2212 cg.body.writeOperand(Id, results.at(i));
2213 cg.body.writeOperand(Id, op_src.at(i));
2214 }
2215
2216 return v.finalize(result_ty, results);
2217}
2218
2219fn buildFma(cg: *CodeGen, a: Temporary, b: Temporary, c: Temporary) !Temporary {
2220 const zcu = cg.pt.zcu;
2221 const target = cg.module.target;
2222
2223 const v = cg.vectorization(.{ a, b, c });
2224 const ops = v.components();
2225 const results = cg.module.allocIds(ops);
2226
2227 const op_result_ty = a.ty.scalarType(zcu);
2228 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2229 const result_ty = try v.resultType(cg, a.ty);
2230
2231 const op_a = try v.prepare(cg, a);
2232 const op_b = try v.prepare(cg, b);
2233 const op_c = try v.prepare(cg, c);
2234
2235 const set = try cg.importExtendedSet();
2236
2237 // TODO: Put these numbers in some definition
2238 const instruction: u32 = switch (target.os.tag) {
2239 .opencl => 26, // fma
2240 // NOTE: Vulkan's FMA instruction does *NOT* produce the right values!
2241 // its precision guarantees do NOT match zigs and it does NOT match OpenCLs!
2242 // it needs to be emulated!
2243 .vulkan, .opengl => return cg.todo("implement fma operation for {s} os", .{@tagName(target.os.tag)}),
2244 else => unreachable,
2245 };
2246
2247 for (0..ops) |i| {
2248 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2249 .id_result_type = op_result_ty_id,
2250 .id_result = results.at(i),
2251 .set = set,
2252 .instruction = .{ .inst = instruction },
2253 .id_ref_4 = &.{ op_a.at(i), op_b.at(i), op_c.at(i) },
2254 });
2255 }
2256
2257 return v.finalize(result_ty, results);
2258}
2259
2260fn buildSelect(cg: *CodeGen, condition: Temporary, lhs: Temporary, rhs: Temporary) !Temporary {
2261 const zcu = cg.pt.zcu;
2262
2263 const v = cg.vectorization(.{ condition, lhs, rhs });
2264 const ops = v.components();
2265 const results = cg.module.allocIds(ops);
2266
2267 const op_result_ty = lhs.ty.scalarType(zcu);
2268 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2269 const result_ty = try v.resultType(cg, lhs.ty);
2270
2271 assert(condition.ty.scalarType(zcu).zigTypeTag(zcu) == .bool);
2272
2273 const cond = try v.prepare(cg, condition);
2274 const object_1 = try v.prepare(cg, lhs);
2275 const object_2 = try v.prepare(cg, rhs);
2276
2277 for (0..ops) |i| {
2278 try cg.body.emit(cg.module.gpa, .OpSelect, .{
2279 .id_result_type = op_result_ty_id,
2280 .id_result = results.at(i),
2281 .condition = cond.at(i),
2282 .object_1 = object_1.at(i),
2283 .object_2 = object_2.at(i),
2284 });
2285 }
2286
2287 return v.finalize(result_ty, results);
2288}
2289
2290const CmpPredicate = enum {
2291 l_eq,
2292 l_ne,
2293 i_ne,
2294 i_eq,
2295 s_lt,
2296 s_gt,
2297 s_le,
2298 s_ge,
2299 u_lt,
2300 u_gt,
2301 u_le,
2302 u_ge,
2303 f_oeq,
2304 f_une,
2305 f_olt,
2306 f_ole,
2307 f_ogt,
2308 f_oge,
2309};
2310
2311fn buildCmp(cg: *CodeGen, pred: CmpPredicate, lhs: Temporary, rhs: Temporary) !Temporary {
2312 const v = cg.vectorization(.{ lhs, rhs });
2313 const ops = v.components();
2314 const results = cg.module.allocIds(ops);
2315
2316 const op_result_ty: Type = .bool;
2317 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2318 const result_ty = try v.resultType(cg, Type.bool);
2319
2320 const op_lhs = try v.prepare(cg, lhs);
2321 const op_rhs = try v.prepare(cg, rhs);
2322
2323 const opcode: Opcode = switch (pred) {
2324 .l_eq => .OpLogicalEqual,
2325 .l_ne => .OpLogicalNotEqual,
2326 .i_eq => .OpIEqual,
2327 .i_ne => .OpINotEqual,
2328 .s_lt => .OpSLessThan,
2329 .s_gt => .OpSGreaterThan,
2330 .s_le => .OpSLessThanEqual,
2331 .s_ge => .OpSGreaterThanEqual,
2332 .u_lt => .OpULessThan,
2333 .u_gt => .OpUGreaterThan,
2334 .u_le => .OpULessThanEqual,
2335 .u_ge => .OpUGreaterThanEqual,
2336 .f_oeq => .OpFOrdEqual,
2337 .f_une => .OpFUnordNotEqual,
2338 .f_olt => .OpFOrdLessThan,
2339 .f_ole => .OpFOrdLessThanEqual,
2340 .f_ogt => .OpFOrdGreaterThan,
2341 .f_oge => .OpFOrdGreaterThanEqual,
2342 };
2343
2344 for (0..ops) |i| {
2345 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2346 cg.body.writeOperand(spec.Id, op_result_ty_id);
2347 cg.body.writeOperand(Id, results.at(i));
2348 cg.body.writeOperand(Id, op_lhs.at(i));
2349 cg.body.writeOperand(Id, op_rhs.at(i));
2350 }
2351
2352 return v.finalize(result_ty, results);
2353}
2354
2355const UnaryOp = enum {
2356 l_not,
2357 bit_not,
2358 i_neg,
2359 f_neg,
2360 i_abs,
2361 f_abs,
2362 clz,
2363 ctz,
2364 floor,
2365 ceil,
2366 trunc,
2367 round,
2368 sqrt,
2369 sin,
2370 cos,
2371 tan,
2372 exp,
2373 exp2,
2374 log,
2375 log2,
2376 log10,
2377};
2378
2379fn buildUnary(cg: *CodeGen, op: UnaryOp, operand: Temporary) !Temporary {
2380 const zcu = cg.pt.zcu;
2381 const target = cg.module.target;
2382 const v = cg.vectorization(.{operand});
2383 const ops = v.components();
2384 const results = cg.module.allocIds(ops);
2385 const op_result_ty = operand.ty.scalarType(zcu);
2386 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2387 const result_ty = try v.resultType(cg, operand.ty);
2388
2389 const op_operand = try v.prepare(cg, operand);
2390
2391 if (switch (op) {
2392 .l_not => .OpLogicalNot,
2393 .bit_not => .OpNot,
2394 .i_neg => .OpSNegate,
2395 .f_neg => .OpFNegate,
2396 else => @as(?Opcode, null),
2397 }) |opcode| {
2398 for (0..ops) |i| {
2399 try cg.body.emitRaw(cg.module.gpa, opcode, 3);
2400 cg.body.writeOperand(spec.Id, op_result_ty_id);
2401 cg.body.writeOperand(Id, results.at(i));
2402 cg.body.writeOperand(Id, op_operand.at(i));
2403 }
2404 } else {
2405 const set = try cg.importExtendedSet();
2406 const extinst: u32 = switch (target.os.tag) {
2407 .opencl => switch (op) {
2408 .i_abs => 141, // s_abs
2409 .f_abs => 23, // fabs
2410 .clz => 151, // clz
2411 .ctz => 152, // ctz
2412 .floor => 25, // floor
2413 .ceil => 12, // ceil
2414 .trunc => 66, // trunc
2415 .round => 55, // round
2416 .sqrt => 61, // sqrt
2417 .sin => 57, // sin
2418 .cos => 14, // cos
2419 .tan => 62, // tan
2420 .exp => 19, // exp
2421 .exp2 => 20, // exp2
2422 .log => 37, // log
2423 .log2 => 38, // log2
2424 .log10 => 39, // log10
2425 else => unreachable,
2426 },
2427 // Note: We'll need to check these for floating point accuracy
2428 // Vulkan does not put tight requirements on these, for correction
2429 // we might want to emulate them at some point.
2430 .vulkan, .opengl => switch (op) {
2431 .i_abs => 5, // SAbs
2432 .f_abs => 4, // FAbs
2433 .floor => 8, // Floor
2434 .ceil => 9, // Ceil
2435 .trunc => 3, // Trunc
2436 .round => 1, // Round
2437 .clz,
2438 .ctz,
2439 .sqrt,
2440 .sin,
2441 .cos,
2442 .tan,
2443 .exp,
2444 .exp2,
2445 .log,
2446 .log2,
2447 .log10,
2448 => return cg.todo("implement unary operation '{s}' for {s} os", .{ @tagName(op), @tagName(target.os.tag) }),
2449 else => unreachable,
2450 },
2451 else => unreachable,
2452 };
2453
2454 for (0..ops) |i| {
2455 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2456 .id_result_type = op_result_ty_id,
2457 .id_result = results.at(i),
2458 .set = set,
2459 .instruction = .{ .inst = extinst },
2460 .id_ref_4 = &.{op_operand.at(i)},
2461 });
2462 }
2463 }
2464
2465 return v.finalize(result_ty, results);
2466}
2467
2468const BinaryOp = enum {
2469 i_add,
2470 f_add,
2471 i_sub,
2472 f_sub,
2473 i_mul,
2474 f_mul,
2475 s_div,
2476 u_div,
2477 f_div,
2478 s_rem,
2479 f_rem,
2480 s_mod,
2481 u_mod,
2482 f_mod,
2483 srl,
2484 sra,
2485 sll,
2486 bit_and,
2487 bit_or,
2488 bit_xor,
2489 f_max,
2490 s_max,
2491 u_max,
2492 f_min,
2493 s_min,
2494 u_min,
2495 l_and,
2496 l_or,
2497};
2498
2499fn buildBinary(cg: *CodeGen, op: BinaryOp, lhs: Temporary, rhs: Temporary) !Temporary {
2500 const zcu = cg.pt.zcu;
2501 const target = cg.module.target;
2502
2503 const v = cg.vectorization(.{ lhs, rhs });
2504 const ops = v.components();
2505 const results = cg.module.allocIds(ops);
2506
2507 const op_result_ty = lhs.ty.scalarType(zcu);
2508 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2509 const result_ty = try v.resultType(cg, lhs.ty);
2510
2511 const op_lhs = try v.prepare(cg, lhs);
2512 const op_rhs = try v.prepare(cg, rhs);
2513
2514 if (switch (op) {
2515 .i_add => .OpIAdd,
2516 .f_add => .OpFAdd,
2517 .i_sub => .OpISub,
2518 .f_sub => .OpFSub,
2519 .i_mul => .OpIMul,
2520 .f_mul => .OpFMul,
2521 .s_div => .OpSDiv,
2522 .u_div => .OpUDiv,
2523 .f_div => .OpFDiv,
2524 .s_rem => .OpSRem,
2525 .f_rem => .OpFRem,
2526 .s_mod => .OpSMod,
2527 .u_mod => .OpUMod,
2528 .f_mod => .OpFMod,
2529 .srl => .OpShiftRightLogical,
2530 .sra => .OpShiftRightArithmetic,
2531 .sll => .OpShiftLeftLogical,
2532 .bit_and => .OpBitwiseAnd,
2533 .bit_or => .OpBitwiseOr,
2534 .bit_xor => .OpBitwiseXor,
2535 .l_and => .OpLogicalAnd,
2536 .l_or => .OpLogicalOr,
2537 else => @as(?Opcode, null),
2538 }) |opcode| {
2539 for (0..ops) |i| {
2540 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2541 cg.body.writeOperand(spec.Id, op_result_ty_id);
2542 cg.body.writeOperand(Id, results.at(i));
2543 cg.body.writeOperand(Id, op_lhs.at(i));
2544 cg.body.writeOperand(Id, op_rhs.at(i));
2545 }
2546 } else {
2547 const set = try cg.importExtendedSet();
2548
2549 // TODO: Put these numbers in some definition
2550 const extinst: u32 = switch (target.os.tag) {
2551 .opencl => switch (op) {
2552 .f_max => 27, // fmax
2553 .s_max => 156, // s_max
2554 .u_max => 157, // u_max
2555 .f_min => 28, // fmin
2556 .s_min => 158, // s_min
2557 .u_min => 159, // u_min
2558 else => unreachable,
2559 },
2560 .vulkan, .opengl => switch (op) {
2561 .f_max => 40, // FMax
2562 .s_max => 42, // SMax
2563 .u_max => 41, // UMax
2564 .f_min => 37, // FMin
2565 .s_min => 39, // SMin
2566 .u_min => 38, // UMin
2567 else => unreachable,
2568 },
2569 else => unreachable,
2570 };
2571
2572 for (0..ops) |i| {
2573 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2574 .id_result_type = op_result_ty_id,
2575 .id_result = results.at(i),
2576 .set = set,
2577 .instruction = .{ .inst = extinst },
2578 .id_ref_4 = &.{ op_lhs.at(i), op_rhs.at(i) },
2579 });
2580 }
2581 }
2582
2583 return v.finalize(result_ty, results);
2584}
2585
2586/// This function builds an extended multiplication, either OpSMulExtended or OpUMulExtended on Vulkan,
2587/// or OpIMul and s_mul_hi or u_mul_hi on OpenCL.
2588fn buildWideMul(
2589 cg: *CodeGen,
2590 op: enum {
2591 s_mul_extended,
2592 u_mul_extended,
2593 },
2594 lhs: Temporary,
2595 rhs: Temporary,
2596) !struct { Temporary, Temporary } {
2597 const pt = cg.pt;
2598 const zcu = pt.zcu;
2599 const target = cg.module.target;
2600 const ip = &zcu.intern_pool;
2601
2602 const v = lhs.vectorization(cg).unify(rhs.vectorization(cg));
2603 const ops = v.components();
2604
2605 const arith_op_ty = lhs.ty.scalarType(zcu);
2606 const arith_op_ty_id = try cg.resolveType(arith_op_ty, .direct);
2607
2608 const lhs_op = try v.prepare(cg, lhs);
2609 const rhs_op = try v.prepare(cg, rhs);
2610
2611 const value_results = cg.module.allocIds(ops);
2612 const overflow_results = cg.module.allocIds(ops);
2613
2614 switch (target.os.tag) {
2615 .opencl => {
2616 // Currently, SPIRV-LLVM-Translator based backends cannot deal with OpSMulExtended and
2617 // OpUMulExtended. For these we will use the OpenCL s_mul_hi to compute the high-order bits
2618 // instead.
2619 const set = try cg.importExtendedSet();
2620 const overflow_inst: u32 = switch (op) {
2621 .s_mul_extended => 160, // s_mul_hi
2622 .u_mul_extended => 203, // u_mul_hi
2623 };
2624
2625 for (0..ops) |i| {
2626 try cg.body.emit(cg.module.gpa, .OpIMul, .{
2627 .id_result_type = arith_op_ty_id,
2628 .id_result = value_results.at(i),
2629 .operand_1 = lhs_op.at(i),
2630 .operand_2 = rhs_op.at(i),
2631 });
2632
2633 try cg.body.emit(cg.module.gpa, .OpExtInst, .{
2634 .id_result_type = arith_op_ty_id,
2635 .id_result = overflow_results.at(i),
2636 .set = set,
2637 .instruction = .{ .inst = overflow_inst },
2638 .id_ref_4 = &.{ lhs_op.at(i), rhs_op.at(i) },
2639 });
2640 }
2641 },
2642 .vulkan, .opengl => {
2643 // Operations return a struct{T, T}
2644 // where T is maybe vectorized.
2645 const op_result_ty: Type = .fromInterned(try ip.getTupleType(zcu.gpa, pt.tid, .{
2646 .types = &.{ arith_op_ty.toIntern(), arith_op_ty.toIntern() },
2647 .values = &.{ .none, .none },
2648 }));
2649 const op_result_ty_id = try cg.resolveType(op_result_ty, .direct);
2650
2651 const opcode: Opcode = switch (op) {
2652 .s_mul_extended => .OpSMulExtended,
2653 .u_mul_extended => .OpUMulExtended,
2654 };
2655
2656 for (0..ops) |i| {
2657 const op_result = cg.module.allocId();
2658
2659 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
2660 cg.body.writeOperand(spec.Id, op_result_ty_id);
2661 cg.body.writeOperand(Id, op_result);
2662 cg.body.writeOperand(Id, lhs_op.at(i));
2663 cg.body.writeOperand(Id, rhs_op.at(i));
2664
2665 // The above operation returns a struct. We might want to expand
2666 // Temporary to deal with the fact that these are structs eventually,
2667 // but for now, take the struct apart and return two separate vectors.
2668
2669 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2670 .id_result_type = arith_op_ty_id,
2671 .id_result = value_results.at(i),
2672 .composite = op_result,
2673 .indexes = &.{0},
2674 });
2675
2676 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2677 .id_result_type = arith_op_ty_id,
2678 .id_result = overflow_results.at(i),
2679 .composite = op_result,
2680 .indexes = &.{1},
2681 });
2682 }
2683 },
2684 else => unreachable,
2685 }
2686
2687 const result_ty = try v.resultType(cg, lhs.ty);
2688 return .{
2689 v.finalize(result_ty, value_results),
2690 v.finalize(result_ty, overflow_results),
2691 };
2692}
2693
2694/// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure.
2695/// In order to be able to run tests, we "temporarily" lower test kernels into separate entry-
2696/// points. The test executor will then be able to invoke these to run the tests.
2697/// Note that tests are lowered according to std.builtin.TestFn, which is `fn () anyerror!void`.
2698/// (anyerror!void has the same layout as anyerror).
2699/// Each test declaration generates a function like.
2700/// %anyerror = OpTypeInt 0 16
2701/// %p_invocation_globals_struct_ty = ...
2702/// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror
2703/// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror
2704///
2705/// %test = OpFunction %void %K
2706/// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty
2707/// %p_err = OpFunctionParameter %p_anyerror
2708/// %lbl = OpLabel
2709/// %result = OpFunctionCall %anyerror %func %p_invocation_globals
2710/// OpStore %p_err %result
2711/// OpFunctionEnd
2712/// TODO is to also write out the error as a function call parameter, and to somehow fetch
2713/// the name of an error in the text executor.
2714fn generateTestEntryPoint(
2715 cg: *CodeGen,
2716 name: []const u8,
2717 spv_decl_index: Module.Decl.Index,
2718 test_id: Id,
2719) !void {
2720 const gpa = cg.module.gpa;
2721 const zcu = cg.pt.zcu;
2722 const target = cg.module.target;
2723
2724 const anyerror_ty_id = try cg.resolveType(.anyerror, .direct);
2725 const ptr_anyerror_ty = try cg.pt.ptrType(.{
2726 .child = .anyerror_type,
2727 .flags = .{ .address_space = .global },
2728 });
2729 const ptr_anyerror_ty_id = try cg.resolveType(ptr_anyerror_ty, .direct);
2730
2731 const kernel_id = cg.module.declPtr(spv_decl_index).result_id;
2732
2733 var decl_deps = std.ArrayList(Module.Decl.Index).init(gpa);
2734 defer decl_deps.deinit();
2735 try decl_deps.append(spv_decl_index);
2736
2737 const section = &cg.module.sections.functions;
2738
2739 const p_error_id = cg.module.allocId();
2740 switch (target.os.tag) {
2741 .opencl, .amdhsa => {
2742 const kernel_proto_ty_id = try cg.functionType(.void, &.{ptr_anyerror_ty});
2743
2744 try section.emit(cg.module.gpa, .OpFunction, .{
2745 .id_result_type = try cg.resolveType(.void, .direct),
2746 .id_result = kernel_id,
2747 .function_control = .{},
2748 .function_type = kernel_proto_ty_id,
2749 });
2750
2751 try section.emit(cg.module.gpa, .OpFunctionParameter, .{
2752 .id_result_type = ptr_anyerror_ty_id,
2753 .id_result = p_error_id,
2754 });
2755
2756 try section.emit(cg.module.gpa, .OpLabel, .{
2757 .id_result = cg.module.allocId(),
2758 });
2759 },
2760 .vulkan, .opengl => {
2761 if (cg.module.error_buffer == null) {
2762 const spv_err_decl_index = try cg.module.allocDecl(.global);
2763 try cg.module.declareDeclDeps(spv_err_decl_index, &.{});
2764
2765 const buffer_struct_ty_id = cg.module.allocId();
2766 try cg.module.structType(buffer_struct_ty_id, &.{anyerror_ty_id}, &.{"error_out"});
2767 try cg.module.decorate(buffer_struct_ty_id, .block);
2768 try cg.module.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });
2769
2770 const ptr_buffer_struct_ty_id = cg.module.allocId();
2771 try cg.module.sections.globals.emit(cg.module.gpa, .OpTypePointer, .{
2772 .id_result = ptr_buffer_struct_ty_id,
2773 .storage_class = cg.module.storageClass(.global),
2774 .type = buffer_struct_ty_id,
2775 });
2776
2777 const buffer_struct_id = cg.module.declPtr(spv_err_decl_index).result_id;
2778 try cg.module.sections.globals.emit(cg.module.gpa, .OpVariable, .{
2779 .id_result_type = ptr_buffer_struct_ty_id,
2780 .id_result = buffer_struct_id,
2781 .storage_class = cg.module.storageClass(.global),
2782 });
2783 try cg.module.decorate(buffer_struct_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });
2784 try cg.module.decorate(buffer_struct_id, .{ .binding = .{ .binding_point = 0 } });
2785
2786 cg.module.error_buffer = spv_err_decl_index;
2787 }
2788
2789 try cg.module.sections.execution_modes.emit(cg.module.gpa, .OpExecutionMode, .{
2790 .entry_point = kernel_id,
2791 .mode = .{ .local_size = .{
2792 .x_size = 1,
2793 .y_size = 1,
2794 .z_size = 1,
2795 } },
2796 });
2797
2798 const kernel_proto_ty_id = try cg.functionType(.void, &.{});
2799 try section.emit(cg.module.gpa, .OpFunction, .{
2800 .id_result_type = try cg.resolveType(.void, .direct),
2801 .id_result = kernel_id,
2802 .function_control = .{},
2803 .function_type = kernel_proto_ty_id,
2804 });
2805 try section.emit(cg.module.gpa, .OpLabel, .{
2806 .id_result = cg.module.allocId(),
2807 });
2808
2809 const spv_err_decl_index = cg.module.error_buffer.?;
2810 const buffer_id = cg.module.declPtr(spv_err_decl_index).result_id;
2811 try decl_deps.append(spv_err_decl_index);
2812
2813 const zero_id = try cg.constInt(.u32, 0);
2814 try section.emit(cg.module.gpa, .OpInBoundsAccessChain, .{
2815 .id_result_type = ptr_anyerror_ty_id,
2816 .id_result = p_error_id,
2817 .base = buffer_id,
2818 .indexes = &.{zero_id},
2819 });
2820 },
2821 else => unreachable,
2822 }
2823
2824 const error_id = cg.module.allocId();
2825 try section.emit(cg.module.gpa, .OpFunctionCall, .{
2826 .id_result_type = anyerror_ty_id,
2827 .id_result = error_id,
2828 .function = test_id,
2829 });
2830 // Note: Convert to direct not required.
2831 try section.emit(cg.module.gpa, .OpStore, .{
2832 .pointer = p_error_id,
2833 .object = error_id,
2834 .memory_access = .{
2835 .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) },
2836 },
2837 });
2838 try section.emit(cg.module.gpa, .OpReturn, {});
2839 try section.emit(cg.module.gpa, .OpFunctionEnd, {});
2840
2841 // Just generate a quick other name because the intel runtime crashes when the entry-
2842 // point name is the same as a different OpName.
2843 const test_name = try std.fmt.allocPrint(gpa, "test {s}", .{name});
2844
2845 const execution_mode: spec.ExecutionModel = switch (target.os.tag) {
2846 .vulkan, .opengl => .gl_compute,
2847 .opencl, .amdhsa => .kernel,
2848 else => unreachable,
2849 };
2850
2851 try cg.module.declareDeclDeps(spv_decl_index, decl_deps.items);
2852 try cg.module.declareEntryPoint(spv_decl_index, test_name, execution_mode, null);
2853}
2854
2855fn intFromBool(cg: *CodeGen, value: Temporary) !Temporary {
2856 return try cg.intFromBool2(value, Type.u1);
2857}
2858
2859fn intFromBool2(cg: *CodeGen, value: Temporary, result_ty: Type) !Temporary {
2860 const zero_id = try cg.constInt(result_ty, 0);
2861 const one_id = try cg.constInt(result_ty, 1);
2862
2863 return try cg.buildSelect(
2864 value,
2865 Temporary.init(result_ty, one_id),
2866 Temporary.init(result_ty, zero_id),
2867 );
2868}
2869
2870/// Convert representation from indirect (in memory) to direct (in 'register')
2871/// This converts the argument type from resolveType(ty, .indirect) to resolveType(ty, .direct).
2872fn convertToDirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2873 const pt = cg.pt;
2874 const zcu = pt.zcu;
2875 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2876 .bool => {
2877 const false_id = try cg.constBool(false, .indirect);
2878 const operand_ty = blk: {
2879 if (!ty.isVector(pt.zcu)) break :blk Type.u1;
2880 break :blk try pt.vectorType(.{
2881 .len = ty.vectorLen(pt.zcu),
2882 .child = .u1_type,
2883 });
2884 };
2885
2886 const result = try cg.buildCmp(
2887 .i_ne,
2888 Temporary.init(operand_ty, operand_id),
2889 Temporary.init(.u1, false_id),
2890 );
2891 return try result.materialize(cg);
2892 },
2893 else => return operand_id,
2894 }
2895}
2896
2897/// Convert representation from direct (in 'register) to direct (in memory)
2898/// This converts the argument type from resolveType(ty, .direct) to resolveType(ty, .indirect).
2899fn convertToIndirect(cg: *CodeGen, ty: Type, operand_id: Id) !Id {
2900 const zcu = cg.pt.zcu;
2901 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
2902 .bool => {
2903 const result = try cg.intFromBool(Temporary.init(ty, operand_id));
2904 return try result.materialize(cg);
2905 },
2906 else => return operand_id,
2907 }
2908}
2909
2910fn extractField(cg: *CodeGen, result_ty: Type, object: Id, field: u32) !Id {
2911 const result_ty_id = try cg.resolveType(result_ty, .indirect);
2912 const result_id = cg.module.allocId();
2913 const indexes = [_]u32{field};
2914 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2915 .id_result_type = result_ty_id,
2916 .id_result = result_id,
2917 .composite = object,
2918 .indexes = &indexes,
2919 });
2920 // Convert bools; direct structs have their field types as indirect values.
2921 return try cg.convertToDirect(result_ty, result_id);
2922}
2923
2924fn extractVectorComponent(cg: *CodeGen, result_ty: Type, vector_id: Id, field: u32) !Id {
2925 const result_ty_id = try cg.resolveType(result_ty, .direct);
2926 const result_id = cg.module.allocId();
2927 const indexes = [_]u32{field};
2928 try cg.body.emit(cg.module.gpa, .OpCompositeExtract, .{
2929 .id_result_type = result_ty_id,
2930 .id_result = result_id,
2931 .composite = vector_id,
2932 .indexes = &indexes,
2933 });
2934 // Vector components are already stored in direct representation.
2935 return result_id;
2936}
2937
2938const MemoryOptions = struct {
2939 is_volatile: bool = false,
2940};
2941
2942fn load(cg: *CodeGen, value_ty: Type, ptr_id: Id, options: MemoryOptions) !Id {
2943 const zcu = cg.pt.zcu;
2944 const alignment: u32 = @intCast(value_ty.abiAlignment(zcu).toByteUnits().?);
2945 const indirect_value_ty_id = try cg.resolveType(value_ty, .indirect);
2946 const result_id = cg.module.allocId();
2947 const access: spec.MemoryAccess.Extended = .{
2948 .@"volatile" = options.is_volatile,
2949 .aligned = .{ .literal_integer = alignment },
2950 };
2951 try cg.body.emit(cg.module.gpa, .OpLoad, .{
2952 .id_result_type = indirect_value_ty_id,
2953 .id_result = result_id,
2954 .pointer = ptr_id,
2955 .memory_access = access,
2956 });
2957 return try cg.convertToDirect(value_ty, result_id);
2958}
2959
2960fn store(cg: *CodeGen, value_ty: Type, ptr_id: Id, value_id: Id, options: MemoryOptions) !void {
2961 const indirect_value_id = try cg.convertToIndirect(value_ty, value_id);
2962 const access: spec.MemoryAccess.Extended = .{ .@"volatile" = options.is_volatile };
2963 try cg.body.emit(cg.module.gpa, .OpStore, .{
2964 .pointer = ptr_id,
2965 .object = indirect_value_id,
2966 .memory_access = access,
2967 });
2968}
2969
2970fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) !void {
2971 for (body) |inst| {
2972 try cg.genInst(inst);
2973 }
2974}
2975
2976fn genInst(cg: *CodeGen, inst: Air.Inst.Index) Error!void {
2977 const gpa = cg.module.gpa;
2978 const zcu = cg.pt.zcu;
2979 const ip = &zcu.intern_pool;
2980 if (cg.liveness.isUnused(inst) and !cg.air.mustLower(inst, ip))
2981 return;
2982
2983 const air_tags = cg.air.instructions.items(.tag);
2984 const maybe_result_id: ?Id = switch (air_tags[@intFromEnum(inst)]) {
2985 // zig fmt: off
2986 .add, .add_wrap, .add_optimized => try cg.airArithOp(inst, .f_add, .i_add, .i_add),
2987 .sub, .sub_wrap, .sub_optimized => try cg.airArithOp(inst, .f_sub, .i_sub, .i_sub),
2988 .mul, .mul_wrap, .mul_optimized => try cg.airArithOp(inst, .f_mul, .i_mul, .i_mul),
2989
2990 .sqrt => try cg.airUnOpSimple(inst, .sqrt),
2991 .sin => try cg.airUnOpSimple(inst, .sin),
2992 .cos => try cg.airUnOpSimple(inst, .cos),
2993 .tan => try cg.airUnOpSimple(inst, .tan),
2994 .exp => try cg.airUnOpSimple(inst, .exp),
2995 .exp2 => try cg.airUnOpSimple(inst, .exp2),
2996 .log => try cg.airUnOpSimple(inst, .log),
2997 .log2 => try cg.airUnOpSimple(inst, .log2),
2998 .log10 => try cg.airUnOpSimple(inst, .log10),
2999 .abs => try cg.airAbs(inst),
3000 .floor => try cg.airUnOpSimple(inst, .floor),
3001 .ceil => try cg.airUnOpSimple(inst, .ceil),
3002 .round => try cg.airUnOpSimple(inst, .round),
3003 .trunc_float => try cg.airUnOpSimple(inst, .trunc),
3004 .neg, .neg_optimized => try cg.airUnOpSimple(inst, .f_neg),
3005
3006 .div_float, .div_float_optimized => try cg.airArithOp(inst, .f_div, .s_div, .u_div),
3007 .div_floor, .div_floor_optimized => try cg.airDivFloor(inst),
3008 .div_trunc, .div_trunc_optimized => try cg.airDivTrunc(inst),
3009
3010 .rem, .rem_optimized => try cg.airArithOp(inst, .f_rem, .s_rem, .u_mod),
3011 .mod, .mod_optimized => try cg.airArithOp(inst, .f_mod, .s_mod, .u_mod),
3012
3013 .add_with_overflow => try cg.airAddSubOverflow(inst, .i_add, .u_lt, .s_lt),
3014 .sub_with_overflow => try cg.airAddSubOverflow(inst, .i_sub, .u_gt, .s_gt),
3015 .mul_with_overflow => try cg.airMulOverflow(inst),
3016 .shl_with_overflow => try cg.airShlOverflow(inst),
3017
3018 .mul_add => try cg.airMulAdd(inst),
3019
3020 .ctz => try cg.airClzCtz(inst, .ctz),
3021 .clz => try cg.airClzCtz(inst, .clz),
3022
3023 .select => try cg.airSelect(inst),
3024
3025 .splat => try cg.airSplat(inst),
3026 .reduce, .reduce_optimized => try cg.airReduce(inst),
3027 .shuffle_one => try cg.airShuffleOne(inst),
3028 .shuffle_two => try cg.airShuffleTwo(inst),
3029
3030 .ptr_add => try cg.airPtrAdd(inst),
3031 .ptr_sub => try cg.airPtrSub(inst),
3032
3033 .bit_and => try cg.airBinOpSimple(inst, .bit_and),
3034 .bit_or => try cg.airBinOpSimple(inst, .bit_or),
3035 .xor => try cg.airBinOpSimple(inst, .bit_xor),
3036 .bool_and => try cg.airBinOpSimple(inst, .l_and),
3037 .bool_or => try cg.airBinOpSimple(inst, .l_or),
3038
3039 .shl, .shl_exact => try cg.airShift(inst, .sll, .sll),
3040 .shr, .shr_exact => try cg.airShift(inst, .srl, .sra),
3041
3042 .min => try cg.airMinMax(inst, .min),
3043 .max => try cg.airMinMax(inst, .max),
3044
3045 .bitcast => try cg.airBitCast(inst),
3046 .intcast, .trunc => try cg.airIntCast(inst),
3047 .float_from_int => try cg.airFloatFromInt(inst),
3048 .int_from_float => try cg.airIntFromFloat(inst),
3049 .fpext, .fptrunc => try cg.airFloatCast(inst),
3050 .not => try cg.airNot(inst),
3051
3052 .array_to_slice => try cg.airArrayToSlice(inst),
3053 .slice => try cg.airSlice(inst),
3054 .aggregate_init => try cg.airAggregateInit(inst),
3055 .memcpy => return cg.airMemcpy(inst),
3056 .memmove => return cg.airMemmove(inst),
3057
3058 .slice_ptr => try cg.airSliceField(inst, 0),
3059 .slice_len => try cg.airSliceField(inst, 1),
3060 .slice_elem_ptr => try cg.airSliceElemPtr(inst),
3061 .slice_elem_val => try cg.airSliceElemVal(inst),
3062 .ptr_elem_ptr => try cg.airPtrElemPtr(inst),
3063 .ptr_elem_val => try cg.airPtrElemVal(inst),
3064 .array_elem_val => try cg.airArrayElemVal(inst),
3065
3066 .vector_store_elem => return cg.airVectorStoreElem(inst),
3067
3068 .set_union_tag => return cg.airSetUnionTag(inst),
3069 .get_union_tag => try cg.airGetUnionTag(inst),
3070 .union_init => try cg.airUnionInit(inst),
3071
3072 .struct_field_val => try cg.airStructFieldVal(inst),
3073 .field_parent_ptr => try cg.airFieldParentPtr(inst),
3074
3075 .struct_field_ptr_index_0 => try cg.airStructFieldPtrIndex(inst, 0),
3076 .struct_field_ptr_index_1 => try cg.airStructFieldPtrIndex(inst, 1),
3077 .struct_field_ptr_index_2 => try cg.airStructFieldPtrIndex(inst, 2),
3078 .struct_field_ptr_index_3 => try cg.airStructFieldPtrIndex(inst, 3),
3079
3080 .cmp_eq => try cg.airCmp(inst, .eq),
3081 .cmp_neq => try cg.airCmp(inst, .neq),
3082 .cmp_gt => try cg.airCmp(inst, .gt),
3083 .cmp_gte => try cg.airCmp(inst, .gte),
3084 .cmp_lt => try cg.airCmp(inst, .lt),
3085 .cmp_lte => try cg.airCmp(inst, .lte),
3086 .cmp_vector => try cg.airVectorCmp(inst),
3087
3088 .arg => cg.airArg(),
3089 .alloc => try cg.airAlloc(inst),
3090 // TODO: We probably need to have a special implementation of this for the C abi.
3091 .ret_ptr => try cg.airAlloc(inst),
3092 .block => try cg.airBlock(inst),
3093
3094 .load => try cg.airLoad(inst),
3095 .store, .store_safe => return cg.airStore(inst),
3096
3097 .br => return cg.airBr(inst),
3098 // For now just ignore this instruction. This effectively falls back on the old implementation,
3099 // this doesn't change anything for us.
3100 .repeat => return,
3101 .breakpoint => return,
3102 .cond_br => return cg.airCondBr(inst),
3103 .loop => return cg.airLoop(inst),
3104 .ret => return cg.airRet(inst),
3105 .ret_safe => return cg.airRet(inst), // TODO
3106 .ret_load => return cg.airRetLoad(inst),
3107 .@"try" => try cg.airTry(inst),
3108 .switch_br => return cg.airSwitchBr(inst),
3109 .unreach, .trap => return cg.airUnreach(),
3110
3111 .dbg_empty_stmt => return,
3112 .dbg_stmt => return cg.airDbgStmt(inst),
3113 .dbg_inline_block => try cg.airDbgInlineBlock(inst),
3114 .dbg_var_ptr, .dbg_var_val, .dbg_arg_inline => return cg.airDbgVar(inst),
3115
3116 .unwrap_errunion_err => try cg.airErrUnionErr(inst),
3117 .unwrap_errunion_payload => try cg.airErrUnionPayload(inst),
3118 .wrap_errunion_err => try cg.airWrapErrUnionErr(inst),
3119 .wrap_errunion_payload => try cg.airWrapErrUnionPayload(inst),
3120
3121 .is_null => try cg.airIsNull(inst, false, .is_null),
3122 .is_non_null => try cg.airIsNull(inst, false, .is_non_null),
3123 .is_null_ptr => try cg.airIsNull(inst, true, .is_null),
3124 .is_non_null_ptr => try cg.airIsNull(inst, true, .is_non_null),
3125 .is_err => try cg.airIsErr(inst, .is_err),
3126 .is_non_err => try cg.airIsErr(inst, .is_non_err),
3127
3128 .optional_payload => try cg.airUnwrapOptional(inst),
3129 .optional_payload_ptr => try cg.airUnwrapOptionalPtr(inst),
3130 .wrap_optional => try cg.airWrapOptional(inst),
3131
3132 .assembly => try cg.airAssembly(inst),
3133
3134 .call => try cg.airCall(inst, .auto),
3135 .call_always_tail => try cg.airCall(inst, .always_tail),
3136 .call_never_tail => try cg.airCall(inst, .never_tail),
3137 .call_never_inline => try cg.airCall(inst, .never_inline),
3138
3139 .work_item_id => try cg.airWorkItemId(inst),
3140 .work_group_size => try cg.airWorkGroupSize(inst),
3141 .work_group_id => try cg.airWorkGroupId(inst),
3142
3143 // zig fmt: on
3144
3145 else => |tag| return cg.todo("implement AIR tag {s}", .{@tagName(tag)}),
3146 };
3147
3148 const result_id = maybe_result_id orelse return;
3149 try cg.inst_results.putNoClobber(gpa, inst, result_id);
3150}
3151
3152fn airBinOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: BinaryOp) !?Id {
3153 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3154 const lhs = try cg.temporary(bin_op.lhs);
3155 const rhs = try cg.temporary(bin_op.rhs);
3156
3157 const result = try cg.buildBinary(op, lhs, rhs);
3158 return try result.materialize(cg);
3159}
3160
3161fn airShift(cg: *CodeGen, inst: Air.Inst.Index, unsigned: BinaryOp, signed: BinaryOp) !?Id {
3162 const zcu = cg.pt.zcu;
3163 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3164
3165 if (cg.typeOf(bin_op.lhs).isVector(zcu) and !cg.typeOf(bin_op.rhs).isVector(zcu)) {
3166 return cg.fail("vector shift with scalar rhs", .{});
3167 }
3168
3169 const base = try cg.temporary(bin_op.lhs);
3170 const shift = try cg.temporary(bin_op.rhs);
3171
3172 const result_ty = cg.typeOfIndex(inst);
3173
3174 const info = cg.arithmeticTypeInfo(result_ty);
3175 switch (info.class) {
3176 .composite_integer => return cg.todo("shift ops for composite integers", .{}),
3177 .integer, .strange_integer => {},
3178 .float, .bool => unreachable,
3179 }
3180
3181 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3182 // so just manually upcast it if required.
3183
3184 // Note: The sign may differ here between the shift and the base type, in case
3185 // of an arithmetic right shift. SPIR-V still expects the same type,
3186 // so in that case we have to cast convert to signed.
3187 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
3188
3189 const shifted = switch (info.signedness) {
3190 .unsigned => try cg.buildBinary(unsigned, base, casted_shift),
3191 .signed => try cg.buildBinary(signed, base, casted_shift),
3192 };
3193
3194 const result = try cg.normalize(shifted, info);
3195 return try result.materialize(cg);
3196}
3197
3198const MinMax = enum { min, max };
3199
3200fn airMinMax(cg: *CodeGen, inst: Air.Inst.Index, op: MinMax) !?Id {
3201 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3202
3203 const lhs = try cg.temporary(bin_op.lhs);
3204 const rhs = try cg.temporary(bin_op.rhs);
3205
3206 const result = try cg.minMax(lhs, rhs, op);
3207 return try result.materialize(cg);
3208}
3209
3210fn minMax(cg: *CodeGen, lhs: Temporary, rhs: Temporary, op: MinMax) !Temporary {
3211 const info = cg.arithmeticTypeInfo(lhs.ty);
3212
3213 const binop: BinaryOp = switch (info.class) {
3214 .float => switch (op) {
3215 .min => .f_min,
3216 .max => .f_max,
3217 },
3218 .integer, .strange_integer => switch (info.signedness) {
3219 .signed => switch (op) {
3220 .min => .s_min,
3221 .max => .s_max,
3222 },
3223 .unsigned => switch (op) {
3224 .min => .u_min,
3225 .max => .u_max,
3226 },
3227 },
3228 .composite_integer => unreachable, // TODO
3229 .bool => unreachable,
3230 };
3231
3232 return try cg.buildBinary(binop, lhs, rhs);
3233}
3234
3235/// This function normalizes values to a canonical representation
3236/// after some arithmetic operation. This mostly consists of wrapping
3237/// behavior for strange integers:
3238/// - Unsigned integers are bitwise masked with a mask that only passes
3239/// the valid bits through.
3240/// - Signed integers are also sign extended if they are negative.
3241/// All other values are returned unmodified (this makes strange integer
3242/// wrapping easier to use in generic operations).
3243fn normalize(cg: *CodeGen, value: Temporary, info: ArithmeticTypeInfo) !Temporary {
3244 const zcu = cg.pt.zcu;
3245 const ty = value.ty;
3246 switch (info.class) {
3247 .composite_integer, .integer, .bool, .float => return value,
3248 .strange_integer => switch (info.signedness) {
3249 .unsigned => {
3250 const mask_value = if (info.bits == 64) 0xFFFF_FFFF_FFFF_FFFF else (@as(u64, 1) << @as(u6, @intCast(info.bits))) - 1;
3251 const mask_id = try cg.constInt(ty.scalarType(zcu), mask_value);
3252 return try cg.buildBinary(.bit_and, value, Temporary.init(ty.scalarType(zcu), mask_id));
3253 },
3254 .signed => {
3255 // Shift left and right so that we can copy the sight bit that way.
3256 const shift_amt_id = try cg.constInt(ty.scalarType(zcu), info.backing_bits - info.bits);
3257 const shift_amt: Temporary = .init(ty.scalarType(zcu), shift_amt_id);
3258 const left = try cg.buildBinary(.sll, value, shift_amt);
3259 return try cg.buildBinary(.sra, left, shift_amt);
3260 },
3261 },
3262 }
3263}
3264
3265fn airDivFloor(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3266 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3267
3268 const lhs = try cg.temporary(bin_op.lhs);
3269 const rhs = try cg.temporary(bin_op.rhs);
3270
3271 const info = cg.arithmeticTypeInfo(lhs.ty);
3272 switch (info.class) {
3273 .composite_integer => unreachable, // TODO
3274 .integer, .strange_integer => {
3275 switch (info.signedness) {
3276 .unsigned => {
3277 const result = try cg.buildBinary(.u_div, lhs, rhs);
3278 return try result.materialize(cg);
3279 },
3280 .signed => {},
3281 }
3282
3283 // For signed integers:
3284 // (a / b) - (a % b != 0 && a < 0 != b < 0);
3285 // There shouldn't be any overflow issues.
3286
3287 const div = try cg.buildBinary(.s_div, lhs, rhs);
3288 const rem = try cg.buildBinary(.s_rem, lhs, rhs);
3289
3290 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3291
3292 const rem_is_not_zero = try cg.buildCmp(.i_ne, rem, zero);
3293
3294 const result_negative = try cg.buildCmp(
3295 .l_ne,
3296 try cg.buildCmp(.s_lt, lhs, zero),
3297 try cg.buildCmp(.s_lt, rhs, zero),
3298 );
3299 const rem_is_not_zero_and_result_is_negative = try cg.buildBinary(
3300 .l_and,
3301 rem_is_not_zero,
3302 result_negative,
3303 );
3304
3305 const result = try cg.buildBinary(
3306 .i_sub,
3307 div,
3308 try cg.intFromBool2(rem_is_not_zero_and_result_is_negative, div.ty),
3309 );
3310
3311 return try result.materialize(cg);
3312 },
3313 .float => {
3314 const div = try cg.buildBinary(.f_div, lhs, rhs);
3315 const result = try cg.buildUnary(.floor, div);
3316 return try result.materialize(cg);
3317 },
3318 .bool => unreachable,
3319 }
3320}
3321
3322fn airDivTrunc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3323 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3324
3325 const lhs = try cg.temporary(bin_op.lhs);
3326 const rhs = try cg.temporary(bin_op.rhs);
3327
3328 const info = cg.arithmeticTypeInfo(lhs.ty);
3329 switch (info.class) {
3330 .composite_integer => unreachable, // TODO
3331 .integer, .strange_integer => switch (info.signedness) {
3332 .unsigned => {
3333 const result = try cg.buildBinary(.u_div, lhs, rhs);
3334 return try result.materialize(cg);
3335 },
3336 .signed => {
3337 const result = try cg.buildBinary(.s_div, lhs, rhs);
3338 return try result.materialize(cg);
3339 },
3340 },
3341 .float => {
3342 const div = try cg.buildBinary(.f_div, lhs, rhs);
3343 const result = try cg.buildUnary(.trunc, div);
3344 return try result.materialize(cg);
3345 },
3346 .bool => unreachable,
3347 }
3348}
3349
3350fn airUnOpSimple(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3351 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
3352 const operand = try cg.temporary(un_op);
3353 const result = try cg.buildUnary(op, operand);
3354 return try result.materialize(cg);
3355}
3356
3357fn airArithOp(
3358 cg: *CodeGen,
3359 inst: Air.Inst.Index,
3360 comptime fop: BinaryOp,
3361 comptime sop: BinaryOp,
3362 comptime uop: BinaryOp,
3363) !?Id {
3364 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3365
3366 const lhs = try cg.temporary(bin_op.lhs);
3367 const rhs = try cg.temporary(bin_op.rhs);
3368
3369 const info = cg.arithmeticTypeInfo(lhs.ty);
3370
3371 const result = switch (info.class) {
3372 .composite_integer => unreachable, // TODO
3373 .integer, .strange_integer => switch (info.signedness) {
3374 .signed => try cg.buildBinary(sop, lhs, rhs),
3375 .unsigned => try cg.buildBinary(uop, lhs, rhs),
3376 },
3377 .float => try cg.buildBinary(fop, lhs, rhs),
3378 .bool => unreachable,
3379 };
3380
3381 return try result.materialize(cg);
3382}
3383
3384fn airAbs(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3385 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3386 const operand = try cg.temporary(ty_op.operand);
3387 // Note: operand_ty may be signed, while ty is always unsigned!
3388 const result_ty = cg.typeOfIndex(inst);
3389 const result = try cg.abs(result_ty, operand);
3390 return try result.materialize(cg);
3391}
3392
3393fn abs(cg: *CodeGen, result_ty: Type, value: Temporary) !Temporary {
3394 const zcu = cg.pt.zcu;
3395 const operand_info = cg.arithmeticTypeInfo(value.ty);
3396
3397 switch (operand_info.class) {
3398 .float => return try cg.buildUnary(.f_abs, value),
3399 .integer, .strange_integer => {
3400 const abs_value = try cg.buildUnary(.i_abs, value);
3401
3402 switch (cg.module.target.os.tag) {
3403 .vulkan, .opengl => {
3404 if (value.ty.intInfo(zcu).signedness == .signed) {
3405 return cg.todo("perform bitcast after @abs", .{});
3406 }
3407 },
3408 else => {},
3409 }
3410
3411 return try cg.normalize(abs_value, cg.arithmeticTypeInfo(result_ty));
3412 },
3413 .composite_integer => unreachable, // TODO
3414 .bool => unreachable,
3415 }
3416}
3417
3418fn airAddSubOverflow(
3419 cg: *CodeGen,
3420 inst: Air.Inst.Index,
3421 comptime add: BinaryOp,
3422 comptime ucmp: CmpPredicate,
3423 comptime scmp: CmpPredicate,
3424) !?Id {
3425 _ = scmp;
3426 // Note: OpIAddCarry and OpISubBorrow are not really useful here: For unsigned numbers,
3427 // there is in both cases only one extra operation required. For signed operations,
3428 // the overflow bit is set then going from 0x80.. to 0x00.., but this doesn't actually
3429 // normally set a carry bit. So the SPIR-V overflow operations are not particularly
3430 // useful here.
3431
3432 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3433 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3434
3435 const lhs = try cg.temporary(extra.lhs);
3436 const rhs = try cg.temporary(extra.rhs);
3437
3438 const result_ty = cg.typeOfIndex(inst);
3439
3440 const info = cg.arithmeticTypeInfo(lhs.ty);
3441 switch (info.class) {
3442 .composite_integer => unreachable, // TODO
3443 .strange_integer, .integer => {},
3444 .float, .bool => unreachable,
3445 }
3446
3447 const sum = try cg.buildBinary(add, lhs, rhs);
3448 const result = try cg.normalize(sum, info);
3449
3450 const overflowed = switch (info.signedness) {
3451 // Overflow happened if the result is smaller than either of the operands. It doesn't matter which.
3452 // For subtraction the conditions need to be swapped.
3453 .unsigned => try cg.buildCmp(ucmp, result, lhs),
3454 // For signed operations, we check the signs of the operands and the result.
3455 .signed => blk: {
3456 // Signed overflow detection using the sign bits of the operands and the result.
3457 // For addition (a + b), overflow occurs if the operands have the same sign
3458 // and the result's sign is different from the operands' sign.
3459 // (sign(a) == sign(b)) && (sign(a) != sign(result))
3460 // For subtraction (a - b), overflow occurs if the operands have different signs
3461 // and the result's sign is different from the minuend's (a's) sign.
3462 // (sign(a) != sign(b)) && (sign(a) != sign(result))
3463 const zero: Temporary = .init(rhs.ty, try cg.constInt(rhs.ty, 0));
3464
3465 const lhs_is_neg = try cg.buildCmp(.s_lt, lhs, zero);
3466 const rhs_is_neg = try cg.buildCmp(.s_lt, rhs, zero);
3467 const result_is_neg = try cg.buildCmp(.s_lt, result, zero);
3468
3469 const signs_match = try cg.buildCmp(.l_eq, lhs_is_neg, rhs_is_neg);
3470 const result_sign_differs = try cg.buildCmp(.l_ne, lhs_is_neg, result_is_neg);
3471
3472 const overflow_condition = if (add == .i_add)
3473 signs_match
3474 else // .i_sub
3475 try cg.buildUnary(.l_not, signs_match);
3476
3477 break :blk try cg.buildBinary(.l_and, overflow_condition, result_sign_differs);
3478 },
3479 };
3480
3481 const ov = try cg.intFromBool(overflowed);
3482
3483 const result_ty_id = try cg.resolveType(result_ty, .direct);
3484 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3485}
3486
3487fn airMulOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3488 const pt = cg.pt;
3489
3490 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3491 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3492
3493 const lhs = try cg.temporary(extra.lhs);
3494 const rhs = try cg.temporary(extra.rhs);
3495
3496 const result_ty = cg.typeOfIndex(inst);
3497
3498 const info = cg.arithmeticTypeInfo(lhs.ty);
3499 switch (info.class) {
3500 .composite_integer => unreachable, // TODO
3501 .strange_integer, .integer => {},
3502 .float, .bool => unreachable,
3503 }
3504
3505 // There are 3 cases which we have to deal with:
3506 // - If info.bits < 32 / 2, we will upcast to 32 and check the higher bits
3507 // - If info.bits > 32 / 2, we have to use extended multiplication
3508 // - Additionally, if info.bits != 32, we'll have to check the high bits
3509 // of the result too.
3510
3511 const largest_int_bits = cg.largestSupportedIntBits();
3512 // If non-null, the number of bits that the multiplication should be performed in. If
3513 // null, we have to use wide multiplication.
3514 const maybe_op_ty_bits: ?u16 = switch (info.bits) {
3515 0 => unreachable,
3516 1...16 => 32,
3517 17...32 => if (largest_int_bits > 32) 64 else null, // Upcast if we can.
3518 33...64 => null, // Always use wide multiplication.
3519 else => unreachable, // TODO: Composite integers
3520 };
3521
3522 const result, const overflowed = switch (info.signedness) {
3523 .unsigned => blk: {
3524 if (maybe_op_ty_bits) |op_ty_bits| {
3525 const op_ty = try pt.intType(.unsigned, op_ty_bits);
3526 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3527 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3528
3529 const full_result = try cg.buildBinary(.i_mul, casted_lhs, casted_rhs);
3530
3531 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3532 const result = try cg.normalize(low_bits, info);
3533
3534 // Shift the result bits away to get the overflow bits.
3535 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits));
3536 const overflow = try cg.buildBinary(.srl, full_result, shift);
3537
3538 // Directly check if its zero in the op_ty without converting first.
3539 const zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3540 const overflowed = try cg.buildCmp(.i_ne, zero, overflow);
3541
3542 break :blk .{ result, overflowed };
3543 }
3544
3545 const low_bits, const high_bits = try cg.buildWideMul(.u_mul_extended, lhs, rhs);
3546
3547 // Truncate the result, if required.
3548 const result = try cg.normalize(low_bits, info);
3549
3550 // Overflow happened if the high-bits of the result are non-zero OR if the
3551 // high bits of the low word of the result (those outside the range of the
3552 // int) are nonzero.
3553 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3554 const high_overflowed = try cg.buildCmp(.i_ne, zero, high_bits);
3555
3556 // If no overflow bits in low_bits, no extra work needs to be done.
3557 if (info.backing_bits == info.bits) break :blk .{ result, high_overflowed };
3558
3559 // Shift the result bits away to get the overflow bits.
3560 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits));
3561 const low_overflow = try cg.buildBinary(.srl, low_bits, shift);
3562 const low_overflowed = try cg.buildCmp(.i_ne, zero, low_overflow);
3563
3564 const overflowed = try cg.buildBinary(.l_or, low_overflowed, high_overflowed);
3565
3566 break :blk .{ result, overflowed };
3567 },
3568 .signed => blk: {
3569 // - lhs >= 0, rhxs >= 0: expect positive; overflow should be 0
3570 // - lhs == 0 : expect positive; overflow should be 0
3571 // - rhs == 0: expect positive; overflow should be 0
3572 // - lhs > 0, rhs < 0: expect negative; overflow should be -1
3573 // - lhs < 0, rhs > 0: expect negative; overflow should be -1
3574 // - lhs <= 0, rhs <= 0: expect positive; overflow should be 0
3575 // ------
3576 // overflow should be -1 when
3577 // (lhs > 0 && rhs < 0) || (lhs < 0 && rhs > 0)
3578
3579 const zero: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, 0));
3580 const lhs_negative = try cg.buildCmp(.s_lt, lhs, zero);
3581 const rhs_negative = try cg.buildCmp(.s_lt, rhs, zero);
3582 const lhs_positive = try cg.buildCmp(.s_gt, lhs, zero);
3583 const rhs_positive = try cg.buildCmp(.s_gt, rhs, zero);
3584
3585 // Set to `true` if we expect -1.
3586 const expected_overflow_bit = try cg.buildBinary(
3587 .l_or,
3588 try cg.buildBinary(.l_and, lhs_positive, rhs_negative),
3589 try cg.buildBinary(.l_and, lhs_negative, rhs_positive),
3590 );
3591
3592 if (maybe_op_ty_bits) |op_ty_bits| {
3593 const op_ty = try pt.intType(.signed, op_ty_bits);
3594 // Assume normalized; sign bit is set. We want a sign extend.
3595 const casted_lhs = try cg.buildConvert(op_ty, lhs);
3596 const casted_rhs = try cg.buildConvert(op_ty, rhs);
3597
3598 const full_result = try cg.buildBinary(.i_mul, casted_lhs, casted_rhs);
3599
3600 // Truncate to the result type.
3601 const low_bits = try cg.buildConvert(lhs.ty, full_result);
3602 const result = try cg.normalize(low_bits, info);
3603
3604 // Now, we need to check the overflow bits AND the sign
3605 // bit for the expected overflow bits.
3606 // To do that, shift out everything bit the sign bit and
3607 // then check what remains.
3608 const shift: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, info.bits - 1));
3609 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3610 // for negative cases.
3611 const overflow = try cg.buildBinary(.sra, full_result, shift);
3612
3613 const long_all_set: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, -1));
3614 const long_zero: Temporary = .init(full_result.ty, try cg.constInt(full_result.ty, 0));
3615 const mask = try cg.buildSelect(expected_overflow_bit, long_all_set, long_zero);
3616
3617 const overflowed = try cg.buildCmp(.i_ne, mask, overflow);
3618
3619 break :blk .{ result, overflowed };
3620 }
3621
3622 const low_bits, const high_bits = try cg.buildWideMul(.s_mul_extended, lhs, rhs);
3623
3624 // Truncate result if required.
3625 const result = try cg.normalize(low_bits, info);
3626
3627 const all_set: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, -1));
3628 const mask = try cg.buildSelect(expected_overflow_bit, all_set, zero);
3629
3630 // Like with unsigned, overflow happened if high_bits are not the ones we expect,
3631 // and we also need to check some ones from the low bits.
3632
3633 const high_overflowed = try cg.buildCmp(.i_ne, mask, high_bits);
3634
3635 // If no overflow bits in low_bits, no extra work needs to be done.
3636 // Careful, we still have to check the sign bit, so this branch
3637 // only goes for i33 and such.
3638 if (info.backing_bits == info.bits + 1) break :blk .{ result, high_overflowed };
3639
3640 // Shift the result bits away to get the overflow bits.
3641 const shift: Temporary = .init(lhs.ty, try cg.constInt(lhs.ty, info.bits - 1));
3642 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3643 // for negative cases.
3644 const low_overflow = try cg.buildBinary(.sra, low_bits, shift);
3645 const low_overflowed = try cg.buildCmp(.i_ne, mask, low_overflow);
3646
3647 const overflowed = try cg.buildBinary(.l_or, low_overflowed, high_overflowed);
3648
3649 break :blk .{ result, overflowed };
3650 },
3651 };
3652
3653 const ov = try cg.intFromBool(overflowed);
3654
3655 const result_ty_id = try cg.resolveType(result_ty, .direct);
3656 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3657}
3658
3659fn airShlOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3660 const zcu = cg.pt.zcu;
3661
3662 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3663 const extra = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3664
3665 if (cg.typeOf(extra.lhs).isVector(zcu) and !cg.typeOf(extra.rhs).isVector(zcu)) {
3666 return cg.fail("vector shift with scalar rhs", .{});
3667 }
3668
3669 const base = try cg.temporary(extra.lhs);
3670 const shift = try cg.temporary(extra.rhs);
3671
3672 const result_ty = cg.typeOfIndex(inst);
3673
3674 const info = cg.arithmeticTypeInfo(base.ty);
3675 switch (info.class) {
3676 .composite_integer => unreachable, // TODO
3677 .integer, .strange_integer => {},
3678 .float, .bool => unreachable,
3679 }
3680
3681 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3682 // so just manually upcast it if required.
3683 const casted_shift = try cg.buildConvert(base.ty.scalarType(zcu), shift);
3684
3685 const left = try cg.buildBinary(.sll, base, casted_shift);
3686 const result = try cg.normalize(left, info);
3687
3688 const right = switch (info.signedness) {
3689 .unsigned => try cg.buildBinary(.srl, result, casted_shift),
3690 .signed => try cg.buildBinary(.sra, result, casted_shift),
3691 };
3692
3693 const overflowed = try cg.buildCmp(.i_ne, base, right);
3694 const ov = try cg.intFromBool(overflowed);
3695
3696 const result_ty_id = try cg.resolveType(result_ty, .direct);
3697 return try cg.constructComposite(result_ty_id, &.{ try result.materialize(cg), try ov.materialize(cg) });
3698}
3699
3700fn airMulAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3701 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3702 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3703
3704 const a = try cg.temporary(extra.lhs);
3705 const b = try cg.temporary(extra.rhs);
3706 const c = try cg.temporary(pl_op.operand);
3707
3708 const result_ty = cg.typeOfIndex(inst);
3709 const info = cg.arithmeticTypeInfo(result_ty);
3710 assert(info.class == .float); // .mul_add is only emitted for floats
3711
3712 const result = try cg.buildFma(a, b, c);
3713 return try result.materialize(cg);
3714}
3715
3716fn airClzCtz(cg: *CodeGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3717 if (cg.liveness.isUnused(inst)) return null;
3718
3719 const zcu = cg.pt.zcu;
3720 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3721 const operand = try cg.temporary(ty_op.operand);
3722
3723 const scalar_result_ty = cg.typeOfIndex(inst).scalarType(zcu);
3724
3725 const info = cg.arithmeticTypeInfo(operand.ty);
3726 switch (info.class) {
3727 .composite_integer => unreachable, // TODO
3728 .integer, .strange_integer => {},
3729 .float, .bool => unreachable,
3730 }
3731
3732 const count = try cg.buildUnary(op, operand);
3733
3734 // Result of OpenCL ctz/clz returns operand.ty, and we want result_ty.
3735 // result_ty is always large enough to hold the result, so we might have to down
3736 // cast it.
3737 const result = try cg.buildConvert(scalar_result_ty, count);
3738 return try result.materialize(cg);
3739}
3740
3741fn airSelect(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3742 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3743 const extra = cg.air.extraData(Air.Bin, pl_op.payload).data;
3744 const pred = try cg.temporary(pl_op.operand);
3745 const a = try cg.temporary(extra.lhs);
3746 const b = try cg.temporary(extra.rhs);
3747
3748 const result = try cg.buildSelect(pred, a, b);
3749 return try result.materialize(cg);
3750}
3751
3752fn airSplat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3753 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3754
3755 const operand_id = try cg.resolve(ty_op.operand);
3756 const result_ty = cg.typeOfIndex(inst);
3757
3758 return try cg.constructCompositeSplat(result_ty, operand_id);
3759}
3760
3761fn airReduce(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3762 const zcu = cg.pt.zcu;
3763 const reduce = cg.air.instructions.items(.data)[@intFromEnum(inst)].reduce;
3764 const operand = try cg.resolve(reduce.operand);
3765 const operand_ty = cg.typeOf(reduce.operand);
3766 const scalar_ty = operand_ty.scalarType(zcu);
3767 const scalar_ty_id = try cg.resolveType(scalar_ty, .direct);
3768 const info = cg.arithmeticTypeInfo(operand_ty);
3769 const len = operand_ty.vectorLen(zcu);
3770 const first = try cg.extractVectorComponent(scalar_ty, operand, 0);
3771
3772 switch (reduce.operation) {
3773 .Min, .Max => |op| {
3774 var result: Temporary = .init(scalar_ty, first);
3775 const cmp_op: MinMax = switch (op) {
3776 .Max => .max,
3777 .Min => .min,
3778 else => unreachable,
3779 };
3780 for (1..len) |i| {
3781 const lhs = result;
3782 const rhs_id = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3783 const rhs: Temporary = .init(scalar_ty, rhs_id);
3784
3785 result = try cg.minMax(lhs, rhs, cmp_op);
3786 }
3787
3788 return try result.materialize(cg);
3789 },
3790 else => {},
3791 }
3792
3793 var result_id = first;
3794
3795 const opcode: Opcode = switch (info.class) {
3796 .bool => switch (reduce.operation) {
3797 .And => .OpLogicalAnd,
3798 .Or => .OpLogicalOr,
3799 .Xor => .OpLogicalNotEqual,
3800 else => unreachable,
3801 },
3802 .strange_integer, .integer => switch (reduce.operation) {
3803 .And => .OpBitwiseAnd,
3804 .Or => .OpBitwiseOr,
3805 .Xor => .OpBitwiseXor,
3806 .Add => .OpIAdd,
3807 .Mul => .OpIMul,
3808 else => unreachable,
3809 },
3810 .float => switch (reduce.operation) {
3811 .Add => .OpFAdd,
3812 .Mul => .OpFMul,
3813 else => unreachable,
3814 },
3815 .composite_integer => unreachable, // TODO
3816 };
3817
3818 for (1..len) |i| {
3819 const lhs = result_id;
3820 const rhs = try cg.extractVectorComponent(scalar_ty, operand, @intCast(i));
3821 result_id = cg.module.allocId();
3822
3823 try cg.body.emitRaw(cg.module.gpa, opcode, 4);
3824 cg.body.writeOperand(spec.Id, scalar_ty_id);
3825 cg.body.writeOperand(spec.Id, result_id);
3826 cg.body.writeOperand(spec.Id, lhs);
3827 cg.body.writeOperand(spec.Id, rhs);
3828 }
3829
3830 return result_id;
3831}
3832
3833fn airShuffleOne(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3834 const pt = cg.pt;
3835 const zcu = pt.zcu;
3836 const gpa = zcu.gpa;
3837
3838 const unwrapped = cg.air.unwrapShuffleOne(zcu, inst);
3839 const mask = unwrapped.mask;
3840 const result_ty = unwrapped.result_ty;
3841 const elem_ty = result_ty.childType(zcu);
3842 const operand = try cg.resolve(unwrapped.operand);
3843
3844 const constituents = try gpa.alloc(Id, mask.len);
3845 defer gpa.free(constituents);
3846
3847 for (constituents, mask) |*id, mask_elem| {
3848 id.* = switch (mask_elem.unwrap()) {
3849 .elem => |idx| try cg.extractVectorComponent(elem_ty, operand, idx),
3850 .value => |val| try cg.constant(elem_ty, .fromInterned(val), .direct),
3851 };
3852 }
3853
3854 const result_ty_id = try cg.resolveType(result_ty, .direct);
3855 return try cg.constructComposite(result_ty_id, constituents);
3856}
3857
3858fn airShuffleTwo(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3859 const pt = cg.pt;
3860 const zcu = pt.zcu;
3861 const gpa = zcu.gpa;
3862
3863 const unwrapped = cg.air.unwrapShuffleTwo(zcu, inst);
3864 const mask = unwrapped.mask;
3865 const result_ty = unwrapped.result_ty;
3866 const elem_ty = result_ty.childType(zcu);
3867 const elem_ty_id = try cg.resolveType(elem_ty, .direct);
3868 const operand_a = try cg.resolve(unwrapped.operand_a);
3869 const operand_b = try cg.resolve(unwrapped.operand_b);
3870
3871 const constituents = try gpa.alloc(Id, mask.len);
3872 defer gpa.free(constituents);
3873
3874 for (constituents, mask) |*id, mask_elem| {
3875 id.* = switch (mask_elem.unwrap()) {
3876 .a_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_a, idx),
3877 .b_elem => |idx| try cg.extractVectorComponent(elem_ty, operand_b, idx),
3878 .undef => try cg.module.constUndef(elem_ty_id),
3879 };
3880 }
3881
3882 const result_ty_id = try cg.resolveType(result_ty, .direct);
3883 return try cg.constructComposite(result_ty_id, constituents);
3884}
3885
3886fn indicesToIds(cg: *CodeGen, indices: []const u32) ![]Id {
3887 const gpa = cg.module.gpa;
3888 const ids = try gpa.alloc(Id, indices.len);
3889 errdefer gpa.free(ids);
3890 for (indices, ids) |index, *id| {
3891 id.* = try cg.constInt(.u32, index);
3892 }
3893
3894 return ids;
3895}
3896
3897fn accessChainId(
3898 cg: *CodeGen,
3899 result_ty_id: Id,
3900 base: Id,
3901 indices: []const Id,
3902) !Id {
3903 const result_id = cg.module.allocId();
3904 try cg.body.emit(cg.module.gpa, .OpInBoundsAccessChain, .{
3905 .id_result_type = result_ty_id,
3906 .id_result = result_id,
3907 .base = base,
3908 .indexes = indices,
3909 });
3910 return result_id;
3911}
3912
3913/// AccessChain is essentially PtrAccessChain with 0 as initial argument. The effective
3914/// difference lies in whether the resulting type of the first dereference will be the
3915/// same as that of the base pointer, or that of a dereferenced base pointer. AccessChain
3916/// is the latter and PtrAccessChain is the former.
3917fn accessChain(
3918 cg: *CodeGen,
3919 result_ty_id: Id,
3920 base: Id,
3921 indices: []const u32,
3922) !Id {
3923 const gpa = cg.module.gpa;
3924 const ids = try cg.indicesToIds(indices);
3925 defer gpa.free(ids);
3926 return try cg.accessChainId(result_ty_id, base, ids);
3927}
3928
3929fn ptrAccessChain(
3930 cg: *CodeGen,
3931 result_ty_id: Id,
3932 base: Id,
3933 element: Id,
3934 indices: []const u32,
3935) !Id {
3936 const gpa = cg.module.gpa;
3937 const ids = try cg.indicesToIds(indices);
3938 defer gpa.free(ids);
3939
3940 const result_id = cg.module.allocId();
3941 switch (cg.module.target.os.tag) {
3942 .opencl, .amdhsa => {
3943 try cg.body.emit(cg.module.gpa, .OpInBoundsPtrAccessChain, .{
3944 .id_result_type = result_ty_id,
3945 .id_result = result_id,
3946 .base = base,
3947 .element = element,
3948 .indexes = ids,
3949 });
3950 },
3951 else => {
3952 try cg.body.emit(cg.module.gpa, .OpPtrAccessChain, .{
3953 .id_result_type = result_ty_id,
3954 .id_result = result_id,
3955 .base = base,
3956 .element = element,
3957 .indexes = ids,
3958 });
3959 },
3960 }
3961 return result_id;
3962}
3963
3964fn ptrAdd(cg: *CodeGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id) !Id {
3965 const zcu = cg.pt.zcu;
3966 const result_ty_id = try cg.resolveType(result_ty, .direct);
3967
3968 switch (ptr_ty.ptrSize(zcu)) {
3969 .one => {
3970 // Pointer to array
3971 // TODO: Is this correct?
3972 return try cg.accessChainId(result_ty_id, ptr_id, &.{offset_id});
3973 },
3974 .c, .many => {
3975 return try cg.ptrAccessChain(result_ty_id, ptr_id, offset_id, &.{});
3976 },
3977 .slice => {
3978 // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does.
3979 const slice_ptr_id = try cg.extractField(result_ty, ptr_id, 0);
3980 return try cg.ptrAccessChain(result_ty_id, slice_ptr_id, offset_id, &.{});
3981 },
3982 }
3983}
3984
3985fn airPtrAdd(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3986 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3987 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3988 const ptr_id = try cg.resolve(bin_op.lhs);
3989 const offset_id = try cg.resolve(bin_op.rhs);
3990 const ptr_ty = cg.typeOf(bin_op.lhs);
3991 const result_ty = cg.typeOfIndex(inst);
3992
3993 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, offset_id);
3994}
3995
3996fn airPtrSub(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
3997 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3998 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
3999 const ptr_id = try cg.resolve(bin_op.lhs);
4000 const ptr_ty = cg.typeOf(bin_op.lhs);
4001 const offset_id = try cg.resolve(bin_op.rhs);
4002 const offset_ty = cg.typeOf(bin_op.rhs);
4003 const offset_ty_id = try cg.resolveType(offset_ty, .direct);
4004 const result_ty = cg.typeOfIndex(inst);
4005
4006 const negative_offset_id = cg.module.allocId();
4007 try cg.body.emit(cg.module.gpa, .OpSNegate, .{
4008 .id_result_type = offset_ty_id,
4009 .id_result = negative_offset_id,
4010 .operand = offset_id,
4011 });
4012 return try cg.ptrAdd(result_ty, ptr_ty, ptr_id, negative_offset_id);
4013}
4014
4015fn cmp(
4016 cg: *CodeGen,
4017 op: std.math.CompareOperator,
4018 lhs: Temporary,
4019 rhs: Temporary,
4020) !Temporary {
4021 const pt = cg.pt;
4022 const zcu = pt.zcu;
4023 const ip = &zcu.intern_pool;
4024 const scalar_ty = lhs.ty.scalarType(zcu);
4025 const is_vector = lhs.ty.isVector(zcu);
4026
4027 switch (scalar_ty.zigTypeTag(zcu)) {
4028 .int, .bool, .float => {},
4029 .@"enum" => {
4030 assert(!is_vector);
4031 const ty = lhs.ty.intTagType(zcu);
4032 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
4033 },
4034 .@"struct" => {
4035 const struct_ty = zcu.typeToPackedStruct(scalar_ty).?;
4036 const ty: Type = .fromInterned(struct_ty.backingIntTypeUnordered(ip));
4037 return try cg.cmp(op, lhs.pun(ty), rhs.pun(ty));
4038 },
4039 .error_set => {
4040 assert(!is_vector);
4041 const err_int_ty = try pt.errorIntType();
4042 return try cg.cmp(op, lhs.pun(err_int_ty), rhs.pun(err_int_ty));
4043 },
4044 .pointer => {
4045 assert(!is_vector);
4046 // Note that while SPIR-V offers OpPtrEqual and OpPtrNotEqual, they are
4047 // currently not implemented in the SPIR-V LLVM translator. Thus, we emit these using
4048 // OpConvertPtrToU...
4049
4050 const usize_ty_id = try cg.resolveType(.usize, .direct);
4051
4052 const lhs_int_id = cg.module.allocId();
4053 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
4054 .id_result_type = usize_ty_id,
4055 .id_result = lhs_int_id,
4056 .pointer = try lhs.materialize(cg),
4057 });
4058
4059 const rhs_int_id = cg.module.allocId();
4060 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
4061 .id_result_type = usize_ty_id,
4062 .id_result = rhs_int_id,
4063 .pointer = try rhs.materialize(cg),
4064 });
4065
4066 const lhs_int: Temporary = .init(.usize, lhs_int_id);
4067 const rhs_int: Temporary = .init(.usize, rhs_int_id);
4068 return try cg.cmp(op, lhs_int, rhs_int);
4069 },
4070 .optional => {
4071 assert(!is_vector);
4072
4073 const ty = lhs.ty;
4074
4075 const payload_ty = ty.optionalChild(zcu);
4076 if (ty.optionalReprIsPayload(zcu)) {
4077 assert(payload_ty.hasRuntimeBitsIgnoreComptime(zcu));
4078 assert(!payload_ty.isSlice(zcu));
4079
4080 return try cg.cmp(op, lhs.pun(payload_ty), rhs.pun(payload_ty));
4081 }
4082
4083 const lhs_id = try lhs.materialize(cg);
4084 const rhs_id = try rhs.materialize(cg);
4085
4086 const lhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
4087 try cg.extractField(.bool, lhs_id, 1)
4088 else
4089 try cg.convertToDirect(.bool, lhs_id);
4090
4091 const rhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
4092 try cg.extractField(.bool, rhs_id, 1)
4093 else
4094 try cg.convertToDirect(.bool, rhs_id);
4095
4096 const lhs_valid: Temporary = .init(.bool, lhs_valid_id);
4097 const rhs_valid: Temporary = .init(.bool, rhs_valid_id);
4098
4099 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4100 return try cg.cmp(op, lhs_valid, rhs_valid);
4101 }
4102
4103 // a = lhs_valid
4104 // b = rhs_valid
4105 // c = lhs_pl == rhs_pl
4106 //
4107 // For op == .eq we have:
4108 // a == b && a -> c
4109 // = a == b && (!a || c)
4110 //
4111 // For op == .neq we have
4112 // a == b && a -> c
4113 // = !(a == b && a -> c)
4114 // = a != b || !(a -> c
4115 // = a != b || !(!a || c)
4116 // = a != b || a && !c
4117
4118 const lhs_pl_id = try cg.extractField(payload_ty, lhs_id, 0);
4119 const rhs_pl_id = try cg.extractField(payload_ty, rhs_id, 0);
4120
4121 const lhs_pl: Temporary = .init(payload_ty, lhs_pl_id);
4122 const rhs_pl: Temporary = .init(payload_ty, rhs_pl_id);
4123
4124 return switch (op) {
4125 .eq => try cg.buildBinary(
4126 .l_and,
4127 try cg.cmp(.eq, lhs_valid, rhs_valid),
4128 try cg.buildBinary(
4129 .l_or,
4130 try cg.buildUnary(.l_not, lhs_valid),
4131 try cg.cmp(.eq, lhs_pl, rhs_pl),
4132 ),
4133 ),
4134 .neq => try cg.buildBinary(
4135 .l_or,
4136 try cg.cmp(.neq, lhs_valid, rhs_valid),
4137 try cg.buildBinary(
4138 .l_and,
4139 lhs_valid,
4140 try cg.cmp(.neq, lhs_pl, rhs_pl),
4141 ),
4142 ),
4143 else => unreachable,
4144 };
4145 },
4146 else => |ty| return cg.todo("implement cmp operation for '{s}' type", .{@tagName(ty)}),
4147 }
4148
4149 const info = cg.arithmeticTypeInfo(scalar_ty);
4150 const pred: CmpPredicate = switch (info.class) {
4151 .composite_integer => unreachable, // TODO
4152 .float => switch (op) {
4153 .eq => .f_oeq,
4154 .neq => .f_une,
4155 .lt => .f_olt,
4156 .lte => .f_ole,
4157 .gt => .f_ogt,
4158 .gte => .f_oge,
4159 },
4160 .bool => switch (op) {
4161 .eq => .l_eq,
4162 .neq => .l_ne,
4163 else => unreachable,
4164 },
4165 .integer, .strange_integer => switch (info.signedness) {
4166 .signed => switch (op) {
4167 .eq => .i_eq,
4168 .neq => .i_ne,
4169 .lt => .s_lt,
4170 .lte => .s_le,
4171 .gt => .s_gt,
4172 .gte => .s_ge,
4173 },
4174 .unsigned => switch (op) {
4175 .eq => .i_eq,
4176 .neq => .i_ne,
4177 .lt => .u_lt,
4178 .lte => .u_le,
4179 .gt => .u_gt,
4180 .gte => .u_ge,
4181 },
4182 },
4183 };
4184
4185 return try cg.buildCmp(pred, lhs, rhs);
4186}
4187
4188fn airCmp(
4189 cg: *CodeGen,
4190 inst: Air.Inst.Index,
4191 comptime op: std.math.CompareOperator,
4192) !?Id {
4193 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4194 const lhs = try cg.temporary(bin_op.lhs);
4195 const rhs = try cg.temporary(bin_op.rhs);
4196
4197 const result = try cg.cmp(op, lhs, rhs);
4198 return try result.materialize(cg);
4199}
4200
4201fn airVectorCmp(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4202 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4203 const vec_cmp = cg.air.extraData(Air.VectorCmp, ty_pl.payload).data;
4204 const lhs = try cg.temporary(vec_cmp.lhs);
4205 const rhs = try cg.temporary(vec_cmp.rhs);
4206 const op = vec_cmp.compareOperator();
4207
4208 const result = try cg.cmp(op, lhs, rhs);
4209 return try result.materialize(cg);
4210}
4211
4212/// Bitcast one type to another. Note: both types, input, output are expected in **direct** representation.
4213fn bitCast(
4214 cg: *CodeGen,
4215 dst_ty: Type,
4216 src_ty: Type,
4217 src_id: Id,
4218) !Id {
4219 const zcu = cg.pt.zcu;
4220 const src_ty_id = try cg.resolveType(src_ty, .direct);
4221 const dst_ty_id = try cg.resolveType(dst_ty, .direct);
4222
4223 const result_id = blk: {
4224 if (src_ty_id == dst_ty_id) break :blk src_id;
4225
4226 // TODO: Some more cases are missing here
4227 // See fn bitCast in llvm.zig
4228
4229 if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) {
4230 const result_id = cg.module.allocId();
4231 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
4232 .id_result_type = dst_ty_id,
4233 .id_result = result_id,
4234 .integer_value = src_id,
4235 });
4236 break :blk result_id;
4237 }
4238
4239 // We can only use OpBitcast for specific conversions: between numerical types, and
4240 // between pointers. If the resolved spir-v types fall into this category then emit OpBitcast,
4241 // otherwise use a temporary and perform a pointer cast.
4242 const can_bitcast = (src_ty.isNumeric(zcu) and dst_ty.isNumeric(zcu)) or (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu));
4243 if (can_bitcast) {
4244 const result_id = cg.module.allocId();
4245 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4246 .id_result_type = dst_ty_id,
4247 .id_result = result_id,
4248 .operand = src_id,
4249 });
4250
4251 break :blk result_id;
4252 }
4253
4254 const dst_ptr_ty_id = try cg.ptrType(dst_ty, .function, .indirect);
4255
4256 const tmp_id = try cg.alloc(src_ty, .{ .storage_class = .function });
4257 try cg.store(src_ty, tmp_id, src_id, .{});
4258 const casted_ptr_id = cg.module.allocId();
4259 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4260 .id_result_type = dst_ptr_ty_id,
4261 .id_result = casted_ptr_id,
4262 .operand = tmp_id,
4263 });
4264 break :blk try cg.load(dst_ty, casted_ptr_id, .{});
4265 };
4266
4267 // Because strange integers use sign-extended representation, we may need to normalize
4268 // the result here.
4269 // TODO: This detail could cause stuff like @as(*const i1, @ptrCast(&@as(u1, 1))) to break
4270 // should we change the representation of strange integers?
4271 if (dst_ty.zigTypeTag(zcu) == .int) {
4272 const info = cg.arithmeticTypeInfo(dst_ty);
4273 const result = try cg.normalize(Temporary.init(dst_ty, result_id), info);
4274 return try result.materialize(cg);
4275 }
4276
4277 return result_id;
4278}
4279
4280fn airBitCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4281 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4282 const operand_ty = cg.typeOf(ty_op.operand);
4283 const result_ty = cg.typeOfIndex(inst);
4284 if (operand_ty.toIntern() == .bool_type) {
4285 const operand = try cg.temporary(ty_op.operand);
4286 const result = try cg.intFromBool(operand);
4287 return try result.materialize(cg);
4288 }
4289 const operand_id = try cg.resolve(ty_op.operand);
4290 return try cg.bitCast(result_ty, operand_ty, operand_id);
4291}
4292
4293fn airIntCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4294 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4295 const src = try cg.temporary(ty_op.operand);
4296 const dst_ty = cg.typeOfIndex(inst);
4297
4298 const src_info = cg.arithmeticTypeInfo(src.ty);
4299 const dst_info = cg.arithmeticTypeInfo(dst_ty);
4300
4301 if (src_info.backing_bits == dst_info.backing_bits) {
4302 return try src.materialize(cg);
4303 }
4304
4305 const converted = try cg.buildConvert(dst_ty, src);
4306
4307 // Make sure to normalize the result if shrinking.
4308 // Because strange ints are sign extended in their backing
4309 // type, we don't need to normalize when growing the type. The
4310 // representation is already the same.
4311 const result = if (dst_info.bits < src_info.bits)
4312 try cg.normalize(converted, dst_info)
4313 else
4314 converted;
4315
4316 return try result.materialize(cg);
4317}
4318
4319fn intFromPtr(cg: *CodeGen, operand_id: Id) !Id {
4320 const result_type_id = try cg.resolveType(.usize, .direct);
4321 const result_id = cg.module.allocId();
4322 try cg.body.emit(cg.module.gpa, .OpConvertPtrToU, .{
4323 .id_result_type = result_type_id,
4324 .id_result = result_id,
4325 .pointer = operand_id,
4326 });
4327 return result_id;
4328}
4329
4330fn airFloatFromInt(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4331 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4332 const operand_ty = cg.typeOf(ty_op.operand);
4333 const operand_id = try cg.resolve(ty_op.operand);
4334 const result_ty = cg.typeOfIndex(inst);
4335 return try cg.floatFromInt(result_ty, operand_ty, operand_id);
4336}
4337
4338fn floatFromInt(cg: *CodeGen, result_ty: Type, operand_ty: Type, operand_id: Id) !Id {
4339 const operand_info = cg.arithmeticTypeInfo(operand_ty);
4340 const result_id = cg.module.allocId();
4341 const result_ty_id = try cg.resolveType(result_ty, .direct);
4342 switch (operand_info.signedness) {
4343 .signed => try cg.body.emit(cg.module.gpa, .OpConvertSToF, .{
4344 .id_result_type = result_ty_id,
4345 .id_result = result_id,
4346 .signed_value = operand_id,
4347 }),
4348 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertUToF, .{
4349 .id_result_type = result_ty_id,
4350 .id_result = result_id,
4351 .unsigned_value = operand_id,
4352 }),
4353 }
4354 return result_id;
4355}
4356
4357fn airIntFromFloat(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4358 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4359 const operand_id = try cg.resolve(ty_op.operand);
4360 const result_ty = cg.typeOfIndex(inst);
4361 return try cg.intFromFloat(result_ty, operand_id);
4362}
4363
4364fn intFromFloat(cg: *CodeGen, result_ty: Type, operand_id: Id) !Id {
4365 const result_info = cg.arithmeticTypeInfo(result_ty);
4366 const result_ty_id = try cg.resolveType(result_ty, .direct);
4367 const result_id = cg.module.allocId();
4368 switch (result_info.signedness) {
4369 .signed => try cg.body.emit(cg.module.gpa, .OpConvertFToS, .{
4370 .id_result_type = result_ty_id,
4371 .id_result = result_id,
4372 .float_value = operand_id,
4373 }),
4374 .unsigned => try cg.body.emit(cg.module.gpa, .OpConvertFToU, .{
4375 .id_result_type = result_ty_id,
4376 .id_result = result_id,
4377 .float_value = operand_id,
4378 }),
4379 }
4380 return result_id;
4381}
4382
4383fn airFloatCast(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4384 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4385 const operand = try cg.temporary(ty_op.operand);
4386 const dest_ty = cg.typeOfIndex(inst);
4387 const result = try cg.buildConvert(dest_ty, operand);
4388 return try result.materialize(cg);
4389}
4390
4391fn airNot(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4392 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4393 const operand = try cg.temporary(ty_op.operand);
4394 const result_ty = cg.typeOfIndex(inst);
4395 const info = cg.arithmeticTypeInfo(result_ty);
4396
4397 const result = switch (info.class) {
4398 .bool => try cg.buildUnary(.l_not, operand),
4399 .float => unreachable,
4400 .composite_integer => unreachable, // TODO
4401 .strange_integer, .integer => blk: {
4402 const complement = try cg.buildUnary(.bit_not, operand);
4403 break :blk try cg.normalize(complement, info);
4404 },
4405 };
4406
4407 return try result.materialize(cg);
4408}
4409
4410fn airArrayToSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4411 const pt = cg.pt;
4412 const zcu = pt.zcu;
4413 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4414 const array_ptr_ty = cg.typeOf(ty_op.operand);
4415 const array_ty = array_ptr_ty.childType(zcu);
4416 const slice_ty = cg.typeOfIndex(inst);
4417 const elem_ptr_ty = slice_ty.slicePtrFieldType(zcu);
4418
4419 const elem_ptr_ty_id = try cg.resolveType(elem_ptr_ty, .direct);
4420
4421 const array_ptr_id = try cg.resolve(ty_op.operand);
4422 const len_id = try cg.constInt(.usize, array_ty.arrayLen(zcu));
4423
4424 const elem_ptr_id = if (!array_ty.hasRuntimeBitsIgnoreComptime(zcu))
4425 // Note: The pointer is something like *opaque{}, so we need to bitcast it to the element type.
4426 try cg.bitCast(elem_ptr_ty, array_ptr_ty, array_ptr_id)
4427 else
4428 // Convert the pointer-to-array to a pointer to the first element.
4429 try cg.accessChain(elem_ptr_ty_id, array_ptr_id, &.{0});
4430
4431 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4432 return try cg.constructComposite(slice_ty_id, &.{ elem_ptr_id, len_id });
4433}
4434
4435fn airSlice(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4436 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4437 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4438 const ptr_id = try cg.resolve(bin_op.lhs);
4439 const len_id = try cg.resolve(bin_op.rhs);
4440 const slice_ty = cg.typeOfIndex(inst);
4441 const slice_ty_id = try cg.resolveType(slice_ty, .direct);
4442 return try cg.constructComposite(slice_ty_id, &.{ ptr_id, len_id });
4443}
4444
4445fn airAggregateInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4446 const gpa = cg.module.gpa;
4447 const pt = cg.pt;
4448 const zcu = pt.zcu;
4449 const ip = &zcu.intern_pool;
4450 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4451 const result_ty = cg.typeOfIndex(inst);
4452 const len: usize = @intCast(result_ty.arrayLen(zcu));
4453 const elements: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[ty_pl.payload..][0..len]);
4454
4455 switch (result_ty.zigTypeTag(zcu)) {
4456 .@"struct" => {
4457 if (zcu.typeToPackedStruct(result_ty)) |struct_type| {
4458 comptime assert(Type.packed_struct_layout_version == 2);
4459 const backing_int_ty: Type = .fromInterned(struct_type.backingIntTypeUnordered(ip));
4460 var running_int_id = try cg.constInt(backing_int_ty, 0);
4461 var running_bits: u16 = 0;
4462 for (struct_type.field_types.get(ip), elements) |field_ty_ip, element| {
4463 const field_ty: Type = .fromInterned(field_ty_ip);
4464 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
4465 const field_id = try cg.resolve(element);
4466 const ty_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4467 const field_int_ty = try cg.pt.intType(.unsigned, ty_bit_size);
4468 const field_int_id = blk: {
4469 if (field_ty.isPtrAtRuntime(zcu)) {
4470 assert(cg.module.target.cpu.arch == .spirv64 and
4471 field_ty.ptrAddressSpace(zcu) == .storage_buffer);
4472 break :blk try cg.intFromPtr(field_id);
4473 }
4474 break :blk try cg.bitCast(field_int_ty, field_ty, field_id);
4475 };
4476 const shift_rhs = try cg.constInt(backing_int_ty, running_bits);
4477 const extended_int_conv = try cg.buildConvert(backing_int_ty, .{
4478 .ty = field_int_ty,
4479 .value = .{ .singleton = field_int_id },
4480 });
4481 const shifted = try cg.buildBinary(.sll, extended_int_conv, .{
4482 .ty = backing_int_ty,
4483 .value = .{ .singleton = shift_rhs },
4484 });
4485 const running_int_tmp = try cg.buildBinary(
4486 .bit_or,
4487 .{ .ty = backing_int_ty, .value = .{ .singleton = running_int_id } },
4488 shifted,
4489 );
4490 running_int_id = try running_int_tmp.materialize(cg);
4491 running_bits += ty_bit_size;
4492 }
4493 return running_int_id;
4494 }
4495
4496 const types = try gpa.alloc(Type, elements.len);
4497 defer gpa.free(types);
4498 const constituents = try gpa.alloc(Id, elements.len);
4499 defer gpa.free(constituents);
4500 var index: usize = 0;
4501
4502 switch (ip.indexToKey(result_ty.toIntern())) {
4503 .tuple_type => |tuple| {
4504 for (tuple.types.get(ip), elements, 0..) |field_ty, element, i| {
4505 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4506 assert(Type.fromInterned(field_ty).hasRuntimeBits(zcu));
4507
4508 const id = try cg.resolve(element);
4509 types[index] = .fromInterned(field_ty);
4510 constituents[index] = try cg.convertToIndirect(.fromInterned(field_ty), id);
4511 index += 1;
4512 }
4513 },
4514 .struct_type => {
4515 const struct_type = ip.loadStructType(result_ty.toIntern());
4516 var it = struct_type.iterateRuntimeOrder(ip);
4517 for (elements, 0..) |element, i| {
4518 const field_index = it.next().?;
4519 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4520 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
4521 assert(field_ty.hasRuntimeBitsIgnoreComptime(zcu));
4522
4523 const id = try cg.resolve(element);
4524 types[index] = field_ty;
4525 constituents[index] = try cg.convertToIndirect(field_ty, id);
4526 index += 1;
4527 }
4528 },
4529 else => unreachable,
4530 }
4531
4532 const result_ty_id = try cg.resolveType(result_ty, .direct);
4533 return try cg.constructComposite(result_ty_id, constituents[0..index]);
4534 },
4535 .vector => {
4536 const n_elems = result_ty.vectorLen(zcu);
4537 const elem_ids = try gpa.alloc(Id, n_elems);
4538 defer gpa.free(elem_ids);
4539
4540 for (elements, 0..) |element, i| {
4541 elem_ids[i] = try cg.resolve(element);
4542 }
4543
4544 const result_ty_id = try cg.resolveType(result_ty, .direct);
4545 return try cg.constructComposite(result_ty_id, elem_ids);
4546 },
4547 .array => {
4548 const array_info = result_ty.arrayInfo(zcu);
4549 const n_elems: usize = @intCast(result_ty.arrayLenIncludingSentinel(zcu));
4550 const elem_ids = try gpa.alloc(Id, n_elems);
4551 defer gpa.free(elem_ids);
4552
4553 for (elements, 0..) |element, i| {
4554 const id = try cg.resolve(element);
4555 elem_ids[i] = try cg.convertToIndirect(array_info.elem_type, id);
4556 }
4557
4558 if (array_info.sentinel) |sentinel_val| {
4559 elem_ids[n_elems - 1] = try cg.constant(array_info.elem_type, sentinel_val, .indirect);
4560 }
4561
4562 const result_ty_id = try cg.resolveType(result_ty, .direct);
4563 return try cg.constructComposite(result_ty_id, elem_ids);
4564 },
4565 else => unreachable,
4566 }
4567}
4568
4569fn sliceOrArrayLen(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4570 const pt = cg.pt;
4571 const zcu = pt.zcu;
4572 switch (ty.ptrSize(zcu)) {
4573 .slice => return cg.extractField(.usize, operand_id, 1),
4574 .one => {
4575 const array_ty = ty.childType(zcu);
4576 const elem_ty = array_ty.childType(zcu);
4577 const abi_size = elem_ty.abiSize(zcu);
4578 const size = array_ty.arrayLenIncludingSentinel(zcu) * abi_size;
4579 return try cg.constInt(.usize, size);
4580 },
4581 .many, .c => unreachable,
4582 }
4583}
4584
4585fn sliceOrArrayPtr(cg: *CodeGen, operand_id: Id, ty: Type) !Id {
4586 const zcu = cg.pt.zcu;
4587 if (ty.isSlice(zcu)) {
4588 const ptr_ty = ty.slicePtrFieldType(zcu);
4589 return cg.extractField(ptr_ty, operand_id, 0);
4590 }
4591 return operand_id;
4592}
4593
4594fn airMemcpy(cg: *CodeGen, inst: Air.Inst.Index) !void {
4595 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4596 const dest_slice = try cg.resolve(bin_op.lhs);
4597 const src_slice = try cg.resolve(bin_op.rhs);
4598 const dest_ty = cg.typeOf(bin_op.lhs);
4599 const src_ty = cg.typeOf(bin_op.rhs);
4600 const dest_ptr = try cg.sliceOrArrayPtr(dest_slice, dest_ty);
4601 const src_ptr = try cg.sliceOrArrayPtr(src_slice, src_ty);
4602 const len = try cg.sliceOrArrayLen(dest_slice, dest_ty);
4603 try cg.body.emit(cg.module.gpa, .OpCopyMemorySized, .{
4604 .target = dest_ptr,
4605 .source = src_ptr,
4606 .size = len,
4607 });
4608}
4609
4610fn airMemmove(cg: *CodeGen, inst: Air.Inst.Index) !void {
4611 _ = inst;
4612 return cg.fail("TODO implement airMemcpy for spirv", .{});
4613}
4614
4615fn airSliceField(cg: *CodeGen, inst: Air.Inst.Index, field: u32) !?Id {
4616 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4617 const field_ty = cg.typeOfIndex(inst);
4618 const operand_id = try cg.resolve(ty_op.operand);
4619 return try cg.extractField(field_ty, operand_id, field);
4620}
4621
4622fn airSliceElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4623 const zcu = cg.pt.zcu;
4624 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4625 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4626 const slice_ty = cg.typeOf(bin_op.lhs);
4627 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4628
4629 const slice_id = try cg.resolve(bin_op.lhs);
4630 const index_id = try cg.resolve(bin_op.rhs);
4631
4632 const ptr_ty = cg.typeOfIndex(inst);
4633 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4634
4635 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4636 return try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4637}
4638
4639fn airSliceElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4640 const zcu = cg.pt.zcu;
4641 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4642 const slice_ty = cg.typeOf(bin_op.lhs);
4643 if (!slice_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
4644
4645 const slice_id = try cg.resolve(bin_op.lhs);
4646 const index_id = try cg.resolve(bin_op.rhs);
4647
4648 const ptr_ty = slice_ty.slicePtrFieldType(zcu);
4649 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
4650
4651 const slice_ptr = try cg.extractField(ptr_ty, slice_id, 0);
4652 const elem_ptr = try cg.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4653 return try cg.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) });
4654}
4655
4656fn ptrElemPtr(cg: *CodeGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {
4657 const zcu = cg.pt.zcu;
4658 // Construct new pointer type for the resulting pointer
4659 const elem_ty = ptr_ty.elemType2(zcu); // use elemType() so that we get T for *[N]T.
4660 const elem_ptr_ty_id = try cg.ptrType(elem_ty, cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)), .indirect);
4661 if (ptr_ty.isSinglePointer(zcu)) {
4662 // Pointer-to-array. In this case, the resulting pointer is not of the same type
4663 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.
4664 return try cg.accessChainId(elem_ptr_ty_id, ptr_id, &.{index_id});
4665 } else {
4666 // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain
4667 return try cg.ptrAccessChain(elem_ptr_ty_id, ptr_id, index_id, &.{});
4668 }
4669}
4670
4671fn airPtrElemPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4672 const pt = cg.pt;
4673 const zcu = pt.zcu;
4674 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4675 const bin_op = cg.air.extraData(Air.Bin, ty_pl.payload).data;
4676 const src_ptr_ty = cg.typeOf(bin_op.lhs);
4677 const elem_ty = src_ptr_ty.childType(zcu);
4678 const ptr_id = try cg.resolve(bin_op.lhs);
4679
4680 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4681 const dst_ptr_ty = cg.typeOfIndex(inst);
4682 return try cg.bitCast(dst_ptr_ty, src_ptr_ty, ptr_id);
4683 }
4684
4685 const index_id = try cg.resolve(bin_op.rhs);
4686 return try cg.ptrElemPtr(src_ptr_ty, ptr_id, index_id);
4687}
4688
4689fn airArrayElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4690 const zcu = cg.pt.zcu;
4691 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4692 const array_ty = cg.typeOf(bin_op.lhs);
4693 const elem_ty = array_ty.childType(zcu);
4694 const array_id = try cg.resolve(bin_op.lhs);
4695 const index_id = try cg.resolve(bin_op.rhs);
4696
4697 // SPIR-V doesn't have an array indexing function for some damn reason.
4698 // For now, just generate a temporary and use that.
4699 // TODO: This backend probably also should use isByRef from llvm...
4700
4701 const is_vector = array_ty.isVector(zcu);
4702
4703 const elem_repr: Repr = if (is_vector) .direct else .indirect;
4704 const ptr_array_ty_id = try cg.ptrType(array_ty, .function, .direct);
4705 const ptr_elem_ty_id = try cg.ptrType(elem_ty, .function, elem_repr);
4706
4707 const tmp_id = cg.module.allocId();
4708 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
4709 .id_result_type = ptr_array_ty_id,
4710 .id_result = tmp_id,
4711 .storage_class = .function,
4712 });
4713
4714 try cg.body.emit(cg.module.gpa, .OpStore, .{
4715 .pointer = tmp_id,
4716 .object = array_id,
4717 });
4718
4719 const elem_ptr_id = try cg.accessChainId(ptr_elem_ty_id, tmp_id, &.{index_id});
4720
4721 const result_id = cg.module.allocId();
4722 try cg.body.emit(cg.module.gpa, .OpLoad, .{
4723 .id_result_type = try cg.resolveType(elem_ty, elem_repr),
4724 .id_result = result_id,
4725 .pointer = elem_ptr_id,
4726 });
4727
4728 if (is_vector) {
4729 // Result is already in direct representation
4730 return result_id;
4731 }
4732
4733 // This is an array type; the elements are stored in indirect representation.
4734 // We have to convert the type to direct.
4735
4736 return try cg.convertToDirect(elem_ty, result_id);
4737}
4738
4739fn airPtrElemVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4740 const zcu = cg.pt.zcu;
4741 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4742 const ptr_ty = cg.typeOf(bin_op.lhs);
4743 const elem_ty = cg.typeOfIndex(inst);
4744 const ptr_id = try cg.resolve(bin_op.lhs);
4745 const index_id = try cg.resolve(bin_op.rhs);
4746 const elem_ptr_id = try cg.ptrElemPtr(ptr_ty, ptr_id, index_id);
4747 return try cg.load(elem_ty, elem_ptr_id, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
4748}
4749
4750fn airVectorStoreElem(cg: *CodeGen, inst: Air.Inst.Index) !void {
4751 const zcu = cg.pt.zcu;
4752 const data = cg.air.instructions.items(.data)[@intFromEnum(inst)].vector_store_elem;
4753 const extra = cg.air.extraData(Air.Bin, data.payload).data;
4754
4755 const vector_ptr_ty = cg.typeOf(data.vector_ptr);
4756 const vector_ty = vector_ptr_ty.childType(zcu);
4757 const scalar_ty = vector_ty.scalarType(zcu);
4758
4759 const storage_class = cg.module.storageClass(vector_ptr_ty.ptrAddressSpace(zcu));
4760 const scalar_ptr_ty_id = try cg.ptrType(scalar_ty, storage_class, .indirect);
4761
4762 const vector_ptr = try cg.resolve(data.vector_ptr);
4763 const index = try cg.resolve(extra.lhs);
4764 const operand = try cg.resolve(extra.rhs);
4765
4766 const elem_ptr_id = try cg.accessChainId(scalar_ptr_ty_id, vector_ptr, &.{index});
4767 try cg.store(scalar_ty, elem_ptr_id, operand, .{
4768 .is_volatile = vector_ptr_ty.isVolatilePtr(zcu),
4769 });
4770}
4771
4772fn airSetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !void {
4773 const zcu = cg.pt.zcu;
4774 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4775 const un_ptr_ty = cg.typeOf(bin_op.lhs);
4776 const un_ty = un_ptr_ty.childType(zcu);
4777 const layout = cg.unionLayout(un_ty);
4778
4779 if (layout.tag_size == 0) return;
4780
4781 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4782 const tag_ptr_ty_id = try cg.ptrType(tag_ty, cg.module.storageClass(un_ptr_ty.ptrAddressSpace(zcu)), .indirect);
4783
4784 const union_ptr_id = try cg.resolve(bin_op.lhs);
4785 const new_tag_id = try cg.resolve(bin_op.rhs);
4786
4787 if (!layout.has_payload) {
4788 try cg.store(tag_ty, union_ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4789 } else {
4790 const ptr_id = try cg.accessChain(tag_ptr_ty_id, union_ptr_id, &.{layout.tag_index});
4791 try cg.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4792 }
4793}
4794
4795fn airGetUnionTag(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4796 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4797 const un_ty = cg.typeOf(ty_op.operand);
4798
4799 const zcu = cg.pt.zcu;
4800 const layout = cg.unionLayout(un_ty);
4801 if (layout.tag_size == 0) return null;
4802
4803 const union_handle = try cg.resolve(ty_op.operand);
4804 if (!layout.has_payload) return union_handle;
4805
4806 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4807 return try cg.extractField(tag_ty, union_handle, layout.tag_index);
4808}
4809
4810fn unionInit(
4811 cg: *CodeGen,
4812 ty: Type,
4813 active_field: u32,
4814 payload: ?Id,
4815) !Id {
4816 // To initialize a union, generate a temporary variable with the
4817 // union type, then get the field pointer and pointer-cast it to the
4818 // right type to store it. Finally load the entire union.
4819
4820 // Note: The result here is not cached, because it generates runtime code.
4821
4822 const pt = cg.pt;
4823 const zcu = pt.zcu;
4824 const ip = &zcu.intern_pool;
4825 const union_ty = zcu.typeToUnion(ty).?;
4826 const tag_ty: Type = .fromInterned(union_ty.enum_tag_ty);
4827
4828 const layout = cg.unionLayout(ty);
4829 const payload_ty: Type = .fromInterned(union_ty.field_types.get(ip)[active_field]);
4830
4831 if (union_ty.flagsUnordered(ip).layout == .@"packed") {
4832 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4833 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
4834 return cg.constInt(int_ty, 0);
4835 }
4836
4837 assert(payload != null);
4838 if (payload_ty.isInt(zcu)) {
4839 if (ty.bitSize(zcu) == payload_ty.bitSize(zcu)) {
4840 return cg.bitCast(ty, payload_ty, payload.?);
4841 }
4842
4843 const trunc = try cg.buildConvert(ty, .{ .ty = payload_ty, .value = .{ .singleton = payload.? } });
4844 return try trunc.materialize(cg);
4845 }
4846
4847 const payload_int_ty = try pt.intType(.unsigned, @intCast(payload_ty.bitSize(zcu)));
4848 const payload_int = if (payload_ty.ip_index == .bool_type)
4849 try cg.convertToIndirect(payload_ty, payload.?)
4850 else
4851 try cg.bitCast(payload_int_ty, payload_ty, payload.?);
4852 const trunc = try cg.buildConvert(ty, .{ .ty = payload_int_ty, .value = .{ .singleton = payload_int } });
4853 return try trunc.materialize(cg);
4854 }
4855
4856 const tag_int = if (layout.tag_size != 0) blk: {
4857 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);
4858 const tag_int_val = try tag_val.intFromEnum(tag_ty, pt);
4859 break :blk tag_int_val.toUnsignedInt(zcu);
4860 } else 0;
4861
4862 if (!layout.has_payload) {
4863 return try cg.constInt(tag_ty, tag_int);
4864 }
4865
4866 const tmp_id = try cg.alloc(ty, .{ .storage_class = .function });
4867
4868 if (layout.tag_size != 0) {
4869 const tag_ptr_ty_id = try cg.ptrType(tag_ty, .function, .indirect);
4870 const ptr_id = try cg.accessChain(tag_ptr_ty_id, tmp_id, &.{@as(u32, @intCast(layout.tag_index))});
4871 const tag_id = try cg.constInt(tag_ty, tag_int);
4872 try cg.store(tag_ty, ptr_id, tag_id, .{});
4873 }
4874
4875 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4876 const pl_ptr_ty_id = try cg.ptrType(layout.payload_ty, .function, .indirect);
4877 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4878 const active_pl_ptr_id = if (!layout.payload_ty.eql(payload_ty, zcu)) blk: {
4879 const active_pl_ptr_ty_id = try cg.ptrType(payload_ty, .function, .indirect);
4880 const active_pl_ptr_id = cg.module.allocId();
4881 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4882 .id_result_type = active_pl_ptr_ty_id,
4883 .id_result = active_pl_ptr_id,
4884 .operand = pl_ptr_id,
4885 });
4886 break :blk active_pl_ptr_id;
4887 } else pl_ptr_id;
4888
4889 try cg.store(payload_ty, active_pl_ptr_id, payload.?, .{});
4890 } else {
4891 assert(payload == null);
4892 }
4893
4894 // Just leave the padding fields uninitialized...
4895 // TODO: Or should we initialize them with undef explicitly?
4896
4897 return try cg.load(ty, tmp_id, .{});
4898}
4899
4900fn airUnionInit(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4901 const pt = cg.pt;
4902 const zcu = pt.zcu;
4903 const ip = &zcu.intern_pool;
4904 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4905 const extra = cg.air.extraData(Air.UnionInit, ty_pl.payload).data;
4906 const ty = cg.typeOfIndex(inst);
4907
4908 const union_obj = zcu.typeToUnion(ty).?;
4909 const field_ty: Type = .fromInterned(union_obj.field_types.get(ip)[extra.field_index]);
4910 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
4911 try cg.resolve(extra.init)
4912 else
4913 null;
4914 return try cg.unionInit(ty, extra.field_index, payload);
4915}
4916
4917fn airStructFieldVal(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
4918 const pt = cg.pt;
4919 const zcu = pt.zcu;
4920 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4921 const struct_field = cg.air.extraData(Air.StructField, ty_pl.payload).data;
4922
4923 const object_ty = cg.typeOf(struct_field.struct_operand);
4924 const object_id = try cg.resolve(struct_field.struct_operand);
4925 const field_index = struct_field.field_index;
4926 const field_ty = object_ty.fieldType(field_index, zcu);
4927
4928 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
4929
4930 switch (object_ty.zigTypeTag(zcu)) {
4931 .@"struct" => switch (object_ty.containerLayout(zcu)) {
4932 .@"packed" => {
4933 const struct_ty = zcu.typeToPackedStruct(object_ty).?;
4934 const bit_offset = zcu.structPackedFieldBitOffset(struct_ty, field_index);
4935 const bit_offset_id = try cg.constInt(.u16, bit_offset);
4936 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4937 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4938 const field_int_ty = try pt.intType(signedness, field_bit_size);
4939 const shift_lhs: Temporary = .{ .ty = object_ty, .value = .{ .singleton = object_id } };
4940 const shift = try cg.buildBinary(.srl, shift_lhs, .{ .ty = .u16, .value = .{ .singleton = bit_offset_id } });
4941 const mask_id = try cg.constInt(object_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4942 const masked = try cg.buildBinary(.bit_and, shift, .{ .ty = object_ty, .value = .{ .singleton = mask_id } });
4943 const result_id = blk: {
4944 if (cg.backingIntBits(field_bit_size).@"0" == cg.backingIntBits(@intCast(object_ty.bitSize(zcu))).@"0")
4945 break :blk try cg.bitCast(field_int_ty, object_ty, try masked.materialize(cg));
4946 const trunc = try cg.buildConvert(field_int_ty, masked);
4947 break :blk try trunc.materialize(cg);
4948 };
4949 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4950 if (field_ty.isInt(zcu)) return result_id;
4951 return try cg.bitCast(field_ty, field_int_ty, result_id);
4952 },
4953 else => return try cg.extractField(field_ty, object_id, field_index),
4954 },
4955 .@"union" => switch (object_ty.containerLayout(zcu)) {
4956 .@"packed" => {
4957 const backing_int_ty = try pt.intType(.unsigned, @intCast(object_ty.bitSize(zcu)));
4958 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
4959 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4960 const int_ty = try pt.intType(signedness, field_bit_size);
4961 const mask_id = try cg.constInt(backing_int_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
4962 const masked = try cg.buildBinary(
4963 .bit_and,
4964 .{ .ty = backing_int_ty, .value = .{ .singleton = object_id } },
4965 .{ .ty = backing_int_ty, .value = .{ .singleton = mask_id } },
4966 );
4967 const result_id = blk: {
4968 if (cg.backingIntBits(field_bit_size).@"0" == cg.backingIntBits(@intCast(backing_int_ty.bitSize(zcu))).@"0")
4969 break :blk try cg.bitCast(int_ty, backing_int_ty, try masked.materialize(cg));
4970 const trunc = try cg.buildConvert(int_ty, masked);
4971 break :blk try trunc.materialize(cg);
4972 };
4973 if (field_ty.ip_index == .bool_type) return try cg.convertToDirect(.bool, result_id);
4974 if (field_ty.isInt(zcu)) return result_id;
4975 return try cg.bitCast(field_ty, int_ty, result_id);
4976 },
4977 else => {
4978 // Store, ptr-elem-ptr, pointer-cast, load
4979 const layout = cg.unionLayout(object_ty);
4980 assert(layout.has_payload);
4981
4982 const tmp_id = try cg.alloc(object_ty, .{ .storage_class = .function });
4983 try cg.store(object_ty, tmp_id, object_id, .{});
4984
4985 const pl_ptr_ty_id = try cg.ptrType(layout.payload_ty, .function, .indirect);
4986 const pl_ptr_id = try cg.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
4987
4988 const active_pl_ptr_ty_id = try cg.ptrType(field_ty, .function, .indirect);
4989 const active_pl_ptr_id = cg.module.allocId();
4990 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
4991 .id_result_type = active_pl_ptr_ty_id,
4992 .id_result = active_pl_ptr_id,
4993 .operand = pl_ptr_id,
4994 });
4995 return try cg.load(field_ty, active_pl_ptr_id, .{});
4996 },
4997 },
4998 else => unreachable,
4999 }
5000}
5001
5002fn airFieldParentPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5003 const pt = cg.pt;
5004 const zcu = pt.zcu;
5005 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5006 const extra = cg.air.extraData(Air.FieldParentPtr, ty_pl.payload).data;
5007
5008 const parent_ty = ty_pl.ty.toType().childType(zcu);
5009 const result_ty_id = try cg.resolveType(ty_pl.ty.toType(), .indirect);
5010
5011 const field_ptr = try cg.resolve(extra.field_ptr);
5012 const field_ptr_int = try cg.intFromPtr(field_ptr);
5013 const field_offset = parent_ty.structFieldOffset(extra.field_index, zcu);
5014
5015 const base_ptr_int = base_ptr_int: {
5016 if (field_offset == 0) break :base_ptr_int field_ptr_int;
5017
5018 const field_offset_id = try cg.constInt(.usize, field_offset);
5019 const field_ptr_tmp: Temporary = .init(.usize, field_ptr_int);
5020 const field_offset_tmp: Temporary = .init(.usize, field_offset_id);
5021 const result = try cg.buildBinary(.i_sub, field_ptr_tmp, field_offset_tmp);
5022 break :base_ptr_int try result.materialize(cg);
5023 };
5024
5025 const base_ptr = cg.module.allocId();
5026 try cg.body.emit(cg.module.gpa, .OpConvertUToPtr, .{
5027 .id_result_type = result_ty_id,
5028 .id_result = base_ptr,
5029 .integer_value = base_ptr_int,
5030 });
5031
5032 return base_ptr;
5033}
5034
5035fn structFieldPtr(
5036 cg: *CodeGen,
5037 result_ptr_ty: Type,
5038 object_ptr_ty: Type,
5039 object_ptr: Id,
5040 field_index: u32,
5041) !Id {
5042 const result_ty_id = try cg.resolveType(result_ptr_ty, .direct);
5043
5044 const zcu = cg.pt.zcu;
5045 const object_ty = object_ptr_ty.childType(zcu);
5046 switch (object_ty.zigTypeTag(zcu)) {
5047 .pointer => {
5048 assert(object_ty.isSlice(zcu));
5049 return cg.accessChain(result_ty_id, object_ptr, &.{field_index});
5050 },
5051 .@"struct" => switch (object_ty.containerLayout(zcu)) {
5052 .@"packed" => return cg.todo("implement field access for packed structs", .{}),
5053 else => {
5054 return try cg.accessChain(result_ty_id, object_ptr, &.{field_index});
5055 },
5056 },
5057 .@"union" => {
5058 const layout = cg.unionLayout(object_ty);
5059 if (!layout.has_payload) {
5060 // Asked to get a pointer to a zero-sized field. Just lower this
5061 // to undefined, there is no reason to make it be a valid pointer.
5062 return try cg.module.constUndef(result_ty_id);
5063 }
5064
5065 const storage_class = cg.module.storageClass(object_ptr_ty.ptrAddressSpace(zcu));
5066 const pl_ptr_ty_id = try cg.ptrType(layout.payload_ty, storage_class, .indirect);
5067 const pl_ptr_id = blk: {
5068 if (object_ty.containerLayout(zcu) == .@"packed") break :blk object_ptr;
5069 break :blk try cg.accessChain(pl_ptr_ty_id, object_ptr, &.{layout.payload_index});
5070 };
5071
5072 const active_pl_ptr_id = cg.module.allocId();
5073 try cg.body.emit(cg.module.gpa, .OpBitcast, .{
5074 .id_result_type = result_ty_id,
5075 .id_result = active_pl_ptr_id,
5076 .operand = pl_ptr_id,
5077 });
5078 return active_pl_ptr_id;
5079 },
5080 else => unreachable,
5081 }
5082}
5083
5084fn airStructFieldPtrIndex(cg: *CodeGen, inst: Air.Inst.Index, field_index: u32) !?Id {
5085 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5086 const struct_ptr = try cg.resolve(ty_op.operand);
5087 const struct_ptr_ty = cg.typeOf(ty_op.operand);
5088 const result_ptr_ty = cg.typeOfIndex(inst);
5089 return try cg.structFieldPtr(result_ptr_ty, struct_ptr_ty, struct_ptr, field_index);
5090}
5091
5092const AllocOptions = struct {
5093 initializer: ?Id = null,
5094 /// The final storage class of the pointer. This may be either `.Generic` or `.Function`.
5095 /// In either case, the local is allocated in the `.Function` storage class, and optionally
5096 /// cast back to `.Generic`.
5097 storage_class: StorageClass,
5098};
5099
5100// Allocate a function-local variable, with possible initializer.
5101// This function returns a pointer to a variable of type `ty`,
5102// which is in the Generic address space. The variable is actually
5103// placed in the Function address space.
5104fn alloc(
5105 cg: *CodeGen,
5106 ty: Type,
5107 options: AllocOptions,
5108) !Id {
5109 const ptr_fn_ty_id = try cg.ptrType(ty, .function, .indirect);
5110
5111 // SPIR-V requires that OpVariable declarations for locals go into the first block, so we are just going to
5112 // directly generate them into func.prologue instead of the body.
5113 const var_id = cg.module.allocId();
5114 try cg.prologue.emit(cg.module.gpa, .OpVariable, .{
5115 .id_result_type = ptr_fn_ty_id,
5116 .id_result = var_id,
5117 .storage_class = .function,
5118 .initializer = options.initializer,
5119 });
5120
5121 switch (cg.module.target.os.tag) {
5122 .vulkan, .opengl => return var_id,
5123 else => {},
5124 }
5125
5126 switch (options.storage_class) {
5127 .generic => {
5128 const ptr_gn_ty_id = try cg.ptrType(ty, .generic, .indirect);
5129 // Convert to a generic pointer
5130 return cg.castToGeneric(ptr_gn_ty_id, var_id);
5131 },
5132 .function => return var_id,
5133 else => unreachable,
5134 }
5135}
5136
5137fn airAlloc(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5138 const zcu = cg.pt.zcu;
5139 const ptr_ty = cg.typeOfIndex(inst);
5140 const child_ty = ptr_ty.childType(zcu);
5141 return try cg.alloc(child_ty, .{
5142 .storage_class = cg.module.storageClass(ptr_ty.ptrAddressSpace(zcu)),
5143 });
5144}
5145
5146fn airArg(cg: *CodeGen) Id {
5147 defer cg.next_arg_index += 1;
5148 return cg.args.items[cg.next_arg_index];
5149}
5150
5151/// Given a slice of incoming block connections, returns the block-id of the next
5152/// block to jump to. This function emits instructions, so it should be emitted
5153/// inside the merge block of the block.
5154/// This function should only be called with structured control flow generation.
5155fn structuredNextBlock(cg: *CodeGen, incoming: []const ControlFlow.Structured.Block.Incoming) !Id {
5156 assert(cg.control_flow == .structured);
5157
5158 const result_id = cg.module.allocId();
5159 const block_id_ty_id = try cg.resolveType(.u32, .direct);
5160 try cg.body.emitRaw(cg.module.gpa, .OpPhi, @intCast(2 + incoming.len * 2)); // result type + result + variable/parent...
5161 cg.body.writeOperand(spec.Id, block_id_ty_id);
5162 cg.body.writeOperand(spec.Id, result_id);
5163
5164 for (incoming) |incoming_block| {
5165 cg.body.writeOperand(spec.PairIdRefIdRef, .{ incoming_block.next_block, incoming_block.src_label });
5166 }
5167
5168 return result_id;
5169}
5170
5171/// Jumps to the block with the target block-id. This function must only be called when
5172/// terminating a body, there should be no instructions after it.
5173/// This function should only be called with structured control flow generation.
5174fn structuredBreak(cg: *CodeGen, target_block: Id) !void {
5175 assert(cg.control_flow == .structured);
5176
5177 const gpa = cg.module.gpa;
5178 const sblock = cg.control_flow.structured.block_stack.getLast();
5179 const merge_block = switch (sblock.*) {
5180 .selection => |*merge| blk: {
5181 const merge_label = cg.module.allocId();
5182 try merge.merge_stack.append(gpa, .{
5183 .incoming = .{
5184 .src_label = cg.block_label,
5185 .next_block = target_block,
5186 },
5187 .merge_block = merge_label,
5188 });
5189 break :blk merge_label;
5190 },
5191 // Loop blocks do not end in a break. Not through a direct break,
5192 // and also not through another instruction like cond_br or unreachable (these
5193 // situations are replaced by `cond_br` in sema, or there is a `block` instruction
5194 // placed around them).
5195 .loop => unreachable,
5196 };
5197
5198 try cg.body.emitBranch(cg.module.gpa, merge_block);
5199}
5200
5201/// Generate a body in a way that exits the body using only structured constructs.
5202/// Returns the block-id of the next block to jump to. After this function, a jump
5203/// should still be emitted to the block that should follow this structured body.
5204/// This function should only be called with structured control flow generation.
5205fn genStructuredBody(
5206 cg: *CodeGen,
5207 /// This parameter defines the method that this structured body is exited with.
5208 block_merge_type: union(enum) {
5209 /// Using selection; early exits from this body are surrounded with
5210 /// if() statements.
5211 selection,
5212 /// Using loops; loops can be early exited by jumping to the merge block at
5213 /// any time.
5214 loop: struct {
5215 merge_label: Id,
5216 continue_label: Id,
5217 },
5218 },
5219 body: []const Air.Inst.Index,
5220) !Id {
5221 assert(cg.control_flow == .structured);
5222
5223 const gpa = cg.module.gpa;
5224
5225 var sblock: ControlFlow.Structured.Block = switch (block_merge_type) {
5226 .loop => |merge| .{ .loop = .{
5227 .merge_block = merge.merge_label,
5228 } },
5229 .selection => .{ .selection = .{} },
5230 };
5231 defer sblock.deinit(gpa);
5232
5233 {
5234 try cg.control_flow.structured.block_stack.append(gpa, &sblock);
5235 defer _ = cg.control_flow.structured.block_stack.pop();
5236
5237 try cg.genBody(body);
5238 }
5239
5240 switch (sblock) {
5241 .selection => |merge| {
5242 // Now generate the merge block for all merges that
5243 // still need to be performed.
5244 const merge_stack = merge.merge_stack.items;
5245
5246 // If no merges on the stack, this block didn't generate any jumps (all paths
5247 // ended with a return or an unreachable). In that case, we don't need to do
5248 // any merging.
5249 if (merge_stack.len == 0) {
5250 // We still need to return a value of a next block to jump to.
5251 // For example, if we have code like
5252 // if (x) {
5253 // if (y) return else return;
5254 // } else {}
5255 // then we still need the outer to have an OpSelectionMerge and consequently
5256 // a phi node. In that case we can just return bogus, since we know that its
5257 // path will never be taken.
5258
5259 // Make sure that we are still in a block when exiting the function.
5260 // TODO: Can we get rid of that?
5261 try cg.beginSpvBlock(cg.module.allocId());
5262 const block_id_ty_id = try cg.resolveType(.u32, .direct);
5263 return try cg.module.constUndef(block_id_ty_id);
5264 }
5265
5266 // The top-most merge actually only has a single source, the
5267 // final jump of the block, or the merge block of a sub-block, cond_br,
5268 // or loop. Therefore we just need to generate a block with a jump to the
5269 // next merge block.
5270 try cg.beginSpvBlock(merge_stack[merge_stack.len - 1].merge_block);
5271
5272 // Now generate a merge ladder for the remaining merges in the stack.
5273 var incoming: ControlFlow.Structured.Block.Incoming = .{
5274 .src_label = cg.block_label,
5275 .next_block = merge_stack[merge_stack.len - 1].incoming.next_block,
5276 };
5277 var i = merge_stack.len - 1;
5278 while (i > 0) {
5279 i -= 1;
5280 const step = merge_stack[i];
5281 try cg.body.emitBranch(cg.module.gpa, step.merge_block);
5282 try cg.beginSpvBlock(step.merge_block);
5283 const next_block = try cg.structuredNextBlock(&.{ incoming, step.incoming });
5284 incoming = .{
5285 .src_label = step.merge_block,
5286 .next_block = next_block,
5287 };
5288 }
5289
5290 return incoming.next_block;
5291 },
5292 .loop => |merge| {
5293 // Close the loop by jumping to the continue label
5294 try cg.body.emitBranch(cg.module.gpa, block_merge_type.loop.continue_label);
5295 // For blocks we must simple merge all the incoming blocks to get the next block.
5296 try cg.beginSpvBlock(merge.merge_block);
5297 return try cg.structuredNextBlock(merge.merges.items);
5298 },
5299 }
5300}
5301
5302fn airBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5303 const inst_datas = cg.air.instructions.items(.data);
5304 const extra = cg.air.extraData(Air.Block, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5305 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
5306}
5307
5308fn lowerBlock(cg: *CodeGen, inst: Air.Inst.Index, body: []const Air.Inst.Index) !?Id {
5309 // In AIR, a block doesn't really define an entry point like a block, but
5310 // more like a scope that breaks can jump out of and "return" a value from.
5311 // This cannot be directly modelled in SPIR-V, so in a block instruction,
5312 // we're going to split up the current block by first generating the code
5313 // of the block, then a label, and then generate the rest of the current
5314 // ir.Block in a different SPIR-V block.
5315
5316 const gpa = cg.module.gpa;
5317 const pt = cg.pt;
5318 const zcu = pt.zcu;
5319 const ty = cg.typeOfIndex(inst);
5320 const have_block_result = ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu);
5321
5322 const cf = switch (cg.control_flow) {
5323 .structured => |*cf| cf,
5324 .unstructured => |*cf| {
5325 var block: ControlFlow.Unstructured.Block = .{};
5326 defer block.incoming_blocks.deinit(gpa);
5327
5328 // 4 chosen as arbitrary initial capacity.
5329 try block.incoming_blocks.ensureUnusedCapacity(gpa, 4);
5330
5331 try cf.blocks.putNoClobber(gpa, inst, &block);
5332 defer assert(cf.blocks.remove(inst));
5333
5334 try cg.genBody(body);
5335
5336 // Only begin a new block if there were actually any breaks towards it.
5337 if (block.label) |label| {
5338 try cg.beginSpvBlock(label);
5339 }
5340
5341 if (!have_block_result)
5342 return null;
5343
5344 assert(block.label != null);
5345 const result_id = cg.module.allocId();
5346 const result_type_id = try cg.resolveType(ty, .direct);
5347
5348 try cg.body.emitRaw(
5349 cg.module.gpa,
5350 .OpPhi,
5351 // result type + result + variable/parent...
5352 2 + @as(u16, @intCast(block.incoming_blocks.items.len * 2)),
5353 );
5354 cg.body.writeOperand(spec.Id, result_type_id);
5355 cg.body.writeOperand(spec.Id, result_id);
5356
5357 for (block.incoming_blocks.items) |incoming| {
5358 cg.body.writeOperand(
5359 spec.PairIdRefIdRef,
5360 .{ incoming.break_value_id, incoming.src_label },
5361 );
5362 }
5363
5364 return result_id;
5365 },
5366 };
5367
5368 const maybe_block_result_var_id = if (have_block_result) blk: {
5369 const block_result_var_id = try cg.alloc(ty, .{ .storage_class = .function });
5370 try cf.block_results.putNoClobber(gpa, inst, block_result_var_id);
5371 break :blk block_result_var_id;
5372 } else null;
5373 defer if (have_block_result) assert(cf.block_results.remove(inst));
5374
5375 const next_block = try cg.genStructuredBody(.selection, body);
5376
5377 // When encountering a block instruction, we are always at least in the function's scope,
5378 // so there always has to be another entry.
5379 assert(cf.block_stack.items.len > 0);
5380
5381 // Check if the target of the branch was this current block.
5382 const this_block = try cg.constInt(.u32, @intFromEnum(inst));
5383 const jump_to_this_block_id = cg.module.allocId();
5384 const bool_ty_id = try cg.resolveType(.bool, .direct);
5385 try cg.body.emit(cg.module.gpa, .OpIEqual, .{
5386 .id_result_type = bool_ty_id,
5387 .id_result = jump_to_this_block_id,
5388 .operand_1 = next_block,
5389 .operand_2 = this_block,
5390 });
5391
5392 const sblock = cf.block_stack.getLast();
5393
5394 if (ty.isNoReturn(zcu)) {
5395 // If this block is noreturn, this instruction is the last of a block,
5396 // and we must simply jump to the block's merge unconditionally.
5397 try cg.structuredBreak(next_block);
5398 } else {
5399 switch (sblock.*) {
5400 .selection => |*merge| {
5401 // To jump out of a selection block, push a new entry onto its merge stack and
5402 // generate a conditional branch to there and to the instructions following this block.
5403 const merge_label = cg.module.allocId();
5404 const then_label = cg.module.allocId();
5405 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5406 .merge_block = merge_label,
5407 .selection_control = .{},
5408 });
5409 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5410 .condition = jump_to_this_block_id,
5411 .true_label = then_label,
5412 .false_label = merge_label,
5413 });
5414 try merge.merge_stack.append(gpa, .{
5415 .incoming = .{
5416 .src_label = cg.block_label,
5417 .next_block = next_block,
5418 },
5419 .merge_block = merge_label,
5420 });
5421
5422 try cg.beginSpvBlock(then_label);
5423 },
5424 .loop => |*merge| {
5425 // To jump out of a loop block, generate a conditional that exits the block
5426 // to the loop merge if the target ID is not the one of this block.
5427 const continue_label = cg.module.allocId();
5428 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5429 .condition = jump_to_this_block_id,
5430 .true_label = continue_label,
5431 .false_label = merge.merge_block,
5432 });
5433 try merge.merges.append(gpa, .{
5434 .src_label = cg.block_label,
5435 .next_block = next_block,
5436 });
5437 try cg.beginSpvBlock(continue_label);
5438 },
5439 }
5440 }
5441
5442 if (maybe_block_result_var_id) |block_result_var_id| {
5443 return try cg.load(ty, block_result_var_id, .{});
5444 }
5445
5446 return null;
5447}
5448
5449fn airBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5450 const gpa = cg.module.gpa;
5451 const zcu = cg.pt.zcu;
5452 const br = cg.air.instructions.items(.data)[@intFromEnum(inst)].br;
5453 const operand_ty = cg.typeOf(br.operand);
5454
5455 switch (cg.control_flow) {
5456 .structured => |*cf| {
5457 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5458 const operand_id = try cg.resolve(br.operand);
5459 const block_result_var_id = cf.block_results.get(br.block_inst).?;
5460 try cg.store(operand_ty, block_result_var_id, operand_id, .{});
5461 }
5462
5463 const next_block = try cg.constInt(.u32, @intFromEnum(br.block_inst));
5464 try cg.structuredBreak(next_block);
5465 },
5466 .unstructured => |cf| {
5467 const block = cf.blocks.get(br.block_inst).?;
5468 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5469 const operand_id = try cg.resolve(br.operand);
5470 // block_label should not be undefined here, lest there
5471 // is a br or br_void in the function's body.
5472 try block.incoming_blocks.append(gpa, .{
5473 .src_label = cg.block_label,
5474 .break_value_id = operand_id,
5475 });
5476 }
5477
5478 if (block.label == null) {
5479 block.label = cg.module.allocId();
5480 }
5481
5482 try cg.body.emitBranch(cg.module.gpa, block.label.?);
5483 },
5484 }
5485}
5486
5487fn airCondBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
5488 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5489 const cond_br = cg.air.extraData(Air.CondBr, pl_op.payload);
5490 const then_body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[cond_br.end..][0..cond_br.data.then_body_len]);
5491 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]);
5492 const condition_id = try cg.resolve(pl_op.operand);
5493
5494 const then_label = cg.module.allocId();
5495 const else_label = cg.module.allocId();
5496
5497 switch (cg.control_flow) {
5498 .structured => {
5499 const merge_label = cg.module.allocId();
5500
5501 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5502 .merge_block = merge_label,
5503 .selection_control = .{},
5504 });
5505 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5506 .condition = condition_id,
5507 .true_label = then_label,
5508 .false_label = else_label,
5509 });
5510
5511 try cg.beginSpvBlock(then_label);
5512 const then_next = try cg.genStructuredBody(.selection, then_body);
5513 const then_incoming: ControlFlow.Structured.Block.Incoming = .{
5514 .src_label = cg.block_label,
5515 .next_block = then_next,
5516 };
5517 try cg.body.emitBranch(cg.module.gpa, merge_label);
5518
5519 try cg.beginSpvBlock(else_label);
5520 const else_next = try cg.genStructuredBody(.selection, else_body);
5521 const else_incoming: ControlFlow.Structured.Block.Incoming = .{
5522 .src_label = cg.block_label,
5523 .next_block = else_next,
5524 };
5525 try cg.body.emitBranch(cg.module.gpa, merge_label);
5526
5527 try cg.beginSpvBlock(merge_label);
5528 const next_block = try cg.structuredNextBlock(&.{ then_incoming, else_incoming });
5529
5530 try cg.structuredBreak(next_block);
5531 },
5532 .unstructured => {
5533 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5534 .condition = condition_id,
5535 .true_label = then_label,
5536 .false_label = else_label,
5537 });
5538
5539 try cg.beginSpvBlock(then_label);
5540 try cg.genBody(then_body);
5541 try cg.beginSpvBlock(else_label);
5542 try cg.genBody(else_body);
5543 },
5544 }
5545}
5546
5547fn airLoop(cg: *CodeGen, inst: Air.Inst.Index) !void {
5548 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5549 const loop = cg.air.extraData(Air.Block, ty_pl.payload);
5550 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[loop.end..][0..loop.data.body_len]);
5551
5552 const body_label = cg.module.allocId();
5553
5554 switch (cg.control_flow) {
5555 .structured => {
5556 const header_label = cg.module.allocId();
5557 const merge_label = cg.module.allocId();
5558 const continue_label = cg.module.allocId();
5559
5560 // The back-edge must point to the loop header, so generate a separate block for the
5561 // loop header so that we don't accidentally include some instructions from there
5562 // in the loop.
5563 try cg.body.emitBranch(cg.module.gpa, header_label);
5564 try cg.beginSpvBlock(header_label);
5565
5566 // Emit loop header and jump to loop body
5567 try cg.body.emit(cg.module.gpa, .OpLoopMerge, .{
5568 .merge_block = merge_label,
5569 .continue_target = continue_label,
5570 .loop_control = .{},
5571 });
5572 try cg.body.emitBranch(cg.module.gpa, body_label);
5573
5574 try cg.beginSpvBlock(body_label);
5575
5576 const next_block = try cg.genStructuredBody(.{ .loop = .{
5577 .merge_label = merge_label,
5578 .continue_label = continue_label,
5579 } }, body);
5580 try cg.structuredBreak(next_block);
5581
5582 try cg.beginSpvBlock(continue_label);
5583 try cg.body.emitBranch(cg.module.gpa, header_label);
5584 },
5585 .unstructured => {
5586 try cg.body.emitBranch(cg.module.gpa, body_label);
5587 try cg.beginSpvBlock(body_label);
5588 try cg.genBody(body);
5589 try cg.body.emitBranch(cg.module.gpa, body_label);
5590 },
5591 }
5592}
5593
5594fn airLoad(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5595 const zcu = cg.pt.zcu;
5596 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5597 const ptr_ty = cg.typeOf(ty_op.operand);
5598 const elem_ty = cg.typeOfIndex(inst);
5599 const operand = try cg.resolve(ty_op.operand);
5600 if (!ptr_ty.isVolatilePtr(zcu) and cg.liveness.isUnused(inst)) return null;
5601
5602 return try cg.load(elem_ty, operand, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5603}
5604
5605fn airStore(cg: *CodeGen, inst: Air.Inst.Index) !void {
5606 const zcu = cg.pt.zcu;
5607 const bin_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
5608 const ptr_ty = cg.typeOf(bin_op.lhs);
5609 const elem_ty = ptr_ty.childType(zcu);
5610 const ptr = try cg.resolve(bin_op.lhs);
5611 const value = try cg.resolve(bin_op.rhs);
5612
5613 try cg.store(elem_ty, ptr, value, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5614}
5615
5616fn airRet(cg: *CodeGen, inst: Air.Inst.Index) !void {
5617 const pt = cg.pt;
5618 const zcu = pt.zcu;
5619 const operand = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5620 const ret_ty = cg.typeOf(operand);
5621 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5622 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5623 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5624 // Functions with an empty error set are emitted with an error code
5625 // return type and return zero so they can be function pointers coerced
5626 // to functions that return anyerror.
5627 const no_err_id = try cg.constInt(.anyerror, 0);
5628 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5629 } else {
5630 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5631 }
5632 }
5633
5634 const operand_id = try cg.resolve(operand);
5635 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = operand_id });
5636}
5637
5638fn airRetLoad(cg: *CodeGen, inst: Air.Inst.Index) !void {
5639 const pt = cg.pt;
5640 const zcu = pt.zcu;
5641 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5642 const ptr_ty = cg.typeOf(un_op);
5643 const ret_ty = ptr_ty.childType(zcu);
5644
5645 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5646 const fn_info = zcu.typeToFunc(zcu.navValue(cg.owner_nav).typeOf(zcu)).?;
5647 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5648 // Functions with an empty error set are emitted with an error code
5649 // return type and return zero so they can be function pointers coerced
5650 // to functions that return anyerror.
5651 const no_err_id = try cg.constInt(.anyerror, 0);
5652 return try cg.body.emit(cg.module.gpa, .OpReturnValue, .{ .value = no_err_id });
5653 } else {
5654 return try cg.body.emit(cg.module.gpa, .OpReturn, {});
5655 }
5656 }
5657
5658 const ptr = try cg.resolve(un_op);
5659 const value = try cg.load(ret_ty, ptr, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5660 try cg.body.emit(cg.module.gpa, .OpReturnValue, .{
5661 .value = value,
5662 });
5663}
5664
5665fn airTry(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5666 const zcu = cg.pt.zcu;
5667 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5668 const err_union_id = try cg.resolve(pl_op.operand);
5669 const extra = cg.air.extraData(Air.Try, pl_op.payload);
5670 const body: []const Air.Inst.Index = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]);
5671
5672 const err_union_ty = cg.typeOf(pl_op.operand);
5673 const payload_ty = cg.typeOfIndex(inst);
5674
5675 const bool_ty_id = try cg.resolveType(.bool, .direct);
5676
5677 const eu_layout = cg.errorUnionLayout(payload_ty);
5678
5679 if (!err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5680 const err_id = if (eu_layout.payload_has_bits)
5681 try cg.extractField(.anyerror, err_union_id, eu_layout.errorFieldIndex())
5682 else
5683 err_union_id;
5684
5685 const zero_id = try cg.constInt(.anyerror, 0);
5686 const is_err_id = cg.module.allocId();
5687 try cg.body.emit(cg.module.gpa, .OpINotEqual, .{
5688 .id_result_type = bool_ty_id,
5689 .id_result = is_err_id,
5690 .operand_1 = err_id,
5691 .operand_2 = zero_id,
5692 });
5693
5694 // When there is an error, we must evaluate `body`. Otherwise we must continue
5695 // with the current body.
5696 // Just generate a new block here, then generate a new block inline for the remainder of the body.
5697
5698 const err_block = cg.module.allocId();
5699 const ok_block = cg.module.allocId();
5700
5701 switch (cg.control_flow) {
5702 .structured => {
5703 // According to AIR documentation, this block is guaranteed
5704 // to not break and end in a return instruction. Thus,
5705 // for structured control flow, we can just naively use
5706 // the ok block as the merge block here.
5707 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
5708 .merge_block = ok_block,
5709 .selection_control = .{},
5710 });
5711 },
5712 .unstructured => {},
5713 }
5714
5715 try cg.body.emit(cg.module.gpa, .OpBranchConditional, .{
5716 .condition = is_err_id,
5717 .true_label = err_block,
5718 .false_label = ok_block,
5719 });
5720
5721 try cg.beginSpvBlock(err_block);
5722 try cg.genBody(body);
5723
5724 try cg.beginSpvBlock(ok_block);
5725 }
5726
5727 if (!eu_layout.payload_has_bits) {
5728 return null;
5729 }
5730
5731 // Now just extract the payload, if required.
5732 return try cg.extractField(payload_ty, err_union_id, eu_layout.payloadFieldIndex());
5733}
5734
5735fn airErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5736 const zcu = cg.pt.zcu;
5737 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5738 const operand_id = try cg.resolve(ty_op.operand);
5739 const err_union_ty = cg.typeOf(ty_op.operand);
5740 const err_ty_id = try cg.resolveType(.anyerror, .direct);
5741
5742 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5743 // No error possible, so just return undefined.
5744 return try cg.module.constUndef(err_ty_id);
5745 }
5746
5747 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5748 const eu_layout = cg.errorUnionLayout(payload_ty);
5749
5750 if (!eu_layout.payload_has_bits) {
5751 // If no payload, error union is represented by error set.
5752 return operand_id;
5753 }
5754
5755 return try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5756}
5757
5758fn airErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5759 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5760 const operand_id = try cg.resolve(ty_op.operand);
5761 const payload_ty = cg.typeOfIndex(inst);
5762 const eu_layout = cg.errorUnionLayout(payload_ty);
5763
5764 if (!eu_layout.payload_has_bits) {
5765 return null; // No error possible.
5766 }
5767
5768 return try cg.extractField(payload_ty, operand_id, eu_layout.payloadFieldIndex());
5769}
5770
5771fn airWrapErrUnionErr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5772 const zcu = cg.pt.zcu;
5773 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5774 const err_union_ty = cg.typeOfIndex(inst);
5775 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5776 const operand_id = try cg.resolve(ty_op.operand);
5777 const eu_layout = cg.errorUnionLayout(payload_ty);
5778
5779 if (!eu_layout.payload_has_bits) {
5780 return operand_id;
5781 }
5782
5783 const payload_ty_id = try cg.resolveType(payload_ty, .indirect);
5784
5785 var members: [2]Id = undefined;
5786 members[eu_layout.errorFieldIndex()] = operand_id;
5787 members[eu_layout.payloadFieldIndex()] = try cg.module.constUndef(payload_ty_id);
5788
5789 var types: [2]Type = undefined;
5790 types[eu_layout.errorFieldIndex()] = .anyerror;
5791 types[eu_layout.payloadFieldIndex()] = payload_ty;
5792
5793 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5794 return try cg.constructComposite(err_union_ty_id, &members);
5795}
5796
5797fn airWrapErrUnionPayload(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5798 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5799 const err_union_ty = cg.typeOfIndex(inst);
5800 const operand_id = try cg.resolve(ty_op.operand);
5801 const payload_ty = cg.typeOf(ty_op.operand);
5802 const eu_layout = cg.errorUnionLayout(payload_ty);
5803
5804 if (!eu_layout.payload_has_bits) {
5805 return try cg.constInt(.anyerror, 0);
5806 }
5807
5808 var members: [2]Id = undefined;
5809 members[eu_layout.errorFieldIndex()] = try cg.constInt(.anyerror, 0);
5810 members[eu_layout.payloadFieldIndex()] = try cg.convertToIndirect(payload_ty, operand_id);
5811
5812 var types: [2]Type = undefined;
5813 types[eu_layout.errorFieldIndex()] = .anyerror;
5814 types[eu_layout.payloadFieldIndex()] = payload_ty;
5815
5816 const err_union_ty_id = try cg.resolveType(err_union_ty, .direct);
5817 return try cg.constructComposite(err_union_ty_id, &members);
5818}
5819
5820fn airIsNull(cg: *CodeGen, inst: Air.Inst.Index, is_pointer: bool, pred: enum { is_null, is_non_null }) !?Id {
5821 const pt = cg.pt;
5822 const zcu = pt.zcu;
5823 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5824 const operand_id = try cg.resolve(un_op);
5825 const operand_ty = cg.typeOf(un_op);
5826 const optional_ty = if (is_pointer) operand_ty.childType(zcu) else operand_ty;
5827 const payload_ty = optional_ty.optionalChild(zcu);
5828
5829 const bool_ty_id = try cg.resolveType(.bool, .direct);
5830
5831 if (optional_ty.optionalReprIsPayload(zcu)) {
5832 // Pointer payload represents nullability: pointer or slice.
5833 const loaded_id = if (is_pointer)
5834 try cg.load(optional_ty, operand_id, .{})
5835 else
5836 operand_id;
5837
5838 const ptr_ty = if (payload_ty.isSlice(zcu))
5839 payload_ty.slicePtrFieldType(zcu)
5840 else
5841 payload_ty;
5842
5843 const ptr_id = if (payload_ty.isSlice(zcu))
5844 try cg.extractField(ptr_ty, loaded_id, 0)
5845 else
5846 loaded_id;
5847
5848 const ptr_ty_id = try cg.resolveType(ptr_ty, .direct);
5849 const null_id = try cg.module.constNull(ptr_ty_id);
5850 const null_tmp: Temporary = .init(ptr_ty, null_id);
5851 const ptr: Temporary = .init(ptr_ty, ptr_id);
5852
5853 const op: std.math.CompareOperator = switch (pred) {
5854 .is_null => .eq,
5855 .is_non_null => .neq,
5856 };
5857 const result = try cg.cmp(op, ptr, null_tmp);
5858 return try result.materialize(cg);
5859 }
5860
5861 const is_non_null_id = blk: {
5862 if (is_pointer) {
5863 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5864 const storage_class = cg.module.storageClass(operand_ty.ptrAddressSpace(zcu));
5865 const bool_ptr_ty_id = try cg.ptrType(.bool, storage_class, .indirect);
5866 const tag_ptr_id = try cg.accessChain(bool_ptr_ty_id, operand_id, &.{1});
5867 break :blk try cg.load(.bool, tag_ptr_id, .{});
5868 }
5869
5870 break :blk try cg.load(.bool, operand_id, .{});
5871 }
5872
5873 break :blk if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
5874 try cg.extractField(.bool, operand_id, 1)
5875 else
5876 // Optional representation is bool indicating whether the optional is set
5877 // Optionals with no payload are represented as an (indirect) bool, so convert
5878 // it back to the direct bool here.
5879 try cg.convertToDirect(.bool, operand_id);
5880 };
5881
5882 return switch (pred) {
5883 .is_null => blk: {
5884 // Invert condition
5885 const result_id = cg.module.allocId();
5886 try cg.body.emit(cg.module.gpa, .OpLogicalNot, .{
5887 .id_result_type = bool_ty_id,
5888 .id_result = result_id,
5889 .operand = is_non_null_id,
5890 });
5891 break :blk result_id;
5892 },
5893 .is_non_null => is_non_null_id,
5894 };
5895}
5896
5897fn airIsErr(cg: *CodeGen, inst: Air.Inst.Index, pred: enum { is_err, is_non_err }) !?Id {
5898 const zcu = cg.pt.zcu;
5899 const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5900 const operand_id = try cg.resolve(un_op);
5901 const err_union_ty = cg.typeOf(un_op);
5902
5903 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5904 return try cg.constBool(pred == .is_non_err, .direct);
5905 }
5906
5907 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5908 const eu_layout = cg.errorUnionLayout(payload_ty);
5909 const bool_ty_id = try cg.resolveType(.bool, .direct);
5910
5911 const error_id = if (!eu_layout.payload_has_bits)
5912 operand_id
5913 else
5914 try cg.extractField(.anyerror, operand_id, eu_layout.errorFieldIndex());
5915
5916 const result_id = cg.module.allocId();
5917 switch (pred) {
5918 inline else => |pred_ct| try cg.body.emit(
5919 cg.module.gpa,
5920 switch (pred_ct) {
5921 .is_err => .OpINotEqual,
5922 .is_non_err => .OpIEqual,
5923 },
5924 .{
5925 .id_result_type = bool_ty_id,
5926 .id_result = result_id,
5927 .operand_1 = error_id,
5928 .operand_2 = try cg.constInt(.anyerror, 0),
5929 },
5930 ),
5931 }
5932 return result_id;
5933}
5934
5935fn airUnwrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5936 const pt = cg.pt;
5937 const zcu = pt.zcu;
5938 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5939 const operand_id = try cg.resolve(ty_op.operand);
5940 const optional_ty = cg.typeOf(ty_op.operand);
5941 const payload_ty = cg.typeOfIndex(inst);
5942
5943 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
5944
5945 if (optional_ty.optionalReprIsPayload(zcu)) {
5946 return operand_id;
5947 }
5948
5949 return try cg.extractField(payload_ty, operand_id, 0);
5950}
5951
5952fn airUnwrapOptionalPtr(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5953 const pt = cg.pt;
5954 const zcu = pt.zcu;
5955 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5956 const operand_id = try cg.resolve(ty_op.operand);
5957 const operand_ty = cg.typeOf(ty_op.operand);
5958 const optional_ty = operand_ty.childType(zcu);
5959 const payload_ty = optional_ty.optionalChild(zcu);
5960 const result_ty = cg.typeOfIndex(inst);
5961 const result_ty_id = try cg.resolveType(result_ty, .direct);
5962
5963 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5964 // There is no payload, but we still need to return a valid pointer.
5965 // We can just return anything here, so just return a pointer to the operand.
5966 return try cg.bitCast(result_ty, operand_ty, operand_id);
5967 }
5968
5969 if (optional_ty.optionalReprIsPayload(zcu)) {
5970 // They are the same value.
5971 return try cg.bitCast(result_ty, operand_ty, operand_id);
5972 }
5973
5974 return try cg.accessChain(result_ty_id, operand_id, &.{0});
5975}
5976
5977fn airWrapOptional(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
5978 const pt = cg.pt;
5979 const zcu = pt.zcu;
5980 const ty_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5981 const payload_ty = cg.typeOf(ty_op.operand);
5982
5983 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5984 return try cg.constBool(true, .indirect);
5985 }
5986
5987 const operand_id = try cg.resolve(ty_op.operand);
5988
5989 const optional_ty = cg.typeOfIndex(inst);
5990 if (optional_ty.optionalReprIsPayload(zcu)) {
5991 return operand_id;
5992 }
5993
5994 const payload_id = try cg.convertToIndirect(payload_ty, operand_id);
5995 const members = [_]Id{ payload_id, try cg.constBool(true, .indirect) };
5996 const optional_ty_id = try cg.resolveType(optional_ty, .direct);
5997 return try cg.constructComposite(optional_ty_id, &members);
5998}
5999
6000fn airSwitchBr(cg: *CodeGen, inst: Air.Inst.Index) !void {
6001 const gpa = cg.module.gpa;
6002 const pt = cg.pt;
6003 const zcu = pt.zcu;
6004 const target = cg.module.target;
6005 const switch_br = cg.air.unwrapSwitch(inst);
6006 const cond_ty = cg.typeOf(switch_br.operand);
6007 const cond = try cg.resolve(switch_br.operand);
6008 var cond_indirect = try cg.convertToIndirect(cond_ty, cond);
6009
6010 const cond_words: u32 = switch (cond_ty.zigTypeTag(zcu)) {
6011 .bool, .error_set => 1,
6012 .int => blk: {
6013 const bits = cond_ty.intInfo(zcu).bits;
6014 const backing_bits, const big_int = cg.backingIntBits(bits);
6015 if (big_int) return cg.todo("implement composite int switch", .{});
6016 break :blk if (backing_bits <= 32) 1 else 2;
6017 },
6018 .@"enum" => blk: {
6019 const int_ty = cond_ty.intTagType(zcu);
6020 const int_info = int_ty.intInfo(zcu);
6021 const backing_bits, const big_int = cg.backingIntBits(int_info.bits);
6022 if (big_int) return cg.todo("implement composite int switch", .{});
6023 break :blk if (backing_bits <= 32) 1 else 2;
6024 },
6025 .pointer => blk: {
6026 cond_indirect = try cg.intFromPtr(cond_indirect);
6027 break :blk target.ptrBitWidth() / 32;
6028 },
6029 // TODO: Figure out which types apply here, and work around them as we can only do integers.
6030 else => return cg.todo("implement switch for type {s}", .{@tagName(cond_ty.zigTypeTag(zcu))}),
6031 };
6032
6033 const num_cases = switch_br.cases_len;
6034
6035 // Compute the total number of arms that we need.
6036 // Zig switches are grouped by condition, so we need to loop through all of them
6037 const num_conditions = blk: {
6038 var num_conditions: u32 = 0;
6039 var it = switch_br.iterateCases();
6040 while (it.next()) |case| {
6041 if (case.ranges.len > 0) return cg.todo("switch with ranges", .{});
6042 num_conditions += @intCast(case.items.len);
6043 }
6044 break :blk num_conditions;
6045 };
6046
6047 // First, pre-allocate the labels for the cases.
6048 const case_labels = cg.module.allocIds(num_cases);
6049 // We always need the default case - if zig has none, we will generate unreachable there.
6050 const default = cg.module.allocId();
6051
6052 const merge_label = switch (cg.control_flow) {
6053 .structured => cg.module.allocId(),
6054 .unstructured => null,
6055 };
6056
6057 if (cg.control_flow == .structured) {
6058 try cg.body.emit(cg.module.gpa, .OpSelectionMerge, .{
6059 .merge_block = merge_label.?,
6060 .selection_control = .{},
6061 });
6062 }
6063
6064 // Emit the instruction before generating the blocks.
6065 try cg.body.emitRaw(cg.module.gpa, .OpSwitch, 2 + (cond_words + 1) * num_conditions);
6066 cg.body.writeOperand(Id, cond_indirect);
6067 cg.body.writeOperand(Id, default);
6068
6069 // Emit each of the cases
6070 {
6071 var it = switch_br.iterateCases();
6072 while (it.next()) |case| {
6073 // SPIR-V needs a literal here, which' width depends on the case condition.
6074 const label = case_labels.at(case.idx);
6075
6076 for (case.items) |item| {
6077 const value = (try cg.air.value(item, pt)) orelse unreachable;
6078 const int_val: u64 = switch (cond_ty.zigTypeTag(zcu)) {
6079 .bool, .int => if (cond_ty.isSignedInt(zcu)) @bitCast(value.toSignedInt(zcu)) else value.toUnsignedInt(zcu),
6080 .@"enum" => blk: {
6081 // TODO: figure out of cond_ty is correct (something with enum literals)
6082 break :blk (try value.intFromEnum(cond_ty, pt)).toUnsignedInt(zcu); // TODO: composite integer constants
6083 },
6084 .error_set => value.getErrorInt(zcu),
6085 .pointer => value.toUnsignedInt(zcu),
6086 else => unreachable,
6087 };
6088 const int_lit: spec.LiteralContextDependentNumber = switch (cond_words) {
6089 1 => .{ .uint32 = @intCast(int_val) },
6090 2 => .{ .uint64 = int_val },
6091 else => unreachable,
6092 };
6093 cg.body.writeOperand(spec.LiteralContextDependentNumber, int_lit);
6094 cg.body.writeOperand(Id, label);
6095 }
6096 }
6097 }
6098
6099 var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty;
6100 defer incoming_structured_blocks.deinit(gpa);
6101
6102 if (cg.control_flow == .structured) {
6103 try incoming_structured_blocks.ensureUnusedCapacity(gpa, num_cases + 1);
6104 }
6105
6106 // Now, finally, we can start emitting each of the cases.
6107 var it = switch_br.iterateCases();
6108 while (it.next()) |case| {
6109 const label = case_labels.at(case.idx);
6110
6111 try cg.beginSpvBlock(label);
6112
6113 switch (cg.control_flow) {
6114 .structured => {
6115 const next_block = try cg.genStructuredBody(.selection, case.body);
6116 incoming_structured_blocks.appendAssumeCapacity(.{
6117 .src_label = cg.block_label,
6118 .next_block = next_block,
6119 });
6120 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
6121 },
6122 .unstructured => {
6123 try cg.genBody(case.body);
6124 },
6125 }
6126 }
6127
6128 const else_body = it.elseBody();
6129 try cg.beginSpvBlock(default);
6130 if (else_body.len != 0) {
6131 switch (cg.control_flow) {
6132 .structured => {
6133 const next_block = try cg.genStructuredBody(.selection, else_body);
6134 incoming_structured_blocks.appendAssumeCapacity(.{
6135 .src_label = cg.block_label,
6136 .next_block = next_block,
6137 });
6138 try cg.body.emitBranch(cg.module.gpa, merge_label.?);
6139 },
6140 .unstructured => {
6141 try cg.genBody(else_body);
6142 },
6143 }
6144 } else {
6145 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
6146 }
6147
6148 if (cg.control_flow == .structured) {
6149 try cg.beginSpvBlock(merge_label.?);
6150 const next_block = try cg.structuredNextBlock(incoming_structured_blocks.items);
6151 try cg.structuredBreak(next_block);
6152 }
6153}
6154
6155fn airUnreach(cg: *CodeGen) !void {
6156 try cg.body.emit(cg.module.gpa, .OpUnreachable, {});
6157}
6158
6159fn airDbgStmt(cg: *CodeGen, inst: Air.Inst.Index) !void {
6160 const gpa = cg.module.gpa;
6161 const pt = cg.pt;
6162 const zcu = pt.zcu;
6163 const dbg_stmt = cg.air.instructions.items(.data)[@intFromEnum(inst)].dbg_stmt;
6164 const path = zcu.navFileScope(cg.owner_nav).sub_file_path;
6165
6166 if (cg.file_path_id == .none) {
6167 cg.file_path_id = cg.module.allocId();
6168 try cg.module.sections.debug_strings.emit(gpa, .OpString, .{
6169 .id_result = cg.file_path_id,
6170 .string = path,
6171 });
6172 }
6173
6174 try cg.body.emit(cg.module.gpa, .OpLine, .{
6175 .file = cg.file_path_id,
6176 .line = cg.base_line + dbg_stmt.line + 1,
6177 .column = dbg_stmt.column + 1,
6178 });
6179}
6180
6181fn airDbgInlineBlock(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6182 const zcu = cg.pt.zcu;
6183 const inst_datas = cg.air.instructions.items(.data);
6184 const extra = cg.air.extraData(Air.DbgInlineBlock, inst_datas[@intFromEnum(inst)].ty_pl.payload);
6185 const old_base_line = cg.base_line;
6186 defer cg.base_line = old_base_line;
6187 cg.base_line = zcu.navSrcLine(zcu.funcInfo(extra.data.func).owner_nav);
6188 return cg.lowerBlock(inst, @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.body_len]));
6189}
6190
6191fn airDbgVar(cg: *CodeGen, inst: Air.Inst.Index) !void {
6192 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6193 const target_id = try cg.resolve(pl_op.operand);
6194 const name: Air.NullTerminatedString = @enumFromInt(pl_op.payload);
6195 try cg.module.debugName(target_id, name.toSlice(cg.air));
6196}
6197
6198fn airAssembly(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6199 const gpa = cg.module.gpa;
6200 const zcu = cg.pt.zcu;
6201 const ty_pl = cg.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
6202 const extra = cg.air.extraData(Air.Asm, ty_pl.payload);
6203
6204 const is_volatile = extra.data.flags.is_volatile;
6205 const outputs_len = extra.data.flags.outputs_len;
6206
6207 if (!is_volatile and cg.liveness.isUnused(inst)) return null;
6208
6209 var extra_i: usize = extra.end;
6210 const outputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..outputs_len]);
6211 extra_i += outputs.len;
6212 const inputs: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra_i..][0..extra.data.inputs_len]);
6213 extra_i += inputs.len;
6214
6215 if (outputs.len > 1) {
6216 return cg.todo("implement inline asm with more than 1 output", .{});
6217 }
6218
6219 var as: Assembler = .{ .cg = cg };
6220 defer as.deinit();
6221
6222 var output_extra_i = extra_i;
6223 for (outputs) |output| {
6224 if (output != .none) {
6225 return cg.todo("implement inline asm with non-returned output", .{});
6226 }
6227 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
6228 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]), 0);
6229 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6230 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6231 // TODO: Record output and use it somewhere.
6232 }
6233
6234 for (inputs) |input| {
6235 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..]);
6236 const constraint = std.mem.sliceTo(extra_bytes, 0);
6237 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6238 // This equation accounts for the fact that even if we have exactly 4 bytes
6239 // for the string, we still use the next u32 for the null terminator.
6240 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6241
6242 const input_ty = cg.typeOf(input);
6243
6244 if (std.mem.eql(u8, constraint, "c")) {
6245 // constant
6246 const val = (try cg.air.value(input, cg.pt)) orelse {
6247 return cg.fail("assembly inputs with 'c' constraint have to be compile-time known", .{});
6248 };
6249
6250 // TODO: This entire function should be handled a bit better...
6251 const ip = &zcu.intern_pool;
6252 switch (ip.indexToKey(val.toIntern())) {
6253 .int_type,
6254 .ptr_type,
6255 .array_type,
6256 .vector_type,
6257 .opt_type,
6258 .anyframe_type,
6259 .error_union_type,
6260 .simple_type,
6261 .struct_type,
6262 .union_type,
6263 .opaque_type,
6264 .enum_type,
6265 .func_type,
6266 .error_set_type,
6267 .inferred_error_set_type,
6268 => unreachable, // types, not values
6269
6270 .undef => return cg.fail("assembly input with 'c' constraint cannot be undefined", .{}),
6271
6272 .int => try as.value_map.put(gpa, name, .{ .constant = @intCast(val.toUnsignedInt(zcu)) }),
6273 .enum_literal => |str| try as.value_map.put(gpa, name, .{ .string = str.toSlice(ip) }),
6274
6275 else => unreachable, // TODO
6276 }
6277 } else if (std.mem.eql(u8, constraint, "t")) {
6278 // type
6279 if (input_ty.zigTypeTag(zcu) == .type) {
6280 // This assembly input is a type instead of a value.
6281 // That's fine for now, just make sure to resolve it as such.
6282 const val = (try cg.air.value(input, cg.pt)).?;
6283 const ty_id = try cg.resolveType(val.toType(), .direct);
6284 try as.value_map.put(gpa, name, .{ .ty = ty_id });
6285 } else {
6286 const ty_id = try cg.resolveType(input_ty, .direct);
6287 try as.value_map.put(gpa, name, .{ .ty = ty_id });
6288 }
6289 } else {
6290 if (input_ty.zigTypeTag(zcu) == .type) {
6291 return cg.fail("use the 't' constraint to supply types to SPIR-V inline assembly", .{});
6292 }
6293
6294 const val_id = try cg.resolve(input);
6295 try as.value_map.put(gpa, name, .{ .value = val_id });
6296 }
6297 }
6298
6299 // TODO: do something with clobbers
6300 _ = extra.data.clobbers;
6301
6302 const asm_source = std.mem.sliceAsBytes(cg.air.extra.items[extra_i..])[0..extra.data.source_len];
6303
6304 as.assemble(asm_source) catch |err| switch (err) {
6305 error.AssembleFail => {
6306 // TODO: For now the compiler only supports a single error message per decl,
6307 // so to translate the possible multiple errors from the assembler, emit
6308 // them as notes here.
6309 // TODO: Translate proper error locations.
6310 assert(as.errors.items.len != 0);
6311 assert(cg.error_msg == null);
6312 const src_loc = zcu.navSrcLoc(cg.owner_nav);
6313 cg.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
6314 const notes = try zcu.gpa.alloc(Zcu.ErrorMsg, as.errors.items.len);
6315
6316 // Sub-scope to prevent `return error.CodegenFail` from running the errdefers.
6317 {
6318 errdefer zcu.gpa.free(notes);
6319 var i: usize = 0;
6320 errdefer for (notes[0..i]) |*note| {
6321 note.deinit(zcu.gpa);
6322 };
6323
6324 while (i < as.errors.items.len) : (i += 1) {
6325 notes[i] = try Zcu.ErrorMsg.init(zcu.gpa, src_loc, "{s}", .{as.errors.items[i].msg});
6326 }
6327 }
6328 cg.error_msg.?.notes = notes;
6329 return error.CodegenFail;
6330 },
6331 else => |others| return others,
6332 };
6333
6334 for (outputs) |output| {
6335 _ = output;
6336 const extra_bytes = std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]);
6337 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(cg.air.extra.items[output_extra_i..]), 0);
6338 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6339 output_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6340
6341 const result = as.value_map.get(name) orelse return {
6342 return cg.fail("invalid asm output '{s}'", .{name});
6343 };
6344
6345 switch (result) {
6346 .just_declared, .unresolved_forward_reference => unreachable,
6347 .ty => return cg.fail("cannot return spir-v type as value from assembly", .{}),
6348 .value => |ref| return ref,
6349 .constant, .string => return cg.fail("cannot return constant from assembly", .{}),
6350 }
6351
6352 // TODO: Multiple results
6353 // TODO: Check that the output type from assembly is the same as the type actually expected by Zig.
6354 }
6355
6356 return null;
6357}
6358
6359fn airCall(cg: *CodeGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !?Id {
6360 _ = modifier;
6361
6362 const gpa = cg.module.gpa;
6363 const pt = cg.pt;
6364 const zcu = pt.zcu;
6365 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6366 const extra = cg.air.extraData(Air.Call, pl_op.payload);
6367 const args: []const Air.Inst.Ref = @ptrCast(cg.air.extra.items[extra.end..][0..extra.data.args_len]);
6368 const callee_ty = cg.typeOf(pl_op.operand);
6369 const zig_fn_ty = switch (callee_ty.zigTypeTag(zcu)) {
6370 .@"fn" => callee_ty,
6371 .pointer => return cg.fail("cannot call function pointers", .{}),
6372 else => unreachable,
6373 };
6374 const fn_info = zcu.typeToFunc(zig_fn_ty).?;
6375 const return_type = fn_info.return_type;
6376
6377 const result_type_id = try cg.resolveFnReturnType(.fromInterned(return_type));
6378 const result_id = cg.module.allocId();
6379 const callee_id = try cg.resolve(pl_op.operand);
6380
6381 comptime assert(zig_call_abi_ver == 3);
6382 const params = try gpa.alloc(spec.Id, args.len);
6383 defer gpa.free(params);
6384 var n_params: usize = 0;
6385 for (args) |arg| {
6386 // Note: resolve() might emit instructions, so we need to call it
6387 // before starting to emit OpFunctionCall instructions. Hence the
6388 // temporary params buffer.
6389 const arg_ty = cg.typeOf(arg);
6390 if (!arg_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
6391 const arg_id = try cg.resolve(arg);
6392
6393 params[n_params] = arg_id;
6394 n_params += 1;
6395 }
6396
6397 try cg.body.emit(cg.module.gpa, .OpFunctionCall, .{
6398 .id_result_type = result_type_id,
6399 .id_result = result_id,
6400 .function = callee_id,
6401 .id_ref_3 = params[0..n_params],
6402 });
6403
6404 if (cg.liveness.isUnused(inst) or !Type.fromInterned(return_type).hasRuntimeBitsIgnoreComptime(zcu)) {
6405 return null;
6406 }
6407
6408 return result_id;
6409}
6410
6411fn builtin3D(cg: *CodeGen, result_ty: Type, builtin: spec.BuiltIn, dimension: u32, out_of_range_value: anytype) !Id {
6412 if (dimension >= 3) {
6413 return try cg.constInt(result_ty, out_of_range_value);
6414 }
6415 const vec_ty = try cg.pt.vectorType(.{
6416 .len = 3,
6417 .child = result_ty.toIntern(),
6418 });
6419 const ptr_ty_id = try cg.ptrType(vec_ty, .input, .indirect);
6420 const spv_decl_index = try cg.module.builtin(ptr_ty_id, builtin);
6421 try cg.decl_deps.put(cg.module.gpa, spv_decl_index, {});
6422 const ptr = cg.module.declPtr(spv_decl_index).result_id;
6423 const vec = try cg.load(vec_ty, ptr, .{});
6424 return try cg.extractVectorComponent(result_ty, vec, dimension);
6425}
6426
6427fn airWorkItemId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6428 if (cg.liveness.isUnused(inst)) return null;
6429 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6430 const dimension = pl_op.payload;
6431 const result_id = try cg.builtin3D(.u32, .local_invocation_id, dimension, 0);
6432 const tmp: Temporary = .init(.u32, result_id);
6433 const result = try cg.buildConvert(.u32, tmp);
6434 return try result.materialize(cg);
6435}
6436
6437fn airWorkGroupSize(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6438 if (cg.liveness.isUnused(inst)) return null;
6439 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6440 const dimension = pl_op.payload;
6441 const result_id = try cg.builtin3D(.u32, .workgroup_size, dimension, 0);
6442 const tmp: Temporary = .init(.u32, result_id);
6443 const result = try cg.buildConvert(.u32, tmp);
6444 return try result.materialize(cg);
6445}
6446
6447fn airWorkGroupId(cg: *CodeGen, inst: Air.Inst.Index) !?Id {
6448 if (cg.liveness.isUnused(inst)) return null;
6449 const pl_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6450 const dimension = pl_op.payload;
6451 const result_id = try cg.builtin3D(.u32, .workgroup_id, dimension, 0);
6452 const tmp: Temporary = .init(.u32, result_id);
6453 const result = try cg.buildConvert(.u32, tmp);
6454 return try result.materialize(cg);
6455}
6456
6457fn typeOf(cg: *CodeGen, inst: Air.Inst.Ref) Type {
6458 const zcu = cg.pt.zcu;
6459 return cg.air.typeOf(inst, &zcu.intern_pool);
6460}
6461
6462fn typeOfIndex(cg: *CodeGen, inst: Air.Inst.Index) Type {
6463 const zcu = cg.pt.zcu;
6464 return cg.air.typeOfIndex(inst, &zcu.intern_pool);
6465}
src/arch/spirv/Module.zig created+755
......@@ -0,0 +1,755 @@
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 Module = @This();
11
12const std = @import("std");
13const Allocator = std.mem.Allocator;
14const assert = std.debug.assert;
15const autoHashStrat = std.hash.autoHashStrat;
16const Wyhash = std.hash.Wyhash;
17
18const InternPool = @import("../../InternPool.zig");
19const spec = @import("spec.zig");
20const Word = spec.Word;
21const Id = spec.Id;
22
23const Section = @import("Section.zig");
24
25/// Declarations, both functions and globals, can have dependencies. These are used for 2 things:
26/// - Globals must be declared before they are used, also between globals. The compiler processes
27/// globals unordered, so we must use the dependencies here to figure out how to order the globals
28/// in the final module. The Globals structure is also used for that.
29/// - Entry points must declare the complete list of OpVariable instructions that they access.
30/// For these we use the same dependency structure.
31/// In this mechanism, globals will only depend on other globals, while functions may depend on
32/// globals or other functions.
33pub const Decl = struct {
34 /// Index to refer to a Decl by.
35 pub const Index = enum(u32) { _ };
36
37 /// Useful to tell what kind of decl this is, and hold the result-id or field index
38 /// to be used for this decl.
39 pub const Kind = enum {
40 func,
41 global,
42 invocation_global,
43 };
44
45 /// See comment on Kind
46 kind: Kind,
47 /// The result-id associated to this decl. The specific meaning of this depends on `kind`:
48 /// - For `func`, this is the result-id of the associated OpFunction instruction.
49 /// - For `global`, this is the result-id of the associated OpVariable instruction.
50 /// - For `invocation_global`, this is the result-id of the associated InvocationGlobal instruction.
51 result_id: Id,
52 /// The offset of the first dependency of this decl in the `decl_deps` array.
53 begin_dep: u32,
54 /// The past-end offset of the dependencies of this decl in the `decl_deps` array.
55 end_dep: u32,
56};
57
58/// This models a kernel entry point.
59pub const EntryPoint = struct {
60 /// The declaration that should be exported.
61 decl_index: Decl.Index,
62 /// The name of the kernel to be exported.
63 name: []const u8,
64 /// Calling Convention
65 exec_model: spec.ExecutionModel,
66 exec_mode: ?spec.ExecutionMode = null,
67};
68
69gpa: Allocator,
70target: *const std.Target,
71nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, Decl.Index) = .empty,
72uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, spec.StorageClass }, Decl.Index) = .empty,
73intern_map: std.AutoHashMapUnmanaged(struct { InternPool.Index, Repr }, Id) = .empty,
74decls: std.ArrayListUnmanaged(Decl) = .empty,
75decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty,
76entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
77/// This map serves a dual purpose:
78/// - It keeps track of pointers that are currently being emitted, so that we can tell
79/// if they are recursive and need an OpTypeForwardPointer.
80/// - It caches pointers by child-type. This is required because sometimes we rely on
81/// ID-equality for pointers, and pointers constructed via `ptrType()` aren't interned
82/// via the usual `intern_map` mechanism.
83ptr_types: std.AutoHashMapUnmanaged(
84 struct { InternPool.Index, spec.StorageClass, Repr },
85 struct { ty_id: Id, fwd_emitted: bool },
86) = .{},
87/// For test declarations compiled for Vulkan target, we have to add a buffer.
88/// We only need to generate this once, this holds the link information related to that.
89error_buffer: ?Decl.Index = null,
90/// SPIR-V instructions return result-ids.
91/// This variable holds the module-wide counter for these.
92next_result_id: Word = 1,
93/// Some types shouldn't be emitted more than one time, but cannot be caught by
94/// the `intern_map` during codegen. Sometimes, IDs are compared to check if
95/// types are the same, so we can't delay until the dedup pass. Therefore,
96/// this is an ad-hoc structure to cache types where required.
97/// According to the SPIR-V specification, section 2.8, this includes all non-aggregate
98/// non-pointer types.
99/// Additionally, this is used for other values which can be cached, for example,
100/// built-in variables.
101cache: struct {
102 bool_type: ?Id = null,
103 void_type: ?Id = null,
104 int_types: std.AutoHashMapUnmanaged(std.builtin.Type.Int, Id) = .empty,
105 float_types: std.AutoHashMapUnmanaged(std.builtin.Type.Float, Id) = .empty,
106 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
107 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
108
109 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
110 extensions: std.StringHashMapUnmanaged(void) = .empty,
111 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
112 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
113 builtins: std.AutoHashMapUnmanaged(struct { Id, spec.BuiltIn }, Decl.Index) = .empty,
114
115 bool_const: [2]?Id = .{ null, null },
116} = .{},
117/// Module layout, according to SPIR-V Spec section 2.4, "Logical Layout of a Module".
118sections: struct {
119 capabilities: Section = .{},
120 extensions: Section = .{},
121 extended_instruction_set: Section = .{},
122 memory_model: Section = .{},
123 execution_modes: Section = .{},
124 debug_strings: Section = .{},
125 debug_names: Section = .{},
126 annotations: Section = .{},
127 globals: Section = .{},
128 functions: Section = .{},
129} = .{},
130
131/// Data can be lowered into in two basic representations: indirect, which is when
132/// a type is stored in memory, and direct, which is how a type is stored when its
133/// a direct SPIR-V value.
134pub const Repr = enum {
135 /// A SPIR-V value as it would be used in operations.
136 direct,
137 /// A SPIR-V value as it is stored in memory.
138 indirect,
139};
140
141pub fn deinit(module: *Module) void {
142 module.nav_link.deinit(module.gpa);
143 module.uav_link.deinit(module.gpa);
144 module.intern_map.deinit(module.gpa);
145 module.ptr_types.deinit(module.gpa);
146
147 module.sections.capabilities.deinit(module.gpa);
148 module.sections.extensions.deinit(module.gpa);
149 module.sections.extended_instruction_set.deinit(module.gpa);
150 module.sections.memory_model.deinit(module.gpa);
151 module.sections.execution_modes.deinit(module.gpa);
152 module.sections.debug_strings.deinit(module.gpa);
153 module.sections.debug_names.deinit(module.gpa);
154 module.sections.annotations.deinit(module.gpa);
155 module.sections.globals.deinit(module.gpa);
156 module.sections.functions.deinit(module.gpa);
157
158 module.cache.int_types.deinit(module.gpa);
159 module.cache.float_types.deinit(module.gpa);
160 module.cache.vector_types.deinit(module.gpa);
161 module.cache.array_types.deinit(module.gpa);
162 module.cache.capabilities.deinit(module.gpa);
163 module.cache.extensions.deinit(module.gpa);
164 module.cache.extended_instruction_set.deinit(module.gpa);
165 module.cache.decorations.deinit(module.gpa);
166 module.cache.builtins.deinit(module.gpa);
167
168 module.decls.deinit(module.gpa);
169 module.decl_deps.deinit(module.gpa);
170
171 for (module.entry_points.values()) |ep| {
172 module.gpa.free(ep.name);
173 }
174 module.entry_points.deinit(module.gpa);
175
176 module.* = undefined;
177}
178
179/// Fetch or allocate a result id for nav index. This function also marks the nav as alive.
180/// Note: Function does not actually generate the nav, it just allocates an index.
181pub fn resolveNav(module: *Module, ip: *InternPool, nav_index: InternPool.Nav.Index) !Decl.Index {
182 const entry = try module.nav_link.getOrPut(module.gpa, nav_index);
183 if (!entry.found_existing) {
184 const nav = ip.getNav(nav_index);
185 // TODO: Extern fn?
186 const kind: Decl.Kind = if (ip.isFunctionType(nav.typeOf(ip)))
187 .func
188 else switch (nav.getAddrspace()) {
189 .generic => .invocation_global,
190 else => .global,
191 };
192
193 entry.value_ptr.* = try module.allocDecl(kind);
194 }
195
196 return entry.value_ptr.*;
197}
198
199pub fn allocIds(module: *Module, n: u32) spec.IdRange {
200 defer module.next_result_id += n;
201 return .{ .base = module.next_result_id, .len = n };
202}
203
204pub fn allocId(module: *Module) Id {
205 return module.allocIds(1).at(0);
206}
207
208pub fn idBound(module: Module) Word {
209 return module.next_result_id;
210}
211
212pub fn addEntryPointDeps(
213 module: *Module,
214 decl_index: Decl.Index,
215 seen: *std.DynamicBitSetUnmanaged,
216 interface: *std.ArrayList(Id),
217) !void {
218 const decl = module.declPtr(decl_index);
219 const deps = module.decl_deps.items[decl.begin_dep..decl.end_dep];
220
221 if (seen.isSet(@intFromEnum(decl_index))) {
222 return;
223 }
224
225 seen.set(@intFromEnum(decl_index));
226
227 if (decl.kind == .global) {
228 try interface.append(decl.result_id);
229 }
230
231 for (deps) |dep| {
232 try module.addEntryPointDeps(dep, seen, interface);
233 }
234}
235
236fn entryPoints(module: *Module) !Section {
237 var entry_points = Section{};
238 errdefer entry_points.deinit(module.gpa);
239
240 var interface = std.ArrayList(Id).init(module.gpa);
241 defer interface.deinit();
242
243 var seen = try std.DynamicBitSetUnmanaged.initEmpty(module.gpa, module.decls.items.len);
244 defer seen.deinit(module.gpa);
245
246 for (module.entry_points.keys(), module.entry_points.values()) |entry_point_id, entry_point| {
247 interface.items.len = 0;
248 seen.setRangeValue(.{ .start = 0, .end = module.decls.items.len }, false);
249
250 try module.addEntryPointDeps(entry_point.decl_index, &seen, &interface);
251 try entry_points.emit(module.gpa, .OpEntryPoint, .{
252 .execution_model = entry_point.exec_model,
253 .entry_point = entry_point_id,
254 .name = entry_point.name,
255 .interface = interface.items,
256 });
257
258 if (entry_point.exec_mode == null and entry_point.exec_model == .fragment) {
259 switch (module.target.os.tag) {
260 .vulkan, .opengl => |tag| {
261 try module.sections.execution_modes.emit(module.gpa, .OpExecutionMode, .{
262 .entry_point = entry_point_id,
263 .mode = if (tag == .vulkan) .origin_upper_left else .origin_lower_left,
264 });
265 },
266 .opencl => {},
267 else => unreachable,
268 }
269 }
270 }
271
272 return entry_points;
273}
274
275pub fn finalize(module: *Module, gpa: Allocator) ![]Word {
276 const target = module.target;
277
278 // Emit capabilities and extensions
279 switch (target.os.tag) {
280 .opengl => {
281 try module.addCapability(.shader);
282 try module.addCapability(.matrix);
283 },
284 .vulkan => {
285 try module.addCapability(.shader);
286 try module.addCapability(.matrix);
287 if (target.cpu.arch == .spirv64) {
288 try module.addExtension("SPV_KHR_physical_storage_buffer");
289 try module.addCapability(.physical_storage_buffer_addresses);
290 }
291 },
292 .opencl, .amdhsa => {
293 try module.addCapability(.kernel);
294 try module.addCapability(.addresses);
295 },
296 else => unreachable,
297 }
298 if (target.cpu.arch == .spirv64) try module.addCapability(.int64);
299 if (target.cpu.has(.spirv, .int64)) try module.addCapability(.int64);
300 if (target.cpu.has(.spirv, .float16)) try module.addCapability(.float16);
301 if (target.cpu.has(.spirv, .float64)) try module.addCapability(.float64);
302 if (target.cpu.has(.spirv, .generic_pointer)) try module.addCapability(.generic_pointer);
303 if (target.cpu.has(.spirv, .vector16)) try module.addCapability(.vector16);
304 if (target.cpu.has(.spirv, .storage_push_constant16)) {
305 try module.addExtension("SPV_KHR_16bit_storage");
306 try module.addCapability(.storage_push_constant16);
307 }
308 if (target.cpu.has(.spirv, .arbitrary_precision_integers)) {
309 try module.addExtension("SPV_INTEL_arbitrary_precision_integers");
310 try module.addCapability(.arbitrary_precision_integers_intel);
311 }
312 if (target.cpu.has(.spirv, .variable_pointers)) {
313 try module.addExtension("SPV_KHR_variable_pointers");
314 try module.addCapability(.variable_pointers_storage_buffer);
315 try module.addCapability(.variable_pointers);
316 }
317 // These are well supported
318 try module.addCapability(.int8);
319 try module.addCapability(.int16);
320
321 // Emit memory model
322 const addressing_model: spec.AddressingModel = switch (target.os.tag) {
323 .opengl => .logical,
324 .vulkan => if (target.cpu.arch == .spirv32) .logical else .physical_storage_buffer64,
325 .opencl => if (target.cpu.arch == .spirv32) .physical32 else .physical64,
326 .amdhsa => .physical64,
327 else => unreachable,
328 };
329 try module.sections.memory_model.emit(module.gpa, .OpMemoryModel, .{
330 .addressing_model = addressing_model,
331 .memory_model = switch (target.os.tag) {
332 .opencl => .open_cl,
333 .vulkan, .opengl => .glsl450,
334 else => unreachable,
335 },
336 });
337
338 var entry_points = try module.entryPoints();
339 defer entry_points.deinit(module.gpa);
340
341 const version: spec.Version = .{
342 .major = 1,
343 .minor = blk: {
344 // Prefer higher versions
345 if (target.cpu.has(.spirv, .v1_6)) break :blk 6;
346 if (target.cpu.has(.spirv, .v1_5)) break :blk 5;
347 if (target.cpu.has(.spirv, .v1_4)) break :blk 4;
348 if (target.cpu.has(.spirv, .v1_3)) break :blk 3;
349 if (target.cpu.has(.spirv, .v1_2)) break :blk 2;
350 if (target.cpu.has(.spirv, .v1_1)) break :blk 1;
351 break :blk 0;
352 },
353 };
354
355 const header = [_]Word{
356 spec.magic_number,
357 version.toWord(),
358 spec.zig_generator_id,
359 module.idBound(),
360 0, // Schema (currently reserved for future use)
361 };
362
363 var source = Section{};
364 defer source.deinit(module.gpa);
365 try module.sections.debug_strings.emit(module.gpa, .OpSource, .{
366 .source_language = .zig,
367 .version = 0,
368 // We cannot emit these because the Khronos translator does not parse this instruction
369 // correctly.
370 // See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2188
371 .file = null,
372 .source = null,
373 });
374
375 // Note: needs to be kept in order according to section 2.3!
376 const buffers = &[_][]const Word{
377 &header,
378 module.sections.capabilities.toWords(),
379 module.sections.extensions.toWords(),
380 module.sections.extended_instruction_set.toWords(),
381 module.sections.memory_model.toWords(),
382 entry_points.toWords(),
383 module.sections.execution_modes.toWords(),
384 source.toWords(),
385 module.sections.debug_strings.toWords(),
386 module.sections.debug_names.toWords(),
387 module.sections.annotations.toWords(),
388 module.sections.globals.toWords(),
389 module.sections.functions.toWords(),
390 };
391
392 var total_result_size: usize = 0;
393 for (buffers) |buffer| {
394 total_result_size += buffer.len;
395 }
396 const result = try gpa.alloc(Word, total_result_size);
397 errdefer comptime unreachable;
398
399 var offset: usize = 0;
400 for (buffers) |buffer| {
401 @memcpy(result[offset..][0..buffer.len], buffer);
402 offset += buffer.len;
403 }
404
405 return result;
406}
407
408pub fn addCapability(module: *Module, cap: spec.Capability) !void {
409 const entry = try module.cache.capabilities.getOrPut(module.gpa, cap);
410 if (entry.found_existing) return;
411 try module.sections.capabilities.emit(module.gpa, .OpCapability, .{ .capability = cap });
412}
413
414pub fn addExtension(module: *Module, ext: []const u8) !void {
415 const entry = try module.cache.extensions.getOrPut(module.gpa, ext);
416 if (entry.found_existing) return;
417 try module.sections.extensions.emit(module.gpa, .OpExtension, .{ .name = ext });
418}
419
420/// Imports or returns the existing id of an extended instruction set
421pub fn importInstructionSet(module: *Module, set: spec.InstructionSet) !Id {
422 assert(set != .core);
423
424 const gop = try module.cache.extended_instruction_set.getOrPut(module.gpa, set);
425 if (gop.found_existing) return gop.value_ptr.*;
426
427 const result_id = module.allocId();
428 try module.sections.extended_instruction_set.emit(module.gpa, .OpExtInstImport, .{
429 .id_result = result_id,
430 .name = @tagName(set),
431 });
432 gop.value_ptr.* = result_id;
433
434 return result_id;
435}
436
437pub fn structType(module: *Module, result_id: Id, types: []const Id, maybe_names: ?[]const []const u8) !void {
438 try module.sections.globals.emit(module.gpa, .OpTypeStruct, .{
439 .id_result = result_id,
440 .id_ref = types,
441 });
442
443 if (maybe_names) |names| {
444 assert(names.len == types.len);
445 for (names, 0..) |name, i| {
446 try module.memberDebugName(result_id, @intCast(i), name);
447 }
448 }
449}
450
451pub fn boolType(module: *Module) !Id {
452 if (module.cache.bool_type) |id| return id;
453
454 const result_id = module.allocId();
455 try module.sections.globals.emit(module.gpa, .OpTypeBool, .{
456 .id_result = result_id,
457 });
458 module.cache.bool_type = result_id;
459 return result_id;
460}
461
462pub fn voidType(module: *Module) !Id {
463 if (module.cache.void_type) |id| return id;
464
465 const result_id = module.allocId();
466 try module.sections.globals.emit(module.gpa, .OpTypeVoid, .{
467 .id_result = result_id,
468 });
469 module.cache.void_type = result_id;
470 try module.debugName(result_id, "void");
471 return result_id;
472}
473
474pub fn intType(module: *Module, signedness: std.builtin.Signedness, bits: u16) !Id {
475 assert(bits > 0);
476 const entry = try module.cache.int_types.getOrPut(module.gpa, .{ .signedness = signedness, .bits = bits });
477 if (!entry.found_existing) {
478 const result_id = module.allocId();
479 entry.value_ptr.* = result_id;
480 try module.sections.globals.emit(module.gpa, .OpTypeInt, .{
481 .id_result = result_id,
482 .width = bits,
483 .signedness = switch (signedness) {
484 .signed => 1,
485 .unsigned => 0,
486 },
487 });
488
489 switch (signedness) {
490 .signed => try module.debugNameFmt(result_id, "i{}", .{bits}),
491 .unsigned => try module.debugNameFmt(result_id, "u{}", .{bits}),
492 }
493 }
494 return entry.value_ptr.*;
495}
496
497pub fn floatType(module: *Module, bits: u16) !Id {
498 assert(bits > 0);
499 const entry = try module.cache.float_types.getOrPut(module.gpa, .{ .bits = bits });
500 if (!entry.found_existing) {
501 const result_id = module.allocId();
502 entry.value_ptr.* = result_id;
503 try module.sections.globals.emit(module.gpa, .OpTypeFloat, .{
504 .id_result = result_id,
505 .width = bits,
506 });
507 try module.debugNameFmt(result_id, "f{}", .{bits});
508 }
509 return entry.value_ptr.*;
510}
511
512pub fn vectorType(module: *Module, len: u32, child_ty_id: Id) !Id {
513 const entry = try module.cache.vector_types.getOrPut(module.gpa, .{ child_ty_id, len });
514 if (!entry.found_existing) {
515 const result_id = module.allocId();
516 entry.value_ptr.* = result_id;
517 try module.sections.globals.emit(module.gpa, .OpTypeVector, .{
518 .id_result = result_id,
519 .component_type = child_ty_id,
520 .component_count = len,
521 });
522 }
523 return entry.value_ptr.*;
524}
525
526pub fn arrayType(module: *Module, len_id: Id, child_ty_id: Id) !Id {
527 const entry = try module.cache.array_types.getOrPut(module.gpa, .{ child_ty_id, len_id });
528 if (!entry.found_existing) {
529 const result_id = module.allocId();
530 entry.value_ptr.* = result_id;
531 try module.sections.globals.emit(module.gpa, .OpTypeArray, .{
532 .id_result = result_id,
533 .element_type = child_ty_id,
534 .length = len_id,
535 });
536 }
537 return entry.value_ptr.*;
538}
539
540pub fn functionType(module: *Module, return_ty_id: Id, param_type_ids: []const Id) !Id {
541 const result_id = module.allocId();
542 try module.sections.globals.emit(module.gpa, .OpTypeFunction, .{
543 .id_result = result_id,
544 .return_type = return_ty_id,
545 .id_ref_2 = param_type_ids,
546 });
547 return result_id;
548}
549
550pub fn constant(module: *Module, result_ty_id: Id, value: spec.LiteralContextDependentNumber) !Id {
551 const result_id = module.allocId();
552 const section = &module.sections.globals;
553 try section.emit(module.gpa, .OpConstant, .{
554 .id_result_type = result_ty_id,
555 .id_result = result_id,
556 .value = value,
557 });
558 return result_id;
559}
560
561pub fn constBool(module: *Module, value: bool) !Id {
562 if (module.cache.bool_const[@intFromBool(value)]) |b| return b;
563
564 const result_ty_id = try module.boolType();
565 const result_id = module.allocId();
566 module.cache.bool_const[@intFromBool(value)] = result_id;
567
568 switch (value) {
569 inline else => |value_ct| try module.sections.globals.emit(
570 module.gpa,
571 if (value_ct) .OpConstantTrue else .OpConstantFalse,
572 .{
573 .id_result_type = result_ty_id,
574 .id_result = result_id,
575 },
576 ),
577 }
578
579 return result_id;
580}
581
582/// Return a pointer to a builtin variable. `result_ty_id` must be a **pointer**
583/// with storage class `.Input`.
584pub fn builtin(module: *Module, result_ty_id: Id, spirv_builtin: spec.BuiltIn) !Decl.Index {
585 const entry = try module.cache.builtins.getOrPut(module.gpa, .{ result_ty_id, spirv_builtin });
586 if (!entry.found_existing) {
587 const decl_index = try module.allocDecl(.global);
588 const result_id = module.declPtr(decl_index).result_id;
589 entry.value_ptr.* = decl_index;
590 try module.sections.globals.emit(module.gpa, .OpVariable, .{
591 .id_result_type = result_ty_id,
592 .id_result = result_id,
593 .storage_class = .input,
594 });
595 try module.decorate(result_id, .{ .built_in = .{ .built_in = spirv_builtin } });
596 try module.declareDeclDeps(decl_index, &.{});
597 }
598 return entry.value_ptr.*;
599}
600
601pub fn constUndef(module: *Module, ty_id: Id) !Id {
602 const result_id = module.allocId();
603 try module.sections.globals.emit(module.gpa, .OpUndef, .{
604 .id_result_type = ty_id,
605 .id_result = result_id,
606 });
607 return result_id;
608}
609
610pub fn constNull(module: *Module, ty_id: Id) !Id {
611 const result_id = module.allocId();
612 try module.sections.globals.emit(module.gpa, .OpConstantNull, .{
613 .id_result_type = ty_id,
614 .id_result = result_id,
615 });
616 return result_id;
617}
618
619/// Decorate a result-id.
620pub fn decorate(
621 module: *Module,
622 target: Id,
623 decoration: spec.Decoration.Extended,
624) !void {
625 const entry = try module.cache.decorations.getOrPut(module.gpa, .{ target, decoration });
626 if (!entry.found_existing) {
627 try module.sections.annotations.emit(module.gpa, .OpDecorate, .{
628 .target = target,
629 .decoration = decoration,
630 });
631 }
632}
633
634/// Decorate a result-id which is a member of some struct.
635/// We really don't have to and shouldn't need to cache this.
636pub fn decorateMember(
637 module: *Module,
638 structure_type: Id,
639 member: u32,
640 decoration: spec.Decoration.Extended,
641) !void {
642 try module.sections.annotations.emit(module.gpa, .OpMemberDecorate, .{
643 .structure_type = structure_type,
644 .member = member,
645 .decoration = decoration,
646 });
647}
648
649pub fn allocDecl(module: *Module, kind: Decl.Kind) !Decl.Index {
650 try module.decls.append(module.gpa, .{
651 .kind = kind,
652 .result_id = module.allocId(),
653 .begin_dep = undefined,
654 .end_dep = undefined,
655 });
656
657 return @as(Decl.Index, @enumFromInt(@as(u32, @intCast(module.decls.items.len - 1))));
658}
659
660pub fn declPtr(module: *Module, index: Decl.Index) *Decl {
661 return &module.decls.items[@intFromEnum(index)];
662}
663
664/// Declare ALL dependencies for a decl.
665pub fn declareDeclDeps(module: *Module, decl_index: Decl.Index, deps: []const Decl.Index) !void {
666 const begin_dep: u32 = @intCast(module.decl_deps.items.len);
667 try module.decl_deps.appendSlice(module.gpa, deps);
668 const end_dep: u32 = @intCast(module.decl_deps.items.len);
669
670 const decl = module.declPtr(decl_index);
671 decl.begin_dep = begin_dep;
672 decl.end_dep = end_dep;
673}
674
675/// Declare a SPIR-V function as an entry point. This causes an extra wrapper
676/// function to be generated, which is then exported as the real entry point. The purpose of this
677/// wrapper is to allocate and initialize the structure holding the instance globals.
678pub fn declareEntryPoint(
679 module: *Module,
680 decl_index: Decl.Index,
681 name: []const u8,
682 exec_model: spec.ExecutionModel,
683 exec_mode: ?spec.ExecutionMode,
684) !void {
685 const gop = try module.entry_points.getOrPut(module.gpa, module.declPtr(decl_index).result_id);
686 gop.value_ptr.decl_index = decl_index;
687 gop.value_ptr.name = name;
688 gop.value_ptr.exec_model = exec_model;
689 // Might've been set by assembler
690 if (!gop.found_existing) gop.value_ptr.exec_mode = exec_mode;
691}
692
693pub fn debugName(module: *Module, target: Id, name: []const u8) !void {
694 try module.sections.debug_names.emit(module.gpa, .OpName, .{
695 .target = target,
696 .name = name,
697 });
698}
699
700pub fn debugNameFmt(module: *Module, target: Id, comptime fmt: []const u8, args: anytype) !void {
701 const name = try std.fmt.allocPrint(module.gpa, fmt, args);
702 defer module.gpa.free(name);
703 try module.debugName(target, name);
704}
705
706pub fn memberDebugName(module: *Module, target: Id, member: u32, name: []const u8) !void {
707 try module.sections.debug_names.emit(module.gpa, .OpMemberName, .{
708 .type = target,
709 .member = member,
710 .name = name,
711 });
712}
713
714pub fn storageClass(module: *Module, as: std.builtin.AddressSpace) spec.StorageClass {
715 return switch (as) {
716 .generic => if (module.target.cpu.has(.spirv, .generic_pointer)) .generic else .function,
717 .global => switch (module.target.os.tag) {
718 .opencl, .amdhsa => .cross_workgroup,
719 else => .storage_buffer,
720 },
721 .push_constant => {
722 return .push_constant;
723 },
724 .output => {
725 return .output;
726 },
727 .uniform => {
728 return .uniform;
729 },
730 .storage_buffer => {
731 return .storage_buffer;
732 },
733 .physical_storage_buffer => {
734 return .physical_storage_buffer;
735 },
736 .constant => .uniform_constant,
737 .shared => .workgroup,
738 .local => .function,
739 .input => .input,
740 .gs,
741 .fs,
742 .ss,
743 .param,
744 .flash,
745 .flash1,
746 .flash2,
747 .flash3,
748 .flash4,
749 .flash5,
750 .cog,
751 .lut,
752 .hub,
753 => unreachable,
754 };
755}
src/arch/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/arch/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/arch/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/codegen.zig+1-1
......@@ -57,7 +57,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
5757 .stage2_powerpc => unreachable,
5858 .stage2_riscv64 => @import("arch/riscv64/CodeGen.zig"),
5959 .stage2_sparc64 => @import("arch/sparc64/CodeGen.zig"),
60 .stage2_spirv => @import("codegen/spirv.zig"),
60 .stage2_spirv => @import("arch/spirv/CodeGen.zig"),
6161 .stage2_wasm => @import("arch/wasm/CodeGen.zig"),
6262 .stage2_x86, .stage2_x86_64 => @import("arch/x86_64/CodeGen.zig"),
6363 _ => unreachable,
src/codegen/spirv.zig deleted-6658
......@@ -1,6658 +0,0 @@
1const std = @import("std");
2const Allocator = std.mem.Allocator;
3const Target = std.Target;
4const log = std.log.scoped(.codegen);
5const assert = std.debug.assert;
6const Signedness = std.builtin.Signedness;
7
8const Zcu = @import("../Zcu.zig");
9const Decl = Zcu.Decl;
10const Type = @import("../Type.zig");
11const Value = @import("../Value.zig");
12const Air = @import("../Air.zig");
13const InternPool = @import("../InternPool.zig");
14
15const spec = @import("spirv/spec.zig");
16const Opcode = spec.Opcode;
17const Word = spec.Word;
18const Id = spec.Id;
19const StorageClass = spec.StorageClass;
20
21const SpvModule = @import("spirv/Module.zig");
22const IdRange = SpvModule.IdRange;
23
24const SpvSection = @import("spirv/Section.zig");
25const SpvAssembler = @import("spirv/Assembler.zig");
26
27const InstMap = std.AutoHashMapUnmanaged(Air.Inst.Index, Id);
28
29pub fn legalizeFeatures(_: *const std.Target) *const Air.Legalize.Features {
30 return comptime &.initMany(&.{
31 .expand_intcast_safe,
32 .expand_int_from_float_safe,
33 .expand_int_from_float_optimized_safe,
34 .expand_add_safe,
35 .expand_sub_safe,
36 .expand_mul_safe,
37 });
38}
39
40pub const zig_call_abi_ver = 3;
41pub const big_int_bits = 32;
42
43const InternMap = std.AutoHashMapUnmanaged(struct { InternPool.Index, NavGen.Repr }, Id);
44const PtrTypeMap = std.AutoHashMapUnmanaged(
45 struct { InternPool.Index, StorageClass, NavGen.Repr },
46 struct { ty_id: Id, fwd_emitted: bool },
47);
48
49const ControlFlow = union(enum) {
50 const Structured = struct {
51 /// This type indicates the way that a block is terminated. The
52 /// state of a particular block is used to track how a jump from
53 /// inside the block must reach the outside.
54 const Block = union(enum) {
55 const Incoming = struct {
56 src_label: Id,
57 /// Instruction that returns an u32 value of the
58 /// `Air.Inst.Index` that control flow should jump to.
59 next_block: Id,
60 };
61
62 const SelectionMerge = struct {
63 /// Incoming block from the `then` label.
64 /// Note that hte incoming block from the `else` label is
65 /// either given by the next element in the stack.
66 incoming: Incoming,
67 /// The label id of the cond_br's merge block.
68 /// For the top-most element in the stack, this
69 /// value is undefined.
70 merge_block: Id,
71 };
72
73 /// For a `selection` type block, we cannot use early exits, and we
74 /// must generate a 'merge ladder' of OpSelection instructions. To that end,
75 /// we keep a stack of the merges that still must be closed at the end of
76 /// a block.
77 ///
78 /// This entire structure basically just resembles a tree like
79 /// a x
80 /// \ /
81 /// b o merge
82 /// \ /
83 /// c o merge
84 /// \ /
85 /// o merge
86 /// /
87 /// o jump to next block
88 selection: struct {
89 /// In order to know which merges we still need to do, we need to keep
90 /// a stack of those.
91 merge_stack: std.ArrayListUnmanaged(SelectionMerge) = .empty,
92 },
93 /// For a `loop` type block, we can early-exit the block by
94 /// jumping to the loop exit node, and we don't need to generate
95 /// an entire stack of merges.
96 loop: struct {
97 /// The next block to jump to can be determined from any number
98 /// of conditions that jump to the loop exit.
99 merges: std.ArrayListUnmanaged(Incoming) = .empty,
100 /// The label id of the loop's merge block.
101 merge_block: Id,
102 },
103
104 fn deinit(self: *Structured.Block, a: Allocator) void {
105 switch (self.*) {
106 .selection => |*merge| merge.merge_stack.deinit(a),
107 .loop => |*merge| merge.merges.deinit(a),
108 }
109 self.* = undefined;
110 }
111 };
112 /// The stack of (structured) blocks that we are currently in. This determines
113 /// how exits from the current block must be handled.
114 block_stack: std.ArrayListUnmanaged(*Structured.Block) = .empty,
115 /// Maps `block` inst indices to the variable that the block's result
116 /// value must be written to.
117 block_results: std.AutoHashMapUnmanaged(Air.Inst.Index, Id) = .empty,
118 };
119
120 const Unstructured = struct {
121 const Incoming = struct {
122 src_label: Id,
123 break_value_id: Id,
124 };
125
126 const Block = struct {
127 label: ?Id = null,
128 incoming_blocks: std.ArrayListUnmanaged(Incoming) = .empty,
129 };
130
131 /// We need to keep track of result ids for block labels, as well as the 'incoming'
132 /// blocks for a block.
133 blocks: std.AutoHashMapUnmanaged(Air.Inst.Index, *Block) = .empty,
134 };
135
136 structured: Structured,
137 unstructured: Unstructured,
138
139 pub fn deinit(self: *ControlFlow, a: Allocator) void {
140 switch (self.*) {
141 .structured => |*cf| {
142 cf.block_stack.deinit(a);
143 cf.block_results.deinit(a);
144 },
145 .unstructured => |*cf| {
146 cf.blocks.deinit(a);
147 },
148 }
149 self.* = undefined;
150 }
151};
152
153/// This structure holds information that is relevant to the entire compilation,
154/// in contrast to `NavGen`, which only holds relevant information about a
155/// single decl.
156pub const Object = struct {
157 /// A general-purpose allocator that can be used for any allocation for this Object.
158 gpa: Allocator,
159
160 /// the SPIR-V module that represents the final binary.
161 spv: SpvModule,
162
163 /// The Zig module that this object file is generated for.
164 /// A map of Zig decl indices to SPIR-V decl indices.
165 nav_link: std.AutoHashMapUnmanaged(InternPool.Nav.Index, SpvModule.Decl.Index) = .empty,
166
167 /// A map of Zig InternPool indices for anonymous decls to SPIR-V decl indices.
168 uav_link: std.AutoHashMapUnmanaged(struct { InternPool.Index, StorageClass }, SpvModule.Decl.Index) = .empty,
169
170 /// A map that maps AIR intern pool indices to SPIR-V result-ids.
171 intern_map: InternMap = .empty,
172
173 /// This map serves a dual purpose:
174 /// - It keeps track of pointers that are currently being emitted, so that we can tell
175 /// if they are recursive and need an OpTypeForwardPointer.
176 /// - It caches pointers by child-type. This is required because sometimes we rely on
177 /// ID-equality for pointers, and pointers constructed via `ptrType()` aren't interned
178 /// via the usual `intern_map` mechanism.
179 ptr_types: PtrTypeMap = .{},
180
181 /// For test declarations for Vulkan, we have to add a buffer.
182 /// We only need to generate this once, this holds the link information
183 /// related to that.
184 error_buffer: ?SpvModule.Decl.Index = null,
185
186 pub fn init(gpa: Allocator, target: *const std.Target) Object {
187 return .{
188 .gpa = gpa,
189 .spv = SpvModule.init(gpa, target),
190 };
191 }
192
193 pub fn deinit(self: *Object) void {
194 self.spv.deinit();
195 self.nav_link.deinit(self.gpa);
196 self.uav_link.deinit(self.gpa);
197 self.intern_map.deinit(self.gpa);
198 self.ptr_types.deinit(self.gpa);
199 }
200
201 fn genNav(
202 self: *Object,
203 pt: Zcu.PerThread,
204 nav_index: InternPool.Nav.Index,
205 air: Air,
206 liveness: Air.Liveness,
207 do_codegen: bool,
208 ) !void {
209 const zcu = pt.zcu;
210 const gpa = zcu.gpa;
211 const structured_cfg = zcu.navFileScope(nav_index).mod.?.structured_cfg;
212
213 var nav_gen = NavGen{
214 .gpa = gpa,
215 .object = self,
216 .pt = pt,
217 .spv = &self.spv,
218 .owner_nav = nav_index,
219 .air = air,
220 .liveness = liveness,
221 .intern_map = &self.intern_map,
222 .ptr_types = &self.ptr_types,
223 .control_flow = switch (structured_cfg) {
224 true => .{ .structured = .{} },
225 false => .{ .unstructured = .{} },
226 },
227 .current_block_label = undefined,
228 .base_line = zcu.navSrcLine(nav_index),
229 };
230 defer nav_gen.deinit();
231
232 nav_gen.genNav(do_codegen) catch |err| switch (err) {
233 error.CodegenFail => switch (zcu.codegenFailMsg(nav_index, nav_gen.error_msg.?)) {
234 error.CodegenFail => {},
235 error.OutOfMemory => |e| return e,
236 },
237 else => |other| {
238 // There might be an error that happened *after* self.error_msg
239 // was already allocated, so be sure to free it.
240 if (nav_gen.error_msg) |error_msg| {
241 error_msg.deinit(gpa);
242 }
243
244 return other;
245 },
246 };
247 }
248
249 pub fn updateFunc(
250 self: *Object,
251 pt: Zcu.PerThread,
252 func_index: InternPool.Index,
253 air: *const Air,
254 liveness: *const ?Air.Liveness,
255 ) !void {
256 const nav = pt.zcu.funcInfo(func_index).owner_nav;
257 // TODO: Separate types for generating decls and functions?
258 try self.genNav(pt, nav, air.*, liveness.*.?, true);
259 }
260
261 pub fn updateNav(
262 self: *Object,
263 pt: Zcu.PerThread,
264 nav: InternPool.Nav.Index,
265 ) !void {
266 try self.genNav(pt, nav, undefined, undefined, false);
267 }
268
269 /// Fetch or allocate a result id for nav index. This function also marks the nav as alive.
270 /// Note: Function does not actually generate the nav, it just allocates an index.
271 pub fn resolveNav(self: *Object, zcu: *Zcu, nav_index: InternPool.Nav.Index) !SpvModule.Decl.Index {
272 const ip = &zcu.intern_pool;
273 const entry = try self.nav_link.getOrPut(self.gpa, nav_index);
274 if (!entry.found_existing) {
275 const nav = ip.getNav(nav_index);
276 // TODO: Extern fn?
277 const kind: SpvModule.Decl.Kind = if (ip.isFunctionType(nav.typeOf(ip)))
278 .func
279 else switch (nav.getAddrspace()) {
280 .generic => .invocation_global,
281 else => .global,
282 };
283
284 entry.value_ptr.* = try self.spv.allocDecl(kind);
285 }
286
287 return entry.value_ptr.*;
288 }
289};
290
291/// This structure is used to compile a declaration, and contains all relevant meta-information to deal with that.
292const NavGen = struct {
293 /// A general-purpose allocator that can be used for any allocations for this NavGen.
294 gpa: Allocator,
295
296 /// The object that this decl is generated into.
297 object: *Object,
298
299 /// The Zig module that we are generating decls for.
300 pt: Zcu.PerThread,
301
302 /// The SPIR-V module that instructions should be emitted into.
303 /// This is the same as `self.object.spv`, repeated here for brevity.
304 spv: *SpvModule,
305
306 /// The decl we are currently generating code for.
307 owner_nav: InternPool.Nav.Index,
308
309 /// The intermediate code of the declaration we are currently generating. Note: If
310 /// the declaration is not a function, this value will be undefined!
311 air: Air,
312
313 /// The liveness analysis of the intermediate code for the declaration we are currently generating.
314 /// Note: If the declaration is not a function, this value will be undefined!
315 liveness: Air.Liveness,
316
317 /// An array of function argument result-ids. Each index corresponds with the
318 /// function argument of the same index.
319 args: std.ArrayListUnmanaged(Id) = .empty,
320
321 /// A counter to keep track of how many `arg` instructions we've seen yet.
322 next_arg_index: u32 = 0,
323
324 /// A map keeping track of which instruction generated which result-id.
325 inst_results: InstMap = .empty,
326
327 /// A map that maps AIR intern pool indices to SPIR-V result-ids.
328 /// See `Object.intern_map`.
329 intern_map: *InternMap,
330
331 /// Module's pointer types, see `Object.ptr_types`.
332 ptr_types: *PtrTypeMap,
333
334 /// This field keeps track of the current state wrt structured or unstructured control flow.
335 control_flow: ControlFlow,
336
337 /// The label of the SPIR-V block we are currently generating.
338 current_block_label: Id,
339
340 /// The code (prologue and body) for the function we are currently generating code for.
341 func: SpvModule.Fn = .{},
342
343 /// The base offset of the current decl, which is what `dbg_stmt` is relative to.
344 base_line: u32,
345
346 /// If `gen` returned `Error.CodegenFail`, this contains an explanatory message.
347 /// Memory is owned by `module.gpa`.
348 error_msg: ?*Zcu.ErrorMsg = null,
349
350 /// Possible errors the `genDecl` function may return.
351 const Error = error{ CodegenFail, OutOfMemory };
352
353 /// This structure is used to return information about a type typically used for
354 /// arithmetic operations. These types may either be integers, floats, or a vector
355 /// of these. If the type is a scalar, 'inner type' refers to the
356 /// scalar type. Otherwise, if its a vector, it refers to the vector's element type.
357 const ArithmeticTypeInfo = struct {
358 /// A classification of the inner type.
359 const Class = enum {
360 /// A boolean.
361 bool,
362
363 /// A regular, **native**, integer.
364 /// This is only returned when the backend supports this int as a native type (when
365 /// the relevant capability is enabled).
366 integer,
367
368 /// A regular float. These are all required to be natively supported. Floating points
369 /// for which the relevant capability is not enabled are not emulated.
370 float,
371
372 /// An integer of a 'strange' size (which' bit size is not the same as its backing
373 /// type. **Note**: this may **also** include power-of-2 integers for which the
374 /// relevant capability is not enabled), but still within the limits of the largest
375 /// natively supported integer type.
376 strange_integer,
377
378 /// An integer with more bits than the largest natively supported integer type.
379 composite_integer,
380 };
381
382 /// The number of bits in the inner type.
383 /// This is the actual number of bits of the type, not the size of the backing integer.
384 bits: u16,
385
386 /// The number of bits required to store the type.
387 /// For `integer` and `float`, this is equal to `bits`.
388 /// For `strange_integer` and `bool` this is the size of the backing integer.
389 /// For `composite_integer` this is the elements count.
390 backing_bits: u16,
391
392 /// Null if this type is a scalar, or the length
393 /// of the vector otherwise.
394 vector_len: ?u32,
395
396 /// Whether the inner type is signed. Only relevant for integers.
397 signedness: std.builtin.Signedness,
398
399 /// A classification of the inner type. These scenarios
400 /// will all have to be handled slightly different.
401 class: Class,
402 };
403
404 /// Data can be lowered into in two basic representations: indirect, which is when
405 /// a type is stored in memory, and direct, which is how a type is stored when its
406 /// a direct SPIR-V value.
407 const Repr = enum {
408 /// A SPIR-V value as it would be used in operations.
409 direct,
410 /// A SPIR-V value as it is stored in memory.
411 indirect,
412 };
413
414 /// Free resources owned by the NavGen.
415 pub fn deinit(self: *NavGen) void {
416 self.args.deinit(self.gpa);
417 self.inst_results.deinit(self.gpa);
418 self.control_flow.deinit(self.gpa);
419 self.func.deinit(self.gpa);
420 }
421
422 pub fn fail(self: *NavGen, comptime format: []const u8, args: anytype) Error {
423 @branchHint(.cold);
424 const zcu = self.pt.zcu;
425 const src_loc = zcu.navSrcLoc(self.owner_nav);
426 assert(self.error_msg == null);
427 self.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, format, args);
428 return error.CodegenFail;
429 }
430
431 pub fn todo(self: *NavGen, comptime format: []const u8, args: anytype) Error {
432 return self.fail("TODO (SPIR-V): " ++ format, args);
433 }
434
435 /// This imports the "default" extended instruction set for the target
436 /// For OpenCL, OpenCL.std.100. For Vulkan and OpenGL, GLSL.std.450.
437 fn importExtendedSet(self: *NavGen) !Id {
438 const target = self.spv.target;
439 return switch (target.os.tag) {
440 .opencl, .amdhsa => try self.spv.importInstructionSet(.open_cl_std),
441 .vulkan, .opengl => try self.spv.importInstructionSet(.glsl_std_450),
442 else => unreachable,
443 };
444 }
445
446 /// Fetch the result-id for a previously generated instruction or constant.
447 fn resolve(self: *NavGen, inst: Air.Inst.Ref) !Id {
448 const pt = self.pt;
449 const zcu = pt.zcu;
450 if (try self.air.value(inst, pt)) |val| {
451 const ty = self.typeOf(inst);
452 if (ty.zigTypeTag(zcu) == .@"fn") {
453 const fn_nav = switch (zcu.intern_pool.indexToKey(val.ip_index)) {
454 .@"extern" => |@"extern"| @"extern".owner_nav,
455 .func => |func| func.owner_nav,
456 else => unreachable,
457 };
458 const spv_decl_index = try self.object.resolveNav(zcu, fn_nav);
459 try self.func.decl_deps.put(self.spv.gpa, spv_decl_index, {});
460 return self.spv.declPtr(spv_decl_index).result_id;
461 }
462
463 return try self.constant(ty, val, .direct);
464 }
465 const index = inst.toIndex().?;
466 return self.inst_results.get(index).?; // Assertion means instruction does not dominate usage.
467 }
468
469 fn resolveUav(self: *NavGen, val: InternPool.Index) !Id {
470 // TODO: This cannot be a function at this point, but it should probably be handled anyway.
471
472 const zcu = self.pt.zcu;
473 const ty = Type.fromInterned(zcu.intern_pool.typeOf(val));
474 const decl_ptr_ty_id = try self.ptrType(ty, self.spvStorageClass(.generic), .indirect);
475
476 const spv_decl_index = blk: {
477 const entry = try self.object.uav_link.getOrPut(self.object.gpa, .{ val, .function });
478 if (entry.found_existing) {
479 try self.addFunctionDep(entry.value_ptr.*, .function);
480
481 const result_id = self.spv.declPtr(entry.value_ptr.*).result_id;
482 return try self.castToGeneric(decl_ptr_ty_id, result_id);
483 }
484
485 const spv_decl_index = try self.spv.allocDecl(.invocation_global);
486 try self.addFunctionDep(spv_decl_index, .function);
487 entry.value_ptr.* = spv_decl_index;
488 break :blk spv_decl_index;
489 };
490
491 // TODO: At some point we will be able to generate this all constant here, but then all of
492 // constant() will need to be implemented such that it doesn't generate any at-runtime code.
493 // NOTE: Because this is a global, we really only want to initialize it once. Therefore the
494 // constant lowering of this value will need to be deferred to an initializer similar to
495 // other globals.
496
497 const result_id = self.spv.declPtr(spv_decl_index).result_id;
498
499 {
500 // Save the current state so that we can temporarily generate into a different function.
501 // TODO: This should probably be made a little more robust.
502 const func = self.func;
503 defer self.func = func;
504 const block_label = self.current_block_label;
505 defer self.current_block_label = block_label;
506
507 self.func = .{};
508 defer self.func.deinit(self.gpa);
509
510 const initializer_proto_ty_id = try self.functionType(Type.void, &.{});
511
512 const initializer_id = self.spv.allocId();
513 try self.func.prologue.emit(self.spv.gpa, .OpFunction, .{
514 .id_result_type = try self.resolveType(Type.void, .direct),
515 .id_result = initializer_id,
516 .function_control = .{},
517 .function_type = initializer_proto_ty_id,
518 });
519 const root_block_id = self.spv.allocId();
520 try self.func.prologue.emit(self.spv.gpa, .OpLabel, .{
521 .id_result = root_block_id,
522 });
523 self.current_block_label = root_block_id;
524
525 const val_id = try self.constant(ty, Value.fromInterned(val), .indirect);
526 try self.func.body.emit(self.spv.gpa, .OpStore, .{
527 .pointer = result_id,
528 .object = val_id,
529 });
530
531 try self.func.body.emit(self.spv.gpa, .OpReturn, {});
532 try self.func.body.emit(self.spv.gpa, .OpFunctionEnd, {});
533 try self.spv.addFunction(spv_decl_index, self.func);
534
535 try self.spv.debugNameFmt(initializer_id, "initializer of __anon_{d}", .{@intFromEnum(val)});
536
537 const fn_decl_ptr_ty_id = try self.ptrType(ty, .function, .indirect);
538 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpExtInst, .{
539 .id_result_type = fn_decl_ptr_ty_id,
540 .id_result = result_id,
541 .set = try self.spv.importInstructionSet(.zig),
542 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
543 .id_ref_4 = &.{initializer_id},
544 });
545 }
546
547 return try self.castToGeneric(decl_ptr_ty_id, result_id);
548 }
549
550 fn addFunctionDep(self: *NavGen, decl_index: SpvModule.Decl.Index, storage_class: StorageClass) !void {
551 if (self.spv.version.minor < 4) {
552 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
553 if (storage_class == .input or storage_class == .output) {
554 try self.func.decl_deps.put(self.spv.gpa, decl_index, {});
555 }
556 } else {
557 try self.func.decl_deps.put(self.spv.gpa, decl_index, {});
558 }
559 }
560
561 fn castToGeneric(self: *NavGen, type_id: Id, ptr_id: Id) !Id {
562 if (self.spv.hasFeature(.generic_pointer)) {
563 const result_id = self.spv.allocId();
564 try self.func.body.emit(self.spv.gpa, .OpPtrCastToGeneric, .{
565 .id_result_type = type_id,
566 .id_result = result_id,
567 .pointer = ptr_id,
568 });
569 return result_id;
570 }
571
572 return ptr_id;
573 }
574
575 /// Start a new SPIR-V block, Emits the label of the new block, and stores which
576 /// block we are currently generating.
577 /// Note that there is no such thing as nested blocks like in ZIR or AIR, so we don't need to
578 /// keep track of the previous block.
579 fn beginSpvBlock(self: *NavGen, label: Id) !void {
580 try self.func.body.emit(self.spv.gpa, .OpLabel, .{ .id_result = label });
581 self.current_block_label = label;
582 }
583
584 /// SPIR-V requires enabling specific integer sizes through capabilities, and so if they are not enabled, we need
585 /// to emulate them in other instructions/types. This function returns, given an integer bit width (signed or unsigned, sign
586 /// included), the width of the underlying type which represents it, given the enabled features for the current target.
587 /// If the result is `null`, the largest type the target platform supports natively is not able to perform computations using
588 /// that size. In this case, multiple elements of the largest type should be used.
589 /// The backing type will be chosen as the smallest supported integer larger or equal to it in number of bits.
590 /// The result is valid to be used with OpTypeInt.
591 /// TODO: Should the result of this function be cached?
592 fn backingIntBits(self: *NavGen, bits: u16) struct { u16, bool } {
593 // The backend will never be asked to compiler a 0-bit integer, so we won't have to handle those in this function.
594 assert(bits != 0);
595
596 if (self.spv.hasFeature(.arbitrary_precision_integers) and bits <= 32) {
597 return .{ bits, false };
598 }
599
600 // We require Int8 and Int16 capabilities and benefit Int64 when available.
601 // 32-bit integers are always supported (see spec, 2.16.1, Data rules).
602 const ints = [_]struct { bits: u16, enabled: bool }{
603 .{ .bits = 8, .enabled = true },
604 .{ .bits = 16, .enabled = true },
605 .{ .bits = 32, .enabled = true },
606 .{
607 .bits = 64,
608 .enabled = self.spv.hasFeature(.int64) or self.spv.target.cpu.arch == .spirv64,
609 },
610 };
611
612 for (ints) |int| {
613 if (bits <= int.bits and int.enabled) return .{ int.bits, false };
614 }
615
616 // Big int
617 return .{ std.mem.alignForward(u16, bits, big_int_bits), true };
618 }
619
620 /// Return the amount of bits in the largest supported integer type. This is either 32 (always supported), or 64 (if
621 /// the Int64 capability is enabled).
622 /// Note: The extension SPV_INTEL_arbitrary_precision_integers allows any integer size (at least up to 32 bits).
623 /// In theory that could also be used, but since the spec says that it only guarantees support up to 32-bit ints there
624 /// is no way of knowing whether those are actually supported.
625 /// TODO: Maybe this should be cached?
626 fn largestSupportedIntBits(self: *NavGen) u16 {
627 if (self.spv.hasFeature(.int64) or self.spv.target.cpu.arch == .spirv64) {
628 return 64;
629 }
630 return 32;
631 }
632
633 fn arithmeticTypeInfo(self: *NavGen, ty: Type) ArithmeticTypeInfo {
634 const zcu = self.pt.zcu;
635 const target = self.spv.target;
636 var scalar_ty = ty.scalarType(zcu);
637 if (scalar_ty.zigTypeTag(zcu) == .@"enum") {
638 scalar_ty = scalar_ty.intTagType(zcu);
639 }
640 const vector_len = if (ty.isVector(zcu)) ty.vectorLen(zcu) else null;
641 return switch (scalar_ty.zigTypeTag(zcu)) {
642 .bool => .{
643 .bits = 1, // Doesn't matter for this class.
644 .backing_bits = self.backingIntBits(1).@"0",
645 .vector_len = vector_len,
646 .signedness = .unsigned, // Technically, but doesn't matter for this class.
647 .class = .bool,
648 },
649 .float => .{
650 .bits = scalar_ty.floatBits(target),
651 .backing_bits = scalar_ty.floatBits(target), // TODO: F80?
652 .vector_len = vector_len,
653 .signedness = .signed, // Technically, but doesn't matter for this class.
654 .class = .float,
655 },
656 .int => blk: {
657 const int_info = scalar_ty.intInfo(zcu);
658 // TODO: Maybe it's useful to also return this value.
659 const backing_bits, const big_int = self.backingIntBits(int_info.bits);
660 break :blk .{
661 .bits = int_info.bits,
662 .backing_bits = backing_bits,
663 .vector_len = vector_len,
664 .signedness = int_info.signedness,
665 .class = class: {
666 if (big_int) break :class .composite_integer;
667 break :class if (backing_bits == int_info.bits) .integer else .strange_integer;
668 },
669 };
670 },
671 .@"enum" => unreachable,
672 .vector => unreachable,
673 else => unreachable, // Unhandled arithmetic type
674 };
675 }
676
677 /// Checks whether the type can be directly translated to SPIR-V vectors
678 fn isSpvVector(self: *NavGen, ty: Type) bool {
679 const zcu = self.pt.zcu;
680 if (ty.zigTypeTag(zcu) != .vector) return false;
681
682 // TODO: This check must be expanded for types that can be represented
683 // as integers (enums / packed structs?) and types that are represented
684 // by multiple SPIR-V values.
685 const scalar_ty = ty.scalarType(zcu);
686 switch (scalar_ty.zigTypeTag(zcu)) {
687 .bool,
688 .int,
689 .float,
690 => {},
691 else => return false,
692 }
693
694 const elem_ty = ty.childType(zcu);
695 const len = ty.vectorLen(zcu);
696
697 if (elem_ty.isNumeric(zcu) or elem_ty.toIntern() == .bool_type) {
698 if (len > 1 and len <= 4) return true;
699 if (self.spv.hasFeature(.vector16)) return (len == 8 or len == 16);
700 }
701
702 return false;
703 }
704
705 /// Emits a bool constant in a particular representation.
706 fn constBool(self: *NavGen, value: bool, repr: Repr) !Id {
707 return switch (repr) {
708 .indirect => self.constInt(Type.u1, @intFromBool(value)),
709 .direct => self.spv.constBool(value),
710 };
711 }
712
713 /// Emits an integer constant.
714 /// This function, unlike SpvModule.constInt, takes care to bitcast
715 /// the value to an unsigned int first for Kernels.
716 fn constInt(self: *NavGen, ty: Type, value: anytype) !Id {
717 const zcu = self.pt.zcu;
718 const scalar_ty = ty.scalarType(zcu);
719 const int_info = scalar_ty.intInfo(zcu);
720 // Use backing bits so that negatives are sign extended
721 const backing_bits, const big_int = self.backingIntBits(int_info.bits);
722 assert(backing_bits != 0); // u0 is comptime
723
724 const result_ty_id = try self.resolveType(scalar_ty, .indirect);
725 const signedness: Signedness = switch (@typeInfo(@TypeOf(value))) {
726 .int => |int| int.signedness,
727 .comptime_int => if (value < 0) .signed else .unsigned,
728 else => unreachable,
729 };
730 if (@sizeOf(@TypeOf(value)) >= 4 and big_int) {
731 const value64: u64 = switch (signedness) {
732 .signed => @bitCast(@as(i64, @intCast(value))),
733 .unsigned => @as(u64, @intCast(value)),
734 };
735 assert(backing_bits == 64);
736 return self.constructComposite(result_ty_id, &.{
737 try self.constInt(.u32, @as(u32, @truncate(value64))),
738 try self.constInt(.u32, @as(u32, @truncate(value64 << 32))),
739 });
740 }
741
742 const final_value: spec.LiteralContextDependentNumber = switch (self.spv.target.os.tag) {
743 .opencl, .amdhsa => blk: {
744 const value64: u64 = switch (signedness) {
745 .signed => @bitCast(@as(i64, @intCast(value))),
746 .unsigned => @as(u64, @intCast(value)),
747 };
748
749 // Manually truncate the value to the right amount of bits.
750 const truncated_value = if (backing_bits == 64)
751 value64
752 else
753 value64 & (@as(u64, 1) << @intCast(backing_bits)) - 1;
754
755 break :blk switch (backing_bits) {
756 1...32 => .{ .uint32 = @truncate(truncated_value) },
757 33...64 => .{ .uint64 = truncated_value },
758 else => unreachable,
759 };
760 },
761 else => switch (backing_bits) {
762 1...32 => if (signedness == .signed) .{ .int32 = @intCast(value) } else .{ .uint32 = @intCast(value) },
763 33...64 => if (signedness == .signed) .{ .int64 = value } else .{ .uint64 = value },
764 else => unreachable,
765 },
766 };
767
768 const result_id = try self.spv.constant(result_ty_id, final_value);
769
770 if (!ty.isVector(zcu)) return result_id;
771 return self.constructCompositeSplat(ty, result_id);
772 }
773
774 pub fn constructComposite(self: *NavGen, result_ty_id: Id, constituents: []const Id) !Id {
775 const result_id = self.spv.allocId();
776 try self.func.body.emit(self.gpa, .OpCompositeConstruct, .{
777 .id_result_type = result_ty_id,
778 .id_result = result_id,
779 .constituents = constituents,
780 });
781 return result_id;
782 }
783
784 /// Construct a composite at runtime with all lanes set to the same value.
785 /// ty must be an aggregate type.
786 fn constructCompositeSplat(self: *NavGen, ty: Type, constituent: Id) !Id {
787 const zcu = self.pt.zcu;
788 const n: usize = @intCast(ty.arrayLen(zcu));
789
790 const constituents = try self.gpa.alloc(Id, n);
791 defer self.gpa.free(constituents);
792 @memset(constituents, constituent);
793
794 const result_ty_id = try self.resolveType(ty, .direct);
795 return self.constructComposite(result_ty_id, constituents);
796 }
797
798 /// This function generates a load for a constant in direct (ie, non-memory) representation.
799 /// When the constant is simple, it can be generated directly using OpConstant instructions.
800 /// When the constant is more complicated however, it needs to be constructed using multiple values. This
801 /// is done by emitting a sequence of instructions that initialize the value.
802 //
803 /// This function should only be called during function code generation.
804 fn constant(self: *NavGen, ty: Type, val: Value, repr: Repr) !Id {
805 // Note: Using intern_map can only be used with constants that DO NOT generate any runtime code!!
806 // Ideally that should be all constants in the future, or it should be cleaned up somehow. For
807 // now, only use the intern_map on case-by-case basis by breaking to :cache.
808 if (self.intern_map.get(.{ val.toIntern(), repr })) |id| {
809 return id;
810 }
811
812 const pt = self.pt;
813 const zcu = pt.zcu;
814 const target = self.spv.target;
815 const result_ty_id = try self.resolveType(ty, repr);
816 const ip = &zcu.intern_pool;
817
818 log.debug("lowering constant: ty = {f}, val = {f}, key = {s}", .{ ty.fmt(pt), val.fmtValue(pt), @tagName(ip.indexToKey(val.toIntern())) });
819 if (val.isUndefDeep(zcu)) {
820 return self.spv.constUndef(result_ty_id);
821 }
822
823 const cacheable_id = cache: {
824 switch (ip.indexToKey(val.toIntern())) {
825 .int_type,
826 .ptr_type,
827 .array_type,
828 .vector_type,
829 .opt_type,
830 .anyframe_type,
831 .error_union_type,
832 .simple_type,
833 .struct_type,
834 .tuple_type,
835 .union_type,
836 .opaque_type,
837 .enum_type,
838 .func_type,
839 .error_set_type,
840 .inferred_error_set_type,
841 => unreachable, // types, not values
842
843 .undef => unreachable, // handled above
844
845 .variable,
846 .@"extern",
847 .func,
848 .enum_literal,
849 .empty_enum_value,
850 => unreachable, // non-runtime values
851
852 .simple_value => |simple_value| switch (simple_value) {
853 .undefined,
854 .void,
855 .null,
856 .empty_tuple,
857 .@"unreachable",
858 => unreachable, // non-runtime values
859
860 .false, .true => break :cache try self.constBool(val.toBool(), repr),
861 },
862 .int => {
863 if (ty.isSignedInt(zcu)) {
864 break :cache try self.constInt(ty, val.toSignedInt(zcu));
865 } else {
866 break :cache try self.constInt(ty, val.toUnsignedInt(zcu));
867 }
868 },
869 .float => {
870 const lit: spec.LiteralContextDependentNumber = switch (ty.floatBits(target)) {
871 16 => .{ .uint32 = @as(u16, @bitCast(val.toFloat(f16, zcu))) },
872 32 => .{ .float32 = val.toFloat(f32, zcu) },
873 64 => .{ .float64 = val.toFloat(f64, zcu) },
874 80, 128 => unreachable, // TODO
875 else => unreachable,
876 };
877 break :cache try self.spv.constant(result_ty_id, lit);
878 },
879 .err => |err| {
880 const value = try pt.getErrorValue(err.name);
881 break :cache try self.constInt(ty, value);
882 },
883 .error_union => |error_union| {
884 // TODO: Error unions may be constructed with constant instructions if the payload type
885 // allows it. For now, just generate it here regardless.
886 const err_int_ty = try pt.errorIntType();
887 const err_ty = switch (error_union.val) {
888 .err_name => ty.errorUnionSet(zcu),
889 .payload => err_int_ty,
890 };
891 const err_val = switch (error_union.val) {
892 .err_name => |err_name| Value.fromInterned(try pt.intern(.{ .err = .{
893 .ty = ty.errorUnionSet(zcu).toIntern(),
894 .name = err_name,
895 } })),
896 .payload => try pt.intValue(err_int_ty, 0),
897 };
898 const payload_ty = ty.errorUnionPayload(zcu);
899 const eu_layout = self.errorUnionLayout(payload_ty);
900 if (!eu_layout.payload_has_bits) {
901 // We use the error type directly as the type.
902 break :cache try self.constant(err_ty, err_val, .indirect);
903 }
904
905 const payload_val = Value.fromInterned(switch (error_union.val) {
906 .err_name => try pt.intern(.{ .undef = payload_ty.toIntern() }),
907 .payload => |payload| payload,
908 });
909
910 var constituents: [2]Id = undefined;
911 var types: [2]Type = undefined;
912 if (eu_layout.error_first) {
913 constituents[0] = try self.constant(err_ty, err_val, .indirect);
914 constituents[1] = try self.constant(payload_ty, payload_val, .indirect);
915 types = .{ err_ty, payload_ty };
916 } else {
917 constituents[0] = try self.constant(payload_ty, payload_val, .indirect);
918 constituents[1] = try self.constant(err_ty, err_val, .indirect);
919 types = .{ payload_ty, err_ty };
920 }
921
922 const comp_ty_id = try self.resolveType(ty, .direct);
923 return try self.constructComposite(comp_ty_id, &constituents);
924 },
925 .enum_tag => {
926 const int_val = try val.intFromEnum(ty, pt);
927 const int_ty = ty.intTagType(zcu);
928 break :cache try self.constant(int_ty, int_val, repr);
929 },
930 .ptr => return self.constantPtr(val),
931 .slice => |slice| {
932 const ptr_id = try self.constantPtr(Value.fromInterned(slice.ptr));
933 const len_id = try self.constant(Type.usize, Value.fromInterned(slice.len), .indirect);
934 const comp_ty_id = try self.resolveType(ty, .direct);
935 return try self.constructComposite(comp_ty_id, &.{ ptr_id, len_id });
936 },
937 .opt => {
938 const payload_ty = ty.optionalChild(zcu);
939 const maybe_payload_val = val.optionalValue(zcu);
940
941 if (!payload_ty.hasRuntimeBits(zcu)) {
942 break :cache try self.constBool(maybe_payload_val != null, .indirect);
943 } else if (ty.optionalReprIsPayload(zcu)) {
944 // Optional representation is a nullable pointer or slice.
945 if (maybe_payload_val) |payload_val| {
946 return try self.constant(payload_ty, payload_val, .indirect);
947 } else {
948 break :cache try self.spv.constNull(result_ty_id);
949 }
950 }
951
952 // Optional representation is a structure.
953 // { Payload, Bool }
954
955 const has_pl_id = try self.constBool(maybe_payload_val != null, .indirect);
956 const payload_id = if (maybe_payload_val) |payload_val|
957 try self.constant(payload_ty, payload_val, .indirect)
958 else
959 try self.spv.constUndef(try self.resolveType(payload_ty, .indirect));
960
961 const comp_ty_id = try self.resolveType(ty, .direct);
962 return try self.constructComposite(comp_ty_id, &.{ payload_id, has_pl_id });
963 },
964 .aggregate => |aggregate| switch (ip.indexToKey(ty.ip_index)) {
965 inline .array_type, .vector_type => |array_type, tag| {
966 const elem_ty = Type.fromInterned(array_type.child);
967
968 const constituents = try self.gpa.alloc(Id, @intCast(ty.arrayLenIncludingSentinel(zcu)));
969 defer self.gpa.free(constituents);
970
971 const child_repr: Repr = switch (tag) {
972 .array_type => .indirect,
973 .vector_type => .direct,
974 else => unreachable,
975 };
976
977 switch (aggregate.storage) {
978 .bytes => |bytes| {
979 // TODO: This is really space inefficient, perhaps there is a better
980 // way to do it?
981 for (constituents, bytes.toSlice(constituents.len, ip)) |*constituent, byte| {
982 constituent.* = try self.constInt(elem_ty, byte);
983 }
984 },
985 .elems => |elems| {
986 for (constituents, elems) |*constituent, elem| {
987 constituent.* = try self.constant(elem_ty, Value.fromInterned(elem), child_repr);
988 }
989 },
990 .repeated_elem => |elem| {
991 @memset(constituents, try self.constant(elem_ty, Value.fromInterned(elem), child_repr));
992 },
993 }
994
995 const comp_ty_id = try self.resolveType(ty, .direct);
996 return self.constructComposite(comp_ty_id, constituents);
997 },
998 .struct_type => {
999 const struct_type = zcu.typeToStruct(ty).?;
1000
1001 if (struct_type.layout == .@"packed") {
1002 // TODO: composite int
1003 // TODO: endianness
1004 const bits: u16 = @intCast(ty.bitSize(zcu));
1005 const bytes = std.mem.alignForward(u16, self.backingIntBits(bits).@"0", 8) / 8;
1006 var limbs: [8]u8 = undefined;
1007 @memset(&limbs, 0);
1008 val.writeToPackedMemory(ty, pt, limbs[0..bytes], 0) catch unreachable;
1009 const backing_ty = Type.fromInterned(struct_type.backingIntTypeUnordered(ip));
1010 return try self.constInt(backing_ty, @as(u64, @bitCast(limbs)));
1011 }
1012
1013 var types = std.ArrayList(Type).init(self.gpa);
1014 defer types.deinit();
1015
1016 var constituents = std.ArrayList(Id).init(self.gpa);
1017 defer constituents.deinit();
1018
1019 var it = struct_type.iterateRuntimeOrder(ip);
1020 while (it.next()) |field_index| {
1021 const field_ty = Type.fromInterned(struct_type.field_types.get(ip)[field_index]);
1022 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1023 // This is a zero-bit field - we only needed it for the alignment.
1024 continue;
1025 }
1026
1027 // TODO: Padding?
1028 const field_val = try val.fieldValue(pt, field_index);
1029 const field_id = try self.constant(field_ty, field_val, .indirect);
1030
1031 try types.append(field_ty);
1032 try constituents.append(field_id);
1033 }
1034
1035 const comp_ty_id = try self.resolveType(ty, .direct);
1036 return try self.constructComposite(comp_ty_id, constituents.items);
1037 },
1038 .tuple_type => return self.todo("implement tuple types", .{}),
1039 else => unreachable,
1040 },
1041 .un => |un| {
1042 if (un.tag == .none) {
1043 assert(ty.containerLayout(zcu) == .@"packed"); // TODO
1044 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1045 return try self.constant(int_ty, Value.fromInterned(un.val), .direct);
1046 }
1047 const active_field = ty.unionTagFieldIndex(Value.fromInterned(un.tag), zcu).?;
1048 const union_obj = zcu.typeToUnion(ty).?;
1049 const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[active_field]);
1050 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
1051 try self.constant(field_ty, Value.fromInterned(un.val), .direct)
1052 else
1053 null;
1054 return try self.unionInit(ty, active_field, payload);
1055 },
1056 .memoized_call => unreachable,
1057 }
1058 };
1059
1060 try self.intern_map.putNoClobber(self.gpa, .{ val.toIntern(), repr }, cacheable_id);
1061
1062 return cacheable_id;
1063 }
1064
1065 fn constantPtr(self: *NavGen, ptr_val: Value) Error!Id {
1066 const pt = self.pt;
1067
1068 if (ptr_val.isUndef(pt.zcu)) {
1069 const result_ty = ptr_val.typeOf(pt.zcu);
1070 const result_ty_id = try self.resolveType(result_ty, .direct);
1071 return self.spv.constUndef(result_ty_id);
1072 }
1073
1074 var arena = std.heap.ArenaAllocator.init(self.gpa);
1075 defer arena.deinit();
1076
1077 const derivation = try ptr_val.pointerDerivation(arena.allocator(), pt);
1078 return self.derivePtr(derivation);
1079 }
1080
1081 fn derivePtr(self: *NavGen, derivation: Value.PointerDeriveStep) Error!Id {
1082 const pt = self.pt;
1083 const zcu = pt.zcu;
1084 switch (derivation) {
1085 .comptime_alloc_ptr, .comptime_field_ptr => unreachable,
1086 .int => |int| {
1087 const result_ty_id = try self.resolveType(int.ptr_ty, .direct);
1088 // TODO: This can probably be an OpSpecConstantOp Bitcast, but
1089 // that is not implemented by Mesa yet. Therefore, just generate it
1090 // as a runtime operation.
1091 const result_ptr_id = self.spv.allocId();
1092 try self.func.body.emit(self.spv.gpa, .OpConvertUToPtr, .{
1093 .id_result_type = result_ty_id,
1094 .id_result = result_ptr_id,
1095 .integer_value = try self.constant(Type.usize, try pt.intValue(Type.usize, int.addr), .direct),
1096 });
1097 return result_ptr_id;
1098 },
1099 .nav_ptr => |nav| {
1100 const result_ptr_ty = try pt.navPtrType(nav);
1101 return self.constantNavRef(result_ptr_ty, nav);
1102 },
1103 .uav_ptr => |uav| {
1104 const result_ptr_ty = Type.fromInterned(uav.orig_ty);
1105 return self.constantUavRef(result_ptr_ty, uav);
1106 },
1107 .eu_payload_ptr => @panic("TODO"),
1108 .opt_payload_ptr => @panic("TODO"),
1109 .field_ptr => |field| {
1110 const parent_ptr_id = try self.derivePtr(field.parent.*);
1111 const parent_ptr_ty = try field.parent.ptrType(pt);
1112 return self.structFieldPtr(field.result_ptr_ty, parent_ptr_ty, parent_ptr_id, field.field_idx);
1113 },
1114 .elem_ptr => |elem| {
1115 const parent_ptr_id = try self.derivePtr(elem.parent.*);
1116 const parent_ptr_ty = try elem.parent.ptrType(pt);
1117 const index_id = try self.constInt(Type.usize, elem.elem_idx);
1118 return self.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id);
1119 },
1120 .offset_and_cast => |oac| {
1121 const parent_ptr_id = try self.derivePtr(oac.parent.*);
1122 const parent_ptr_ty = try oac.parent.ptrType(pt);
1123 const result_ty_id = try self.resolveType(oac.new_ptr_ty, .direct);
1124 const child_size = oac.new_ptr_ty.childType(zcu).abiSize(zcu);
1125
1126 if (parent_ptr_ty.childType(zcu).isVector(zcu) and oac.byte_offset % child_size == 0) {
1127 // Vector element ptr accesses are derived as offset_and_cast.
1128 // We can just use OpAccessChain.
1129 return self.accessChain(
1130 result_ty_id,
1131 parent_ptr_id,
1132 &.{@intCast(@divExact(oac.byte_offset, child_size))},
1133 );
1134 }
1135
1136 if (oac.byte_offset == 0) {
1137 // Allow changing the pointer type child only to restructure arrays.
1138 // e.g. [3][2]T to T is fine, as is [2]T -> [2][1]T.
1139 const result_ptr_id = self.spv.allocId();
1140 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
1141 .id_result_type = result_ty_id,
1142 .id_result = result_ptr_id,
1143 .operand = parent_ptr_id,
1144 });
1145 return result_ptr_id;
1146 }
1147
1148 return self.fail("cannot perform pointer cast: '{f}' to '{f}'", .{
1149 parent_ptr_ty.fmt(pt),
1150 oac.new_ptr_ty.fmt(pt),
1151 });
1152 },
1153 }
1154 }
1155
1156 fn constantUavRef(
1157 self: *NavGen,
1158 ty: Type,
1159 uav: InternPool.Key.Ptr.BaseAddr.Uav,
1160 ) !Id {
1161 // TODO: Merge this function with constantDeclRef.
1162
1163 const pt = self.pt;
1164 const zcu = pt.zcu;
1165 const ip = &zcu.intern_pool;
1166 const ty_id = try self.resolveType(ty, .direct);
1167 const uav_ty = Type.fromInterned(ip.typeOf(uav.val));
1168
1169 switch (ip.indexToKey(uav.val)) {
1170 .func => unreachable, // TODO
1171 .@"extern" => assert(!ip.isFunctionType(uav_ty.toIntern())),
1172 else => {},
1173 }
1174
1175 // const is_fn_body = decl_ty.zigTypeTag(zcu) == .@"fn";
1176 if (!uav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1177 // Pointer to nothing - return undefined
1178 return self.spv.constUndef(ty_id);
1179 }
1180
1181 // Uav refs are always generic.
1182 assert(ty.ptrAddressSpace(zcu) == .generic);
1183 const decl_ptr_ty_id = try self.ptrType(uav_ty, .generic, .indirect);
1184 const ptr_id = try self.resolveUav(uav.val);
1185
1186 if (decl_ptr_ty_id != ty_id) {
1187 // Differing pointer types, insert a cast.
1188 const casted_ptr_id = self.spv.allocId();
1189 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
1190 .id_result_type = ty_id,
1191 .id_result = casted_ptr_id,
1192 .operand = ptr_id,
1193 });
1194 return casted_ptr_id;
1195 } else {
1196 return ptr_id;
1197 }
1198 }
1199
1200 fn constantNavRef(self: *NavGen, ty: Type, nav_index: InternPool.Nav.Index) !Id {
1201 const pt = self.pt;
1202 const zcu = pt.zcu;
1203 const ip = &zcu.intern_pool;
1204 const ty_id = try self.resolveType(ty, .direct);
1205 const nav = ip.getNav(nav_index);
1206 const nav_ty: Type = .fromInterned(nav.typeOf(ip));
1207
1208 switch (nav.status) {
1209 .unresolved => unreachable,
1210 .type_resolved => {}, // this is not a function or extern
1211 .fully_resolved => |r| switch (ip.indexToKey(r.val)) {
1212 .func => {
1213 // TODO: Properly lower function pointers. For now we are going to hack around it and
1214 // just generate an empty pointer. Function pointers are represented by a pointer to usize.
1215 return try self.spv.constUndef(ty_id);
1216 },
1217 .@"extern" => if (ip.isFunctionType(nav_ty.toIntern())) @panic("TODO"),
1218 else => {},
1219 },
1220 }
1221
1222 if (!nav_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
1223 // Pointer to nothing - return undefined.
1224 return self.spv.constUndef(ty_id);
1225 }
1226
1227 const spv_decl_index = try self.object.resolveNav(zcu, nav_index);
1228 const spv_decl = self.spv.declPtr(spv_decl_index);
1229
1230 const decl_id = switch (spv_decl.kind) {
1231 .func => unreachable, // TODO: Is this possible?
1232 .global, .invocation_global => spv_decl.result_id,
1233 };
1234
1235 const storage_class = self.spvStorageClass(nav.getAddrspace());
1236 try self.addFunctionDep(spv_decl_index, storage_class);
1237
1238 const decl_ptr_ty_id = try self.ptrType(nav_ty, storage_class, .indirect);
1239
1240 const ptr_id = switch (storage_class) {
1241 .generic => try self.castToGeneric(decl_ptr_ty_id, decl_id),
1242 else => decl_id,
1243 };
1244
1245 if (decl_ptr_ty_id != ty_id) {
1246 // Differing pointer types, insert a cast.
1247 const casted_ptr_id = self.spv.allocId();
1248 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
1249 .id_result_type = ty_id,
1250 .id_result = casted_ptr_id,
1251 .operand = ptr_id,
1252 });
1253 return casted_ptr_id;
1254 } else {
1255 return ptr_id;
1256 }
1257 }
1258
1259 // Turn a Zig type's name into a cache reference.
1260 fn resolveTypeName(self: *NavGen, ty: Type) ![]const u8 {
1261 var aw: std.io.Writer.Allocating = .init(self.gpa);
1262 defer aw.deinit();
1263 ty.print(&aw.writer, self.pt) catch |err| switch (err) {
1264 error.WriteFailed => return error.OutOfMemory,
1265 };
1266 return try aw.toOwnedSlice();
1267 }
1268
1269 /// Create an integer type suitable for storing at least 'bits' bits.
1270 /// The integer type that is returned by this function is the type that is used to perform
1271 /// actual operations (as well as store) a Zig type of a particular number of bits. To create
1272 /// a type with an exact size, use SpvModule.intType.
1273 fn intType(self: *NavGen, signedness: std.builtin.Signedness, bits: u16) !Id {
1274 const backing_bits, const big_int = self.backingIntBits(bits);
1275 if (big_int) {
1276 if (backing_bits > 64) {
1277 return self.fail("composite integers larger than 64bit aren't supported", .{});
1278 }
1279 const int_ty = try self.resolveType(.u32, .direct);
1280 return self.arrayType(backing_bits / big_int_bits, int_ty);
1281 }
1282
1283 return switch (self.spv.target.os.tag) {
1284 // Kernel only supports unsigned ints.
1285 .opencl, .amdhsa => return self.spv.intType(.unsigned, backing_bits),
1286 else => self.spv.intType(signedness, backing_bits),
1287 };
1288 }
1289
1290 fn arrayType(self: *NavGen, len: u32, child_ty: Id) !Id {
1291 const len_id = try self.constInt(Type.u32, len);
1292 return self.spv.arrayType(len_id, child_ty);
1293 }
1294
1295 fn ptrType(self: *NavGen, child_ty: Type, storage_class: StorageClass, child_repr: Repr) !Id {
1296 const zcu = self.pt.zcu;
1297 const ip = &zcu.intern_pool;
1298 const key = .{ child_ty.toIntern(), storage_class, child_repr };
1299 const entry = try self.ptr_types.getOrPut(self.gpa, key);
1300 if (entry.found_existing) {
1301 const fwd_id = entry.value_ptr.ty_id;
1302 if (!entry.value_ptr.fwd_emitted) {
1303 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpTypeForwardPointer, .{
1304 .pointer_type = fwd_id,
1305 .storage_class = storage_class,
1306 });
1307 entry.value_ptr.fwd_emitted = true;
1308 }
1309 return fwd_id;
1310 }
1311
1312 const result_id = self.spv.allocId();
1313 entry.value_ptr.* = .{
1314 .ty_id = result_id,
1315 .fwd_emitted = false,
1316 };
1317
1318 const child_ty_id = try self.resolveType(child_ty, child_repr);
1319
1320 switch (self.spv.target.os.tag) {
1321 .vulkan, .opengl => {
1322 if (child_ty.zigTypeTag(zcu) == .@"struct") {
1323 switch (storage_class) {
1324 .uniform, .push_constant => try self.spv.decorate(child_ty_id, .block),
1325 else => {},
1326 }
1327 }
1328
1329 switch (ip.indexToKey(child_ty.toIntern())) {
1330 .func_type, .opaque_type => {},
1331 else => {
1332 try self.spv.decorate(result_id, .{ .array_stride = .{ .array_stride = @intCast(child_ty.abiSize(zcu)) } });
1333 },
1334 }
1335 },
1336 else => {},
1337 }
1338
1339 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpTypePointer, .{
1340 .id_result = result_id,
1341 .storage_class = storage_class,
1342 .type = child_ty_id,
1343 });
1344
1345 self.ptr_types.getPtr(key).?.fwd_emitted = true;
1346
1347 return result_id;
1348 }
1349
1350 fn functionType(self: *NavGen, return_ty: Type, param_types: []const Type) !Id {
1351 const return_ty_id = try self.resolveFnReturnType(return_ty);
1352 const param_ids = try self.gpa.alloc(Id, param_types.len);
1353 defer self.gpa.free(param_ids);
1354
1355 for (param_types, param_ids) |param_ty, *param_id| {
1356 param_id.* = try self.resolveType(param_ty, .direct);
1357 }
1358
1359 return self.spv.functionType(return_ty_id, param_ids);
1360 }
1361
1362 /// Generate a union type. Union types are always generated with the
1363 /// most aligned field active. If the tag alignment is greater
1364 /// than that of the payload, a regular union (non-packed, with both tag and
1365 /// payload), will be generated as follows:
1366 /// struct {
1367 /// tag: TagType,
1368 /// payload: MostAlignedFieldType,
1369 /// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1370 /// padding: [padding_size]u8,
1371 /// }
1372 /// If the payload alignment is greater than that of the tag:
1373 /// struct {
1374 /// payload: MostAlignedFieldType,
1375 /// payload_padding: [payload_size - @sizeOf(MostAlignedFieldType)]u8,
1376 /// tag: TagType,
1377 /// padding: [padding_size]u8,
1378 /// }
1379 /// If any of the fields' size is 0, it will be omitted.
1380 fn resolveUnionType(self: *NavGen, ty: Type) !Id {
1381 const zcu = self.pt.zcu;
1382 const ip = &zcu.intern_pool;
1383 const union_obj = zcu.typeToUnion(ty).?;
1384
1385 if (union_obj.flagsUnordered(ip).layout == .@"packed") {
1386 return try self.intType(.unsigned, @intCast(ty.bitSize(zcu)));
1387 }
1388
1389 const layout = self.unionLayout(ty);
1390 if (!layout.has_payload) {
1391 // No payload, so represent this as just the tag type.
1392 return try self.resolveType(Type.fromInterned(union_obj.enum_tag_ty), .indirect);
1393 }
1394
1395 var member_types: [4]Id = undefined;
1396 var member_names: [4][]const u8 = undefined;
1397
1398 const u8_ty_id = try self.resolveType(Type.u8, .direct);
1399
1400 if (layout.tag_size != 0) {
1401 const tag_ty_id = try self.resolveType(Type.fromInterned(union_obj.enum_tag_ty), .indirect);
1402 member_types[layout.tag_index] = tag_ty_id;
1403 member_names[layout.tag_index] = "(tag)";
1404 }
1405
1406 if (layout.payload_size != 0) {
1407 const payload_ty_id = try self.resolveType(layout.payload_ty, .indirect);
1408 member_types[layout.payload_index] = payload_ty_id;
1409 member_names[layout.payload_index] = "(payload)";
1410 }
1411
1412 if (layout.payload_padding_size != 0) {
1413 const payload_padding_ty_id = try self.arrayType(@intCast(layout.payload_padding_size), u8_ty_id);
1414 member_types[layout.payload_padding_index] = payload_padding_ty_id;
1415 member_names[layout.payload_padding_index] = "(payload padding)";
1416 }
1417
1418 if (layout.padding_size != 0) {
1419 const padding_ty_id = try self.arrayType(@intCast(layout.padding_size), u8_ty_id);
1420 member_types[layout.padding_index] = padding_ty_id;
1421 member_names[layout.padding_index] = "(padding)";
1422 }
1423
1424 const result_id = self.spv.allocId();
1425 try self.spv.structType(result_id, member_types[0..layout.total_fields], member_names[0..layout.total_fields]);
1426
1427 const type_name = try self.resolveTypeName(ty);
1428 defer self.gpa.free(type_name);
1429 try self.spv.debugName(result_id, type_name);
1430
1431 return result_id;
1432 }
1433
1434 fn resolveFnReturnType(self: *NavGen, ret_ty: Type) !Id {
1435 const zcu = self.pt.zcu;
1436 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1437 // If the return type is an error set or an error union, then we make this
1438 // anyerror return type instead, so that it can be coerced into a function
1439 // pointer type which has anyerror as the return type.
1440 if (ret_ty.isError(zcu)) {
1441 return self.resolveType(Type.anyerror, .direct);
1442 } else {
1443 return self.resolveType(Type.void, .direct);
1444 }
1445 }
1446
1447 return try self.resolveType(ret_ty, .direct);
1448 }
1449
1450 /// Turn a Zig type into a SPIR-V Type, and return a reference to it.
1451 fn resolveType(self: *NavGen, ty: Type, repr: Repr) Error!Id {
1452 if (self.intern_map.get(.{ ty.toIntern(), repr })) |id| {
1453 return id;
1454 }
1455
1456 const id = try self.resolveTypeInner(ty, repr);
1457 try self.intern_map.put(self.gpa, .{ ty.toIntern(), repr }, id);
1458 return id;
1459 }
1460
1461 fn resolveTypeInner(self: *NavGen, ty: Type, repr: Repr) Error!Id {
1462 const pt = self.pt;
1463 const zcu = pt.zcu;
1464 const ip = &zcu.intern_pool;
1465 log.debug("resolveType: ty = {f}", .{ty.fmt(pt)});
1466 const target = self.spv.target;
1467
1468 const section = &self.spv.sections.types_globals_constants;
1469
1470 switch (ty.zigTypeTag(zcu)) {
1471 .noreturn => {
1472 assert(repr == .direct);
1473 return try self.spv.voidType();
1474 },
1475 .void => switch (repr) {
1476 .direct => {
1477 return try self.spv.voidType();
1478 },
1479 // Pointers to void
1480 .indirect => {
1481 const result_id = self.spv.allocId();
1482 try section.emit(self.spv.gpa, .OpTypeOpaque, .{
1483 .id_result = result_id,
1484 .literal_string = "void",
1485 });
1486 return result_id;
1487 },
1488 },
1489 .bool => switch (repr) {
1490 .direct => return try self.spv.boolType(),
1491 .indirect => return try self.resolveType(Type.u1, .indirect),
1492 },
1493 .int => {
1494 const int_info = ty.intInfo(zcu);
1495 if (int_info.bits == 0) {
1496 // Some times, the backend will be asked to generate a pointer to i0. OpTypeInt
1497 // with 0 bits is invalid, so return an opaque type in this case.
1498 assert(repr == .indirect);
1499 const result_id = self.spv.allocId();
1500 try section.emit(self.spv.gpa, .OpTypeOpaque, .{
1501 .id_result = result_id,
1502 .literal_string = "u0",
1503 });
1504 return result_id;
1505 }
1506 return try self.intType(int_info.signedness, int_info.bits);
1507 },
1508 .@"enum" => {
1509 const tag_ty = ty.intTagType(zcu);
1510 return try self.resolveType(tag_ty, repr);
1511 },
1512 .float => {
1513 // We can (and want) not really emulate floating points with other floating point types like with the integer types,
1514 // so if the float is not supported, just return an error.
1515 const bits = ty.floatBits(target);
1516 const supported = switch (bits) {
1517 16 => self.spv.hasFeature(.float16),
1518 // 32-bit floats are always supported (see spec, 2.16.1, Data rules).
1519 32 => true,
1520 64 => self.spv.hasFeature(.float64),
1521 else => false,
1522 };
1523
1524 if (!supported) {
1525 return self.fail("Floating point width of {} bits is not supported for the current SPIR-V feature set", .{bits});
1526 }
1527
1528 return try self.spv.floatType(bits);
1529 },
1530 .array => {
1531 const elem_ty = ty.childType(zcu);
1532 const elem_ty_id = try self.resolveType(elem_ty, .indirect);
1533 const total_len = std.math.cast(u32, ty.arrayLenIncludingSentinel(zcu)) orelse {
1534 return self.fail("array type of {} elements is too large", .{ty.arrayLenIncludingSentinel(zcu)});
1535 };
1536
1537 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1538 // The size of the array would be 0, but that is not allowed in SPIR-V.
1539 // This path can be reached when the backend is asked to generate a pointer to
1540 // an array of some zero-bit type. This should always be an indirect path.
1541 assert(repr == .indirect);
1542
1543 // We cannot use the child type here, so just use an opaque type.
1544 const result_id = self.spv.allocId();
1545 try section.emit(self.spv.gpa, .OpTypeOpaque, .{
1546 .id_result = result_id,
1547 .literal_string = "zero-sized array",
1548 });
1549 return result_id;
1550 } else if (total_len == 0) {
1551 // The size of the array would be 0, but that is not allowed in SPIR-V.
1552 // This path can be reached for example when there is a slicing of a pointer
1553 // that produces a zero-length array. In all cases where this type can be generated,
1554 // this should be an indirect path.
1555 assert(repr == .indirect);
1556
1557 // In this case, we have an array of a non-zero sized type. In this case,
1558 // generate an array of 1 element instead, so that ptr_elem_ptr instructions
1559 // can be lowered to ptrAccessChain instead of manually performing the math.
1560 return try self.arrayType(1, elem_ty_id);
1561 } else {
1562 const result_id = try self.arrayType(total_len, elem_ty_id);
1563 switch (self.spv.target.os.tag) {
1564 .vulkan, .opengl => {
1565 try self.spv.decorate(result_id, .{ .array_stride = .{
1566 .array_stride = @intCast(elem_ty.abiSize(zcu)),
1567 } });
1568 },
1569 else => {},
1570 }
1571 return result_id;
1572 }
1573 },
1574 .vector => {
1575 const elem_ty = ty.childType(zcu);
1576 const elem_ty_id = try self.resolveType(elem_ty, repr);
1577 const len = ty.vectorLen(zcu);
1578
1579 if (self.isSpvVector(ty)) {
1580 return try self.spv.vectorType(len, elem_ty_id);
1581 } else {
1582 return try self.arrayType(len, elem_ty_id);
1583 }
1584 },
1585 .@"fn" => switch (repr) {
1586 .direct => {
1587 const fn_info = zcu.typeToFunc(ty).?;
1588
1589 comptime assert(zig_call_abi_ver == 3);
1590 switch (fn_info.cc) {
1591 .auto,
1592 .spirv_kernel,
1593 .spirv_fragment,
1594 .spirv_vertex,
1595 .spirv_device,
1596 => {},
1597 else => unreachable,
1598 }
1599
1600 // Guaranteed by callConvSupportsVarArgs, there are no SPIR-V CCs which support
1601 // varargs.
1602 assert(!fn_info.is_var_args);
1603
1604 // Note: Logic is different from functionType().
1605 const param_ty_ids = try self.gpa.alloc(Id, fn_info.param_types.len);
1606 defer self.gpa.free(param_ty_ids);
1607 var param_index: usize = 0;
1608 for (fn_info.param_types.get(ip)) |param_ty_index| {
1609 const param_ty = Type.fromInterned(param_ty_index);
1610 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
1611
1612 param_ty_ids[param_index] = try self.resolveType(param_ty, .direct);
1613 param_index += 1;
1614 }
1615
1616 const return_ty_id = try self.resolveFnReturnType(Type.fromInterned(fn_info.return_type));
1617
1618 const result_id = self.spv.allocId();
1619 try section.emit(self.spv.gpa, .OpTypeFunction, .{
1620 .id_result = result_id,
1621 .return_type = return_ty_id,
1622 .id_ref_2 = param_ty_ids[0..param_index],
1623 });
1624
1625 return result_id;
1626 },
1627 .indirect => {
1628 // TODO: Represent function pointers properly.
1629 // For now, just use an usize type.
1630 return try self.resolveType(Type.usize, .indirect);
1631 },
1632 },
1633 .pointer => {
1634 const ptr_info = ty.ptrInfo(zcu);
1635
1636 const child_ty = Type.fromInterned(ptr_info.child);
1637 const storage_class = self.spvStorageClass(ptr_info.flags.address_space);
1638 const ptr_ty_id = try self.ptrType(child_ty, storage_class, .indirect);
1639
1640 if (ptr_info.flags.size != .slice) {
1641 return ptr_ty_id;
1642 }
1643
1644 const size_ty_id = try self.resolveType(Type.usize, .direct);
1645 const result_id = self.spv.allocId();
1646 try self.spv.structType(
1647 result_id,
1648 &.{ ptr_ty_id, size_ty_id },
1649 &.{ "ptr", "len" },
1650 );
1651 return result_id;
1652 },
1653 .@"struct" => {
1654 const struct_type = switch (ip.indexToKey(ty.toIntern())) {
1655 .tuple_type => |tuple| {
1656 const member_types = try self.gpa.alloc(Id, tuple.values.len);
1657 defer self.gpa.free(member_types);
1658
1659 var member_index: usize = 0;
1660 for (tuple.types.get(ip), tuple.values.get(ip)) |field_ty, field_val| {
1661 if (field_val != .none or !Type.fromInterned(field_ty).hasRuntimeBits(zcu)) continue;
1662
1663 member_types[member_index] = try self.resolveType(Type.fromInterned(field_ty), .indirect);
1664 member_index += 1;
1665 }
1666
1667 const result_id = self.spv.allocId();
1668 try self.spv.structType(result_id, member_types[0..member_index], null);
1669
1670 const type_name = try self.resolveTypeName(ty);
1671 defer self.gpa.free(type_name);
1672 try self.spv.debugName(result_id, type_name);
1673
1674 return result_id;
1675 },
1676 .struct_type => ip.loadStructType(ty.toIntern()),
1677 else => unreachable,
1678 };
1679
1680 if (struct_type.layout == .@"packed") {
1681 return try self.resolveType(Type.fromInterned(struct_type.backingIntTypeUnordered(ip)), .direct);
1682 }
1683
1684 var member_types = std.ArrayList(Id).init(self.gpa);
1685 defer member_types.deinit();
1686
1687 var member_names = std.ArrayList([]const u8).init(self.gpa);
1688 defer member_names.deinit();
1689
1690 var index: u32 = 0;
1691 var it = struct_type.iterateRuntimeOrder(ip);
1692 const result_id = self.spv.allocId();
1693 while (it.next()) |field_index| {
1694 const field_ty = Type.fromInterned(struct_type.field_types.get(ip)[field_index]);
1695 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1696 // This is a zero-bit field - we only needed it for the alignment.
1697 continue;
1698 }
1699
1700 switch (self.spv.target.os.tag) {
1701 .vulkan, .opengl => {
1702 try self.spv.decorateMember(result_id, index, .{ .offset = .{
1703 .byte_offset = @intCast(ty.structFieldOffset(field_index, zcu)),
1704 } });
1705 },
1706 else => {},
1707 }
1708
1709 const field_name = struct_type.fieldName(ip, field_index).unwrap() orelse
1710 try ip.getOrPutStringFmt(zcu.gpa, pt.tid, "{d}", .{field_index}, .no_embedded_nulls);
1711 try member_types.append(try self.resolveType(field_ty, .indirect));
1712 try member_names.append(field_name.toSlice(ip));
1713
1714 index += 1;
1715 }
1716
1717 try self.spv.structType(result_id, member_types.items, member_names.items);
1718
1719 const type_name = try self.resolveTypeName(ty);
1720 defer self.gpa.free(type_name);
1721 try self.spv.debugName(result_id, type_name);
1722
1723 return result_id;
1724 },
1725 .optional => {
1726 const payload_ty = ty.optionalChild(zcu);
1727 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
1728 // Just use a bool.
1729 // Note: Always generate the bool with indirect format, to save on some sanity
1730 // Perform the conversion to a direct bool when the field is extracted.
1731 return try self.resolveType(Type.bool, .indirect);
1732 }
1733
1734 const payload_ty_id = try self.resolveType(payload_ty, .indirect);
1735 if (ty.optionalReprIsPayload(zcu)) {
1736 // Optional is actually a pointer or a slice.
1737 return payload_ty_id;
1738 }
1739
1740 const bool_ty_id = try self.resolveType(Type.bool, .indirect);
1741
1742 const result_id = self.spv.allocId();
1743 try self.spv.structType(
1744 result_id,
1745 &.{ payload_ty_id, bool_ty_id },
1746 &.{ "payload", "valid" },
1747 );
1748 return result_id;
1749 },
1750 .@"union" => return try self.resolveUnionType(ty),
1751 .error_set => {
1752 const err_int_ty = try pt.errorIntType();
1753 return try self.resolveType(err_int_ty, repr);
1754 },
1755 .error_union => {
1756 const payload_ty = ty.errorUnionPayload(zcu);
1757 const error_ty_id = try self.resolveType(Type.anyerror, .indirect);
1758
1759 const eu_layout = self.errorUnionLayout(payload_ty);
1760 if (!eu_layout.payload_has_bits) {
1761 return error_ty_id;
1762 }
1763
1764 const payload_ty_id = try self.resolveType(payload_ty, .indirect);
1765
1766 var member_types: [2]Id = undefined;
1767 var member_names: [2][]const u8 = undefined;
1768 if (eu_layout.error_first) {
1769 // Put the error first
1770 member_types = .{ error_ty_id, payload_ty_id };
1771 member_names = .{ "error", "payload" };
1772 // TODO: ABI padding?
1773 } else {
1774 // Put the payload first.
1775 member_types = .{ payload_ty_id, error_ty_id };
1776 member_names = .{ "payload", "error" };
1777 // TODO: ABI padding?
1778 }
1779
1780 const result_id = self.spv.allocId();
1781 try self.spv.structType(result_id, &member_types, &member_names);
1782 return result_id;
1783 },
1784 .@"opaque" => {
1785 const type_name = try self.resolveTypeName(ty);
1786 defer self.gpa.free(type_name);
1787
1788 const result_id = self.spv.allocId();
1789 try section.emit(self.spv.gpa, .OpTypeOpaque, .{
1790 .id_result = result_id,
1791 .literal_string = type_name,
1792 });
1793 return result_id;
1794 },
1795
1796 .null,
1797 .undefined,
1798 .enum_literal,
1799 .comptime_float,
1800 .comptime_int,
1801 .type,
1802 => unreachable, // Must be comptime.
1803
1804 .frame, .@"anyframe" => unreachable, // TODO
1805 }
1806 }
1807
1808 fn spvStorageClass(self: *NavGen, as: std.builtin.AddressSpace) StorageClass {
1809 return switch (as) {
1810 .generic => if (self.spv.hasFeature(.generic_pointer)) .generic else .function,
1811 .global => switch (self.spv.target.os.tag) {
1812 .opencl, .amdhsa => .cross_workgroup,
1813 else => .storage_buffer,
1814 },
1815 .push_constant => {
1816 return .push_constant;
1817 },
1818 .output => {
1819 return .output;
1820 },
1821 .uniform => {
1822 return .uniform;
1823 },
1824 .storage_buffer => {
1825 return .storage_buffer;
1826 },
1827 .physical_storage_buffer => {
1828 return .physical_storage_buffer;
1829 },
1830 .constant => .uniform_constant,
1831 .shared => .workgroup,
1832 .local => .function,
1833 .input => .input,
1834 .gs,
1835 .fs,
1836 .ss,
1837 .param,
1838 .flash,
1839 .flash1,
1840 .flash2,
1841 .flash3,
1842 .flash4,
1843 .flash5,
1844 .cog,
1845 .lut,
1846 .hub,
1847 => unreachable,
1848 };
1849 }
1850
1851 const ErrorUnionLayout = struct {
1852 payload_has_bits: bool,
1853 error_first: bool,
1854
1855 fn errorFieldIndex(self: @This()) u32 {
1856 assert(self.payload_has_bits);
1857 return if (self.error_first) 0 else 1;
1858 }
1859
1860 fn payloadFieldIndex(self: @This()) u32 {
1861 assert(self.payload_has_bits);
1862 return if (self.error_first) 1 else 0;
1863 }
1864 };
1865
1866 fn errorUnionLayout(self: *NavGen, payload_ty: Type) ErrorUnionLayout {
1867 const pt = self.pt;
1868 const zcu = pt.zcu;
1869
1870 const error_align = Type.anyerror.abiAlignment(zcu);
1871 const payload_align = payload_ty.abiAlignment(zcu);
1872
1873 const error_first = error_align.compare(.gt, payload_align);
1874 return .{
1875 .payload_has_bits = payload_ty.hasRuntimeBitsIgnoreComptime(zcu),
1876 .error_first = error_first,
1877 };
1878 }
1879
1880 const UnionLayout = struct {
1881 /// If false, this union is represented
1882 /// by only an integer of the tag type.
1883 has_payload: bool,
1884 tag_size: u32,
1885 tag_index: u32,
1886 /// Note: This is the size of the payload type itself, NOT the size of the ENTIRE payload.
1887 /// Use `has_payload` instead!!
1888 payload_ty: Type,
1889 payload_size: u32,
1890 payload_index: u32,
1891 payload_padding_size: u32,
1892 payload_padding_index: u32,
1893 padding_size: u32,
1894 padding_index: u32,
1895 total_fields: u32,
1896 };
1897
1898 fn unionLayout(self: *NavGen, ty: Type) UnionLayout {
1899 const pt = self.pt;
1900 const zcu = pt.zcu;
1901 const ip = &zcu.intern_pool;
1902 const layout = ty.unionGetLayout(zcu);
1903 const union_obj = zcu.typeToUnion(ty).?;
1904
1905 var union_layout = UnionLayout{
1906 .has_payload = layout.payload_size != 0,
1907 .tag_size = @intCast(layout.tag_size),
1908 .tag_index = undefined,
1909 .payload_ty = undefined,
1910 .payload_size = undefined,
1911 .payload_index = undefined,
1912 .payload_padding_size = undefined,
1913 .payload_padding_index = undefined,
1914 .padding_size = @intCast(layout.padding),
1915 .padding_index = undefined,
1916 .total_fields = undefined,
1917 };
1918
1919 if (union_layout.has_payload) {
1920 const most_aligned_field = layout.most_aligned_field;
1921 const most_aligned_field_ty = Type.fromInterned(union_obj.field_types.get(ip)[most_aligned_field]);
1922 union_layout.payload_ty = most_aligned_field_ty;
1923 union_layout.payload_size = @intCast(most_aligned_field_ty.abiSize(zcu));
1924 } else {
1925 union_layout.payload_size = 0;
1926 }
1927
1928 union_layout.payload_padding_size = @intCast(layout.payload_size - union_layout.payload_size);
1929
1930 const tag_first = layout.tag_align.compare(.gte, layout.payload_align);
1931 var field_index: u32 = 0;
1932
1933 if (union_layout.tag_size != 0 and tag_first) {
1934 union_layout.tag_index = field_index;
1935 field_index += 1;
1936 }
1937
1938 if (union_layout.payload_size != 0) {
1939 union_layout.payload_index = field_index;
1940 field_index += 1;
1941 }
1942
1943 if (union_layout.payload_padding_size != 0) {
1944 union_layout.payload_padding_index = field_index;
1945 field_index += 1;
1946 }
1947
1948 if (union_layout.tag_size != 0 and !tag_first) {
1949 union_layout.tag_index = field_index;
1950 field_index += 1;
1951 }
1952
1953 if (union_layout.padding_size != 0) {
1954 union_layout.padding_index = field_index;
1955 field_index += 1;
1956 }
1957
1958 union_layout.total_fields = field_index;
1959
1960 return union_layout;
1961 }
1962
1963 /// This structure represents a "temporary" value: Something we are currently
1964 /// operating on. It typically lives no longer than the function that
1965 /// implements a particular AIR operation. These are used to easier
1966 /// implement vectorizable operations (see Vectorization and the build*
1967 /// functions), and typically are only used for vectors of primitive types.
1968 const Temporary = struct {
1969 /// The type of the temporary. This is here mainly
1970 /// for easier bookkeeping. Because we will never really
1971 /// store Temporaries, they only cause extra stack space,
1972 /// therefore no real storage is wasted.
1973 ty: Type,
1974 /// The value that this temporary holds. This is not necessarily
1975 /// a value that is actually usable, or a single value: It is virtual
1976 /// until materialize() is called, at which point is turned into
1977 /// the usual SPIR-V representation of `self.ty`.
1978 value: Temporary.Value,
1979
1980 const Value = union(enum) {
1981 singleton: Id,
1982 exploded_vector: IdRange,
1983 };
1984
1985 fn init(ty: Type, singleton: Id) Temporary {
1986 return .{ .ty = ty, .value = .{ .singleton = singleton } };
1987 }
1988
1989 fn materialize(self: Temporary, ng: *NavGen) !Id {
1990 const zcu = ng.pt.zcu;
1991 switch (self.value) {
1992 .singleton => |id| return id,
1993 .exploded_vector => |range| {
1994 assert(self.ty.isVector(zcu));
1995 assert(self.ty.vectorLen(zcu) == range.len);
1996 const constituents = try ng.gpa.alloc(Id, range.len);
1997 defer ng.gpa.free(constituents);
1998 for (constituents, 0..range.len) |*id, i| {
1999 id.* = range.at(i);
2000 }
2001 const result_ty_id = try ng.resolveType(self.ty, .direct);
2002 return ng.constructComposite(result_ty_id, constituents);
2003 },
2004 }
2005 }
2006
2007 fn vectorization(self: Temporary, ng: *NavGen) Vectorization {
2008 return Vectorization.fromType(self.ty, ng);
2009 }
2010
2011 fn pun(self: Temporary, new_ty: Type) Temporary {
2012 return .{
2013 .ty = new_ty,
2014 .value = self.value,
2015 };
2016 }
2017
2018 /// 'Explode' a temporary into separate elements. This turns a vector
2019 /// into a bag of elements.
2020 fn explode(self: Temporary, ng: *NavGen) !IdRange {
2021 const zcu = ng.pt.zcu;
2022
2023 // If the value is a scalar, then this is a no-op.
2024 if (!self.ty.isVector(zcu)) {
2025 return switch (self.value) {
2026 .singleton => |id| .{ .base = @intFromEnum(id), .len = 1 },
2027 .exploded_vector => |range| range,
2028 };
2029 }
2030
2031 const ty_id = try ng.resolveType(self.ty.scalarType(zcu), .direct);
2032 const n = self.ty.vectorLen(zcu);
2033 const results = ng.spv.allocIds(n);
2034
2035 const id = switch (self.value) {
2036 .singleton => |id| id,
2037 .exploded_vector => |range| return range,
2038 };
2039
2040 for (0..n) |i| {
2041 const indexes = [_]u32{@intCast(i)};
2042 try ng.func.body.emit(ng.spv.gpa, .OpCompositeExtract, .{
2043 .id_result_type = ty_id,
2044 .id_result = results.at(i),
2045 .composite = id,
2046 .indexes = &indexes,
2047 });
2048 }
2049
2050 return results;
2051 }
2052 };
2053
2054 /// Initialize a `Temporary` from an AIR value.
2055 fn temporary(self: *NavGen, inst: Air.Inst.Ref) !Temporary {
2056 return .{
2057 .ty = self.typeOf(inst),
2058 .value = .{ .singleton = try self.resolve(inst) },
2059 };
2060 }
2061
2062 /// This union describes how a particular operation should be vectorized.
2063 /// That depends on the operation and number of components of the inputs.
2064 const Vectorization = union(enum) {
2065 /// This is an operation between scalars.
2066 scalar,
2067 /// This operation is unrolled into separate operations.
2068 /// Inputs may still be SPIR-V vectors, for example,
2069 /// when the operation can't be vectorized in SPIR-V.
2070 /// Value is number of components.
2071 unrolled: u32,
2072
2073 /// Derive a vectorization from a particular type
2074 fn fromType(ty: Type, ng: *NavGen) Vectorization {
2075 const zcu = ng.pt.zcu;
2076 if (!ty.isVector(zcu)) return .scalar;
2077 return .{ .unrolled = ty.vectorLen(zcu) };
2078 }
2079
2080 /// Given two vectorization methods, compute a "unification": a fallback
2081 /// that works for both, according to the following rules:
2082 /// - Scalars may broadcast
2083 /// - SPIR-V vectorized operations will unroll
2084 /// - Prefer scalar > unrolled
2085 fn unify(a: Vectorization, b: Vectorization) Vectorization {
2086 if (a == .scalar and b == .scalar) return .scalar;
2087 if (a == .unrolled or b == .unrolled) {
2088 if (a == .unrolled and b == .unrolled) assert(a.components() == b.components());
2089 if (a == .unrolled) return .{ .unrolled = a.components() };
2090 return .{ .unrolled = b.components() };
2091 }
2092 unreachable;
2093 }
2094
2095 /// Query the number of components that inputs of this operation have.
2096 /// Note: for broadcasting scalars, this returns the number of elements
2097 /// that the broadcasted vector would have.
2098 fn components(self: Vectorization) u32 {
2099 return switch (self) {
2100 .scalar => 1,
2101 .unrolled => |n| n,
2102 };
2103 }
2104
2105 /// Turns `ty` into the result-type of the entire operation.
2106 /// `ty` may be a scalar or vector, it doesn't matter.
2107 fn resultType(self: Vectorization, ng: *NavGen, ty: Type) !Type {
2108 const pt = ng.pt;
2109 const scalar_ty = ty.scalarType(pt.zcu);
2110 return switch (self) {
2111 .scalar => scalar_ty,
2112 .unrolled => |n| try pt.vectorType(.{ .len = n, .child = scalar_ty.toIntern() }),
2113 };
2114 }
2115
2116 /// Before a temporary can be used, some setup may need to be one. This function implements
2117 /// this setup, and returns a new type that holds the relevant information on how to access
2118 /// elements of the input.
2119 fn prepare(self: Vectorization, ng: *NavGen, tmp: Temporary) !PreparedOperand {
2120 const pt = ng.pt;
2121 const is_vector = tmp.ty.isVector(pt.zcu);
2122 const value: PreparedOperand.Value = switch (tmp.value) {
2123 .singleton => |id| switch (self) {
2124 .scalar => blk: {
2125 assert(!is_vector);
2126 break :blk .{ .scalar = id };
2127 },
2128 .unrolled => blk: {
2129 if (is_vector) break :blk .{ .vector_exploded = try tmp.explode(ng) };
2130 break :blk .{ .scalar_broadcast = id };
2131 },
2132 },
2133 .exploded_vector => |range| switch (self) {
2134 .scalar => unreachable,
2135 .unrolled => |n| blk: {
2136 assert(range.len == n);
2137 break :blk .{ .vector_exploded = range };
2138 },
2139 },
2140 };
2141
2142 return .{
2143 .ty = tmp.ty,
2144 .value = value,
2145 };
2146 }
2147
2148 /// Finalize the results of an operation back into a temporary. `results` is
2149 /// a list of result-ids of the operation.
2150 fn finalize(self: Vectorization, ty: Type, results: IdRange) Temporary {
2151 assert(self.components() == results.len);
2152 return .{
2153 .ty = ty,
2154 .value = switch (self) {
2155 .scalar => .{ .singleton = results.at(0) },
2156 .unrolled => .{ .exploded_vector = results },
2157 },
2158 };
2159 }
2160
2161 /// This struct represents an operand that has gone through some setup, and is
2162 /// ready to be used as part of an operation.
2163 const PreparedOperand = struct {
2164 ty: Type,
2165 value: PreparedOperand.Value,
2166
2167 /// The types of value that a prepared operand can hold internally. Depends
2168 /// on the operation and input value.
2169 const Value = union(enum) {
2170 /// A single scalar value that is used by a scalar operation.
2171 scalar: Id,
2172 /// A single scalar that is broadcasted in an unrolled operation.
2173 scalar_broadcast: Id,
2174 /// A vector represented by a consecutive list of IDs that is used in an unrolled operation.
2175 vector_exploded: IdRange,
2176 };
2177
2178 /// Query the value at a particular index of the operation. Note that
2179 /// the index is *not* the component/lane, but the index of the *operation*.
2180 fn at(self: PreparedOperand, i: usize) Id {
2181 switch (self.value) {
2182 .scalar => |id| {
2183 assert(i == 0);
2184 return id;
2185 },
2186 .scalar_broadcast => |id| return id,
2187 .vector_exploded => |range| return range.at(i),
2188 }
2189 }
2190 };
2191 };
2192
2193 /// A utility function to compute the vectorization style of
2194 /// a list of values. These values may be any of the following:
2195 /// - A `Vectorization` instance
2196 /// - A Type, in which case the vectorization is computed via `Vectorization.fromType`.
2197 /// - A Temporary, in which case the vectorization is computed via `Temporary.vectorization`.
2198 fn vectorization(self: *NavGen, args: anytype) Vectorization {
2199 var v: Vectorization = undefined;
2200 assert(args.len >= 1);
2201 inline for (args, 0..) |arg, i| {
2202 const iv: Vectorization = switch (@TypeOf(arg)) {
2203 Vectorization => arg,
2204 Type => Vectorization.fromType(arg, self),
2205 Temporary => arg.vectorization(self),
2206 else => @compileError("invalid type"),
2207 };
2208 if (i == 0) {
2209 v = iv;
2210 } else {
2211 v = v.unify(iv);
2212 }
2213 }
2214 return v;
2215 }
2216
2217 /// This function builds an OpSConvert of OpUConvert depending on the
2218 /// signedness of the types.
2219 fn buildConvert(self: *NavGen, dst_ty: Type, src: Temporary) !Temporary {
2220 const zcu = self.pt.zcu;
2221
2222 const dst_ty_id = try self.resolveType(dst_ty.scalarType(zcu), .direct);
2223 const src_ty_id = try self.resolveType(src.ty.scalarType(zcu), .direct);
2224
2225 const v = self.vectorization(.{ dst_ty, src });
2226 const result_ty = try v.resultType(self, dst_ty);
2227
2228 // We can directly compare integers, because those type-IDs are cached.
2229 if (dst_ty_id == src_ty_id) {
2230 // Nothing to do, type-pun to the right value.
2231 // Note, Caller guarantees that the types fit (or caller will normalize after),
2232 // so we don't have to normalize here.
2233 // Note, dst_ty may be a scalar type even if we expect a vector, so we have to
2234 // convert to the right type here.
2235 return src.pun(result_ty);
2236 }
2237
2238 const ops = v.components();
2239 const results = self.spv.allocIds(ops);
2240
2241 const op_result_ty = dst_ty.scalarType(zcu);
2242 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2243
2244 const opcode: Opcode = blk: {
2245 if (dst_ty.scalarType(zcu).isAnyFloat()) break :blk .OpFConvert;
2246 if (dst_ty.scalarType(zcu).isSignedInt(zcu)) break :blk .OpSConvert;
2247 break :blk .OpUConvert;
2248 };
2249
2250 const op_src = try v.prepare(self, src);
2251
2252 for (0..ops) |i| {
2253 try self.func.body.emitRaw(self.spv.gpa, opcode, 3);
2254 self.func.body.writeOperand(spec.Id, op_result_ty_id);
2255 self.func.body.writeOperand(Id, results.at(i));
2256 self.func.body.writeOperand(Id, op_src.at(i));
2257 }
2258
2259 return v.finalize(result_ty, results);
2260 }
2261
2262 fn buildFma(self: *NavGen, a: Temporary, b: Temporary, c: Temporary) !Temporary {
2263 const zcu = self.pt.zcu;
2264 const target = self.spv.target;
2265
2266 const v = self.vectorization(.{ a, b, c });
2267 const ops = v.components();
2268 const results = self.spv.allocIds(ops);
2269
2270 const op_result_ty = a.ty.scalarType(zcu);
2271 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2272 const result_ty = try v.resultType(self, a.ty);
2273
2274 const op_a = try v.prepare(self, a);
2275 const op_b = try v.prepare(self, b);
2276 const op_c = try v.prepare(self, c);
2277
2278 const set = try self.importExtendedSet();
2279
2280 // TODO: Put these numbers in some definition
2281 const instruction: u32 = switch (target.os.tag) {
2282 .opencl => 26, // fma
2283 // NOTE: Vulkan's FMA instruction does *NOT* produce the right values!
2284 // its precision guarantees do NOT match zigs and it does NOT match OpenCLs!
2285 // it needs to be emulated!
2286 .vulkan, .opengl => return self.todo("implement fma operation for {s} os", .{@tagName(target.os.tag)}),
2287 else => unreachable,
2288 };
2289
2290 for (0..ops) |i| {
2291 try self.func.body.emit(self.spv.gpa, .OpExtInst, .{
2292 .id_result_type = op_result_ty_id,
2293 .id_result = results.at(i),
2294 .set = set,
2295 .instruction = .{ .inst = instruction },
2296 .id_ref_4 = &.{ op_a.at(i), op_b.at(i), op_c.at(i) },
2297 });
2298 }
2299
2300 return v.finalize(result_ty, results);
2301 }
2302
2303 fn buildSelect(self: *NavGen, condition: Temporary, lhs: Temporary, rhs: Temporary) !Temporary {
2304 const zcu = self.pt.zcu;
2305
2306 const v = self.vectorization(.{ condition, lhs, rhs });
2307 const ops = v.components();
2308 const results = self.spv.allocIds(ops);
2309
2310 const op_result_ty = lhs.ty.scalarType(zcu);
2311 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2312 const result_ty = try v.resultType(self, lhs.ty);
2313
2314 assert(condition.ty.scalarType(zcu).zigTypeTag(zcu) == .bool);
2315
2316 const cond = try v.prepare(self, condition);
2317 const object_1 = try v.prepare(self, lhs);
2318 const object_2 = try v.prepare(self, rhs);
2319
2320 for (0..ops) |i| {
2321 try self.func.body.emit(self.spv.gpa, .OpSelect, .{
2322 .id_result_type = op_result_ty_id,
2323 .id_result = results.at(i),
2324 .condition = cond.at(i),
2325 .object_1 = object_1.at(i),
2326 .object_2 = object_2.at(i),
2327 });
2328 }
2329
2330 return v.finalize(result_ty, results);
2331 }
2332
2333 const CmpPredicate = enum {
2334 l_eq,
2335 l_ne,
2336 i_ne,
2337 i_eq,
2338 s_lt,
2339 s_gt,
2340 s_le,
2341 s_ge,
2342 u_lt,
2343 u_gt,
2344 u_le,
2345 u_ge,
2346 f_oeq,
2347 f_une,
2348 f_olt,
2349 f_ole,
2350 f_ogt,
2351 f_oge,
2352 };
2353
2354 fn buildCmp(self: *NavGen, pred: CmpPredicate, lhs: Temporary, rhs: Temporary) !Temporary {
2355 const v = self.vectorization(.{ lhs, rhs });
2356 const ops = v.components();
2357 const results = self.spv.allocIds(ops);
2358
2359 const op_result_ty: Type = .bool;
2360 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2361 const result_ty = try v.resultType(self, Type.bool);
2362
2363 const op_lhs = try v.prepare(self, lhs);
2364 const op_rhs = try v.prepare(self, rhs);
2365
2366 const opcode: Opcode = switch (pred) {
2367 .l_eq => .OpLogicalEqual,
2368 .l_ne => .OpLogicalNotEqual,
2369 .i_eq => .OpIEqual,
2370 .i_ne => .OpINotEqual,
2371 .s_lt => .OpSLessThan,
2372 .s_gt => .OpSGreaterThan,
2373 .s_le => .OpSLessThanEqual,
2374 .s_ge => .OpSGreaterThanEqual,
2375 .u_lt => .OpULessThan,
2376 .u_gt => .OpUGreaterThan,
2377 .u_le => .OpULessThanEqual,
2378 .u_ge => .OpUGreaterThanEqual,
2379 .f_oeq => .OpFOrdEqual,
2380 .f_une => .OpFUnordNotEqual,
2381 .f_olt => .OpFOrdLessThan,
2382 .f_ole => .OpFOrdLessThanEqual,
2383 .f_ogt => .OpFOrdGreaterThan,
2384 .f_oge => .OpFOrdGreaterThanEqual,
2385 };
2386
2387 for (0..ops) |i| {
2388 try self.func.body.emitRaw(self.spv.gpa, opcode, 4);
2389 self.func.body.writeOperand(spec.Id, op_result_ty_id);
2390 self.func.body.writeOperand(Id, results.at(i));
2391 self.func.body.writeOperand(Id, op_lhs.at(i));
2392 self.func.body.writeOperand(Id, op_rhs.at(i));
2393 }
2394
2395 return v.finalize(result_ty, results);
2396 }
2397
2398 const UnaryOp = enum {
2399 l_not,
2400 bit_not,
2401 i_neg,
2402 f_neg,
2403 i_abs,
2404 f_abs,
2405 clz,
2406 ctz,
2407 floor,
2408 ceil,
2409 trunc,
2410 round,
2411 sqrt,
2412 sin,
2413 cos,
2414 tan,
2415 exp,
2416 exp2,
2417 log,
2418 log2,
2419 log10,
2420 };
2421
2422 fn buildUnary(self: *NavGen, op: UnaryOp, operand: Temporary) !Temporary {
2423 const zcu = self.pt.zcu;
2424 const target = self.spv.target;
2425 const v = self.vectorization(.{operand});
2426 const ops = v.components();
2427 const results = self.spv.allocIds(ops);
2428 const op_result_ty = operand.ty.scalarType(zcu);
2429 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2430 const result_ty = try v.resultType(self, operand.ty);
2431
2432 const op_operand = try v.prepare(self, operand);
2433
2434 if (switch (op) {
2435 .l_not => .OpLogicalNot,
2436 .bit_not => .OpNot,
2437 .i_neg => .OpSNegate,
2438 .f_neg => .OpFNegate,
2439 else => @as(?Opcode, null),
2440 }) |opcode| {
2441 for (0..ops) |i| {
2442 try self.func.body.emitRaw(self.spv.gpa, opcode, 3);
2443 self.func.body.writeOperand(spec.Id, op_result_ty_id);
2444 self.func.body.writeOperand(Id, results.at(i));
2445 self.func.body.writeOperand(Id, op_operand.at(i));
2446 }
2447 } else {
2448 const set = try self.importExtendedSet();
2449 const extinst: u32 = switch (target.os.tag) {
2450 .opencl => switch (op) {
2451 .i_abs => 141, // s_abs
2452 .f_abs => 23, // fabs
2453 .clz => 151, // clz
2454 .ctz => 152, // ctz
2455 .floor => 25, // floor
2456 .ceil => 12, // ceil
2457 .trunc => 66, // trunc
2458 .round => 55, // round
2459 .sqrt => 61, // sqrt
2460 .sin => 57, // sin
2461 .cos => 14, // cos
2462 .tan => 62, // tan
2463 .exp => 19, // exp
2464 .exp2 => 20, // exp2
2465 .log => 37, // log
2466 .log2 => 38, // log2
2467 .log10 => 39, // log10
2468 else => unreachable,
2469 },
2470 // Note: We'll need to check these for floating point accuracy
2471 // Vulkan does not put tight requirements on these, for correction
2472 // we might want to emulate them at some point.
2473 .vulkan, .opengl => switch (op) {
2474 .i_abs => 5, // SAbs
2475 .f_abs => 4, // FAbs
2476 .floor => 8, // Floor
2477 .ceil => 9, // Ceil
2478 .trunc => 3, // Trunc
2479 .round => 1, // Round
2480 .clz,
2481 .ctz,
2482 .sqrt,
2483 .sin,
2484 .cos,
2485 .tan,
2486 .exp,
2487 .exp2,
2488 .log,
2489 .log2,
2490 .log10,
2491 => return self.todo("implement unary operation '{s}' for {s} os", .{ @tagName(op), @tagName(target.os.tag) }),
2492 else => unreachable,
2493 },
2494 else => unreachable,
2495 };
2496
2497 for (0..ops) |i| {
2498 try self.func.body.emit(self.spv.gpa, .OpExtInst, .{
2499 .id_result_type = op_result_ty_id,
2500 .id_result = results.at(i),
2501 .set = set,
2502 .instruction = .{ .inst = extinst },
2503 .id_ref_4 = &.{op_operand.at(i)},
2504 });
2505 }
2506 }
2507
2508 return v.finalize(result_ty, results);
2509 }
2510
2511 const BinaryOp = enum {
2512 i_add,
2513 f_add,
2514 i_sub,
2515 f_sub,
2516 i_mul,
2517 f_mul,
2518 s_div,
2519 u_div,
2520 f_div,
2521 s_rem,
2522 f_rem,
2523 s_mod,
2524 u_mod,
2525 f_mod,
2526 srl,
2527 sra,
2528 sll,
2529 bit_and,
2530 bit_or,
2531 bit_xor,
2532 f_max,
2533 s_max,
2534 u_max,
2535 f_min,
2536 s_min,
2537 u_min,
2538 l_and,
2539 l_or,
2540 };
2541
2542 fn buildBinary(self: *NavGen, op: BinaryOp, lhs: Temporary, rhs: Temporary) !Temporary {
2543 const zcu = self.pt.zcu;
2544 const target = self.spv.target;
2545
2546 const v = self.vectorization(.{ lhs, rhs });
2547 const ops = v.components();
2548 const results = self.spv.allocIds(ops);
2549
2550 const op_result_ty = lhs.ty.scalarType(zcu);
2551 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2552 const result_ty = try v.resultType(self, lhs.ty);
2553
2554 const op_lhs = try v.prepare(self, lhs);
2555 const op_rhs = try v.prepare(self, rhs);
2556
2557 if (switch (op) {
2558 .i_add => .OpIAdd,
2559 .f_add => .OpFAdd,
2560 .i_sub => .OpISub,
2561 .f_sub => .OpFSub,
2562 .i_mul => .OpIMul,
2563 .f_mul => .OpFMul,
2564 .s_div => .OpSDiv,
2565 .u_div => .OpUDiv,
2566 .f_div => .OpFDiv,
2567 .s_rem => .OpSRem,
2568 .f_rem => .OpFRem,
2569 .s_mod => .OpSMod,
2570 .u_mod => .OpUMod,
2571 .f_mod => .OpFMod,
2572 .srl => .OpShiftRightLogical,
2573 .sra => .OpShiftRightArithmetic,
2574 .sll => .OpShiftLeftLogical,
2575 .bit_and => .OpBitwiseAnd,
2576 .bit_or => .OpBitwiseOr,
2577 .bit_xor => .OpBitwiseXor,
2578 .l_and => .OpLogicalAnd,
2579 .l_or => .OpLogicalOr,
2580 else => @as(?Opcode, null),
2581 }) |opcode| {
2582 for (0..ops) |i| {
2583 try self.func.body.emitRaw(self.spv.gpa, opcode, 4);
2584 self.func.body.writeOperand(spec.Id, op_result_ty_id);
2585 self.func.body.writeOperand(Id, results.at(i));
2586 self.func.body.writeOperand(Id, op_lhs.at(i));
2587 self.func.body.writeOperand(Id, op_rhs.at(i));
2588 }
2589 } else {
2590 const set = try self.importExtendedSet();
2591
2592 // TODO: Put these numbers in some definition
2593 const extinst: u32 = switch (target.os.tag) {
2594 .opencl => switch (op) {
2595 .f_max => 27, // fmax
2596 .s_max => 156, // s_max
2597 .u_max => 157, // u_max
2598 .f_min => 28, // fmin
2599 .s_min => 158, // s_min
2600 .u_min => 159, // u_min
2601 else => unreachable,
2602 },
2603 .vulkan, .opengl => switch (op) {
2604 .f_max => 40, // FMax
2605 .s_max => 42, // SMax
2606 .u_max => 41, // UMax
2607 .f_min => 37, // FMin
2608 .s_min => 39, // SMin
2609 .u_min => 38, // UMin
2610 else => unreachable,
2611 },
2612 else => unreachable,
2613 };
2614
2615 for (0..ops) |i| {
2616 try self.func.body.emit(self.spv.gpa, .OpExtInst, .{
2617 .id_result_type = op_result_ty_id,
2618 .id_result = results.at(i),
2619 .set = set,
2620 .instruction = .{ .inst = extinst },
2621 .id_ref_4 = &.{ op_lhs.at(i), op_rhs.at(i) },
2622 });
2623 }
2624 }
2625
2626 return v.finalize(result_ty, results);
2627 }
2628
2629 /// This function builds an extended multiplication, either OpSMulExtended or OpUMulExtended on Vulkan,
2630 /// or OpIMul and s_mul_hi or u_mul_hi on OpenCL.
2631 fn buildWideMul(
2632 self: *NavGen,
2633 op: enum {
2634 s_mul_extended,
2635 u_mul_extended,
2636 },
2637 lhs: Temporary,
2638 rhs: Temporary,
2639 ) !struct { Temporary, Temporary } {
2640 const pt = self.pt;
2641 const zcu = pt.zcu;
2642 const target = self.spv.target;
2643 const ip = &zcu.intern_pool;
2644
2645 const v = lhs.vectorization(self).unify(rhs.vectorization(self));
2646 const ops = v.components();
2647
2648 const arith_op_ty = lhs.ty.scalarType(zcu);
2649 const arith_op_ty_id = try self.resolveType(arith_op_ty, .direct);
2650
2651 const lhs_op = try v.prepare(self, lhs);
2652 const rhs_op = try v.prepare(self, rhs);
2653
2654 const value_results = self.spv.allocIds(ops);
2655 const overflow_results = self.spv.allocIds(ops);
2656
2657 switch (target.os.tag) {
2658 .opencl => {
2659 // Currently, SPIRV-LLVM-Translator based backends cannot deal with OpSMulExtended and
2660 // OpUMulExtended. For these we will use the OpenCL s_mul_hi to compute the high-order bits
2661 // instead.
2662 const set = try self.importExtendedSet();
2663 const overflow_inst: u32 = switch (op) {
2664 .s_mul_extended => 160, // s_mul_hi
2665 .u_mul_extended => 203, // u_mul_hi
2666 };
2667
2668 for (0..ops) |i| {
2669 try self.func.body.emit(self.spv.gpa, .OpIMul, .{
2670 .id_result_type = arith_op_ty_id,
2671 .id_result = value_results.at(i),
2672 .operand_1 = lhs_op.at(i),
2673 .operand_2 = rhs_op.at(i),
2674 });
2675
2676 try self.func.body.emit(self.spv.gpa, .OpExtInst, .{
2677 .id_result_type = arith_op_ty_id,
2678 .id_result = overflow_results.at(i),
2679 .set = set,
2680 .instruction = .{ .inst = overflow_inst },
2681 .id_ref_4 = &.{ lhs_op.at(i), rhs_op.at(i) },
2682 });
2683 }
2684 },
2685 .vulkan, .opengl => {
2686 // Operations return a struct{T, T}
2687 // where T is maybe vectorized.
2688 const op_result_ty: Type = .fromInterned(try ip.getTupleType(zcu.gpa, pt.tid, .{
2689 .types = &.{ arith_op_ty.toIntern(), arith_op_ty.toIntern() },
2690 .values = &.{ .none, .none },
2691 }));
2692 const op_result_ty_id = try self.resolveType(op_result_ty, .direct);
2693
2694 const opcode: Opcode = switch (op) {
2695 .s_mul_extended => .OpSMulExtended,
2696 .u_mul_extended => .OpUMulExtended,
2697 };
2698
2699 for (0..ops) |i| {
2700 const op_result = self.spv.allocId();
2701
2702 try self.func.body.emitRaw(self.spv.gpa, opcode, 4);
2703 self.func.body.writeOperand(spec.Id, op_result_ty_id);
2704 self.func.body.writeOperand(Id, op_result);
2705 self.func.body.writeOperand(Id, lhs_op.at(i));
2706 self.func.body.writeOperand(Id, rhs_op.at(i));
2707
2708 // The above operation returns a struct. We might want to expand
2709 // Temporary to deal with the fact that these are structs eventually,
2710 // but for now, take the struct apart and return two separate vectors.
2711
2712 try self.func.body.emit(self.spv.gpa, .OpCompositeExtract, .{
2713 .id_result_type = arith_op_ty_id,
2714 .id_result = value_results.at(i),
2715 .composite = op_result,
2716 .indexes = &.{0},
2717 });
2718
2719 try self.func.body.emit(self.spv.gpa, .OpCompositeExtract, .{
2720 .id_result_type = arith_op_ty_id,
2721 .id_result = overflow_results.at(i),
2722 .composite = op_result,
2723 .indexes = &.{1},
2724 });
2725 }
2726 },
2727 else => unreachable,
2728 }
2729
2730 const result_ty = try v.resultType(self, lhs.ty);
2731 return .{
2732 v.finalize(result_ty, value_results),
2733 v.finalize(result_ty, overflow_results),
2734 };
2735 }
2736
2737 /// The SPIR-V backend is not yet advanced enough to support the std testing infrastructure.
2738 /// In order to be able to run tests, we "temporarily" lower test kernels into separate entry-
2739 /// points. The test executor will then be able to invoke these to run the tests.
2740 /// Note that tests are lowered according to std.builtin.TestFn, which is `fn () anyerror!void`.
2741 /// (anyerror!void has the same layout as anyerror).
2742 /// Each test declaration generates a function like.
2743 /// %anyerror = OpTypeInt 0 16
2744 /// %p_invocation_globals_struct_ty = ...
2745 /// %p_anyerror = OpTypePointer CrossWorkgroup %anyerror
2746 /// %K = OpTypeFunction %void %p_invocation_globals_struct_ty %p_anyerror
2747 ///
2748 /// %test = OpFunction %void %K
2749 /// %p_invocation_globals = OpFunctionParameter p_invocation_globals_struct_ty
2750 /// %p_err = OpFunctionParameter %p_anyerror
2751 /// %lbl = OpLabel
2752 /// %result = OpFunctionCall %anyerror %func %p_invocation_globals
2753 /// OpStore %p_err %result
2754 /// OpFunctionEnd
2755 /// TODO is to also write out the error as a function call parameter, and to somehow fetch
2756 /// the name of an error in the text executor.
2757 fn generateTestEntryPoint(self: *NavGen, name: []const u8, spv_test_decl_index: SpvModule.Decl.Index) !void {
2758 const zcu = self.pt.zcu;
2759 const target = self.spv.target;
2760
2761 const anyerror_ty_id = try self.resolveType(Type.anyerror, .direct);
2762 const ptr_anyerror_ty = try self.pt.ptrType(.{
2763 .child = Type.anyerror.toIntern(),
2764 .flags = .{ .address_space = .global },
2765 });
2766 const ptr_anyerror_ty_id = try self.resolveType(ptr_anyerror_ty, .direct);
2767
2768 const spv_decl_index = try self.spv.allocDecl(.func);
2769 const kernel_id = self.spv.declPtr(spv_decl_index).result_id;
2770
2771 var decl_deps = std.ArrayList(SpvModule.Decl.Index).init(self.gpa);
2772 defer decl_deps.deinit();
2773 try decl_deps.append(spv_test_decl_index);
2774
2775 const section = &self.spv.sections.functions;
2776
2777 const p_error_id = self.spv.allocId();
2778 switch (target.os.tag) {
2779 .opencl, .amdhsa => {
2780 const kernel_proto_ty_id = try self.functionType(Type.void, &.{ptr_anyerror_ty});
2781
2782 try section.emit(self.spv.gpa, .OpFunction, .{
2783 .id_result_type = try self.resolveType(Type.void, .direct),
2784 .id_result = kernel_id,
2785 .function_control = .{},
2786 .function_type = kernel_proto_ty_id,
2787 });
2788
2789 try section.emit(self.spv.gpa, .OpFunctionParameter, .{
2790 .id_result_type = ptr_anyerror_ty_id,
2791 .id_result = p_error_id,
2792 });
2793
2794 try section.emit(self.spv.gpa, .OpLabel, .{
2795 .id_result = self.spv.allocId(),
2796 });
2797 },
2798 .vulkan, .opengl => {
2799 if (self.object.error_buffer == null) {
2800 const spv_err_decl_index = try self.spv.allocDecl(.global);
2801 try self.spv.declareDeclDeps(spv_err_decl_index, &.{});
2802
2803 const buffer_struct_ty_id = self.spv.allocId();
2804 try self.spv.structType(buffer_struct_ty_id, &.{anyerror_ty_id}, &.{"error_out"});
2805 try self.spv.decorate(buffer_struct_ty_id, .block);
2806 try self.spv.decorateMember(buffer_struct_ty_id, 0, .{ .offset = .{ .byte_offset = 0 } });
2807
2808 const ptr_buffer_struct_ty_id = self.spv.allocId();
2809 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpTypePointer, .{
2810 .id_result = ptr_buffer_struct_ty_id,
2811 .storage_class = self.spvStorageClass(.global),
2812 .type = buffer_struct_ty_id,
2813 });
2814
2815 const buffer_struct_id = self.spv.declPtr(spv_err_decl_index).result_id;
2816 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpVariable, .{
2817 .id_result_type = ptr_buffer_struct_ty_id,
2818 .id_result = buffer_struct_id,
2819 .storage_class = self.spvStorageClass(.global),
2820 });
2821 try self.spv.decorate(buffer_struct_id, .{ .descriptor_set = .{ .descriptor_set = 0 } });
2822 try self.spv.decorate(buffer_struct_id, .{ .binding = .{ .binding_point = 0 } });
2823
2824 self.object.error_buffer = spv_err_decl_index;
2825 }
2826
2827 try self.spv.sections.execution_modes.emit(self.spv.gpa, .OpExecutionMode, .{
2828 .entry_point = kernel_id,
2829 .mode = .{ .local_size = .{
2830 .x_size = 1,
2831 .y_size = 1,
2832 .z_size = 1,
2833 } },
2834 });
2835
2836 const kernel_proto_ty_id = try self.functionType(Type.void, &.{});
2837 try section.emit(self.spv.gpa, .OpFunction, .{
2838 .id_result_type = try self.resolveType(Type.void, .direct),
2839 .id_result = kernel_id,
2840 .function_control = .{},
2841 .function_type = kernel_proto_ty_id,
2842 });
2843 try section.emit(self.spv.gpa, .OpLabel, .{
2844 .id_result = self.spv.allocId(),
2845 });
2846
2847 const spv_err_decl_index = self.object.error_buffer.?;
2848 const buffer_id = self.spv.declPtr(spv_err_decl_index).result_id;
2849 try decl_deps.append(spv_err_decl_index);
2850
2851 const zero_id = try self.constInt(Type.u32, 0);
2852 try section.emit(self.spv.gpa, .OpInBoundsAccessChain, .{
2853 .id_result_type = ptr_anyerror_ty_id,
2854 .id_result = p_error_id,
2855 .base = buffer_id,
2856 .indexes = &.{zero_id},
2857 });
2858 },
2859 else => unreachable,
2860 }
2861
2862 const test_id = self.spv.declPtr(spv_test_decl_index).result_id;
2863 const error_id = self.spv.allocId();
2864 try section.emit(self.spv.gpa, .OpFunctionCall, .{
2865 .id_result_type = anyerror_ty_id,
2866 .id_result = error_id,
2867 .function = test_id,
2868 });
2869 // Note: Convert to direct not required.
2870 try section.emit(self.spv.gpa, .OpStore, .{
2871 .pointer = p_error_id,
2872 .object = error_id,
2873 .memory_access = .{
2874 .aligned = .{ .literal_integer = @intCast(Type.abiAlignment(.anyerror, zcu).toByteUnits().?) },
2875 },
2876 });
2877 try section.emit(self.spv.gpa, .OpReturn, {});
2878 try section.emit(self.spv.gpa, .OpFunctionEnd, {});
2879
2880 // Just generate a quick other name because the intel runtime crashes when the entry-
2881 // point name is the same as a different OpName.
2882 const test_name = try std.fmt.allocPrint(self.gpa, "test {s}", .{name});
2883 defer self.gpa.free(test_name);
2884
2885 const execution_mode: spec.ExecutionModel = switch (target.os.tag) {
2886 .vulkan, .opengl => .gl_compute,
2887 .opencl, .amdhsa => .kernel,
2888 else => unreachable,
2889 };
2890
2891 try self.spv.declareDeclDeps(spv_decl_index, decl_deps.items);
2892 try self.spv.declareEntryPoint(spv_decl_index, test_name, execution_mode, null);
2893 }
2894
2895 fn genNav(self: *NavGen, do_codegen: bool) !void {
2896 const pt = self.pt;
2897 const zcu = pt.zcu;
2898 const ip = &zcu.intern_pool;
2899
2900 const nav = ip.getNav(self.owner_nav);
2901 const val = zcu.navValue(self.owner_nav);
2902 const ty = val.typeOf(zcu);
2903
2904 if (!do_codegen and !ty.hasRuntimeBits(zcu)) {
2905 return;
2906 }
2907
2908 const spv_decl_index = try self.object.resolveNav(zcu, self.owner_nav);
2909 const result_id = self.spv.declPtr(spv_decl_index).result_id;
2910
2911 switch (self.spv.declPtr(spv_decl_index).kind) {
2912 .func => {
2913 const fn_info = zcu.typeToFunc(ty).?;
2914 const return_ty_id = try self.resolveFnReturnType(Type.fromInterned(fn_info.return_type));
2915
2916 const prototype_ty_id = try self.resolveType(ty, .direct);
2917 try self.func.prologue.emit(self.spv.gpa, .OpFunction, .{
2918 .id_result_type = return_ty_id,
2919 .id_result = result_id,
2920 .function_type = prototype_ty_id,
2921 // Note: the backend will never be asked to generate an inline function
2922 // (this is handled in sema), so we don't need to set function_control here.
2923 .function_control = .{},
2924 });
2925
2926 comptime assert(zig_call_abi_ver == 3);
2927 try self.args.ensureUnusedCapacity(self.gpa, fn_info.param_types.len);
2928 for (fn_info.param_types.get(ip)) |param_ty_index| {
2929 const param_ty = Type.fromInterned(param_ty_index);
2930 if (!param_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
2931
2932 const param_type_id = try self.resolveType(param_ty, .direct);
2933 const arg_result_id = self.spv.allocId();
2934 try self.func.prologue.emit(self.spv.gpa, .OpFunctionParameter, .{
2935 .id_result_type = param_type_id,
2936 .id_result = arg_result_id,
2937 });
2938 self.args.appendAssumeCapacity(arg_result_id);
2939 }
2940
2941 // TODO: This could probably be done in a better way...
2942 const root_block_id = self.spv.allocId();
2943
2944 // The root block of a function declaration should appear before OpVariable instructions,
2945 // so it is generated into the function's prologue.
2946 try self.func.prologue.emit(self.spv.gpa, .OpLabel, .{
2947 .id_result = root_block_id,
2948 });
2949 self.current_block_label = root_block_id;
2950
2951 const main_body = self.air.getMainBody();
2952 switch (self.control_flow) {
2953 .structured => {
2954 _ = try self.genStructuredBody(.selection, main_body);
2955 // We always expect paths to here to end, but we still need the block
2956 // to act as a dummy merge block.
2957 try self.func.body.emit(self.spv.gpa, .OpUnreachable, {});
2958 },
2959 .unstructured => {
2960 try self.genBody(main_body);
2961 },
2962 }
2963 try self.func.body.emit(self.spv.gpa, .OpFunctionEnd, {});
2964 // Append the actual code into the functions section.
2965 try self.spv.addFunction(spv_decl_index, self.func);
2966
2967 try self.spv.debugName(result_id, nav.fqn.toSlice(ip));
2968
2969 // Temporarily generate a test kernel declaration if this is a test function.
2970 if (self.pt.zcu.test_functions.contains(self.owner_nav)) {
2971 try self.generateTestEntryPoint(nav.fqn.toSlice(ip), spv_decl_index);
2972 }
2973 },
2974 .global => {
2975 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
2976 .func => unreachable,
2977 .variable => |variable| Value.fromInterned(variable.init),
2978 .@"extern" => null,
2979 else => val,
2980 };
2981 assert(maybe_init_val == null); // TODO
2982
2983 const storage_class = self.spvStorageClass(nav.getAddrspace());
2984 assert(storage_class != .generic); // These should be instance globals
2985
2986 const ptr_ty_id = try self.ptrType(ty, storage_class, .indirect);
2987
2988 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpVariable, .{
2989 .id_result_type = ptr_ty_id,
2990 .id_result = result_id,
2991 .storage_class = storage_class,
2992 });
2993
2994 if (std.meta.stringToEnum(spec.BuiltIn, nav.fqn.toSlice(ip))) |builtin| {
2995 try self.spv.decorate(result_id, .{ .built_in = .{ .built_in = builtin } });
2996 }
2997
2998 try self.spv.debugName(result_id, nav.fqn.toSlice(ip));
2999 try self.spv.declareDeclDeps(spv_decl_index, &.{});
3000 },
3001 .invocation_global => {
3002 const maybe_init_val: ?Value = switch (ip.indexToKey(val.toIntern())) {
3003 .func => unreachable,
3004 .variable => |variable| Value.fromInterned(variable.init),
3005 .@"extern" => null,
3006 else => val,
3007 };
3008
3009 try self.spv.declareDeclDeps(spv_decl_index, &.{});
3010
3011 const ptr_ty_id = try self.ptrType(ty, .function, .indirect);
3012
3013 if (maybe_init_val) |init_val| {
3014 // TODO: Combine with resolveAnonDecl?
3015 const initializer_proto_ty_id = try self.functionType(Type.void, &.{});
3016
3017 const initializer_id = self.spv.allocId();
3018 try self.func.prologue.emit(self.spv.gpa, .OpFunction, .{
3019 .id_result_type = try self.resolveType(Type.void, .direct),
3020 .id_result = initializer_id,
3021 .function_control = .{},
3022 .function_type = initializer_proto_ty_id,
3023 });
3024
3025 const root_block_id = self.spv.allocId();
3026 try self.func.prologue.emit(self.spv.gpa, .OpLabel, .{
3027 .id_result = root_block_id,
3028 });
3029 self.current_block_label = root_block_id;
3030
3031 const val_id = try self.constant(ty, init_val, .indirect);
3032 try self.func.body.emit(self.spv.gpa, .OpStore, .{
3033 .pointer = result_id,
3034 .object = val_id,
3035 });
3036
3037 try self.func.body.emit(self.spv.gpa, .OpReturn, {});
3038 try self.func.body.emit(self.spv.gpa, .OpFunctionEnd, {});
3039 try self.spv.addFunction(spv_decl_index, self.func);
3040
3041 try self.spv.debugNameFmt(initializer_id, "initializer of {f}", .{nav.fqn.fmt(ip)});
3042
3043 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpExtInst, .{
3044 .id_result_type = ptr_ty_id,
3045 .id_result = result_id,
3046 .set = try self.spv.importInstructionSet(.zig),
3047 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
3048 .id_ref_4 = &.{initializer_id},
3049 });
3050 } else {
3051 try self.spv.sections.types_globals_constants.emit(self.spv.gpa, .OpExtInst, .{
3052 .id_result_type = ptr_ty_id,
3053 .id_result = result_id,
3054 .set = try self.spv.importInstructionSet(.zig),
3055 .instruction = .{ .inst = 0 }, // TODO: Put this definition somewhere...
3056 .id_ref_4 = &.{},
3057 });
3058 }
3059 },
3060 }
3061 }
3062
3063 fn intFromBool(self: *NavGen, value: Temporary) !Temporary {
3064 return try self.intFromBool2(value, Type.u1);
3065 }
3066
3067 fn intFromBool2(self: *NavGen, value: Temporary, result_ty: Type) !Temporary {
3068 const zero_id = try self.constInt(result_ty, 0);
3069 const one_id = try self.constInt(result_ty, 1);
3070
3071 return try self.buildSelect(
3072 value,
3073 Temporary.init(result_ty, one_id),
3074 Temporary.init(result_ty, zero_id),
3075 );
3076 }
3077
3078 /// Convert representation from indirect (in memory) to direct (in 'register')
3079 /// This converts the argument type from resolveType(ty, .indirect) to resolveType(ty, .direct).
3080 fn convertToDirect(self: *NavGen, ty: Type, operand_id: Id) !Id {
3081 const pt = self.pt;
3082 const zcu = pt.zcu;
3083 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
3084 .bool => {
3085 const false_id = try self.constBool(false, .indirect);
3086 const operand_ty = blk: {
3087 if (!ty.isVector(pt.zcu)) break :blk Type.u1;
3088 break :blk try pt.vectorType(.{
3089 .len = ty.vectorLen(pt.zcu),
3090 .child = Type.u1.toIntern(),
3091 });
3092 };
3093
3094 const result = try self.buildCmp(
3095 .i_ne,
3096 Temporary.init(operand_ty, operand_id),
3097 Temporary.init(Type.u1, false_id),
3098 );
3099 return try result.materialize(self);
3100 },
3101 else => return operand_id,
3102 }
3103 }
3104
3105 /// Convert representation from direct (in 'register) to direct (in memory)
3106 /// This converts the argument type from resolveType(ty, .direct) to resolveType(ty, .indirect).
3107 fn convertToIndirect(self: *NavGen, ty: Type, operand_id: Id) !Id {
3108 const zcu = self.pt.zcu;
3109 switch (ty.scalarType(zcu).zigTypeTag(zcu)) {
3110 .bool => {
3111 const result = try self.intFromBool(Temporary.init(ty, operand_id));
3112 return try result.materialize(self);
3113 },
3114 else => return operand_id,
3115 }
3116 }
3117
3118 fn extractField(self: *NavGen, result_ty: Type, object: Id, field: u32) !Id {
3119 const result_ty_id = try self.resolveType(result_ty, .indirect);
3120 const result_id = self.spv.allocId();
3121 const indexes = [_]u32{field};
3122 try self.func.body.emit(self.spv.gpa, .OpCompositeExtract, .{
3123 .id_result_type = result_ty_id,
3124 .id_result = result_id,
3125 .composite = object,
3126 .indexes = &indexes,
3127 });
3128 // Convert bools; direct structs have their field types as indirect values.
3129 return try self.convertToDirect(result_ty, result_id);
3130 }
3131
3132 fn extractVectorComponent(self: *NavGen, result_ty: Type, vector_id: Id, field: u32) !Id {
3133 const result_ty_id = try self.resolveType(result_ty, .direct);
3134 const result_id = self.spv.allocId();
3135 const indexes = [_]u32{field};
3136 try self.func.body.emit(self.spv.gpa, .OpCompositeExtract, .{
3137 .id_result_type = result_ty_id,
3138 .id_result = result_id,
3139 .composite = vector_id,
3140 .indexes = &indexes,
3141 });
3142 // Vector components are already stored in direct representation.
3143 return result_id;
3144 }
3145
3146 const MemoryOptions = struct {
3147 is_volatile: bool = false,
3148 };
3149
3150 fn load(self: *NavGen, value_ty: Type, ptr_id: Id, options: MemoryOptions) !Id {
3151 const zcu = self.pt.zcu;
3152 const alignment: u32 = @intCast(value_ty.abiAlignment(zcu).toByteUnits().?);
3153 const indirect_value_ty_id = try self.resolveType(value_ty, .indirect);
3154 const result_id = self.spv.allocId();
3155 const access: spec.MemoryAccess.Extended = .{
3156 .@"volatile" = options.is_volatile,
3157 .aligned = .{ .literal_integer = alignment },
3158 };
3159 try self.func.body.emit(self.spv.gpa, .OpLoad, .{
3160 .id_result_type = indirect_value_ty_id,
3161 .id_result = result_id,
3162 .pointer = ptr_id,
3163 .memory_access = access,
3164 });
3165 return try self.convertToDirect(value_ty, result_id);
3166 }
3167
3168 fn store(self: *NavGen, value_ty: Type, ptr_id: Id, value_id: Id, options: MemoryOptions) !void {
3169 const indirect_value_id = try self.convertToIndirect(value_ty, value_id);
3170 const access: spec.MemoryAccess.Extended = .{ .@"volatile" = options.is_volatile };
3171 try self.func.body.emit(self.spv.gpa, .OpStore, .{
3172 .pointer = ptr_id,
3173 .object = indirect_value_id,
3174 .memory_access = access,
3175 });
3176 }
3177
3178 fn genBody(self: *NavGen, body: []const Air.Inst.Index) Error!void {
3179 for (body) |inst| {
3180 try self.genInst(inst);
3181 }
3182 }
3183
3184 fn genInst(self: *NavGen, inst: Air.Inst.Index) !void {
3185 const zcu = self.pt.zcu;
3186 const ip = &zcu.intern_pool;
3187 if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip))
3188 return;
3189
3190 const air_tags = self.air.instructions.items(.tag);
3191 const maybe_result_id: ?Id = switch (air_tags[@intFromEnum(inst)]) {
3192 // zig fmt: off
3193 .add, .add_wrap, .add_optimized => try self.airArithOp(inst, .f_add, .i_add, .i_add),
3194 .sub, .sub_wrap, .sub_optimized => try self.airArithOp(inst, .f_sub, .i_sub, .i_sub),
3195 .mul, .mul_wrap, .mul_optimized => try self.airArithOp(inst, .f_mul, .i_mul, .i_mul),
3196
3197 .sqrt => try self.airUnOpSimple(inst, .sqrt),
3198 .sin => try self.airUnOpSimple(inst, .sin),
3199 .cos => try self.airUnOpSimple(inst, .cos),
3200 .tan => try self.airUnOpSimple(inst, .tan),
3201 .exp => try self.airUnOpSimple(inst, .exp),
3202 .exp2 => try self.airUnOpSimple(inst, .exp2),
3203 .log => try self.airUnOpSimple(inst, .log),
3204 .log2 => try self.airUnOpSimple(inst, .log2),
3205 .log10 => try self.airUnOpSimple(inst, .log10),
3206 .abs => try self.airAbs(inst),
3207 .floor => try self.airUnOpSimple(inst, .floor),
3208 .ceil => try self.airUnOpSimple(inst, .ceil),
3209 .round => try self.airUnOpSimple(inst, .round),
3210 .trunc_float => try self.airUnOpSimple(inst, .trunc),
3211 .neg, .neg_optimized => try self.airUnOpSimple(inst, .f_neg),
3212
3213 .div_float, .div_float_optimized => try self.airArithOp(inst, .f_div, .s_div, .u_div),
3214 .div_floor, .div_floor_optimized => try self.airDivFloor(inst),
3215 .div_trunc, .div_trunc_optimized => try self.airDivTrunc(inst),
3216
3217 .rem, .rem_optimized => try self.airArithOp(inst, .f_rem, .s_rem, .u_mod),
3218 .mod, .mod_optimized => try self.airArithOp(inst, .f_mod, .s_mod, .u_mod),
3219
3220 .add_with_overflow => try self.airAddSubOverflow(inst, .i_add, .u_lt, .s_lt),
3221 .sub_with_overflow => try self.airAddSubOverflow(inst, .i_sub, .u_gt, .s_gt),
3222 .mul_with_overflow => try self.airMulOverflow(inst),
3223 .shl_with_overflow => try self.airShlOverflow(inst),
3224
3225 .mul_add => try self.airMulAdd(inst),
3226
3227 .ctz => try self.airClzCtz(inst, .ctz),
3228 .clz => try self.airClzCtz(inst, .clz),
3229
3230 .select => try self.airSelect(inst),
3231
3232 .splat => try self.airSplat(inst),
3233 .reduce, .reduce_optimized => try self.airReduce(inst),
3234 .shuffle_one => try self.airShuffleOne(inst),
3235 .shuffle_two => try self.airShuffleTwo(inst),
3236
3237 .ptr_add => try self.airPtrAdd(inst),
3238 .ptr_sub => try self.airPtrSub(inst),
3239
3240 .bit_and => try self.airBinOpSimple(inst, .bit_and),
3241 .bit_or => try self.airBinOpSimple(inst, .bit_or),
3242 .xor => try self.airBinOpSimple(inst, .bit_xor),
3243 .bool_and => try self.airBinOpSimple(inst, .l_and),
3244 .bool_or => try self.airBinOpSimple(inst, .l_or),
3245
3246 .shl, .shl_exact => try self.airShift(inst, .sll, .sll),
3247 .shr, .shr_exact => try self.airShift(inst, .srl, .sra),
3248
3249 .min => try self.airMinMax(inst, .min),
3250 .max => try self.airMinMax(inst, .max),
3251
3252 .bitcast => try self.airBitCast(inst),
3253 .intcast, .trunc => try self.airIntCast(inst),
3254 .float_from_int => try self.airFloatFromInt(inst),
3255 .int_from_float => try self.airIntFromFloat(inst),
3256 .fpext, .fptrunc => try self.airFloatCast(inst),
3257 .not => try self.airNot(inst),
3258
3259 .array_to_slice => try self.airArrayToSlice(inst),
3260 .slice => try self.airSlice(inst),
3261 .aggregate_init => try self.airAggregateInit(inst),
3262 .memcpy => return self.airMemcpy(inst),
3263 .memmove => return self.airMemmove(inst),
3264
3265 .slice_ptr => try self.airSliceField(inst, 0),
3266 .slice_len => try self.airSliceField(inst, 1),
3267 .slice_elem_ptr => try self.airSliceElemPtr(inst),
3268 .slice_elem_val => try self.airSliceElemVal(inst),
3269 .ptr_elem_ptr => try self.airPtrElemPtr(inst),
3270 .ptr_elem_val => try self.airPtrElemVal(inst),
3271 .array_elem_val => try self.airArrayElemVal(inst),
3272
3273 .vector_store_elem => return self.airVectorStoreElem(inst),
3274
3275 .set_union_tag => return self.airSetUnionTag(inst),
3276 .get_union_tag => try self.airGetUnionTag(inst),
3277 .union_init => try self.airUnionInit(inst),
3278
3279 .struct_field_val => try self.airStructFieldVal(inst),
3280 .field_parent_ptr => try self.airFieldParentPtr(inst),
3281
3282 .struct_field_ptr_index_0 => try self.airStructFieldPtrIndex(inst, 0),
3283 .struct_field_ptr_index_1 => try self.airStructFieldPtrIndex(inst, 1),
3284 .struct_field_ptr_index_2 => try self.airStructFieldPtrIndex(inst, 2),
3285 .struct_field_ptr_index_3 => try self.airStructFieldPtrIndex(inst, 3),
3286
3287 .cmp_eq => try self.airCmp(inst, .eq),
3288 .cmp_neq => try self.airCmp(inst, .neq),
3289 .cmp_gt => try self.airCmp(inst, .gt),
3290 .cmp_gte => try self.airCmp(inst, .gte),
3291 .cmp_lt => try self.airCmp(inst, .lt),
3292 .cmp_lte => try self.airCmp(inst, .lte),
3293 .cmp_vector => try self.airVectorCmp(inst),
3294
3295 .arg => self.airArg(),
3296 .alloc => try self.airAlloc(inst),
3297 // TODO: We probably need to have a special implementation of this for the C abi.
3298 .ret_ptr => try self.airAlloc(inst),
3299 .block => try self.airBlock(inst),
3300
3301 .load => try self.airLoad(inst),
3302 .store, .store_safe => return self.airStore(inst),
3303
3304 .br => return self.airBr(inst),
3305 // For now just ignore this instruction. This effectively falls back on the old implementation,
3306 // this doesn't change anything for us.
3307 .repeat => return,
3308 .breakpoint => return,
3309 .cond_br => return self.airCondBr(inst),
3310 .loop => return self.airLoop(inst),
3311 .ret => return self.airRet(inst),
3312 .ret_safe => return self.airRet(inst), // TODO
3313 .ret_load => return self.airRetLoad(inst),
3314 .@"try" => try self.airTry(inst),
3315 .switch_br => return self.airSwitchBr(inst),
3316 .unreach, .trap => return self.airUnreach(),
3317
3318 .dbg_empty_stmt => return,
3319 .dbg_stmt => return self.airDbgStmt(inst),
3320 .dbg_inline_block => try self.airDbgInlineBlock(inst),
3321 .dbg_var_ptr, .dbg_var_val, .dbg_arg_inline => return self.airDbgVar(inst),
3322
3323 .unwrap_errunion_err => try self.airErrUnionErr(inst),
3324 .unwrap_errunion_payload => try self.airErrUnionPayload(inst),
3325 .wrap_errunion_err => try self.airWrapErrUnionErr(inst),
3326 .wrap_errunion_payload => try self.airWrapErrUnionPayload(inst),
3327
3328 .is_null => try self.airIsNull(inst, false, .is_null),
3329 .is_non_null => try self.airIsNull(inst, false, .is_non_null),
3330 .is_null_ptr => try self.airIsNull(inst, true, .is_null),
3331 .is_non_null_ptr => try self.airIsNull(inst, true, .is_non_null),
3332 .is_err => try self.airIsErr(inst, .is_err),
3333 .is_non_err => try self.airIsErr(inst, .is_non_err),
3334
3335 .optional_payload => try self.airUnwrapOptional(inst),
3336 .optional_payload_ptr => try self.airUnwrapOptionalPtr(inst),
3337 .wrap_optional => try self.airWrapOptional(inst),
3338
3339 .assembly => try self.airAssembly(inst),
3340
3341 .call => try self.airCall(inst, .auto),
3342 .call_always_tail => try self.airCall(inst, .always_tail),
3343 .call_never_tail => try self.airCall(inst, .never_tail),
3344 .call_never_inline => try self.airCall(inst, .never_inline),
3345
3346 .work_item_id => try self.airWorkItemId(inst),
3347 .work_group_size => try self.airWorkGroupSize(inst),
3348 .work_group_id => try self.airWorkGroupId(inst),
3349
3350 // zig fmt: on
3351
3352 else => |tag| return self.todo("implement AIR tag {s}", .{@tagName(tag)}),
3353 };
3354
3355 const result_id = maybe_result_id orelse return;
3356 try self.inst_results.putNoClobber(self.gpa, inst, result_id);
3357 }
3358
3359 fn airBinOpSimple(self: *NavGen, inst: Air.Inst.Index, op: BinaryOp) !?Id {
3360 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3361 const lhs = try self.temporary(bin_op.lhs);
3362 const rhs = try self.temporary(bin_op.rhs);
3363
3364 const result = try self.buildBinary(op, lhs, rhs);
3365 return try result.materialize(self);
3366 }
3367
3368 fn airShift(self: *NavGen, inst: Air.Inst.Index, unsigned: BinaryOp, signed: BinaryOp) !?Id {
3369 const zcu = self.pt.zcu;
3370 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3371
3372 if (self.typeOf(bin_op.lhs).isVector(zcu) and !self.typeOf(bin_op.rhs).isVector(zcu)) {
3373 return self.fail("vector shift with scalar rhs", .{});
3374 }
3375
3376 const base = try self.temporary(bin_op.lhs);
3377 const shift = try self.temporary(bin_op.rhs);
3378
3379 const result_ty = self.typeOfIndex(inst);
3380
3381 const info = self.arithmeticTypeInfo(result_ty);
3382 switch (info.class) {
3383 .composite_integer => return self.todo("shift ops for composite integers", .{}),
3384 .integer, .strange_integer => {},
3385 .float, .bool => unreachable,
3386 }
3387
3388 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3389 // so just manually upcast it if required.
3390
3391 // Note: The sign may differ here between the shift and the base type, in case
3392 // of an arithmetic right shift. SPIR-V still expects the same type,
3393 // so in that case we have to cast convert to signed.
3394 const casted_shift = try self.buildConvert(base.ty.scalarType(zcu), shift);
3395
3396 const shifted = switch (info.signedness) {
3397 .unsigned => try self.buildBinary(unsigned, base, casted_shift),
3398 .signed => try self.buildBinary(signed, base, casted_shift),
3399 };
3400
3401 const result = try self.normalize(shifted, info);
3402 return try result.materialize(self);
3403 }
3404
3405 const MinMax = enum { min, max };
3406
3407 fn airMinMax(self: *NavGen, inst: Air.Inst.Index, op: MinMax) !?Id {
3408 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3409
3410 const lhs = try self.temporary(bin_op.lhs);
3411 const rhs = try self.temporary(bin_op.rhs);
3412
3413 const result = try self.minMax(lhs, rhs, op);
3414 return try result.materialize(self);
3415 }
3416
3417 fn minMax(self: *NavGen, lhs: Temporary, rhs: Temporary, op: MinMax) !Temporary {
3418 const info = self.arithmeticTypeInfo(lhs.ty);
3419
3420 const binop: BinaryOp = switch (info.class) {
3421 .float => switch (op) {
3422 .min => .f_min,
3423 .max => .f_max,
3424 },
3425 .integer, .strange_integer => switch (info.signedness) {
3426 .signed => switch (op) {
3427 .min => .s_min,
3428 .max => .s_max,
3429 },
3430 .unsigned => switch (op) {
3431 .min => .u_min,
3432 .max => .u_max,
3433 },
3434 },
3435 .composite_integer => unreachable, // TODO
3436 .bool => unreachable,
3437 };
3438
3439 return try self.buildBinary(binop, lhs, rhs);
3440 }
3441
3442 /// This function normalizes values to a canonical representation
3443 /// after some arithmetic operation. This mostly consists of wrapping
3444 /// behavior for strange integers:
3445 /// - Unsigned integers are bitwise masked with a mask that only passes
3446 /// the valid bits through.
3447 /// - Signed integers are also sign extended if they are negative.
3448 /// All other values are returned unmodified (this makes strange integer
3449 /// wrapping easier to use in generic operations).
3450 fn normalize(self: *NavGen, value: Temporary, info: ArithmeticTypeInfo) !Temporary {
3451 const zcu = self.pt.zcu;
3452 const ty = value.ty;
3453 switch (info.class) {
3454 .composite_integer, .integer, .bool, .float => return value,
3455 .strange_integer => switch (info.signedness) {
3456 .unsigned => {
3457 const mask_value = if (info.bits == 64) 0xFFFF_FFFF_FFFF_FFFF else (@as(u64, 1) << @as(u6, @intCast(info.bits))) - 1;
3458 const mask_id = try self.constInt(ty.scalarType(zcu), mask_value);
3459 return try self.buildBinary(.bit_and, value, Temporary.init(ty.scalarType(zcu), mask_id));
3460 },
3461 .signed => {
3462 // Shift left and right so that we can copy the sight bit that way.
3463 const shift_amt_id = try self.constInt(ty.scalarType(zcu), info.backing_bits - info.bits);
3464 const shift_amt = Temporary.init(ty.scalarType(zcu), shift_amt_id);
3465 const left = try self.buildBinary(.sll, value, shift_amt);
3466 return try self.buildBinary(.sra, left, shift_amt);
3467 },
3468 },
3469 }
3470 }
3471
3472 fn airDivFloor(self: *NavGen, inst: Air.Inst.Index) !?Id {
3473 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3474
3475 const lhs = try self.temporary(bin_op.lhs);
3476 const rhs = try self.temporary(bin_op.rhs);
3477
3478 const info = self.arithmeticTypeInfo(lhs.ty);
3479 switch (info.class) {
3480 .composite_integer => unreachable, // TODO
3481 .integer, .strange_integer => {
3482 switch (info.signedness) {
3483 .unsigned => {
3484 const result = try self.buildBinary(.u_div, lhs, rhs);
3485 return try result.materialize(self);
3486 },
3487 .signed => {},
3488 }
3489
3490 // For signed integers:
3491 // (a / b) - (a % b != 0 && a < 0 != b < 0);
3492 // There shouldn't be any overflow issues.
3493
3494 const div = try self.buildBinary(.s_div, lhs, rhs);
3495 const rem = try self.buildBinary(.s_rem, lhs, rhs);
3496
3497 const zero = Temporary.init(lhs.ty, try self.constInt(lhs.ty, 0));
3498
3499 const rem_is_not_zero = try self.buildCmp(.i_ne, rem, zero);
3500
3501 const result_negative = try self.buildCmp(
3502 .l_ne,
3503 try self.buildCmp(.s_lt, lhs, zero),
3504 try self.buildCmp(.s_lt, rhs, zero),
3505 );
3506 const rem_is_not_zero_and_result_is_negative = try self.buildBinary(
3507 .l_and,
3508 rem_is_not_zero,
3509 result_negative,
3510 );
3511
3512 const result = try self.buildBinary(
3513 .i_sub,
3514 div,
3515 try self.intFromBool2(rem_is_not_zero_and_result_is_negative, div.ty),
3516 );
3517
3518 return try result.materialize(self);
3519 },
3520 .float => {
3521 const div = try self.buildBinary(.f_div, lhs, rhs);
3522 const result = try self.buildUnary(.floor, div);
3523 return try result.materialize(self);
3524 },
3525 .bool => unreachable,
3526 }
3527 }
3528
3529 fn airDivTrunc(self: *NavGen, inst: Air.Inst.Index) !?Id {
3530 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3531
3532 const lhs = try self.temporary(bin_op.lhs);
3533 const rhs = try self.temporary(bin_op.rhs);
3534
3535 const info = self.arithmeticTypeInfo(lhs.ty);
3536 switch (info.class) {
3537 .composite_integer => unreachable, // TODO
3538 .integer, .strange_integer => switch (info.signedness) {
3539 .unsigned => {
3540 const result = try self.buildBinary(.u_div, lhs, rhs);
3541 return try result.materialize(self);
3542 },
3543 .signed => {
3544 const result = try self.buildBinary(.s_div, lhs, rhs);
3545 return try result.materialize(self);
3546 },
3547 },
3548 .float => {
3549 const div = try self.buildBinary(.f_div, lhs, rhs);
3550 const result = try self.buildUnary(.trunc, div);
3551 return try result.materialize(self);
3552 },
3553 .bool => unreachable,
3554 }
3555 }
3556
3557 fn airUnOpSimple(self: *NavGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3558 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
3559 const operand = try self.temporary(un_op);
3560 const result = try self.buildUnary(op, operand);
3561 return try result.materialize(self);
3562 }
3563
3564 fn airArithOp(
3565 self: *NavGen,
3566 inst: Air.Inst.Index,
3567 comptime fop: BinaryOp,
3568 comptime sop: BinaryOp,
3569 comptime uop: BinaryOp,
3570 ) !?Id {
3571 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
3572
3573 const lhs = try self.temporary(bin_op.lhs);
3574 const rhs = try self.temporary(bin_op.rhs);
3575
3576 const info = self.arithmeticTypeInfo(lhs.ty);
3577
3578 const result = switch (info.class) {
3579 .composite_integer => unreachable, // TODO
3580 .integer, .strange_integer => switch (info.signedness) {
3581 .signed => try self.buildBinary(sop, lhs, rhs),
3582 .unsigned => try self.buildBinary(uop, lhs, rhs),
3583 },
3584 .float => try self.buildBinary(fop, lhs, rhs),
3585 .bool => unreachable,
3586 };
3587
3588 return try result.materialize(self);
3589 }
3590
3591 fn airAbs(self: *NavGen, inst: Air.Inst.Index) !?Id {
3592 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3593 const operand = try self.temporary(ty_op.operand);
3594 // Note: operand_ty may be signed, while ty is always unsigned!
3595 const result_ty = self.typeOfIndex(inst);
3596 const result = try self.abs(result_ty, operand);
3597 return try result.materialize(self);
3598 }
3599
3600 fn abs(self: *NavGen, result_ty: Type, value: Temporary) !Temporary {
3601 const zcu = self.pt.zcu;
3602 const operand_info = self.arithmeticTypeInfo(value.ty);
3603
3604 switch (operand_info.class) {
3605 .float => return try self.buildUnary(.f_abs, value),
3606 .integer, .strange_integer => {
3607 const abs_value = try self.buildUnary(.i_abs, value);
3608
3609 switch (self.spv.target.os.tag) {
3610 .vulkan, .opengl => {
3611 if (value.ty.intInfo(zcu).signedness == .signed) {
3612 return self.todo("perform bitcast after @abs", .{});
3613 }
3614 },
3615 else => {},
3616 }
3617
3618 return try self.normalize(abs_value, self.arithmeticTypeInfo(result_ty));
3619 },
3620 .composite_integer => unreachable, // TODO
3621 .bool => unreachable,
3622 }
3623 }
3624
3625 fn airAddSubOverflow(
3626 self: *NavGen,
3627 inst: Air.Inst.Index,
3628 comptime add: BinaryOp,
3629 comptime ucmp: CmpPredicate,
3630 comptime scmp: CmpPredicate,
3631 ) !?Id {
3632 _ = scmp;
3633 // Note: OpIAddCarry and OpISubBorrow are not really useful here: For unsigned numbers,
3634 // there is in both cases only one extra operation required. For signed operations,
3635 // the overflow bit is set then going from 0x80.. to 0x00.., but this doesn't actually
3636 // normally set a carry bit. So the SPIR-V overflow operations are not particularly
3637 // useful here.
3638
3639 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3640 const extra = self.air.extraData(Air.Bin, ty_pl.payload).data;
3641
3642 const lhs = try self.temporary(extra.lhs);
3643 const rhs = try self.temporary(extra.rhs);
3644
3645 const result_ty = self.typeOfIndex(inst);
3646
3647 const info = self.arithmeticTypeInfo(lhs.ty);
3648 switch (info.class) {
3649 .composite_integer => unreachable, // TODO
3650 .strange_integer, .integer => {},
3651 .float, .bool => unreachable,
3652 }
3653
3654 const sum = try self.buildBinary(add, lhs, rhs);
3655 const result = try self.normalize(sum, info);
3656
3657 const overflowed = switch (info.signedness) {
3658 // Overflow happened if the result is smaller than either of the operands. It doesn't matter which.
3659 // For subtraction the conditions need to be swapped.
3660 .unsigned => try self.buildCmp(ucmp, result, lhs),
3661 // For signed operations, we check the signs of the operands and the result.
3662 .signed => blk: {
3663 // Signed overflow detection using the sign bits of the operands and the result.
3664 // For addition (a + b), overflow occurs if the operands have the same sign
3665 // and the result's sign is different from the operands' sign.
3666 // (sign(a) == sign(b)) && (sign(a) != sign(result))
3667 // For subtraction (a - b), overflow occurs if the operands have different signs
3668 // and the result's sign is different from the minuend's (a's) sign.
3669 // (sign(a) != sign(b)) && (sign(a) != sign(result))
3670 const zero = Temporary.init(rhs.ty, try self.constInt(rhs.ty, 0));
3671
3672 const lhs_is_neg = try self.buildCmp(.s_lt, lhs, zero);
3673 const rhs_is_neg = try self.buildCmp(.s_lt, rhs, zero);
3674 const result_is_neg = try self.buildCmp(.s_lt, result, zero);
3675
3676 const signs_match = try self.buildCmp(.l_eq, lhs_is_neg, rhs_is_neg);
3677 const result_sign_differs = try self.buildCmp(.l_ne, lhs_is_neg, result_is_neg);
3678
3679 const overflow_condition = if (add == .i_add)
3680 signs_match
3681 else // .i_sub
3682 try self.buildUnary(.l_not, signs_match);
3683
3684 break :blk try self.buildBinary(.l_and, overflow_condition, result_sign_differs);
3685 },
3686 };
3687
3688 const ov = try self.intFromBool(overflowed);
3689
3690 const result_ty_id = try self.resolveType(result_ty, .direct);
3691 return try self.constructComposite(result_ty_id, &.{ try result.materialize(self), try ov.materialize(self) });
3692 }
3693
3694 fn airMulOverflow(self: *NavGen, inst: Air.Inst.Index) !?Id {
3695 const pt = self.pt;
3696
3697 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3698 const extra = self.air.extraData(Air.Bin, ty_pl.payload).data;
3699
3700 const lhs = try self.temporary(extra.lhs);
3701 const rhs = try self.temporary(extra.rhs);
3702
3703 const result_ty = self.typeOfIndex(inst);
3704
3705 const info = self.arithmeticTypeInfo(lhs.ty);
3706 switch (info.class) {
3707 .composite_integer => unreachable, // TODO
3708 .strange_integer, .integer => {},
3709 .float, .bool => unreachable,
3710 }
3711
3712 // There are 3 cases which we have to deal with:
3713 // - If info.bits < 32 / 2, we will upcast to 32 and check the higher bits
3714 // - If info.bits > 32 / 2, we have to use extended multiplication
3715 // - Additionally, if info.bits != 32, we'll have to check the high bits
3716 // of the result too.
3717
3718 const largest_int_bits = self.largestSupportedIntBits();
3719 // If non-null, the number of bits that the multiplication should be performed in. If
3720 // null, we have to use wide multiplication.
3721 const maybe_op_ty_bits: ?u16 = switch (info.bits) {
3722 0 => unreachable,
3723 1...16 => 32,
3724 17...32 => if (largest_int_bits > 32) 64 else null, // Upcast if we can.
3725 33...64 => null, // Always use wide multiplication.
3726 else => unreachable, // TODO: Composite integers
3727 };
3728
3729 const result, const overflowed = switch (info.signedness) {
3730 .unsigned => blk: {
3731 if (maybe_op_ty_bits) |op_ty_bits| {
3732 const op_ty = try pt.intType(.unsigned, op_ty_bits);
3733 const casted_lhs = try self.buildConvert(op_ty, lhs);
3734 const casted_rhs = try self.buildConvert(op_ty, rhs);
3735
3736 const full_result = try self.buildBinary(.i_mul, casted_lhs, casted_rhs);
3737
3738 const low_bits = try self.buildConvert(lhs.ty, full_result);
3739 const result = try self.normalize(low_bits, info);
3740
3741 // Shift the result bits away to get the overflow bits.
3742 const shift = Temporary.init(full_result.ty, try self.constInt(full_result.ty, info.bits));
3743 const overflow = try self.buildBinary(.srl, full_result, shift);
3744
3745 // Directly check if its zero in the op_ty without converting first.
3746 const zero = Temporary.init(full_result.ty, try self.constInt(full_result.ty, 0));
3747 const overflowed = try self.buildCmp(.i_ne, zero, overflow);
3748
3749 break :blk .{ result, overflowed };
3750 }
3751
3752 const low_bits, const high_bits = try self.buildWideMul(.u_mul_extended, lhs, rhs);
3753
3754 // Truncate the result, if required.
3755 const result = try self.normalize(low_bits, info);
3756
3757 // Overflow happened if the high-bits of the result are non-zero OR if the
3758 // high bits of the low word of the result (those outside the range of the
3759 // int) are nonzero.
3760 const zero = Temporary.init(lhs.ty, try self.constInt(lhs.ty, 0));
3761 const high_overflowed = try self.buildCmp(.i_ne, zero, high_bits);
3762
3763 // If no overflow bits in low_bits, no extra work needs to be done.
3764 if (info.backing_bits == info.bits) break :blk .{ result, high_overflowed };
3765
3766 // Shift the result bits away to get the overflow bits.
3767 const shift = Temporary.init(lhs.ty, try self.constInt(lhs.ty, info.bits));
3768 const low_overflow = try self.buildBinary(.srl, low_bits, shift);
3769 const low_overflowed = try self.buildCmp(.i_ne, zero, low_overflow);
3770
3771 const overflowed = try self.buildBinary(.l_or, low_overflowed, high_overflowed);
3772
3773 break :blk .{ result, overflowed };
3774 },
3775 .signed => blk: {
3776 // - lhs >= 0, rhxs >= 0: expect positive; overflow should be 0
3777 // - lhs == 0 : expect positive; overflow should be 0
3778 // - rhs == 0: expect positive; overflow should be 0
3779 // - lhs > 0, rhs < 0: expect negative; overflow should be -1
3780 // - lhs < 0, rhs > 0: expect negative; overflow should be -1
3781 // - lhs <= 0, rhs <= 0: expect positive; overflow should be 0
3782 // ------
3783 // overflow should be -1 when
3784 // (lhs > 0 && rhs < 0) || (lhs < 0 && rhs > 0)
3785
3786 const zero = Temporary.init(lhs.ty, try self.constInt(lhs.ty, 0));
3787 const lhs_negative = try self.buildCmp(.s_lt, lhs, zero);
3788 const rhs_negative = try self.buildCmp(.s_lt, rhs, zero);
3789 const lhs_positive = try self.buildCmp(.s_gt, lhs, zero);
3790 const rhs_positive = try self.buildCmp(.s_gt, rhs, zero);
3791
3792 // Set to `true` if we expect -1.
3793 const expected_overflow_bit = try self.buildBinary(
3794 .l_or,
3795 try self.buildBinary(.l_and, lhs_positive, rhs_negative),
3796 try self.buildBinary(.l_and, lhs_negative, rhs_positive),
3797 );
3798
3799 if (maybe_op_ty_bits) |op_ty_bits| {
3800 const op_ty = try pt.intType(.signed, op_ty_bits);
3801 // Assume normalized; sign bit is set. We want a sign extend.
3802 const casted_lhs = try self.buildConvert(op_ty, lhs);
3803 const casted_rhs = try self.buildConvert(op_ty, rhs);
3804
3805 const full_result = try self.buildBinary(.i_mul, casted_lhs, casted_rhs);
3806
3807 // Truncate to the result type.
3808 const low_bits = try self.buildConvert(lhs.ty, full_result);
3809 const result = try self.normalize(low_bits, info);
3810
3811 // Now, we need to check the overflow bits AND the sign
3812 // bit for the expected overflow bits.
3813 // To do that, shift out everything bit the sign bit and
3814 // then check what remains.
3815 const shift = Temporary.init(full_result.ty, try self.constInt(full_result.ty, info.bits - 1));
3816 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3817 // for negative cases.
3818 const overflow = try self.buildBinary(.sra, full_result, shift);
3819
3820 const long_all_set = Temporary.init(full_result.ty, try self.constInt(full_result.ty, -1));
3821 const long_zero = Temporary.init(full_result.ty, try self.constInt(full_result.ty, 0));
3822 const mask = try self.buildSelect(expected_overflow_bit, long_all_set, long_zero);
3823
3824 const overflowed = try self.buildCmp(.i_ne, mask, overflow);
3825
3826 break :blk .{ result, overflowed };
3827 }
3828
3829 const low_bits, const high_bits = try self.buildWideMul(.s_mul_extended, lhs, rhs);
3830
3831 // Truncate result if required.
3832 const result = try self.normalize(low_bits, info);
3833
3834 const all_set = Temporary.init(lhs.ty, try self.constInt(lhs.ty, -1));
3835 const mask = try self.buildSelect(expected_overflow_bit, all_set, zero);
3836
3837 // Like with unsigned, overflow happened if high_bits are not the ones we expect,
3838 // and we also need to check some ones from the low bits.
3839
3840 const high_overflowed = try self.buildCmp(.i_ne, mask, high_bits);
3841
3842 // If no overflow bits in low_bits, no extra work needs to be done.
3843 // Careful, we still have to check the sign bit, so this branch
3844 // only goes for i33 and such.
3845 if (info.backing_bits == info.bits + 1) break :blk .{ result, high_overflowed };
3846
3847 // Shift the result bits away to get the overflow bits.
3848 const shift = Temporary.init(lhs.ty, try self.constInt(lhs.ty, info.bits - 1));
3849 // Use SRA so that any sign bits are duplicated. Now we can just check if ALL bits are set
3850 // for negative cases.
3851 const low_overflow = try self.buildBinary(.sra, low_bits, shift);
3852 const low_overflowed = try self.buildCmp(.i_ne, mask, low_overflow);
3853
3854 const overflowed = try self.buildBinary(.l_or, low_overflowed, high_overflowed);
3855
3856 break :blk .{ result, overflowed };
3857 },
3858 };
3859
3860 const ov = try self.intFromBool(overflowed);
3861
3862 const result_ty_id = try self.resolveType(result_ty, .direct);
3863 return try self.constructComposite(result_ty_id, &.{ try result.materialize(self), try ov.materialize(self) });
3864 }
3865
3866 fn airShlOverflow(self: *NavGen, inst: Air.Inst.Index) !?Id {
3867 const zcu = self.pt.zcu;
3868
3869 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
3870 const extra = self.air.extraData(Air.Bin, ty_pl.payload).data;
3871
3872 if (self.typeOf(extra.lhs).isVector(zcu) and !self.typeOf(extra.rhs).isVector(zcu)) {
3873 return self.fail("vector shift with scalar rhs", .{});
3874 }
3875
3876 const base = try self.temporary(extra.lhs);
3877 const shift = try self.temporary(extra.rhs);
3878
3879 const result_ty = self.typeOfIndex(inst);
3880
3881 const info = self.arithmeticTypeInfo(base.ty);
3882 switch (info.class) {
3883 .composite_integer => unreachable, // TODO
3884 .integer, .strange_integer => {},
3885 .float, .bool => unreachable,
3886 }
3887
3888 // Sometimes Zig doesn't make both of the arguments the same types here. SPIR-V expects that,
3889 // so just manually upcast it if required.
3890 const casted_shift = try self.buildConvert(base.ty.scalarType(zcu), shift);
3891
3892 const left = try self.buildBinary(.sll, base, casted_shift);
3893 const result = try self.normalize(left, info);
3894
3895 const right = switch (info.signedness) {
3896 .unsigned => try self.buildBinary(.srl, result, casted_shift),
3897 .signed => try self.buildBinary(.sra, result, casted_shift),
3898 };
3899
3900 const overflowed = try self.buildCmp(.i_ne, base, right);
3901 const ov = try self.intFromBool(overflowed);
3902
3903 const result_ty_id = try self.resolveType(result_ty, .direct);
3904 return try self.constructComposite(result_ty_id, &.{ try result.materialize(self), try ov.materialize(self) });
3905 }
3906
3907 fn airMulAdd(self: *NavGen, inst: Air.Inst.Index) !?Id {
3908 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3909 const extra = self.air.extraData(Air.Bin, pl_op.payload).data;
3910
3911 const a = try self.temporary(extra.lhs);
3912 const b = try self.temporary(extra.rhs);
3913 const c = try self.temporary(pl_op.operand);
3914
3915 const result_ty = self.typeOfIndex(inst);
3916 const info = self.arithmeticTypeInfo(result_ty);
3917 assert(info.class == .float); // .mul_add is only emitted for floats
3918
3919 const result = try self.buildFma(a, b, c);
3920 return try result.materialize(self);
3921 }
3922
3923 fn airClzCtz(self: *NavGen, inst: Air.Inst.Index, op: UnaryOp) !?Id {
3924 if (self.liveness.isUnused(inst)) return null;
3925
3926 const zcu = self.pt.zcu;
3927 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3928 const operand = try self.temporary(ty_op.operand);
3929
3930 const scalar_result_ty = self.typeOfIndex(inst).scalarType(zcu);
3931
3932 const info = self.arithmeticTypeInfo(operand.ty);
3933 switch (info.class) {
3934 .composite_integer => unreachable, // TODO
3935 .integer, .strange_integer => {},
3936 .float, .bool => unreachable,
3937 }
3938
3939 const count = try self.buildUnary(op, operand);
3940
3941 // Result of OpenCL ctz/clz returns operand.ty, and we want result_ty.
3942 // result_ty is always large enough to hold the result, so we might have to down
3943 // cast it.
3944 const result = try self.buildConvert(scalar_result_ty, count);
3945 return try result.materialize(self);
3946 }
3947
3948 fn airSelect(self: *NavGen, inst: Air.Inst.Index) !?Id {
3949 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
3950 const extra = self.air.extraData(Air.Bin, pl_op.payload).data;
3951 const pred = try self.temporary(pl_op.operand);
3952 const a = try self.temporary(extra.lhs);
3953 const b = try self.temporary(extra.rhs);
3954
3955 const result = try self.buildSelect(pred, a, b);
3956 return try result.materialize(self);
3957 }
3958
3959 fn airSplat(self: *NavGen, inst: Air.Inst.Index) !?Id {
3960 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
3961
3962 const operand_id = try self.resolve(ty_op.operand);
3963 const result_ty = self.typeOfIndex(inst);
3964
3965 return try self.constructCompositeSplat(result_ty, operand_id);
3966 }
3967
3968 fn airReduce(self: *NavGen, inst: Air.Inst.Index) !?Id {
3969 const zcu = self.pt.zcu;
3970 const reduce = self.air.instructions.items(.data)[@intFromEnum(inst)].reduce;
3971 const operand = try self.resolve(reduce.operand);
3972 const operand_ty = self.typeOf(reduce.operand);
3973 const scalar_ty = operand_ty.scalarType(zcu);
3974 const scalar_ty_id = try self.resolveType(scalar_ty, .direct);
3975 const info = self.arithmeticTypeInfo(operand_ty);
3976 const len = operand_ty.vectorLen(zcu);
3977 const first = try self.extractVectorComponent(scalar_ty, operand, 0);
3978
3979 switch (reduce.operation) {
3980 .Min, .Max => |op| {
3981 var result = Temporary.init(scalar_ty, first);
3982 const cmp_op: MinMax = switch (op) {
3983 .Max => .max,
3984 .Min => .min,
3985 else => unreachable,
3986 };
3987 for (1..len) |i| {
3988 const lhs = result;
3989 const rhs_id = try self.extractVectorComponent(scalar_ty, operand, @intCast(i));
3990 const rhs = Temporary.init(scalar_ty, rhs_id);
3991
3992 result = try self.minMax(lhs, rhs, cmp_op);
3993 }
3994
3995 return try result.materialize(self);
3996 },
3997 else => {},
3998 }
3999
4000 var result_id = first;
4001
4002 const opcode: Opcode = switch (info.class) {
4003 .bool => switch (reduce.operation) {
4004 .And => .OpLogicalAnd,
4005 .Or => .OpLogicalOr,
4006 .Xor => .OpLogicalNotEqual,
4007 else => unreachable,
4008 },
4009 .strange_integer, .integer => switch (reduce.operation) {
4010 .And => .OpBitwiseAnd,
4011 .Or => .OpBitwiseOr,
4012 .Xor => .OpBitwiseXor,
4013 .Add => .OpIAdd,
4014 .Mul => .OpIMul,
4015 else => unreachable,
4016 },
4017 .float => switch (reduce.operation) {
4018 .Add => .OpFAdd,
4019 .Mul => .OpFMul,
4020 else => unreachable,
4021 },
4022 .composite_integer => unreachable, // TODO
4023 };
4024
4025 for (1..len) |i| {
4026 const lhs = result_id;
4027 const rhs = try self.extractVectorComponent(scalar_ty, operand, @intCast(i));
4028 result_id = self.spv.allocId();
4029
4030 try self.func.body.emitRaw(self.spv.gpa, opcode, 4);
4031 self.func.body.writeOperand(spec.Id, scalar_ty_id);
4032 self.func.body.writeOperand(spec.Id, result_id);
4033 self.func.body.writeOperand(spec.Id, lhs);
4034 self.func.body.writeOperand(spec.Id, rhs);
4035 }
4036
4037 return result_id;
4038 }
4039
4040 fn airShuffleOne(ng: *NavGen, inst: Air.Inst.Index) !?Id {
4041 const pt = ng.pt;
4042 const zcu = pt.zcu;
4043 const gpa = zcu.gpa;
4044
4045 const unwrapped = ng.air.unwrapShuffleOne(zcu, inst);
4046 const mask = unwrapped.mask;
4047 const result_ty = unwrapped.result_ty;
4048 const elem_ty = result_ty.childType(zcu);
4049 const operand = try ng.resolve(unwrapped.operand);
4050
4051 const constituents = try gpa.alloc(Id, mask.len);
4052 defer gpa.free(constituents);
4053
4054 for (constituents, mask) |*id, mask_elem| {
4055 id.* = switch (mask_elem.unwrap()) {
4056 .elem => |idx| try ng.extractVectorComponent(elem_ty, operand, idx),
4057 .value => |val| try ng.constant(elem_ty, .fromInterned(val), .direct),
4058 };
4059 }
4060
4061 const result_ty_id = try ng.resolveType(result_ty, .direct);
4062 return try ng.constructComposite(result_ty_id, constituents);
4063 }
4064
4065 fn airShuffleTwo(ng: *NavGen, inst: Air.Inst.Index) !?Id {
4066 const pt = ng.pt;
4067 const zcu = pt.zcu;
4068 const gpa = zcu.gpa;
4069
4070 const unwrapped = ng.air.unwrapShuffleTwo(zcu, inst);
4071 const mask = unwrapped.mask;
4072 const result_ty = unwrapped.result_ty;
4073 const elem_ty = result_ty.childType(zcu);
4074 const elem_ty_id = try ng.resolveType(elem_ty, .direct);
4075 const operand_a = try ng.resolve(unwrapped.operand_a);
4076 const operand_b = try ng.resolve(unwrapped.operand_b);
4077
4078 const constituents = try gpa.alloc(Id, mask.len);
4079 defer gpa.free(constituents);
4080
4081 for (constituents, mask) |*id, mask_elem| {
4082 id.* = switch (mask_elem.unwrap()) {
4083 .a_elem => |idx| try ng.extractVectorComponent(elem_ty, operand_a, idx),
4084 .b_elem => |idx| try ng.extractVectorComponent(elem_ty, operand_b, idx),
4085 .undef => try ng.spv.constUndef(elem_ty_id),
4086 };
4087 }
4088
4089 const result_ty_id = try ng.resolveType(result_ty, .direct);
4090 return try ng.constructComposite(result_ty_id, constituents);
4091 }
4092
4093 fn indicesToIds(self: *NavGen, indices: []const u32) ![]Id {
4094 const ids = try self.gpa.alloc(Id, indices.len);
4095 errdefer self.gpa.free(ids);
4096 for (indices, ids) |index, *id| {
4097 id.* = try self.constInt(Type.u32, index);
4098 }
4099
4100 return ids;
4101 }
4102
4103 fn accessChainId(
4104 self: *NavGen,
4105 result_ty_id: Id,
4106 base: Id,
4107 indices: []const Id,
4108 ) !Id {
4109 const result_id = self.spv.allocId();
4110 try self.func.body.emit(self.spv.gpa, .OpInBoundsAccessChain, .{
4111 .id_result_type = result_ty_id,
4112 .id_result = result_id,
4113 .base = base,
4114 .indexes = indices,
4115 });
4116 return result_id;
4117 }
4118
4119 /// AccessChain is essentially PtrAccessChain with 0 as initial argument. The effective
4120 /// difference lies in whether the resulting type of the first dereference will be the
4121 /// same as that of the base pointer, or that of a dereferenced base pointer. AccessChain
4122 /// is the latter and PtrAccessChain is the former.
4123 fn accessChain(
4124 self: *NavGen,
4125 result_ty_id: Id,
4126 base: Id,
4127 indices: []const u32,
4128 ) !Id {
4129 const ids = try self.indicesToIds(indices);
4130 defer self.gpa.free(ids);
4131 return try self.accessChainId(result_ty_id, base, ids);
4132 }
4133
4134 fn ptrAccessChain(
4135 self: *NavGen,
4136 result_ty_id: Id,
4137 base: Id,
4138 element: Id,
4139 indices: []const u32,
4140 ) !Id {
4141 const ids = try self.indicesToIds(indices);
4142 defer self.gpa.free(ids);
4143
4144 const result_id = self.spv.allocId();
4145 switch (self.spv.target.os.tag) {
4146 .opencl, .amdhsa => {
4147 try self.func.body.emit(self.spv.gpa, .OpInBoundsPtrAccessChain, .{
4148 .id_result_type = result_ty_id,
4149 .id_result = result_id,
4150 .base = base,
4151 .element = element,
4152 .indexes = ids,
4153 });
4154 },
4155 else => {
4156 try self.func.body.emit(self.spv.gpa, .OpPtrAccessChain, .{
4157 .id_result_type = result_ty_id,
4158 .id_result = result_id,
4159 .base = base,
4160 .element = element,
4161 .indexes = ids,
4162 });
4163 },
4164 }
4165 return result_id;
4166 }
4167
4168 fn ptrAdd(self: *NavGen, result_ty: Type, ptr_ty: Type, ptr_id: Id, offset_id: Id) !Id {
4169 const zcu = self.pt.zcu;
4170 const result_ty_id = try self.resolveType(result_ty, .direct);
4171
4172 switch (ptr_ty.ptrSize(zcu)) {
4173 .one => {
4174 // Pointer to array
4175 // TODO: Is this correct?
4176 return try self.accessChainId(result_ty_id, ptr_id, &.{offset_id});
4177 },
4178 .c, .many => {
4179 return try self.ptrAccessChain(result_ty_id, ptr_id, offset_id, &.{});
4180 },
4181 .slice => {
4182 // TODO: This is probably incorrect. A slice should be returned here, though this is what llvm does.
4183 const slice_ptr_id = try self.extractField(result_ty, ptr_id, 0);
4184 return try self.ptrAccessChain(result_ty_id, slice_ptr_id, offset_id, &.{});
4185 },
4186 }
4187 }
4188
4189 fn airPtrAdd(self: *NavGen, inst: Air.Inst.Index) !?Id {
4190 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4191 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
4192 const ptr_id = try self.resolve(bin_op.lhs);
4193 const offset_id = try self.resolve(bin_op.rhs);
4194 const ptr_ty = self.typeOf(bin_op.lhs);
4195 const result_ty = self.typeOfIndex(inst);
4196
4197 return try self.ptrAdd(result_ty, ptr_ty, ptr_id, offset_id);
4198 }
4199
4200 fn airPtrSub(self: *NavGen, inst: Air.Inst.Index) !?Id {
4201 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4202 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
4203 const ptr_id = try self.resolve(bin_op.lhs);
4204 const ptr_ty = self.typeOf(bin_op.lhs);
4205 const offset_id = try self.resolve(bin_op.rhs);
4206 const offset_ty = self.typeOf(bin_op.rhs);
4207 const offset_ty_id = try self.resolveType(offset_ty, .direct);
4208 const result_ty = self.typeOfIndex(inst);
4209
4210 const negative_offset_id = self.spv.allocId();
4211 try self.func.body.emit(self.spv.gpa, .OpSNegate, .{
4212 .id_result_type = offset_ty_id,
4213 .id_result = negative_offset_id,
4214 .operand = offset_id,
4215 });
4216 return try self.ptrAdd(result_ty, ptr_ty, ptr_id, negative_offset_id);
4217 }
4218
4219 fn cmp(
4220 self: *NavGen,
4221 op: std.math.CompareOperator,
4222 lhs: Temporary,
4223 rhs: Temporary,
4224 ) !Temporary {
4225 const pt = self.pt;
4226 const zcu = pt.zcu;
4227 const ip = &zcu.intern_pool;
4228 const scalar_ty = lhs.ty.scalarType(zcu);
4229 const is_vector = lhs.ty.isVector(zcu);
4230
4231 switch (scalar_ty.zigTypeTag(zcu)) {
4232 .int, .bool, .float => {},
4233 .@"enum" => {
4234 assert(!is_vector);
4235 const ty = lhs.ty.intTagType(zcu);
4236 return try self.cmp(op, lhs.pun(ty), rhs.pun(ty));
4237 },
4238 .@"struct" => {
4239 const struct_ty = zcu.typeToPackedStruct(scalar_ty).?;
4240 const ty = Type.fromInterned(struct_ty.backingIntTypeUnordered(ip));
4241 return try self.cmp(op, lhs.pun(ty), rhs.pun(ty));
4242 },
4243 .error_set => {
4244 assert(!is_vector);
4245 const err_int_ty = try pt.errorIntType();
4246 return try self.cmp(op, lhs.pun(err_int_ty), rhs.pun(err_int_ty));
4247 },
4248 .pointer => {
4249 assert(!is_vector);
4250 // Note that while SPIR-V offers OpPtrEqual and OpPtrNotEqual, they are
4251 // currently not implemented in the SPIR-V LLVM translator. Thus, we emit these using
4252 // OpConvertPtrToU...
4253
4254 const usize_ty_id = try self.resolveType(Type.usize, .direct);
4255
4256 const lhs_int_id = self.spv.allocId();
4257 try self.func.body.emit(self.spv.gpa, .OpConvertPtrToU, .{
4258 .id_result_type = usize_ty_id,
4259 .id_result = lhs_int_id,
4260 .pointer = try lhs.materialize(self),
4261 });
4262
4263 const rhs_int_id = self.spv.allocId();
4264 try self.func.body.emit(self.spv.gpa, .OpConvertPtrToU, .{
4265 .id_result_type = usize_ty_id,
4266 .id_result = rhs_int_id,
4267 .pointer = try rhs.materialize(self),
4268 });
4269
4270 const lhs_int = Temporary.init(Type.usize, lhs_int_id);
4271 const rhs_int = Temporary.init(Type.usize, rhs_int_id);
4272 return try self.cmp(op, lhs_int, rhs_int);
4273 },
4274 .optional => {
4275 assert(!is_vector);
4276
4277 const ty = lhs.ty;
4278
4279 const payload_ty = ty.optionalChild(zcu);
4280 if (ty.optionalReprIsPayload(zcu)) {
4281 assert(payload_ty.hasRuntimeBitsIgnoreComptime(zcu));
4282 assert(!payload_ty.isSlice(zcu));
4283
4284 return try self.cmp(op, lhs.pun(payload_ty), rhs.pun(payload_ty));
4285 }
4286
4287 const lhs_id = try lhs.materialize(self);
4288 const rhs_id = try rhs.materialize(self);
4289
4290 const lhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
4291 try self.extractField(Type.bool, lhs_id, 1)
4292 else
4293 try self.convertToDirect(Type.bool, lhs_id);
4294
4295 const rhs_valid_id = if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
4296 try self.extractField(Type.bool, rhs_id, 1)
4297 else
4298 try self.convertToDirect(Type.bool, rhs_id);
4299
4300 const lhs_valid = Temporary.init(Type.bool, lhs_valid_id);
4301 const rhs_valid = Temporary.init(Type.bool, rhs_valid_id);
4302
4303 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4304 return try self.cmp(op, lhs_valid, rhs_valid);
4305 }
4306
4307 // a = lhs_valid
4308 // b = rhs_valid
4309 // c = lhs_pl == rhs_pl
4310 //
4311 // For op == .eq we have:
4312 // a == b && a -> c
4313 // = a == b && (!a || c)
4314 //
4315 // For op == .neq we have
4316 // a == b && a -> c
4317 // = !(a == b && a -> c)
4318 // = a != b || !(a -> c
4319 // = a != b || !(!a || c)
4320 // = a != b || a && !c
4321
4322 const lhs_pl_id = try self.extractField(payload_ty, lhs_id, 0);
4323 const rhs_pl_id = try self.extractField(payload_ty, rhs_id, 0);
4324
4325 const lhs_pl = Temporary.init(payload_ty, lhs_pl_id);
4326 const rhs_pl = Temporary.init(payload_ty, rhs_pl_id);
4327
4328 return switch (op) {
4329 .eq => try self.buildBinary(
4330 .l_and,
4331 try self.cmp(.eq, lhs_valid, rhs_valid),
4332 try self.buildBinary(
4333 .l_or,
4334 try self.buildUnary(.l_not, lhs_valid),
4335 try self.cmp(.eq, lhs_pl, rhs_pl),
4336 ),
4337 ),
4338 .neq => try self.buildBinary(
4339 .l_or,
4340 try self.cmp(.neq, lhs_valid, rhs_valid),
4341 try self.buildBinary(
4342 .l_and,
4343 lhs_valid,
4344 try self.cmp(.neq, lhs_pl, rhs_pl),
4345 ),
4346 ),
4347 else => unreachable,
4348 };
4349 },
4350 else => |ty| return self.todo("implement cmp operation for '{s}' type", .{@tagName(ty)}),
4351 }
4352
4353 const info = self.arithmeticTypeInfo(scalar_ty);
4354 const pred: CmpPredicate = switch (info.class) {
4355 .composite_integer => unreachable, // TODO
4356 .float => switch (op) {
4357 .eq => .f_oeq,
4358 .neq => .f_une,
4359 .lt => .f_olt,
4360 .lte => .f_ole,
4361 .gt => .f_ogt,
4362 .gte => .f_oge,
4363 },
4364 .bool => switch (op) {
4365 .eq => .l_eq,
4366 .neq => .l_ne,
4367 else => unreachable,
4368 },
4369 .integer, .strange_integer => switch (info.signedness) {
4370 .signed => switch (op) {
4371 .eq => .i_eq,
4372 .neq => .i_ne,
4373 .lt => .s_lt,
4374 .lte => .s_le,
4375 .gt => .s_gt,
4376 .gte => .s_ge,
4377 },
4378 .unsigned => switch (op) {
4379 .eq => .i_eq,
4380 .neq => .i_ne,
4381 .lt => .u_lt,
4382 .lte => .u_le,
4383 .gt => .u_gt,
4384 .gte => .u_ge,
4385 },
4386 },
4387 };
4388
4389 return try self.buildCmp(pred, lhs, rhs);
4390 }
4391
4392 fn airCmp(
4393 self: *NavGen,
4394 inst: Air.Inst.Index,
4395 comptime op: std.math.CompareOperator,
4396 ) !?Id {
4397 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4398 const lhs = try self.temporary(bin_op.lhs);
4399 const rhs = try self.temporary(bin_op.rhs);
4400
4401 const result = try self.cmp(op, lhs, rhs);
4402 return try result.materialize(self);
4403 }
4404
4405 fn airVectorCmp(self: *NavGen, inst: Air.Inst.Index) !?Id {
4406 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4407 const vec_cmp = self.air.extraData(Air.VectorCmp, ty_pl.payload).data;
4408 const lhs = try self.temporary(vec_cmp.lhs);
4409 const rhs = try self.temporary(vec_cmp.rhs);
4410 const op = vec_cmp.compareOperator();
4411
4412 const result = try self.cmp(op, lhs, rhs);
4413 return try result.materialize(self);
4414 }
4415
4416 /// Bitcast one type to another. Note: both types, input, output are expected in **direct** representation.
4417 fn bitCast(
4418 self: *NavGen,
4419 dst_ty: Type,
4420 src_ty: Type,
4421 src_id: Id,
4422 ) !Id {
4423 const zcu = self.pt.zcu;
4424 const src_ty_id = try self.resolveType(src_ty, .direct);
4425 const dst_ty_id = try self.resolveType(dst_ty, .direct);
4426
4427 const result_id = blk: {
4428 if (src_ty_id == dst_ty_id) break :blk src_id;
4429
4430 // TODO: Some more cases are missing here
4431 // See fn bitCast in llvm.zig
4432
4433 if (src_ty.zigTypeTag(zcu) == .int and dst_ty.isPtrAtRuntime(zcu)) {
4434 const result_id = self.spv.allocId();
4435 try self.func.body.emit(self.spv.gpa, .OpConvertUToPtr, .{
4436 .id_result_type = dst_ty_id,
4437 .id_result = result_id,
4438 .integer_value = src_id,
4439 });
4440 break :blk result_id;
4441 }
4442
4443 // We can only use OpBitcast for specific conversions: between numerical types, and
4444 // between pointers. If the resolved spir-v types fall into this category then emit OpBitcast,
4445 // otherwise use a temporary and perform a pointer cast.
4446 const can_bitcast = (src_ty.isNumeric(zcu) and dst_ty.isNumeric(zcu)) or (src_ty.isPtrAtRuntime(zcu) and dst_ty.isPtrAtRuntime(zcu));
4447 if (can_bitcast) {
4448 const result_id = self.spv.allocId();
4449 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
4450 .id_result_type = dst_ty_id,
4451 .id_result = result_id,
4452 .operand = src_id,
4453 });
4454
4455 break :blk result_id;
4456 }
4457
4458 const dst_ptr_ty_id = try self.ptrType(dst_ty, .function, .indirect);
4459
4460 const tmp_id = try self.alloc(src_ty, .{ .storage_class = .function });
4461 try self.store(src_ty, tmp_id, src_id, .{});
4462 const casted_ptr_id = self.spv.allocId();
4463 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
4464 .id_result_type = dst_ptr_ty_id,
4465 .id_result = casted_ptr_id,
4466 .operand = tmp_id,
4467 });
4468 break :blk try self.load(dst_ty, casted_ptr_id, .{});
4469 };
4470
4471 // Because strange integers use sign-extended representation, we may need to normalize
4472 // the result here.
4473 // TODO: This detail could cause stuff like @as(*const i1, @ptrCast(&@as(u1, 1))) to break
4474 // should we change the representation of strange integers?
4475 if (dst_ty.zigTypeTag(zcu) == .int) {
4476 const info = self.arithmeticTypeInfo(dst_ty);
4477 const result = try self.normalize(Temporary.init(dst_ty, result_id), info);
4478 return try result.materialize(self);
4479 }
4480
4481 return result_id;
4482 }
4483
4484 fn airBitCast(self: *NavGen, inst: Air.Inst.Index) !?Id {
4485 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4486 const operand_ty = self.typeOf(ty_op.operand);
4487 const result_ty = self.typeOfIndex(inst);
4488 if (operand_ty.toIntern() == .bool_type) {
4489 const operand = try self.temporary(ty_op.operand);
4490 const result = try self.intFromBool(operand);
4491 return try result.materialize(self);
4492 }
4493 const operand_id = try self.resolve(ty_op.operand);
4494 return try self.bitCast(result_ty, operand_ty, operand_id);
4495 }
4496
4497 fn airIntCast(self: *NavGen, inst: Air.Inst.Index) !?Id {
4498 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4499 const src = try self.temporary(ty_op.operand);
4500 const dst_ty = self.typeOfIndex(inst);
4501
4502 const src_info = self.arithmeticTypeInfo(src.ty);
4503 const dst_info = self.arithmeticTypeInfo(dst_ty);
4504
4505 if (src_info.backing_bits == dst_info.backing_bits) {
4506 return try src.materialize(self);
4507 }
4508
4509 const converted = try self.buildConvert(dst_ty, src);
4510
4511 // Make sure to normalize the result if shrinking.
4512 // Because strange ints are sign extended in their backing
4513 // type, we don't need to normalize when growing the type. The
4514 // representation is already the same.
4515 const result = if (dst_info.bits < src_info.bits)
4516 try self.normalize(converted, dst_info)
4517 else
4518 converted;
4519
4520 return try result.materialize(self);
4521 }
4522
4523 fn intFromPtr(self: *NavGen, operand_id: Id) !Id {
4524 const result_type_id = try self.resolveType(Type.usize, .direct);
4525 const result_id = self.spv.allocId();
4526 try self.func.body.emit(self.spv.gpa, .OpConvertPtrToU, .{
4527 .id_result_type = result_type_id,
4528 .id_result = result_id,
4529 .pointer = operand_id,
4530 });
4531 return result_id;
4532 }
4533
4534 fn airFloatFromInt(self: *NavGen, inst: Air.Inst.Index) !?Id {
4535 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4536 const operand_ty = self.typeOf(ty_op.operand);
4537 const operand_id = try self.resolve(ty_op.operand);
4538 const result_ty = self.typeOfIndex(inst);
4539 return try self.floatFromInt(result_ty, operand_ty, operand_id);
4540 }
4541
4542 fn floatFromInt(self: *NavGen, result_ty: Type, operand_ty: Type, operand_id: Id) !Id {
4543 const operand_info = self.arithmeticTypeInfo(operand_ty);
4544 const result_id = self.spv.allocId();
4545 const result_ty_id = try self.resolveType(result_ty, .direct);
4546 switch (operand_info.signedness) {
4547 .signed => try self.func.body.emit(self.spv.gpa, .OpConvertSToF, .{
4548 .id_result_type = result_ty_id,
4549 .id_result = result_id,
4550 .signed_value = operand_id,
4551 }),
4552 .unsigned => try self.func.body.emit(self.spv.gpa, .OpConvertUToF, .{
4553 .id_result_type = result_ty_id,
4554 .id_result = result_id,
4555 .unsigned_value = operand_id,
4556 }),
4557 }
4558 return result_id;
4559 }
4560
4561 fn airIntFromFloat(self: *NavGen, inst: Air.Inst.Index) !?Id {
4562 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4563 const operand_id = try self.resolve(ty_op.operand);
4564 const result_ty = self.typeOfIndex(inst);
4565 return try self.intFromFloat(result_ty, operand_id);
4566 }
4567
4568 fn intFromFloat(self: *NavGen, result_ty: Type, operand_id: Id) !Id {
4569 const result_info = self.arithmeticTypeInfo(result_ty);
4570 const result_ty_id = try self.resolveType(result_ty, .direct);
4571 const result_id = self.spv.allocId();
4572 switch (result_info.signedness) {
4573 .signed => try self.func.body.emit(self.spv.gpa, .OpConvertFToS, .{
4574 .id_result_type = result_ty_id,
4575 .id_result = result_id,
4576 .float_value = operand_id,
4577 }),
4578 .unsigned => try self.func.body.emit(self.spv.gpa, .OpConvertFToU, .{
4579 .id_result_type = result_ty_id,
4580 .id_result = result_id,
4581 .float_value = operand_id,
4582 }),
4583 }
4584 return result_id;
4585 }
4586
4587 fn airFloatCast(self: *NavGen, inst: Air.Inst.Index) !?Id {
4588 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4589 const operand = try self.temporary(ty_op.operand);
4590 const dest_ty = self.typeOfIndex(inst);
4591 const result = try self.buildConvert(dest_ty, operand);
4592 return try result.materialize(self);
4593 }
4594
4595 fn airNot(self: *NavGen, inst: Air.Inst.Index) !?Id {
4596 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4597 const operand = try self.temporary(ty_op.operand);
4598 const result_ty = self.typeOfIndex(inst);
4599 const info = self.arithmeticTypeInfo(result_ty);
4600
4601 const result = switch (info.class) {
4602 .bool => try self.buildUnary(.l_not, operand),
4603 .float => unreachable,
4604 .composite_integer => unreachable, // TODO
4605 .strange_integer, .integer => blk: {
4606 const complement = try self.buildUnary(.bit_not, operand);
4607 break :blk try self.normalize(complement, info);
4608 },
4609 };
4610
4611 return try result.materialize(self);
4612 }
4613
4614 fn airArrayToSlice(self: *NavGen, inst: Air.Inst.Index) !?Id {
4615 const pt = self.pt;
4616 const zcu = pt.zcu;
4617 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4618 const array_ptr_ty = self.typeOf(ty_op.operand);
4619 const array_ty = array_ptr_ty.childType(zcu);
4620 const slice_ty = self.typeOfIndex(inst);
4621 const elem_ptr_ty = slice_ty.slicePtrFieldType(zcu);
4622
4623 const elem_ptr_ty_id = try self.resolveType(elem_ptr_ty, .direct);
4624
4625 const array_ptr_id = try self.resolve(ty_op.operand);
4626 const len_id = try self.constInt(Type.usize, array_ty.arrayLen(zcu));
4627
4628 const elem_ptr_id = if (!array_ty.hasRuntimeBitsIgnoreComptime(zcu))
4629 // Note: The pointer is something like *opaque{}, so we need to bitcast it to the element type.
4630 try self.bitCast(elem_ptr_ty, array_ptr_ty, array_ptr_id)
4631 else
4632 // Convert the pointer-to-array to a pointer to the first element.
4633 try self.accessChain(elem_ptr_ty_id, array_ptr_id, &.{0});
4634
4635 const slice_ty_id = try self.resolveType(slice_ty, .direct);
4636 return try self.constructComposite(slice_ty_id, &.{ elem_ptr_id, len_id });
4637 }
4638
4639 fn airSlice(self: *NavGen, inst: Air.Inst.Index) !?Id {
4640 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4641 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
4642 const ptr_id = try self.resolve(bin_op.lhs);
4643 const len_id = try self.resolve(bin_op.rhs);
4644 const slice_ty = self.typeOfIndex(inst);
4645 const slice_ty_id = try self.resolveType(slice_ty, .direct);
4646 return try self.constructComposite(slice_ty_id, &.{ ptr_id, len_id });
4647 }
4648
4649 fn airAggregateInit(self: *NavGen, inst: Air.Inst.Index) !?Id {
4650 const pt = self.pt;
4651 const zcu = pt.zcu;
4652 const ip = &zcu.intern_pool;
4653 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4654 const result_ty = self.typeOfIndex(inst);
4655 const len: usize = @intCast(result_ty.arrayLen(zcu));
4656 const elements: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[ty_pl.payload..][0..len]);
4657
4658 switch (result_ty.zigTypeTag(zcu)) {
4659 .@"struct" => {
4660 if (zcu.typeToPackedStruct(result_ty)) |struct_type| {
4661 comptime assert(Type.packed_struct_layout_version == 2);
4662 const backing_int_ty = Type.fromInterned(struct_type.backingIntTypeUnordered(ip));
4663 var running_int_id = try self.constInt(backing_int_ty, 0);
4664 var running_bits: u16 = 0;
4665 for (struct_type.field_types.get(ip), elements) |field_ty_ip, element| {
4666 const field_ty = Type.fromInterned(field_ty_ip);
4667 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
4668 const field_id = try self.resolve(element);
4669 const ty_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
4670 const field_int_ty = try self.pt.intType(.unsigned, ty_bit_size);
4671 const field_int_id = blk: {
4672 if (field_ty.isPtrAtRuntime(zcu)) {
4673 assert(self.spv.target.cpu.arch == .spirv64 and
4674 field_ty.ptrAddressSpace(zcu) == .storage_buffer);
4675 break :blk try self.intFromPtr(field_id);
4676 }
4677 break :blk try self.bitCast(field_int_ty, field_ty, field_id);
4678 };
4679 const shift_rhs = try self.constInt(backing_int_ty, running_bits);
4680 const extended_int_conv = try self.buildConvert(backing_int_ty, .{
4681 .ty = field_int_ty,
4682 .value = .{ .singleton = field_int_id },
4683 });
4684 const shifted = try self.buildBinary(.sll, extended_int_conv, .{
4685 .ty = backing_int_ty,
4686 .value = .{ .singleton = shift_rhs },
4687 });
4688 const running_int_tmp = try self.buildBinary(
4689 .bit_or,
4690 .{ .ty = backing_int_ty, .value = .{ .singleton = running_int_id } },
4691 shifted,
4692 );
4693 running_int_id = try running_int_tmp.materialize(self);
4694 running_bits += ty_bit_size;
4695 }
4696 return running_int_id;
4697 }
4698
4699 const types = try self.gpa.alloc(Type, elements.len);
4700 defer self.gpa.free(types);
4701 const constituents = try self.gpa.alloc(Id, elements.len);
4702 defer self.gpa.free(constituents);
4703 var index: usize = 0;
4704
4705 switch (ip.indexToKey(result_ty.toIntern())) {
4706 .tuple_type => |tuple| {
4707 for (tuple.types.get(ip), elements, 0..) |field_ty, element, i| {
4708 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4709 assert(Type.fromInterned(field_ty).hasRuntimeBits(zcu));
4710
4711 const id = try self.resolve(element);
4712 types[index] = Type.fromInterned(field_ty);
4713 constituents[index] = try self.convertToIndirect(Type.fromInterned(field_ty), id);
4714 index += 1;
4715 }
4716 },
4717 .struct_type => {
4718 const struct_type = ip.loadStructType(result_ty.toIntern());
4719 var it = struct_type.iterateRuntimeOrder(ip);
4720 for (elements, 0..) |element, i| {
4721 const field_index = it.next().?;
4722 if ((try result_ty.structFieldValueComptime(pt, i)) != null) continue;
4723 const field_ty = Type.fromInterned(struct_type.field_types.get(ip)[field_index]);
4724 assert(field_ty.hasRuntimeBitsIgnoreComptime(zcu));
4725
4726 const id = try self.resolve(element);
4727 types[index] = field_ty;
4728 constituents[index] = try self.convertToIndirect(field_ty, id);
4729 index += 1;
4730 }
4731 },
4732 else => unreachable,
4733 }
4734
4735 const result_ty_id = try self.resolveType(result_ty, .direct);
4736 return try self.constructComposite(result_ty_id, constituents[0..index]);
4737 },
4738 .vector => {
4739 const n_elems = result_ty.vectorLen(zcu);
4740 const elem_ids = try self.gpa.alloc(Id, n_elems);
4741 defer self.gpa.free(elem_ids);
4742
4743 for (elements, 0..) |element, i| {
4744 elem_ids[i] = try self.resolve(element);
4745 }
4746
4747 const result_ty_id = try self.resolveType(result_ty, .direct);
4748 return try self.constructComposite(result_ty_id, elem_ids);
4749 },
4750 .array => {
4751 const array_info = result_ty.arrayInfo(zcu);
4752 const n_elems: usize = @intCast(result_ty.arrayLenIncludingSentinel(zcu));
4753 const elem_ids = try self.gpa.alloc(Id, n_elems);
4754 defer self.gpa.free(elem_ids);
4755
4756 for (elements, 0..) |element, i| {
4757 const id = try self.resolve(element);
4758 elem_ids[i] = try self.convertToIndirect(array_info.elem_type, id);
4759 }
4760
4761 if (array_info.sentinel) |sentinel_val| {
4762 elem_ids[n_elems - 1] = try self.constant(array_info.elem_type, sentinel_val, .indirect);
4763 }
4764
4765 const result_ty_id = try self.resolveType(result_ty, .direct);
4766 return try self.constructComposite(result_ty_id, elem_ids);
4767 },
4768 else => unreachable,
4769 }
4770 }
4771
4772 fn sliceOrArrayLen(self: *NavGen, operand_id: Id, ty: Type) !Id {
4773 const pt = self.pt;
4774 const zcu = pt.zcu;
4775 switch (ty.ptrSize(zcu)) {
4776 .slice => return self.extractField(Type.usize, operand_id, 1),
4777 .one => {
4778 const array_ty = ty.childType(zcu);
4779 const elem_ty = array_ty.childType(zcu);
4780 const abi_size = elem_ty.abiSize(zcu);
4781 const size = array_ty.arrayLenIncludingSentinel(zcu) * abi_size;
4782 return try self.constInt(Type.usize, size);
4783 },
4784 .many, .c => unreachable,
4785 }
4786 }
4787
4788 fn sliceOrArrayPtr(self: *NavGen, operand_id: Id, ty: Type) !Id {
4789 const zcu = self.pt.zcu;
4790 if (ty.isSlice(zcu)) {
4791 const ptr_ty = ty.slicePtrFieldType(zcu);
4792 return self.extractField(ptr_ty, operand_id, 0);
4793 }
4794 return operand_id;
4795 }
4796
4797 fn airMemcpy(self: *NavGen, inst: Air.Inst.Index) !void {
4798 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4799 const dest_slice = try self.resolve(bin_op.lhs);
4800 const src_slice = try self.resolve(bin_op.rhs);
4801 const dest_ty = self.typeOf(bin_op.lhs);
4802 const src_ty = self.typeOf(bin_op.rhs);
4803 const dest_ptr = try self.sliceOrArrayPtr(dest_slice, dest_ty);
4804 const src_ptr = try self.sliceOrArrayPtr(src_slice, src_ty);
4805 const len = try self.sliceOrArrayLen(dest_slice, dest_ty);
4806 try self.func.body.emit(self.spv.gpa, .OpCopyMemorySized, .{
4807 .target = dest_ptr,
4808 .source = src_ptr,
4809 .size = len,
4810 });
4811 }
4812
4813 fn airMemmove(self: *NavGen, inst: Air.Inst.Index) !void {
4814 _ = inst;
4815 return self.fail("TODO implement airMemcpy for spirv", .{});
4816 }
4817
4818 fn airSliceField(self: *NavGen, inst: Air.Inst.Index, field: u32) !?Id {
4819 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
4820 const field_ty = self.typeOfIndex(inst);
4821 const operand_id = try self.resolve(ty_op.operand);
4822 return try self.extractField(field_ty, operand_id, field);
4823 }
4824
4825 fn airSliceElemPtr(self: *NavGen, inst: Air.Inst.Index) !?Id {
4826 const zcu = self.pt.zcu;
4827 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4828 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
4829 const slice_ty = self.typeOf(bin_op.lhs);
4830 if (!slice_ty.isVolatilePtr(zcu) and self.liveness.isUnused(inst)) return null;
4831
4832 const slice_id = try self.resolve(bin_op.lhs);
4833 const index_id = try self.resolve(bin_op.rhs);
4834
4835 const ptr_ty = self.typeOfIndex(inst);
4836 const ptr_ty_id = try self.resolveType(ptr_ty, .direct);
4837
4838 const slice_ptr = try self.extractField(ptr_ty, slice_id, 0);
4839 return try self.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4840 }
4841
4842 fn airSliceElemVal(self: *NavGen, inst: Air.Inst.Index) !?Id {
4843 const zcu = self.pt.zcu;
4844 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4845 const slice_ty = self.typeOf(bin_op.lhs);
4846 if (!slice_ty.isVolatilePtr(zcu) and self.liveness.isUnused(inst)) return null;
4847
4848 const slice_id = try self.resolve(bin_op.lhs);
4849 const index_id = try self.resolve(bin_op.rhs);
4850
4851 const ptr_ty = slice_ty.slicePtrFieldType(zcu);
4852 const ptr_ty_id = try self.resolveType(ptr_ty, .direct);
4853
4854 const slice_ptr = try self.extractField(ptr_ty, slice_id, 0);
4855 const elem_ptr = try self.ptrAccessChain(ptr_ty_id, slice_ptr, index_id, &.{});
4856 return try self.load(slice_ty.childType(zcu), elem_ptr, .{ .is_volatile = slice_ty.isVolatilePtr(zcu) });
4857 }
4858
4859 fn ptrElemPtr(self: *NavGen, ptr_ty: Type, ptr_id: Id, index_id: Id) !Id {
4860 const zcu = self.pt.zcu;
4861 // Construct new pointer type for the resulting pointer
4862 const elem_ty = ptr_ty.elemType2(zcu); // use elemType() so that we get T for *[N]T.
4863 const elem_ptr_ty_id = try self.ptrType(elem_ty, self.spvStorageClass(ptr_ty.ptrAddressSpace(zcu)), .indirect);
4864 if (ptr_ty.isSinglePointer(zcu)) {
4865 // Pointer-to-array. In this case, the resulting pointer is not of the same type
4866 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.
4867 return try self.accessChainId(elem_ptr_ty_id, ptr_id, &.{index_id});
4868 } else {
4869 // Resulting pointer type is the same as the ptr_ty, so use ptrAccessChain
4870 return try self.ptrAccessChain(elem_ptr_ty_id, ptr_id, index_id, &.{});
4871 }
4872 }
4873
4874 fn airPtrElemPtr(self: *NavGen, inst: Air.Inst.Index) !?Id {
4875 const pt = self.pt;
4876 const zcu = pt.zcu;
4877 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
4878 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
4879 const src_ptr_ty = self.typeOf(bin_op.lhs);
4880 const elem_ty = src_ptr_ty.childType(zcu);
4881 const ptr_id = try self.resolve(bin_op.lhs);
4882
4883 if (!elem_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
4884 const dst_ptr_ty = self.typeOfIndex(inst);
4885 return try self.bitCast(dst_ptr_ty, src_ptr_ty, ptr_id);
4886 }
4887
4888 const index_id = try self.resolve(bin_op.rhs);
4889 return try self.ptrElemPtr(src_ptr_ty, ptr_id, index_id);
4890 }
4891
4892 fn airArrayElemVal(self: *NavGen, inst: Air.Inst.Index) !?Id {
4893 const zcu = self.pt.zcu;
4894 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4895 const array_ty = self.typeOf(bin_op.lhs);
4896 const elem_ty = array_ty.childType(zcu);
4897 const array_id = try self.resolve(bin_op.lhs);
4898 const index_id = try self.resolve(bin_op.rhs);
4899
4900 // SPIR-V doesn't have an array indexing function for some damn reason.
4901 // For now, just generate a temporary and use that.
4902 // TODO: This backend probably also should use isByRef from llvm...
4903
4904 const is_vector = array_ty.isVector(zcu);
4905
4906 const elem_repr: Repr = if (is_vector) .direct else .indirect;
4907 const ptr_array_ty_id = try self.ptrType(array_ty, .function, .direct);
4908 const ptr_elem_ty_id = try self.ptrType(elem_ty, .function, elem_repr);
4909
4910 const tmp_id = self.spv.allocId();
4911 try self.func.prologue.emit(self.spv.gpa, .OpVariable, .{
4912 .id_result_type = ptr_array_ty_id,
4913 .id_result = tmp_id,
4914 .storage_class = .function,
4915 });
4916
4917 try self.func.body.emit(self.spv.gpa, .OpStore, .{
4918 .pointer = tmp_id,
4919 .object = array_id,
4920 });
4921
4922 const elem_ptr_id = try self.accessChainId(ptr_elem_ty_id, tmp_id, &.{index_id});
4923
4924 const result_id = self.spv.allocId();
4925 try self.func.body.emit(self.spv.gpa, .OpLoad, .{
4926 .id_result_type = try self.resolveType(elem_ty, elem_repr),
4927 .id_result = result_id,
4928 .pointer = elem_ptr_id,
4929 });
4930
4931 if (is_vector) {
4932 // Result is already in direct representation
4933 return result_id;
4934 }
4935
4936 // This is an array type; the elements are stored in indirect representation.
4937 // We have to convert the type to direct.
4938
4939 return try self.convertToDirect(elem_ty, result_id);
4940 }
4941
4942 fn airPtrElemVal(self: *NavGen, inst: Air.Inst.Index) !?Id {
4943 const zcu = self.pt.zcu;
4944 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4945 const ptr_ty = self.typeOf(bin_op.lhs);
4946 const elem_ty = self.typeOfIndex(inst);
4947 const ptr_id = try self.resolve(bin_op.lhs);
4948 const index_id = try self.resolve(bin_op.rhs);
4949 const elem_ptr_id = try self.ptrElemPtr(ptr_ty, ptr_id, index_id);
4950 return try self.load(elem_ty, elem_ptr_id, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
4951 }
4952
4953 fn airVectorStoreElem(self: *NavGen, inst: Air.Inst.Index) !void {
4954 const zcu = self.pt.zcu;
4955 const data = self.air.instructions.items(.data)[@intFromEnum(inst)].vector_store_elem;
4956 const extra = self.air.extraData(Air.Bin, data.payload).data;
4957
4958 const vector_ptr_ty = self.typeOf(data.vector_ptr);
4959 const vector_ty = vector_ptr_ty.childType(zcu);
4960 const scalar_ty = vector_ty.scalarType(zcu);
4961
4962 const storage_class = self.spvStorageClass(vector_ptr_ty.ptrAddressSpace(zcu));
4963 const scalar_ptr_ty_id = try self.ptrType(scalar_ty, storage_class, .indirect);
4964
4965 const vector_ptr = try self.resolve(data.vector_ptr);
4966 const index = try self.resolve(extra.lhs);
4967 const operand = try self.resolve(extra.rhs);
4968
4969 const elem_ptr_id = try self.accessChainId(scalar_ptr_ty_id, vector_ptr, &.{index});
4970 try self.store(scalar_ty, elem_ptr_id, operand, .{
4971 .is_volatile = vector_ptr_ty.isVolatilePtr(zcu),
4972 });
4973 }
4974
4975 fn airSetUnionTag(self: *NavGen, inst: Air.Inst.Index) !void {
4976 const zcu = self.pt.zcu;
4977 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
4978 const un_ptr_ty = self.typeOf(bin_op.lhs);
4979 const un_ty = un_ptr_ty.childType(zcu);
4980 const layout = self.unionLayout(un_ty);
4981
4982 if (layout.tag_size == 0) return;
4983
4984 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
4985 const tag_ptr_ty_id = try self.ptrType(tag_ty, self.spvStorageClass(un_ptr_ty.ptrAddressSpace(zcu)), .indirect);
4986
4987 const union_ptr_id = try self.resolve(bin_op.lhs);
4988 const new_tag_id = try self.resolve(bin_op.rhs);
4989
4990 if (!layout.has_payload) {
4991 try self.store(tag_ty, union_ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4992 } else {
4993 const ptr_id = try self.accessChain(tag_ptr_ty_id, union_ptr_id, &.{layout.tag_index});
4994 try self.store(tag_ty, ptr_id, new_tag_id, .{ .is_volatile = un_ptr_ty.isVolatilePtr(zcu) });
4995 }
4996 }
4997
4998 fn airGetUnionTag(self: *NavGen, inst: Air.Inst.Index) !?Id {
4999 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5000 const un_ty = self.typeOf(ty_op.operand);
5001
5002 const zcu = self.pt.zcu;
5003 const layout = self.unionLayout(un_ty);
5004 if (layout.tag_size == 0) return null;
5005
5006 const union_handle = try self.resolve(ty_op.operand);
5007 if (!layout.has_payload) return union_handle;
5008
5009 const tag_ty = un_ty.unionTagTypeSafety(zcu).?;
5010 return try self.extractField(tag_ty, union_handle, layout.tag_index);
5011 }
5012
5013 fn unionInit(
5014 self: *NavGen,
5015 ty: Type,
5016 active_field: u32,
5017 payload: ?Id,
5018 ) !Id {
5019 // To initialize a union, generate a temporary variable with the
5020 // union type, then get the field pointer and pointer-cast it to the
5021 // right type to store it. Finally load the entire union.
5022
5023 // Note: The result here is not cached, because it generates runtime code.
5024
5025 const pt = self.pt;
5026 const zcu = pt.zcu;
5027 const ip = &zcu.intern_pool;
5028 const union_ty = zcu.typeToUnion(ty).?;
5029 const tag_ty = Type.fromInterned(union_ty.enum_tag_ty);
5030
5031 const layout = self.unionLayout(ty);
5032 const payload_ty = Type.fromInterned(union_ty.field_types.get(ip)[active_field]);
5033
5034 if (union_ty.flagsUnordered(ip).layout == .@"packed") {
5035 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5036 const int_ty = try pt.intType(.unsigned, @intCast(ty.bitSize(zcu)));
5037 return self.constInt(int_ty, 0);
5038 }
5039
5040 assert(payload != null);
5041 if (payload_ty.isInt(zcu)) {
5042 if (ty.bitSize(zcu) == payload_ty.bitSize(zcu)) {
5043 return self.bitCast(ty, payload_ty, payload.?);
5044 }
5045
5046 const trunc = try self.buildConvert(ty, .{ .ty = payload_ty, .value = .{ .singleton = payload.? } });
5047 return try trunc.materialize(self);
5048 }
5049
5050 const payload_int_ty = try pt.intType(.unsigned, @intCast(payload_ty.bitSize(zcu)));
5051 const payload_int = if (payload_ty.ip_index == .bool_type)
5052 try self.convertToIndirect(payload_ty, payload.?)
5053 else
5054 try self.bitCast(payload_int_ty, payload_ty, payload.?);
5055 const trunc = try self.buildConvert(ty, .{ .ty = payload_int_ty, .value = .{ .singleton = payload_int } });
5056 return try trunc.materialize(self);
5057 }
5058
5059 const tag_int = if (layout.tag_size != 0) blk: {
5060 const tag_val = try pt.enumValueFieldIndex(tag_ty, active_field);
5061 const tag_int_val = try tag_val.intFromEnum(tag_ty, pt);
5062 break :blk tag_int_val.toUnsignedInt(zcu);
5063 } else 0;
5064
5065 if (!layout.has_payload) {
5066 return try self.constInt(tag_ty, tag_int);
5067 }
5068
5069 const tmp_id = try self.alloc(ty, .{ .storage_class = .function });
5070
5071 if (layout.tag_size != 0) {
5072 const tag_ptr_ty_id = try self.ptrType(tag_ty, .function, .indirect);
5073 const ptr_id = try self.accessChain(tag_ptr_ty_id, tmp_id, &.{@as(u32, @intCast(layout.tag_index))});
5074 const tag_id = try self.constInt(tag_ty, tag_int);
5075 try self.store(tag_ty, ptr_id, tag_id, .{});
5076 }
5077
5078 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5079 const pl_ptr_ty_id = try self.ptrType(layout.payload_ty, .function, .indirect);
5080 const pl_ptr_id = try self.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
5081 const active_pl_ptr_id = if (!layout.payload_ty.eql(payload_ty, zcu)) blk: {
5082 const active_pl_ptr_ty_id = try self.ptrType(payload_ty, .function, .indirect);
5083 const active_pl_ptr_id = self.spv.allocId();
5084 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
5085 .id_result_type = active_pl_ptr_ty_id,
5086 .id_result = active_pl_ptr_id,
5087 .operand = pl_ptr_id,
5088 });
5089 break :blk active_pl_ptr_id;
5090 } else pl_ptr_id;
5091
5092 try self.store(payload_ty, active_pl_ptr_id, payload.?, .{});
5093 } else {
5094 assert(payload == null);
5095 }
5096
5097 // Just leave the padding fields uninitialized...
5098 // TODO: Or should we initialize them with undef explicitly?
5099
5100 return try self.load(ty, tmp_id, .{});
5101 }
5102
5103 fn airUnionInit(self: *NavGen, inst: Air.Inst.Index) !?Id {
5104 const pt = self.pt;
5105 const zcu = pt.zcu;
5106 const ip = &zcu.intern_pool;
5107 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5108 const extra = self.air.extraData(Air.UnionInit, ty_pl.payload).data;
5109 const ty = self.typeOfIndex(inst);
5110
5111 const union_obj = zcu.typeToUnion(ty).?;
5112 const field_ty = Type.fromInterned(union_obj.field_types.get(ip)[extra.field_index]);
5113 const payload = if (field_ty.hasRuntimeBitsIgnoreComptime(zcu))
5114 try self.resolve(extra.init)
5115 else
5116 null;
5117 return try self.unionInit(ty, extra.field_index, payload);
5118 }
5119
5120 fn airStructFieldVal(self: *NavGen, inst: Air.Inst.Index) !?Id {
5121 const pt = self.pt;
5122 const zcu = pt.zcu;
5123 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5124 const struct_field = self.air.extraData(Air.StructField, ty_pl.payload).data;
5125
5126 const object_ty = self.typeOf(struct_field.struct_operand);
5127 const object_id = try self.resolve(struct_field.struct_operand);
5128 const field_index = struct_field.field_index;
5129 const field_ty = object_ty.fieldType(field_index, zcu);
5130
5131 if (!field_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
5132
5133 switch (object_ty.zigTypeTag(zcu)) {
5134 .@"struct" => switch (object_ty.containerLayout(zcu)) {
5135 .@"packed" => {
5136 const struct_ty = zcu.typeToPackedStruct(object_ty).?;
5137 const bit_offset = zcu.structPackedFieldBitOffset(struct_ty, field_index);
5138 const bit_offset_id = try self.constInt(.u16, bit_offset);
5139 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
5140 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
5141 const field_int_ty = try pt.intType(signedness, field_bit_size);
5142 const shift_lhs: Temporary = .{ .ty = object_ty, .value = .{ .singleton = object_id } };
5143 const shift = try self.buildBinary(.srl, shift_lhs, .{ .ty = .u16, .value = .{ .singleton = bit_offset_id } });
5144 const mask_id = try self.constInt(object_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
5145 const masked = try self.buildBinary(.bit_and, shift, .{ .ty = object_ty, .value = .{ .singleton = mask_id } });
5146 const result_id = blk: {
5147 if (self.backingIntBits(field_bit_size).@"0" == self.backingIntBits(@intCast(object_ty.bitSize(zcu))).@"0")
5148 break :blk try self.bitCast(field_int_ty, object_ty, try masked.materialize(self));
5149 const trunc = try self.buildConvert(field_int_ty, masked);
5150 break :blk try trunc.materialize(self);
5151 };
5152 if (field_ty.ip_index == .bool_type) return try self.convertToDirect(.bool, result_id);
5153 if (field_ty.isInt(zcu)) return result_id;
5154 return try self.bitCast(field_ty, field_int_ty, result_id);
5155 },
5156 else => return try self.extractField(field_ty, object_id, field_index),
5157 },
5158 .@"union" => switch (object_ty.containerLayout(zcu)) {
5159 .@"packed" => {
5160 const backing_int_ty = try pt.intType(.unsigned, @intCast(object_ty.bitSize(zcu)));
5161 const signedness = if (field_ty.isInt(zcu)) field_ty.intInfo(zcu).signedness else .unsigned;
5162 const field_bit_size: u16 = @intCast(field_ty.bitSize(zcu));
5163 const int_ty = try pt.intType(signedness, field_bit_size);
5164 const mask_id = try self.constInt(backing_int_ty, (@as(u64, 1) << @as(u6, @intCast(field_bit_size))) - 1);
5165 const masked = try self.buildBinary(
5166 .bit_and,
5167 .{ .ty = backing_int_ty, .value = .{ .singleton = object_id } },
5168 .{ .ty = backing_int_ty, .value = .{ .singleton = mask_id } },
5169 );
5170 const result_id = blk: {
5171 if (self.backingIntBits(field_bit_size).@"0" == self.backingIntBits(@intCast(backing_int_ty.bitSize(zcu))).@"0")
5172 break :blk try self.bitCast(int_ty, backing_int_ty, try masked.materialize(self));
5173 const trunc = try self.buildConvert(int_ty, masked);
5174 break :blk try trunc.materialize(self);
5175 };
5176 if (field_ty.ip_index == .bool_type) return try self.convertToDirect(.bool, result_id);
5177 if (field_ty.isInt(zcu)) return result_id;
5178 return try self.bitCast(field_ty, int_ty, result_id);
5179 },
5180 else => {
5181 // Store, ptr-elem-ptr, pointer-cast, load
5182 const layout = self.unionLayout(object_ty);
5183 assert(layout.has_payload);
5184
5185 const tmp_id = try self.alloc(object_ty, .{ .storage_class = .function });
5186 try self.store(object_ty, tmp_id, object_id, .{});
5187
5188 const pl_ptr_ty_id = try self.ptrType(layout.payload_ty, .function, .indirect);
5189 const pl_ptr_id = try self.accessChain(pl_ptr_ty_id, tmp_id, &.{layout.payload_index});
5190
5191 const active_pl_ptr_ty_id = try self.ptrType(field_ty, .function, .indirect);
5192 const active_pl_ptr_id = self.spv.allocId();
5193 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
5194 .id_result_type = active_pl_ptr_ty_id,
5195 .id_result = active_pl_ptr_id,
5196 .operand = pl_ptr_id,
5197 });
5198 return try self.load(field_ty, active_pl_ptr_id, .{});
5199 },
5200 },
5201 else => unreachable,
5202 }
5203 }
5204
5205 fn airFieldParentPtr(self: *NavGen, inst: Air.Inst.Index) !?Id {
5206 const pt = self.pt;
5207 const zcu = pt.zcu;
5208 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5209 const extra = self.air.extraData(Air.FieldParentPtr, ty_pl.payload).data;
5210
5211 const parent_ty = ty_pl.ty.toType().childType(zcu);
5212 const result_ty_id = try self.resolveType(ty_pl.ty.toType(), .indirect);
5213
5214 const field_ptr = try self.resolve(extra.field_ptr);
5215 const field_ptr_int = try self.intFromPtr(field_ptr);
5216 const field_offset = parent_ty.structFieldOffset(extra.field_index, zcu);
5217
5218 const base_ptr_int = base_ptr_int: {
5219 if (field_offset == 0) break :base_ptr_int field_ptr_int;
5220
5221 const field_offset_id = try self.constInt(Type.usize, field_offset);
5222 const field_ptr_tmp = Temporary.init(Type.usize, field_ptr_int);
5223 const field_offset_tmp = Temporary.init(Type.usize, field_offset_id);
5224 const result = try self.buildBinary(.i_sub, field_ptr_tmp, field_offset_tmp);
5225 break :base_ptr_int try result.materialize(self);
5226 };
5227
5228 const base_ptr = self.spv.allocId();
5229 try self.func.body.emit(self.spv.gpa, .OpConvertUToPtr, .{
5230 .id_result_type = result_ty_id,
5231 .id_result = base_ptr,
5232 .integer_value = base_ptr_int,
5233 });
5234
5235 return base_ptr;
5236 }
5237
5238 fn structFieldPtr(
5239 self: *NavGen,
5240 result_ptr_ty: Type,
5241 object_ptr_ty: Type,
5242 object_ptr: Id,
5243 field_index: u32,
5244 ) !Id {
5245 const result_ty_id = try self.resolveType(result_ptr_ty, .direct);
5246
5247 const zcu = self.pt.zcu;
5248 const object_ty = object_ptr_ty.childType(zcu);
5249 switch (object_ty.zigTypeTag(zcu)) {
5250 .pointer => {
5251 assert(object_ty.isSlice(zcu));
5252 return self.accessChain(result_ty_id, object_ptr, &.{field_index});
5253 },
5254 .@"struct" => switch (object_ty.containerLayout(zcu)) {
5255 .@"packed" => return self.todo("implement field access for packed structs", .{}),
5256 else => {
5257 return try self.accessChain(result_ty_id, object_ptr, &.{field_index});
5258 },
5259 },
5260 .@"union" => {
5261 const layout = self.unionLayout(object_ty);
5262 if (!layout.has_payload) {
5263 // Asked to get a pointer to a zero-sized field. Just lower this
5264 // to undefined, there is no reason to make it be a valid pointer.
5265 return try self.spv.constUndef(result_ty_id);
5266 }
5267
5268 const storage_class = self.spvStorageClass(object_ptr_ty.ptrAddressSpace(zcu));
5269 const pl_ptr_ty_id = try self.ptrType(layout.payload_ty, storage_class, .indirect);
5270 const pl_ptr_id = blk: {
5271 if (object_ty.containerLayout(zcu) == .@"packed") break :blk object_ptr;
5272 break :blk try self.accessChain(pl_ptr_ty_id, object_ptr, &.{layout.payload_index});
5273 };
5274
5275 const active_pl_ptr_id = self.spv.allocId();
5276 try self.func.body.emit(self.spv.gpa, .OpBitcast, .{
5277 .id_result_type = result_ty_id,
5278 .id_result = active_pl_ptr_id,
5279 .operand = pl_ptr_id,
5280 });
5281 return active_pl_ptr_id;
5282 },
5283 else => unreachable,
5284 }
5285 }
5286
5287 fn airStructFieldPtrIndex(self: *NavGen, inst: Air.Inst.Index, field_index: u32) !?Id {
5288 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5289 const struct_ptr = try self.resolve(ty_op.operand);
5290 const struct_ptr_ty = self.typeOf(ty_op.operand);
5291 const result_ptr_ty = self.typeOfIndex(inst);
5292 return try self.structFieldPtr(result_ptr_ty, struct_ptr_ty, struct_ptr, field_index);
5293 }
5294
5295 const AllocOptions = struct {
5296 initializer: ?Id = null,
5297 /// The final storage class of the pointer. This may be either `.Generic` or `.Function`.
5298 /// In either case, the local is allocated in the `.Function` storage class, and optionally
5299 /// cast back to `.Generic`.
5300 storage_class: StorageClass,
5301 };
5302
5303 // Allocate a function-local variable, with possible initializer.
5304 // This function returns a pointer to a variable of type `ty`,
5305 // which is in the Generic address space. The variable is actually
5306 // placed in the Function address space.
5307 fn alloc(
5308 self: *NavGen,
5309 ty: Type,
5310 options: AllocOptions,
5311 ) !Id {
5312 const ptr_fn_ty_id = try self.ptrType(ty, .function, .indirect);
5313
5314 // SPIR-V requires that OpVariable declarations for locals go into the first block, so we are just going to
5315 // directly generate them into func.prologue instead of the body.
5316 const var_id = self.spv.allocId();
5317 try self.func.prologue.emit(self.spv.gpa, .OpVariable, .{
5318 .id_result_type = ptr_fn_ty_id,
5319 .id_result = var_id,
5320 .storage_class = .function,
5321 .initializer = options.initializer,
5322 });
5323
5324 switch (self.spv.target.os.tag) {
5325 .vulkan, .opengl => return var_id,
5326 else => {},
5327 }
5328
5329 switch (options.storage_class) {
5330 .generic => {
5331 const ptr_gn_ty_id = try self.ptrType(ty, .generic, .indirect);
5332 // Convert to a generic pointer
5333 return self.castToGeneric(ptr_gn_ty_id, var_id);
5334 },
5335 .function => return var_id,
5336 else => unreachable,
5337 }
5338 }
5339
5340 fn airAlloc(self: *NavGen, inst: Air.Inst.Index) !?Id {
5341 const zcu = self.pt.zcu;
5342 const ptr_ty = self.typeOfIndex(inst);
5343 const child_ty = ptr_ty.childType(zcu);
5344 return try self.alloc(child_ty, .{
5345 .storage_class = self.spvStorageClass(ptr_ty.ptrAddressSpace(zcu)),
5346 });
5347 }
5348
5349 fn airArg(self: *NavGen) Id {
5350 defer self.next_arg_index += 1;
5351 return self.args.items[self.next_arg_index];
5352 }
5353
5354 /// Given a slice of incoming block connections, returns the block-id of the next
5355 /// block to jump to. This function emits instructions, so it should be emitted
5356 /// inside the merge block of the block.
5357 /// This function should only be called with structured control flow generation.
5358 fn structuredNextBlock(self: *NavGen, incoming: []const ControlFlow.Structured.Block.Incoming) !Id {
5359 assert(self.control_flow == .structured);
5360
5361 const result_id = self.spv.allocId();
5362 const block_id_ty_id = try self.resolveType(Type.u32, .direct);
5363 try self.func.body.emitRaw(self.spv.gpa, .OpPhi, @intCast(2 + incoming.len * 2)); // result type + result + variable/parent...
5364 self.func.body.writeOperand(spec.Id, block_id_ty_id);
5365 self.func.body.writeOperand(spec.Id, result_id);
5366
5367 for (incoming) |incoming_block| {
5368 self.func.body.writeOperand(spec.PairIdRefIdRef, .{ incoming_block.next_block, incoming_block.src_label });
5369 }
5370
5371 return result_id;
5372 }
5373
5374 /// Jumps to the block with the target block-id. This function must only be called when
5375 /// terminating a body, there should be no instructions after it.
5376 /// This function should only be called with structured control flow generation.
5377 fn structuredBreak(self: *NavGen, target_block: Id) !void {
5378 assert(self.control_flow == .structured);
5379
5380 const sblock = self.control_flow.structured.block_stack.getLast();
5381 const merge_block = switch (sblock.*) {
5382 .selection => |*merge| blk: {
5383 const merge_label = self.spv.allocId();
5384 try merge.merge_stack.append(self.gpa, .{
5385 .incoming = .{
5386 .src_label = self.current_block_label,
5387 .next_block = target_block,
5388 },
5389 .merge_block = merge_label,
5390 });
5391 break :blk merge_label;
5392 },
5393 // Loop blocks do not end in a break. Not through a direct break,
5394 // and also not through another instruction like cond_br or unreachable (these
5395 // situations are replaced by `cond_br` in sema, or there is a `block` instruction
5396 // placed around them).
5397 .loop => unreachable,
5398 };
5399
5400 try self.func.body.emitBranch(self.spv.gpa, merge_block);
5401 }
5402
5403 /// Generate a body in a way that exits the body using only structured constructs.
5404 /// Returns the block-id of the next block to jump to. After this function, a jump
5405 /// should still be emitted to the block that should follow this structured body.
5406 /// This function should only be called with structured control flow generation.
5407 fn genStructuredBody(
5408 self: *NavGen,
5409 /// This parameter defines the method that this structured body is exited with.
5410 block_merge_type: union(enum) {
5411 /// Using selection; early exits from this body are surrounded with
5412 /// if() statements.
5413 selection,
5414 /// Using loops; loops can be early exited by jumping to the merge block at
5415 /// any time.
5416 loop: struct {
5417 merge_label: Id,
5418 continue_label: Id,
5419 },
5420 },
5421 body: []const Air.Inst.Index,
5422 ) !Id {
5423 assert(self.control_flow == .structured);
5424
5425 var sblock: ControlFlow.Structured.Block = switch (block_merge_type) {
5426 .loop => |merge| .{ .loop = .{
5427 .merge_block = merge.merge_label,
5428 } },
5429 .selection => .{ .selection = .{} },
5430 };
5431 defer sblock.deinit(self.gpa);
5432
5433 {
5434 try self.control_flow.structured.block_stack.append(self.gpa, &sblock);
5435 defer _ = self.control_flow.structured.block_stack.pop();
5436
5437 try self.genBody(body);
5438 }
5439
5440 switch (sblock) {
5441 .selection => |merge| {
5442 // Now generate the merge block for all merges that
5443 // still need to be performed.
5444 const merge_stack = merge.merge_stack.items;
5445
5446 // If no merges on the stack, this block didn't generate any jumps (all paths
5447 // ended with a return or an unreachable). In that case, we don't need to do
5448 // any merging.
5449 if (merge_stack.len == 0) {
5450 // We still need to return a value of a next block to jump to.
5451 // For example, if we have code like
5452 // if (x) {
5453 // if (y) return else return;
5454 // } else {}
5455 // then we still need the outer to have an OpSelectionMerge and consequently
5456 // a phi node. In that case we can just return bogus, since we know that its
5457 // path will never be taken.
5458
5459 // Make sure that we are still in a block when exiting the function.
5460 // TODO: Can we get rid of that?
5461 try self.beginSpvBlock(self.spv.allocId());
5462 const block_id_ty_id = try self.resolveType(Type.u32, .direct);
5463 return try self.spv.constUndef(block_id_ty_id);
5464 }
5465
5466 // The top-most merge actually only has a single source, the
5467 // final jump of the block, or the merge block of a sub-block, cond_br,
5468 // or loop. Therefore we just need to generate a block with a jump to the
5469 // next merge block.
5470 try self.beginSpvBlock(merge_stack[merge_stack.len - 1].merge_block);
5471
5472 // Now generate a merge ladder for the remaining merges in the stack.
5473 var incoming = ControlFlow.Structured.Block.Incoming{
5474 .src_label = self.current_block_label,
5475 .next_block = merge_stack[merge_stack.len - 1].incoming.next_block,
5476 };
5477 var i = merge_stack.len - 1;
5478 while (i > 0) {
5479 i -= 1;
5480 const step = merge_stack[i];
5481 try self.func.body.emitBranch(self.spv.gpa, step.merge_block);
5482 try self.beginSpvBlock(step.merge_block);
5483 const next_block = try self.structuredNextBlock(&.{ incoming, step.incoming });
5484 incoming = .{
5485 .src_label = step.merge_block,
5486 .next_block = next_block,
5487 };
5488 }
5489
5490 return incoming.next_block;
5491 },
5492 .loop => |merge| {
5493 // Close the loop by jumping to the continue label
5494 try self.func.body.emitBranch(self.spv.gpa, block_merge_type.loop.continue_label);
5495 // For blocks we must simple merge all the incoming blocks to get the next block.
5496 try self.beginSpvBlock(merge.merge_block);
5497 return try self.structuredNextBlock(merge.merges.items);
5498 },
5499 }
5500 }
5501
5502 fn airBlock(self: *NavGen, inst: Air.Inst.Index) !?Id {
5503 const inst_datas = self.air.instructions.items(.data);
5504 const extra = self.air.extraData(Air.Block, inst_datas[@intFromEnum(inst)].ty_pl.payload);
5505 return self.lowerBlock(inst, @ptrCast(self.air.extra.items[extra.end..][0..extra.data.body_len]));
5506 }
5507
5508 fn lowerBlock(self: *NavGen, inst: Air.Inst.Index, body: []const Air.Inst.Index) !?Id {
5509 // In AIR, a block doesn't really define an entry point like a block, but
5510 // more like a scope that breaks can jump out of and "return" a value from.
5511 // This cannot be directly modelled in SPIR-V, so in a block instruction,
5512 // we're going to split up the current block by first generating the code
5513 // of the block, then a label, and then generate the rest of the current
5514 // ir.Block in a different SPIR-V block.
5515
5516 const pt = self.pt;
5517 const zcu = pt.zcu;
5518 const ty = self.typeOfIndex(inst);
5519 const have_block_result = ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu);
5520
5521 const cf = switch (self.control_flow) {
5522 .structured => |*cf| cf,
5523 .unstructured => |*cf| {
5524 var block = ControlFlow.Unstructured.Block{};
5525 defer block.incoming_blocks.deinit(self.gpa);
5526
5527 // 4 chosen as arbitrary initial capacity.
5528 try block.incoming_blocks.ensureUnusedCapacity(self.gpa, 4);
5529
5530 try cf.blocks.putNoClobber(self.gpa, inst, &block);
5531 defer assert(cf.blocks.remove(inst));
5532
5533 try self.genBody(body);
5534
5535 // Only begin a new block if there were actually any breaks towards it.
5536 if (block.label) |label| {
5537 try self.beginSpvBlock(label);
5538 }
5539
5540 if (!have_block_result)
5541 return null;
5542
5543 assert(block.label != null);
5544 const result_id = self.spv.allocId();
5545 const result_type_id = try self.resolveType(ty, .direct);
5546
5547 try self.func.body.emitRaw(
5548 self.spv.gpa,
5549 .OpPhi,
5550 // result type + result + variable/parent...
5551 2 + @as(u16, @intCast(block.incoming_blocks.items.len * 2)),
5552 );
5553 self.func.body.writeOperand(spec.Id, result_type_id);
5554 self.func.body.writeOperand(spec.Id, result_id);
5555
5556 for (block.incoming_blocks.items) |incoming| {
5557 self.func.body.writeOperand(
5558 spec.PairIdRefIdRef,
5559 .{ incoming.break_value_id, incoming.src_label },
5560 );
5561 }
5562
5563 return result_id;
5564 },
5565 };
5566
5567 const maybe_block_result_var_id = if (have_block_result) blk: {
5568 const block_result_var_id = try self.alloc(ty, .{ .storage_class = .function });
5569 try cf.block_results.putNoClobber(self.gpa, inst, block_result_var_id);
5570 break :blk block_result_var_id;
5571 } else null;
5572 defer if (have_block_result) assert(cf.block_results.remove(inst));
5573
5574 const next_block = try self.genStructuredBody(.selection, body);
5575
5576 // When encountering a block instruction, we are always at least in the function's scope,
5577 // so there always has to be another entry.
5578 assert(cf.block_stack.items.len > 0);
5579
5580 // Check if the target of the branch was this current block.
5581 const this_block = try self.constInt(Type.u32, @intFromEnum(inst));
5582 const jump_to_this_block_id = self.spv.allocId();
5583 const bool_ty_id = try self.resolveType(Type.bool, .direct);
5584 try self.func.body.emit(self.spv.gpa, .OpIEqual, .{
5585 .id_result_type = bool_ty_id,
5586 .id_result = jump_to_this_block_id,
5587 .operand_1 = next_block,
5588 .operand_2 = this_block,
5589 });
5590
5591 const sblock = cf.block_stack.getLast();
5592
5593 if (ty.isNoReturn(zcu)) {
5594 // If this block is noreturn, this instruction is the last of a block,
5595 // and we must simply jump to the block's merge unconditionally.
5596 try self.structuredBreak(next_block);
5597 } else {
5598 switch (sblock.*) {
5599 .selection => |*merge| {
5600 // To jump out of a selection block, push a new entry onto its merge stack and
5601 // generate a conditional branch to there and to the instructions following this block.
5602 const merge_label = self.spv.allocId();
5603 const then_label = self.spv.allocId();
5604 try self.func.body.emit(self.spv.gpa, .OpSelectionMerge, .{
5605 .merge_block = merge_label,
5606 .selection_control = .{},
5607 });
5608 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
5609 .condition = jump_to_this_block_id,
5610 .true_label = then_label,
5611 .false_label = merge_label,
5612 });
5613 try merge.merge_stack.append(self.gpa, .{
5614 .incoming = .{
5615 .src_label = self.current_block_label,
5616 .next_block = next_block,
5617 },
5618 .merge_block = merge_label,
5619 });
5620
5621 try self.beginSpvBlock(then_label);
5622 },
5623 .loop => |*merge| {
5624 // To jump out of a loop block, generate a conditional that exits the block
5625 // to the loop merge if the target ID is not the one of this block.
5626 const continue_label = self.spv.allocId();
5627 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
5628 .condition = jump_to_this_block_id,
5629 .true_label = continue_label,
5630 .false_label = merge.merge_block,
5631 });
5632 try merge.merges.append(self.gpa, .{
5633 .src_label = self.current_block_label,
5634 .next_block = next_block,
5635 });
5636 try self.beginSpvBlock(continue_label);
5637 },
5638 }
5639 }
5640
5641 if (maybe_block_result_var_id) |block_result_var_id| {
5642 return try self.load(ty, block_result_var_id, .{});
5643 }
5644
5645 return null;
5646 }
5647
5648 fn airBr(self: *NavGen, inst: Air.Inst.Index) !void {
5649 const zcu = self.pt.zcu;
5650 const br = self.air.instructions.items(.data)[@intFromEnum(inst)].br;
5651 const operand_ty = self.typeOf(br.operand);
5652
5653 switch (self.control_flow) {
5654 .structured => |*cf| {
5655 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5656 const operand_id = try self.resolve(br.operand);
5657 const block_result_var_id = cf.block_results.get(br.block_inst).?;
5658 try self.store(operand_ty, block_result_var_id, operand_id, .{});
5659 }
5660
5661 const next_block = try self.constInt(Type.u32, @intFromEnum(br.block_inst));
5662 try self.structuredBreak(next_block);
5663 },
5664 .unstructured => |cf| {
5665 const block = cf.blocks.get(br.block_inst).?;
5666 if (operand_ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) {
5667 const operand_id = try self.resolve(br.operand);
5668 // current_block_label should not be undefined here, lest there
5669 // is a br or br_void in the function's body.
5670 try block.incoming_blocks.append(self.gpa, .{
5671 .src_label = self.current_block_label,
5672 .break_value_id = operand_id,
5673 });
5674 }
5675
5676 if (block.label == null) {
5677 block.label = self.spv.allocId();
5678 }
5679
5680 try self.func.body.emitBranch(self.spv.gpa, block.label.?);
5681 },
5682 }
5683 }
5684
5685 fn airCondBr(self: *NavGen, inst: Air.Inst.Index) !void {
5686 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5687 const cond_br = self.air.extraData(Air.CondBr, pl_op.payload);
5688 const then_body: []const Air.Inst.Index = @ptrCast(self.air.extra.items[cond_br.end..][0..cond_br.data.then_body_len]);
5689 const else_body: []const Air.Inst.Index = @ptrCast(self.air.extra.items[cond_br.end + then_body.len ..][0..cond_br.data.else_body_len]);
5690 const condition_id = try self.resolve(pl_op.operand);
5691
5692 const then_label = self.spv.allocId();
5693 const else_label = self.spv.allocId();
5694
5695 switch (self.control_flow) {
5696 .structured => {
5697 const merge_label = self.spv.allocId();
5698
5699 try self.func.body.emit(self.spv.gpa, .OpSelectionMerge, .{
5700 .merge_block = merge_label,
5701 .selection_control = .{},
5702 });
5703 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
5704 .condition = condition_id,
5705 .true_label = then_label,
5706 .false_label = else_label,
5707 });
5708
5709 try self.beginSpvBlock(then_label);
5710 const then_next = try self.genStructuredBody(.selection, then_body);
5711 const then_incoming = ControlFlow.Structured.Block.Incoming{
5712 .src_label = self.current_block_label,
5713 .next_block = then_next,
5714 };
5715 try self.func.body.emitBranch(self.spv.gpa, merge_label);
5716
5717 try self.beginSpvBlock(else_label);
5718 const else_next = try self.genStructuredBody(.selection, else_body);
5719 const else_incoming = ControlFlow.Structured.Block.Incoming{
5720 .src_label = self.current_block_label,
5721 .next_block = else_next,
5722 };
5723 try self.func.body.emitBranch(self.spv.gpa, merge_label);
5724
5725 try self.beginSpvBlock(merge_label);
5726 const next_block = try self.structuredNextBlock(&.{ then_incoming, else_incoming });
5727
5728 try self.structuredBreak(next_block);
5729 },
5730 .unstructured => {
5731 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
5732 .condition = condition_id,
5733 .true_label = then_label,
5734 .false_label = else_label,
5735 });
5736
5737 try self.beginSpvBlock(then_label);
5738 try self.genBody(then_body);
5739 try self.beginSpvBlock(else_label);
5740 try self.genBody(else_body);
5741 },
5742 }
5743 }
5744
5745 fn airLoop(self: *NavGen, inst: Air.Inst.Index) !void {
5746 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
5747 const loop = self.air.extraData(Air.Block, ty_pl.payload);
5748 const body: []const Air.Inst.Index = @ptrCast(self.air.extra.items[loop.end..][0..loop.data.body_len]);
5749
5750 const body_label = self.spv.allocId();
5751
5752 switch (self.control_flow) {
5753 .structured => {
5754 const header_label = self.spv.allocId();
5755 const merge_label = self.spv.allocId();
5756 const continue_label = self.spv.allocId();
5757
5758 // The back-edge must point to the loop header, so generate a separate block for the
5759 // loop header so that we don't accidentally include some instructions from there
5760 // in the loop.
5761 try self.func.body.emitBranch(self.spv.gpa, header_label);
5762 try self.beginSpvBlock(header_label);
5763
5764 // Emit loop header and jump to loop body
5765 try self.func.body.emit(self.spv.gpa, .OpLoopMerge, .{
5766 .merge_block = merge_label,
5767 .continue_target = continue_label,
5768 .loop_control = .{},
5769 });
5770 try self.func.body.emitBranch(self.spv.gpa, body_label);
5771
5772 try self.beginSpvBlock(body_label);
5773
5774 const next_block = try self.genStructuredBody(.{ .loop = .{
5775 .merge_label = merge_label,
5776 .continue_label = continue_label,
5777 } }, body);
5778 try self.structuredBreak(next_block);
5779
5780 try self.beginSpvBlock(continue_label);
5781 try self.func.body.emitBranch(self.spv.gpa, header_label);
5782 },
5783 .unstructured => {
5784 try self.func.body.emitBranch(self.spv.gpa, body_label);
5785 try self.beginSpvBlock(body_label);
5786 try self.genBody(body);
5787 try self.func.body.emitBranch(self.spv.gpa, body_label);
5788 },
5789 }
5790 }
5791
5792 fn airLoad(self: *NavGen, inst: Air.Inst.Index) !?Id {
5793 const zcu = self.pt.zcu;
5794 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5795 const ptr_ty = self.typeOf(ty_op.operand);
5796 const elem_ty = self.typeOfIndex(inst);
5797 const operand = try self.resolve(ty_op.operand);
5798 if (!ptr_ty.isVolatilePtr(zcu) and self.liveness.isUnused(inst)) return null;
5799
5800 return try self.load(elem_ty, operand, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5801 }
5802
5803 fn airStore(self: *NavGen, inst: Air.Inst.Index) !void {
5804 const zcu = self.pt.zcu;
5805 const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
5806 const ptr_ty = self.typeOf(bin_op.lhs);
5807 const elem_ty = ptr_ty.childType(zcu);
5808 const ptr = try self.resolve(bin_op.lhs);
5809 const value = try self.resolve(bin_op.rhs);
5810
5811 try self.store(elem_ty, ptr, value, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5812 }
5813
5814 fn airRet(self: *NavGen, inst: Air.Inst.Index) !void {
5815 const pt = self.pt;
5816 const zcu = pt.zcu;
5817 const operand = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5818 const ret_ty = self.typeOf(operand);
5819 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5820 const fn_info = zcu.typeToFunc(zcu.navValue(self.owner_nav).typeOf(zcu)).?;
5821 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5822 // Functions with an empty error set are emitted with an error code
5823 // return type and return zero so they can be function pointers coerced
5824 // to functions that return anyerror.
5825 const no_err_id = try self.constInt(Type.anyerror, 0);
5826 return try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{ .value = no_err_id });
5827 } else {
5828 return try self.func.body.emit(self.spv.gpa, .OpReturn, {});
5829 }
5830 }
5831
5832 const operand_id = try self.resolve(operand);
5833 try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{ .value = operand_id });
5834 }
5835
5836 fn airRetLoad(self: *NavGen, inst: Air.Inst.Index) !void {
5837 const pt = self.pt;
5838 const zcu = pt.zcu;
5839 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
5840 const ptr_ty = self.typeOf(un_op);
5841 const ret_ty = ptr_ty.childType(zcu);
5842
5843 if (!ret_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
5844 const fn_info = zcu.typeToFunc(zcu.navValue(self.owner_nav).typeOf(zcu)).?;
5845 if (Type.fromInterned(fn_info.return_type).isError(zcu)) {
5846 // Functions with an empty error set are emitted with an error code
5847 // return type and return zero so they can be function pointers coerced
5848 // to functions that return anyerror.
5849 const no_err_id = try self.constInt(Type.anyerror, 0);
5850 return try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{ .value = no_err_id });
5851 } else {
5852 return try self.func.body.emit(self.spv.gpa, .OpReturn, {});
5853 }
5854 }
5855
5856 const ptr = try self.resolve(un_op);
5857 const value = try self.load(ret_ty, ptr, .{ .is_volatile = ptr_ty.isVolatilePtr(zcu) });
5858 try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{
5859 .value = value,
5860 });
5861 }
5862
5863 fn airTry(self: *NavGen, inst: Air.Inst.Index) !?Id {
5864 const zcu = self.pt.zcu;
5865 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
5866 const err_union_id = try self.resolve(pl_op.operand);
5867 const extra = self.air.extraData(Air.Try, pl_op.payload);
5868 const body: []const Air.Inst.Index = @ptrCast(self.air.extra.items[extra.end..][0..extra.data.body_len]);
5869
5870 const err_union_ty = self.typeOf(pl_op.operand);
5871 const payload_ty = self.typeOfIndex(inst);
5872
5873 const bool_ty_id = try self.resolveType(Type.bool, .direct);
5874
5875 const eu_layout = self.errorUnionLayout(payload_ty);
5876
5877 if (!err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5878 const err_id = if (eu_layout.payload_has_bits)
5879 try self.extractField(Type.anyerror, err_union_id, eu_layout.errorFieldIndex())
5880 else
5881 err_union_id;
5882
5883 const zero_id = try self.constInt(Type.anyerror, 0);
5884 const is_err_id = self.spv.allocId();
5885 try self.func.body.emit(self.spv.gpa, .OpINotEqual, .{
5886 .id_result_type = bool_ty_id,
5887 .id_result = is_err_id,
5888 .operand_1 = err_id,
5889 .operand_2 = zero_id,
5890 });
5891
5892 // When there is an error, we must evaluate `body`. Otherwise we must continue
5893 // with the current body.
5894 // Just generate a new block here, then generate a new block inline for the remainder of the body.
5895
5896 const err_block = self.spv.allocId();
5897 const ok_block = self.spv.allocId();
5898
5899 switch (self.control_flow) {
5900 .structured => {
5901 // According to AIR documentation, this block is guaranteed
5902 // to not break and end in a return instruction. Thus,
5903 // for structured control flow, we can just naively use
5904 // the ok block as the merge block here.
5905 try self.func.body.emit(self.spv.gpa, .OpSelectionMerge, .{
5906 .merge_block = ok_block,
5907 .selection_control = .{},
5908 });
5909 },
5910 .unstructured => {},
5911 }
5912
5913 try self.func.body.emit(self.spv.gpa, .OpBranchConditional, .{
5914 .condition = is_err_id,
5915 .true_label = err_block,
5916 .false_label = ok_block,
5917 });
5918
5919 try self.beginSpvBlock(err_block);
5920 try self.genBody(body);
5921
5922 try self.beginSpvBlock(ok_block);
5923 }
5924
5925 if (!eu_layout.payload_has_bits) {
5926 return null;
5927 }
5928
5929 // Now just extract the payload, if required.
5930 return try self.extractField(payload_ty, err_union_id, eu_layout.payloadFieldIndex());
5931 }
5932
5933 fn airErrUnionErr(self: *NavGen, inst: Air.Inst.Index) !?Id {
5934 const zcu = self.pt.zcu;
5935 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5936 const operand_id = try self.resolve(ty_op.operand);
5937 const err_union_ty = self.typeOf(ty_op.operand);
5938 const err_ty_id = try self.resolveType(Type.anyerror, .direct);
5939
5940 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
5941 // No error possible, so just return undefined.
5942 return try self.spv.constUndef(err_ty_id);
5943 }
5944
5945 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5946 const eu_layout = self.errorUnionLayout(payload_ty);
5947
5948 if (!eu_layout.payload_has_bits) {
5949 // If no payload, error union is represented by error set.
5950 return operand_id;
5951 }
5952
5953 return try self.extractField(Type.anyerror, operand_id, eu_layout.errorFieldIndex());
5954 }
5955
5956 fn airErrUnionPayload(self: *NavGen, inst: Air.Inst.Index) !?Id {
5957 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5958 const operand_id = try self.resolve(ty_op.operand);
5959 const payload_ty = self.typeOfIndex(inst);
5960 const eu_layout = self.errorUnionLayout(payload_ty);
5961
5962 if (!eu_layout.payload_has_bits) {
5963 return null; // No error possible.
5964 }
5965
5966 return try self.extractField(payload_ty, operand_id, eu_layout.payloadFieldIndex());
5967 }
5968
5969 fn airWrapErrUnionErr(self: *NavGen, inst: Air.Inst.Index) !?Id {
5970 const zcu = self.pt.zcu;
5971 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5972 const err_union_ty = self.typeOfIndex(inst);
5973 const payload_ty = err_union_ty.errorUnionPayload(zcu);
5974 const operand_id = try self.resolve(ty_op.operand);
5975 const eu_layout = self.errorUnionLayout(payload_ty);
5976
5977 if (!eu_layout.payload_has_bits) {
5978 return operand_id;
5979 }
5980
5981 const payload_ty_id = try self.resolveType(payload_ty, .indirect);
5982
5983 var members: [2]Id = undefined;
5984 members[eu_layout.errorFieldIndex()] = operand_id;
5985 members[eu_layout.payloadFieldIndex()] = try self.spv.constUndef(payload_ty_id);
5986
5987 var types: [2]Type = undefined;
5988 types[eu_layout.errorFieldIndex()] = Type.anyerror;
5989 types[eu_layout.payloadFieldIndex()] = payload_ty;
5990
5991 const err_union_ty_id = try self.resolveType(err_union_ty, .direct);
5992 return try self.constructComposite(err_union_ty_id, &members);
5993 }
5994
5995 fn airWrapErrUnionPayload(self: *NavGen, inst: Air.Inst.Index) !?Id {
5996 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
5997 const err_union_ty = self.typeOfIndex(inst);
5998 const operand_id = try self.resolve(ty_op.operand);
5999 const payload_ty = self.typeOf(ty_op.operand);
6000 const eu_layout = self.errorUnionLayout(payload_ty);
6001
6002 if (!eu_layout.payload_has_bits) {
6003 return try self.constInt(Type.anyerror, 0);
6004 }
6005
6006 var members: [2]Id = undefined;
6007 members[eu_layout.errorFieldIndex()] = try self.constInt(Type.anyerror, 0);
6008 members[eu_layout.payloadFieldIndex()] = try self.convertToIndirect(payload_ty, operand_id);
6009
6010 var types: [2]Type = undefined;
6011 types[eu_layout.errorFieldIndex()] = Type.anyerror;
6012 types[eu_layout.payloadFieldIndex()] = payload_ty;
6013
6014 const err_union_ty_id = try self.resolveType(err_union_ty, .direct);
6015 return try self.constructComposite(err_union_ty_id, &members);
6016 }
6017
6018 fn airIsNull(self: *NavGen, inst: Air.Inst.Index, is_pointer: bool, pred: enum { is_null, is_non_null }) !?Id {
6019 const pt = self.pt;
6020 const zcu = pt.zcu;
6021 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
6022 const operand_id = try self.resolve(un_op);
6023 const operand_ty = self.typeOf(un_op);
6024 const optional_ty = if (is_pointer) operand_ty.childType(zcu) else operand_ty;
6025 const payload_ty = optional_ty.optionalChild(zcu);
6026
6027 const bool_ty_id = try self.resolveType(Type.bool, .direct);
6028
6029 if (optional_ty.optionalReprIsPayload(zcu)) {
6030 // Pointer payload represents nullability: pointer or slice.
6031 const loaded_id = if (is_pointer)
6032 try self.load(optional_ty, operand_id, .{})
6033 else
6034 operand_id;
6035
6036 const ptr_ty = if (payload_ty.isSlice(zcu))
6037 payload_ty.slicePtrFieldType(zcu)
6038 else
6039 payload_ty;
6040
6041 const ptr_id = if (payload_ty.isSlice(zcu))
6042 try self.extractField(ptr_ty, loaded_id, 0)
6043 else
6044 loaded_id;
6045
6046 const ptr_ty_id = try self.resolveType(ptr_ty, .direct);
6047 const null_id = try self.spv.constNull(ptr_ty_id);
6048 const null_tmp = Temporary.init(ptr_ty, null_id);
6049 const ptr = Temporary.init(ptr_ty, ptr_id);
6050
6051 const op: std.math.CompareOperator = switch (pred) {
6052 .is_null => .eq,
6053 .is_non_null => .neq,
6054 };
6055 const result = try self.cmp(op, ptr, null_tmp);
6056 return try result.materialize(self);
6057 }
6058
6059 const is_non_null_id = blk: {
6060 if (is_pointer) {
6061 if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
6062 const storage_class = self.spvStorageClass(operand_ty.ptrAddressSpace(zcu));
6063 const bool_ptr_ty_id = try self.ptrType(Type.bool, storage_class, .indirect);
6064 const tag_ptr_id = try self.accessChain(bool_ptr_ty_id, operand_id, &.{1});
6065 break :blk try self.load(Type.bool, tag_ptr_id, .{});
6066 }
6067
6068 break :blk try self.load(Type.bool, operand_id, .{});
6069 }
6070
6071 break :blk if (payload_ty.hasRuntimeBitsIgnoreComptime(zcu))
6072 try self.extractField(Type.bool, operand_id, 1)
6073 else
6074 // Optional representation is bool indicating whether the optional is set
6075 // Optionals with no payload are represented as an (indirect) bool, so convert
6076 // it back to the direct bool here.
6077 try self.convertToDirect(Type.bool, operand_id);
6078 };
6079
6080 return switch (pred) {
6081 .is_null => blk: {
6082 // Invert condition
6083 const result_id = self.spv.allocId();
6084 try self.func.body.emit(self.spv.gpa, .OpLogicalNot, .{
6085 .id_result_type = bool_ty_id,
6086 .id_result = result_id,
6087 .operand = is_non_null_id,
6088 });
6089 break :blk result_id;
6090 },
6091 .is_non_null => is_non_null_id,
6092 };
6093 }
6094
6095 fn airIsErr(self: *NavGen, inst: Air.Inst.Index, pred: enum { is_err, is_non_err }) !?Id {
6096 const zcu = self.pt.zcu;
6097 const un_op = self.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
6098 const operand_id = try self.resolve(un_op);
6099 const err_union_ty = self.typeOf(un_op);
6100
6101 if (err_union_ty.errorUnionSet(zcu).errorSetIsEmpty(zcu)) {
6102 return try self.constBool(pred == .is_non_err, .direct);
6103 }
6104
6105 const payload_ty = err_union_ty.errorUnionPayload(zcu);
6106 const eu_layout = self.errorUnionLayout(payload_ty);
6107 const bool_ty_id = try self.resolveType(Type.bool, .direct);
6108
6109 const error_id = if (!eu_layout.payload_has_bits)
6110 operand_id
6111 else
6112 try self.extractField(Type.anyerror, operand_id, eu_layout.errorFieldIndex());
6113
6114 const result_id = self.spv.allocId();
6115 switch (pred) {
6116 inline else => |pred_ct| try self.func.body.emit(
6117 self.spv.gpa,
6118 switch (pred_ct) {
6119 .is_err => .OpINotEqual,
6120 .is_non_err => .OpIEqual,
6121 },
6122 .{
6123 .id_result_type = bool_ty_id,
6124 .id_result = result_id,
6125 .operand_1 = error_id,
6126 .operand_2 = try self.constInt(Type.anyerror, 0),
6127 },
6128 ),
6129 }
6130 return result_id;
6131 }
6132
6133 fn airUnwrapOptional(self: *NavGen, inst: Air.Inst.Index) !?Id {
6134 const pt = self.pt;
6135 const zcu = pt.zcu;
6136 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
6137 const operand_id = try self.resolve(ty_op.operand);
6138 const optional_ty = self.typeOf(ty_op.operand);
6139 const payload_ty = self.typeOfIndex(inst);
6140
6141 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) return null;
6142
6143 if (optional_ty.optionalReprIsPayload(zcu)) {
6144 return operand_id;
6145 }
6146
6147 return try self.extractField(payload_ty, operand_id, 0);
6148 }
6149
6150 fn airUnwrapOptionalPtr(self: *NavGen, inst: Air.Inst.Index) !?Id {
6151 const pt = self.pt;
6152 const zcu = pt.zcu;
6153 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
6154 const operand_id = try self.resolve(ty_op.operand);
6155 const operand_ty = self.typeOf(ty_op.operand);
6156 const optional_ty = operand_ty.childType(zcu);
6157 const payload_ty = optional_ty.optionalChild(zcu);
6158 const result_ty = self.typeOfIndex(inst);
6159 const result_ty_id = try self.resolveType(result_ty, .direct);
6160
6161 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
6162 // There is no payload, but we still need to return a valid pointer.
6163 // We can just return anything here, so just return a pointer to the operand.
6164 return try self.bitCast(result_ty, operand_ty, operand_id);
6165 }
6166
6167 if (optional_ty.optionalReprIsPayload(zcu)) {
6168 // They are the same value.
6169 return try self.bitCast(result_ty, operand_ty, operand_id);
6170 }
6171
6172 return try self.accessChain(result_ty_id, operand_id, &.{0});
6173 }
6174
6175 fn airWrapOptional(self: *NavGen, inst: Air.Inst.Index) !?Id {
6176 const pt = self.pt;
6177 const zcu = pt.zcu;
6178 const ty_op = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_op;
6179 const payload_ty = self.typeOf(ty_op.operand);
6180
6181 if (!payload_ty.hasRuntimeBitsIgnoreComptime(zcu)) {
6182 return try self.constBool(true, .indirect);
6183 }
6184
6185 const operand_id = try self.resolve(ty_op.operand);
6186
6187 const optional_ty = self.typeOfIndex(inst);
6188 if (optional_ty.optionalReprIsPayload(zcu)) {
6189 return operand_id;
6190 }
6191
6192 const payload_id = try self.convertToIndirect(payload_ty, operand_id);
6193 const members = [_]Id{ payload_id, try self.constBool(true, .indirect) };
6194 const optional_ty_id = try self.resolveType(optional_ty, .direct);
6195 return try self.constructComposite(optional_ty_id, &members);
6196 }
6197
6198 fn airSwitchBr(self: *NavGen, inst: Air.Inst.Index) !void {
6199 const pt = self.pt;
6200 const zcu = pt.zcu;
6201 const target = self.spv.target;
6202 const switch_br = self.air.unwrapSwitch(inst);
6203 const cond_ty = self.typeOf(switch_br.operand);
6204 const cond = try self.resolve(switch_br.operand);
6205 var cond_indirect = try self.convertToIndirect(cond_ty, cond);
6206
6207 const cond_words: u32 = switch (cond_ty.zigTypeTag(zcu)) {
6208 .bool, .error_set => 1,
6209 .int => blk: {
6210 const bits = cond_ty.intInfo(zcu).bits;
6211 const backing_bits, const big_int = self.backingIntBits(bits);
6212 if (big_int) return self.todo("implement composite int switch", .{});
6213 break :blk if (backing_bits <= 32) 1 else 2;
6214 },
6215 .@"enum" => blk: {
6216 const int_ty = cond_ty.intTagType(zcu);
6217 const int_info = int_ty.intInfo(zcu);
6218 const backing_bits, const big_int = self.backingIntBits(int_info.bits);
6219 if (big_int) return self.todo("implement composite int switch", .{});
6220 break :blk if (backing_bits <= 32) 1 else 2;
6221 },
6222 .pointer => blk: {
6223 cond_indirect = try self.intFromPtr(cond_indirect);
6224 break :blk target.ptrBitWidth() / 32;
6225 },
6226 // TODO: Figure out which types apply here, and work around them as we can only do integers.
6227 else => return self.todo("implement switch for type {s}", .{@tagName(cond_ty.zigTypeTag(zcu))}),
6228 };
6229
6230 const num_cases = switch_br.cases_len;
6231
6232 // Compute the total number of arms that we need.
6233 // Zig switches are grouped by condition, so we need to loop through all of them
6234 const num_conditions = blk: {
6235 var num_conditions: u32 = 0;
6236 var it = switch_br.iterateCases();
6237 while (it.next()) |case| {
6238 if (case.ranges.len > 0) return self.todo("switch with ranges", .{});
6239 num_conditions += @intCast(case.items.len);
6240 }
6241 break :blk num_conditions;
6242 };
6243
6244 // First, pre-allocate the labels for the cases.
6245 const case_labels = self.spv.allocIds(num_cases);
6246 // We always need the default case - if zig has none, we will generate unreachable there.
6247 const default = self.spv.allocId();
6248
6249 const merge_label = switch (self.control_flow) {
6250 .structured => self.spv.allocId(),
6251 .unstructured => null,
6252 };
6253
6254 if (self.control_flow == .structured) {
6255 try self.func.body.emit(self.spv.gpa, .OpSelectionMerge, .{
6256 .merge_block = merge_label.?,
6257 .selection_control = .{},
6258 });
6259 }
6260
6261 // Emit the instruction before generating the blocks.
6262 try self.func.body.emitRaw(self.spv.gpa, .OpSwitch, 2 + (cond_words + 1) * num_conditions);
6263 self.func.body.writeOperand(Id, cond_indirect);
6264 self.func.body.writeOperand(Id, default);
6265
6266 // Emit each of the cases
6267 {
6268 var it = switch_br.iterateCases();
6269 while (it.next()) |case| {
6270 // SPIR-V needs a literal here, which' width depends on the case condition.
6271 const label = case_labels.at(case.idx);
6272
6273 for (case.items) |item| {
6274 const value = (try self.air.value(item, pt)) orelse unreachable;
6275 const int_val: u64 = switch (cond_ty.zigTypeTag(zcu)) {
6276 .bool, .int => if (cond_ty.isSignedInt(zcu)) @bitCast(value.toSignedInt(zcu)) else value.toUnsignedInt(zcu),
6277 .@"enum" => blk: {
6278 // TODO: figure out of cond_ty is correct (something with enum literals)
6279 break :blk (try value.intFromEnum(cond_ty, pt)).toUnsignedInt(zcu); // TODO: composite integer constants
6280 },
6281 .error_set => value.getErrorInt(zcu),
6282 .pointer => value.toUnsignedInt(zcu),
6283 else => unreachable,
6284 };
6285 const int_lit: spec.LiteralContextDependentNumber = switch (cond_words) {
6286 1 => .{ .uint32 = @intCast(int_val) },
6287 2 => .{ .uint64 = int_val },
6288 else => unreachable,
6289 };
6290 self.func.body.writeOperand(spec.LiteralContextDependentNumber, int_lit);
6291 self.func.body.writeOperand(Id, label);
6292 }
6293 }
6294 }
6295
6296 var incoming_structured_blocks: std.ArrayListUnmanaged(ControlFlow.Structured.Block.Incoming) = .empty;
6297 defer incoming_structured_blocks.deinit(self.gpa);
6298
6299 if (self.control_flow == .structured) {
6300 try incoming_structured_blocks.ensureUnusedCapacity(self.gpa, num_cases + 1);
6301 }
6302
6303 // Now, finally, we can start emitting each of the cases.
6304 var it = switch_br.iterateCases();
6305 while (it.next()) |case| {
6306 const label = case_labels.at(case.idx);
6307
6308 try self.beginSpvBlock(label);
6309
6310 switch (self.control_flow) {
6311 .structured => {
6312 const next_block = try self.genStructuredBody(.selection, case.body);
6313 incoming_structured_blocks.appendAssumeCapacity(.{
6314 .src_label = self.current_block_label,
6315 .next_block = next_block,
6316 });
6317 try self.func.body.emitBranch(self.spv.gpa, merge_label.?);
6318 },
6319 .unstructured => {
6320 try self.genBody(case.body);
6321 },
6322 }
6323 }
6324
6325 const else_body = it.elseBody();
6326 try self.beginSpvBlock(default);
6327 if (else_body.len != 0) {
6328 switch (self.control_flow) {
6329 .structured => {
6330 const next_block = try self.genStructuredBody(.selection, else_body);
6331 incoming_structured_blocks.appendAssumeCapacity(.{
6332 .src_label = self.current_block_label,
6333 .next_block = next_block,
6334 });
6335 try self.func.body.emitBranch(self.spv.gpa, merge_label.?);
6336 },
6337 .unstructured => {
6338 try self.genBody(else_body);
6339 },
6340 }
6341 } else {
6342 try self.func.body.emit(self.spv.gpa, .OpUnreachable, {});
6343 }
6344
6345 if (self.control_flow == .structured) {
6346 try self.beginSpvBlock(merge_label.?);
6347 const next_block = try self.structuredNextBlock(incoming_structured_blocks.items);
6348 try self.structuredBreak(next_block);
6349 }
6350 }
6351
6352 fn airUnreach(self: *NavGen) !void {
6353 try self.func.body.emit(self.spv.gpa, .OpUnreachable, {});
6354 }
6355
6356 fn airDbgStmt(self: *NavGen, inst: Air.Inst.Index) !void {
6357 const pt = self.pt;
6358 const zcu = pt.zcu;
6359 const dbg_stmt = self.air.instructions.items(.data)[@intFromEnum(inst)].dbg_stmt;
6360 const path = zcu.navFileScope(self.owner_nav).sub_file_path;
6361 try self.func.body.emit(self.spv.gpa, .OpLine, .{
6362 .file = try self.spv.resolveString(path),
6363 .line = self.base_line + dbg_stmt.line + 1,
6364 .column = dbg_stmt.column + 1,
6365 });
6366 }
6367
6368 fn airDbgInlineBlock(self: *NavGen, inst: Air.Inst.Index) !?Id {
6369 const zcu = self.pt.zcu;
6370 const inst_datas = self.air.instructions.items(.data);
6371 const extra = self.air.extraData(Air.DbgInlineBlock, inst_datas[@intFromEnum(inst)].ty_pl.payload);
6372 const old_base_line = self.base_line;
6373 defer self.base_line = old_base_line;
6374 self.base_line = zcu.navSrcLine(zcu.funcInfo(extra.data.func).owner_nav);
6375 return self.lowerBlock(inst, @ptrCast(self.air.extra.items[extra.end..][0..extra.data.body_len]));
6376 }
6377
6378 fn airDbgVar(self: *NavGen, inst: Air.Inst.Index) !void {
6379 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6380 const target_id = try self.resolve(pl_op.operand);
6381 const name: Air.NullTerminatedString = @enumFromInt(pl_op.payload);
6382 try self.spv.debugName(target_id, name.toSlice(self.air));
6383 }
6384
6385 fn airAssembly(self: *NavGen, inst: Air.Inst.Index) !?Id {
6386 const zcu = self.pt.zcu;
6387 const ty_pl = self.air.instructions.items(.data)[@intFromEnum(inst)].ty_pl;
6388 const extra = self.air.extraData(Air.Asm, ty_pl.payload);
6389
6390 const is_volatile = extra.data.flags.is_volatile;
6391 const outputs_len = extra.data.flags.outputs_len;
6392
6393 if (!is_volatile and self.liveness.isUnused(inst)) return null;
6394
6395 var extra_i: usize = extra.end;
6396 const outputs: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra_i..][0..outputs_len]);
6397 extra_i += outputs.len;
6398 const inputs: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra_i..][0..extra.data.inputs_len]);
6399 extra_i += inputs.len;
6400
6401 if (outputs.len > 1) {
6402 return self.todo("implement inline asm with more than 1 output", .{});
6403 }
6404
6405 var as: SpvAssembler = .{
6406 .gpa = self.gpa,
6407 .spv = self.spv,
6408 .func = &self.func,
6409 };
6410 defer as.deinit();
6411
6412 var output_extra_i = extra_i;
6413 for (outputs) |output| {
6414 if (output != .none) {
6415 return self.todo("implement inline asm with non-returned output", .{});
6416 }
6417 const extra_bytes = std.mem.sliceAsBytes(self.air.extra.items[extra_i..]);
6418 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(self.air.extra.items[extra_i..]), 0);
6419 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6420 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6421 // TODO: Record output and use it somewhere.
6422 }
6423
6424 for (inputs) |input| {
6425 const extra_bytes = std.mem.sliceAsBytes(self.air.extra.items[extra_i..]);
6426 const constraint = std.mem.sliceTo(extra_bytes, 0);
6427 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6428 // This equation accounts for the fact that even if we have exactly 4 bytes
6429 // for the string, we still use the next u32 for the null terminator.
6430 extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6431
6432 const input_ty = self.typeOf(input);
6433
6434 if (std.mem.eql(u8, constraint, "c")) {
6435 // constant
6436 const val = (try self.air.value(input, self.pt)) orelse {
6437 return self.fail("assembly inputs with 'c' constraint have to be compile-time known", .{});
6438 };
6439
6440 // TODO: This entire function should be handled a bit better...
6441 const ip = &zcu.intern_pool;
6442 switch (ip.indexToKey(val.toIntern())) {
6443 .int_type,
6444 .ptr_type,
6445 .array_type,
6446 .vector_type,
6447 .opt_type,
6448 .anyframe_type,
6449 .error_union_type,
6450 .simple_type,
6451 .struct_type,
6452 .union_type,
6453 .opaque_type,
6454 .enum_type,
6455 .func_type,
6456 .error_set_type,
6457 .inferred_error_set_type,
6458 => unreachable, // types, not values
6459
6460 .undef => return self.fail("assembly input with 'c' constraint cannot be undefined", .{}),
6461
6462 .int => try as.value_map.put(as.gpa, name, .{ .constant = @intCast(val.toUnsignedInt(zcu)) }),
6463 .enum_literal => |str| try as.value_map.put(as.gpa, name, .{ .string = str.toSlice(ip) }),
6464
6465 else => unreachable, // TODO
6466 }
6467 } else if (std.mem.eql(u8, constraint, "t")) {
6468 // type
6469 if (input_ty.zigTypeTag(zcu) == .type) {
6470 // This assembly input is a type instead of a value.
6471 // That's fine for now, just make sure to resolve it as such.
6472 const val = (try self.air.value(input, self.pt)).?;
6473 const ty_id = try self.resolveType(val.toType(), .direct);
6474 try as.value_map.put(as.gpa, name, .{ .ty = ty_id });
6475 } else {
6476 const ty_id = try self.resolveType(input_ty, .direct);
6477 try as.value_map.put(as.gpa, name, .{ .ty = ty_id });
6478 }
6479 } else {
6480 if (input_ty.zigTypeTag(zcu) == .type) {
6481 return self.fail("use the 't' constraint to supply types to SPIR-V inline assembly", .{});
6482 }
6483
6484 const val_id = try self.resolve(input);
6485 try as.value_map.put(as.gpa, name, .{ .value = val_id });
6486 }
6487 }
6488
6489 // TODO: do something with clobbers
6490 _ = extra.data.clobbers;
6491
6492 const asm_source = std.mem.sliceAsBytes(self.air.extra.items[extra_i..])[0..extra.data.source_len];
6493
6494 as.assemble(asm_source) catch |err| switch (err) {
6495 error.AssembleFail => {
6496 // TODO: For now the compiler only supports a single error message per decl,
6497 // so to translate the possible multiple errors from the assembler, emit
6498 // them as notes here.
6499 // TODO: Translate proper error locations.
6500 assert(as.errors.items.len != 0);
6501 assert(self.error_msg == null);
6502 const src_loc = zcu.navSrcLoc(self.owner_nav);
6503 self.error_msg = try Zcu.ErrorMsg.create(zcu.gpa, src_loc, "failed to assemble SPIR-V inline assembly", .{});
6504 const notes = try zcu.gpa.alloc(Zcu.ErrorMsg, as.errors.items.len);
6505
6506 // Sub-scope to prevent `return error.CodegenFail` from running the errdefers.
6507 {
6508 errdefer zcu.gpa.free(notes);
6509 var i: usize = 0;
6510 errdefer for (notes[0..i]) |*note| {
6511 note.deinit(zcu.gpa);
6512 };
6513
6514 while (i < as.errors.items.len) : (i += 1) {
6515 notes[i] = try Zcu.ErrorMsg.init(zcu.gpa, src_loc, "{s}", .{as.errors.items[i].msg});
6516 }
6517 }
6518 self.error_msg.?.notes = notes;
6519 return error.CodegenFail;
6520 },
6521 else => |others| return others,
6522 };
6523
6524 for (outputs) |output| {
6525 _ = output;
6526 const extra_bytes = std.mem.sliceAsBytes(self.air.extra.items[output_extra_i..]);
6527 const constraint = std.mem.sliceTo(std.mem.sliceAsBytes(self.air.extra.items[output_extra_i..]), 0);
6528 const name = std.mem.sliceTo(extra_bytes[constraint.len + 1 ..], 0);
6529 output_extra_i += (constraint.len + name.len + (2 + 3)) / 4;
6530
6531 const result = as.value_map.get(name) orelse return {
6532 return self.fail("invalid asm output '{s}'", .{name});
6533 };
6534
6535 switch (result) {
6536 .just_declared, .unresolved_forward_reference => unreachable,
6537 .ty => return self.fail("cannot return spir-v type as value from assembly", .{}),
6538 .value => |ref| return ref,
6539 .constant, .string => return self.fail("cannot return constant from assembly", .{}),
6540 }
6541
6542 // TODO: Multiple results
6543 // TODO: Check that the output type from assembly is the same as the type actually expected by Zig.
6544 }
6545
6546 return null;
6547 }
6548
6549 fn airCall(self: *NavGen, inst: Air.Inst.Index, modifier: std.builtin.CallModifier) !?Id {
6550 _ = modifier;
6551
6552 const pt = self.pt;
6553 const zcu = pt.zcu;
6554 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6555 const extra = self.air.extraData(Air.Call, pl_op.payload);
6556 const args: []const Air.Inst.Ref = @ptrCast(self.air.extra.items[extra.end..][0..extra.data.args_len]);
6557 const callee_ty = self.typeOf(pl_op.operand);
6558 const zig_fn_ty = switch (callee_ty.zigTypeTag(zcu)) {
6559 .@"fn" => callee_ty,
6560 .pointer => return self.fail("cannot call function pointers", .{}),
6561 else => unreachable,
6562 };
6563 const fn_info = zcu.typeToFunc(zig_fn_ty).?;
6564 const return_type = fn_info.return_type;
6565
6566 const result_type_id = try self.resolveFnReturnType(Type.fromInterned(return_type));
6567 const result_id = self.spv.allocId();
6568 const callee_id = try self.resolve(pl_op.operand);
6569
6570 comptime assert(zig_call_abi_ver == 3);
6571 const params = try self.gpa.alloc(spec.Id, args.len);
6572 defer self.gpa.free(params);
6573 var n_params: usize = 0;
6574 for (args) |arg| {
6575 // Note: resolve() might emit instructions, so we need to call it
6576 // before starting to emit OpFunctionCall instructions. Hence the
6577 // temporary params buffer.
6578 const arg_ty = self.typeOf(arg);
6579 if (!arg_ty.hasRuntimeBitsIgnoreComptime(zcu)) continue;
6580 const arg_id = try self.resolve(arg);
6581
6582 params[n_params] = arg_id;
6583 n_params += 1;
6584 }
6585
6586 try self.func.body.emit(self.spv.gpa, .OpFunctionCall, .{
6587 .id_result_type = result_type_id,
6588 .id_result = result_id,
6589 .function = callee_id,
6590 .id_ref_3 = params[0..n_params],
6591 });
6592
6593 if (self.liveness.isUnused(inst) or !Type.fromInterned(return_type).hasRuntimeBitsIgnoreComptime(zcu)) {
6594 return null;
6595 }
6596
6597 return result_id;
6598 }
6599
6600 fn builtin3D(self: *NavGen, result_ty: Type, builtin: spec.BuiltIn, dimension: u32, out_of_range_value: anytype) !Id {
6601 if (dimension >= 3) {
6602 return try self.constInt(result_ty, out_of_range_value);
6603 }
6604 const vec_ty = try self.pt.vectorType(.{
6605 .len = 3,
6606 .child = result_ty.toIntern(),
6607 });
6608 const ptr_ty_id = try self.ptrType(vec_ty, .input, .indirect);
6609 const spv_decl_index = try self.spv.builtin(ptr_ty_id, builtin);
6610 try self.func.decl_deps.put(self.spv.gpa, spv_decl_index, {});
6611 const ptr = self.spv.declPtr(spv_decl_index).result_id;
6612 const vec = try self.load(vec_ty, ptr, .{});
6613 return try self.extractVectorComponent(result_ty, vec, dimension);
6614 }
6615
6616 fn airWorkItemId(self: *NavGen, inst: Air.Inst.Index) !?Id {
6617 if (self.liveness.isUnused(inst)) return null;
6618 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6619 const dimension = pl_op.payload;
6620 // TODO: Should we make these builtins return usize?
6621 const result_id = try self.builtin3D(Type.u64, .local_invocation_id, dimension, 0);
6622 const tmp = Temporary.init(Type.u64, result_id);
6623 const result = try self.buildConvert(Type.u32, tmp);
6624 return try result.materialize(self);
6625 }
6626
6627 fn airWorkGroupSize(self: *NavGen, inst: Air.Inst.Index) !?Id {
6628 if (self.liveness.isUnused(inst)) return null;
6629 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6630 const dimension = pl_op.payload;
6631 // TODO: Should we make these builtins return usize?
6632 const result_id = try self.builtin3D(Type.u64, .workgroup_size, dimension, 0);
6633 const tmp = Temporary.init(Type.u64, result_id);
6634 const result = try self.buildConvert(Type.u32, tmp);
6635 return try result.materialize(self);
6636 }
6637
6638 fn airWorkGroupId(self: *NavGen, inst: Air.Inst.Index) !?Id {
6639 if (self.liveness.isUnused(inst)) return null;
6640 const pl_op = self.air.instructions.items(.data)[@intFromEnum(inst)].pl_op;
6641 const dimension = pl_op.payload;
6642 // TODO: Should we make these builtins return usize?
6643 const result_id = try self.builtin3D(Type.u64, .workgroup_id, dimension, 0);
6644 const tmp = Temporary.init(Type.u64, result_id);
6645 const result = try self.buildConvert(Type.u32, tmp);
6646 return try result.materialize(self);
6647 }
6648
6649 fn typeOf(self: *NavGen, inst: Air.Inst.Ref) Type {
6650 const zcu = self.pt.zcu;
6651 return self.air.typeOf(inst, &zcu.intern_pool);
6652 }
6653
6654 fn typeOfIndex(self: *NavGen, inst: Air.Inst.Index) Type {
6655 const zcu = self.pt.zcu;
6656 return self.air.typeOfIndex(inst, &zcu.intern_pool);
6657 }
6658};
src/codegen/spirv/Assembler.zig deleted-1157
......@@ -1,1157 +0,0 @@
1const Assembler = @This();
2
3const std = @import("std");
4const Allocator = std.mem.Allocator;
5const assert = std.debug.assert;
6
7const spec = @import("spec.zig");
8const Opcode = spec.Opcode;
9const Word = spec.Word;
10const Id = spec.Id;
11const StorageClass = spec.StorageClass;
12
13const SpvModule = @import("Module.zig");
14
15/// Represents a token in the assembly template.
16const Token = struct {
17 tag: Tag,
18 start: u32,
19 end: u32,
20
21 const Tag = enum {
22 /// Returned when there was no more input to match.
23 eof,
24 /// %identifier
25 result_id,
26 /// %identifier when appearing on the LHS of an equals sign.
27 /// While not technically a token, its relatively easy to resolve
28 /// this during lexical analysis and relieves a bunch of headaches
29 /// during parsing.
30 result_id_assign,
31 /// Mask, int, or float. These are grouped together as some
32 /// SPIR-V enumerants look a bit like integers as well (for example
33 /// "3D"), and so it is easier to just interpret them as the expected
34 /// type when resolving an instruction's operands.
35 value,
36 /// An enumerant that looks like an opcode, that is, OpXxxx.
37 /// Not necessarily a *valid* opcode.
38 opcode,
39 /// String literals.
40 /// Note, this token is also returned for unterminated
41 /// strings. In this case the closing " is not present.
42 string,
43 /// |.
44 pipe,
45 /// =.
46 equals,
47 /// $identifier. This is used (for now) for constant values, like integers.
48 /// These can be used in place of a normal `value`.
49 placeholder,
50
51 fn name(self: Tag) []const u8 {
52 return switch (self) {
53 .eof => "<end of input>",
54 .result_id => "<result-id>",
55 .result_id_assign => "<assigned result-id>",
56 .value => "<value>",
57 .opcode => "<opcode>",
58 .string => "<string literal>",
59 .pipe => "'|'",
60 .equals => "'='",
61 .placeholder => "<placeholder>",
62 };
63 }
64 };
65};
66
67/// This union represents utility information for a decoded operand.
68/// Note that this union only needs to maintain a minimal amount of
69/// bookkeeping: these values are enough to either decode the operands
70/// into a spec type, or emit it directly into its binary form.
71const Operand = union(enum) {
72 /// Any 'simple' 32-bit value. This could be a mask or
73 /// enumerant, etc, depending on the operands.
74 value: u32,
75
76 /// An int- or float literal encoded as 1 word. This may be
77 /// a 32-bit literal or smaller, already in the proper format:
78 /// the opper bits are 0 for floats and unsigned ints, and sign-extended
79 /// for signed ints.
80 literal32: u32,
81
82 /// An int- or float literal encoded as 2 words. This may be a 33-bit
83 /// to 64 bit literal, already in the proper format:
84 /// the opper bits are 0 for floats and unsigned ints, and sign-extended
85 /// for signed ints.
86 literal64: u64,
87
88 /// A result-id which is assigned to in this instruction. If present,
89 /// this is the first operand of the instruction.
90 result_id: AsmValue.Ref,
91
92 /// A result-id which referred to (not assigned to) in this instruction.
93 ref_id: AsmValue.Ref,
94
95 /// Offset into `inst.string_bytes`. The string ends at the next zero-terminator.
96 string: u32,
97};
98
99/// A structure representing an error message that the assembler may return, when
100/// the assembly source is not syntactically or semantically correct.
101const ErrorMsg = struct {
102 /// The offset in bytes from the start of `src` that this error occured.
103 byte_offset: u32,
104 /// An explanatory error message.
105 /// Memory is owned by `self.gpa`. TODO: Maybe allocate this with an arena
106 /// allocator if it is needed elsewhere?
107 msg: []const u8,
108};
109
110/// Possible errors the `assemble` function may return.
111const Error = error{ AssembleFail, OutOfMemory };
112
113/// This union is used to keep track of results of spir-v instructions. This can either be just a plain
114/// result-id, in the case of most instructions, or for example a type that is constructed from
115/// an OpTypeXxx instruction.
116const AsmValue = union(enum) {
117 /// The results are stored in an array hash map, and can be referred to either by name (without the %),
118 /// or by values of this index type.
119 pub const Ref = u32;
120
121 /// This result-value is the RHS of the current instruction.
122 just_declared,
123
124 /// This is used as placeholder for ref-ids of which the result-id is not yet known.
125 /// It will be further resolved at a later stage to a more concrete forward reference.
126 unresolved_forward_reference,
127
128 /// This result-value is a normal result produced by a different instruction.
129 value: Id,
130
131 /// This result-value represents a type registered into the module's type system.
132 ty: Id,
133
134 /// This is a pre-supplied constant integer value.
135 constant: u32,
136
137 /// This is a pre-supplied constant string value.
138 string: []const u8,
139
140 /// Retrieve the result-id of this AsmValue. Asserts that this AsmValue
141 /// is of a variant that allows the result to be obtained (not an unresolved
142 /// forward declaration, not in the process of being declared, etc).
143 pub fn resultId(self: AsmValue) Id {
144 return switch (self) {
145 .just_declared,
146 .unresolved_forward_reference,
147 // TODO: Lower this value as constant?
148 .constant,
149 .string,
150 => unreachable,
151 .value => |result| result,
152 .ty => |result| result,
153 };
154 }
155};
156
157/// This map type maps results to values. Results can be addressed either by name (without the %), or by
158/// AsmValue.Ref in AsmValueMap.keys/.values.
159const AsmValueMap = std.StringArrayHashMapUnmanaged(AsmValue);
160
161/// An allocator used for common allocations.
162gpa: Allocator,
163
164/// A list of errors that occured during processing the assembly.
165errors: std.ArrayListUnmanaged(ErrorMsg) = .empty,
166
167/// The source code that is being assembled.
168/// This is set when calling `assemble()`.
169src: []const u8 = undefined,
170
171/// The module that this assembly is associated to.
172/// Instructions like OpType*, OpDecorate, etc are emitted into this module.
173spv: *SpvModule,
174
175/// The function that the function-specific instructions should be emitted to.
176func: *SpvModule.Fn,
177
178/// `self.src` tokenized.
179tokens: std.ArrayListUnmanaged(Token) = .empty,
180
181/// The token that is next during parsing.
182current_token: u32 = 0,
183
184/// This field groups the properties of the instruction that is currently
185/// being parsed or has just been parsed.
186inst: struct {
187 /// The opcode of the current instruction.
188 opcode: Opcode = undefined,
189 /// Operands of the current instruction.
190 operands: std.ArrayListUnmanaged(Operand) = .empty,
191 /// This is where string data resides. Strings are zero-terminated.
192 string_bytes: std.ArrayListUnmanaged(u8) = .empty,
193
194 /// Return a reference to the result of this instruction, if any.
195 fn result(self: @This()) ?AsmValue.Ref {
196 // The result, if present, is either the first or second
197 // operand of an instruction.
198 for (self.operands.items[0..@min(self.operands.items.len, 2)]) |op| {
199 switch (op) {
200 .result_id => |index| return index,
201 else => {},
202 }
203 }
204 return null;
205 }
206} = .{},
207
208/// This map maps results to their tracked values.
209value_map: AsmValueMap = .{},
210
211/// This set is used to quickly transform from an opcode name to the
212/// index in its instruction set. The index of the key is the
213/// index in `spec.InstructionSet.core.instructions()`.
214instruction_map: std.StringArrayHashMapUnmanaged(void) = .empty,
215
216/// Free the resources owned by this assembler.
217pub fn deinit(self: *Assembler) void {
218 for (self.errors.items) |err| {
219 self.gpa.free(err.msg);
220 }
221 self.tokens.deinit(self.gpa);
222 self.errors.deinit(self.gpa);
223 self.inst.operands.deinit(self.gpa);
224 self.inst.string_bytes.deinit(self.gpa);
225 self.value_map.deinit(self.gpa);
226 self.instruction_map.deinit(self.gpa);
227}
228
229pub fn assemble(self: *Assembler, src: []const u8) Error!void {
230 self.src = src;
231 self.errors.clearRetainingCapacity();
232
233 // Populate the opcode map if it isn't already
234 if (self.instruction_map.count() == 0) {
235 const instructions = spec.InstructionSet.core.instructions();
236 try self.instruction_map.ensureUnusedCapacity(self.gpa, @intCast(instructions.len));
237 for (spec.InstructionSet.core.instructions(), 0..) |inst, i| {
238 const entry = try self.instruction_map.getOrPut(self.gpa, inst.name);
239 assert(entry.index == i);
240 }
241 }
242
243 try self.tokenize();
244 while (!self.testToken(.eof)) {
245 try self.parseInstruction();
246 try self.processInstruction();
247 }
248 if (self.errors.items.len > 0)
249 return error.AssembleFail;
250}
251
252fn addError(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) !void {
253 const msg = try std.fmt.allocPrint(self.gpa, fmt, args);
254 errdefer self.gpa.free(msg);
255 try self.errors.append(self.gpa, .{
256 .byte_offset = offset,
257 .msg = msg,
258 });
259}
260
261fn fail(self: *Assembler, offset: u32, comptime fmt: []const u8, args: anytype) Error {
262 try self.addError(offset, fmt, args);
263 return error.AssembleFail;
264}
265
266fn todo(self: *Assembler, comptime fmt: []const u8, args: anytype) Error {
267 return self.fail(0, "todo: " ++ fmt, args);
268}
269
270/// Attempt to process the instruction currently in `self.inst`.
271/// This for example emits the instruction in the module or function, or
272/// records type definitions.
273/// If this function returns `error.AssembleFail`, an explanatory
274/// error message has already been emitted into `self.errors`.
275fn processInstruction(self: *Assembler) !void {
276 const result: AsmValue = switch (self.inst.opcode) {
277 .OpEntryPoint => {
278 return self.fail(0, "cannot export entry points via OpEntryPoint, export the kernel using callconv(.kernel)", .{});
279 },
280 .OpCapability => {
281 try self.spv.addCapability(@enumFromInt(self.inst.operands.items[0].value));
282 return;
283 },
284 .OpExtension => {
285 const ext_name_offset = self.inst.operands.items[0].string;
286 const ext_name = std.mem.sliceTo(self.inst.string_bytes.items[ext_name_offset..], 0);
287 try self.spv.addExtension(ext_name);
288 return;
289 },
290 .OpExtInstImport => blk: {
291 const set_name_offset = self.inst.operands.items[1].string;
292 const set_name = std.mem.sliceTo(self.inst.string_bytes.items[set_name_offset..], 0);
293 const set_tag = std.meta.stringToEnum(spec.InstructionSet, set_name) orelse {
294 return self.fail(set_name_offset, "unknown instruction set: {s}", .{set_name});
295 };
296 break :blk .{ .value = try self.spv.importInstructionSet(set_tag) };
297 },
298 .OpExecutionMode, .OpExecutionModeId => {
299 assert(try self.processGenericInstruction() == null);
300 const entry_point_id = try self.resolveRefId(self.inst.operands.items[0].ref_id);
301 const exec_mode: spec.ExecutionMode = @enumFromInt(self.inst.operands.items[1].value);
302 const gop = try self.spv.entry_points.getOrPut(self.gpa, entry_point_id);
303 if (!gop.found_existing) {
304 gop.value_ptr.* = .{};
305 } else if (gop.value_ptr.exec_mode != null) {
306 return self.fail(
307 self.currentToken().start,
308 "cannot set execution mode more than once to any entry point",
309 .{},
310 );
311 }
312 gop.value_ptr.exec_mode = exec_mode;
313 return;
314 },
315 else => switch (self.inst.opcode.class()) {
316 .type_declaration => try self.processTypeInstruction(),
317 else => (try self.processGenericInstruction()) orelse return,
318 },
319 };
320
321 const result_ref = self.inst.result().?;
322 switch (self.value_map.values()[result_ref]) {
323 .just_declared => self.value_map.values()[result_ref] = result,
324 else => {
325 // TODO: Improve source location.
326 const name = self.value_map.keys()[result_ref];
327 return self.fail(0, "duplicate definition of %{s}", .{name});
328 },
329 }
330}
331
332/// Record `self.inst` into the module's type system, and return the AsmValue that
333/// refers to the result.
334fn processTypeInstruction(self: *Assembler) !AsmValue {
335 const operands = self.inst.operands.items;
336 const section = &self.spv.sections.types_globals_constants;
337 const id = switch (self.inst.opcode) {
338 .OpTypeVoid => try self.spv.voidType(),
339 .OpTypeBool => try self.spv.boolType(),
340 .OpTypeInt => blk: {
341 const signedness: std.builtin.Signedness = switch (operands[2].literal32) {
342 0 => .unsigned,
343 1 => .signed,
344 else => {
345 // TODO: Improve source location.
346 return self.fail(0, "{} is not a valid signedness (expected 0 or 1)", .{operands[2].literal32});
347 },
348 };
349 const width = std.math.cast(u16, operands[1].literal32) orelse {
350 return self.fail(0, "int type of {} bits is too large", .{operands[1].literal32});
351 };
352 break :blk try self.spv.intType(signedness, width);
353 },
354 .OpTypeFloat => blk: {
355 const bits = operands[1].literal32;
356 switch (bits) {
357 16, 32, 64 => {},
358 else => {
359 return self.fail(0, "{} is not a valid bit count for floats (expected 16, 32 or 64)", .{bits});
360 },
361 }
362 break :blk try self.spv.floatType(@intCast(bits));
363 },
364 .OpTypeVector => blk: {
365 const child_type = try self.resolveRefId(operands[1].ref_id);
366 break :blk try self.spv.vectorType(operands[2].literal32, child_type);
367 },
368 .OpTypeArray => {
369 // TODO: The length of an OpTypeArray is determined by a constant (which may be a spec constant),
370 // and so some consideration must be taken when entering this in the type system.
371 return self.todo("process OpTypeArray", .{});
372 },
373 .OpTypeRuntimeArray => blk: {
374 const element_type = try self.resolveRefId(operands[1].ref_id);
375 const result_id = self.spv.allocId();
376 try section.emit(self.spv.gpa, .OpTypeRuntimeArray, .{
377 .id_result = result_id,
378 .element_type = element_type,
379 });
380 break :blk result_id;
381 },
382 .OpTypePointer => blk: {
383 const storage_class: StorageClass = @enumFromInt(operands[1].value);
384 const child_type = try self.resolveRefId(operands[2].ref_id);
385 const result_id = self.spv.allocId();
386 try section.emit(self.spv.gpa, .OpTypePointer, .{
387 .id_result = result_id,
388 .storage_class = storage_class,
389 .type = child_type,
390 });
391 break :blk result_id;
392 },
393 .OpTypeStruct => blk: {
394 const ids = try self.gpa.alloc(Id, operands[1..].len);
395 defer self.gpa.free(ids);
396 for (operands[1..], ids) |op, *id| id.* = try self.resolveRefId(op.ref_id);
397 const result_id = self.spv.allocId();
398 try self.spv.structType(result_id, ids, null);
399 break :blk result_id;
400 },
401 .OpTypeImage => blk: {
402 const sampled_type = try self.resolveRefId(operands[1].ref_id);
403 const result_id = self.spv.allocId();
404 try section.emit(self.gpa, .OpTypeImage, .{
405 .id_result = result_id,
406 .sampled_type = sampled_type,
407 .dim = @enumFromInt(operands[2].value),
408 .depth = operands[3].literal32,
409 .arrayed = operands[4].literal32,
410 .ms = operands[5].literal32,
411 .sampled = operands[6].literal32,
412 .image_format = @enumFromInt(operands[7].value),
413 });
414 break :blk result_id;
415 },
416 .OpTypeSampler => blk: {
417 const result_id = self.spv.allocId();
418 try section.emit(self.gpa, .OpTypeSampler, .{ .id_result = result_id });
419 break :blk result_id;
420 },
421 .OpTypeSampledImage => blk: {
422 const image_type = try self.resolveRefId(operands[1].ref_id);
423 const result_id = self.spv.allocId();
424 try section.emit(self.gpa, .OpTypeSampledImage, .{ .id_result = result_id, .image_type = image_type });
425 break :blk result_id;
426 },
427 .OpTypeFunction => blk: {
428 const param_operands = operands[2..];
429 const return_type = try self.resolveRefId(operands[1].ref_id);
430
431 const param_types = try self.spv.gpa.alloc(Id, param_operands.len);
432 defer self.spv.gpa.free(param_types);
433 for (param_types, param_operands) |*param, operand| {
434 param.* = try self.resolveRefId(operand.ref_id);
435 }
436 const result_id = self.spv.allocId();
437 try section.emit(self.spv.gpa, .OpTypeFunction, .{
438 .id_result = result_id,
439 .return_type = return_type,
440 .id_ref_2 = param_types,
441 });
442 break :blk result_id;
443 },
444 else => return self.todo("process type instruction {s}", .{@tagName(self.inst.opcode)}),
445 };
446
447 return AsmValue{ .ty = id };
448}
449
450/// Emit `self.inst` into `self.spv` and `self.func`, and return the AsmValue
451/// that this produces (if any). This function processes common instructions:
452/// - No forward references are allowed in operands.
453/// - Target section is determined from instruction type.
454/// - Function-local instructions are emitted in `self.func`.
455fn processGenericInstruction(self: *Assembler) !?AsmValue {
456 const operands = self.inst.operands.items;
457 var maybe_spv_decl_index: ?SpvModule.Decl.Index = null;
458 const section = switch (self.inst.opcode.class()) {
459 .constant_creation => &self.spv.sections.types_globals_constants,
460 .annotation => &self.spv.sections.annotations,
461 .type_declaration => unreachable, // Handled elsewhere.
462 else => switch (self.inst.opcode) {
463 .OpEntryPoint => unreachable,
464 .OpExecutionMode, .OpExecutionModeId => &self.spv.sections.execution_modes,
465 .OpVariable => section: {
466 const storage_class: spec.StorageClass = @enumFromInt(operands[2].value);
467 if (storage_class == .function) break :section &self.func.prologue;
468 maybe_spv_decl_index = try self.spv.allocDecl(.global);
469 if (self.spv.version.minor < 4 and storage_class != .input and storage_class != .output) {
470 // Before version 1.4, the interface’s storage classes are limited to the Input and Output
471 break :section &self.spv.sections.types_globals_constants;
472 }
473 try self.func.decl_deps.put(self.spv.gpa, maybe_spv_decl_index.?, {});
474 // TODO: In theory this can be non-empty if there is an initializer which depends on another global...
475 try self.spv.declareDeclDeps(maybe_spv_decl_index.?, &.{});
476 break :section &self.spv.sections.types_globals_constants;
477 },
478 // Default case - to be worked out further.
479 else => &self.func.body,
480 },
481 };
482
483 var maybe_result_id: ?Id = null;
484 const first_word = section.instructions.items.len;
485 // At this point we're not quite sure how many operands this instruction is going to have,
486 // so insert 0 and patch up the actual opcode word later.
487 try section.ensureUnusedCapacity(self.spv.gpa, 1);
488 section.writeWord(0);
489
490 for (operands) |operand| {
491 switch (operand) {
492 .value, .literal32 => |word| {
493 try section.ensureUnusedCapacity(self.spv.gpa, 1);
494 section.writeWord(word);
495 },
496 .literal64 => |dword| {
497 try section.ensureUnusedCapacity(self.spv.gpa, 2);
498 section.writeDoubleWord(dword);
499 },
500 .result_id => {
501 maybe_result_id = if (maybe_spv_decl_index) |spv_decl_index|
502 self.spv.declPtr(spv_decl_index).result_id
503 else
504 self.spv.allocId();
505 try section.ensureUnusedCapacity(self.spv.gpa, 1);
506 section.writeOperand(Id, maybe_result_id.?);
507 },
508 .ref_id => |index| {
509 const result = try self.resolveRef(index);
510 try section.ensureUnusedCapacity(self.spv.gpa, 1);
511 section.writeOperand(spec.Id, result.resultId());
512 },
513 .string => |offset| {
514 const text = std.mem.sliceTo(self.inst.string_bytes.items[offset..], 0);
515 const size = std.math.divCeil(usize, text.len + 1, @sizeOf(Word)) catch unreachable;
516 try section.ensureUnusedCapacity(self.spv.gpa, size);
517 section.writeOperand(spec.LiteralString, text);
518 },
519 }
520 }
521
522 const actual_word_count = section.instructions.items.len - first_word;
523 section.instructions.items[first_word] |= @as(u32, @as(u16, @intCast(actual_word_count))) << 16 | @intFromEnum(self.inst.opcode);
524
525 if (maybe_result_id) |result| {
526 return AsmValue{ .value = result };
527 }
528 return null;
529}
530
531/// Resolve a value reference. This function makes sure that the reference is
532/// not self-referential, but it does allow the result to be forward declared.
533fn resolveMaybeForwardRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
534 const value = self.value_map.values()[ref];
535 switch (value) {
536 .just_declared => {
537 const name = self.value_map.keys()[ref];
538 // TODO: Improve source location.
539 return self.fail(0, "self-referential parameter %{s}", .{name});
540 },
541 else => return value,
542 }
543}
544
545/// Resolve a value reference. This function
546/// makes sure that the result is not self-referential, nor that it is forward declared.
547fn resolveRef(self: *Assembler, ref: AsmValue.Ref) !AsmValue {
548 const value = try self.resolveMaybeForwardRef(ref);
549 switch (value) {
550 .just_declared => unreachable,
551 .unresolved_forward_reference => {
552 const name = self.value_map.keys()[ref];
553 // TODO: Improve source location.
554 return self.fail(0, "reference to undeclared result-id %{s}", .{name});
555 },
556 else => return value,
557 }
558}
559
560fn resolveRefId(self: *Assembler, ref: AsmValue.Ref) !Id {
561 const value = try self.resolveRef(ref);
562 return value.resultId();
563}
564
565/// Attempt to parse an instruction into `self.inst`.
566/// If this function returns `error.AssembleFail`, an explanatory
567/// error message has been emitted into `self.errors`.
568fn parseInstruction(self: *Assembler) !void {
569 self.inst.opcode = undefined;
570 self.inst.operands.clearRetainingCapacity();
571 self.inst.string_bytes.clearRetainingCapacity();
572
573 const lhs_result_tok = self.currentToken();
574 const maybe_lhs_result: ?AsmValue.Ref = if (self.eatToken(.result_id_assign)) blk: {
575 const name = self.tokenText(lhs_result_tok)[1..];
576 const entry = try self.value_map.getOrPut(self.gpa, name);
577 try self.expectToken(.equals);
578 if (!entry.found_existing) {
579 entry.value_ptr.* = .just_declared;
580 }
581 break :blk @intCast(entry.index);
582 } else null;
583
584 const opcode_tok = self.currentToken();
585 if (maybe_lhs_result != null) {
586 try self.expectToken(.opcode);
587 } else if (!self.eatToken(.opcode)) {
588 return self.fail(opcode_tok.start, "expected start of instruction, found {s}", .{opcode_tok.tag.name()});
589 }
590
591 const opcode_text = self.tokenText(opcode_tok);
592 const index = self.instruction_map.getIndex(opcode_text) orelse {
593 return self.fail(opcode_tok.start, "invalid opcode '{s}'", .{opcode_text});
594 };
595
596 const inst = spec.InstructionSet.core.instructions()[index];
597 self.inst.opcode = @enumFromInt(inst.opcode);
598
599 const expected_operands = inst.operands;
600 // This is a loop because the result-id is not always the first operand.
601 const requires_lhs_result = for (expected_operands) |op| {
602 if (op.kind == .id_result) break true;
603 } else false;
604
605 if (requires_lhs_result and maybe_lhs_result == null) {
606 return self.fail(opcode_tok.start, "opcode '{s}' expects result on left-hand side", .{@tagName(self.inst.opcode)});
607 } else if (!requires_lhs_result and maybe_lhs_result != null) {
608 return self.fail(
609 lhs_result_tok.start,
610 "opcode '{s}' does not expect a result-id on the left-hand side",
611 .{@tagName(self.inst.opcode)},
612 );
613 }
614
615 for (expected_operands) |operand| {
616 if (operand.kind == .id_result) {
617 try self.inst.operands.append(self.gpa, .{ .result_id = maybe_lhs_result.? });
618 continue;
619 }
620
621 switch (operand.quantifier) {
622 .required => if (self.isAtInstructionBoundary()) {
623 return self.fail(
624 self.currentToken().start,
625 "missing required operand", // TODO: Operand name?
626 .{},
627 );
628 } else {
629 try self.parseOperand(operand.kind);
630 },
631 .optional => if (!self.isAtInstructionBoundary()) {
632 try self.parseOperand(operand.kind);
633 },
634 .variadic => while (!self.isAtInstructionBoundary()) {
635 try self.parseOperand(operand.kind);
636 },
637 }
638 }
639}
640
641/// Parse a single operand of a particular type.
642fn parseOperand(self: *Assembler, kind: spec.OperandKind) Error!void {
643 switch (kind.category()) {
644 .bit_enum => try self.parseBitEnum(kind),
645 .value_enum => try self.parseValueEnum(kind),
646 .id => try self.parseRefId(),
647 else => switch (kind) {
648 .literal_integer => try self.parseLiteralInteger(),
649 .literal_string => try self.parseString(),
650 .literal_context_dependent_number => try self.parseContextDependentNumber(),
651 .literal_ext_inst_integer => try self.parseLiteralExtInstInteger(),
652 .pair_id_ref_id_ref => try self.parsePhiSource(),
653 else => return self.todo("parse operand of type {s}", .{@tagName(kind)}),
654 },
655 }
656}
657
658/// Also handles parsing any required extra operands.
659fn parseBitEnum(self: *Assembler, kind: spec.OperandKind) !void {
660 var tok = self.currentToken();
661 try self.expectToken(.value);
662
663 var text = self.tokenText(tok);
664 if (std.mem.eql(u8, text, "None")) {
665 try self.inst.operands.append(self.gpa, .{ .value = 0 });
666 return;
667 }
668
669 const enumerants = kind.enumerants();
670 var mask: u32 = 0;
671 while (true) {
672 const enumerant = for (enumerants) |enumerant| {
673 if (std.mem.eql(u8, enumerant.name, text))
674 break enumerant;
675 } else {
676 return self.fail(tok.start, "'{s}' is not a valid flag for bitmask {s}", .{ text, @tagName(kind) });
677 };
678 mask |= enumerant.value;
679 if (!self.eatToken(.pipe))
680 break;
681
682 tok = self.currentToken();
683 try self.expectToken(.value);
684 text = self.tokenText(tok);
685 }
686
687 try self.inst.operands.append(self.gpa, .{ .value = mask });
688
689 // Assume values are sorted.
690 // TODO: ensure in generator.
691 for (enumerants) |enumerant| {
692 if ((mask & enumerant.value) == 0)
693 continue;
694
695 for (enumerant.parameters) |param_kind| {
696 if (self.isAtInstructionBoundary()) {
697 return self.fail(self.currentToken().start, "missing required parameter for bit flag '{s}'", .{enumerant.name});
698 }
699
700 try self.parseOperand(param_kind);
701 }
702 }
703}
704
705/// Also handles parsing any required extra operands.
706fn parseValueEnum(self: *Assembler, kind: spec.OperandKind) !void {
707 const tok = self.currentToken();
708 if (self.eatToken(.placeholder)) {
709 const name = self.tokenText(tok)[1..];
710 const value = self.value_map.get(name) orelse {
711 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
712 };
713 switch (value) {
714 .constant => |literal32| {
715 try self.inst.operands.append(self.gpa, .{ .value = literal32 });
716 },
717 .string => |str| {
718 const enumerant = for (kind.enumerants()) |enumerant| {
719 if (std.mem.eql(u8, enumerant.name, str)) break enumerant;
720 } else {
721 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ str, @tagName(kind) });
722 };
723 try self.inst.operands.append(self.gpa, .{ .value = enumerant.value });
724 },
725 else => return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name}),
726 }
727 return;
728 }
729
730 try self.expectToken(.value);
731
732 const text = self.tokenText(tok);
733 const int_value = std.fmt.parseInt(u32, text, 0) catch null;
734 const enumerant = for (kind.enumerants()) |enumerant| {
735 if (int_value) |v| {
736 if (v == enumerant.value) break enumerant;
737 } else {
738 if (std.mem.eql(u8, enumerant.name, text)) break enumerant;
739 }
740 } else {
741 return self.fail(tok.start, "'{s}' is not a valid value for enumeration {s}", .{ text, @tagName(kind) });
742 };
743
744 try self.inst.operands.append(self.gpa, .{ .value = enumerant.value });
745
746 for (enumerant.parameters) |param_kind| {
747 if (self.isAtInstructionBoundary()) {
748 return self.fail(self.currentToken().start, "missing required parameter for enum variant '{s}'", .{enumerant.name});
749 }
750
751 try self.parseOperand(param_kind);
752 }
753}
754
755fn parseRefId(self: *Assembler) !void {
756 const tok = self.currentToken();
757 try self.expectToken(.result_id);
758
759 const name = self.tokenText(tok)[1..];
760 const entry = try self.value_map.getOrPut(self.gpa, name);
761 if (!entry.found_existing) {
762 entry.value_ptr.* = .unresolved_forward_reference;
763 }
764
765 const index: AsmValue.Ref = @intCast(entry.index);
766 try self.inst.operands.append(self.gpa, .{ .ref_id = index });
767}
768
769fn parseLiteralInteger(self: *Assembler) !void {
770 const tok = self.currentToken();
771 if (self.eatToken(.placeholder)) {
772 const name = self.tokenText(tok)[1..];
773 const value = self.value_map.get(name) orelse {
774 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
775 };
776 switch (value) {
777 .constant => |literal32| {
778 try self.inst.operands.append(self.gpa, .{ .literal32 = literal32 });
779 },
780 else => {
781 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
782 },
783 }
784 return;
785 }
786
787 try self.expectToken(.value);
788 // According to the SPIR-V machine readable grammar, a LiteralInteger
789 // may consist of one or more words. From the SPIR-V docs it seems like there
790 // only one instruction where multiple words are allowed, the literals that make up the
791 // switch cases of OpSwitch. This case is handled separately, and so we just assume
792 // everything is a 32-bit integer in this function.
793 const text = self.tokenText(tok);
794 const value = std.fmt.parseInt(u32, text, 0) catch {
795 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
796 };
797 try self.inst.operands.append(self.gpa, .{ .literal32 = value });
798}
799
800fn parseLiteralExtInstInteger(self: *Assembler) !void {
801 const tok = self.currentToken();
802 if (self.eatToken(.placeholder)) {
803 const name = self.tokenText(tok)[1..];
804 const value = self.value_map.get(name) orelse {
805 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
806 };
807 switch (value) {
808 .constant => |literal32| {
809 try self.inst.operands.append(self.gpa, .{ .literal32 = literal32 });
810 },
811 else => {
812 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
813 },
814 }
815 return;
816 }
817
818 try self.expectToken(.value);
819 const text = self.tokenText(tok);
820 const value = std.fmt.parseInt(u32, text, 0) catch {
821 return self.fail(tok.start, "'{s}' is not a valid 32-bit integer literal", .{text});
822 };
823 try self.inst.operands.append(self.gpa, .{ .literal32 = value });
824}
825
826fn parseString(self: *Assembler) !void {
827 const tok = self.currentToken();
828 try self.expectToken(.string);
829 // Note, the string might not have a closing quote. In this case,
830 // an error is already emitted but we are trying to continue processing
831 // anyway, so in this function we have to deal with that situation.
832 const text = self.tokenText(tok);
833 assert(text.len > 0 and text[0] == '"');
834 const literal = if (text.len != 1 and text[text.len - 1] == '"')
835 text[1 .. text.len - 1]
836 else
837 text[1..];
838
839 const string_offset: u32 = @intCast(self.inst.string_bytes.items.len);
840 try self.inst.string_bytes.ensureUnusedCapacity(self.gpa, literal.len + 1);
841 self.inst.string_bytes.appendSliceAssumeCapacity(literal);
842 self.inst.string_bytes.appendAssumeCapacity(0);
843
844 try self.inst.operands.append(self.gpa, .{ .string = string_offset });
845}
846
847fn parseContextDependentNumber(self: *Assembler) !void {
848 // For context dependent numbers, the actual type to parse is determined by the instruction.
849 // Currently, this operand appears in OpConstant and OpSpecConstant, where the too-be-parsed type
850 // is determined by the result type. That means that in this instructions we have to resolve the
851 // operand type early and look at the result to see how we need to proceed.
852 assert(self.inst.opcode == .OpConstant or self.inst.opcode == .OpSpecConstant);
853
854 const tok = self.currentToken();
855 const result = try self.resolveRef(self.inst.operands.items[0].ref_id);
856 const result_id = result.resultId();
857 // We are going to cheat a little bit: The types we are interested in, int and float,
858 // are added to the module and cached via self.spv.intType and self.spv.floatType. Therefore,
859 // we can determine the width of these types by directly checking the cache.
860 // This only works if the Assembler and codegen both use spv.intType and spv.floatType though.
861 // We don't expect there to be many of these types, so just look it up every time.
862 // TODO: Count be improved to be a little bit more efficent.
863
864 {
865 var it = self.spv.cache.int_types.iterator();
866 while (it.next()) |entry| {
867 const id = entry.value_ptr.*;
868 if (id != result_id) continue;
869 const info = entry.key_ptr.*;
870 return try self.parseContextDependentInt(info.signedness, info.bits);
871 }
872 }
873
874 {
875 var it = self.spv.cache.float_types.iterator();
876 while (it.next()) |entry| {
877 const id = entry.value_ptr.*;
878 if (id != result_id) continue;
879 const info = entry.key_ptr.*;
880 switch (info.bits) {
881 16 => try self.parseContextDependentFloat(16),
882 32 => try self.parseContextDependentFloat(32),
883 64 => try self.parseContextDependentFloat(64),
884 else => return self.fail(tok.start, "cannot parse {}-bit info literal", .{info.bits}),
885 }
886 }
887 }
888
889 return self.fail(tok.start, "cannot parse literal constant", .{});
890}
891
892fn parseContextDependentInt(self: *Assembler, signedness: std.builtin.Signedness, width: u32) !void {
893 const tok = self.currentToken();
894 if (self.eatToken(.placeholder)) {
895 const name = self.tokenText(tok)[1..];
896 const value = self.value_map.get(name) orelse {
897 return self.fail(tok.start, "invalid placeholder '${s}'", .{name});
898 };
899 switch (value) {
900 .constant => |literal32| {
901 try self.inst.operands.append(self.gpa, .{ .literal32 = literal32 });
902 },
903 else => {
904 return self.fail(tok.start, "value '{s}' cannot be used as placeholder", .{name});
905 },
906 }
907 return;
908 }
909
910 try self.expectToken(.value);
911
912 if (width == 0 or width > 2 * @bitSizeOf(spec.Word)) {
913 return self.fail(tok.start, "cannot parse {}-bit integer literal", .{width});
914 }
915
916 const text = self.tokenText(tok);
917 invalid: {
918 // Just parse the integer as the next larger integer type, and check if it overflows afterwards.
919 const int = std.fmt.parseInt(i128, text, 0) catch break :invalid;
920 const min = switch (signedness) {
921 .unsigned => 0,
922 .signed => -(@as(i128, 1) << (@as(u7, @intCast(width)) - 1)),
923 };
924 const max = (@as(i128, 1) << (@as(u7, @intCast(width)) - @intFromBool(signedness == .signed))) - 1;
925 if (int < min or int > max) {
926 break :invalid;
927 }
928
929 // Note, we store the sign-extended version here.
930 if (width <= @bitSizeOf(spec.Word)) {
931 try self.inst.operands.append(self.gpa, .{ .literal32 = @truncate(@as(u128, @bitCast(int))) });
932 } else {
933 try self.inst.operands.append(self.gpa, .{ .literal64 = @truncate(@as(u128, @bitCast(int))) });
934 }
935 return;
936 }
937
938 return self.fail(tok.start, "'{s}' is not a valid {s} {}-bit int literal", .{ text, @tagName(signedness), width });
939}
940
941fn parseContextDependentFloat(self: *Assembler, comptime width: u16) !void {
942 const Float = std.meta.Float(width);
943 const Int = std.meta.Int(.unsigned, width);
944
945 const tok = self.currentToken();
946 try self.expectToken(.value);
947
948 const text = self.tokenText(tok);
949
950 const value = std.fmt.parseFloat(Float, text) catch {
951 return self.fail(tok.start, "'{s}' is not a valid {}-bit float literal", .{ text, width });
952 };
953
954 const float_bits: Int = @bitCast(value);
955 if (width <= @bitSizeOf(spec.Word)) {
956 try self.inst.operands.append(self.gpa, .{ .literal32 = float_bits });
957 } else {
958 assert(width <= 2 * @bitSizeOf(spec.Word));
959 try self.inst.operands.append(self.gpa, .{ .literal64 = float_bits });
960 }
961}
962
963fn parsePhiSource(self: *Assembler) !void {
964 try self.parseRefId();
965 if (self.isAtInstructionBoundary()) {
966 return self.fail(self.currentToken().start, "missing phi block parent", .{});
967 }
968 try self.parseRefId();
969}
970
971/// Returns whether the `current_token` cursor is currently pointing
972/// at the start of a new instruction.
973fn isAtInstructionBoundary(self: Assembler) bool {
974 return switch (self.currentToken().tag) {
975 .opcode, .result_id_assign, .eof => true,
976 else => false,
977 };
978}
979
980fn expectToken(self: *Assembler, tag: Token.Tag) !void {
981 if (self.eatToken(tag))
982 return;
983
984 return self.fail(self.currentToken().start, "unexpected {s}, expected {s}", .{
985 self.currentToken().tag.name(),
986 tag.name(),
987 });
988}
989
990fn eatToken(self: *Assembler, tag: Token.Tag) bool {
991 if (self.testToken(tag)) {
992 self.current_token += 1;
993 return true;
994 }
995 return false;
996}
997
998fn testToken(self: Assembler, tag: Token.Tag) bool {
999 return self.currentToken().tag == tag;
1000}
1001
1002fn currentToken(self: Assembler) Token {
1003 return self.tokens.items[self.current_token];
1004}
1005
1006fn tokenText(self: Assembler, tok: Token) []const u8 {
1007 return self.src[tok.start..tok.end];
1008}
1009
1010/// Tokenize `self.src` and put the tokens in `self.tokens`.
1011/// Any errors encountered are appended to `self.errors`.
1012fn tokenize(self: *Assembler) !void {
1013 self.tokens.clearRetainingCapacity();
1014
1015 var offset: u32 = 0;
1016 while (true) {
1017 const tok = try self.nextToken(offset);
1018 // Resolve result-id assignment now.
1019 // Note: If the previous token wasn't a result-id, just ignore it,
1020 // we will catch it while parsing.
1021 if (tok.tag == .equals and self.tokens.items[self.tokens.items.len - 1].tag == .result_id) {
1022 self.tokens.items[self.tokens.items.len - 1].tag = .result_id_assign;
1023 }
1024 try self.tokens.append(self.gpa, tok);
1025 if (tok.tag == .eof)
1026 break;
1027 offset = tok.end;
1028 }
1029}
1030
1031/// Retrieve the next token from the input. This function will assert
1032/// that the token is surrounded by whitespace if required, but will not
1033/// interpret the token yet.
1034/// Note: This function doesn't handle .result_id_assign - this is handled in
1035/// tokenize().
1036fn nextToken(self: *Assembler, start_offset: u32) !Token {
1037 // We generally separate the input into the following types:
1038 // - Whitespace. Generally ignored, but also used as delimiter for some
1039 // tokens.
1040 // - Values. This entails integers, floats, enums - anything that
1041 // consists of alphanumeric characters, delimited by whitespace.
1042 // - Result-IDs. This entails anything that consists of alphanumeric characters and _, and
1043 // starts with a %. In contrast to values, this entity can be checked for complete correctness
1044 // relatively easily here.
1045 // - Strings. This entails quote-delimited text such as "abc".
1046 // SPIR-V strings have only two escapes, \" and \\.
1047 // - Sigils, = and |. In this assembler, these are not required to have whitespace
1048 // around them (they act as delimiters) as they do in SPIRV-Tools.
1049
1050 var state: enum {
1051 start,
1052 value,
1053 result_id,
1054 string,
1055 string_end,
1056 escape,
1057 placeholder,
1058 } = .start;
1059 var token_start = start_offset;
1060 var offset = start_offset;
1061 var tag = Token.Tag.eof;
1062 while (offset < self.src.len) : (offset += 1) {
1063 const c = self.src[offset];
1064 switch (state) {
1065 .start => switch (c) {
1066 ' ', '\t', '\r', '\n' => token_start = offset + 1,
1067 '"' => {
1068 state = .string;
1069 tag = .string;
1070 },
1071 '%' => {
1072 state = .result_id;
1073 tag = .result_id;
1074 },
1075 '|' => {
1076 tag = .pipe;
1077 offset += 1;
1078 break;
1079 },
1080 '=' => {
1081 tag = .equals;
1082 offset += 1;
1083 break;
1084 },
1085 '$' => {
1086 state = .placeholder;
1087 tag = .placeholder;
1088 },
1089 else => {
1090 state = .value;
1091 tag = .value;
1092 },
1093 },
1094 .value => switch (c) {
1095 '"' => {
1096 try self.addError(offset, "unexpected string literal", .{});
1097 // The user most likely just forgot a delimiter here - keep
1098 // the tag as value.
1099 break;
1100 },
1101 ' ', '\t', '\r', '\n', '=', '|' => break,
1102 else => {},
1103 },
1104 .result_id, .placeholder => switch (c) {
1105 '_', 'a'...'z', 'A'...'Z', '0'...'9' => {},
1106 ' ', '\t', '\r', '\n', '=', '|' => break,
1107 else => {
1108 try self.addError(offset, "illegal character in result-id or placeholder", .{});
1109 // Again, probably a forgotten delimiter here.
1110 break;
1111 },
1112 },
1113 .string => switch (c) {
1114 '\\' => state = .escape,
1115 '"' => state = .string_end,
1116 else => {}, // Note, strings may include newlines
1117 },
1118 .string_end => switch (c) {
1119 ' ', '\t', '\r', '\n', '=', '|' => break,
1120 else => {
1121 try self.addError(offset, "unexpected character after string literal", .{});
1122 // The token is still unmistakibly a string.
1123 break;
1124 },
1125 },
1126 // Escapes simply skip the next char.
1127 .escape => state = .string,
1128 }
1129 }
1130
1131 var tok = Token{
1132 .tag = tag,
1133 .start = token_start,
1134 .end = offset,
1135 };
1136
1137 switch (state) {
1138 .string, .escape => {
1139 try self.addError(token_start, "unterminated string", .{});
1140 },
1141 .result_id => if (offset - token_start == 1) {
1142 try self.addError(token_start, "result-id must have at least one name character", .{});
1143 },
1144 .value => {
1145 const text = self.tokenText(tok);
1146 const prefix = "Op";
1147 const looks_like_opcode = text.len > prefix.len and
1148 std.mem.startsWith(u8, text, prefix) and
1149 std.ascii.isUpper(text[prefix.len]);
1150 if (looks_like_opcode)
1151 tok.tag = .opcode;
1152 },
1153 else => {},
1154 }
1155
1156 return tok;
1157}
src/codegen/spirv/Module.zig deleted-782
......@@ -1,782 +0,0 @@
1//! This structure represents a SPIR-V (sections) module being compiled, and keeps track of all relevant information.
2//! That includes the actual instructions, the current result-id bound, and data structures for querying result-id's
3//! of data which needs to be persistent over different calls to Decl code generation.
4//!
5//! A SPIR-V binary module supports both little- and big endian layout. The layout is detected by the magic word in the
6//! header. Therefore, we can ignore any byte order throughout the implementation, and just use the host byte order,
7//! and make this a problem for the consumer.
8const Module = @This();
9
10const std = @import("std");
11const Allocator = std.mem.Allocator;
12const assert = std.debug.assert;
13const autoHashStrat = std.hash.autoHashStrat;
14const Wyhash = std.hash.Wyhash;
15
16const spec = @import("spec.zig");
17const Word = spec.Word;
18const Id = spec.Id;
19
20const Section = @import("Section.zig");
21
22/// This structure represents a function that isc in-progress of being emitted.
23/// Commonly, the contents of this structure will be merged with the appropriate
24/// sections of the module and re-used. Note that the SPIR-V module system makes
25/// no attempt of compacting result-id's, so any Fn instance should ultimately
26/// be merged into the module it's result-id's are allocated from.
27pub const Fn = struct {
28 /// The prologue of this function; this section contains the function's
29 /// OpFunction, OpFunctionParameter, OpLabel and OpVariable instructions, and
30 /// is separated from the actual function contents as OpVariable instructions
31 /// must appear in the first block of a function definition.
32 prologue: Section = .{},
33 /// The code of the body of this function.
34 /// This section should also contain the OpFunctionEnd instruction marking
35 /// the end of this function definition.
36 body: Section = .{},
37 /// The decl dependencies that this function depends on.
38 decl_deps: std.AutoArrayHashMapUnmanaged(Decl.Index, void) = .empty,
39
40 /// Reset this function without deallocating resources, so that
41 /// it may be used to emit code for another function.
42 pub fn reset(self: *Fn) void {
43 self.prologue.reset();
44 self.body.reset();
45 self.decl_deps.clearRetainingCapacity();
46 }
47
48 /// Free the resources owned by this function.
49 pub fn deinit(self: *Fn, a: Allocator) void {
50 self.prologue.deinit(a);
51 self.body.deinit(a);
52 self.decl_deps.deinit(a);
53 self.* = undefined;
54 }
55};
56
57/// Declarations, both functions and globals, can have dependencies. These are used for 2 things:
58/// - Globals must be declared before they are used, also between globals. The compiler processes
59/// globals unordered, so we must use the dependencies here to figure out how to order the globals
60/// in the final module. The Globals structure is also used for that.
61/// - Entry points must declare the complete list of OpVariable instructions that they access.
62/// For these we use the same dependency structure.
63/// In this mechanism, globals will only depend on other globals, while functions may depend on
64/// globals or other functions.
65pub const Decl = struct {
66 /// Index to refer to a Decl by.
67 pub const Index = enum(u32) { _ };
68
69 /// Useful to tell what kind of decl this is, and hold the result-id or field index
70 /// to be used for this decl.
71 pub const Kind = enum {
72 func,
73 global,
74 invocation_global,
75 };
76
77 /// See comment on Kind
78 kind: Kind,
79 /// The result-id associated to this decl. The specific meaning of this depends on `kind`:
80 /// - For `func`, this is the result-id of the associated OpFunction instruction.
81 /// - For `global`, this is the result-id of the associated OpVariable instruction.
82 /// - For `invocation_global`, this is the result-id of the associated InvocationGlobal instruction.
83 result_id: Id,
84 /// The offset of the first dependency of this decl in the `decl_deps` array.
85 begin_dep: u32,
86 /// The past-end offset of the dependencies of this decl in the `decl_deps` array.
87 end_dep: u32,
88};
89
90/// This models a kernel entry point.
91pub const EntryPoint = struct {
92 /// The declaration that should be exported.
93 decl_index: ?Decl.Index = null,
94 /// The name of the kernel to be exported.
95 name: ?[]const u8 = null,
96 /// Calling Convention
97 exec_model: ?spec.ExecutionModel = null,
98 exec_mode: ?spec.ExecutionMode = null,
99};
100
101/// A general-purpose allocator which may be used to allocate resources for this module
102gpa: Allocator,
103
104/// Arena for things that need to live for the length of this program.
105arena: std.heap.ArenaAllocator,
106
107/// Target info
108target: *const std.Target,
109
110/// The target SPIR-V version
111version: spec.Version,
112
113/// Module layout, according to SPIR-V Spec section 2.4, "Logical Layout of a Module".
114sections: struct {
115 /// Capability instructions
116 capabilities: Section = .{},
117 /// OpExtension instructions
118 extensions: Section = .{},
119 /// OpExtInstImport
120 extended_instruction_set: Section = .{},
121 /// memory model defined by target
122 memory_model: Section = .{},
123 /// OpEntryPoint instructions - Handled by `self.entry_points`.
124 /// OpExecutionMode and OpExecutionModeId instructions.
125 execution_modes: Section = .{},
126 /// OpString, OpSourcExtension, OpSource, OpSourceContinued.
127 debug_strings: Section = .{},
128 // OpName, OpMemberName.
129 debug_names: Section = .{},
130 // OpModuleProcessed - skip for now.
131 /// Annotation instructions (OpDecorate etc).
132 annotations: Section = .{},
133 /// Type declarations, constants, global variables
134 /// From this section, OpLine and OpNoLine is allowed.
135 /// According to the SPIR-V documentation, this section normally
136 /// also holds type and constant instructions. These are managed
137 /// via the cache instead, which is the sole structure that
138 /// manages that section. These will be inserted between this and
139 /// the previous section when emitting the final binary.
140 /// TODO: Do we need this section? Globals are also managed with another mechanism.
141 types_globals_constants: Section = .{},
142 // Functions without a body - skip for now.
143 /// Regular function definitions.
144 functions: Section = .{},
145} = .{},
146
147/// SPIR-V instructions return result-ids. This variable holds the module-wide counter for these.
148next_result_id: Word,
149
150/// Cache for results of OpString instructions.
151strings: std.StringArrayHashMapUnmanaged(Id) = .empty,
152
153/// Some types shouldn't be emitted more than one time, but cannot be caught by
154/// the `intern_map` during codegen. Sometimes, IDs are compared to check if
155/// types are the same, so we can't delay until the dedup pass. Therefore,
156/// this is an ad-hoc structure to cache types where required.
157/// According to the SPIR-V specification, section 2.8, this includes all non-aggregate
158/// non-pointer types.
159/// Additionally, this is used for other values which can be cached, for example,
160/// built-in variables.
161cache: struct {
162 bool_type: ?Id = null,
163 void_type: ?Id = null,
164 int_types: std.AutoHashMapUnmanaged(std.builtin.Type.Int, Id) = .empty,
165 float_types: std.AutoHashMapUnmanaged(std.builtin.Type.Float, Id) = .empty,
166 vector_types: std.AutoHashMapUnmanaged(struct { Id, u32 }, Id) = .empty,
167 array_types: std.AutoHashMapUnmanaged(struct { Id, Id }, Id) = .empty,
168
169 capabilities: std.AutoHashMapUnmanaged(spec.Capability, void) = .empty,
170 extensions: std.StringHashMapUnmanaged(void) = .empty,
171 extended_instruction_set: std.AutoHashMapUnmanaged(spec.InstructionSet, Id) = .empty,
172 decorations: std.AutoHashMapUnmanaged(struct { Id, spec.Decoration }, void) = .empty,
173 builtins: std.AutoHashMapUnmanaged(struct { Id, spec.BuiltIn }, Decl.Index) = .empty,
174
175 bool_const: [2]?Id = .{ null, null },
176} = .{},
177
178/// Set of Decls, referred to by Decl.Index.
179decls: std.ArrayListUnmanaged(Decl) = .empty,
180
181/// List of dependencies, per decl. This list holds all the dependencies, sliced by the
182/// begin_dep and end_dep in `self.decls`.
183decl_deps: std.ArrayListUnmanaged(Decl.Index) = .empty,
184
185/// The list of entry points that should be exported from this module.
186entry_points: std.AutoArrayHashMapUnmanaged(Id, EntryPoint) = .empty,
187
188pub fn init(gpa: Allocator, target: *const std.Target) Module {
189 const version_minor: u8 = blk: {
190 // Prefer higher versions
191 if (target.cpu.has(.spirv, .v1_6)) break :blk 6;
192 if (target.cpu.has(.spirv, .v1_5)) break :blk 5;
193 if (target.cpu.has(.spirv, .v1_4)) break :blk 4;
194 if (target.cpu.has(.spirv, .v1_3)) break :blk 3;
195 if (target.cpu.has(.spirv, .v1_2)) break :blk 2;
196 if (target.cpu.has(.spirv, .v1_1)) break :blk 1;
197 break :blk 0;
198 };
199
200 return .{
201 .gpa = gpa,
202 .arena = std.heap.ArenaAllocator.init(gpa),
203 .target = target,
204 .version = .{ .major = 1, .minor = version_minor },
205 .next_result_id = 1, // 0 is an invalid SPIR-V result id, so start counting at 1.
206 };
207}
208
209pub fn deinit(self: *Module) void {
210 self.sections.capabilities.deinit(self.gpa);
211 self.sections.extensions.deinit(self.gpa);
212 self.sections.extended_instruction_set.deinit(self.gpa);
213 self.sections.memory_model.deinit(self.gpa);
214 self.sections.execution_modes.deinit(self.gpa);
215 self.sections.debug_strings.deinit(self.gpa);
216 self.sections.debug_names.deinit(self.gpa);
217 self.sections.annotations.deinit(self.gpa);
218 self.sections.types_globals_constants.deinit(self.gpa);
219 self.sections.functions.deinit(self.gpa);
220
221 self.strings.deinit(self.gpa);
222
223 self.cache.int_types.deinit(self.gpa);
224 self.cache.float_types.deinit(self.gpa);
225 self.cache.vector_types.deinit(self.gpa);
226 self.cache.array_types.deinit(self.gpa);
227 self.cache.capabilities.deinit(self.gpa);
228 self.cache.extensions.deinit(self.gpa);
229 self.cache.extended_instruction_set.deinit(self.gpa);
230 self.cache.decorations.deinit(self.gpa);
231 self.cache.builtins.deinit(self.gpa);
232
233 self.decls.deinit(self.gpa);
234 self.decl_deps.deinit(self.gpa);
235 self.entry_points.deinit(self.gpa);
236
237 self.arena.deinit();
238
239 self.* = undefined;
240}
241
242pub const IdRange = struct {
243 base: u32,
244 len: u32,
245
246 pub fn at(range: IdRange, i: usize) Id {
247 assert(i < range.len);
248 return @enumFromInt(range.base + i);
249 }
250};
251
252pub fn allocIds(self: *Module, n: u32) IdRange {
253 defer self.next_result_id += n;
254 return .{
255 .base = self.next_result_id,
256 .len = n,
257 };
258}
259
260pub fn allocId(self: *Module) Id {
261 return self.allocIds(1).at(0);
262}
263
264pub fn idBound(self: Module) Word {
265 return self.next_result_id;
266}
267
268pub fn hasFeature(self: *Module, feature: std.Target.spirv.Feature) bool {
269 return self.target.cpu.has(.spirv, feature);
270}
271
272fn addEntryPointDeps(
273 self: *Module,
274 decl_index: Decl.Index,
275 seen: *std.DynamicBitSetUnmanaged,
276 interface: *std.ArrayList(Id),
277) !void {
278 const decl = self.declPtr(decl_index);
279 const deps = self.decl_deps.items[decl.begin_dep..decl.end_dep];
280
281 if (seen.isSet(@intFromEnum(decl_index))) {
282 return;
283 }
284
285 seen.set(@intFromEnum(decl_index));
286
287 if (decl.kind == .global) {
288 try interface.append(decl.result_id);
289 }
290
291 for (deps) |dep| {
292 try self.addEntryPointDeps(dep, seen, interface);
293 }
294}
295
296fn entryPoints(self: *Module) !Section {
297 var entry_points = Section{};
298 errdefer entry_points.deinit(self.gpa);
299
300 var interface = std.ArrayList(Id).init(self.gpa);
301 defer interface.deinit();
302
303 var seen = try std.DynamicBitSetUnmanaged.initEmpty(self.gpa, self.decls.items.len);
304 defer seen.deinit(self.gpa);
305
306 for (self.entry_points.keys(), self.entry_points.values()) |entry_point_id, entry_point| {
307 interface.items.len = 0;
308 seen.setRangeValue(.{ .start = 0, .end = self.decls.items.len }, false);
309
310 try self.addEntryPointDeps(entry_point.decl_index.?, &seen, &interface);
311 try entry_points.emit(self.gpa, .OpEntryPoint, .{
312 .execution_model = entry_point.exec_model.?,
313 .entry_point = entry_point_id,
314 .name = entry_point.name.?,
315 .interface = interface.items,
316 });
317
318 if (entry_point.exec_mode == null and entry_point.exec_model == .fragment) {
319 switch (self.target.os.tag) {
320 .vulkan, .opengl => |tag| {
321 try self.sections.execution_modes.emit(self.gpa, .OpExecutionMode, .{
322 .entry_point = entry_point_id,
323 .mode = if (tag == .vulkan) .origin_upper_left else .origin_lower_left,
324 });
325 },
326 .opencl => {},
327 else => unreachable,
328 }
329 }
330 }
331
332 return entry_points;
333}
334
335pub fn finalize(self: *Module, a: Allocator) ![]Word {
336 // Emit capabilities and extensions
337 switch (self.target.os.tag) {
338 .opengl => {
339 try self.addCapability(.shader);
340 try self.addCapability(.matrix);
341 },
342 .vulkan => {
343 try self.addCapability(.shader);
344 try self.addCapability(.matrix);
345 if (self.target.cpu.arch == .spirv64) {
346 try self.addExtension("SPV_KHR_physical_storage_buffer");
347 try self.addCapability(.physical_storage_buffer_addresses);
348 }
349 },
350 .opencl, .amdhsa => {
351 try self.addCapability(.kernel);
352 try self.addCapability(.addresses);
353 },
354 else => unreachable,
355 }
356 if (self.target.cpu.arch == .spirv64) try self.addCapability(.int64);
357 if (self.target.cpu.has(.spirv, .int64)) try self.addCapability(.int64);
358 if (self.target.cpu.has(.spirv, .float16)) try self.addCapability(.float16);
359 if (self.target.cpu.has(.spirv, .float64)) try self.addCapability(.float64);
360 if (self.target.cpu.has(.spirv, .generic_pointer)) try self.addCapability(.generic_pointer);
361 if (self.target.cpu.has(.spirv, .vector16)) try self.addCapability(.vector16);
362 if (self.target.cpu.has(.spirv, .storage_push_constant16)) {
363 try self.addExtension("SPV_KHR_16bit_storage");
364 try self.addCapability(.storage_push_constant16);
365 }
366 if (self.target.cpu.has(.spirv, .arbitrary_precision_integers)) {
367 try self.addExtension("SPV_INTEL_arbitrary_precision_integers");
368 try self.addCapability(.arbitrary_precision_integers_intel);
369 }
370 if (self.target.cpu.has(.spirv, .variable_pointers)) {
371 try self.addExtension("SPV_KHR_variable_pointers");
372 try self.addCapability(.variable_pointers_storage_buffer);
373 try self.addCapability(.variable_pointers);
374 }
375 // These are well supported
376 try self.addCapability(.int8);
377 try self.addCapability(.int16);
378
379 // Emit memory model
380 const addressing_model: spec.AddressingModel = switch (self.target.os.tag) {
381 .opengl => .logical,
382 .vulkan => if (self.target.cpu.arch == .spirv32) .logical else .physical_storage_buffer64,
383 .opencl => if (self.target.cpu.arch == .spirv32) .physical32 else .physical64,
384 .amdhsa => .physical64,
385 else => unreachable,
386 };
387 try self.sections.memory_model.emit(self.gpa, .OpMemoryModel, .{
388 .addressing_model = addressing_model,
389 .memory_model = switch (self.target.os.tag) {
390 .opencl => .open_cl,
391 .vulkan, .opengl => .glsl450,
392 else => unreachable,
393 },
394 });
395
396 // See SPIR-V Spec section 2.3, "Physical Layout of a SPIR-V Module and Instruction"
397 // TODO: Audit calls to allocId() in this function to make it idempotent.
398 var entry_points = try self.entryPoints();
399 defer entry_points.deinit(self.gpa);
400
401 const header = [_]Word{
402 spec.magic_number,
403 self.version.toWord(),
404 spec.zig_generator_id,
405 self.idBound(),
406 0, // Schema (currently reserved for future use)
407 };
408
409 var source = Section{};
410 defer source.deinit(self.gpa);
411 try self.sections.debug_strings.emit(self.gpa, .OpSource, .{
412 .source_language = .zig,
413 .version = 0,
414 // We cannot emit these because the Khronos translator does not parse this instruction
415 // correctly.
416 // See https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2188
417 .file = null,
418 .source = null,
419 });
420
421 // Note: needs to be kept in order according to section 2.3!
422 const buffers = &[_][]const Word{
423 &header,
424 self.sections.capabilities.toWords(),
425 self.sections.extensions.toWords(),
426 self.sections.extended_instruction_set.toWords(),
427 self.sections.memory_model.toWords(),
428 entry_points.toWords(),
429 self.sections.execution_modes.toWords(),
430 source.toWords(),
431 self.sections.debug_strings.toWords(),
432 self.sections.debug_names.toWords(),
433 self.sections.annotations.toWords(),
434 self.sections.types_globals_constants.toWords(),
435 self.sections.functions.toWords(),
436 };
437
438 var total_result_size: usize = 0;
439 for (buffers) |buffer| {
440 total_result_size += buffer.len;
441 }
442 const result = try a.alloc(Word, total_result_size);
443 errdefer a.free(result);
444
445 var offset: usize = 0;
446 for (buffers) |buffer| {
447 @memcpy(result[offset..][0..buffer.len], buffer);
448 offset += buffer.len;
449 }
450
451 return result;
452}
453
454/// Merge the sections making up a function declaration into this module.
455pub fn addFunction(self: *Module, decl_index: Decl.Index, func: Fn) !void {
456 try self.sections.functions.append(self.gpa, func.prologue);
457 try self.sections.functions.append(self.gpa, func.body);
458 try self.declareDeclDeps(decl_index, func.decl_deps.keys());
459}
460
461pub fn addCapability(self: *Module, cap: spec.Capability) !void {
462 const entry = try self.cache.capabilities.getOrPut(self.gpa, cap);
463 if (entry.found_existing) return;
464 try self.sections.capabilities.emit(self.gpa, .OpCapability, .{ .capability = cap });
465}
466
467pub fn addExtension(self: *Module, ext: []const u8) !void {
468 const entry = try self.cache.extensions.getOrPut(self.gpa, ext);
469 if (entry.found_existing) return;
470 try self.sections.extensions.emit(self.gpa, .OpExtension, .{ .name = ext });
471}
472
473/// Imports or returns the existing id of an extended instruction set
474pub fn importInstructionSet(self: *Module, set: spec.InstructionSet) !Id {
475 assert(set != .core);
476
477 const gop = try self.cache.extended_instruction_set.getOrPut(self.gpa, set);
478 if (gop.found_existing) return gop.value_ptr.*;
479
480 const result_id = self.allocId();
481 try self.sections.extended_instruction_set.emit(self.gpa, .OpExtInstImport, .{
482 .id_result = result_id,
483 .name = @tagName(set),
484 });
485 gop.value_ptr.* = result_id;
486
487 return result_id;
488}
489
490/// Fetch the result-id of an instruction corresponding to a string.
491pub fn resolveString(self: *Module, string: []const u8) !Id {
492 if (self.strings.get(string)) |id| {
493 return id;
494 }
495
496 const id = self.allocId();
497 try self.strings.put(self.gpa, try self.arena.allocator().dupe(u8, string), id);
498
499 try self.sections.debug_strings.emit(self.gpa, .OpString, .{
500 .id_result = id,
501 .string = string,
502 });
503
504 return id;
505}
506
507pub fn structType(self: *Module, result_id: Id, types: []const Id, maybe_names: ?[]const []const u8) !void {
508 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeStruct, .{
509 .id_result = result_id,
510 .id_ref = types,
511 });
512
513 if (maybe_names) |names| {
514 assert(names.len == types.len);
515 for (names, 0..) |name, i| {
516 try self.memberDebugName(result_id, @intCast(i), name);
517 }
518 }
519}
520
521pub fn boolType(self: *Module) !Id {
522 if (self.cache.bool_type) |id| return id;
523
524 const result_id = self.allocId();
525 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeBool, .{
526 .id_result = result_id,
527 });
528 self.cache.bool_type = result_id;
529 return result_id;
530}
531
532pub fn voidType(self: *Module) !Id {
533 if (self.cache.void_type) |id| return id;
534
535 const result_id = self.allocId();
536 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeVoid, .{
537 .id_result = result_id,
538 });
539 self.cache.void_type = result_id;
540 try self.debugName(result_id, "void");
541 return result_id;
542}
543
544pub fn intType(self: *Module, signedness: std.builtin.Signedness, bits: u16) !Id {
545 assert(bits > 0);
546 const entry = try self.cache.int_types.getOrPut(self.gpa, .{ .signedness = signedness, .bits = bits });
547 if (!entry.found_existing) {
548 const result_id = self.allocId();
549 entry.value_ptr.* = result_id;
550 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeInt, .{
551 .id_result = result_id,
552 .width = bits,
553 .signedness = switch (signedness) {
554 .signed => 1,
555 .unsigned => 0,
556 },
557 });
558
559 switch (signedness) {
560 .signed => try self.debugNameFmt(result_id, "i{}", .{bits}),
561 .unsigned => try self.debugNameFmt(result_id, "u{}", .{bits}),
562 }
563 }
564 return entry.value_ptr.*;
565}
566
567pub fn floatType(self: *Module, bits: u16) !Id {
568 assert(bits > 0);
569 const entry = try self.cache.float_types.getOrPut(self.gpa, .{ .bits = bits });
570 if (!entry.found_existing) {
571 const result_id = self.allocId();
572 entry.value_ptr.* = result_id;
573 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeFloat, .{
574 .id_result = result_id,
575 .width = bits,
576 });
577 try self.debugNameFmt(result_id, "f{}", .{bits});
578 }
579 return entry.value_ptr.*;
580}
581
582pub fn vectorType(self: *Module, len: u32, child_ty_id: Id) !Id {
583 const entry = try self.cache.vector_types.getOrPut(self.gpa, .{ child_ty_id, len });
584 if (!entry.found_existing) {
585 const result_id = self.allocId();
586 entry.value_ptr.* = result_id;
587 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeVector, .{
588 .id_result = result_id,
589 .component_type = child_ty_id,
590 .component_count = len,
591 });
592 }
593 return entry.value_ptr.*;
594}
595
596pub fn arrayType(self: *Module, len_id: Id, child_ty_id: Id) !Id {
597 const entry = try self.cache.array_types.getOrPut(self.gpa, .{ child_ty_id, len_id });
598 if (!entry.found_existing) {
599 const result_id = self.allocId();
600 entry.value_ptr.* = result_id;
601 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeArray, .{
602 .id_result = result_id,
603 .element_type = child_ty_id,
604 .length = len_id,
605 });
606 }
607 return entry.value_ptr.*;
608}
609
610pub fn functionType(self: *Module, return_ty_id: Id, param_type_ids: []const Id) !Id {
611 const result_id = self.allocId();
612 try self.sections.types_globals_constants.emit(self.gpa, .OpTypeFunction, .{
613 .id_result = result_id,
614 .return_type = return_ty_id,
615 .id_ref_2 = param_type_ids,
616 });
617 return result_id;
618}
619
620pub fn constant(self: *Module, result_ty_id: Id, value: spec.LiteralContextDependentNumber) !Id {
621 const result_id = self.allocId();
622 const section = &self.sections.types_globals_constants;
623 try section.emit(self.gpa, .OpConstant, .{
624 .id_result_type = result_ty_id,
625 .id_result = result_id,
626 .value = value,
627 });
628 return result_id;
629}
630
631pub fn constBool(self: *Module, value: bool) !Id {
632 if (self.cache.bool_const[@intFromBool(value)]) |b| return b;
633
634 const result_ty_id = try self.boolType();
635 const result_id = self.allocId();
636 self.cache.bool_const[@intFromBool(value)] = result_id;
637
638 switch (value) {
639 inline else => |value_ct| try self.sections.types_globals_constants.emit(
640 self.gpa,
641 if (value_ct) .OpConstantTrue else .OpConstantFalse,
642 .{
643 .id_result_type = result_ty_id,
644 .id_result = result_id,
645 },
646 ),
647 }
648
649 return result_id;
650}
651
652/// Return a pointer to a builtin variable. `result_ty_id` must be a **pointer**
653/// with storage class `.Input`.
654pub fn builtin(self: *Module, result_ty_id: Id, spirv_builtin: spec.BuiltIn) !Decl.Index {
655 const entry = try self.cache.builtins.getOrPut(self.gpa, .{ result_ty_id, spirv_builtin });
656 if (!entry.found_existing) {
657 const decl_index = try self.allocDecl(.global);
658 const result_id = self.declPtr(decl_index).result_id;
659 entry.value_ptr.* = decl_index;
660 try self.sections.types_globals_constants.emit(self.gpa, .OpVariable, .{
661 .id_result_type = result_ty_id,
662 .id_result = result_id,
663 .storage_class = .input,
664 });
665 try self.decorate(result_id, .{ .built_in = .{ .built_in = spirv_builtin } });
666 try self.declareDeclDeps(decl_index, &.{});
667 }
668 return entry.value_ptr.*;
669}
670
671pub fn constUndef(self: *Module, ty_id: Id) !Id {
672 const result_id = self.allocId();
673 try self.sections.types_globals_constants.emit(self.gpa, .OpUndef, .{
674 .id_result_type = ty_id,
675 .id_result = result_id,
676 });
677 return result_id;
678}
679
680pub fn constNull(self: *Module, ty_id: Id) !Id {
681 const result_id = self.allocId();
682 try self.sections.types_globals_constants.emit(self.gpa, .OpConstantNull, .{
683 .id_result_type = ty_id,
684 .id_result = result_id,
685 });
686 return result_id;
687}
688
689/// Decorate a result-id.
690pub fn decorate(
691 self: *Module,
692 target: Id,
693 decoration: spec.Decoration.Extended,
694) !void {
695 const entry = try self.cache.decorations.getOrPut(self.gpa, .{ target, decoration });
696 if (!entry.found_existing) {
697 try self.sections.annotations.emit(self.gpa, .OpDecorate, .{
698 .target = target,
699 .decoration = decoration,
700 });
701 }
702}
703
704/// Decorate a result-id which is a member of some struct.
705/// We really don't have to and shouldn't need to cache this.
706pub fn decorateMember(
707 self: *Module,
708 structure_type: Id,
709 member: u32,
710 decoration: spec.Decoration.Extended,
711) !void {
712 try self.sections.annotations.emit(self.gpa, .OpMemberDecorate, .{
713 .structure_type = structure_type,
714 .member = member,
715 .decoration = decoration,
716 });
717}
718
719pub fn allocDecl(self: *Module, kind: Decl.Kind) !Decl.Index {
720 try self.decls.append(self.gpa, .{
721 .kind = kind,
722 .result_id = self.allocId(),
723 .begin_dep = undefined,
724 .end_dep = undefined,
725 });
726
727 return @as(Decl.Index, @enumFromInt(@as(u32, @intCast(self.decls.items.len - 1))));
728}
729
730pub fn declPtr(self: *Module, index: Decl.Index) *Decl {
731 return &self.decls.items[@intFromEnum(index)];
732}
733
734/// Declare ALL dependencies for a decl.
735pub fn declareDeclDeps(self: *Module, decl_index: Decl.Index, deps: []const Decl.Index) !void {
736 const begin_dep: u32 = @intCast(self.decl_deps.items.len);
737 try self.decl_deps.appendSlice(self.gpa, deps);
738 const end_dep: u32 = @intCast(self.decl_deps.items.len);
739
740 const decl = self.declPtr(decl_index);
741 decl.begin_dep = begin_dep;
742 decl.end_dep = end_dep;
743}
744
745/// Declare a SPIR-V function as an entry point. This causes an extra wrapper
746/// function to be generated, which is then exported as the real entry point. The purpose of this
747/// wrapper is to allocate and initialize the structure holding the instance globals.
748pub fn declareEntryPoint(
749 self: *Module,
750 decl_index: Decl.Index,
751 name: []const u8,
752 exec_model: spec.ExecutionModel,
753 exec_mode: ?spec.ExecutionMode,
754) !void {
755 const gop = try self.entry_points.getOrPut(self.gpa, self.declPtr(decl_index).result_id);
756 gop.value_ptr.decl_index = decl_index;
757 gop.value_ptr.name = try self.arena.allocator().dupe(u8, name);
758 gop.value_ptr.exec_model = exec_model;
759 // Might've been set by assembler
760 if (!gop.found_existing) gop.value_ptr.exec_mode = exec_mode;
761}
762
763pub fn debugName(self: *Module, target: Id, name: []const u8) !void {
764 try self.sections.debug_names.emit(self.gpa, .OpName, .{
765 .target = target,
766 .name = name,
767 });
768}
769
770pub fn debugNameFmt(self: *Module, target: Id, comptime fmt: []const u8, args: anytype) !void {
771 const name = try std.fmt.allocPrint(self.gpa, fmt, args);
772 defer self.gpa.free(name);
773 try self.debugName(target, name);
774}
775
776pub fn memberDebugName(self: *Module, target: Id, member: u32, name: []const u8) !void {
777 try self.sections.debug_names.emit(self.gpa, .OpMemberName, .{
778 .type = target,
779 .member = member,
780 .name = name,
781 });
782}
src/codegen/spirv/Section.zig deleted-431
......@@ -1,431 +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
16/// The instructions in this section. Memory is owned by the Module
17/// externally associated to this Section.
18instructions: std.ArrayListUnmanaged(Word) = .empty,
19
20pub fn deinit(section: *Section, allocator: Allocator) void {
21 section.instructions.deinit(allocator);
22 section.* = undefined;
23}
24
25/// Clear the instructions in this section
26pub fn reset(section: *Section) void {
27 section.instructions.items.len = 0;
28}
29
30pub fn toWords(section: Section) []Word {
31 return section.instructions.items;
32}
33
34/// Append the instructions from another section into this section.
35pub fn append(section: *Section, allocator: Allocator, other_section: Section) !void {
36 try section.instructions.appendSlice(allocator, other_section.instructions.items);
37}
38
39/// Ensure capacity of at least `capacity` more words in this section.
40pub fn ensureUnusedCapacity(section: *Section, allocator: Allocator, capacity: usize) !void {
41 try section.instructions.ensureUnusedCapacity(allocator, capacity);
42}
43
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, // opcode itself not included
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 emit(
68 section: *Section,
69 allocator: Allocator,
70 comptime opcode: spec.Opcode,
71 operands: opcode.Operands(),
72) !void {
73 const word_count = instructionSize(opcode, operands);
74 try section.instructions.ensureUnusedCapacity(allocator, word_count);
75 section.writeWord(@as(Word, @intCast(word_count << 16)) | @intFromEnum(opcode));
76 section.writeOperands(opcode.Operands(), operands);
77}
78
79pub fn emitBranch(
80 section: *Section,
81 allocator: Allocator,
82 target_label: spec.Id,
83) !void {
84 try section.emit(allocator, .OpBranch, .{
85 .target_label = target_label,
86 });
87}
88
89pub fn emitSpecConstantOp(
90 section: *Section,
91 allocator: Allocator,
92 comptime opcode: spec.Opcode,
93 operands: opcode.Operands(),
94) !void {
95 const word_count = operandsSize(opcode.Operands(), operands);
96 try section.emitRaw(allocator, .OpSpecConstantOp, 1 + word_count);
97 section.writeOperand(spec.Id, operands.id_result_type);
98 section.writeOperand(spec.Id, operands.id_result);
99 section.writeOperand(Opcode, opcode);
100
101 const fields = @typeInfo(opcode.Operands()).@"struct".fields;
102 // First 2 fields are always id_result_type and id_result.
103 inline for (fields[2..]) |field| {
104 section.writeOperand(field.type, @field(operands, field.name));
105 }
106}
107
108pub fn writeWord(section: *Section, word: Word) void {
109 section.instructions.appendAssumeCapacity(word);
110}
111
112pub fn writeWords(section: *Section, words: []const Word) void {
113 section.instructions.appendSliceAssumeCapacity(words);
114}
115
116pub fn writeDoubleWord(section: *Section, dword: DoubleWord) void {
117 section.writeWords(&.{
118 @truncate(dword),
119 @truncate(dword >> @bitSizeOf(Word)),
120 });
121}
122
123fn writeOperands(section: *Section, comptime Operands: type, operands: Operands) void {
124 const fields = switch (@typeInfo(Operands)) {
125 .@"struct" => |info| info.fields,
126 .void => return,
127 else => unreachable,
128 };
129
130 inline for (fields) |field| {
131 section.writeOperand(field.type, @field(operands, field.name));
132 }
133}
134
135pub fn writeOperand(section: *Section, comptime Operand: type, operand: Operand) void {
136 switch (Operand) {
137 spec.Id => section.writeWord(@intFromEnum(operand)),
138
139 spec.LiteralInteger => section.writeWord(operand),
140
141 spec.LiteralString => section.writeString(operand),
142
143 spec.LiteralContextDependentNumber => section.writeContextDependentNumber(operand),
144
145 spec.LiteralExtInstInteger => section.writeWord(operand.inst),
146
147 // TODO: Where this type is used (OpSpecConstantOp) is currently not correct in the spec json,
148 // so it most likely needs to be altered into something that can actually describe the entire
149 // instruction in which it is used.
150 spec.LiteralSpecConstantOpInteger => section.writeWord(@intFromEnum(operand.opcode)),
151
152 spec.PairLiteralIntegerIdRef => section.writeWords(&.{ operand.value, @enumFromInt(operand.label) }),
153 spec.PairIdRefLiteralInteger => section.writeWords(&.{ @intFromEnum(operand.target), operand.member }),
154 spec.PairIdRefIdRef => section.writeWords(&.{ @intFromEnum(operand[0]), @intFromEnum(operand[1]) }),
155
156 else => switch (@typeInfo(Operand)) {
157 .@"enum" => section.writeWord(@intFromEnum(operand)),
158 .optional => |info| if (operand) |child| {
159 section.writeOperand(info.child, child);
160 },
161 .pointer => |info| {
162 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
163 for (operand) |item| {
164 section.writeOperand(info.child, item);
165 }
166 },
167 .@"struct" => |info| {
168 if (info.layout == .@"packed") {
169 section.writeWord(@as(Word, @bitCast(operand)));
170 } else {
171 section.writeExtendedMask(Operand, operand);
172 }
173 },
174 .@"union" => section.writeExtendedUnion(Operand, operand),
175 else => unreachable,
176 },
177 }
178}
179
180fn writeString(section: *Section, str: []const u8) void {
181 // TODO: Not actually sure whether this is correct for big-endian.
182 // See https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#Literal
183 const zero_terminated_len = str.len + 1;
184 var i: usize = 0;
185 while (i < zero_terminated_len) : (i += @sizeOf(Word)) {
186 var word: Word = 0;
187
188 var j: usize = 0;
189 while (j < @sizeOf(Word) and i + j < str.len) : (j += 1) {
190 word |= @as(Word, str[i + j]) << @as(Log2Word, @intCast(j * @bitSizeOf(u8)));
191 }
192
193 section.instructions.appendAssumeCapacity(word);
194 }
195}
196
197fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDependentNumber) void {
198 switch (operand) {
199 .int32 => |int| section.writeWord(@bitCast(int)),
200 .uint32 => |int| section.writeWord(@bitCast(int)),
201 .int64 => |int| section.writeDoubleWord(@bitCast(int)),
202 .uint64 => |int| section.writeDoubleWord(@bitCast(int)),
203 .float32 => |float| section.writeWord(@bitCast(float)),
204 .float64 => |float| section.writeDoubleWord(@bitCast(float)),
205 }
206}
207
208fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {
209 var mask: Word = 0;
210 inline for (@typeInfo(Operand).@"struct".fields, 0..) |field, bit| {
211 switch (@typeInfo(field.type)) {
212 .optional => if (@field(operand, field.name) != null) {
213 mask |= 1 << @as(u5, @intCast(bit));
214 },
215 .bool => if (@field(operand, field.name)) {
216 mask |= 1 << @as(u5, @intCast(bit));
217 },
218 else => unreachable,
219 }
220 }
221
222 section.writeWord(mask);
223
224 inline for (@typeInfo(Operand).@"struct".fields) |field| {
225 switch (@typeInfo(field.type)) {
226 .optional => |info| if (@field(operand, field.name)) |child| {
227 section.writeOperands(info.child, child);
228 },
229 .bool => {},
230 else => unreachable,
231 }
232 }
233}
234
235fn writeExtendedUnion(section: *Section, comptime Operand: type, operand: Operand) void {
236 const tag = std.meta.activeTag(operand);
237 section.writeWord(@intFromEnum(tag));
238
239 inline for (@typeInfo(Operand).@"union".fields) |field| {
240 if (@field(Operand, field.name) == tag) {
241 section.writeOperands(field.type, @field(operand, field.name));
242 return;
243 }
244 }
245 unreachable;
246}
247
248fn instructionSize(comptime opcode: spec.Opcode, operands: opcode.Operands()) usize {
249 return 1 + operandsSize(opcode.Operands(), operands);
250}
251
252fn operandsSize(comptime Operands: type, operands: Operands) usize {
253 const fields = switch (@typeInfo(Operands)) {
254 .@"struct" => |info| info.fields,
255 .void => return 0,
256 else => unreachable,
257 };
258
259 var total: usize = 0;
260 inline for (fields) |field| {
261 total += operandSize(field.type, @field(operands, field.name));
262 }
263
264 return total;
265}
266
267fn operandSize(comptime Operand: type, operand: Operand) usize {
268 return switch (Operand) {
269 spec.Id,
270 spec.LiteralInteger,
271 spec.LiteralExtInstInteger,
272 => 1,
273
274 spec.LiteralString => std.math.divCeil(usize, operand.len + 1, @sizeOf(Word)) catch unreachable, // Add one for zero-terminator
275
276 spec.LiteralContextDependentNumber => switch (operand) {
277 .int32, .uint32, .float32 => 1,
278 .int64, .uint64, .float64 => 2,
279 },
280
281 // TODO: Where this type is used (OpSpecConstantOp) is currently not correct in the spec
282 // json, so it most likely needs to be altered into something that can actually
283 // describe the entire insturction in which it is used.
284 spec.LiteralSpecConstantOpInteger => 1,
285
286 spec.PairLiteralIntegerIdRef,
287 spec.PairIdRefLiteralInteger,
288 spec.PairIdRefIdRef,
289 => 2,
290
291 else => switch (@typeInfo(Operand)) {
292 .@"enum" => 1,
293 .optional => |info| if (operand) |child| operandSize(info.child, child) else 0,
294 .pointer => |info| blk: {
295 std.debug.assert(info.size == .slice); // Should be no other pointer types in the spec.
296 var total: usize = 0;
297 for (operand) |item| {
298 total += operandSize(info.child, item);
299 }
300 break :blk total;
301 },
302 .@"struct" => |info| if (info.layout == .@"packed") 1 else extendedMaskSize(Operand, operand),
303 .@"union" => extendedUnionSize(Operand, operand),
304 else => unreachable,
305 },
306 };
307}
308
309fn extendedMaskSize(comptime Operand: type, operand: Operand) usize {
310 var total: usize = 0;
311 var any_set = false;
312 inline for (@typeInfo(Operand).@"struct".fields) |field| {
313 switch (@typeInfo(field.type)) {
314 .optional => |info| if (@field(operand, field.name)) |child| {
315 total += operandsSize(info.child, child);
316 any_set = true;
317 },
318 .bool => if (@field(operand, field.name)) {
319 any_set = true;
320 },
321 else => unreachable,
322 }
323 }
324 return total + 1; // Add one for the mask itself.
325}
326
327fn extendedUnionSize(comptime Operand: type, operand: Operand) usize {
328 const tag = std.meta.activeTag(operand);
329 inline for (@typeInfo(Operand).@"union".fields) |field| {
330 if (@field(Operand, field.name) == tag) {
331 // Add one for the tag itself.
332 return 1 + operandsSize(field.type, @field(operand, field.name));
333 }
334 }
335 unreachable;
336}
337
338test "SPIR-V Section emit() - no operands" {
339 var section = Section{};
340 defer section.deinit(std.testing.allocator);
341
342 try section.emit(std.testing.allocator, .OpNop, {});
343
344 try testing.expect(section.instructions.items[0] == (@as(Word, 1) << 16) | @intFromEnum(Opcode.OpNop));
345}
346
347test "SPIR-V Section emit() - simple" {
348 var section = Section{};
349 defer section.deinit(std.testing.allocator);
350
351 try section.emit(std.testing.allocator, .OpUndef, .{
352 .id_result_type = @enumFromInt(0),
353 .id_result = @enumFromInt(1),
354 });
355
356 try testing.expectEqualSlices(Word, &.{
357 (@as(Word, 3) << 16) | @intFromEnum(Opcode.OpUndef),
358 0,
359 1,
360 }, section.instructions.items);
361}
362
363test "SPIR-V Section emit() - string" {
364 var section = Section{};
365 defer section.deinit(std.testing.allocator);
366
367 try section.emit(std.testing.allocator, .OpSource, .{
368 .source_language = .Unknown,
369 .version = 123,
370 .file = @enumFromInt(256),
371 .source = "pub fn main() void {}",
372 });
373
374 try testing.expectEqualSlices(Word, &.{
375 (@as(Word, 10) << 16) | @intFromEnum(Opcode.OpSource),
376 @intFromEnum(spec.SourceLanguage.Unknown),
377 123,
378 456,
379 std.mem.bytesToValue(Word, "pub "),
380 std.mem.bytesToValue(Word, "fn m"),
381 std.mem.bytesToValue(Word, "ain("),
382 std.mem.bytesToValue(Word, ") vo"),
383 std.mem.bytesToValue(Word, "id {"),
384 std.mem.bytesToValue(Word, "}\x00\x00\x00"),
385 }, section.instructions.items);
386}
387
388test "SPIR-V Section emit() - extended mask" {
389 var section = Section{};
390 defer section.deinit(std.testing.allocator);
391
392 try section.emit(std.testing.allocator, .OpLoopMerge, .{
393 .merge_block = @enumFromInt(10),
394 .continue_target = @enumFromInt(20),
395 .loop_control = .{
396 .Unroll = true,
397 .DependencyLength = .{
398 .literal_integer = 2,
399 },
400 },
401 });
402
403 try testing.expectEqualSlices(Word, &.{
404 (@as(Word, 5) << 16) | @intFromEnum(Opcode.OpLoopMerge),
405 10,
406 20,
407 @as(Word, @bitCast(spec.LoopControl{ .Unroll = true, .DependencyLength = true })),
408 2,
409 }, section.instructions.items);
410}
411
412test "SPIR-V Section emit() - extended union" {
413 var section = Section{};
414 defer section.deinit(std.testing.allocator);
415
416 try section.emit(std.testing.allocator, .OpExecutionMode, .{
417 .entry_point = @enumFromInt(888),
418 .mode = .{
419 .LocalSize = .{ .x_size = 4, .y_size = 8, .z_size = 16 },
420 },
421 });
422
423 try testing.expectEqualSlices(Word, &.{
424 (@as(Word, 6) << 16) | @intFromEnum(Opcode.OpExecutionMode),
425 888,
426 @intFromEnum(spec.ExecutionMode.LocalSize),
427 4,
428 8,
429 16,
430 }, section.instructions.items);
431}
src/codegen/spirv/extinst.zig.grammar.json deleted-11
......@@ -1,11 +0,0 @@
1{
2 "version": 0,
3 "revision": 0,
4 "instructions": [
5 {
6 "opname": "InvocationGlobal",
7 "opcode": 0,
8 "operands": [{ "kind": "IdRef", "name": "initializer function" }]
9 }
10 ]
11}
src/codegen/spirv/spec.zig deleted-18418
......@@ -1,18418 +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 LiteralInteger = Word;
30pub const LiteralFloat = Word;
31pub const LiteralString = []const u8;
32pub const LiteralContextDependentNumber = union(enum) {
33 int32: i32,
34 uint32: u32,
35 int64: i64,
36 uint64: u64,
37 float32: f32,
38 float64: f64,
39};
40pub const LiteralExtInstInteger = struct { inst: Word };
41pub const LiteralSpecConstantOpInteger = struct { opcode: Opcode };
42pub const PairLiteralIntegerIdRef = struct { value: LiteralInteger, label: Id };
43pub const PairIdRefLiteralInteger = struct { target: Id, member: LiteralInteger };
44pub const PairIdRefIdRef = [2]Id;
45
46pub const Quantifier = enum {
47 required,
48 optional,
49 variadic,
50};
51
52pub const Operand = struct {
53 kind: OperandKind,
54 quantifier: Quantifier,
55};
56
57pub const OperandCategory = enum {
58 bit_enum,
59 value_enum,
60 id,
61 literal,
62 composite,
63};
64
65pub const Enumerant = struct {
66 name: []const u8,
67 value: Word,
68 parameters: []const OperandKind,
69};
70
71pub const Instruction = struct {
72 name: []const u8,
73 opcode: Word,
74 operands: []const Operand,
75};
76
77pub const zig_generator_id: Word = 41;
78pub const version: Version = .{ .major = 1, .minor = 6, .patch = 4 };
79pub const magic_number: Word = 0x07230203;
80
81pub const Class = enum {
82 miscellaneous,
83 debug,
84 extension,
85 mode_setting,
86 type_declaration,
87 constant_creation,
88 function,
89 memory,
90 annotation,
91 composite,
92 image,
93 conversion,
94 arithmetic,
95 relational_and_logical,
96 bit,
97 derivative,
98 primitive,
99 barrier,
100 atomic,
101 control_flow,
102 group,
103 pipe,
104 device_side_enqueue,
105 non_uniform,
106 tensor,
107 graph,
108 reserved,
109};
110
111pub const OperandKind = enum {
112 opcode,
113 image_operands,
114 fp_fast_math_mode,
115 selection_control,
116 loop_control,
117 function_control,
118 memory_semantics,
119 memory_access,
120 kernel_profiling_info,
121 ray_flags,
122 fragment_shading_rate,
123 raw_access_chain_operands,
124 source_language,
125 execution_model,
126 addressing_model,
127 memory_model,
128 execution_mode,
129 storage_class,
130 dim,
131 sampler_addressing_mode,
132 sampler_filter_mode,
133 image_format,
134 image_channel_order,
135 image_channel_data_type,
136 fp_rounding_mode,
137 fp_denorm_mode,
138 quantization_modes,
139 fp_operation_mode,
140 overflow_modes,
141 linkage_type,
142 access_qualifier,
143 host_access_qualifier,
144 function_parameter_attribute,
145 decoration,
146 built_in,
147 scope,
148 group_operation,
149 kernel_enqueue_flags,
150 capability,
151 ray_query_intersection,
152 ray_query_committed_intersection_type,
153 ray_query_candidate_intersection_type,
154 packed_vector_format,
155 cooperative_matrix_operands,
156 cooperative_matrix_layout,
157 cooperative_matrix_use,
158 cooperative_matrix_reduce,
159 tensor_clamp_mode,
160 tensor_addressing_operands,
161 initialization_mode_qualifier,
162 load_cache_control,
163 store_cache_control,
164 named_maximum_number_of_registers,
165 matrix_multiply_accumulate_operands,
166 fp_encoding,
167 cooperative_vector_matrix_layout,
168 component_type,
169 id_result_type,
170 id_result,
171 id_memory_semantics,
172 id_scope,
173 id_ref,
174 literal_integer,
175 literal_string,
176 literal_float,
177 literal_context_dependent_number,
178 literal_ext_inst_integer,
179 literal_spec_constant_op_integer,
180 pair_literal_integer_id_ref,
181 pair_id_ref_literal_integer,
182 pair_id_ref_id_ref,
183 tensor_operands,
184 debug_info_debug_info_flags,
185 debug_info_debug_base_type_attribute_encoding,
186 debug_info_debug_composite_type,
187 debug_info_debug_type_qualifier,
188 debug_info_debug_operation,
189 open_cl_debug_info_100_debug_info_flags,
190 open_cl_debug_info_100_debug_base_type_attribute_encoding,
191 open_cl_debug_info_100_debug_composite_type,
192 open_cl_debug_info_100_debug_type_qualifier,
193 open_cl_debug_info_100_debug_operation,
194 open_cl_debug_info_100_debug_imported_entity,
195 non_semantic_clspv_reflection_6_kernel_property_flags,
196 non_semantic_shader_debug_info_100_debug_info_flags,
197 non_semantic_shader_debug_info_100_build_identifier_flags,
198 non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding,
199 non_semantic_shader_debug_info_100_debug_composite_type,
200 non_semantic_shader_debug_info_100_debug_type_qualifier,
201 non_semantic_shader_debug_info_100_debug_operation,
202 non_semantic_shader_debug_info_100_debug_imported_entity,
203
204 pub fn category(self: OperandKind) OperandCategory {
205 return switch (self) {
206 .opcode => .literal,
207 .image_operands => .bit_enum,
208 .fp_fast_math_mode => .bit_enum,
209 .selection_control => .bit_enum,
210 .loop_control => .bit_enum,
211 .function_control => .bit_enum,
212 .memory_semantics => .bit_enum,
213 .memory_access => .bit_enum,
214 .kernel_profiling_info => .bit_enum,
215 .ray_flags => .bit_enum,
216 .fragment_shading_rate => .bit_enum,
217 .raw_access_chain_operands => .bit_enum,
218 .source_language => .value_enum,
219 .execution_model => .value_enum,
220 .addressing_model => .value_enum,
221 .memory_model => .value_enum,
222 .execution_mode => .value_enum,
223 .storage_class => .value_enum,
224 .dim => .value_enum,
225 .sampler_addressing_mode => .value_enum,
226 .sampler_filter_mode => .value_enum,
227 .image_format => .value_enum,
228 .image_channel_order => .value_enum,
229 .image_channel_data_type => .value_enum,
230 .fp_rounding_mode => .value_enum,
231 .fp_denorm_mode => .value_enum,
232 .quantization_modes => .value_enum,
233 .fp_operation_mode => .value_enum,
234 .overflow_modes => .value_enum,
235 .linkage_type => .value_enum,
236 .access_qualifier => .value_enum,
237 .host_access_qualifier => .value_enum,
238 .function_parameter_attribute => .value_enum,
239 .decoration => .value_enum,
240 .built_in => .value_enum,
241 .scope => .value_enum,
242 .group_operation => .value_enum,
243 .kernel_enqueue_flags => .value_enum,
244 .capability => .value_enum,
245 .ray_query_intersection => .value_enum,
246 .ray_query_committed_intersection_type => .value_enum,
247 .ray_query_candidate_intersection_type => .value_enum,
248 .packed_vector_format => .value_enum,
249 .cooperative_matrix_operands => .bit_enum,
250 .cooperative_matrix_layout => .value_enum,
251 .cooperative_matrix_use => .value_enum,
252 .cooperative_matrix_reduce => .bit_enum,
253 .tensor_clamp_mode => .value_enum,
254 .tensor_addressing_operands => .bit_enum,
255 .initialization_mode_qualifier => .value_enum,
256 .load_cache_control => .value_enum,
257 .store_cache_control => .value_enum,
258 .named_maximum_number_of_registers => .value_enum,
259 .matrix_multiply_accumulate_operands => .bit_enum,
260 .fp_encoding => .value_enum,
261 .cooperative_vector_matrix_layout => .value_enum,
262 .component_type => .value_enum,
263 .id_result_type => .id,
264 .id_result => .id,
265 .id_memory_semantics => .id,
266 .id_scope => .id,
267 .id_ref => .id,
268 .literal_integer => .literal,
269 .literal_string => .literal,
270 .literal_float => .literal,
271 .literal_context_dependent_number => .literal,
272 .literal_ext_inst_integer => .literal,
273 .literal_spec_constant_op_integer => .literal,
274 .pair_literal_integer_id_ref => .composite,
275 .pair_id_ref_literal_integer => .composite,
276 .pair_id_ref_id_ref => .composite,
277 .tensor_operands => .bit_enum,
278 .debug_info_debug_info_flags => .bit_enum,
279 .debug_info_debug_base_type_attribute_encoding => .value_enum,
280 .debug_info_debug_composite_type => .value_enum,
281 .debug_info_debug_type_qualifier => .value_enum,
282 .debug_info_debug_operation => .value_enum,
283 .open_cl_debug_info_100_debug_info_flags => .bit_enum,
284 .open_cl_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
285 .open_cl_debug_info_100_debug_composite_type => .value_enum,
286 .open_cl_debug_info_100_debug_type_qualifier => .value_enum,
287 .open_cl_debug_info_100_debug_operation => .value_enum,
288 .open_cl_debug_info_100_debug_imported_entity => .value_enum,
289 .non_semantic_clspv_reflection_6_kernel_property_flags => .bit_enum,
290 .non_semantic_shader_debug_info_100_debug_info_flags => .bit_enum,
291 .non_semantic_shader_debug_info_100_build_identifier_flags => .bit_enum,
292 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => .value_enum,
293 .non_semantic_shader_debug_info_100_debug_composite_type => .value_enum,
294 .non_semantic_shader_debug_info_100_debug_type_qualifier => .value_enum,
295 .non_semantic_shader_debug_info_100_debug_operation => .value_enum,
296 .non_semantic_shader_debug_info_100_debug_imported_entity => .value_enum,
297 };
298 }
299 pub fn enumerants(self: OperandKind) []const Enumerant {
300 return switch (self) {
301 .opcode => unreachable,
302 .image_operands => &.{
303 .{ .name = "Bias", .value = 0x0001, .parameters = &.{.id_ref} },
304 .{ .name = "Lod", .value = 0x0002, .parameters = &.{.id_ref} },
305 .{ .name = "Grad", .value = 0x0004, .parameters = &.{ .id_ref, .id_ref } },
306 .{ .name = "ConstOffset", .value = 0x0008, .parameters = &.{.id_ref} },
307 .{ .name = "Offset", .value = 0x0010, .parameters = &.{.id_ref} },
308 .{ .name = "ConstOffsets", .value = 0x0020, .parameters = &.{.id_ref} },
309 .{ .name = "Sample", .value = 0x0040, .parameters = &.{.id_ref} },
310 .{ .name = "MinLod", .value = 0x0080, .parameters = &.{.id_ref} },
311 .{ .name = "MakeTexelAvailable", .value = 0x0100, .parameters = &.{.id_scope} },
312 .{ .name = "MakeTexelVisible", .value = 0x0200, .parameters = &.{.id_scope} },
313 .{ .name = "NonPrivateTexel", .value = 0x0400, .parameters = &.{} },
314 .{ .name = "VolatileTexel", .value = 0x0800, .parameters = &.{} },
315 .{ .name = "SignExtend", .value = 0x1000, .parameters = &.{} },
316 .{ .name = "ZeroExtend", .value = 0x2000, .parameters = &.{} },
317 .{ .name = "Nontemporal", .value = 0x4000, .parameters = &.{} },
318 .{ .name = "Offsets", .value = 0x10000, .parameters = &.{.id_ref} },
319 },
320 .fp_fast_math_mode => &.{
321 .{ .name = "NotNaN", .value = 0x0001, .parameters = &.{} },
322 .{ .name = "NotInf", .value = 0x0002, .parameters = &.{} },
323 .{ .name = "NSZ", .value = 0x0004, .parameters = &.{} },
324 .{ .name = "AllowRecip", .value = 0x0008, .parameters = &.{} },
325 .{ .name = "Fast", .value = 0x0010, .parameters = &.{} },
326 .{ .name = "AllowContract", .value = 0x10000, .parameters = &.{} },
327 .{ .name = "AllowReassoc", .value = 0x20000, .parameters = &.{} },
328 .{ .name = "AllowTransform", .value = 0x40000, .parameters = &.{} },
329 },
330 .selection_control => &.{
331 .{ .name = "Flatten", .value = 0x0001, .parameters = &.{} },
332 .{ .name = "DontFlatten", .value = 0x0002, .parameters = &.{} },
333 },
334 .loop_control => &.{
335 .{ .name = "Unroll", .value = 0x0001, .parameters = &.{} },
336 .{ .name = "DontUnroll", .value = 0x0002, .parameters = &.{} },
337 .{ .name = "DependencyInfinite", .value = 0x0004, .parameters = &.{} },
338 .{ .name = "DependencyLength", .value = 0x0008, .parameters = &.{.literal_integer} },
339 .{ .name = "MinIterations", .value = 0x0010, .parameters = &.{.literal_integer} },
340 .{ .name = "MaxIterations", .value = 0x0020, .parameters = &.{.literal_integer} },
341 .{ .name = "IterationMultiple", .value = 0x0040, .parameters = &.{.literal_integer} },
342 .{ .name = "PeelCount", .value = 0x0080, .parameters = &.{.literal_integer} },
343 .{ .name = "PartialCount", .value = 0x0100, .parameters = &.{.literal_integer} },
344 .{ .name = "InitiationIntervalINTEL", .value = 0x10000, .parameters = &.{.literal_integer} },
345 .{ .name = "MaxConcurrencyINTEL", .value = 0x20000, .parameters = &.{.literal_integer} },
346 .{ .name = "DependencyArrayINTEL", .value = 0x40000, .parameters = &.{.literal_integer} },
347 .{ .name = "PipelineEnableINTEL", .value = 0x80000, .parameters = &.{.literal_integer} },
348 .{ .name = "LoopCoalesceINTEL", .value = 0x100000, .parameters = &.{.literal_integer} },
349 .{ .name = "MaxInterleavingINTEL", .value = 0x200000, .parameters = &.{.literal_integer} },
350 .{ .name = "SpeculatedIterationsINTEL", .value = 0x400000, .parameters = &.{.literal_integer} },
351 .{ .name = "NoFusionINTEL", .value = 0x800000, .parameters = &.{} },
352 .{ .name = "LoopCountINTEL", .value = 0x1000000, .parameters = &.{.literal_integer} },
353 .{ .name = "MaxReinvocationDelayINTEL", .value = 0x2000000, .parameters = &.{.literal_integer} },
354 },
355 .function_control => &.{
356 .{ .name = "Inline", .value = 0x0001, .parameters = &.{} },
357 .{ .name = "DontInline", .value = 0x0002, .parameters = &.{} },
358 .{ .name = "Pure", .value = 0x0004, .parameters = &.{} },
359 .{ .name = "Const", .value = 0x0008, .parameters = &.{} },
360 .{ .name = "OptNoneEXT", .value = 0x10000, .parameters = &.{} },
361 },
362 .memory_semantics => &.{
363 .{ .name = "Relaxed", .value = 0x0000, .parameters = &.{} },
364 .{ .name = "Acquire", .value = 0x0002, .parameters = &.{} },
365 .{ .name = "Release", .value = 0x0004, .parameters = &.{} },
366 .{ .name = "AcquireRelease", .value = 0x0008, .parameters = &.{} },
367 .{ .name = "SequentiallyConsistent", .value = 0x0010, .parameters = &.{} },
368 .{ .name = "UniformMemory", .value = 0x0040, .parameters = &.{} },
369 .{ .name = "SubgroupMemory", .value = 0x0080, .parameters = &.{} },
370 .{ .name = "WorkgroupMemory", .value = 0x0100, .parameters = &.{} },
371 .{ .name = "CrossWorkgroupMemory", .value = 0x0200, .parameters = &.{} },
372 .{ .name = "AtomicCounterMemory", .value = 0x0400, .parameters = &.{} },
373 .{ .name = "ImageMemory", .value = 0x0800, .parameters = &.{} },
374 .{ .name = "OutputMemory", .value = 0x1000, .parameters = &.{} },
375 .{ .name = "MakeAvailable", .value = 0x2000, .parameters = &.{} },
376 .{ .name = "MakeVisible", .value = 0x4000, .parameters = &.{} },
377 .{ .name = "Volatile", .value = 0x8000, .parameters = &.{} },
378 },
379 .memory_access => &.{
380 .{ .name = "Volatile", .value = 0x0001, .parameters = &.{} },
381 .{ .name = "Aligned", .value = 0x0002, .parameters = &.{.literal_integer} },
382 .{ .name = "Nontemporal", .value = 0x0004, .parameters = &.{} },
383 .{ .name = "MakePointerAvailable", .value = 0x0008, .parameters = &.{.id_scope} },
384 .{ .name = "MakePointerVisible", .value = 0x0010, .parameters = &.{.id_scope} },
385 .{ .name = "NonPrivatePointer", .value = 0x0020, .parameters = &.{} },
386 .{ .name = "AliasScopeINTELMask", .value = 0x10000, .parameters = &.{.id_ref} },
387 .{ .name = "NoAliasINTELMask", .value = 0x20000, .parameters = &.{.id_ref} },
388 },
389 .kernel_profiling_info => &.{
390 .{ .name = "CmdExecTime", .value = 0x0001, .parameters = &.{} },
391 },
392 .ray_flags => &.{
393 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
394 .{ .name = "OpaqueKHR", .value = 0x0001, .parameters = &.{} },
395 .{ .name = "NoOpaqueKHR", .value = 0x0002, .parameters = &.{} },
396 .{ .name = "TerminateOnFirstHitKHR", .value = 0x0004, .parameters = &.{} },
397 .{ .name = "SkipClosestHitShaderKHR", .value = 0x0008, .parameters = &.{} },
398 .{ .name = "CullBackFacingTrianglesKHR", .value = 0x0010, .parameters = &.{} },
399 .{ .name = "CullFrontFacingTrianglesKHR", .value = 0x0020, .parameters = &.{} },
400 .{ .name = "CullOpaqueKHR", .value = 0x0040, .parameters = &.{} },
401 .{ .name = "CullNoOpaqueKHR", .value = 0x0080, .parameters = &.{} },
402 .{ .name = "SkipTrianglesKHR", .value = 0x0100, .parameters = &.{} },
403 .{ .name = "SkipAABBsKHR", .value = 0x0200, .parameters = &.{} },
404 .{ .name = "ForceOpacityMicromap2StateEXT", .value = 0x0400, .parameters = &.{} },
405 },
406 .fragment_shading_rate => &.{
407 .{ .name = "Vertical2Pixels", .value = 0x0001, .parameters = &.{} },
408 .{ .name = "Vertical4Pixels", .value = 0x0002, .parameters = &.{} },
409 .{ .name = "Horizontal2Pixels", .value = 0x0004, .parameters = &.{} },
410 .{ .name = "Horizontal4Pixels", .value = 0x0008, .parameters = &.{} },
411 },
412 .raw_access_chain_operands => &.{
413 .{ .name = "RobustnessPerComponentNV", .value = 0x0001, .parameters = &.{} },
414 .{ .name = "RobustnessPerElementNV", .value = 0x0002, .parameters = &.{} },
415 },
416 .source_language => &.{
417 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
418 .{ .name = "ESSL", .value = 1, .parameters = &.{} },
419 .{ .name = "GLSL", .value = 2, .parameters = &.{} },
420 .{ .name = "OpenCL_C", .value = 3, .parameters = &.{} },
421 .{ .name = "OpenCL_CPP", .value = 4, .parameters = &.{} },
422 .{ .name = "HLSL", .value = 5, .parameters = &.{} },
423 .{ .name = "CPP_for_OpenCL", .value = 6, .parameters = &.{} },
424 .{ .name = "SYCL", .value = 7, .parameters = &.{} },
425 .{ .name = "HERO_C", .value = 8, .parameters = &.{} },
426 .{ .name = "NZSL", .value = 9, .parameters = &.{} },
427 .{ .name = "WGSL", .value = 10, .parameters = &.{} },
428 .{ .name = "Slang", .value = 11, .parameters = &.{} },
429 .{ .name = "Zig", .value = 12, .parameters = &.{} },
430 .{ .name = "Rust", .value = 13, .parameters = &.{} },
431 },
432 .execution_model => &.{
433 .{ .name = "Vertex", .value = 0, .parameters = &.{} },
434 .{ .name = "TessellationControl", .value = 1, .parameters = &.{} },
435 .{ .name = "TessellationEvaluation", .value = 2, .parameters = &.{} },
436 .{ .name = "Geometry", .value = 3, .parameters = &.{} },
437 .{ .name = "Fragment", .value = 4, .parameters = &.{} },
438 .{ .name = "GLCompute", .value = 5, .parameters = &.{} },
439 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
440 .{ .name = "TaskNV", .value = 5267, .parameters = &.{} },
441 .{ .name = "MeshNV", .value = 5268, .parameters = &.{} },
442 .{ .name = "RayGenerationKHR", .value = 5313, .parameters = &.{} },
443 .{ .name = "IntersectionKHR", .value = 5314, .parameters = &.{} },
444 .{ .name = "AnyHitKHR", .value = 5315, .parameters = &.{} },
445 .{ .name = "ClosestHitKHR", .value = 5316, .parameters = &.{} },
446 .{ .name = "MissKHR", .value = 5317, .parameters = &.{} },
447 .{ .name = "CallableKHR", .value = 5318, .parameters = &.{} },
448 .{ .name = "TaskEXT", .value = 5364, .parameters = &.{} },
449 .{ .name = "MeshEXT", .value = 5365, .parameters = &.{} },
450 },
451 .addressing_model => &.{
452 .{ .name = "Logical", .value = 0, .parameters = &.{} },
453 .{ .name = "Physical32", .value = 1, .parameters = &.{} },
454 .{ .name = "Physical64", .value = 2, .parameters = &.{} },
455 .{ .name = "PhysicalStorageBuffer64", .value = 5348, .parameters = &.{} },
456 },
457 .memory_model => &.{
458 .{ .name = "Simple", .value = 0, .parameters = &.{} },
459 .{ .name = "GLSL450", .value = 1, .parameters = &.{} },
460 .{ .name = "OpenCL", .value = 2, .parameters = &.{} },
461 .{ .name = "Vulkan", .value = 3, .parameters = &.{} },
462 },
463 .execution_mode => &.{
464 .{ .name = "Invocations", .value = 0, .parameters = &.{.literal_integer} },
465 .{ .name = "SpacingEqual", .value = 1, .parameters = &.{} },
466 .{ .name = "SpacingFractionalEven", .value = 2, .parameters = &.{} },
467 .{ .name = "SpacingFractionalOdd", .value = 3, .parameters = &.{} },
468 .{ .name = "VertexOrderCw", .value = 4, .parameters = &.{} },
469 .{ .name = "VertexOrderCcw", .value = 5, .parameters = &.{} },
470 .{ .name = "PixelCenterInteger", .value = 6, .parameters = &.{} },
471 .{ .name = "OriginUpperLeft", .value = 7, .parameters = &.{} },
472 .{ .name = "OriginLowerLeft", .value = 8, .parameters = &.{} },
473 .{ .name = "EarlyFragmentTests", .value = 9, .parameters = &.{} },
474 .{ .name = "PointMode", .value = 10, .parameters = &.{} },
475 .{ .name = "Xfb", .value = 11, .parameters = &.{} },
476 .{ .name = "DepthReplacing", .value = 12, .parameters = &.{} },
477 .{ .name = "DepthGreater", .value = 14, .parameters = &.{} },
478 .{ .name = "DepthLess", .value = 15, .parameters = &.{} },
479 .{ .name = "DepthUnchanged", .value = 16, .parameters = &.{} },
480 .{ .name = "LocalSize", .value = 17, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
481 .{ .name = "LocalSizeHint", .value = 18, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
482 .{ .name = "InputPoints", .value = 19, .parameters = &.{} },
483 .{ .name = "InputLines", .value = 20, .parameters = &.{} },
484 .{ .name = "InputLinesAdjacency", .value = 21, .parameters = &.{} },
485 .{ .name = "Triangles", .value = 22, .parameters = &.{} },
486 .{ .name = "InputTrianglesAdjacency", .value = 23, .parameters = &.{} },
487 .{ .name = "Quads", .value = 24, .parameters = &.{} },
488 .{ .name = "Isolines", .value = 25, .parameters = &.{} },
489 .{ .name = "OutputVertices", .value = 26, .parameters = &.{.literal_integer} },
490 .{ .name = "OutputPoints", .value = 27, .parameters = &.{} },
491 .{ .name = "OutputLineStrip", .value = 28, .parameters = &.{} },
492 .{ .name = "OutputTriangleStrip", .value = 29, .parameters = &.{} },
493 .{ .name = "VecTypeHint", .value = 30, .parameters = &.{.literal_integer} },
494 .{ .name = "ContractionOff", .value = 31, .parameters = &.{} },
495 .{ .name = "Initializer", .value = 33, .parameters = &.{} },
496 .{ .name = "Finalizer", .value = 34, .parameters = &.{} },
497 .{ .name = "SubgroupSize", .value = 35, .parameters = &.{.literal_integer} },
498 .{ .name = "SubgroupsPerWorkgroup", .value = 36, .parameters = &.{.literal_integer} },
499 .{ .name = "SubgroupsPerWorkgroupId", .value = 37, .parameters = &.{.id_ref} },
500 .{ .name = "LocalSizeId", .value = 38, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
501 .{ .name = "LocalSizeHintId", .value = 39, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
502 .{ .name = "NonCoherentColorAttachmentReadEXT", .value = 4169, .parameters = &.{} },
503 .{ .name = "NonCoherentDepthAttachmentReadEXT", .value = 4170, .parameters = &.{} },
504 .{ .name = "NonCoherentStencilAttachmentReadEXT", .value = 4171, .parameters = &.{} },
505 .{ .name = "SubgroupUniformControlFlowKHR", .value = 4421, .parameters = &.{} },
506 .{ .name = "PostDepthCoverage", .value = 4446, .parameters = &.{} },
507 .{ .name = "DenormPreserve", .value = 4459, .parameters = &.{.literal_integer} },
508 .{ .name = "DenormFlushToZero", .value = 4460, .parameters = &.{.literal_integer} },
509 .{ .name = "SignedZeroInfNanPreserve", .value = 4461, .parameters = &.{.literal_integer} },
510 .{ .name = "RoundingModeRTE", .value = 4462, .parameters = &.{.literal_integer} },
511 .{ .name = "RoundingModeRTZ", .value = 4463, .parameters = &.{.literal_integer} },
512 .{ .name = "NonCoherentTileAttachmentReadQCOM", .value = 4489, .parameters = &.{} },
513 .{ .name = "TileShadingRateQCOM", .value = 4490, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
514 .{ .name = "EarlyAndLateFragmentTestsAMD", .value = 5017, .parameters = &.{} },
515 .{ .name = "StencilRefReplacingEXT", .value = 5027, .parameters = &.{} },
516 .{ .name = "CoalescingAMDX", .value = 5069, .parameters = &.{} },
517 .{ .name = "IsApiEntryAMDX", .value = 5070, .parameters = &.{.id_ref} },
518 .{ .name = "MaxNodeRecursionAMDX", .value = 5071, .parameters = &.{.id_ref} },
519 .{ .name = "StaticNumWorkgroupsAMDX", .value = 5072, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
520 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{.id_ref} },
521 .{ .name = "MaxNumWorkgroupsAMDX", .value = 5077, .parameters = &.{ .id_ref, .id_ref, .id_ref } },
522 .{ .name = "StencilRefUnchangedFrontAMD", .value = 5079, .parameters = &.{} },
523 .{ .name = "StencilRefGreaterFrontAMD", .value = 5080, .parameters = &.{} },
524 .{ .name = "StencilRefLessFrontAMD", .value = 5081, .parameters = &.{} },
525 .{ .name = "StencilRefUnchangedBackAMD", .value = 5082, .parameters = &.{} },
526 .{ .name = "StencilRefGreaterBackAMD", .value = 5083, .parameters = &.{} },
527 .{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },
528 .{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },
529 .{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },
530 .{ .name = "SharesInputWithAMDX", .value = 5102, .parameters = &.{ .id_ref, .id_ref } },
531 .{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },
532 .{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.literal_integer} },
533 .{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },
534 .{ .name = "DerivativeGroupLinearKHR", .value = 5290, .parameters = &.{} },
535 .{ .name = "OutputTrianglesEXT", .value = 5298, .parameters = &.{} },
536 .{ .name = "PixelInterlockOrderedEXT", .value = 5366, .parameters = &.{} },
537 .{ .name = "PixelInterlockUnorderedEXT", .value = 5367, .parameters = &.{} },
538 .{ .name = "SampleInterlockOrderedEXT", .value = 5368, .parameters = &.{} },
539 .{ .name = "SampleInterlockUnorderedEXT", .value = 5369, .parameters = &.{} },
540 .{ .name = "ShadingRateInterlockOrderedEXT", .value = 5370, .parameters = &.{} },
541 .{ .name = "ShadingRateInterlockUnorderedEXT", .value = 5371, .parameters = &.{} },
542 .{ .name = "SharedLocalMemorySizeINTEL", .value = 5618, .parameters = &.{.literal_integer} },
543 .{ .name = "RoundingModeRTPINTEL", .value = 5620, .parameters = &.{.literal_integer} },
544 .{ .name = "RoundingModeRTNINTEL", .value = 5621, .parameters = &.{.literal_integer} },
545 .{ .name = "FloatingPointModeALTINTEL", .value = 5622, .parameters = &.{.literal_integer} },
546 .{ .name = "FloatingPointModeIEEEINTEL", .value = 5623, .parameters = &.{.literal_integer} },
547 .{ .name = "MaxWorkgroupSizeINTEL", .value = 5893, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
548 .{ .name = "MaxWorkDimINTEL", .value = 5894, .parameters = &.{.literal_integer} },
549 .{ .name = "NoGlobalOffsetINTEL", .value = 5895, .parameters = &.{} },
550 .{ .name = "NumSIMDWorkitemsINTEL", .value = 5896, .parameters = &.{.literal_integer} },
551 .{ .name = "SchedulerTargetFmaxMhzINTEL", .value = 5903, .parameters = &.{.literal_integer} },
552 .{ .name = "MaximallyReconvergesKHR", .value = 6023, .parameters = &.{} },
553 .{ .name = "FPFastMathDefault", .value = 6028, .parameters = &.{ .id_ref, .id_ref } },
554 .{ .name = "StreamingInterfaceINTEL", .value = 6154, .parameters = &.{.literal_integer} },
555 .{ .name = "RegisterMapInterfaceINTEL", .value = 6160, .parameters = &.{.literal_integer} },
556 .{ .name = "NamedBarrierCountINTEL", .value = 6417, .parameters = &.{.literal_integer} },
557 .{ .name = "MaximumRegistersINTEL", .value = 6461, .parameters = &.{.literal_integer} },
558 .{ .name = "MaximumRegistersIdINTEL", .value = 6462, .parameters = &.{.id_ref} },
559 .{ .name = "NamedMaximumRegistersINTEL", .value = 6463, .parameters = &.{.named_maximum_number_of_registers} },
560 },
561 .storage_class => &.{
562 .{ .name = "UniformConstant", .value = 0, .parameters = &.{} },
563 .{ .name = "Input", .value = 1, .parameters = &.{} },
564 .{ .name = "Uniform", .value = 2, .parameters = &.{} },
565 .{ .name = "Output", .value = 3, .parameters = &.{} },
566 .{ .name = "Workgroup", .value = 4, .parameters = &.{} },
567 .{ .name = "CrossWorkgroup", .value = 5, .parameters = &.{} },
568 .{ .name = "Private", .value = 6, .parameters = &.{} },
569 .{ .name = "Function", .value = 7, .parameters = &.{} },
570 .{ .name = "Generic", .value = 8, .parameters = &.{} },
571 .{ .name = "PushConstant", .value = 9, .parameters = &.{} },
572 .{ .name = "AtomicCounter", .value = 10, .parameters = &.{} },
573 .{ .name = "Image", .value = 11, .parameters = &.{} },
574 .{ .name = "StorageBuffer", .value = 12, .parameters = &.{} },
575 .{ .name = "TileImageEXT", .value = 4172, .parameters = &.{} },
576 .{ .name = "TileAttachmentQCOM", .value = 4491, .parameters = &.{} },
577 .{ .name = "NodePayloadAMDX", .value = 5068, .parameters = &.{} },
578 .{ .name = "CallableDataKHR", .value = 5328, .parameters = &.{} },
579 .{ .name = "IncomingCallableDataKHR", .value = 5329, .parameters = &.{} },
580 .{ .name = "RayPayloadKHR", .value = 5338, .parameters = &.{} },
581 .{ .name = "HitAttributeKHR", .value = 5339, .parameters = &.{} },
582 .{ .name = "IncomingRayPayloadKHR", .value = 5342, .parameters = &.{} },
583 .{ .name = "ShaderRecordBufferKHR", .value = 5343, .parameters = &.{} },
584 .{ .name = "PhysicalStorageBuffer", .value = 5349, .parameters = &.{} },
585 .{ .name = "HitObjectAttributeNV", .value = 5385, .parameters = &.{} },
586 .{ .name = "TaskPayloadWorkgroupEXT", .value = 5402, .parameters = &.{} },
587 .{ .name = "CodeSectionINTEL", .value = 5605, .parameters = &.{} },
588 .{ .name = "DeviceOnlyINTEL", .value = 5936, .parameters = &.{} },
589 .{ .name = "HostOnlyINTEL", .value = 5937, .parameters = &.{} },
590 },
591 .dim => &.{
592 .{ .name = "1D", .value = 0, .parameters = &.{} },
593 .{ .name = "2D", .value = 1, .parameters = &.{} },
594 .{ .name = "3D", .value = 2, .parameters = &.{} },
595 .{ .name = "Cube", .value = 3, .parameters = &.{} },
596 .{ .name = "Rect", .value = 4, .parameters = &.{} },
597 .{ .name = "Buffer", .value = 5, .parameters = &.{} },
598 .{ .name = "SubpassData", .value = 6, .parameters = &.{} },
599 .{ .name = "TileImageDataEXT", .value = 4173, .parameters = &.{} },
600 },
601 .sampler_addressing_mode => &.{
602 .{ .name = "None", .value = 0, .parameters = &.{} },
603 .{ .name = "ClampToEdge", .value = 1, .parameters = &.{} },
604 .{ .name = "Clamp", .value = 2, .parameters = &.{} },
605 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
606 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
607 },
608 .sampler_filter_mode => &.{
609 .{ .name = "Nearest", .value = 0, .parameters = &.{} },
610 .{ .name = "Linear", .value = 1, .parameters = &.{} },
611 },
612 .image_format => &.{
613 .{ .name = "Unknown", .value = 0, .parameters = &.{} },
614 .{ .name = "Rgba32f", .value = 1, .parameters = &.{} },
615 .{ .name = "Rgba16f", .value = 2, .parameters = &.{} },
616 .{ .name = "R32f", .value = 3, .parameters = &.{} },
617 .{ .name = "Rgba8", .value = 4, .parameters = &.{} },
618 .{ .name = "Rgba8Snorm", .value = 5, .parameters = &.{} },
619 .{ .name = "Rg32f", .value = 6, .parameters = &.{} },
620 .{ .name = "Rg16f", .value = 7, .parameters = &.{} },
621 .{ .name = "R11fG11fB10f", .value = 8, .parameters = &.{} },
622 .{ .name = "R16f", .value = 9, .parameters = &.{} },
623 .{ .name = "Rgba16", .value = 10, .parameters = &.{} },
624 .{ .name = "Rgb10A2", .value = 11, .parameters = &.{} },
625 .{ .name = "Rg16", .value = 12, .parameters = &.{} },
626 .{ .name = "Rg8", .value = 13, .parameters = &.{} },
627 .{ .name = "R16", .value = 14, .parameters = &.{} },
628 .{ .name = "R8", .value = 15, .parameters = &.{} },
629 .{ .name = "Rgba16Snorm", .value = 16, .parameters = &.{} },
630 .{ .name = "Rg16Snorm", .value = 17, .parameters = &.{} },
631 .{ .name = "Rg8Snorm", .value = 18, .parameters = &.{} },
632 .{ .name = "R16Snorm", .value = 19, .parameters = &.{} },
633 .{ .name = "R8Snorm", .value = 20, .parameters = &.{} },
634 .{ .name = "Rgba32i", .value = 21, .parameters = &.{} },
635 .{ .name = "Rgba16i", .value = 22, .parameters = &.{} },
636 .{ .name = "Rgba8i", .value = 23, .parameters = &.{} },
637 .{ .name = "R32i", .value = 24, .parameters = &.{} },
638 .{ .name = "Rg32i", .value = 25, .parameters = &.{} },
639 .{ .name = "Rg16i", .value = 26, .parameters = &.{} },
640 .{ .name = "Rg8i", .value = 27, .parameters = &.{} },
641 .{ .name = "R16i", .value = 28, .parameters = &.{} },
642 .{ .name = "R8i", .value = 29, .parameters = &.{} },
643 .{ .name = "Rgba32ui", .value = 30, .parameters = &.{} },
644 .{ .name = "Rgba16ui", .value = 31, .parameters = &.{} },
645 .{ .name = "Rgba8ui", .value = 32, .parameters = &.{} },
646 .{ .name = "R32ui", .value = 33, .parameters = &.{} },
647 .{ .name = "Rgb10a2ui", .value = 34, .parameters = &.{} },
648 .{ .name = "Rg32ui", .value = 35, .parameters = &.{} },
649 .{ .name = "Rg16ui", .value = 36, .parameters = &.{} },
650 .{ .name = "Rg8ui", .value = 37, .parameters = &.{} },
651 .{ .name = "R16ui", .value = 38, .parameters = &.{} },
652 .{ .name = "R8ui", .value = 39, .parameters = &.{} },
653 .{ .name = "R64ui", .value = 40, .parameters = &.{} },
654 .{ .name = "R64i", .value = 41, .parameters = &.{} },
655 },
656 .image_channel_order => &.{
657 .{ .name = "R", .value = 0, .parameters = &.{} },
658 .{ .name = "A", .value = 1, .parameters = &.{} },
659 .{ .name = "RG", .value = 2, .parameters = &.{} },
660 .{ .name = "RA", .value = 3, .parameters = &.{} },
661 .{ .name = "RGB", .value = 4, .parameters = &.{} },
662 .{ .name = "RGBA", .value = 5, .parameters = &.{} },
663 .{ .name = "BGRA", .value = 6, .parameters = &.{} },
664 .{ .name = "ARGB", .value = 7, .parameters = &.{} },
665 .{ .name = "Intensity", .value = 8, .parameters = &.{} },
666 .{ .name = "Luminance", .value = 9, .parameters = &.{} },
667 .{ .name = "Rx", .value = 10, .parameters = &.{} },
668 .{ .name = "RGx", .value = 11, .parameters = &.{} },
669 .{ .name = "RGBx", .value = 12, .parameters = &.{} },
670 .{ .name = "Depth", .value = 13, .parameters = &.{} },
671 .{ .name = "DepthStencil", .value = 14, .parameters = &.{} },
672 .{ .name = "sRGB", .value = 15, .parameters = &.{} },
673 .{ .name = "sRGBx", .value = 16, .parameters = &.{} },
674 .{ .name = "sRGBA", .value = 17, .parameters = &.{} },
675 .{ .name = "sBGRA", .value = 18, .parameters = &.{} },
676 .{ .name = "ABGR", .value = 19, .parameters = &.{} },
677 },
678 .image_channel_data_type => &.{
679 .{ .name = "SnormInt8", .value = 0, .parameters = &.{} },
680 .{ .name = "SnormInt16", .value = 1, .parameters = &.{} },
681 .{ .name = "UnormInt8", .value = 2, .parameters = &.{} },
682 .{ .name = "UnormInt16", .value = 3, .parameters = &.{} },
683 .{ .name = "UnormShort565", .value = 4, .parameters = &.{} },
684 .{ .name = "UnormShort555", .value = 5, .parameters = &.{} },
685 .{ .name = "UnormInt101010", .value = 6, .parameters = &.{} },
686 .{ .name = "SignedInt8", .value = 7, .parameters = &.{} },
687 .{ .name = "SignedInt16", .value = 8, .parameters = &.{} },
688 .{ .name = "SignedInt32", .value = 9, .parameters = &.{} },
689 .{ .name = "UnsignedInt8", .value = 10, .parameters = &.{} },
690 .{ .name = "UnsignedInt16", .value = 11, .parameters = &.{} },
691 .{ .name = "UnsignedInt32", .value = 12, .parameters = &.{} },
692 .{ .name = "HalfFloat", .value = 13, .parameters = &.{} },
693 .{ .name = "Float", .value = 14, .parameters = &.{} },
694 .{ .name = "UnormInt24", .value = 15, .parameters = &.{} },
695 .{ .name = "UnormInt101010_2", .value = 16, .parameters = &.{} },
696 .{ .name = "UnormInt10X6EXT", .value = 17, .parameters = &.{} },
697 .{ .name = "UnsignedIntRaw10EXT", .value = 19, .parameters = &.{} },
698 .{ .name = "UnsignedIntRaw12EXT", .value = 20, .parameters = &.{} },
699 .{ .name = "UnormInt2_101010EXT", .value = 21, .parameters = &.{} },
700 .{ .name = "UnsignedInt10X6EXT", .value = 22, .parameters = &.{} },
701 .{ .name = "UnsignedInt12X4EXT", .value = 23, .parameters = &.{} },
702 .{ .name = "UnsignedInt14X2EXT", .value = 24, .parameters = &.{} },
703 .{ .name = "UnormInt12X4EXT", .value = 25, .parameters = &.{} },
704 .{ .name = "UnormInt14X2EXT", .value = 26, .parameters = &.{} },
705 },
706 .fp_rounding_mode => &.{
707 .{ .name = "RTE", .value = 0, .parameters = &.{} },
708 .{ .name = "RTZ", .value = 1, .parameters = &.{} },
709 .{ .name = "RTP", .value = 2, .parameters = &.{} },
710 .{ .name = "RTN", .value = 3, .parameters = &.{} },
711 },
712 .fp_denorm_mode => &.{
713 .{ .name = "Preserve", .value = 0, .parameters = &.{} },
714 .{ .name = "FlushToZero", .value = 1, .parameters = &.{} },
715 },
716 .quantization_modes => &.{
717 .{ .name = "TRN", .value = 0, .parameters = &.{} },
718 .{ .name = "TRN_ZERO", .value = 1, .parameters = &.{} },
719 .{ .name = "RND", .value = 2, .parameters = &.{} },
720 .{ .name = "RND_ZERO", .value = 3, .parameters = &.{} },
721 .{ .name = "RND_INF", .value = 4, .parameters = &.{} },
722 .{ .name = "RND_MIN_INF", .value = 5, .parameters = &.{} },
723 .{ .name = "RND_CONV", .value = 6, .parameters = &.{} },
724 .{ .name = "RND_CONV_ODD", .value = 7, .parameters = &.{} },
725 },
726 .fp_operation_mode => &.{
727 .{ .name = "IEEE", .value = 0, .parameters = &.{} },
728 .{ .name = "ALT", .value = 1, .parameters = &.{} },
729 },
730 .overflow_modes => &.{
731 .{ .name = "WRAP", .value = 0, .parameters = &.{} },
732 .{ .name = "SAT", .value = 1, .parameters = &.{} },
733 .{ .name = "SAT_ZERO", .value = 2, .parameters = &.{} },
734 .{ .name = "SAT_SYM", .value = 3, .parameters = &.{} },
735 },
736 .linkage_type => &.{
737 .{ .name = "Export", .value = 0, .parameters = &.{} },
738 .{ .name = "Import", .value = 1, .parameters = &.{} },
739 .{ .name = "LinkOnceODR", .value = 2, .parameters = &.{} },
740 },
741 .access_qualifier => &.{
742 .{ .name = "ReadOnly", .value = 0, .parameters = &.{} },
743 .{ .name = "WriteOnly", .value = 1, .parameters = &.{} },
744 .{ .name = "ReadWrite", .value = 2, .parameters = &.{} },
745 },
746 .host_access_qualifier => &.{
747 .{ .name = "NoneINTEL", .value = 0, .parameters = &.{} },
748 .{ .name = "ReadINTEL", .value = 1, .parameters = &.{} },
749 .{ .name = "WriteINTEL", .value = 2, .parameters = &.{} },
750 .{ .name = "ReadWriteINTEL", .value = 3, .parameters = &.{} },
751 },
752 .function_parameter_attribute => &.{
753 .{ .name = "Zext", .value = 0, .parameters = &.{} },
754 .{ .name = "Sext", .value = 1, .parameters = &.{} },
755 .{ .name = "ByVal", .value = 2, .parameters = &.{} },
756 .{ .name = "Sret", .value = 3, .parameters = &.{} },
757 .{ .name = "NoAlias", .value = 4, .parameters = &.{} },
758 .{ .name = "NoCapture", .value = 5, .parameters = &.{} },
759 .{ .name = "NoWrite", .value = 6, .parameters = &.{} },
760 .{ .name = "NoReadWrite", .value = 7, .parameters = &.{} },
761 .{ .name = "RuntimeAlignedINTEL", .value = 5940, .parameters = &.{} },
762 },
763 .decoration => &.{
764 .{ .name = "RelaxedPrecision", .value = 0, .parameters = &.{} },
765 .{ .name = "SpecId", .value = 1, .parameters = &.{.literal_integer} },
766 .{ .name = "Block", .value = 2, .parameters = &.{} },
767 .{ .name = "BufferBlock", .value = 3, .parameters = &.{} },
768 .{ .name = "RowMajor", .value = 4, .parameters = &.{} },
769 .{ .name = "ColMajor", .value = 5, .parameters = &.{} },
770 .{ .name = "ArrayStride", .value = 6, .parameters = &.{.literal_integer} },
771 .{ .name = "MatrixStride", .value = 7, .parameters = &.{.literal_integer} },
772 .{ .name = "GLSLShared", .value = 8, .parameters = &.{} },
773 .{ .name = "GLSLPacked", .value = 9, .parameters = &.{} },
774 .{ .name = "CPacked", .value = 10, .parameters = &.{} },
775 .{ .name = "BuiltIn", .value = 11, .parameters = &.{.built_in} },
776 .{ .name = "NoPerspective", .value = 13, .parameters = &.{} },
777 .{ .name = "Flat", .value = 14, .parameters = &.{} },
778 .{ .name = "Patch", .value = 15, .parameters = &.{} },
779 .{ .name = "Centroid", .value = 16, .parameters = &.{} },
780 .{ .name = "Sample", .value = 17, .parameters = &.{} },
781 .{ .name = "Invariant", .value = 18, .parameters = &.{} },
782 .{ .name = "Restrict", .value = 19, .parameters = &.{} },
783 .{ .name = "Aliased", .value = 20, .parameters = &.{} },
784 .{ .name = "Volatile", .value = 21, .parameters = &.{} },
785 .{ .name = "Constant", .value = 22, .parameters = &.{} },
786 .{ .name = "Coherent", .value = 23, .parameters = &.{} },
787 .{ .name = "NonWritable", .value = 24, .parameters = &.{} },
788 .{ .name = "NonReadable", .value = 25, .parameters = &.{} },
789 .{ .name = "Uniform", .value = 26, .parameters = &.{} },
790 .{ .name = "UniformId", .value = 27, .parameters = &.{.id_scope} },
791 .{ .name = "SaturatedConversion", .value = 28, .parameters = &.{} },
792 .{ .name = "Stream", .value = 29, .parameters = &.{.literal_integer} },
793 .{ .name = "Location", .value = 30, .parameters = &.{.literal_integer} },
794 .{ .name = "Component", .value = 31, .parameters = &.{.literal_integer} },
795 .{ .name = "Index", .value = 32, .parameters = &.{.literal_integer} },
796 .{ .name = "Binding", .value = 33, .parameters = &.{.literal_integer} },
797 .{ .name = "DescriptorSet", .value = 34, .parameters = &.{.literal_integer} },
798 .{ .name = "Offset", .value = 35, .parameters = &.{.literal_integer} },
799 .{ .name = "XfbBuffer", .value = 36, .parameters = &.{.literal_integer} },
800 .{ .name = "XfbStride", .value = 37, .parameters = &.{.literal_integer} },
801 .{ .name = "FuncParamAttr", .value = 38, .parameters = &.{.function_parameter_attribute} },
802 .{ .name = "FPRoundingMode", .value = 39, .parameters = &.{.fp_rounding_mode} },
803 .{ .name = "FPFastMathMode", .value = 40, .parameters = &.{.fp_fast_math_mode} },
804 .{ .name = "LinkageAttributes", .value = 41, .parameters = &.{ .literal_string, .linkage_type } },
805 .{ .name = "NoContraction", .value = 42, .parameters = &.{} },
806 .{ .name = "InputAttachmentIndex", .value = 43, .parameters = &.{.literal_integer} },
807 .{ .name = "Alignment", .value = 44, .parameters = &.{.literal_integer} },
808 .{ .name = "MaxByteOffset", .value = 45, .parameters = &.{.literal_integer} },
809 .{ .name = "AlignmentId", .value = 46, .parameters = &.{.id_ref} },
810 .{ .name = "MaxByteOffsetId", .value = 47, .parameters = &.{.id_ref} },
811 .{ .name = "SaturatedToLargestFloat8NormalConversionEXT", .value = 4216, .parameters = &.{} },
812 .{ .name = "NoSignedWrap", .value = 4469, .parameters = &.{} },
813 .{ .name = "NoUnsignedWrap", .value = 4470, .parameters = &.{} },
814 .{ .name = "WeightTextureQCOM", .value = 4487, .parameters = &.{} },
815 .{ .name = "BlockMatchTextureQCOM", .value = 4488, .parameters = &.{} },
816 .{ .name = "BlockMatchSamplerQCOM", .value = 4499, .parameters = &.{} },
817 .{ .name = "ExplicitInterpAMD", .value = 4999, .parameters = &.{} },
818 .{ .name = "NodeSharesPayloadLimitsWithAMDX", .value = 5019, .parameters = &.{.id_ref} },
819 .{ .name = "NodeMaxPayloadsAMDX", .value = 5020, .parameters = &.{.id_ref} },
820 .{ .name = "TrackFinishWritingAMDX", .value = 5078, .parameters = &.{} },
821 .{ .name = "PayloadNodeNameAMDX", .value = 5091, .parameters = &.{.id_ref} },
822 .{ .name = "PayloadNodeBaseIndexAMDX", .value = 5098, .parameters = &.{.id_ref} },
823 .{ .name = "PayloadNodeSparseArrayAMDX", .value = 5099, .parameters = &.{} },
824 .{ .name = "PayloadNodeArraySizeAMDX", .value = 5100, .parameters = &.{.id_ref} },
825 .{ .name = "PayloadDispatchIndirectAMDX", .value = 5105, .parameters = &.{} },
826 .{ .name = "OverrideCoverageNV", .value = 5248, .parameters = &.{} },
827 .{ .name = "PassthroughNV", .value = 5250, .parameters = &.{} },
828 .{ .name = "ViewportRelativeNV", .value = 5252, .parameters = &.{} },
829 .{ .name = "SecondaryViewportRelativeNV", .value = 5256, .parameters = &.{.literal_integer} },
830 .{ .name = "PerPrimitiveEXT", .value = 5271, .parameters = &.{} },
831 .{ .name = "PerViewNV", .value = 5272, .parameters = &.{} },
832 .{ .name = "PerTaskNV", .value = 5273, .parameters = &.{} },
833 .{ .name = "PerVertexKHR", .value = 5285, .parameters = &.{} },
834 .{ .name = "NonUniform", .value = 5300, .parameters = &.{} },
835 .{ .name = "RestrictPointer", .value = 5355, .parameters = &.{} },
836 .{ .name = "AliasedPointer", .value = 5356, .parameters = &.{} },
837 .{ .name = "HitObjectShaderRecordBufferNV", .value = 5386, .parameters = &.{} },
838 .{ .name = "BindlessSamplerNV", .value = 5398, .parameters = &.{} },
839 .{ .name = "BindlessImageNV", .value = 5399, .parameters = &.{} },
840 .{ .name = "BoundSamplerNV", .value = 5400, .parameters = &.{} },
841 .{ .name = "BoundImageNV", .value = 5401, .parameters = &.{} },
842 .{ .name = "SIMTCallINTEL", .value = 5599, .parameters = &.{.literal_integer} },
843 .{ .name = "ReferencedIndirectlyINTEL", .value = 5602, .parameters = &.{} },
844 .{ .name = "ClobberINTEL", .value = 5607, .parameters = &.{.literal_string} },
845 .{ .name = "SideEffectsINTEL", .value = 5608, .parameters = &.{} },
846 .{ .name = "VectorComputeVariableINTEL", .value = 5624, .parameters = &.{} },
847 .{ .name = "FuncParamIOKindINTEL", .value = 5625, .parameters = &.{.literal_integer} },
848 .{ .name = "VectorComputeFunctionINTEL", .value = 5626, .parameters = &.{} },
849 .{ .name = "StackCallINTEL", .value = 5627, .parameters = &.{} },
850 .{ .name = "GlobalVariableOffsetINTEL", .value = 5628, .parameters = &.{.literal_integer} },
851 .{ .name = "CounterBuffer", .value = 5634, .parameters = &.{.id_ref} },
852 .{ .name = "UserSemantic", .value = 5635, .parameters = &.{.literal_string} },
853 .{ .name = "UserTypeGOOGLE", .value = 5636, .parameters = &.{.literal_string} },
854 .{ .name = "FunctionRoundingModeINTEL", .value = 5822, .parameters = &.{ .literal_integer, .fp_rounding_mode } },
855 .{ .name = "FunctionDenormModeINTEL", .value = 5823, .parameters = &.{ .literal_integer, .fp_denorm_mode } },
856 .{ .name = "RegisterINTEL", .value = 5825, .parameters = &.{} },
857 .{ .name = "MemoryINTEL", .value = 5826, .parameters = &.{.literal_string} },
858 .{ .name = "NumbanksINTEL", .value = 5827, .parameters = &.{.literal_integer} },
859 .{ .name = "BankwidthINTEL", .value = 5828, .parameters = &.{.literal_integer} },
860 .{ .name = "MaxPrivateCopiesINTEL", .value = 5829, .parameters = &.{.literal_integer} },
861 .{ .name = "SinglepumpINTEL", .value = 5830, .parameters = &.{} },
862 .{ .name = "DoublepumpINTEL", .value = 5831, .parameters = &.{} },
863 .{ .name = "MaxReplicatesINTEL", .value = 5832, .parameters = &.{.literal_integer} },
864 .{ .name = "SimpleDualPortINTEL", .value = 5833, .parameters = &.{} },
865 .{ .name = "MergeINTEL", .value = 5834, .parameters = &.{ .literal_string, .literal_string } },
866 .{ .name = "BankBitsINTEL", .value = 5835, .parameters = &.{.literal_integer} },
867 .{ .name = "ForcePow2DepthINTEL", .value = 5836, .parameters = &.{.literal_integer} },
868 .{ .name = "StridesizeINTEL", .value = 5883, .parameters = &.{.literal_integer} },
869 .{ .name = "WordsizeINTEL", .value = 5884, .parameters = &.{.literal_integer} },
870 .{ .name = "TrueDualPortINTEL", .value = 5885, .parameters = &.{} },
871 .{ .name = "BurstCoalesceINTEL", .value = 5899, .parameters = &.{} },
872 .{ .name = "CacheSizeINTEL", .value = 5900, .parameters = &.{.literal_integer} },
873 .{ .name = "DontStaticallyCoalesceINTEL", .value = 5901, .parameters = &.{} },
874 .{ .name = "PrefetchINTEL", .value = 5902, .parameters = &.{.literal_integer} },
875 .{ .name = "StallEnableINTEL", .value = 5905, .parameters = &.{} },
876 .{ .name = "FuseLoopsInFunctionINTEL", .value = 5907, .parameters = &.{} },
877 .{ .name = "MathOpDSPModeINTEL", .value = 5909, .parameters = &.{ .literal_integer, .literal_integer } },
878 .{ .name = "AliasScopeINTEL", .value = 5914, .parameters = &.{.id_ref} },
879 .{ .name = "NoAliasINTEL", .value = 5915, .parameters = &.{.id_ref} },
880 .{ .name = "InitiationIntervalINTEL", .value = 5917, .parameters = &.{.literal_integer} },
881 .{ .name = "MaxConcurrencyINTEL", .value = 5918, .parameters = &.{.literal_integer} },
882 .{ .name = "PipelineEnableINTEL", .value = 5919, .parameters = &.{.literal_integer} },
883 .{ .name = "BufferLocationINTEL", .value = 5921, .parameters = &.{.literal_integer} },
884 .{ .name = "IOPipeStorageINTEL", .value = 5944, .parameters = &.{.literal_integer} },
885 .{ .name = "FunctionFloatingPointModeINTEL", .value = 6080, .parameters = &.{ .literal_integer, .fp_operation_mode } },
886 .{ .name = "SingleElementVectorINTEL", .value = 6085, .parameters = &.{} },
887 .{ .name = "VectorComputeCallableFunctionINTEL", .value = 6087, .parameters = &.{} },
888 .{ .name = "MediaBlockIOINTEL", .value = 6140, .parameters = &.{} },
889 .{ .name = "StallFreeINTEL", .value = 6151, .parameters = &.{} },
890 .{ .name = "FPMaxErrorDecorationINTEL", .value = 6170, .parameters = &.{.literal_float} },
891 .{ .name = "LatencyControlLabelINTEL", .value = 6172, .parameters = &.{.literal_integer} },
892 .{ .name = "LatencyControlConstraintINTEL", .value = 6173, .parameters = &.{ .literal_integer, .literal_integer, .literal_integer } },
893 .{ .name = "ConduitKernelArgumentINTEL", .value = 6175, .parameters = &.{} },
894 .{ .name = "RegisterMapKernelArgumentINTEL", .value = 6176, .parameters = &.{} },
895 .{ .name = "MMHostInterfaceAddressWidthINTEL", .value = 6177, .parameters = &.{.literal_integer} },
896 .{ .name = "MMHostInterfaceDataWidthINTEL", .value = 6178, .parameters = &.{.literal_integer} },
897 .{ .name = "MMHostInterfaceLatencyINTEL", .value = 6179, .parameters = &.{.literal_integer} },
898 .{ .name = "MMHostInterfaceReadWriteModeINTEL", .value = 6180, .parameters = &.{.access_qualifier} },
899 .{ .name = "MMHostInterfaceMaxBurstINTEL", .value = 6181, .parameters = &.{.literal_integer} },
900 .{ .name = "MMHostInterfaceWaitRequestINTEL", .value = 6182, .parameters = &.{.literal_integer} },
901 .{ .name = "StableKernelArgumentINTEL", .value = 6183, .parameters = &.{} },
902 .{ .name = "HostAccessINTEL", .value = 6188, .parameters = &.{ .host_access_qualifier, .literal_string } },
903 .{ .name = "InitModeINTEL", .value = 6190, .parameters = &.{.initialization_mode_qualifier} },
904 .{ .name = "ImplementInRegisterMapINTEL", .value = 6191, .parameters = &.{.literal_integer} },
905 .{ .name = "CacheControlLoadINTEL", .value = 6442, .parameters = &.{ .literal_integer, .load_cache_control } },
906 .{ .name = "CacheControlStoreINTEL", .value = 6443, .parameters = &.{ .literal_integer, .store_cache_control } },
907 },
908 .built_in => &.{
909 .{ .name = "Position", .value = 0, .parameters = &.{} },
910 .{ .name = "PointSize", .value = 1, .parameters = &.{} },
911 .{ .name = "ClipDistance", .value = 3, .parameters = &.{} },
912 .{ .name = "CullDistance", .value = 4, .parameters = &.{} },
913 .{ .name = "VertexId", .value = 5, .parameters = &.{} },
914 .{ .name = "InstanceId", .value = 6, .parameters = &.{} },
915 .{ .name = "PrimitiveId", .value = 7, .parameters = &.{} },
916 .{ .name = "InvocationId", .value = 8, .parameters = &.{} },
917 .{ .name = "Layer", .value = 9, .parameters = &.{} },
918 .{ .name = "ViewportIndex", .value = 10, .parameters = &.{} },
919 .{ .name = "TessLevelOuter", .value = 11, .parameters = &.{} },
920 .{ .name = "TessLevelInner", .value = 12, .parameters = &.{} },
921 .{ .name = "TessCoord", .value = 13, .parameters = &.{} },
922 .{ .name = "PatchVertices", .value = 14, .parameters = &.{} },
923 .{ .name = "FragCoord", .value = 15, .parameters = &.{} },
924 .{ .name = "PointCoord", .value = 16, .parameters = &.{} },
925 .{ .name = "FrontFacing", .value = 17, .parameters = &.{} },
926 .{ .name = "SampleId", .value = 18, .parameters = &.{} },
927 .{ .name = "SamplePosition", .value = 19, .parameters = &.{} },
928 .{ .name = "SampleMask", .value = 20, .parameters = &.{} },
929 .{ .name = "FragDepth", .value = 22, .parameters = &.{} },
930 .{ .name = "HelperInvocation", .value = 23, .parameters = &.{} },
931 .{ .name = "NumWorkgroups", .value = 24, .parameters = &.{} },
932 .{ .name = "WorkgroupSize", .value = 25, .parameters = &.{} },
933 .{ .name = "WorkgroupId", .value = 26, .parameters = &.{} },
934 .{ .name = "LocalInvocationId", .value = 27, .parameters = &.{} },
935 .{ .name = "GlobalInvocationId", .value = 28, .parameters = &.{} },
936 .{ .name = "LocalInvocationIndex", .value = 29, .parameters = &.{} },
937 .{ .name = "WorkDim", .value = 30, .parameters = &.{} },
938 .{ .name = "GlobalSize", .value = 31, .parameters = &.{} },
939 .{ .name = "EnqueuedWorkgroupSize", .value = 32, .parameters = &.{} },
940 .{ .name = "GlobalOffset", .value = 33, .parameters = &.{} },
941 .{ .name = "GlobalLinearId", .value = 34, .parameters = &.{} },
942 .{ .name = "SubgroupSize", .value = 36, .parameters = &.{} },
943 .{ .name = "SubgroupMaxSize", .value = 37, .parameters = &.{} },
944 .{ .name = "NumSubgroups", .value = 38, .parameters = &.{} },
945 .{ .name = "NumEnqueuedSubgroups", .value = 39, .parameters = &.{} },
946 .{ .name = "SubgroupId", .value = 40, .parameters = &.{} },
947 .{ .name = "SubgroupLocalInvocationId", .value = 41, .parameters = &.{} },
948 .{ .name = "VertexIndex", .value = 42, .parameters = &.{} },
949 .{ .name = "InstanceIndex", .value = 43, .parameters = &.{} },
950 .{ .name = "CoreIDARM", .value = 4160, .parameters = &.{} },
951 .{ .name = "CoreCountARM", .value = 4161, .parameters = &.{} },
952 .{ .name = "CoreMaxIDARM", .value = 4162, .parameters = &.{} },
953 .{ .name = "WarpIDARM", .value = 4163, .parameters = &.{} },
954 .{ .name = "WarpMaxIDARM", .value = 4164, .parameters = &.{} },
955 .{ .name = "SubgroupEqMask", .value = 4416, .parameters = &.{} },
956 .{ .name = "SubgroupGeMask", .value = 4417, .parameters = &.{} },
957 .{ .name = "SubgroupGtMask", .value = 4418, .parameters = &.{} },
958 .{ .name = "SubgroupLeMask", .value = 4419, .parameters = &.{} },
959 .{ .name = "SubgroupLtMask", .value = 4420, .parameters = &.{} },
960 .{ .name = "BaseVertex", .value = 4424, .parameters = &.{} },
961 .{ .name = "BaseInstance", .value = 4425, .parameters = &.{} },
962 .{ .name = "DrawIndex", .value = 4426, .parameters = &.{} },
963 .{ .name = "PrimitiveShadingRateKHR", .value = 4432, .parameters = &.{} },
964 .{ .name = "DeviceIndex", .value = 4438, .parameters = &.{} },
965 .{ .name = "ViewIndex", .value = 4440, .parameters = &.{} },
966 .{ .name = "ShadingRateKHR", .value = 4444, .parameters = &.{} },
967 .{ .name = "TileOffsetQCOM", .value = 4492, .parameters = &.{} },
968 .{ .name = "TileDimensionQCOM", .value = 4493, .parameters = &.{} },
969 .{ .name = "TileApronSizeQCOM", .value = 4494, .parameters = &.{} },
970 .{ .name = "BaryCoordNoPerspAMD", .value = 4992, .parameters = &.{} },
971 .{ .name = "BaryCoordNoPerspCentroidAMD", .value = 4993, .parameters = &.{} },
972 .{ .name = "BaryCoordNoPerspSampleAMD", .value = 4994, .parameters = &.{} },
973 .{ .name = "BaryCoordSmoothAMD", .value = 4995, .parameters = &.{} },
974 .{ .name = "BaryCoordSmoothCentroidAMD", .value = 4996, .parameters = &.{} },
975 .{ .name = "BaryCoordSmoothSampleAMD", .value = 4997, .parameters = &.{} },
976 .{ .name = "BaryCoordPullModelAMD", .value = 4998, .parameters = &.{} },
977 .{ .name = "FragStencilRefEXT", .value = 5014, .parameters = &.{} },
978 .{ .name = "RemainingRecursionLevelsAMDX", .value = 5021, .parameters = &.{} },
979 .{ .name = "ShaderIndexAMDX", .value = 5073, .parameters = &.{} },
980 .{ .name = "ViewportMaskNV", .value = 5253, .parameters = &.{} },
981 .{ .name = "SecondaryPositionNV", .value = 5257, .parameters = &.{} },
982 .{ .name = "SecondaryViewportMaskNV", .value = 5258, .parameters = &.{} },
983 .{ .name = "PositionPerViewNV", .value = 5261, .parameters = &.{} },
984 .{ .name = "ViewportMaskPerViewNV", .value = 5262, .parameters = &.{} },
985 .{ .name = "FullyCoveredEXT", .value = 5264, .parameters = &.{} },
986 .{ .name = "TaskCountNV", .value = 5274, .parameters = &.{} },
987 .{ .name = "PrimitiveCountNV", .value = 5275, .parameters = &.{} },
988 .{ .name = "PrimitiveIndicesNV", .value = 5276, .parameters = &.{} },
989 .{ .name = "ClipDistancePerViewNV", .value = 5277, .parameters = &.{} },
990 .{ .name = "CullDistancePerViewNV", .value = 5278, .parameters = &.{} },
991 .{ .name = "LayerPerViewNV", .value = 5279, .parameters = &.{} },
992 .{ .name = "MeshViewCountNV", .value = 5280, .parameters = &.{} },
993 .{ .name = "MeshViewIndicesNV", .value = 5281, .parameters = &.{} },
994 .{ .name = "BaryCoordKHR", .value = 5286, .parameters = &.{} },
995 .{ .name = "BaryCoordNoPerspKHR", .value = 5287, .parameters = &.{} },
996 .{ .name = "FragSizeEXT", .value = 5292, .parameters = &.{} },
997 .{ .name = "FragInvocationCountEXT", .value = 5293, .parameters = &.{} },
998 .{ .name = "PrimitivePointIndicesEXT", .value = 5294, .parameters = &.{} },
999 .{ .name = "PrimitiveLineIndicesEXT", .value = 5295, .parameters = &.{} },
1000 .{ .name = "PrimitiveTriangleIndicesEXT", .value = 5296, .parameters = &.{} },
1001 .{ .name = "CullPrimitiveEXT", .value = 5299, .parameters = &.{} },
1002 .{ .name = "LaunchIdKHR", .value = 5319, .parameters = &.{} },
1003 .{ .name = "LaunchSizeKHR", .value = 5320, .parameters = &.{} },
1004 .{ .name = "WorldRayOriginKHR", .value = 5321, .parameters = &.{} },
1005 .{ .name = "WorldRayDirectionKHR", .value = 5322, .parameters = &.{} },
1006 .{ .name = "ObjectRayOriginKHR", .value = 5323, .parameters = &.{} },
1007 .{ .name = "ObjectRayDirectionKHR", .value = 5324, .parameters = &.{} },
1008 .{ .name = "RayTminKHR", .value = 5325, .parameters = &.{} },
1009 .{ .name = "RayTmaxKHR", .value = 5326, .parameters = &.{} },
1010 .{ .name = "InstanceCustomIndexKHR", .value = 5327, .parameters = &.{} },
1011 .{ .name = "ObjectToWorldKHR", .value = 5330, .parameters = &.{} },
1012 .{ .name = "WorldToObjectKHR", .value = 5331, .parameters = &.{} },
1013 .{ .name = "HitTNV", .value = 5332, .parameters = &.{} },
1014 .{ .name = "HitKindKHR", .value = 5333, .parameters = &.{} },
1015 .{ .name = "CurrentRayTimeNV", .value = 5334, .parameters = &.{} },
1016 .{ .name = "HitTriangleVertexPositionsKHR", .value = 5335, .parameters = &.{} },
1017 .{ .name = "HitMicroTriangleVertexPositionsNV", .value = 5337, .parameters = &.{} },
1018 .{ .name = "HitMicroTriangleVertexBarycentricsNV", .value = 5344, .parameters = &.{} },
1019 .{ .name = "IncomingRayFlagsKHR", .value = 5351, .parameters = &.{} },
1020 .{ .name = "RayGeometryIndexKHR", .value = 5352, .parameters = &.{} },
1021 .{ .name = "HitIsSphereNV", .value = 5359, .parameters = &.{} },
1022 .{ .name = "HitIsLSSNV", .value = 5360, .parameters = &.{} },
1023 .{ .name = "HitSpherePositionNV", .value = 5361, .parameters = &.{} },
1024 .{ .name = "WarpsPerSMNV", .value = 5374, .parameters = &.{} },
1025 .{ .name = "SMCountNV", .value = 5375, .parameters = &.{} },
1026 .{ .name = "WarpIDNV", .value = 5376, .parameters = &.{} },
1027 .{ .name = "SMIDNV", .value = 5377, .parameters = &.{} },
1028 .{ .name = "HitLSSPositionsNV", .value = 5396, .parameters = &.{} },
1029 .{ .name = "HitKindFrontFacingMicroTriangleNV", .value = 5405, .parameters = &.{} },
1030 .{ .name = "HitKindBackFacingMicroTriangleNV", .value = 5406, .parameters = &.{} },
1031 .{ .name = "HitSphereRadiusNV", .value = 5420, .parameters = &.{} },
1032 .{ .name = "HitLSSRadiiNV", .value = 5421, .parameters = &.{} },
1033 .{ .name = "ClusterIDNV", .value = 5436, .parameters = &.{} },
1034 .{ .name = "CullMaskKHR", .value = 6021, .parameters = &.{} },
1035 },
1036 .scope => &.{
1037 .{ .name = "CrossDevice", .value = 0, .parameters = &.{} },
1038 .{ .name = "Device", .value = 1, .parameters = &.{} },
1039 .{ .name = "Workgroup", .value = 2, .parameters = &.{} },
1040 .{ .name = "Subgroup", .value = 3, .parameters = &.{} },
1041 .{ .name = "Invocation", .value = 4, .parameters = &.{} },
1042 .{ .name = "QueueFamily", .value = 5, .parameters = &.{} },
1043 .{ .name = "ShaderCallKHR", .value = 6, .parameters = &.{} },
1044 },
1045 .group_operation => &.{
1046 .{ .name = "Reduce", .value = 0, .parameters = &.{} },
1047 .{ .name = "InclusiveScan", .value = 1, .parameters = &.{} },
1048 .{ .name = "ExclusiveScan", .value = 2, .parameters = &.{} },
1049 .{ .name = "ClusteredReduce", .value = 3, .parameters = &.{} },
1050 .{ .name = "PartitionedReduceNV", .value = 6, .parameters = &.{} },
1051 .{ .name = "PartitionedInclusiveScanNV", .value = 7, .parameters = &.{} },
1052 .{ .name = "PartitionedExclusiveScanNV", .value = 8, .parameters = &.{} },
1053 },
1054 .kernel_enqueue_flags => &.{
1055 .{ .name = "NoWait", .value = 0, .parameters = &.{} },
1056 .{ .name = "WaitKernel", .value = 1, .parameters = &.{} },
1057 .{ .name = "WaitWorkGroup", .value = 2, .parameters = &.{} },
1058 },
1059 .capability => &.{
1060 .{ .name = "Matrix", .value = 0, .parameters = &.{} },
1061 .{ .name = "Shader", .value = 1, .parameters = &.{} },
1062 .{ .name = "Geometry", .value = 2, .parameters = &.{} },
1063 .{ .name = "Tessellation", .value = 3, .parameters = &.{} },
1064 .{ .name = "Addresses", .value = 4, .parameters = &.{} },
1065 .{ .name = "Linkage", .value = 5, .parameters = &.{} },
1066 .{ .name = "Kernel", .value = 6, .parameters = &.{} },
1067 .{ .name = "Vector16", .value = 7, .parameters = &.{} },
1068 .{ .name = "Float16Buffer", .value = 8, .parameters = &.{} },
1069 .{ .name = "Float16", .value = 9, .parameters = &.{} },
1070 .{ .name = "Float64", .value = 10, .parameters = &.{} },
1071 .{ .name = "Int64", .value = 11, .parameters = &.{} },
1072 .{ .name = "Int64Atomics", .value = 12, .parameters = &.{} },
1073 .{ .name = "ImageBasic", .value = 13, .parameters = &.{} },
1074 .{ .name = "ImageReadWrite", .value = 14, .parameters = &.{} },
1075 .{ .name = "ImageMipmap", .value = 15, .parameters = &.{} },
1076 .{ .name = "Pipes", .value = 17, .parameters = &.{} },
1077 .{ .name = "Groups", .value = 18, .parameters = &.{} },
1078 .{ .name = "DeviceEnqueue", .value = 19, .parameters = &.{} },
1079 .{ .name = "LiteralSampler", .value = 20, .parameters = &.{} },
1080 .{ .name = "AtomicStorage", .value = 21, .parameters = &.{} },
1081 .{ .name = "Int16", .value = 22, .parameters = &.{} },
1082 .{ .name = "TessellationPointSize", .value = 23, .parameters = &.{} },
1083 .{ .name = "GeometryPointSize", .value = 24, .parameters = &.{} },
1084 .{ .name = "ImageGatherExtended", .value = 25, .parameters = &.{} },
1085 .{ .name = "StorageImageMultisample", .value = 27, .parameters = &.{} },
1086 .{ .name = "UniformBufferArrayDynamicIndexing", .value = 28, .parameters = &.{} },
1087 .{ .name = "SampledImageArrayDynamicIndexing", .value = 29, .parameters = &.{} },
1088 .{ .name = "StorageBufferArrayDynamicIndexing", .value = 30, .parameters = &.{} },
1089 .{ .name = "StorageImageArrayDynamicIndexing", .value = 31, .parameters = &.{} },
1090 .{ .name = "ClipDistance", .value = 32, .parameters = &.{} },
1091 .{ .name = "CullDistance", .value = 33, .parameters = &.{} },
1092 .{ .name = "ImageCubeArray", .value = 34, .parameters = &.{} },
1093 .{ .name = "SampleRateShading", .value = 35, .parameters = &.{} },
1094 .{ .name = "ImageRect", .value = 36, .parameters = &.{} },
1095 .{ .name = "SampledRect", .value = 37, .parameters = &.{} },
1096 .{ .name = "GenericPointer", .value = 38, .parameters = &.{} },
1097 .{ .name = "Int8", .value = 39, .parameters = &.{} },
1098 .{ .name = "InputAttachment", .value = 40, .parameters = &.{} },
1099 .{ .name = "SparseResidency", .value = 41, .parameters = &.{} },
1100 .{ .name = "MinLod", .value = 42, .parameters = &.{} },
1101 .{ .name = "Sampled1D", .value = 43, .parameters = &.{} },
1102 .{ .name = "Image1D", .value = 44, .parameters = &.{} },
1103 .{ .name = "SampledCubeArray", .value = 45, .parameters = &.{} },
1104 .{ .name = "SampledBuffer", .value = 46, .parameters = &.{} },
1105 .{ .name = "ImageBuffer", .value = 47, .parameters = &.{} },
1106 .{ .name = "ImageMSArray", .value = 48, .parameters = &.{} },
1107 .{ .name = "StorageImageExtendedFormats", .value = 49, .parameters = &.{} },
1108 .{ .name = "ImageQuery", .value = 50, .parameters = &.{} },
1109 .{ .name = "DerivativeControl", .value = 51, .parameters = &.{} },
1110 .{ .name = "InterpolationFunction", .value = 52, .parameters = &.{} },
1111 .{ .name = "TransformFeedback", .value = 53, .parameters = &.{} },
1112 .{ .name = "GeometryStreams", .value = 54, .parameters = &.{} },
1113 .{ .name = "StorageImageReadWithoutFormat", .value = 55, .parameters = &.{} },
1114 .{ .name = "StorageImageWriteWithoutFormat", .value = 56, .parameters = &.{} },
1115 .{ .name = "MultiViewport", .value = 57, .parameters = &.{} },
1116 .{ .name = "SubgroupDispatch", .value = 58, .parameters = &.{} },
1117 .{ .name = "NamedBarrier", .value = 59, .parameters = &.{} },
1118 .{ .name = "PipeStorage", .value = 60, .parameters = &.{} },
1119 .{ .name = "GroupNonUniform", .value = 61, .parameters = &.{} },
1120 .{ .name = "GroupNonUniformVote", .value = 62, .parameters = &.{} },
1121 .{ .name = "GroupNonUniformArithmetic", .value = 63, .parameters = &.{} },
1122 .{ .name = "GroupNonUniformBallot", .value = 64, .parameters = &.{} },
1123 .{ .name = "GroupNonUniformShuffle", .value = 65, .parameters = &.{} },
1124 .{ .name = "GroupNonUniformShuffleRelative", .value = 66, .parameters = &.{} },
1125 .{ .name = "GroupNonUniformClustered", .value = 67, .parameters = &.{} },
1126 .{ .name = "GroupNonUniformQuad", .value = 68, .parameters = &.{} },
1127 .{ .name = "ShaderLayer", .value = 69, .parameters = &.{} },
1128 .{ .name = "ShaderViewportIndex", .value = 70, .parameters = &.{} },
1129 .{ .name = "UniformDecoration", .value = 71, .parameters = &.{} },
1130 .{ .name = "CoreBuiltinsARM", .value = 4165, .parameters = &.{} },
1131 .{ .name = "TileImageColorReadAccessEXT", .value = 4166, .parameters = &.{} },
1132 .{ .name = "TileImageDepthReadAccessEXT", .value = 4167, .parameters = &.{} },
1133 .{ .name = "TileImageStencilReadAccessEXT", .value = 4168, .parameters = &.{} },
1134 .{ .name = "TensorsARM", .value = 4174, .parameters = &.{} },
1135 .{ .name = "StorageTensorArrayDynamicIndexingARM", .value = 4175, .parameters = &.{} },
1136 .{ .name = "StorageTensorArrayNonUniformIndexingARM", .value = 4176, .parameters = &.{} },
1137 .{ .name = "GraphARM", .value = 4191, .parameters = &.{} },
1138 .{ .name = "CooperativeMatrixLayoutsARM", .value = 4201, .parameters = &.{} },
1139 .{ .name = "Float8EXT", .value = 4212, .parameters = &.{} },
1140 .{ .name = "Float8CooperativeMatrixEXT", .value = 4213, .parameters = &.{} },
1141 .{ .name = "FragmentShadingRateKHR", .value = 4422, .parameters = &.{} },
1142 .{ .name = "SubgroupBallotKHR", .value = 4423, .parameters = &.{} },
1143 .{ .name = "DrawParameters", .value = 4427, .parameters = &.{} },
1144 .{ .name = "WorkgroupMemoryExplicitLayoutKHR", .value = 4428, .parameters = &.{} },
1145 .{ .name = "WorkgroupMemoryExplicitLayout8BitAccessKHR", .value = 4429, .parameters = &.{} },
1146 .{ .name = "WorkgroupMemoryExplicitLayout16BitAccessKHR", .value = 4430, .parameters = &.{} },
1147 .{ .name = "SubgroupVoteKHR", .value = 4431, .parameters = &.{} },
1148 .{ .name = "StorageBuffer16BitAccess", .value = 4433, .parameters = &.{} },
1149 .{ .name = "UniformAndStorageBuffer16BitAccess", .value = 4434, .parameters = &.{} },
1150 .{ .name = "StoragePushConstant16", .value = 4435, .parameters = &.{} },
1151 .{ .name = "StorageInputOutput16", .value = 4436, .parameters = &.{} },
1152 .{ .name = "DeviceGroup", .value = 4437, .parameters = &.{} },
1153 .{ .name = "MultiView", .value = 4439, .parameters = &.{} },
1154 .{ .name = "VariablePointersStorageBuffer", .value = 4441, .parameters = &.{} },
1155 .{ .name = "VariablePointers", .value = 4442, .parameters = &.{} },
1156 .{ .name = "AtomicStorageOps", .value = 4445, .parameters = &.{} },
1157 .{ .name = "SampleMaskPostDepthCoverage", .value = 4447, .parameters = &.{} },
1158 .{ .name = "StorageBuffer8BitAccess", .value = 4448, .parameters = &.{} },
1159 .{ .name = "UniformAndStorageBuffer8BitAccess", .value = 4449, .parameters = &.{} },
1160 .{ .name = "StoragePushConstant8", .value = 4450, .parameters = &.{} },
1161 .{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },
1162 .{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },
1163 .{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },
1164 .{ .name = "RoundingModeRTE", .value = 4467, .parameters = &.{} },
1165 .{ .name = "RoundingModeRTZ", .value = 4468, .parameters = &.{} },
1166 .{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },
1167 .{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },
1168 .{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },
1169 .{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },
1170 .{ .name = "RayTracingKHR", .value = 4479, .parameters = &.{} },
1171 .{ .name = "TextureSampleWeightedQCOM", .value = 4484, .parameters = &.{} },
1172 .{ .name = "TextureBoxFilterQCOM", .value = 4485, .parameters = &.{} },
1173 .{ .name = "TextureBlockMatchQCOM", .value = 4486, .parameters = &.{} },
1174 .{ .name = "TileShadingQCOM", .value = 4495, .parameters = &.{} },
1175 .{ .name = "TextureBlockMatch2QCOM", .value = 4498, .parameters = &.{} },
1176 .{ .name = "Float16ImageAMD", .value = 5008, .parameters = &.{} },
1177 .{ .name = "ImageGatherBiasLodAMD", .value = 5009, .parameters = &.{} },
1178 .{ .name = "FragmentMaskAMD", .value = 5010, .parameters = &.{} },
1179 .{ .name = "StencilExportEXT", .value = 5013, .parameters = &.{} },
1180 .{ .name = "ImageReadWriteLodAMD", .value = 5015, .parameters = &.{} },
1181 .{ .name = "Int64ImageEXT", .value = 5016, .parameters = &.{} },
1182 .{ .name = "ShaderClockKHR", .value = 5055, .parameters = &.{} },
1183 .{ .name = "ShaderEnqueueAMDX", .value = 5067, .parameters = &.{} },
1184 .{ .name = "QuadControlKHR", .value = 5087, .parameters = &.{} },
1185 .{ .name = "Int4TypeINTEL", .value = 5112, .parameters = &.{} },
1186 .{ .name = "Int4CooperativeMatrixINTEL", .value = 5114, .parameters = &.{} },
1187 .{ .name = "BFloat16TypeKHR", .value = 5116, .parameters = &.{} },
1188 .{ .name = "BFloat16DotProductKHR", .value = 5117, .parameters = &.{} },
1189 .{ .name = "BFloat16CooperativeMatrixKHR", .value = 5118, .parameters = &.{} },
1190 .{ .name = "SampleMaskOverrideCoverageNV", .value = 5249, .parameters = &.{} },
1191 .{ .name = "GeometryShaderPassthroughNV", .value = 5251, .parameters = &.{} },
1192 .{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },
1193 .{ .name = "ShaderViewportMaskNV", .value = 5255, .parameters = &.{} },
1194 .{ .name = "ShaderStereoViewNV", .value = 5259, .parameters = &.{} },
1195 .{ .name = "PerViewAttributesNV", .value = 5260, .parameters = &.{} },
1196 .{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },
1197 .{ .name = "MeshShadingNV", .value = 5266, .parameters = &.{} },
1198 .{ .name = "ImageFootprintNV", .value = 5282, .parameters = &.{} },
1199 .{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },
1200 .{ .name = "FragmentBarycentricKHR", .value = 5284, .parameters = &.{} },
1201 .{ .name = "ComputeDerivativeGroupQuadsKHR", .value = 5288, .parameters = &.{} },
1202 .{ .name = "FragmentDensityEXT", .value = 5291, .parameters = &.{} },
1203 .{ .name = "GroupNonUniformPartitionedNV", .value = 5297, .parameters = &.{} },
1204 .{ .name = "ShaderNonUniform", .value = 5301, .parameters = &.{} },
1205 .{ .name = "RuntimeDescriptorArray", .value = 5302, .parameters = &.{} },
1206 .{ .name = "InputAttachmentArrayDynamicIndexing", .value = 5303, .parameters = &.{} },
1207 .{ .name = "UniformTexelBufferArrayDynamicIndexing", .value = 5304, .parameters = &.{} },
1208 .{ .name = "StorageTexelBufferArrayDynamicIndexing", .value = 5305, .parameters = &.{} },
1209 .{ .name = "UniformBufferArrayNonUniformIndexing", .value = 5306, .parameters = &.{} },
1210 .{ .name = "SampledImageArrayNonUniformIndexing", .value = 5307, .parameters = &.{} },
1211 .{ .name = "StorageBufferArrayNonUniformIndexing", .value = 5308, .parameters = &.{} },
1212 .{ .name = "StorageImageArrayNonUniformIndexing", .value = 5309, .parameters = &.{} },
1213 .{ .name = "InputAttachmentArrayNonUniformIndexing", .value = 5310, .parameters = &.{} },
1214 .{ .name = "UniformTexelBufferArrayNonUniformIndexing", .value = 5311, .parameters = &.{} },
1215 .{ .name = "StorageTexelBufferArrayNonUniformIndexing", .value = 5312, .parameters = &.{} },
1216 .{ .name = "RayTracingPositionFetchKHR", .value = 5336, .parameters = &.{} },
1217 .{ .name = "RayTracingNV", .value = 5340, .parameters = &.{} },
1218 .{ .name = "RayTracingMotionBlurNV", .value = 5341, .parameters = &.{} },
1219 .{ .name = "VulkanMemoryModel", .value = 5345, .parameters = &.{} },
1220 .{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },
1221 .{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },
1222 .{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },
1223 .{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },
1224 .{ .name = "CooperativeMatrixNV", .value = 5357, .parameters = &.{} },
1225 .{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },
1226 .{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },
1227 .{ .name = "ShaderSMBuiltinsNV", .value = 5373, .parameters = &.{} },
1228 .{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },
1229 .{ .name = "DemoteToHelperInvocation", .value = 5379, .parameters = &.{} },
1230 .{ .name = "DisplacementMicromapNV", .value = 5380, .parameters = &.{} },
1231 .{ .name = "RayTracingOpacityMicromapEXT", .value = 5381, .parameters = &.{} },
1232 .{ .name = "ShaderInvocationReorderNV", .value = 5383, .parameters = &.{} },
1233 .{ .name = "BindlessTextureNV", .value = 5390, .parameters = &.{} },
1234 .{ .name = "RayQueryPositionFetchKHR", .value = 5391, .parameters = &.{} },
1235 .{ .name = "CooperativeVectorNV", .value = 5394, .parameters = &.{} },
1236 .{ .name = "AtomicFloat16VectorNV", .value = 5404, .parameters = &.{} },
1237 .{ .name = "RayTracingDisplacementMicromapNV", .value = 5409, .parameters = &.{} },
1238 .{ .name = "RawAccessChainsNV", .value = 5414, .parameters = &.{} },
1239 .{ .name = "RayTracingSpheresGeometryNV", .value = 5418, .parameters = &.{} },
1240 .{ .name = "RayTracingLinearSweptSpheresGeometryNV", .value = 5419, .parameters = &.{} },
1241 .{ .name = "CooperativeMatrixReductionsNV", .value = 5430, .parameters = &.{} },
1242 .{ .name = "CooperativeMatrixConversionsNV", .value = 5431, .parameters = &.{} },
1243 .{ .name = "CooperativeMatrixPerElementOperationsNV", .value = 5432, .parameters = &.{} },
1244 .{ .name = "CooperativeMatrixTensorAddressingNV", .value = 5433, .parameters = &.{} },
1245 .{ .name = "CooperativeMatrixBlockLoadsNV", .value = 5434, .parameters = &.{} },
1246 .{ .name = "CooperativeVectorTrainingNV", .value = 5435, .parameters = &.{} },
1247 .{ .name = "RayTracingClusterAccelerationStructureNV", .value = 5437, .parameters = &.{} },
1248 .{ .name = "TensorAddressingNV", .value = 5439, .parameters = &.{} },
1249 .{ .name = "SubgroupShuffleINTEL", .value = 5568, .parameters = &.{} },
1250 .{ .name = "SubgroupBufferBlockIOINTEL", .value = 5569, .parameters = &.{} },
1251 .{ .name = "SubgroupImageBlockIOINTEL", .value = 5570, .parameters = &.{} },
1252 .{ .name = "SubgroupImageMediaBlockIOINTEL", .value = 5579, .parameters = &.{} },
1253 .{ .name = "RoundToInfinityINTEL", .value = 5582, .parameters = &.{} },
1254 .{ .name = "FloatingPointModeINTEL", .value = 5583, .parameters = &.{} },
1255 .{ .name = "IntegerFunctions2INTEL", .value = 5584, .parameters = &.{} },
1256 .{ .name = "FunctionPointersINTEL", .value = 5603, .parameters = &.{} },
1257 .{ .name = "IndirectReferencesINTEL", .value = 5604, .parameters = &.{} },
1258 .{ .name = "AsmINTEL", .value = 5606, .parameters = &.{} },
1259 .{ .name = "AtomicFloat32MinMaxEXT", .value = 5612, .parameters = &.{} },
1260 .{ .name = "AtomicFloat64MinMaxEXT", .value = 5613, .parameters = &.{} },
1261 .{ .name = "AtomicFloat16MinMaxEXT", .value = 5616, .parameters = &.{} },
1262 .{ .name = "VectorComputeINTEL", .value = 5617, .parameters = &.{} },
1263 .{ .name = "VectorAnyINTEL", .value = 5619, .parameters = &.{} },
1264 .{ .name = "ExpectAssumeKHR", .value = 5629, .parameters = &.{} },
1265 .{ .name = "SubgroupAvcMotionEstimationINTEL", .value = 5696, .parameters = &.{} },
1266 .{ .name = "SubgroupAvcMotionEstimationIntraINTEL", .value = 5697, .parameters = &.{} },
1267 .{ .name = "SubgroupAvcMotionEstimationChromaINTEL", .value = 5698, .parameters = &.{} },
1268 .{ .name = "VariableLengthArrayINTEL", .value = 5817, .parameters = &.{} },
1269 .{ .name = "FunctionFloatControlINTEL", .value = 5821, .parameters = &.{} },
1270 .{ .name = "FPGAMemoryAttributesINTEL", .value = 5824, .parameters = &.{} },
1271 .{ .name = "FPFastMathModeINTEL", .value = 5837, .parameters = &.{} },
1272 .{ .name = "ArbitraryPrecisionIntegersINTEL", .value = 5844, .parameters = &.{} },
1273 .{ .name = "ArbitraryPrecisionFloatingPointINTEL", .value = 5845, .parameters = &.{} },
1274 .{ .name = "UnstructuredLoopControlsINTEL", .value = 5886, .parameters = &.{} },
1275 .{ .name = "FPGALoopControlsINTEL", .value = 5888, .parameters = &.{} },
1276 .{ .name = "KernelAttributesINTEL", .value = 5892, .parameters = &.{} },
1277 .{ .name = "FPGAKernelAttributesINTEL", .value = 5897, .parameters = &.{} },
1278 .{ .name = "FPGAMemoryAccessesINTEL", .value = 5898, .parameters = &.{} },
1279 .{ .name = "FPGAClusterAttributesINTEL", .value = 5904, .parameters = &.{} },
1280 .{ .name = "LoopFuseINTEL", .value = 5906, .parameters = &.{} },
1281 .{ .name = "FPGADSPControlINTEL", .value = 5908, .parameters = &.{} },
1282 .{ .name = "MemoryAccessAliasingINTEL", .value = 5910, .parameters = &.{} },
1283 .{ .name = "FPGAInvocationPipeliningAttributesINTEL", .value = 5916, .parameters = &.{} },
1284 .{ .name = "FPGABufferLocationINTEL", .value = 5920, .parameters = &.{} },
1285 .{ .name = "ArbitraryPrecisionFixedPointINTEL", .value = 5922, .parameters = &.{} },
1286 .{ .name = "USMStorageClassesINTEL", .value = 5935, .parameters = &.{} },
1287 .{ .name = "RuntimeAlignedAttributeINTEL", .value = 5939, .parameters = &.{} },
1288 .{ .name = "IOPipesINTEL", .value = 5943, .parameters = &.{} },
1289 .{ .name = "BlockingPipesINTEL", .value = 5945, .parameters = &.{} },
1290 .{ .name = "FPGARegINTEL", .value = 5948, .parameters = &.{} },
1291 .{ .name = "DotProductInputAll", .value = 6016, .parameters = &.{} },
1292 .{ .name = "DotProductInput4x8Bit", .value = 6017, .parameters = &.{} },
1293 .{ .name = "DotProductInput4x8BitPacked", .value = 6018, .parameters = &.{} },
1294 .{ .name = "DotProduct", .value = 6019, .parameters = &.{} },
1295 .{ .name = "RayCullMaskKHR", .value = 6020, .parameters = &.{} },
1296 .{ .name = "CooperativeMatrixKHR", .value = 6022, .parameters = &.{} },
1297 .{ .name = "ReplicatedCompositesEXT", .value = 6024, .parameters = &.{} },
1298 .{ .name = "BitInstructions", .value = 6025, .parameters = &.{} },
1299 .{ .name = "GroupNonUniformRotateKHR", .value = 6026, .parameters = &.{} },
1300 .{ .name = "FloatControls2", .value = 6029, .parameters = &.{} },
1301 .{ .name = "AtomicFloat32AddEXT", .value = 6033, .parameters = &.{} },
1302 .{ .name = "AtomicFloat64AddEXT", .value = 6034, .parameters = &.{} },
1303 .{ .name = "LongCompositesINTEL", .value = 6089, .parameters = &.{} },
1304 .{ .name = "OptNoneEXT", .value = 6094, .parameters = &.{} },
1305 .{ .name = "AtomicFloat16AddEXT", .value = 6095, .parameters = &.{} },
1306 .{ .name = "DebugInfoModuleINTEL", .value = 6114, .parameters = &.{} },
1307 .{ .name = "BFloat16ConversionINTEL", .value = 6115, .parameters = &.{} },
1308 .{ .name = "SplitBarrierINTEL", .value = 6141, .parameters = &.{} },
1309 .{ .name = "ArithmeticFenceEXT", .value = 6144, .parameters = &.{} },
1310 .{ .name = "FPGAClusterAttributesV2INTEL", .value = 6150, .parameters = &.{} },
1311 .{ .name = "FPGAKernelAttributesv2INTEL", .value = 6161, .parameters = &.{} },
1312 .{ .name = "TaskSequenceINTEL", .value = 6162, .parameters = &.{} },
1313 .{ .name = "FPMaxErrorINTEL", .value = 6169, .parameters = &.{} },
1314 .{ .name = "FPGALatencyControlINTEL", .value = 6171, .parameters = &.{} },
1315 .{ .name = "FPGAArgumentInterfacesINTEL", .value = 6174, .parameters = &.{} },
1316 .{ .name = "GlobalVariableHostAccessINTEL", .value = 6187, .parameters = &.{} },
1317 .{ .name = "GlobalVariableFPGADecorationsINTEL", .value = 6189, .parameters = &.{} },
1318 .{ .name = "SubgroupBufferPrefetchINTEL", .value = 6220, .parameters = &.{} },
1319 .{ .name = "Subgroup2DBlockIOINTEL", .value = 6228, .parameters = &.{} },
1320 .{ .name = "Subgroup2DBlockTransformINTEL", .value = 6229, .parameters = &.{} },
1321 .{ .name = "Subgroup2DBlockTransposeINTEL", .value = 6230, .parameters = &.{} },
1322 .{ .name = "SubgroupMatrixMultiplyAccumulateINTEL", .value = 6236, .parameters = &.{} },
1323 .{ .name = "TernaryBitwiseFunctionINTEL", .value = 6241, .parameters = &.{} },
1324 .{ .name = "GroupUniformArithmeticKHR", .value = 6400, .parameters = &.{} },
1325 .{ .name = "TensorFloat32RoundingINTEL", .value = 6425, .parameters = &.{} },
1326 .{ .name = "MaskedGatherScatterINTEL", .value = 6427, .parameters = &.{} },
1327 .{ .name = "CacheControlsINTEL", .value = 6441, .parameters = &.{} },
1328 .{ .name = "RegisterLimitsINTEL", .value = 6460, .parameters = &.{} },
1329 .{ .name = "BindlessImagesINTEL", .value = 6528, .parameters = &.{} },
1330 },
1331 .ray_query_intersection => &.{
1332 .{ .name = "RayQueryCandidateIntersectionKHR", .value = 0, .parameters = &.{} },
1333 .{ .name = "RayQueryCommittedIntersectionKHR", .value = 1, .parameters = &.{} },
1334 },
1335 .ray_query_committed_intersection_type => &.{
1336 .{ .name = "RayQueryCommittedIntersectionNoneKHR", .value = 0, .parameters = &.{} },
1337 .{ .name = "RayQueryCommittedIntersectionTriangleKHR", .value = 1, .parameters = &.{} },
1338 .{ .name = "RayQueryCommittedIntersectionGeneratedKHR", .value = 2, .parameters = &.{} },
1339 },
1340 .ray_query_candidate_intersection_type => &.{
1341 .{ .name = "RayQueryCandidateIntersectionTriangleKHR", .value = 0, .parameters = &.{} },
1342 .{ .name = "RayQueryCandidateIntersectionAABBKHR", .value = 1, .parameters = &.{} },
1343 },
1344 .packed_vector_format => &.{
1345 .{ .name = "PackedVectorFormat4x8Bit", .value = 0, .parameters = &.{} },
1346 },
1347 .cooperative_matrix_operands => &.{
1348 .{ .name = "NoneKHR", .value = 0x0000, .parameters = &.{} },
1349 .{ .name = "MatrixASignedComponentsKHR", .value = 0x0001, .parameters = &.{} },
1350 .{ .name = "MatrixBSignedComponentsKHR", .value = 0x0002, .parameters = &.{} },
1351 .{ .name = "MatrixCSignedComponentsKHR", .value = 0x0004, .parameters = &.{} },
1352 .{ .name = "MatrixResultSignedComponentsKHR", .value = 0x0008, .parameters = &.{} },
1353 .{ .name = "SaturatingAccumulationKHR", .value = 0x0010, .parameters = &.{} },
1354 },
1355 .cooperative_matrix_layout => &.{
1356 .{ .name = "RowMajorKHR", .value = 0, .parameters = &.{} },
1357 .{ .name = "ColumnMajorKHR", .value = 1, .parameters = &.{} },
1358 .{ .name = "RowBlockedInterleavedARM", .value = 4202, .parameters = &.{} },
1359 .{ .name = "ColumnBlockedInterleavedARM", .value = 4203, .parameters = &.{} },
1360 },
1361 .cooperative_matrix_use => &.{
1362 .{ .name = "MatrixAKHR", .value = 0, .parameters = &.{} },
1363 .{ .name = "MatrixBKHR", .value = 1, .parameters = &.{} },
1364 .{ .name = "MatrixAccumulatorKHR", .value = 2, .parameters = &.{} },
1365 },
1366 .cooperative_matrix_reduce => &.{
1367 .{ .name = "Row", .value = 0x0001, .parameters = &.{} },
1368 .{ .name = "Column", .value = 0x0002, .parameters = &.{} },
1369 .{ .name = "2x2", .value = 0x0004, .parameters = &.{} },
1370 },
1371 .tensor_clamp_mode => &.{
1372 .{ .name = "Undefined", .value = 0, .parameters = &.{} },
1373 .{ .name = "Constant", .value = 1, .parameters = &.{} },
1374 .{ .name = "ClampToEdge", .value = 2, .parameters = &.{} },
1375 .{ .name = "Repeat", .value = 3, .parameters = &.{} },
1376 .{ .name = "RepeatMirrored", .value = 4, .parameters = &.{} },
1377 },
1378 .tensor_addressing_operands => &.{
1379 .{ .name = "TensorView", .value = 0x0001, .parameters = &.{.id_ref} },
1380 .{ .name = "DecodeFunc", .value = 0x0002, .parameters = &.{.id_ref} },
1381 },
1382 .initialization_mode_qualifier => &.{
1383 .{ .name = "InitOnDeviceReprogramINTEL", .value = 0, .parameters = &.{} },
1384 .{ .name = "InitOnDeviceResetINTEL", .value = 1, .parameters = &.{} },
1385 },
1386 .load_cache_control => &.{
1387 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1388 .{ .name = "CachedINTEL", .value = 1, .parameters = &.{} },
1389 .{ .name = "StreamingINTEL", .value = 2, .parameters = &.{} },
1390 .{ .name = "InvalidateAfterReadINTEL", .value = 3, .parameters = &.{} },
1391 .{ .name = "ConstCachedINTEL", .value = 4, .parameters = &.{} },
1392 },
1393 .store_cache_control => &.{
1394 .{ .name = "UncachedINTEL", .value = 0, .parameters = &.{} },
1395 .{ .name = "WriteThroughINTEL", .value = 1, .parameters = &.{} },
1396 .{ .name = "WriteBackINTEL", .value = 2, .parameters = &.{} },
1397 .{ .name = "StreamingINTEL", .value = 3, .parameters = &.{} },
1398 },
1399 .named_maximum_number_of_registers => &.{
1400 .{ .name = "AutoINTEL", .value = 0, .parameters = &.{} },
1401 },
1402 .matrix_multiply_accumulate_operands => &.{
1403 .{ .name = "MatrixASignedComponentsINTEL", .value = 0x1, .parameters = &.{} },
1404 .{ .name = "MatrixBSignedComponentsINTEL", .value = 0x2, .parameters = &.{} },
1405 .{ .name = "MatrixCBFloat16INTEL", .value = 0x4, .parameters = &.{} },
1406 .{ .name = "MatrixResultBFloat16INTEL", .value = 0x8, .parameters = &.{} },
1407 .{ .name = "MatrixAPackedInt8INTEL", .value = 0x10, .parameters = &.{} },
1408 .{ .name = "MatrixBPackedInt8INTEL", .value = 0x20, .parameters = &.{} },
1409 .{ .name = "MatrixAPackedInt4INTEL", .value = 0x40, .parameters = &.{} },
1410 .{ .name = "MatrixBPackedInt4INTEL", .value = 0x80, .parameters = &.{} },
1411 .{ .name = "MatrixATF32INTEL", .value = 0x100, .parameters = &.{} },
1412 .{ .name = "MatrixBTF32INTEL", .value = 0x200, .parameters = &.{} },
1413 .{ .name = "MatrixAPackedFloat16INTEL", .value = 0x400, .parameters = &.{} },
1414 .{ .name = "MatrixBPackedFloat16INTEL", .value = 0x800, .parameters = &.{} },
1415 .{ .name = "MatrixAPackedBFloat16INTEL", .value = 0x1000, .parameters = &.{} },
1416 .{ .name = "MatrixBPackedBFloat16INTEL", .value = 0x2000, .parameters = &.{} },
1417 },
1418 .fp_encoding => &.{
1419 .{ .name = "BFloat16KHR", .value = 0, .parameters = &.{} },
1420 .{ .name = "Float8E4M3EXT", .value = 4214, .parameters = &.{} },
1421 .{ .name = "Float8E5M2EXT", .value = 4215, .parameters = &.{} },
1422 },
1423 .cooperative_vector_matrix_layout => &.{
1424 .{ .name = "RowMajorNV", .value = 0, .parameters = &.{} },
1425 .{ .name = "ColumnMajorNV", .value = 1, .parameters = &.{} },
1426 .{ .name = "InferencingOptimalNV", .value = 2, .parameters = &.{} },
1427 .{ .name = "TrainingOptimalNV", .value = 3, .parameters = &.{} },
1428 },
1429 .component_type => &.{
1430 .{ .name = "Float16NV", .value = 0, .parameters = &.{} },
1431 .{ .name = "Float32NV", .value = 1, .parameters = &.{} },
1432 .{ .name = "Float64NV", .value = 2, .parameters = &.{} },
1433 .{ .name = "SignedInt8NV", .value = 3, .parameters = &.{} },
1434 .{ .name = "SignedInt16NV", .value = 4, .parameters = &.{} },
1435 .{ .name = "SignedInt32NV", .value = 5, .parameters = &.{} },
1436 .{ .name = "SignedInt64NV", .value = 6, .parameters = &.{} },
1437 .{ .name = "UnsignedInt8NV", .value = 7, .parameters = &.{} },
1438 .{ .name = "UnsignedInt16NV", .value = 8, .parameters = &.{} },
1439 .{ .name = "UnsignedInt32NV", .value = 9, .parameters = &.{} },
1440 .{ .name = "UnsignedInt64NV", .value = 10, .parameters = &.{} },
1441 .{ .name = "SignedInt8PackedNV", .value = 1000491000, .parameters = &.{} },
1442 .{ .name = "UnsignedInt8PackedNV", .value = 1000491001, .parameters = &.{} },
1443 .{ .name = "FloatE4M3NV", .value = 1000491002, .parameters = &.{} },
1444 .{ .name = "FloatE5M2NV", .value = 1000491003, .parameters = &.{} },
1445 },
1446 .id_result_type => unreachable,
1447 .id_result => unreachable,
1448 .id_memory_semantics => unreachable,
1449 .id_scope => unreachable,
1450 .id_ref => unreachable,
1451 .literal_integer => unreachable,
1452 .literal_string => unreachable,
1453 .literal_float => unreachable,
1454 .literal_context_dependent_number => unreachable,
1455 .literal_ext_inst_integer => unreachable,
1456 .literal_spec_constant_op_integer => unreachable,
1457 .pair_literal_integer_id_ref => unreachable,
1458 .pair_id_ref_literal_integer => unreachable,
1459 .pair_id_ref_id_ref => unreachable,
1460 .tensor_operands => &.{
1461 .{ .name = "NoneARM", .value = 0x0000, .parameters = &.{} },
1462 .{ .name = "NontemporalARM", .value = 0x0001, .parameters = &.{} },
1463 .{ .name = "OutOfBoundsValueARM", .value = 0x0002, .parameters = &.{.id_ref} },
1464 .{ .name = "MakeElementAvailableARM", .value = 0x0004, .parameters = &.{.id_ref} },
1465 .{ .name = "MakeElementVisibleARM", .value = 0x0008, .parameters = &.{.id_ref} },
1466 .{ .name = "NonPrivateElementARM", .value = 0x0010, .parameters = &.{} },
1467 },
1468 .debug_info_debug_info_flags => &.{
1469 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1470 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1471 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1472 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1473 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1474 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1475 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1476 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1477 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1478 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1479 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1480 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1481 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1482 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1483 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1484 },
1485 .debug_info_debug_base_type_attribute_encoding => &.{
1486 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1487 .{ .name = "Address", .value = 1, .parameters = &.{} },
1488 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1489 .{ .name = "Float", .value = 4, .parameters = &.{} },
1490 .{ .name = "Signed", .value = 5, .parameters = &.{} },
1491 .{ .name = "SignedChar", .value = 6, .parameters = &.{} },
1492 .{ .name = "Unsigned", .value = 7, .parameters = &.{} },
1493 .{ .name = "UnsignedChar", .value = 8, .parameters = &.{} },
1494 },
1495 .debug_info_debug_composite_type => &.{
1496 .{ .name = "Class", .value = 0, .parameters = &.{} },
1497 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1498 .{ .name = "Union", .value = 2, .parameters = &.{} },
1499 },
1500 .debug_info_debug_type_qualifier => &.{
1501 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1502 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1503 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1504 },
1505 .debug_info_debug_operation => &.{
1506 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1507 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1508 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1509 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1510 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1511 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1512 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1513 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1514 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1515 },
1516 .open_cl_debug_info_100_debug_info_flags => &.{
1517 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1518 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1519 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1520 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1521 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1522 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1523 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1524 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1525 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1526 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1527 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1528 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1529 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1530 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1531 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1532 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1533 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1534 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1535 },
1536 .open_cl_debug_info_100_debug_base_type_attribute_encoding => &.{
1537 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1538 .{ .name = "Address", .value = 1, .parameters = &.{} },
1539 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1540 .{ .name = "Float", .value = 3, .parameters = &.{} },
1541 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1542 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1543 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1544 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1545 },
1546 .open_cl_debug_info_100_debug_composite_type => &.{
1547 .{ .name = "Class", .value = 0, .parameters = &.{} },
1548 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1549 .{ .name = "Union", .value = 2, .parameters = &.{} },
1550 },
1551 .open_cl_debug_info_100_debug_type_qualifier => &.{
1552 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1553 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1554 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1555 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1556 },
1557 .open_cl_debug_info_100_debug_operation => &.{
1558 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1559 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1560 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1561 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.literal_integer} },
1562 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .literal_integer, .literal_integer } },
1563 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1564 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1565 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1566 .{ .name = "Constu", .value = 8, .parameters = &.{.literal_integer} },
1567 .{ .name = "Fragment", .value = 9, .parameters = &.{ .literal_integer, .literal_integer } },
1568 },
1569 .open_cl_debug_info_100_debug_imported_entity => &.{
1570 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1571 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1572 },
1573 .non_semantic_clspv_reflection_6_kernel_property_flags => &.{
1574 .{ .name = "MayUsePrintf", .value = 0x1, .parameters = &.{} },
1575 },
1576 .non_semantic_shader_debug_info_100_debug_info_flags => &.{
1577 .{ .name = "FlagIsProtected", .value = 0x01, .parameters = &.{} },
1578 .{ .name = "FlagIsPrivate", .value = 0x02, .parameters = &.{} },
1579 .{ .name = "FlagIsPublic", .value = 0x03, .parameters = &.{} },
1580 .{ .name = "FlagIsLocal", .value = 0x04, .parameters = &.{} },
1581 .{ .name = "FlagIsDefinition", .value = 0x08, .parameters = &.{} },
1582 .{ .name = "FlagFwdDecl", .value = 0x10, .parameters = &.{} },
1583 .{ .name = "FlagArtificial", .value = 0x20, .parameters = &.{} },
1584 .{ .name = "FlagExplicit", .value = 0x40, .parameters = &.{} },
1585 .{ .name = "FlagPrototyped", .value = 0x80, .parameters = &.{} },
1586 .{ .name = "FlagObjectPointer", .value = 0x100, .parameters = &.{} },
1587 .{ .name = "FlagStaticMember", .value = 0x200, .parameters = &.{} },
1588 .{ .name = "FlagIndirectVariable", .value = 0x400, .parameters = &.{} },
1589 .{ .name = "FlagLValueReference", .value = 0x800, .parameters = &.{} },
1590 .{ .name = "FlagRValueReference", .value = 0x1000, .parameters = &.{} },
1591 .{ .name = "FlagIsOptimized", .value = 0x2000, .parameters = &.{} },
1592 .{ .name = "FlagIsEnumClass", .value = 0x4000, .parameters = &.{} },
1593 .{ .name = "FlagTypePassByValue", .value = 0x8000, .parameters = &.{} },
1594 .{ .name = "FlagTypePassByReference", .value = 0x10000, .parameters = &.{} },
1595 .{ .name = "FlagUnknownPhysicalLayout", .value = 0x20000, .parameters = &.{} },
1596 },
1597 .non_semantic_shader_debug_info_100_build_identifier_flags => &.{
1598 .{ .name = "IdentifierPossibleDuplicates", .value = 0x01, .parameters = &.{} },
1599 },
1600 .non_semantic_shader_debug_info_100_debug_base_type_attribute_encoding => &.{
1601 .{ .name = "Unspecified", .value = 0, .parameters = &.{} },
1602 .{ .name = "Address", .value = 1, .parameters = &.{} },
1603 .{ .name = "Boolean", .value = 2, .parameters = &.{} },
1604 .{ .name = "Float", .value = 3, .parameters = &.{} },
1605 .{ .name = "Signed", .value = 4, .parameters = &.{} },
1606 .{ .name = "SignedChar", .value = 5, .parameters = &.{} },
1607 .{ .name = "Unsigned", .value = 6, .parameters = &.{} },
1608 .{ .name = "UnsignedChar", .value = 7, .parameters = &.{} },
1609 },
1610 .non_semantic_shader_debug_info_100_debug_composite_type => &.{
1611 .{ .name = "Class", .value = 0, .parameters = &.{} },
1612 .{ .name = "Structure", .value = 1, .parameters = &.{} },
1613 .{ .name = "Union", .value = 2, .parameters = &.{} },
1614 },
1615 .non_semantic_shader_debug_info_100_debug_type_qualifier => &.{
1616 .{ .name = "ConstType", .value = 0, .parameters = &.{} },
1617 .{ .name = "VolatileType", .value = 1, .parameters = &.{} },
1618 .{ .name = "RestrictType", .value = 2, .parameters = &.{} },
1619 .{ .name = "AtomicType", .value = 3, .parameters = &.{} },
1620 },
1621 .non_semantic_shader_debug_info_100_debug_operation => &.{
1622 .{ .name = "Deref", .value = 0, .parameters = &.{} },
1623 .{ .name = "Plus", .value = 1, .parameters = &.{} },
1624 .{ .name = "Minus", .value = 2, .parameters = &.{} },
1625 .{ .name = "PlusUconst", .value = 3, .parameters = &.{.id_ref} },
1626 .{ .name = "BitPiece", .value = 4, .parameters = &.{ .id_ref, .id_ref } },
1627 .{ .name = "Swap", .value = 5, .parameters = &.{} },
1628 .{ .name = "Xderef", .value = 6, .parameters = &.{} },
1629 .{ .name = "StackValue", .value = 7, .parameters = &.{} },
1630 .{ .name = "Constu", .value = 8, .parameters = &.{.id_ref} },
1631 .{ .name = "Fragment", .value = 9, .parameters = &.{ .id_ref, .id_ref } },
1632 },
1633 .non_semantic_shader_debug_info_100_debug_imported_entity => &.{
1634 .{ .name = "ImportedModule", .value = 0, .parameters = &.{} },
1635 .{ .name = "ImportedDeclaration", .value = 1, .parameters = &.{} },
1636 },
1637 };
1638 }
1639};
1640pub const Opcode = enum(u16) {
1641 OpNop = 0,
1642 OpUndef = 1,
1643 OpSourceContinued = 2,
1644 OpSource = 3,
1645 OpSourceExtension = 4,
1646 OpName = 5,
1647 OpMemberName = 6,
1648 OpString = 7,
1649 OpLine = 8,
1650 OpExtension = 10,
1651 OpExtInstImport = 11,
1652 OpExtInst = 12,
1653 OpMemoryModel = 14,
1654 OpEntryPoint = 15,
1655 OpExecutionMode = 16,
1656 OpCapability = 17,
1657 OpTypeVoid = 19,
1658 OpTypeBool = 20,
1659 OpTypeInt = 21,
1660 OpTypeFloat = 22,
1661 OpTypeVector = 23,
1662 OpTypeMatrix = 24,
1663 OpTypeImage = 25,
1664 OpTypeSampler = 26,
1665 OpTypeSampledImage = 27,
1666 OpTypeArray = 28,
1667 OpTypeRuntimeArray = 29,
1668 OpTypeStruct = 30,
1669 OpTypeOpaque = 31,
1670 OpTypePointer = 32,
1671 OpTypeFunction = 33,
1672 OpTypeEvent = 34,
1673 OpTypeDeviceEvent = 35,
1674 OpTypeReserveId = 36,
1675 OpTypeQueue = 37,
1676 OpTypePipe = 38,
1677 OpTypeForwardPointer = 39,
1678 OpConstantTrue = 41,
1679 OpConstantFalse = 42,
1680 OpConstant = 43,
1681 OpConstantComposite = 44,
1682 OpConstantSampler = 45,
1683 OpConstantNull = 46,
1684 OpSpecConstantTrue = 48,
1685 OpSpecConstantFalse = 49,
1686 OpSpecConstant = 50,
1687 OpSpecConstantComposite = 51,
1688 OpSpecConstantOp = 52,
1689 OpFunction = 54,
1690 OpFunctionParameter = 55,
1691 OpFunctionEnd = 56,
1692 OpFunctionCall = 57,
1693 OpVariable = 59,
1694 OpImageTexelPointer = 60,
1695 OpLoad = 61,
1696 OpStore = 62,
1697 OpCopyMemory = 63,
1698 OpCopyMemorySized = 64,
1699 OpAccessChain = 65,
1700 OpInBoundsAccessChain = 66,
1701 OpPtrAccessChain = 67,
1702 OpArrayLength = 68,
1703 OpGenericPtrMemSemantics = 69,
1704 OpInBoundsPtrAccessChain = 70,
1705 OpDecorate = 71,
1706 OpMemberDecorate = 72,
1707 OpDecorationGroup = 73,
1708 OpGroupDecorate = 74,
1709 OpGroupMemberDecorate = 75,
1710 OpVectorExtractDynamic = 77,
1711 OpVectorInsertDynamic = 78,
1712 OpVectorShuffle = 79,
1713 OpCompositeConstruct = 80,
1714 OpCompositeExtract = 81,
1715 OpCompositeInsert = 82,
1716 OpCopyObject = 83,
1717 OpTranspose = 84,
1718 OpSampledImage = 86,
1719 OpImageSampleImplicitLod = 87,
1720 OpImageSampleExplicitLod = 88,
1721 OpImageSampleDrefImplicitLod = 89,
1722 OpImageSampleDrefExplicitLod = 90,
1723 OpImageSampleProjImplicitLod = 91,
1724 OpImageSampleProjExplicitLod = 92,
1725 OpImageSampleProjDrefImplicitLod = 93,
1726 OpImageSampleProjDrefExplicitLod = 94,
1727 OpImageFetch = 95,
1728 OpImageGather = 96,
1729 OpImageDrefGather = 97,
1730 OpImageRead = 98,
1731 OpImageWrite = 99,
1732 OpImage = 100,
1733 OpImageQueryFormat = 101,
1734 OpImageQueryOrder = 102,
1735 OpImageQuerySizeLod = 103,
1736 OpImageQuerySize = 104,
1737 OpImageQueryLod = 105,
1738 OpImageQueryLevels = 106,
1739 OpImageQuerySamples = 107,
1740 OpConvertFToU = 109,
1741 OpConvertFToS = 110,
1742 OpConvertSToF = 111,
1743 OpConvertUToF = 112,
1744 OpUConvert = 113,
1745 OpSConvert = 114,
1746 OpFConvert = 115,
1747 OpQuantizeToF16 = 116,
1748 OpConvertPtrToU = 117,
1749 OpSatConvertSToU = 118,
1750 OpSatConvertUToS = 119,
1751 OpConvertUToPtr = 120,
1752 OpPtrCastToGeneric = 121,
1753 OpGenericCastToPtr = 122,
1754 OpGenericCastToPtrExplicit = 123,
1755 OpBitcast = 124,
1756 OpSNegate = 126,
1757 OpFNegate = 127,
1758 OpIAdd = 128,
1759 OpFAdd = 129,
1760 OpISub = 130,
1761 OpFSub = 131,
1762 OpIMul = 132,
1763 OpFMul = 133,
1764 OpUDiv = 134,
1765 OpSDiv = 135,
1766 OpFDiv = 136,
1767 OpUMod = 137,
1768 OpSRem = 138,
1769 OpSMod = 139,
1770 OpFRem = 140,
1771 OpFMod = 141,
1772 OpVectorTimesScalar = 142,
1773 OpMatrixTimesScalar = 143,
1774 OpVectorTimesMatrix = 144,
1775 OpMatrixTimesVector = 145,
1776 OpMatrixTimesMatrix = 146,
1777 OpOuterProduct = 147,
1778 OpDot = 148,
1779 OpIAddCarry = 149,
1780 OpISubBorrow = 150,
1781 OpUMulExtended = 151,
1782 OpSMulExtended = 152,
1783 OpAny = 154,
1784 OpAll = 155,
1785 OpIsNan = 156,
1786 OpIsInf = 157,
1787 OpIsFinite = 158,
1788 OpIsNormal = 159,
1789 OpSignBitSet = 160,
1790 OpLessOrGreater = 161,
1791 OpOrdered = 162,
1792 OpUnordered = 163,
1793 OpLogicalEqual = 164,
1794 OpLogicalNotEqual = 165,
1795 OpLogicalOr = 166,
1796 OpLogicalAnd = 167,
1797 OpLogicalNot = 168,
1798 OpSelect = 169,
1799 OpIEqual = 170,
1800 OpINotEqual = 171,
1801 OpUGreaterThan = 172,
1802 OpSGreaterThan = 173,
1803 OpUGreaterThanEqual = 174,
1804 OpSGreaterThanEqual = 175,
1805 OpULessThan = 176,
1806 OpSLessThan = 177,
1807 OpULessThanEqual = 178,
1808 OpSLessThanEqual = 179,
1809 OpFOrdEqual = 180,
1810 OpFUnordEqual = 181,
1811 OpFOrdNotEqual = 182,
1812 OpFUnordNotEqual = 183,
1813 OpFOrdLessThan = 184,
1814 OpFUnordLessThan = 185,
1815 OpFOrdGreaterThan = 186,
1816 OpFUnordGreaterThan = 187,
1817 OpFOrdLessThanEqual = 188,
1818 OpFUnordLessThanEqual = 189,
1819 OpFOrdGreaterThanEqual = 190,
1820 OpFUnordGreaterThanEqual = 191,
1821 OpShiftRightLogical = 194,
1822 OpShiftRightArithmetic = 195,
1823 OpShiftLeftLogical = 196,
1824 OpBitwiseOr = 197,
1825 OpBitwiseXor = 198,
1826 OpBitwiseAnd = 199,
1827 OpNot = 200,
1828 OpBitFieldInsert = 201,
1829 OpBitFieldSExtract = 202,
1830 OpBitFieldUExtract = 203,
1831 OpBitReverse = 204,
1832 OpBitCount = 205,
1833 OpDPdx = 207,
1834 OpDPdy = 208,
1835 OpFwidth = 209,
1836 OpDPdxFine = 210,
1837 OpDPdyFine = 211,
1838 OpFwidthFine = 212,
1839 OpDPdxCoarse = 213,
1840 OpDPdyCoarse = 214,
1841 OpFwidthCoarse = 215,
1842 OpEmitVertex = 218,
1843 OpEndPrimitive = 219,
1844 OpEmitStreamVertex = 220,
1845 OpEndStreamPrimitive = 221,
1846 OpControlBarrier = 224,
1847 OpMemoryBarrier = 225,
1848 OpAtomicLoad = 227,
1849 OpAtomicStore = 228,
1850 OpAtomicExchange = 229,
1851 OpAtomicCompareExchange = 230,
1852 OpAtomicCompareExchangeWeak = 231,
1853 OpAtomicIIncrement = 232,
1854 OpAtomicIDecrement = 233,
1855 OpAtomicIAdd = 234,
1856 OpAtomicISub = 235,
1857 OpAtomicSMin = 236,
1858 OpAtomicUMin = 237,
1859 OpAtomicSMax = 238,
1860 OpAtomicUMax = 239,
1861 OpAtomicAnd = 240,
1862 OpAtomicOr = 241,
1863 OpAtomicXor = 242,
1864 OpPhi = 245,
1865 OpLoopMerge = 246,
1866 OpSelectionMerge = 247,
1867 OpLabel = 248,
1868 OpBranch = 249,
1869 OpBranchConditional = 250,
1870 OpSwitch = 251,
1871 OpKill = 252,
1872 OpReturn = 253,
1873 OpReturnValue = 254,
1874 OpUnreachable = 255,
1875 OpLifetimeStart = 256,
1876 OpLifetimeStop = 257,
1877 OpGroupAsyncCopy = 259,
1878 OpGroupWaitEvents = 260,
1879 OpGroupAll = 261,
1880 OpGroupAny = 262,
1881 OpGroupBroadcast = 263,
1882 OpGroupIAdd = 264,
1883 OpGroupFAdd = 265,
1884 OpGroupFMin = 266,
1885 OpGroupUMin = 267,
1886 OpGroupSMin = 268,
1887 OpGroupFMax = 269,
1888 OpGroupUMax = 270,
1889 OpGroupSMax = 271,
1890 OpReadPipe = 274,
1891 OpWritePipe = 275,
1892 OpReservedReadPipe = 276,
1893 OpReservedWritePipe = 277,
1894 OpReserveReadPipePackets = 278,
1895 OpReserveWritePipePackets = 279,
1896 OpCommitReadPipe = 280,
1897 OpCommitWritePipe = 281,
1898 OpIsValidReserveId = 282,
1899 OpGetNumPipePackets = 283,
1900 OpGetMaxPipePackets = 284,
1901 OpGroupReserveReadPipePackets = 285,
1902 OpGroupReserveWritePipePackets = 286,
1903 OpGroupCommitReadPipe = 287,
1904 OpGroupCommitWritePipe = 288,
1905 OpEnqueueMarker = 291,
1906 OpEnqueueKernel = 292,
1907 OpGetKernelNDrangeSubGroupCount = 293,
1908 OpGetKernelNDrangeMaxSubGroupSize = 294,
1909 OpGetKernelWorkGroupSize = 295,
1910 OpGetKernelPreferredWorkGroupSizeMultiple = 296,
1911 OpRetainEvent = 297,
1912 OpReleaseEvent = 298,
1913 OpCreateUserEvent = 299,
1914 OpIsValidEvent = 300,
1915 OpSetUserEventStatus = 301,
1916 OpCaptureEventProfilingInfo = 302,
1917 OpGetDefaultQueue = 303,
1918 OpBuildNDRange = 304,
1919 OpImageSparseSampleImplicitLod = 305,
1920 OpImageSparseSampleExplicitLod = 306,
1921 OpImageSparseSampleDrefImplicitLod = 307,
1922 OpImageSparseSampleDrefExplicitLod = 308,
1923 OpImageSparseSampleProjImplicitLod = 309,
1924 OpImageSparseSampleProjExplicitLod = 310,
1925 OpImageSparseSampleProjDrefImplicitLod = 311,
1926 OpImageSparseSampleProjDrefExplicitLod = 312,
1927 OpImageSparseFetch = 313,
1928 OpImageSparseGather = 314,
1929 OpImageSparseDrefGather = 315,
1930 OpImageSparseTexelsResident = 316,
1931 OpNoLine = 317,
1932 OpAtomicFlagTestAndSet = 318,
1933 OpAtomicFlagClear = 319,
1934 OpImageSparseRead = 320,
1935 OpSizeOf = 321,
1936 OpTypePipeStorage = 322,
1937 OpConstantPipeStorage = 323,
1938 OpCreatePipeFromPipeStorage = 324,
1939 OpGetKernelLocalSizeForSubgroupCount = 325,
1940 OpGetKernelMaxNumSubgroups = 326,
1941 OpTypeNamedBarrier = 327,
1942 OpNamedBarrierInitialize = 328,
1943 OpMemoryNamedBarrier = 329,
1944 OpModuleProcessed = 330,
1945 OpExecutionModeId = 331,
1946 OpDecorateId = 332,
1947 OpGroupNonUniformElect = 333,
1948 OpGroupNonUniformAll = 334,
1949 OpGroupNonUniformAny = 335,
1950 OpGroupNonUniformAllEqual = 336,
1951 OpGroupNonUniformBroadcast = 337,
1952 OpGroupNonUniformBroadcastFirst = 338,
1953 OpGroupNonUniformBallot = 339,
1954 OpGroupNonUniformInverseBallot = 340,
1955 OpGroupNonUniformBallotBitExtract = 341,
1956 OpGroupNonUniformBallotBitCount = 342,
1957 OpGroupNonUniformBallotFindLSB = 343,
1958 OpGroupNonUniformBallotFindMSB = 344,
1959 OpGroupNonUniformShuffle = 345,
1960 OpGroupNonUniformShuffleXor = 346,
1961 OpGroupNonUniformShuffleUp = 347,
1962 OpGroupNonUniformShuffleDown = 348,
1963 OpGroupNonUniformIAdd = 349,
1964 OpGroupNonUniformFAdd = 350,
1965 OpGroupNonUniformIMul = 351,
1966 OpGroupNonUniformFMul = 352,
1967 OpGroupNonUniformSMin = 353,
1968 OpGroupNonUniformUMin = 354,
1969 OpGroupNonUniformFMin = 355,
1970 OpGroupNonUniformSMax = 356,
1971 OpGroupNonUniformUMax = 357,
1972 OpGroupNonUniformFMax = 358,
1973 OpGroupNonUniformBitwiseAnd = 359,
1974 OpGroupNonUniformBitwiseOr = 360,
1975 OpGroupNonUniformBitwiseXor = 361,
1976 OpGroupNonUniformLogicalAnd = 362,
1977 OpGroupNonUniformLogicalOr = 363,
1978 OpGroupNonUniformLogicalXor = 364,
1979 OpGroupNonUniformQuadBroadcast = 365,
1980 OpGroupNonUniformQuadSwap = 366,
1981 OpCopyLogical = 400,
1982 OpPtrEqual = 401,
1983 OpPtrNotEqual = 402,
1984 OpPtrDiff = 403,
1985 OpColorAttachmentReadEXT = 4160,
1986 OpDepthAttachmentReadEXT = 4161,
1987 OpStencilAttachmentReadEXT = 4162,
1988 OpTypeTensorARM = 4163,
1989 OpTensorReadARM = 4164,
1990 OpTensorWriteARM = 4165,
1991 OpTensorQuerySizeARM = 4166,
1992 OpGraphConstantARM = 4181,
1993 OpGraphEntryPointARM = 4182,
1994 OpGraphARM = 4183,
1995 OpGraphInputARM = 4184,
1996 OpGraphSetOutputARM = 4185,
1997 OpGraphEndARM = 4186,
1998 OpTypeGraphARM = 4190,
1999 OpTerminateInvocation = 4416,
2000 OpTypeUntypedPointerKHR = 4417,
2001 OpUntypedVariableKHR = 4418,
2002 OpUntypedAccessChainKHR = 4419,
2003 OpUntypedInBoundsAccessChainKHR = 4420,
2004 OpSubgroupBallotKHR = 4421,
2005 OpSubgroupFirstInvocationKHR = 4422,
2006 OpUntypedPtrAccessChainKHR = 4423,
2007 OpUntypedInBoundsPtrAccessChainKHR = 4424,
2008 OpUntypedArrayLengthKHR = 4425,
2009 OpUntypedPrefetchKHR = 4426,
2010 OpSubgroupAllKHR = 4428,
2011 OpSubgroupAnyKHR = 4429,
2012 OpSubgroupAllEqualKHR = 4430,
2013 OpGroupNonUniformRotateKHR = 4431,
2014 OpSubgroupReadInvocationKHR = 4432,
2015 OpExtInstWithForwardRefsKHR = 4433,
2016 OpTraceRayKHR = 4445,
2017 OpExecuteCallableKHR = 4446,
2018 OpConvertUToAccelerationStructureKHR = 4447,
2019 OpIgnoreIntersectionKHR = 4448,
2020 OpTerminateRayKHR = 4449,
2021 OpSDot = 4450,
2022 OpUDot = 4451,
2023 OpSUDot = 4452,
2024 OpSDotAccSat = 4453,
2025 OpUDotAccSat = 4454,
2026 OpSUDotAccSat = 4455,
2027 OpTypeCooperativeMatrixKHR = 4456,
2028 OpCooperativeMatrixLoadKHR = 4457,
2029 OpCooperativeMatrixStoreKHR = 4458,
2030 OpCooperativeMatrixMulAddKHR = 4459,
2031 OpCooperativeMatrixLengthKHR = 4460,
2032 OpConstantCompositeReplicateEXT = 4461,
2033 OpSpecConstantCompositeReplicateEXT = 4462,
2034 OpCompositeConstructReplicateEXT = 4463,
2035 OpTypeRayQueryKHR = 4472,
2036 OpRayQueryInitializeKHR = 4473,
2037 OpRayQueryTerminateKHR = 4474,
2038 OpRayQueryGenerateIntersectionKHR = 4475,
2039 OpRayQueryConfirmIntersectionKHR = 4476,
2040 OpRayQueryProceedKHR = 4477,
2041 OpRayQueryGetIntersectionTypeKHR = 4479,
2042 OpImageSampleWeightedQCOM = 4480,
2043 OpImageBoxFilterQCOM = 4481,
2044 OpImageBlockMatchSSDQCOM = 4482,
2045 OpImageBlockMatchSADQCOM = 4483,
2046 OpImageBlockMatchWindowSSDQCOM = 4500,
2047 OpImageBlockMatchWindowSADQCOM = 4501,
2048 OpImageBlockMatchGatherSSDQCOM = 4502,
2049 OpImageBlockMatchGatherSADQCOM = 4503,
2050 OpGroupIAddNonUniformAMD = 5000,
2051 OpGroupFAddNonUniformAMD = 5001,
2052 OpGroupFMinNonUniformAMD = 5002,
2053 OpGroupUMinNonUniformAMD = 5003,
2054 OpGroupSMinNonUniformAMD = 5004,
2055 OpGroupFMaxNonUniformAMD = 5005,
2056 OpGroupUMaxNonUniformAMD = 5006,
2057 OpGroupSMaxNonUniformAMD = 5007,
2058 OpFragmentMaskFetchAMD = 5011,
2059 OpFragmentFetchAMD = 5012,
2060 OpReadClockKHR = 5056,
2061 OpAllocateNodePayloadsAMDX = 5074,
2062 OpEnqueueNodePayloadsAMDX = 5075,
2063 OpTypeNodePayloadArrayAMDX = 5076,
2064 OpFinishWritingNodePayloadAMDX = 5078,
2065 OpNodePayloadArrayLengthAMDX = 5090,
2066 OpIsNodePayloadValidAMDX = 5101,
2067 OpConstantStringAMDX = 5103,
2068 OpSpecConstantStringAMDX = 5104,
2069 OpGroupNonUniformQuadAllKHR = 5110,
2070 OpGroupNonUniformQuadAnyKHR = 5111,
2071 OpHitObjectRecordHitMotionNV = 5249,
2072 OpHitObjectRecordHitWithIndexMotionNV = 5250,
2073 OpHitObjectRecordMissMotionNV = 5251,
2074 OpHitObjectGetWorldToObjectNV = 5252,
2075 OpHitObjectGetObjectToWorldNV = 5253,
2076 OpHitObjectGetObjectRayDirectionNV = 5254,
2077 OpHitObjectGetObjectRayOriginNV = 5255,
2078 OpHitObjectTraceRayMotionNV = 5256,
2079 OpHitObjectGetShaderRecordBufferHandleNV = 5257,
2080 OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
2081 OpHitObjectRecordEmptyNV = 5259,
2082 OpHitObjectTraceRayNV = 5260,
2083 OpHitObjectRecordHitNV = 5261,
2084 OpHitObjectRecordHitWithIndexNV = 5262,
2085 OpHitObjectRecordMissNV = 5263,
2086 OpHitObjectExecuteShaderNV = 5264,
2087 OpHitObjectGetCurrentTimeNV = 5265,
2088 OpHitObjectGetAttributesNV = 5266,
2089 OpHitObjectGetHitKindNV = 5267,
2090 OpHitObjectGetPrimitiveIndexNV = 5268,
2091 OpHitObjectGetGeometryIndexNV = 5269,
2092 OpHitObjectGetInstanceIdNV = 5270,
2093 OpHitObjectGetInstanceCustomIndexNV = 5271,
2094 OpHitObjectGetWorldRayDirectionNV = 5272,
2095 OpHitObjectGetWorldRayOriginNV = 5273,
2096 OpHitObjectGetRayTMaxNV = 5274,
2097 OpHitObjectGetRayTMinNV = 5275,
2098 OpHitObjectIsEmptyNV = 5276,
2099 OpHitObjectIsHitNV = 5277,
2100 OpHitObjectIsMissNV = 5278,
2101 OpReorderThreadWithHitObjectNV = 5279,
2102 OpReorderThreadWithHintNV = 5280,
2103 OpTypeHitObjectNV = 5281,
2104 OpImageSampleFootprintNV = 5283,
2105 OpTypeCooperativeVectorNV = 5288,
2106 OpCooperativeVectorMatrixMulNV = 5289,
2107 OpCooperativeVectorOuterProductAccumulateNV = 5290,
2108 OpCooperativeVectorReduceSumAccumulateNV = 5291,
2109 OpCooperativeVectorMatrixMulAddNV = 5292,
2110 OpCooperativeMatrixConvertNV = 5293,
2111 OpEmitMeshTasksEXT = 5294,
2112 OpSetMeshOutputsEXT = 5295,
2113 OpGroupNonUniformPartitionNV = 5296,
2114 OpWritePackedPrimitiveIndices4x8NV = 5299,
2115 OpFetchMicroTriangleVertexPositionNV = 5300,
2116 OpFetchMicroTriangleVertexBarycentricNV = 5301,
2117 OpCooperativeVectorLoadNV = 5302,
2118 OpCooperativeVectorStoreNV = 5303,
2119 OpReportIntersectionKHR = 5334,
2120 OpIgnoreIntersectionNV = 5335,
2121 OpTerminateRayNV = 5336,
2122 OpTraceNV = 5337,
2123 OpTraceMotionNV = 5338,
2124 OpTraceRayMotionNV = 5339,
2125 OpRayQueryGetIntersectionTriangleVertexPositionsKHR = 5340,
2126 OpTypeAccelerationStructureKHR = 5341,
2127 OpExecuteCallableNV = 5344,
2128 OpRayQueryGetClusterIdNV = 5345,
2129 OpHitObjectGetClusterIdNV = 5346,
2130 OpTypeCooperativeMatrixNV = 5358,
2131 OpCooperativeMatrixLoadNV = 5359,
2132 OpCooperativeMatrixStoreNV = 5360,
2133 OpCooperativeMatrixMulAddNV = 5361,
2134 OpCooperativeMatrixLengthNV = 5362,
2135 OpBeginInvocationInterlockEXT = 5364,
2136 OpEndInvocationInterlockEXT = 5365,
2137 OpCooperativeMatrixReduceNV = 5366,
2138 OpCooperativeMatrixLoadTensorNV = 5367,
2139 OpCooperativeMatrixStoreTensorNV = 5368,
2140 OpCooperativeMatrixPerElementOpNV = 5369,
2141 OpTypeTensorLayoutNV = 5370,
2142 OpTypeTensorViewNV = 5371,
2143 OpCreateTensorLayoutNV = 5372,
2144 OpTensorLayoutSetDimensionNV = 5373,
2145 OpTensorLayoutSetStrideNV = 5374,
2146 OpTensorLayoutSliceNV = 5375,
2147 OpTensorLayoutSetClampValueNV = 5376,
2148 OpCreateTensorViewNV = 5377,
2149 OpTensorViewSetDimensionNV = 5378,
2150 OpTensorViewSetStrideNV = 5379,
2151 OpDemoteToHelperInvocation = 5380,
2152 OpIsHelperInvocationEXT = 5381,
2153 OpTensorViewSetClipNV = 5382,
2154 OpTensorLayoutSetBlockSizeNV = 5384,
2155 OpCooperativeMatrixTransposeNV = 5390,
2156 OpConvertUToImageNV = 5391,
2157 OpConvertUToSamplerNV = 5392,
2158 OpConvertImageToUNV = 5393,
2159 OpConvertSamplerToUNV = 5394,
2160 OpConvertUToSampledImageNV = 5395,
2161 OpConvertSampledImageToUNV = 5396,
2162 OpSamplerImageAddressingModeNV = 5397,
2163 OpRawAccessChainNV = 5398,
2164 OpRayQueryGetIntersectionSpherePositionNV = 5427,
2165 OpRayQueryGetIntersectionSphereRadiusNV = 5428,
2166 OpRayQueryGetIntersectionLSSPositionsNV = 5429,
2167 OpRayQueryGetIntersectionLSSRadiiNV = 5430,
2168 OpRayQueryGetIntersectionLSSHitValueNV = 5431,
2169 OpHitObjectGetSpherePositionNV = 5432,
2170 OpHitObjectGetSphereRadiusNV = 5433,
2171 OpHitObjectGetLSSPositionsNV = 5434,
2172 OpHitObjectGetLSSRadiiNV = 5435,
2173 OpHitObjectIsSphereHitNV = 5436,
2174 OpHitObjectIsLSSHitNV = 5437,
2175 OpRayQueryIsSphereHitNV = 5438,
2176 OpRayQueryIsLSSHitNV = 5439,
2177 OpSubgroupShuffleINTEL = 5571,
2178 OpSubgroupShuffleDownINTEL = 5572,
2179 OpSubgroupShuffleUpINTEL = 5573,
2180 OpSubgroupShuffleXorINTEL = 5574,
2181 OpSubgroupBlockReadINTEL = 5575,
2182 OpSubgroupBlockWriteINTEL = 5576,
2183 OpSubgroupImageBlockReadINTEL = 5577,
2184 OpSubgroupImageBlockWriteINTEL = 5578,
2185 OpSubgroupImageMediaBlockReadINTEL = 5580,
2186 OpSubgroupImageMediaBlockWriteINTEL = 5581,
2187 OpUCountLeadingZerosINTEL = 5585,
2188 OpUCountTrailingZerosINTEL = 5586,
2189 OpAbsISubINTEL = 5587,
2190 OpAbsUSubINTEL = 5588,
2191 OpIAddSatINTEL = 5589,
2192 OpUAddSatINTEL = 5590,
2193 OpIAverageINTEL = 5591,
2194 OpUAverageINTEL = 5592,
2195 OpIAverageRoundedINTEL = 5593,
2196 OpUAverageRoundedINTEL = 5594,
2197 OpISubSatINTEL = 5595,
2198 OpUSubSatINTEL = 5596,
2199 OpIMul32x16INTEL = 5597,
2200 OpUMul32x16INTEL = 5598,
2201 OpAtomicFMinEXT = 5614,
2202 OpAtomicFMaxEXT = 5615,
2203 OpAssumeTrueKHR = 5630,
2204 OpExpectKHR = 5631,
2205 OpDecorateString = 5632,
2206 OpMemberDecorateString = 5633,
2207 OpLoopControlINTEL = 5887,
2208 OpReadPipeBlockingINTEL = 5946,
2209 OpWritePipeBlockingINTEL = 5947,
2210 OpFPGARegINTEL = 5949,
2211 OpRayQueryGetRayTMinKHR = 6016,
2212 OpRayQueryGetRayFlagsKHR = 6017,
2213 OpRayQueryGetIntersectionTKHR = 6018,
2214 OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
2215 OpRayQueryGetIntersectionInstanceIdKHR = 6020,
2216 OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
2217 OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
2218 OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
2219 OpRayQueryGetIntersectionBarycentricsKHR = 6024,
2220 OpRayQueryGetIntersectionFrontFaceKHR = 6025,
2221 OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
2222 OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
2223 OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
2224 OpRayQueryGetWorldRayDirectionKHR = 6029,
2225 OpRayQueryGetWorldRayOriginKHR = 6030,
2226 OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
2227 OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
2228 OpAtomicFAddEXT = 6035,
2229 OpTypeBufferSurfaceINTEL = 6086,
2230 OpTypeStructContinuedINTEL = 6090,
2231 OpConstantCompositeContinuedINTEL = 6091,
2232 OpSpecConstantCompositeContinuedINTEL = 6092,
2233 OpCompositeConstructContinuedINTEL = 6096,
2234 OpConvertFToBF16INTEL = 6116,
2235 OpConvertBF16ToFINTEL = 6117,
2236 OpControlBarrierArriveINTEL = 6142,
2237 OpControlBarrierWaitINTEL = 6143,
2238 OpArithmeticFenceEXT = 6145,
2239 OpTaskSequenceCreateINTEL = 6163,
2240 OpTaskSequenceAsyncINTEL = 6164,
2241 OpTaskSequenceGetINTEL = 6165,
2242 OpTaskSequenceReleaseINTEL = 6166,
2243 OpTypeTaskSequenceINTEL = 6199,
2244 OpSubgroupBlockPrefetchINTEL = 6221,
2245 OpSubgroup2DBlockLoadINTEL = 6231,
2246 OpSubgroup2DBlockLoadTransformINTEL = 6232,
2247 OpSubgroup2DBlockLoadTransposeINTEL = 6233,
2248 OpSubgroup2DBlockPrefetchINTEL = 6234,
2249 OpSubgroup2DBlockStoreINTEL = 6235,
2250 OpSubgroupMatrixMultiplyAccumulateINTEL = 6237,
2251 OpBitwiseFunctionINTEL = 6242,
2252 OpGroupIMulKHR = 6401,
2253 OpGroupFMulKHR = 6402,
2254 OpGroupBitwiseAndKHR = 6403,
2255 OpGroupBitwiseOrKHR = 6404,
2256 OpGroupBitwiseXorKHR = 6405,
2257 OpGroupLogicalAndKHR = 6406,
2258 OpGroupLogicalOrKHR = 6407,
2259 OpGroupLogicalXorKHR = 6408,
2260 OpRoundFToTF32INTEL = 6426,
2261 OpMaskedGatherINTEL = 6428,
2262 OpMaskedScatterINTEL = 6429,
2263 OpConvertHandleToImageINTEL = 6529,
2264 OpConvertHandleToSamplerINTEL = 6530,
2265 OpConvertHandleToSampledImageINTEL = 6531,
2266
2267 pub fn Operands(comptime self: Opcode) type {
2268 return switch (self) {
2269 .OpNop => void,
2270 .OpUndef => struct { id_result_type: Id, id_result: Id },
2271 .OpSourceContinued => struct { continued_source: LiteralString },
2272 .OpSource => struct { source_language: SourceLanguage, version: LiteralInteger, file: ?Id = null, source: ?LiteralString = null },
2273 .OpSourceExtension => struct { extension: LiteralString },
2274 .OpName => struct { target: Id, name: LiteralString },
2275 .OpMemberName => struct { type: Id, member: LiteralInteger, name: LiteralString },
2276 .OpString => struct { id_result: Id, string: LiteralString },
2277 .OpLine => struct { file: Id, line: LiteralInteger, column: LiteralInteger },
2278 .OpExtension => struct { name: LiteralString },
2279 .OpExtInstImport => struct { id_result: Id, name: LiteralString },
2280 .OpExtInst => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2281 .OpMemoryModel => struct { addressing_model: AddressingModel, memory_model: MemoryModel },
2282 .OpEntryPoint => struct { execution_model: ExecutionModel, entry_point: Id, name: LiteralString, interface: []const Id = &.{} },
2283 .OpExecutionMode => struct { entry_point: Id, mode: ExecutionMode.Extended },
2284 .OpCapability => struct { capability: Capability },
2285 .OpTypeVoid => struct { id_result: Id },
2286 .OpTypeBool => struct { id_result: Id },
2287 .OpTypeInt => struct { id_result: Id, width: LiteralInteger, signedness: LiteralInteger },
2288 .OpTypeFloat => struct { id_result: Id, width: LiteralInteger, floating_point_encoding: ?FPEncoding = null },
2289 .OpTypeVector => struct { id_result: Id, component_type: Id, component_count: LiteralInteger },
2290 .OpTypeMatrix => struct { id_result: Id, column_type: Id, column_count: LiteralInteger },
2291 .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 },
2292 .OpTypeSampler => struct { id_result: Id },
2293 .OpTypeSampledImage => struct { id_result: Id, image_type: Id },
2294 .OpTypeArray => struct { id_result: Id, element_type: Id, length: Id },
2295 .OpTypeRuntimeArray => struct { id_result: Id, element_type: Id },
2296 .OpTypeStruct => struct { id_result: Id, id_ref: []const Id = &.{} },
2297 .OpTypeOpaque => struct { id_result: Id, literal_string: LiteralString },
2298 .OpTypePointer => struct { id_result: Id, storage_class: StorageClass, type: Id },
2299 .OpTypeFunction => struct { id_result: Id, return_type: Id, id_ref_2: []const Id = &.{} },
2300 .OpTypeEvent => struct { id_result: Id },
2301 .OpTypeDeviceEvent => struct { id_result: Id },
2302 .OpTypeReserveId => struct { id_result: Id },
2303 .OpTypeQueue => struct { id_result: Id },
2304 .OpTypePipe => struct { id_result: Id, qualifier: AccessQualifier },
2305 .OpTypeForwardPointer => struct { pointer_type: Id, storage_class: StorageClass },
2306 .OpConstantTrue => struct { id_result_type: Id, id_result: Id },
2307 .OpConstantFalse => struct { id_result_type: Id, id_result: Id },
2308 .OpConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2309 .OpConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2310 .OpConstantSampler => struct { id_result_type: Id, id_result: Id, sampler_addressing_mode: SamplerAddressingMode, param: LiteralInteger, sampler_filter_mode: SamplerFilterMode },
2311 .OpConstantNull => struct { id_result_type: Id, id_result: Id },
2312 .OpSpecConstantTrue => struct { id_result_type: Id, id_result: Id },
2313 .OpSpecConstantFalse => struct { id_result_type: Id, id_result: Id },
2314 .OpSpecConstant => struct { id_result_type: Id, id_result: Id, value: LiteralContextDependentNumber },
2315 .OpSpecConstantComposite => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2316 .OpSpecConstantOp => struct { id_result_type: Id, id_result: Id, opcode: LiteralSpecConstantOpInteger },
2317 .OpFunction => struct { id_result_type: Id, id_result: Id, function_control: FunctionControl, function_type: Id },
2318 .OpFunctionParameter => struct { id_result_type: Id, id_result: Id },
2319 .OpFunctionEnd => void,
2320 .OpFunctionCall => struct { id_result_type: Id, id_result: Id, function: Id, id_ref_3: []const Id = &.{} },
2321 .OpVariable => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, initializer: ?Id = null },
2322 .OpImageTexelPointer => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, sample: Id },
2323 .OpLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_access: ?MemoryAccess.Extended = null },
2324 .OpStore => struct { pointer: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2325 .OpCopyMemory => struct { target: Id, source: Id, memory_access_2: ?MemoryAccess.Extended = null, memory_access_3: ?MemoryAccess.Extended = null },
2326 .OpCopyMemorySized => struct { target: Id, source: Id, size: Id, memory_access_3: ?MemoryAccess.Extended = null, memory_access_4: ?MemoryAccess.Extended = null },
2327 .OpAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2328 .OpInBoundsAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, indexes: []const Id = &.{} },
2329 .OpPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2330 .OpArrayLength => struct { id_result_type: Id, id_result: Id, structure: Id, array_member: LiteralInteger },
2331 .OpGenericPtrMemSemantics => struct { id_result_type: Id, id_result: Id, pointer: Id },
2332 .OpInBoundsPtrAccessChain => struct { id_result_type: Id, id_result: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2333 .OpDecorate => struct { target: Id, decoration: Decoration.Extended },
2334 .OpMemberDecorate => struct { structure_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2335 .OpDecorationGroup => struct { id_result: Id },
2336 .OpGroupDecorate => struct { decoration_group: Id, targets: []const Id = &.{} },
2337 .OpGroupMemberDecorate => struct { decoration_group: Id, targets: []const PairIdRefLiteralInteger = &.{} },
2338 .OpVectorExtractDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, index: Id },
2339 .OpVectorInsertDynamic => struct { id_result_type: Id, id_result: Id, vector: Id, component: Id, index: Id },
2340 .OpVectorShuffle => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, components: []const LiteralInteger = &.{} },
2341 .OpCompositeConstruct => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2342 .OpCompositeExtract => struct { id_result_type: Id, id_result: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2343 .OpCompositeInsert => struct { id_result_type: Id, id_result: Id, object: Id, composite: Id, indexes: []const LiteralInteger = &.{} },
2344 .OpCopyObject => struct { id_result_type: Id, id_result: Id, operand: Id },
2345 .OpTranspose => struct { id_result_type: Id, id_result: Id, matrix: Id },
2346 .OpSampledImage => struct { id_result_type: Id, id_result: Id, image: Id, sampler: Id },
2347 .OpImageSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2348 .OpImageSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2349 .OpImageSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2350 .OpImageSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2351 .OpImageSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2352 .OpImageSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2353 .OpImageSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2354 .OpImageSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2355 .OpImageFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2356 .OpImageGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2357 .OpImageDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2358 .OpImageRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2359 .OpImageWrite => struct { image: Id, coordinate: Id, texel: Id, image_operands: ?ImageOperands.Extended = null },
2360 .OpImage => struct { id_result_type: Id, id_result: Id, sampled_image: Id },
2361 .OpImageQueryFormat => struct { id_result_type: Id, id_result: Id, image: Id },
2362 .OpImageQueryOrder => struct { id_result_type: Id, id_result: Id, image: Id },
2363 .OpImageQuerySizeLod => struct { id_result_type: Id, id_result: Id, image: Id, level_of_detail: Id },
2364 .OpImageQuerySize => struct { id_result_type: Id, id_result: Id, image: Id },
2365 .OpImageQueryLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id },
2366 .OpImageQueryLevels => struct { id_result_type: Id, id_result: Id, image: Id },
2367 .OpImageQuerySamples => struct { id_result_type: Id, id_result: Id, image: Id },
2368 .OpConvertFToU => struct { id_result_type: Id, id_result: Id, float_value: Id },
2369 .OpConvertFToS => struct { id_result_type: Id, id_result: Id, float_value: Id },
2370 .OpConvertSToF => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2371 .OpConvertUToF => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2372 .OpUConvert => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2373 .OpSConvert => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2374 .OpFConvert => struct { id_result_type: Id, id_result: Id, float_value: Id },
2375 .OpQuantizeToF16 => struct { id_result_type: Id, id_result: Id, value: Id },
2376 .OpConvertPtrToU => struct { id_result_type: Id, id_result: Id, pointer: Id },
2377 .OpSatConvertSToU => struct { id_result_type: Id, id_result: Id, signed_value: Id },
2378 .OpSatConvertUToS => struct { id_result_type: Id, id_result: Id, unsigned_value: Id },
2379 .OpConvertUToPtr => struct { id_result_type: Id, id_result: Id, integer_value: Id },
2380 .OpPtrCastToGeneric => struct { id_result_type: Id, id_result: Id, pointer: Id },
2381 .OpGenericCastToPtr => struct { id_result_type: Id, id_result: Id, pointer: Id },
2382 .OpGenericCastToPtrExplicit => struct { id_result_type: Id, id_result: Id, pointer: Id, storage: StorageClass },
2383 .OpBitcast => struct { id_result_type: Id, id_result: Id, operand: Id },
2384 .OpSNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2385 .OpFNegate => struct { id_result_type: Id, id_result: Id, operand: Id },
2386 .OpIAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2387 .OpFAdd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2388 .OpISub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2389 .OpFSub => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2390 .OpIMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2391 .OpFMul => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2392 .OpUDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2393 .OpSDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2394 .OpFDiv => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2395 .OpUMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2396 .OpSRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2397 .OpSMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2398 .OpFRem => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2399 .OpFMod => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2400 .OpVectorTimesScalar => struct { id_result_type: Id, id_result: Id, vector: Id, scalar: Id },
2401 .OpMatrixTimesScalar => struct { id_result_type: Id, id_result: Id, matrix: Id, scalar: Id },
2402 .OpVectorTimesMatrix => struct { id_result_type: Id, id_result: Id, vector: Id, matrix: Id },
2403 .OpMatrixTimesVector => struct { id_result_type: Id, id_result: Id, matrix: Id, vector: Id },
2404 .OpMatrixTimesMatrix => struct { id_result_type: Id, id_result: Id, left_matrix: Id, right_matrix: Id },
2405 .OpOuterProduct => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2406 .OpDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id },
2407 .OpIAddCarry => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2408 .OpISubBorrow => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2409 .OpUMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2410 .OpSMulExtended => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2411 .OpAny => struct { id_result_type: Id, id_result: Id, vector: Id },
2412 .OpAll => struct { id_result_type: Id, id_result: Id, vector: Id },
2413 .OpIsNan => struct { id_result_type: Id, id_result: Id, x: Id },
2414 .OpIsInf => struct { id_result_type: Id, id_result: Id, x: Id },
2415 .OpIsFinite => struct { id_result_type: Id, id_result: Id, x: Id },
2416 .OpIsNormal => struct { id_result_type: Id, id_result: Id, x: Id },
2417 .OpSignBitSet => struct { id_result_type: Id, id_result: Id, x: Id },
2418 .OpLessOrGreater => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2419 .OpOrdered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2420 .OpUnordered => struct { id_result_type: Id, id_result: Id, x: Id, y: Id },
2421 .OpLogicalEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2422 .OpLogicalNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2423 .OpLogicalOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2424 .OpLogicalAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2425 .OpLogicalNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2426 .OpSelect => struct { id_result_type: Id, id_result: Id, condition: Id, object_1: Id, object_2: Id },
2427 .OpIEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2428 .OpINotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2429 .OpUGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2430 .OpSGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2431 .OpUGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2432 .OpSGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2433 .OpULessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2434 .OpSLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2435 .OpULessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2436 .OpSLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2437 .OpFOrdEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2438 .OpFUnordEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2439 .OpFOrdNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2440 .OpFUnordNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2441 .OpFOrdLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2442 .OpFUnordLessThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2443 .OpFOrdGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2444 .OpFUnordGreaterThan => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2445 .OpFOrdLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2446 .OpFUnordLessThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2447 .OpFOrdGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2448 .OpFUnordGreaterThanEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2449 .OpShiftRightLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2450 .OpShiftRightArithmetic => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2451 .OpShiftLeftLogical => struct { id_result_type: Id, id_result: Id, base: Id, shift: Id },
2452 .OpBitwiseOr => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2453 .OpBitwiseXor => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2454 .OpBitwiseAnd => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2455 .OpNot => struct { id_result_type: Id, id_result: Id, operand: Id },
2456 .OpBitFieldInsert => struct { id_result_type: Id, id_result: Id, base: Id, insert: Id, offset: Id, count: Id },
2457 .OpBitFieldSExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2458 .OpBitFieldUExtract => struct { id_result_type: Id, id_result: Id, base: Id, offset: Id, count: Id },
2459 .OpBitReverse => struct { id_result_type: Id, id_result: Id, base: Id },
2460 .OpBitCount => struct { id_result_type: Id, id_result: Id, base: Id },
2461 .OpDPdx => struct { id_result_type: Id, id_result: Id, p: Id },
2462 .OpDPdy => struct { id_result_type: Id, id_result: Id, p: Id },
2463 .OpFwidth => struct { id_result_type: Id, id_result: Id, p: Id },
2464 .OpDPdxFine => struct { id_result_type: Id, id_result: Id, p: Id },
2465 .OpDPdyFine => struct { id_result_type: Id, id_result: Id, p: Id },
2466 .OpFwidthFine => struct { id_result_type: Id, id_result: Id, p: Id },
2467 .OpDPdxCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2468 .OpDPdyCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2469 .OpFwidthCoarse => struct { id_result_type: Id, id_result: Id, p: Id },
2470 .OpEmitVertex => void,
2471 .OpEndPrimitive => void,
2472 .OpEmitStreamVertex => struct { stream: Id },
2473 .OpEndStreamPrimitive => struct { stream: Id },
2474 .OpControlBarrier => struct { execution: Id, memory: Id, semantics: Id },
2475 .OpMemoryBarrier => struct { memory: Id, semantics: Id },
2476 .OpAtomicLoad => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2477 .OpAtomicStore => struct { pointer: Id, memory: Id, semantics: Id, value: Id },
2478 .OpAtomicExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2479 .OpAtomicCompareExchange => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2480 .OpAtomicCompareExchangeWeak => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, equal: Id, unequal: Id, value: Id, comparator: Id },
2481 .OpAtomicIIncrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2482 .OpAtomicIDecrement => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2483 .OpAtomicIAdd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2484 .OpAtomicISub => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2485 .OpAtomicSMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2486 .OpAtomicUMin => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2487 .OpAtomicSMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2488 .OpAtomicUMax => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2489 .OpAtomicAnd => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2490 .OpAtomicOr => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2491 .OpAtomicXor => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2492 .OpPhi => struct { id_result_type: Id, id_result: Id, pair_id_ref_id_ref: []const PairIdRefIdRef = &.{} },
2493 .OpLoopMerge => struct { merge_block: Id, continue_target: Id, loop_control: LoopControl.Extended },
2494 .OpSelectionMerge => struct { merge_block: Id, selection_control: SelectionControl },
2495 .OpLabel => struct { id_result: Id },
2496 .OpBranch => struct { target_label: Id },
2497 .OpBranchConditional => struct { condition: Id, true_label: Id, false_label: Id, branch_weights: []const LiteralInteger = &.{} },
2498 .OpSwitch => struct { selector: Id, default: Id, target: []const PairLiteralIntegerIdRef = &.{} },
2499 .OpKill => void,
2500 .OpReturn => void,
2501 .OpReturnValue => struct { value: Id },
2502 .OpUnreachable => void,
2503 .OpLifetimeStart => struct { pointer: Id, size: LiteralInteger },
2504 .OpLifetimeStop => struct { pointer: Id, size: LiteralInteger },
2505 .OpGroupAsyncCopy => struct { id_result_type: Id, id_result: Id, execution: Id, destination: Id, source: Id, num_elements: Id, stride: Id, event: Id },
2506 .OpGroupWaitEvents => struct { execution: Id, num_events: Id, events_list: Id },
2507 .OpGroupAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2508 .OpGroupAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2509 .OpGroupBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, local_id: Id },
2510 .OpGroupIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2511 .OpGroupFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2512 .OpGroupFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2513 .OpGroupUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2514 .OpGroupSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2515 .OpGroupFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2516 .OpGroupUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2517 .OpGroupSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2518 .OpReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2519 .OpWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2520 .OpReservedReadPipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2521 .OpReservedWritePipe => struct { id_result_type: Id, id_result: Id, pipe: Id, reserve_id: Id, index: Id, pointer: Id, packet_size: Id, packet_alignment: Id },
2522 .OpReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2523 .OpReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2524 .OpCommitReadPipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2525 .OpCommitWritePipe => struct { pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2526 .OpIsValidReserveId => struct { id_result_type: Id, id_result: Id, reserve_id: Id },
2527 .OpGetNumPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2528 .OpGetMaxPipePackets => struct { id_result_type: Id, id_result: Id, pipe: Id, packet_size: Id, packet_alignment: Id },
2529 .OpGroupReserveReadPipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2530 .OpGroupReserveWritePipePackets => struct { id_result_type: Id, id_result: Id, execution: Id, pipe: Id, num_packets: Id, packet_size: Id, packet_alignment: Id },
2531 .OpGroupCommitReadPipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2532 .OpGroupCommitWritePipe => struct { execution: Id, pipe: Id, reserve_id: Id, packet_size: Id, packet_alignment: Id },
2533 .OpEnqueueMarker => struct { id_result_type: Id, id_result: Id, queue: Id, num_events: Id, wait_events: Id, ret_event: Id },
2534 .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 = &.{} },
2535 .OpGetKernelNDrangeSubGroupCount => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2536 .OpGetKernelNDrangeMaxSubGroupSize => struct { id_result_type: Id, id_result: Id, nd_range: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2537 .OpGetKernelWorkGroupSize => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2538 .OpGetKernelPreferredWorkGroupSizeMultiple => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2539 .OpRetainEvent => struct { event: Id },
2540 .OpReleaseEvent => struct { event: Id },
2541 .OpCreateUserEvent => struct { id_result_type: Id, id_result: Id },
2542 .OpIsValidEvent => struct { id_result_type: Id, id_result: Id, event: Id },
2543 .OpSetUserEventStatus => struct { event: Id, status: Id },
2544 .OpCaptureEventProfilingInfo => struct { event: Id, profiling_info: Id, value: Id },
2545 .OpGetDefaultQueue => struct { id_result_type: Id, id_result: Id },
2546 .OpBuildNDRange => struct { id_result_type: Id, id_result: Id, global_work_size: Id, local_work_size: Id, global_work_offset: Id },
2547 .OpImageSparseSampleImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2548 .OpImageSparseSampleExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2549 .OpImageSparseSampleDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2550 .OpImageSparseSampleDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2551 .OpImageSparseSampleProjImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2552 .OpImageSparseSampleProjExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, image_operands: ImageOperands.Extended },
2553 .OpImageSparseSampleProjDrefImplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2554 .OpImageSparseSampleProjDrefExplicitLod => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ImageOperands.Extended },
2555 .OpImageSparseFetch => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2556 .OpImageSparseGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, component: Id, image_operands: ?ImageOperands.Extended = null },
2557 .OpImageSparseDrefGather => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, d_ref: Id, image_operands: ?ImageOperands.Extended = null },
2558 .OpImageSparseTexelsResident => struct { id_result_type: Id, id_result: Id, resident_code: Id },
2559 .OpNoLine => void,
2560 .OpAtomicFlagTestAndSet => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id },
2561 .OpAtomicFlagClear => struct { pointer: Id, memory: Id, semantics: Id },
2562 .OpImageSparseRead => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, image_operands: ?ImageOperands.Extended = null },
2563 .OpSizeOf => struct { id_result_type: Id, id_result: Id, pointer: Id },
2564 .OpTypePipeStorage => struct { id_result: Id },
2565 .OpConstantPipeStorage => struct { id_result_type: Id, id_result: Id, packet_size: LiteralInteger, packet_alignment: LiteralInteger, capacity: LiteralInteger },
2566 .OpCreatePipeFromPipeStorage => struct { id_result_type: Id, id_result: Id, pipe_storage: Id },
2567 .OpGetKernelLocalSizeForSubgroupCount => struct { id_result_type: Id, id_result: Id, subgroup_count: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2568 .OpGetKernelMaxNumSubgroups => struct { id_result_type: Id, id_result: Id, invoke: Id, param: Id, param_size: Id, param_align: Id },
2569 .OpTypeNamedBarrier => struct { id_result: Id },
2570 .OpNamedBarrierInitialize => struct { id_result_type: Id, id_result: Id, subgroup_count: Id },
2571 .OpMemoryNamedBarrier => struct { named_barrier: Id, memory: Id, semantics: Id },
2572 .OpModuleProcessed => struct { process: LiteralString },
2573 .OpExecutionModeId => struct { entry_point: Id, mode: ExecutionMode.Extended },
2574 .OpDecorateId => struct { target: Id, decoration: Decoration.Extended },
2575 .OpGroupNonUniformElect => struct { id_result_type: Id, id_result: Id, execution: Id },
2576 .OpGroupNonUniformAll => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2577 .OpGroupNonUniformAny => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2578 .OpGroupNonUniformAllEqual => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2579 .OpGroupNonUniformBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2580 .OpGroupNonUniformBroadcastFirst => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2581 .OpGroupNonUniformBallot => struct { id_result_type: Id, id_result: Id, execution: Id, predicate: Id },
2582 .OpGroupNonUniformInverseBallot => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2583 .OpGroupNonUniformBallotBitExtract => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2584 .OpGroupNonUniformBallotBitCount => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id },
2585 .OpGroupNonUniformBallotFindLSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2586 .OpGroupNonUniformBallotFindMSB => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id },
2587 .OpGroupNonUniformShuffle => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, id: Id },
2588 .OpGroupNonUniformShuffleXor => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, mask: Id },
2589 .OpGroupNonUniformShuffleUp => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2590 .OpGroupNonUniformShuffleDown => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id },
2591 .OpGroupNonUniformIAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2592 .OpGroupNonUniformFAdd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2593 .OpGroupNonUniformIMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2594 .OpGroupNonUniformFMul => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2595 .OpGroupNonUniformSMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2596 .OpGroupNonUniformUMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2597 .OpGroupNonUniformFMin => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2598 .OpGroupNonUniformSMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2599 .OpGroupNonUniformUMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2600 .OpGroupNonUniformFMax => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2601 .OpGroupNonUniformBitwiseAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2602 .OpGroupNonUniformBitwiseOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2603 .OpGroupNonUniformBitwiseXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2604 .OpGroupNonUniformLogicalAnd => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2605 .OpGroupNonUniformLogicalOr => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2606 .OpGroupNonUniformLogicalXor => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, value: Id, cluster_size: ?Id = null },
2607 .OpGroupNonUniformQuadBroadcast => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, index: Id },
2608 .OpGroupNonUniformQuadSwap => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, direction: Id },
2609 .OpCopyLogical => struct { id_result_type: Id, id_result: Id, operand: Id },
2610 .OpPtrEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2611 .OpPtrNotEqual => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2612 .OpPtrDiff => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2613 .OpColorAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, attachment: Id, sample: ?Id = null },
2614 .OpDepthAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2615 .OpStencilAttachmentReadEXT => struct { id_result_type: Id, id_result: Id, sample: ?Id = null },
2616 .OpTypeTensorARM => struct { id_result: Id, element_type: Id, rank: ?Id = null, shape: ?Id = null },
2617 .OpTensorReadARM => struct { id_result_type: Id, id_result: Id, tensor: Id, coordinates: Id, tensor_operands: ?TensorOperands.Extended = null },
2618 .OpTensorWriteARM => struct { tensor: Id, coordinates: Id, object: Id, tensor_operands: ?TensorOperands.Extended = null },
2619 .OpTensorQuerySizeARM => struct { id_result_type: Id, id_result: Id, tensor: Id, dimension: Id },
2620 .OpGraphConstantARM => struct { id_result_type: Id, id_result: Id, graph_constant_id: LiteralInteger },
2621 .OpGraphEntryPointARM => struct { graph: Id, name: LiteralString, interface: []const Id = &.{} },
2622 .OpGraphARM => struct { id_result_type: Id, id_result: Id },
2623 .OpGraphInputARM => struct { id_result_type: Id, id_result: Id, input_index: Id, element_index: []const Id = &.{} },
2624 .OpGraphSetOutputARM => struct { value: Id, output_index: Id, element_index: []const Id = &.{} },
2625 .OpGraphEndARM => void,
2626 .OpTypeGraphARM => struct { id_result: Id, num_inputs: LiteralInteger, in_out_types: []const Id = &.{} },
2627 .OpTerminateInvocation => void,
2628 .OpTypeUntypedPointerKHR => struct { id_result: Id, storage_class: StorageClass },
2629 .OpUntypedVariableKHR => struct { id_result_type: Id, id_result: Id, storage_class: StorageClass, data_type: ?Id = null, initializer: ?Id = null },
2630 .OpUntypedAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2631 .OpUntypedInBoundsAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, indexes: []const Id = &.{} },
2632 .OpSubgroupBallotKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2633 .OpSubgroupFirstInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id },
2634 .OpUntypedPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2635 .OpUntypedInBoundsPtrAccessChainKHR => struct { id_result_type: Id, id_result: Id, base_type: Id, base: Id, element: Id, indexes: []const Id = &.{} },
2636 .OpUntypedArrayLengthKHR => struct { id_result_type: Id, id_result: Id, structure: Id, pointer: Id, array_member: LiteralInteger },
2637 .OpUntypedPrefetchKHR => struct { pointer_type: Id, num_bytes: Id, rw: ?Id = null, locality: ?Id = null, cache_type: ?Id = null },
2638 .OpSubgroupAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2639 .OpSubgroupAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2640 .OpSubgroupAllEqualKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2641 .OpGroupNonUniformRotateKHR => struct { id_result_type: Id, id_result: Id, execution: Id, value: Id, delta: Id, cluster_size: ?Id = null },
2642 .OpSubgroupReadInvocationKHR => struct { id_result_type: Id, id_result: Id, value: Id, index: Id },
2643 .OpExtInstWithForwardRefsKHR => struct { id_result_type: Id, id_result: Id, set: Id, instruction: LiteralExtInstInteger, id_ref_4: []const Id = &.{} },
2644 .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 },
2645 .OpExecuteCallableKHR => struct { sbt_index: Id, callable_data: Id },
2646 .OpConvertUToAccelerationStructureKHR => struct { id_result_type: Id, id_result: Id, accel: Id },
2647 .OpIgnoreIntersectionKHR => void,
2648 .OpTerminateRayKHR => void,
2649 .OpSDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2650 .OpUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2651 .OpSUDot => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, packed_vector_format: ?PackedVectorFormat = null },
2652 .OpSDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2653 .OpUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2654 .OpSUDotAccSat => struct { id_result_type: Id, id_result: Id, vector_1: Id, vector_2: Id, accumulator: Id, packed_vector_format: ?PackedVectorFormat = null },
2655 .OpTypeCooperativeMatrixKHR => struct { id_result: Id, component_type: Id, scope: Id, rows: Id, columns: Id, use: Id },
2656 .OpCooperativeMatrixLoadKHR => struct { id_result_type: Id, id_result: Id, pointer: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2657 .OpCooperativeMatrixStoreKHR => struct { pointer: Id, object: Id, memory_layout: Id, stride: ?Id = null, memory_operand: ?MemoryAccess.Extended = null },
2658 .OpCooperativeMatrixMulAddKHR => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, cooperative_matrix_operands: ?CooperativeMatrixOperands = null },
2659 .OpCooperativeMatrixLengthKHR => struct { id_result_type: Id, id_result: Id, type: Id },
2660 .OpConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2661 .OpSpecConstantCompositeReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2662 .OpCompositeConstructReplicateEXT => struct { id_result_type: Id, id_result: Id, value: Id },
2663 .OpTypeRayQueryKHR => struct { id_result: Id },
2664 .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 },
2665 .OpRayQueryTerminateKHR => struct { ray_query: Id },
2666 .OpRayQueryGenerateIntersectionKHR => struct { ray_query: Id, hit_t: Id },
2667 .OpRayQueryConfirmIntersectionKHR => struct { ray_query: Id },
2668 .OpRayQueryProceedKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2669 .OpRayQueryGetIntersectionTypeKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2670 .OpImageSampleWeightedQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, weights: Id },
2671 .OpImageBoxFilterQCOM => struct { id_result_type: Id, id_result: Id, texture: Id, coordinates: Id, box_size: Id },
2672 .OpImageBlockMatchSSDQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2673 .OpImageBlockMatchSADQCOM => struct { id_result_type: Id, id_result: Id, target: Id, target_coordinates: Id, reference: Id, reference_coordinates: Id, block_size: Id },
2674 .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 },
2675 .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 },
2676 .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 },
2677 .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 },
2678 .OpGroupIAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2679 .OpGroupFAddNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2680 .OpGroupFMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2681 .OpGroupUMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2682 .OpGroupSMinNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2683 .OpGroupFMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2684 .OpGroupUMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2685 .OpGroupSMaxNonUniformAMD => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2686 .OpFragmentMaskFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2687 .OpFragmentFetchAMD => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, fragment_index: Id },
2688 .OpReadClockKHR => struct { id_result_type: Id, id_result: Id, scope: Id },
2689 .OpAllocateNodePayloadsAMDX => struct { id_result_type: Id, id_result: Id, visibility: Id, payload_count: Id, node_index: Id },
2690 .OpEnqueueNodePayloadsAMDX => struct { payload_array: Id },
2691 .OpTypeNodePayloadArrayAMDX => struct { id_result: Id, payload_type: Id },
2692 .OpFinishWritingNodePayloadAMDX => struct { id_result_type: Id, id_result: Id, payload: Id },
2693 .OpNodePayloadArrayLengthAMDX => struct { id_result_type: Id, id_result: Id, payload_array: Id },
2694 .OpIsNodePayloadValidAMDX => struct { id_result_type: Id, id_result: Id, payload_type: Id, node_index: Id },
2695 .OpConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2696 .OpSpecConstantStringAMDX => struct { id_result: Id, literal_string: LiteralString },
2697 .OpGroupNonUniformQuadAllKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2698 .OpGroupNonUniformQuadAnyKHR => struct { id_result_type: Id, id_result: Id, predicate: Id },
2699 .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 },
2700 .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 },
2701 .OpHitObjectRecordMissMotionNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id, current_time: Id },
2702 .OpHitObjectGetWorldToObjectNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2703 .OpHitObjectGetObjectToWorldNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2704 .OpHitObjectGetObjectRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2705 .OpHitObjectGetObjectRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2706 .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 },
2707 .OpHitObjectGetShaderRecordBufferHandleNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2708 .OpHitObjectGetShaderBindingTableRecordIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2709 .OpHitObjectRecordEmptyNV => struct { hit_object: Id },
2710 .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 },
2711 .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 },
2712 .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 },
2713 .OpHitObjectRecordMissNV => struct { hit_object: Id, sbt_index: Id, origin: Id, t_min: Id, direction: Id, t_max: Id },
2714 .OpHitObjectExecuteShaderNV => struct { hit_object: Id, payload: Id },
2715 .OpHitObjectGetCurrentTimeNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2716 .OpHitObjectGetAttributesNV => struct { hit_object: Id, hit_object_attribute: Id },
2717 .OpHitObjectGetHitKindNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2718 .OpHitObjectGetPrimitiveIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2719 .OpHitObjectGetGeometryIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2720 .OpHitObjectGetInstanceIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2721 .OpHitObjectGetInstanceCustomIndexNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2722 .OpHitObjectGetWorldRayDirectionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2723 .OpHitObjectGetWorldRayOriginNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2724 .OpHitObjectGetRayTMaxNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2725 .OpHitObjectGetRayTMinNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2726 .OpHitObjectIsEmptyNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2727 .OpHitObjectIsHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2728 .OpHitObjectIsMissNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2729 .OpReorderThreadWithHitObjectNV => struct { hit_object: Id, hint: ?Id = null, bits: ?Id = null },
2730 .OpReorderThreadWithHintNV => struct { hint: Id, bits: Id },
2731 .OpTypeHitObjectNV => struct { id_result: Id },
2732 .OpImageSampleFootprintNV => struct { id_result_type: Id, id_result: Id, sampled_image: Id, coordinate: Id, granularity: Id, coarse: Id, image_operands: ?ImageOperands.Extended = null },
2733 .OpTypeCooperativeVectorNV => struct { id_result: Id, component_type: Id, component_count: Id },
2734 .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 },
2735 .OpCooperativeVectorOuterProductAccumulateNV => struct { pointer: Id, offset: Id, a: Id, b: Id, memory_layout: Id, matrix_interpretation: Id, matrix_stride: ?Id = null },
2736 .OpCooperativeVectorReduceSumAccumulateNV => struct { pointer: Id, offset: Id, v: Id },
2737 .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 },
2738 .OpCooperativeMatrixConvertNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2739 .OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },
2740 .OpSetMeshOutputsEXT => struct { vertex_count: Id, primitive_count: Id },
2741 .OpGroupNonUniformPartitionNV => struct { id_result_type: Id, id_result: Id, value: Id },
2742 .OpWritePackedPrimitiveIndices4x8NV => struct { index_offset: Id, packed_indices: Id },
2743 .OpFetchMicroTriangleVertexPositionNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2744 .OpFetchMicroTriangleVertexBarycentricNV => struct { id_result_type: Id, id_result: Id, accel: Id, instance_id: Id, geometry_index: Id, primitive_index: Id, barycentric: Id },
2745 .OpCooperativeVectorLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, offset: Id, memory_access: ?MemoryAccess.Extended = null },
2746 .OpCooperativeVectorStoreNV => struct { pointer: Id, offset: Id, object: Id, memory_access: ?MemoryAccess.Extended = null },
2747 .OpReportIntersectionKHR => struct { id_result_type: Id, id_result: Id, hit: Id, hit_kind: Id },
2748 .OpIgnoreIntersectionNV => void,
2749 .OpTerminateRayNV => void,
2750 .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 },
2751 .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 },
2752 .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 },
2753 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2754 .OpTypeAccelerationStructureKHR => struct { id_result: Id },
2755 .OpExecuteCallableNV => struct { sbt_index: Id, callable_data_id: Id },
2756 .OpRayQueryGetClusterIdNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2757 .OpHitObjectGetClusterIdNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2758 .OpTypeCooperativeMatrixNV => struct { id_result: Id, component_type: Id, execution: Id, rows: Id, columns: Id },
2759 .OpCooperativeMatrixLoadNV => struct { id_result_type: Id, id_result: Id, pointer: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2760 .OpCooperativeMatrixStoreNV => struct { pointer: Id, object: Id, stride: Id, column_major: Id, memory_access: ?MemoryAccess.Extended = null },
2761 .OpCooperativeMatrixMulAddNV => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id },
2762 .OpCooperativeMatrixLengthNV => struct { id_result_type: Id, id_result: Id, type: Id },
2763 .OpBeginInvocationInterlockEXT => void,
2764 .OpEndInvocationInterlockEXT => void,
2765 .OpCooperativeMatrixReduceNV => struct { id_result_type: Id, id_result: Id, matrix: Id, reduce: CooperativeMatrixReduce, combine_func: Id },
2766 .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 },
2767 .OpCooperativeMatrixStoreTensorNV => struct { pointer: Id, object: Id, tensor_layout: Id, memory_operand: MemoryAccess.Extended, tensor_addressing_operands: TensorAddressingOperands.Extended },
2768 .OpCooperativeMatrixPerElementOpNV => struct { id_result_type: Id, id_result: Id, matrix: Id, func: Id, operands: []const Id = &.{} },
2769 .OpTypeTensorLayoutNV => struct { id_result: Id, dim: Id, clamp_mode: Id },
2770 .OpTypeTensorViewNV => struct { id_result: Id, dim: Id, has_dimensions: Id, p: []const Id = &.{} },
2771 .OpCreateTensorLayoutNV => struct { id_result_type: Id, id_result: Id },
2772 .OpTensorLayoutSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, dim: []const Id = &.{} },
2773 .OpTensorLayoutSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, stride: []const Id = &.{} },
2774 .OpTensorLayoutSliceNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, operands: []const Id = &.{} },
2775 .OpTensorLayoutSetClampValueNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, value: Id },
2776 .OpCreateTensorViewNV => struct { id_result_type: Id, id_result: Id },
2777 .OpTensorViewSetDimensionNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, dim: []const Id = &.{} },
2778 .OpTensorViewSetStrideNV => struct { id_result_type: Id, id_result: Id, tensor_view: Id, stride: []const Id = &.{} },
2779 .OpDemoteToHelperInvocation => void,
2780 .OpIsHelperInvocationEXT => struct { id_result_type: Id, id_result: Id },
2781 .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 },
2782 .OpTensorLayoutSetBlockSizeNV => struct { id_result_type: Id, id_result: Id, tensor_layout: Id, block_size: []const Id = &.{} },
2783 .OpCooperativeMatrixTransposeNV => struct { id_result_type: Id, id_result: Id, matrix: Id },
2784 .OpConvertUToImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2785 .OpConvertUToSamplerNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2786 .OpConvertImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2787 .OpConvertSamplerToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2788 .OpConvertUToSampledImageNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2789 .OpConvertSampledImageToUNV => struct { id_result_type: Id, id_result: Id, operand: Id },
2790 .OpSamplerImageAddressingModeNV => struct { bit_width: LiteralInteger },
2791 .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 },
2792 .OpRayQueryGetIntersectionSpherePositionNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2793 .OpRayQueryGetIntersectionSphereRadiusNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2794 .OpRayQueryGetIntersectionLSSPositionsNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2795 .OpRayQueryGetIntersectionLSSRadiiNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2796 .OpRayQueryGetIntersectionLSSHitValueNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2797 .OpHitObjectGetSpherePositionNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2798 .OpHitObjectGetSphereRadiusNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2799 .OpHitObjectGetLSSPositionsNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2800 .OpHitObjectGetLSSRadiiNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2801 .OpHitObjectIsSphereHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2802 .OpHitObjectIsLSSHitNV => struct { id_result_type: Id, id_result: Id, hit_object: Id },
2803 .OpRayQueryIsSphereHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2804 .OpRayQueryIsLSSHitNV => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2805 .OpSubgroupShuffleINTEL => struct { id_result_type: Id, id_result: Id, data: Id, invocation_id: Id },
2806 .OpSubgroupShuffleDownINTEL => struct { id_result_type: Id, id_result: Id, current: Id, next: Id, delta: Id },
2807 .OpSubgroupShuffleUpINTEL => struct { id_result_type: Id, id_result: Id, previous: Id, current: Id, delta: Id },
2808 .OpSubgroupShuffleXorINTEL => struct { id_result_type: Id, id_result: Id, data: Id, value: Id },
2809 .OpSubgroupBlockReadINTEL => struct { id_result_type: Id, id_result: Id, ptr: Id },
2810 .OpSubgroupBlockWriteINTEL => struct { ptr: Id, data: Id },
2811 .OpSubgroupImageBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id },
2812 .OpSubgroupImageBlockWriteINTEL => struct { image: Id, coordinate: Id, data: Id },
2813 .OpSubgroupImageMediaBlockReadINTEL => struct { id_result_type: Id, id_result: Id, image: Id, coordinate: Id, width: Id, height: Id },
2814 .OpSubgroupImageMediaBlockWriteINTEL => struct { image: Id, coordinate: Id, width: Id, height: Id, data: Id },
2815 .OpUCountLeadingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2816 .OpUCountTrailingZerosINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2817 .OpAbsISubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2818 .OpAbsUSubINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2819 .OpIAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2820 .OpUAddSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2821 .OpIAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2822 .OpUAverageINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2823 .OpIAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2824 .OpUAverageRoundedINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2825 .OpISubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2826 .OpUSubSatINTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2827 .OpIMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2828 .OpUMul32x16INTEL => struct { id_result_type: Id, id_result: Id, operand_1: Id, operand_2: Id },
2829 .OpAtomicFMinEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2830 .OpAtomicFMaxEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2831 .OpAssumeTrueKHR => struct { condition: Id },
2832 .OpExpectKHR => struct { id_result_type: Id, id_result: Id, value: Id, expected_value: Id },
2833 .OpDecorateString => struct { target: Id, decoration: Decoration.Extended },
2834 .OpMemberDecorateString => struct { struct_type: Id, member: LiteralInteger, decoration: Decoration.Extended },
2835 .OpLoopControlINTEL => struct { loop_control_parameters: []const LiteralInteger = &.{} },
2836 .OpReadPipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2837 .OpWritePipeBlockingINTEL => struct { id_result_type: Id, id_result: Id, packet_size: Id, packet_alignment: Id },
2838 .OpFPGARegINTEL => struct { id_result_type: Id, id_result: Id, input: Id },
2839 .OpRayQueryGetRayTMinKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2840 .OpRayQueryGetRayFlagsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2841 .OpRayQueryGetIntersectionTKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2842 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2843 .OpRayQueryGetIntersectionInstanceIdKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2844 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2845 .OpRayQueryGetIntersectionGeometryIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2846 .OpRayQueryGetIntersectionPrimitiveIndexKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2847 .OpRayQueryGetIntersectionBarycentricsKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2848 .OpRayQueryGetIntersectionFrontFaceKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2849 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2850 .OpRayQueryGetIntersectionObjectRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2851 .OpRayQueryGetIntersectionObjectRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2852 .OpRayQueryGetWorldRayDirectionKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2853 .OpRayQueryGetWorldRayOriginKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id },
2854 .OpRayQueryGetIntersectionObjectToWorldKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2855 .OpRayQueryGetIntersectionWorldToObjectKHR => struct { id_result_type: Id, id_result: Id, ray_query: Id, intersection: Id },
2856 .OpAtomicFAddEXT => struct { id_result_type: Id, id_result: Id, pointer: Id, memory: Id, semantics: Id, value: Id },
2857 .OpTypeBufferSurfaceINTEL => struct { id_result: Id, access_qualifier: AccessQualifier },
2858 .OpTypeStructContinuedINTEL => struct { id_ref: []const Id = &.{} },
2859 .OpConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2860 .OpSpecConstantCompositeContinuedINTEL => struct { constituents: []const Id = &.{} },
2861 .OpCompositeConstructContinuedINTEL => struct { id_result_type: Id, id_result: Id, constituents: []const Id = &.{} },
2862 .OpConvertFToBF16INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2863 .OpConvertBF16ToFINTEL => struct { id_result_type: Id, id_result: Id, b_float16_value: Id },
2864 .OpControlBarrierArriveINTEL => struct { execution: Id, memory: Id, semantics: Id },
2865 .OpControlBarrierWaitINTEL => struct { execution: Id, memory: Id, semantics: Id },
2866 .OpArithmeticFenceEXT => struct { id_result_type: Id, id_result: Id, target: Id },
2867 .OpTaskSequenceCreateINTEL => struct { id_result_type: Id, id_result: Id, function: Id, pipelined: LiteralInteger, use_stall_enable_clusters: LiteralInteger, get_capacity: LiteralInteger, async_capacity: LiteralInteger },
2868 .OpTaskSequenceAsyncINTEL => struct { sequence: Id, arguments: []const Id = &.{} },
2869 .OpTaskSequenceGetINTEL => struct { id_result_type: Id, id_result: Id, sequence: Id },
2870 .OpTaskSequenceReleaseINTEL => struct { sequence: Id },
2871 .OpTypeTaskSequenceINTEL => struct { id_result: Id },
2872 .OpSubgroupBlockPrefetchINTEL => struct { ptr: Id, num_bytes: Id, memory_access: ?MemoryAccess.Extended = null },
2873 .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 },
2874 .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 },
2875 .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 },
2876 .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 },
2877 .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 },
2878 .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 },
2879 .OpBitwiseFunctionINTEL => struct { id_result_type: Id, id_result: Id, a: Id, b: Id, c: Id, lut_index: Id },
2880 .OpGroupIMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2881 .OpGroupFMulKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2882 .OpGroupBitwiseAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2883 .OpGroupBitwiseOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2884 .OpGroupBitwiseXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2885 .OpGroupLogicalAndKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2886 .OpGroupLogicalOrKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2887 .OpGroupLogicalXorKHR => struct { id_result_type: Id, id_result: Id, execution: Id, operation: GroupOperation, x: Id },
2888 .OpRoundFToTF32INTEL => struct { id_result_type: Id, id_result: Id, float_value: Id },
2889 .OpMaskedGatherINTEL => struct { id_result_type: Id, id_result: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id, fill_empty: Id },
2890 .OpMaskedScatterINTEL => struct { input_vector: Id, ptr_vector: Id, alignment: LiteralInteger, mask: Id },
2891 .OpConvertHandleToImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2892 .OpConvertHandleToSamplerINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2893 .OpConvertHandleToSampledImageINTEL => struct { id_result_type: Id, id_result: Id, operand: Id },
2894 };
2895 }
2896 pub fn class(self: Opcode) Class {
2897 return switch (self) {
2898 .OpNop => .miscellaneous,
2899 .OpUndef => .miscellaneous,
2900 .OpSourceContinued => .debug,
2901 .OpSource => .debug,
2902 .OpSourceExtension => .debug,
2903 .OpName => .debug,
2904 .OpMemberName => .debug,
2905 .OpString => .debug,
2906 .OpLine => .debug,
2907 .OpExtension => .extension,
2908 .OpExtInstImport => .extension,
2909 .OpExtInst => .extension,
2910 .OpMemoryModel => .mode_setting,
2911 .OpEntryPoint => .mode_setting,
2912 .OpExecutionMode => .mode_setting,
2913 .OpCapability => .mode_setting,
2914 .OpTypeVoid => .type_declaration,
2915 .OpTypeBool => .type_declaration,
2916 .OpTypeInt => .type_declaration,
2917 .OpTypeFloat => .type_declaration,
2918 .OpTypeVector => .type_declaration,
2919 .OpTypeMatrix => .type_declaration,
2920 .OpTypeImage => .type_declaration,
2921 .OpTypeSampler => .type_declaration,
2922 .OpTypeSampledImage => .type_declaration,
2923 .OpTypeArray => .type_declaration,
2924 .OpTypeRuntimeArray => .type_declaration,
2925 .OpTypeStruct => .type_declaration,
2926 .OpTypeOpaque => .type_declaration,
2927 .OpTypePointer => .type_declaration,
2928 .OpTypeFunction => .type_declaration,
2929 .OpTypeEvent => .type_declaration,
2930 .OpTypeDeviceEvent => .type_declaration,
2931 .OpTypeReserveId => .type_declaration,
2932 .OpTypeQueue => .type_declaration,
2933 .OpTypePipe => .type_declaration,
2934 .OpTypeForwardPointer => .type_declaration,
2935 .OpConstantTrue => .constant_creation,
2936 .OpConstantFalse => .constant_creation,
2937 .OpConstant => .constant_creation,
2938 .OpConstantComposite => .constant_creation,
2939 .OpConstantSampler => .constant_creation,
2940 .OpConstantNull => .constant_creation,
2941 .OpSpecConstantTrue => .constant_creation,
2942 .OpSpecConstantFalse => .constant_creation,
2943 .OpSpecConstant => .constant_creation,
2944 .OpSpecConstantComposite => .constant_creation,
2945 .OpSpecConstantOp => .constant_creation,
2946 .OpFunction => .function,
2947 .OpFunctionParameter => .function,
2948 .OpFunctionEnd => .function,
2949 .OpFunctionCall => .function,
2950 .OpVariable => .memory,
2951 .OpImageTexelPointer => .memory,
2952 .OpLoad => .memory,
2953 .OpStore => .memory,
2954 .OpCopyMemory => .memory,
2955 .OpCopyMemorySized => .memory,
2956 .OpAccessChain => .memory,
2957 .OpInBoundsAccessChain => .memory,
2958 .OpPtrAccessChain => .memory,
2959 .OpArrayLength => .memory,
2960 .OpGenericPtrMemSemantics => .memory,
2961 .OpInBoundsPtrAccessChain => .memory,
2962 .OpDecorate => .annotation,
2963 .OpMemberDecorate => .annotation,
2964 .OpDecorationGroup => .annotation,
2965 .OpGroupDecorate => .annotation,
2966 .OpGroupMemberDecorate => .annotation,
2967 .OpVectorExtractDynamic => .composite,
2968 .OpVectorInsertDynamic => .composite,
2969 .OpVectorShuffle => .composite,
2970 .OpCompositeConstruct => .composite,
2971 .OpCompositeExtract => .composite,
2972 .OpCompositeInsert => .composite,
2973 .OpCopyObject => .composite,
2974 .OpTranspose => .composite,
2975 .OpSampledImage => .image,
2976 .OpImageSampleImplicitLod => .image,
2977 .OpImageSampleExplicitLod => .image,
2978 .OpImageSampleDrefImplicitLod => .image,
2979 .OpImageSampleDrefExplicitLod => .image,
2980 .OpImageSampleProjImplicitLod => .image,
2981 .OpImageSampleProjExplicitLod => .image,
2982 .OpImageSampleProjDrefImplicitLod => .image,
2983 .OpImageSampleProjDrefExplicitLod => .image,
2984 .OpImageFetch => .image,
2985 .OpImageGather => .image,
2986 .OpImageDrefGather => .image,
2987 .OpImageRead => .image,
2988 .OpImageWrite => .image,
2989 .OpImage => .image,
2990 .OpImageQueryFormat => .image,
2991 .OpImageQueryOrder => .image,
2992 .OpImageQuerySizeLod => .image,
2993 .OpImageQuerySize => .image,
2994 .OpImageQueryLod => .image,
2995 .OpImageQueryLevels => .image,
2996 .OpImageQuerySamples => .image,
2997 .OpConvertFToU => .conversion,
2998 .OpConvertFToS => .conversion,
2999 .OpConvertSToF => .conversion,
3000 .OpConvertUToF => .conversion,
3001 .OpUConvert => .conversion,
3002 .OpSConvert => .conversion,
3003 .OpFConvert => .conversion,
3004 .OpQuantizeToF16 => .conversion,
3005 .OpConvertPtrToU => .conversion,
3006 .OpSatConvertSToU => .conversion,
3007 .OpSatConvertUToS => .conversion,
3008 .OpConvertUToPtr => .conversion,
3009 .OpPtrCastToGeneric => .conversion,
3010 .OpGenericCastToPtr => .conversion,
3011 .OpGenericCastToPtrExplicit => .conversion,
3012 .OpBitcast => .conversion,
3013 .OpSNegate => .arithmetic,
3014 .OpFNegate => .arithmetic,
3015 .OpIAdd => .arithmetic,
3016 .OpFAdd => .arithmetic,
3017 .OpISub => .arithmetic,
3018 .OpFSub => .arithmetic,
3019 .OpIMul => .arithmetic,
3020 .OpFMul => .arithmetic,
3021 .OpUDiv => .arithmetic,
3022 .OpSDiv => .arithmetic,
3023 .OpFDiv => .arithmetic,
3024 .OpUMod => .arithmetic,
3025 .OpSRem => .arithmetic,
3026 .OpSMod => .arithmetic,
3027 .OpFRem => .arithmetic,
3028 .OpFMod => .arithmetic,
3029 .OpVectorTimesScalar => .arithmetic,
3030 .OpMatrixTimesScalar => .arithmetic,
3031 .OpVectorTimesMatrix => .arithmetic,
3032 .OpMatrixTimesVector => .arithmetic,
3033 .OpMatrixTimesMatrix => .arithmetic,
3034 .OpOuterProduct => .arithmetic,
3035 .OpDot => .arithmetic,
3036 .OpIAddCarry => .arithmetic,
3037 .OpISubBorrow => .arithmetic,
3038 .OpUMulExtended => .arithmetic,
3039 .OpSMulExtended => .arithmetic,
3040 .OpAny => .relational_and_logical,
3041 .OpAll => .relational_and_logical,
3042 .OpIsNan => .relational_and_logical,
3043 .OpIsInf => .relational_and_logical,
3044 .OpIsFinite => .relational_and_logical,
3045 .OpIsNormal => .relational_and_logical,
3046 .OpSignBitSet => .relational_and_logical,
3047 .OpLessOrGreater => .relational_and_logical,
3048 .OpOrdered => .relational_and_logical,
3049 .OpUnordered => .relational_and_logical,
3050 .OpLogicalEqual => .relational_and_logical,
3051 .OpLogicalNotEqual => .relational_and_logical,
3052 .OpLogicalOr => .relational_and_logical,
3053 .OpLogicalAnd => .relational_and_logical,
3054 .OpLogicalNot => .relational_and_logical,
3055 .OpSelect => .relational_and_logical,
3056 .OpIEqual => .relational_and_logical,
3057 .OpINotEqual => .relational_and_logical,
3058 .OpUGreaterThan => .relational_and_logical,
3059 .OpSGreaterThan => .relational_and_logical,
3060 .OpUGreaterThanEqual => .relational_and_logical,
3061 .OpSGreaterThanEqual => .relational_and_logical,
3062 .OpULessThan => .relational_and_logical,
3063 .OpSLessThan => .relational_and_logical,
3064 .OpULessThanEqual => .relational_and_logical,
3065 .OpSLessThanEqual => .relational_and_logical,
3066 .OpFOrdEqual => .relational_and_logical,
3067 .OpFUnordEqual => .relational_and_logical,
3068 .OpFOrdNotEqual => .relational_and_logical,
3069 .OpFUnordNotEqual => .relational_and_logical,
3070 .OpFOrdLessThan => .relational_and_logical,
3071 .OpFUnordLessThan => .relational_and_logical,
3072 .OpFOrdGreaterThan => .relational_and_logical,
3073 .OpFUnordGreaterThan => .relational_and_logical,
3074 .OpFOrdLessThanEqual => .relational_and_logical,
3075 .OpFUnordLessThanEqual => .relational_and_logical,
3076 .OpFOrdGreaterThanEqual => .relational_and_logical,
3077 .OpFUnordGreaterThanEqual => .relational_and_logical,
3078 .OpShiftRightLogical => .bit,
3079 .OpShiftRightArithmetic => .bit,
3080 .OpShiftLeftLogical => .bit,
3081 .OpBitwiseOr => .bit,
3082 .OpBitwiseXor => .bit,
3083 .OpBitwiseAnd => .bit,
3084 .OpNot => .bit,
3085 .OpBitFieldInsert => .bit,
3086 .OpBitFieldSExtract => .bit,
3087 .OpBitFieldUExtract => .bit,
3088 .OpBitReverse => .bit,
3089 .OpBitCount => .bit,
3090 .OpDPdx => .derivative,
3091 .OpDPdy => .derivative,
3092 .OpFwidth => .derivative,
3093 .OpDPdxFine => .derivative,
3094 .OpDPdyFine => .derivative,
3095 .OpFwidthFine => .derivative,
3096 .OpDPdxCoarse => .derivative,
3097 .OpDPdyCoarse => .derivative,
3098 .OpFwidthCoarse => .derivative,
3099 .OpEmitVertex => .primitive,
3100 .OpEndPrimitive => .primitive,
3101 .OpEmitStreamVertex => .primitive,
3102 .OpEndStreamPrimitive => .primitive,
3103 .OpControlBarrier => .barrier,
3104 .OpMemoryBarrier => .barrier,
3105 .OpAtomicLoad => .atomic,
3106 .OpAtomicStore => .atomic,
3107 .OpAtomicExchange => .atomic,
3108 .OpAtomicCompareExchange => .atomic,
3109 .OpAtomicCompareExchangeWeak => .atomic,
3110 .OpAtomicIIncrement => .atomic,
3111 .OpAtomicIDecrement => .atomic,
3112 .OpAtomicIAdd => .atomic,
3113 .OpAtomicISub => .atomic,
3114 .OpAtomicSMin => .atomic,
3115 .OpAtomicUMin => .atomic,
3116 .OpAtomicSMax => .atomic,
3117 .OpAtomicUMax => .atomic,
3118 .OpAtomicAnd => .atomic,
3119 .OpAtomicOr => .atomic,
3120 .OpAtomicXor => .atomic,
3121 .OpPhi => .control_flow,
3122 .OpLoopMerge => .control_flow,
3123 .OpSelectionMerge => .control_flow,
3124 .OpLabel => .control_flow,
3125 .OpBranch => .control_flow,
3126 .OpBranchConditional => .control_flow,
3127 .OpSwitch => .control_flow,
3128 .OpKill => .control_flow,
3129 .OpReturn => .control_flow,
3130 .OpReturnValue => .control_flow,
3131 .OpUnreachable => .control_flow,
3132 .OpLifetimeStart => .control_flow,
3133 .OpLifetimeStop => .control_flow,
3134 .OpGroupAsyncCopy => .group,
3135 .OpGroupWaitEvents => .group,
3136 .OpGroupAll => .group,
3137 .OpGroupAny => .group,
3138 .OpGroupBroadcast => .group,
3139 .OpGroupIAdd => .group,
3140 .OpGroupFAdd => .group,
3141 .OpGroupFMin => .group,
3142 .OpGroupUMin => .group,
3143 .OpGroupSMin => .group,
3144 .OpGroupFMax => .group,
3145 .OpGroupUMax => .group,
3146 .OpGroupSMax => .group,
3147 .OpReadPipe => .pipe,
3148 .OpWritePipe => .pipe,
3149 .OpReservedReadPipe => .pipe,
3150 .OpReservedWritePipe => .pipe,
3151 .OpReserveReadPipePackets => .pipe,
3152 .OpReserveWritePipePackets => .pipe,
3153 .OpCommitReadPipe => .pipe,
3154 .OpCommitWritePipe => .pipe,
3155 .OpIsValidReserveId => .pipe,
3156 .OpGetNumPipePackets => .pipe,
3157 .OpGetMaxPipePackets => .pipe,
3158 .OpGroupReserveReadPipePackets => .pipe,
3159 .OpGroupReserveWritePipePackets => .pipe,
3160 .OpGroupCommitReadPipe => .pipe,
3161 .OpGroupCommitWritePipe => .pipe,
3162 .OpEnqueueMarker => .device_side_enqueue,
3163 .OpEnqueueKernel => .device_side_enqueue,
3164 .OpGetKernelNDrangeSubGroupCount => .device_side_enqueue,
3165 .OpGetKernelNDrangeMaxSubGroupSize => .device_side_enqueue,
3166 .OpGetKernelWorkGroupSize => .device_side_enqueue,
3167 .OpGetKernelPreferredWorkGroupSizeMultiple => .device_side_enqueue,
3168 .OpRetainEvent => .device_side_enqueue,
3169 .OpReleaseEvent => .device_side_enqueue,
3170 .OpCreateUserEvent => .device_side_enqueue,
3171 .OpIsValidEvent => .device_side_enqueue,
3172 .OpSetUserEventStatus => .device_side_enqueue,
3173 .OpCaptureEventProfilingInfo => .device_side_enqueue,
3174 .OpGetDefaultQueue => .device_side_enqueue,
3175 .OpBuildNDRange => .device_side_enqueue,
3176 .OpImageSparseSampleImplicitLod => .image,
3177 .OpImageSparseSampleExplicitLod => .image,
3178 .OpImageSparseSampleDrefImplicitLod => .image,
3179 .OpImageSparseSampleDrefExplicitLod => .image,
3180 .OpImageSparseSampleProjImplicitLod => .image,
3181 .OpImageSparseSampleProjExplicitLod => .image,
3182 .OpImageSparseSampleProjDrefImplicitLod => .image,
3183 .OpImageSparseSampleProjDrefExplicitLod => .image,
3184 .OpImageSparseFetch => .image,
3185 .OpImageSparseGather => .image,
3186 .OpImageSparseDrefGather => .image,
3187 .OpImageSparseTexelsResident => .image,
3188 .OpNoLine => .debug,
3189 .OpAtomicFlagTestAndSet => .atomic,
3190 .OpAtomicFlagClear => .atomic,
3191 .OpImageSparseRead => .image,
3192 .OpSizeOf => .miscellaneous,
3193 .OpTypePipeStorage => .type_declaration,
3194 .OpConstantPipeStorage => .pipe,
3195 .OpCreatePipeFromPipeStorage => .pipe,
3196 .OpGetKernelLocalSizeForSubgroupCount => .device_side_enqueue,
3197 .OpGetKernelMaxNumSubgroups => .device_side_enqueue,
3198 .OpTypeNamedBarrier => .type_declaration,
3199 .OpNamedBarrierInitialize => .barrier,
3200 .OpMemoryNamedBarrier => .barrier,
3201 .OpModuleProcessed => .debug,
3202 .OpExecutionModeId => .mode_setting,
3203 .OpDecorateId => .annotation,
3204 .OpGroupNonUniformElect => .non_uniform,
3205 .OpGroupNonUniformAll => .non_uniform,
3206 .OpGroupNonUniformAny => .non_uniform,
3207 .OpGroupNonUniformAllEqual => .non_uniform,
3208 .OpGroupNonUniformBroadcast => .non_uniform,
3209 .OpGroupNonUniformBroadcastFirst => .non_uniform,
3210 .OpGroupNonUniformBallot => .non_uniform,
3211 .OpGroupNonUniformInverseBallot => .non_uniform,
3212 .OpGroupNonUniformBallotBitExtract => .non_uniform,
3213 .OpGroupNonUniformBallotBitCount => .non_uniform,
3214 .OpGroupNonUniformBallotFindLSB => .non_uniform,
3215 .OpGroupNonUniformBallotFindMSB => .non_uniform,
3216 .OpGroupNonUniformShuffle => .non_uniform,
3217 .OpGroupNonUniformShuffleXor => .non_uniform,
3218 .OpGroupNonUniformShuffleUp => .non_uniform,
3219 .OpGroupNonUniformShuffleDown => .non_uniform,
3220 .OpGroupNonUniformIAdd => .non_uniform,
3221 .OpGroupNonUniformFAdd => .non_uniform,
3222 .OpGroupNonUniformIMul => .non_uniform,
3223 .OpGroupNonUniformFMul => .non_uniform,
3224 .OpGroupNonUniformSMin => .non_uniform,
3225 .OpGroupNonUniformUMin => .non_uniform,
3226 .OpGroupNonUniformFMin => .non_uniform,
3227 .OpGroupNonUniformSMax => .non_uniform,
3228 .OpGroupNonUniformUMax => .non_uniform,
3229 .OpGroupNonUniformFMax => .non_uniform,
3230 .OpGroupNonUniformBitwiseAnd => .non_uniform,
3231 .OpGroupNonUniformBitwiseOr => .non_uniform,
3232 .OpGroupNonUniformBitwiseXor => .non_uniform,
3233 .OpGroupNonUniformLogicalAnd => .non_uniform,
3234 .OpGroupNonUniformLogicalOr => .non_uniform,
3235 .OpGroupNonUniformLogicalXor => .non_uniform,
3236 .OpGroupNonUniformQuadBroadcast => .non_uniform,
3237 .OpGroupNonUniformQuadSwap => .non_uniform,
3238 .OpCopyLogical => .composite,
3239 .OpPtrEqual => .memory,
3240 .OpPtrNotEqual => .memory,
3241 .OpPtrDiff => .memory,
3242 .OpColorAttachmentReadEXT => .image,
3243 .OpDepthAttachmentReadEXT => .image,
3244 .OpStencilAttachmentReadEXT => .image,
3245 .OpTypeTensorARM => .type_declaration,
3246 .OpTensorReadARM => .tensor,
3247 .OpTensorWriteARM => .tensor,
3248 .OpTensorQuerySizeARM => .tensor,
3249 .OpGraphConstantARM => .graph,
3250 .OpGraphEntryPointARM => .graph,
3251 .OpGraphARM => .graph,
3252 .OpGraphInputARM => .graph,
3253 .OpGraphSetOutputARM => .graph,
3254 .OpGraphEndARM => .graph,
3255 .OpTypeGraphARM => .type_declaration,
3256 .OpTerminateInvocation => .control_flow,
3257 .OpTypeUntypedPointerKHR => .type_declaration,
3258 .OpUntypedVariableKHR => .memory,
3259 .OpUntypedAccessChainKHR => .memory,
3260 .OpUntypedInBoundsAccessChainKHR => .memory,
3261 .OpSubgroupBallotKHR => .group,
3262 .OpSubgroupFirstInvocationKHR => .group,
3263 .OpUntypedPtrAccessChainKHR => .memory,
3264 .OpUntypedInBoundsPtrAccessChainKHR => .memory,
3265 .OpUntypedArrayLengthKHR => .memory,
3266 .OpUntypedPrefetchKHR => .memory,
3267 .OpSubgroupAllKHR => .group,
3268 .OpSubgroupAnyKHR => .group,
3269 .OpSubgroupAllEqualKHR => .group,
3270 .OpGroupNonUniformRotateKHR => .group,
3271 .OpSubgroupReadInvocationKHR => .group,
3272 .OpExtInstWithForwardRefsKHR => .extension,
3273 .OpTraceRayKHR => .reserved,
3274 .OpExecuteCallableKHR => .reserved,
3275 .OpConvertUToAccelerationStructureKHR => .reserved,
3276 .OpIgnoreIntersectionKHR => .reserved,
3277 .OpTerminateRayKHR => .reserved,
3278 .OpSDot => .arithmetic,
3279 .OpUDot => .arithmetic,
3280 .OpSUDot => .arithmetic,
3281 .OpSDotAccSat => .arithmetic,
3282 .OpUDotAccSat => .arithmetic,
3283 .OpSUDotAccSat => .arithmetic,
3284 .OpTypeCooperativeMatrixKHR => .type_declaration,
3285 .OpCooperativeMatrixLoadKHR => .memory,
3286 .OpCooperativeMatrixStoreKHR => .memory,
3287 .OpCooperativeMatrixMulAddKHR => .arithmetic,
3288 .OpCooperativeMatrixLengthKHR => .miscellaneous,
3289 .OpConstantCompositeReplicateEXT => .constant_creation,
3290 .OpSpecConstantCompositeReplicateEXT => .constant_creation,
3291 .OpCompositeConstructReplicateEXT => .composite,
3292 .OpTypeRayQueryKHR => .type_declaration,
3293 .OpRayQueryInitializeKHR => .reserved,
3294 .OpRayQueryTerminateKHR => .reserved,
3295 .OpRayQueryGenerateIntersectionKHR => .reserved,
3296 .OpRayQueryConfirmIntersectionKHR => .reserved,
3297 .OpRayQueryProceedKHR => .reserved,
3298 .OpRayQueryGetIntersectionTypeKHR => .reserved,
3299 .OpImageSampleWeightedQCOM => .image,
3300 .OpImageBoxFilterQCOM => .image,
3301 .OpImageBlockMatchSSDQCOM => .image,
3302 .OpImageBlockMatchSADQCOM => .image,
3303 .OpImageBlockMatchWindowSSDQCOM => .image,
3304 .OpImageBlockMatchWindowSADQCOM => .image,
3305 .OpImageBlockMatchGatherSSDQCOM => .image,
3306 .OpImageBlockMatchGatherSADQCOM => .image,
3307 .OpGroupIAddNonUniformAMD => .group,
3308 .OpGroupFAddNonUniformAMD => .group,
3309 .OpGroupFMinNonUniformAMD => .group,
3310 .OpGroupUMinNonUniformAMD => .group,
3311 .OpGroupSMinNonUniformAMD => .group,
3312 .OpGroupFMaxNonUniformAMD => .group,
3313 .OpGroupUMaxNonUniformAMD => .group,
3314 .OpGroupSMaxNonUniformAMD => .group,
3315 .OpFragmentMaskFetchAMD => .reserved,
3316 .OpFragmentFetchAMD => .reserved,
3317 .OpReadClockKHR => .reserved,
3318 .OpAllocateNodePayloadsAMDX => .reserved,
3319 .OpEnqueueNodePayloadsAMDX => .reserved,
3320 .OpTypeNodePayloadArrayAMDX => .reserved,
3321 .OpFinishWritingNodePayloadAMDX => .reserved,
3322 .OpNodePayloadArrayLengthAMDX => .reserved,
3323 .OpIsNodePayloadValidAMDX => .reserved,
3324 .OpConstantStringAMDX => .reserved,
3325 .OpSpecConstantStringAMDX => .reserved,
3326 .OpGroupNonUniformQuadAllKHR => .non_uniform,
3327 .OpGroupNonUniformQuadAnyKHR => .non_uniform,
3328 .OpHitObjectRecordHitMotionNV => .reserved,
3329 .OpHitObjectRecordHitWithIndexMotionNV => .reserved,
3330 .OpHitObjectRecordMissMotionNV => .reserved,
3331 .OpHitObjectGetWorldToObjectNV => .reserved,
3332 .OpHitObjectGetObjectToWorldNV => .reserved,
3333 .OpHitObjectGetObjectRayDirectionNV => .reserved,
3334 .OpHitObjectGetObjectRayOriginNV => .reserved,
3335 .OpHitObjectTraceRayMotionNV => .reserved,
3336 .OpHitObjectGetShaderRecordBufferHandleNV => .reserved,
3337 .OpHitObjectGetShaderBindingTableRecordIndexNV => .reserved,
3338 .OpHitObjectRecordEmptyNV => .reserved,
3339 .OpHitObjectTraceRayNV => .reserved,
3340 .OpHitObjectRecordHitNV => .reserved,
3341 .OpHitObjectRecordHitWithIndexNV => .reserved,
3342 .OpHitObjectRecordMissNV => .reserved,
3343 .OpHitObjectExecuteShaderNV => .reserved,
3344 .OpHitObjectGetCurrentTimeNV => .reserved,
3345 .OpHitObjectGetAttributesNV => .reserved,
3346 .OpHitObjectGetHitKindNV => .reserved,
3347 .OpHitObjectGetPrimitiveIndexNV => .reserved,
3348 .OpHitObjectGetGeometryIndexNV => .reserved,
3349 .OpHitObjectGetInstanceIdNV => .reserved,
3350 .OpHitObjectGetInstanceCustomIndexNV => .reserved,
3351 .OpHitObjectGetWorldRayDirectionNV => .reserved,
3352 .OpHitObjectGetWorldRayOriginNV => .reserved,
3353 .OpHitObjectGetRayTMaxNV => .reserved,
3354 .OpHitObjectGetRayTMinNV => .reserved,
3355 .OpHitObjectIsEmptyNV => .reserved,
3356 .OpHitObjectIsHitNV => .reserved,
3357 .OpHitObjectIsMissNV => .reserved,
3358 .OpReorderThreadWithHitObjectNV => .reserved,
3359 .OpReorderThreadWithHintNV => .reserved,
3360 .OpTypeHitObjectNV => .type_declaration,
3361 .OpImageSampleFootprintNV => .image,
3362 .OpTypeCooperativeVectorNV => .type_declaration,
3363 .OpCooperativeVectorMatrixMulNV => .reserved,
3364 .OpCooperativeVectorOuterProductAccumulateNV => .reserved,
3365 .OpCooperativeVectorReduceSumAccumulateNV => .reserved,
3366 .OpCooperativeVectorMatrixMulAddNV => .reserved,
3367 .OpCooperativeMatrixConvertNV => .conversion,
3368 .OpEmitMeshTasksEXT => .reserved,
3369 .OpSetMeshOutputsEXT => .reserved,
3370 .OpGroupNonUniformPartitionNV => .non_uniform,
3371 .OpWritePackedPrimitiveIndices4x8NV => .reserved,
3372 .OpFetchMicroTriangleVertexPositionNV => .reserved,
3373 .OpFetchMicroTriangleVertexBarycentricNV => .reserved,
3374 .OpCooperativeVectorLoadNV => .memory,
3375 .OpCooperativeVectorStoreNV => .memory,
3376 .OpReportIntersectionKHR => .reserved,
3377 .OpIgnoreIntersectionNV => .reserved,
3378 .OpTerminateRayNV => .reserved,
3379 .OpTraceNV => .reserved,
3380 .OpTraceMotionNV => .reserved,
3381 .OpTraceRayMotionNV => .reserved,
3382 .OpRayQueryGetIntersectionTriangleVertexPositionsKHR => .reserved,
3383 .OpTypeAccelerationStructureKHR => .type_declaration,
3384 .OpExecuteCallableNV => .reserved,
3385 .OpRayQueryGetClusterIdNV => .reserved,
3386 .OpHitObjectGetClusterIdNV => .reserved,
3387 .OpTypeCooperativeMatrixNV => .type_declaration,
3388 .OpCooperativeMatrixLoadNV => .reserved,
3389 .OpCooperativeMatrixStoreNV => .reserved,
3390 .OpCooperativeMatrixMulAddNV => .reserved,
3391 .OpCooperativeMatrixLengthNV => .reserved,
3392 .OpBeginInvocationInterlockEXT => .reserved,
3393 .OpEndInvocationInterlockEXT => .reserved,
3394 .OpCooperativeMatrixReduceNV => .arithmetic,
3395 .OpCooperativeMatrixLoadTensorNV => .memory,
3396 .OpCooperativeMatrixStoreTensorNV => .memory,
3397 .OpCooperativeMatrixPerElementOpNV => .function,
3398 .OpTypeTensorLayoutNV => .type_declaration,
3399 .OpTypeTensorViewNV => .type_declaration,
3400 .OpCreateTensorLayoutNV => .reserved,
3401 .OpTensorLayoutSetDimensionNV => .reserved,
3402 .OpTensorLayoutSetStrideNV => .reserved,
3403 .OpTensorLayoutSliceNV => .reserved,
3404 .OpTensorLayoutSetClampValueNV => .reserved,
3405 .OpCreateTensorViewNV => .reserved,
3406 .OpTensorViewSetDimensionNV => .reserved,
3407 .OpTensorViewSetStrideNV => .reserved,
3408 .OpDemoteToHelperInvocation => .control_flow,
3409 .OpIsHelperInvocationEXT => .reserved,
3410 .OpTensorViewSetClipNV => .reserved,
3411 .OpTensorLayoutSetBlockSizeNV => .reserved,
3412 .OpCooperativeMatrixTransposeNV => .conversion,
3413 .OpConvertUToImageNV => .reserved,
3414 .OpConvertUToSamplerNV => .reserved,
3415 .OpConvertImageToUNV => .reserved,
3416 .OpConvertSamplerToUNV => .reserved,
3417 .OpConvertUToSampledImageNV => .reserved,
3418 .OpConvertSampledImageToUNV => .reserved,
3419 .OpSamplerImageAddressingModeNV => .reserved,
3420 .OpRawAccessChainNV => .memory,
3421 .OpRayQueryGetIntersectionSpherePositionNV => .reserved,
3422 .OpRayQueryGetIntersectionSphereRadiusNV => .reserved,
3423 .OpRayQueryGetIntersectionLSSPositionsNV => .reserved,
3424 .OpRayQueryGetIntersectionLSSRadiiNV => .reserved,
3425 .OpRayQueryGetIntersectionLSSHitValueNV => .reserved,
3426 .OpHitObjectGetSpherePositionNV => .reserved,
3427 .OpHitObjectGetSphereRadiusNV => .reserved,
3428 .OpHitObjectGetLSSPositionsNV => .reserved,
3429 .OpHitObjectGetLSSRadiiNV => .reserved,
3430 .OpHitObjectIsSphereHitNV => .reserved,
3431 .OpHitObjectIsLSSHitNV => .reserved,
3432 .OpRayQueryIsSphereHitNV => .reserved,
3433 .OpRayQueryIsLSSHitNV => .reserved,
3434 .OpSubgroupShuffleINTEL => .group,
3435 .OpSubgroupShuffleDownINTEL => .group,
3436 .OpSubgroupShuffleUpINTEL => .group,
3437 .OpSubgroupShuffleXorINTEL => .group,
3438 .OpSubgroupBlockReadINTEL => .group,
3439 .OpSubgroupBlockWriteINTEL => .group,
3440 .OpSubgroupImageBlockReadINTEL => .group,
3441 .OpSubgroupImageBlockWriteINTEL => .group,
3442 .OpSubgroupImageMediaBlockReadINTEL => .group,
3443 .OpSubgroupImageMediaBlockWriteINTEL => .group,
3444 .OpUCountLeadingZerosINTEL => .reserved,
3445 .OpUCountTrailingZerosINTEL => .reserved,
3446 .OpAbsISubINTEL => .reserved,
3447 .OpAbsUSubINTEL => .reserved,
3448 .OpIAddSatINTEL => .reserved,
3449 .OpUAddSatINTEL => .reserved,
3450 .OpIAverageINTEL => .reserved,
3451 .OpUAverageINTEL => .reserved,
3452 .OpIAverageRoundedINTEL => .reserved,
3453 .OpUAverageRoundedINTEL => .reserved,
3454 .OpISubSatINTEL => .reserved,
3455 .OpUSubSatINTEL => .reserved,
3456 .OpIMul32x16INTEL => .reserved,
3457 .OpUMul32x16INTEL => .reserved,
3458 .OpAtomicFMinEXT => .atomic,
3459 .OpAtomicFMaxEXT => .atomic,
3460 .OpAssumeTrueKHR => .miscellaneous,
3461 .OpExpectKHR => .miscellaneous,
3462 .OpDecorateString => .annotation,
3463 .OpMemberDecorateString => .annotation,
3464 .OpLoopControlINTEL => .reserved,
3465 .OpReadPipeBlockingINTEL => .pipe,
3466 .OpWritePipeBlockingINTEL => .pipe,
3467 .OpFPGARegINTEL => .reserved,
3468 .OpRayQueryGetRayTMinKHR => .reserved,
3469 .OpRayQueryGetRayFlagsKHR => .reserved,
3470 .OpRayQueryGetIntersectionTKHR => .reserved,
3471 .OpRayQueryGetIntersectionInstanceCustomIndexKHR => .reserved,
3472 .OpRayQueryGetIntersectionInstanceIdKHR => .reserved,
3473 .OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR => .reserved,
3474 .OpRayQueryGetIntersectionGeometryIndexKHR => .reserved,
3475 .OpRayQueryGetIntersectionPrimitiveIndexKHR => .reserved,
3476 .OpRayQueryGetIntersectionBarycentricsKHR => .reserved,
3477 .OpRayQueryGetIntersectionFrontFaceKHR => .reserved,
3478 .OpRayQueryGetIntersectionCandidateAABBOpaqueKHR => .reserved,
3479 .OpRayQueryGetIntersectionObjectRayDirectionKHR => .reserved,
3480 .OpRayQueryGetIntersectionObjectRayOriginKHR => .reserved,
3481 .OpRayQueryGetWorldRayDirectionKHR => .reserved,
3482 .OpRayQueryGetWorldRayOriginKHR => .reserved,
3483 .OpRayQueryGetIntersectionObjectToWorldKHR => .reserved,
3484 .OpRayQueryGetIntersectionWorldToObjectKHR => .reserved,
3485 .OpAtomicFAddEXT => .atomic,
3486 .OpTypeBufferSurfaceINTEL => .type_declaration,
3487 .OpTypeStructContinuedINTEL => .type_declaration,
3488 .OpConstantCompositeContinuedINTEL => .constant_creation,
3489 .OpSpecConstantCompositeContinuedINTEL => .constant_creation,
3490 .OpCompositeConstructContinuedINTEL => .composite,
3491 .OpConvertFToBF16INTEL => .conversion,
3492 .OpConvertBF16ToFINTEL => .conversion,
3493 .OpControlBarrierArriveINTEL => .barrier,
3494 .OpControlBarrierWaitINTEL => .barrier,
3495 .OpArithmeticFenceEXT => .miscellaneous,
3496 .OpTaskSequenceCreateINTEL => .reserved,
3497 .OpTaskSequenceAsyncINTEL => .reserved,
3498 .OpTaskSequenceGetINTEL => .reserved,
3499 .OpTaskSequenceReleaseINTEL => .reserved,
3500 .OpTypeTaskSequenceINTEL => .type_declaration,
3501 .OpSubgroupBlockPrefetchINTEL => .group,
3502 .OpSubgroup2DBlockLoadINTEL => .group,
3503 .OpSubgroup2DBlockLoadTransformINTEL => .group,
3504 .OpSubgroup2DBlockLoadTransposeINTEL => .group,
3505 .OpSubgroup2DBlockPrefetchINTEL => .group,
3506 .OpSubgroup2DBlockStoreINTEL => .group,
3507 .OpSubgroupMatrixMultiplyAccumulateINTEL => .group,
3508 .OpBitwiseFunctionINTEL => .bit,
3509 .OpGroupIMulKHR => .group,
3510 .OpGroupFMulKHR => .group,
3511 .OpGroupBitwiseAndKHR => .group,
3512 .OpGroupBitwiseOrKHR => .group,
3513 .OpGroupBitwiseXorKHR => .group,
3514 .OpGroupLogicalAndKHR => .group,
3515 .OpGroupLogicalOrKHR => .group,
3516 .OpGroupLogicalXorKHR => .group,
3517 .OpRoundFToTF32INTEL => .conversion,
3518 .OpMaskedGatherINTEL => .memory,
3519 .OpMaskedScatterINTEL => .memory,
3520 .OpConvertHandleToImageINTEL => .image,
3521 .OpConvertHandleToSamplerINTEL => .image,
3522 .OpConvertHandleToSampledImageINTEL => .image,
3523 };
3524 }
3525};
3526pub const ImageOperands = packed struct {
3527 bias: bool = false,
3528 lod: bool = false,
3529 grad: bool = false,
3530 const_offset: bool = false,
3531 offset: bool = false,
3532 const_offsets: bool = false,
3533 sample: bool = false,
3534 min_lod: bool = false,
3535 make_texel_available: bool = false,
3536 make_texel_visible: bool = false,
3537 non_private_texel: bool = false,
3538 volatile_texel: bool = false,
3539 sign_extend: bool = false,
3540 zero_extend: bool = false,
3541 nontemporal: bool = false,
3542 _reserved_bit_15: bool = false,
3543 offsets: bool = false,
3544 _reserved_bit_17: bool = false,
3545 _reserved_bit_18: bool = false,
3546 _reserved_bit_19: bool = false,
3547 _reserved_bit_20: bool = false,
3548 _reserved_bit_21: bool = false,
3549 _reserved_bit_22: bool = false,
3550 _reserved_bit_23: bool = false,
3551 _reserved_bit_24: bool = false,
3552 _reserved_bit_25: bool = false,
3553 _reserved_bit_26: bool = false,
3554 _reserved_bit_27: bool = false,
3555 _reserved_bit_28: bool = false,
3556 _reserved_bit_29: bool = false,
3557 _reserved_bit_30: bool = false,
3558 _reserved_bit_31: bool = false,
3559
3560 pub const Extended = struct {
3561 bias: ?struct { id_ref: Id } = null,
3562 lod: ?struct { id_ref: Id } = null,
3563 grad: ?struct { id_ref_0: Id, id_ref_1: Id } = null,
3564 const_offset: ?struct { id_ref: Id } = null,
3565 offset: ?struct { id_ref: Id } = null,
3566 const_offsets: ?struct { id_ref: Id } = null,
3567 sample: ?struct { id_ref: Id } = null,
3568 min_lod: ?struct { id_ref: Id } = null,
3569 make_texel_available: ?struct { id_scope: Id } = null,
3570 make_texel_visible: ?struct { id_scope: Id } = null,
3571 non_private_texel: bool = false,
3572 volatile_texel: bool = false,
3573 sign_extend: bool = false,
3574 zero_extend: bool = false,
3575 nontemporal: bool = false,
3576 _reserved_bit_15: bool = false,
3577 offsets: ?struct { id_ref: Id } = null,
3578 _reserved_bit_17: bool = false,
3579 _reserved_bit_18: bool = false,
3580 _reserved_bit_19: bool = false,
3581 _reserved_bit_20: bool = false,
3582 _reserved_bit_21: bool = false,
3583 _reserved_bit_22: bool = false,
3584 _reserved_bit_23: bool = false,
3585 _reserved_bit_24: bool = false,
3586 _reserved_bit_25: bool = false,
3587 _reserved_bit_26: bool = false,
3588 _reserved_bit_27: bool = false,
3589 _reserved_bit_28: bool = false,
3590 _reserved_bit_29: bool = false,
3591 _reserved_bit_30: bool = false,
3592 _reserved_bit_31: bool = false,
3593 };
3594};
3595pub const FPFastMathMode = packed struct {
3596 not_na_n: bool = false,
3597 not_inf: bool = false,
3598 nsz: bool = false,
3599 allow_recip: bool = false,
3600 fast: bool = false,
3601 _reserved_bit_5: bool = false,
3602 _reserved_bit_6: bool = false,
3603 _reserved_bit_7: bool = false,
3604 _reserved_bit_8: bool = false,
3605 _reserved_bit_9: bool = false,
3606 _reserved_bit_10: bool = false,
3607 _reserved_bit_11: bool = false,
3608 _reserved_bit_12: bool = false,
3609 _reserved_bit_13: bool = false,
3610 _reserved_bit_14: bool = false,
3611 _reserved_bit_15: bool = false,
3612 allow_contract: bool = false,
3613 allow_reassoc: bool = false,
3614 allow_transform: bool = false,
3615 _reserved_bit_19: bool = false,
3616 _reserved_bit_20: bool = false,
3617 _reserved_bit_21: bool = false,
3618 _reserved_bit_22: bool = false,
3619 _reserved_bit_23: bool = false,
3620 _reserved_bit_24: bool = false,
3621 _reserved_bit_25: bool = false,
3622 _reserved_bit_26: bool = false,
3623 _reserved_bit_27: bool = false,
3624 _reserved_bit_28: bool = false,
3625 _reserved_bit_29: bool = false,
3626 _reserved_bit_30: bool = false,
3627 _reserved_bit_31: bool = false,
3628};
3629pub const SelectionControl = packed struct {
3630 flatten: bool = false,
3631 dont_flatten: bool = false,
3632 _reserved_bit_2: bool = false,
3633 _reserved_bit_3: bool = false,
3634 _reserved_bit_4: bool = false,
3635 _reserved_bit_5: bool = false,
3636 _reserved_bit_6: bool = false,
3637 _reserved_bit_7: bool = false,
3638 _reserved_bit_8: bool = false,
3639 _reserved_bit_9: bool = false,
3640 _reserved_bit_10: bool = false,
3641 _reserved_bit_11: bool = false,
3642 _reserved_bit_12: bool = false,
3643 _reserved_bit_13: bool = false,
3644 _reserved_bit_14: bool = false,
3645 _reserved_bit_15: bool = false,
3646 _reserved_bit_16: bool = false,
3647 _reserved_bit_17: bool = false,
3648 _reserved_bit_18: bool = false,
3649 _reserved_bit_19: bool = false,
3650 _reserved_bit_20: bool = false,
3651 _reserved_bit_21: bool = false,
3652 _reserved_bit_22: bool = false,
3653 _reserved_bit_23: bool = false,
3654 _reserved_bit_24: bool = false,
3655 _reserved_bit_25: bool = false,
3656 _reserved_bit_26: bool = false,
3657 _reserved_bit_27: bool = false,
3658 _reserved_bit_28: bool = false,
3659 _reserved_bit_29: bool = false,
3660 _reserved_bit_30: bool = false,
3661 _reserved_bit_31: bool = false,
3662};
3663pub const LoopControl = packed struct {
3664 unroll: bool = false,
3665 dont_unroll: bool = false,
3666 dependency_infinite: bool = false,
3667 dependency_length: bool = false,
3668 min_iterations: bool = false,
3669 max_iterations: bool = false,
3670 iteration_multiple: bool = false,
3671 peel_count: bool = false,
3672 partial_count: bool = false,
3673 _reserved_bit_9: bool = false,
3674 _reserved_bit_10: bool = false,
3675 _reserved_bit_11: bool = false,
3676 _reserved_bit_12: bool = false,
3677 _reserved_bit_13: bool = false,
3678 _reserved_bit_14: bool = false,
3679 _reserved_bit_15: bool = false,
3680 initiation_interval_intel: bool = false,
3681 max_concurrency_intel: bool = false,
3682 dependency_array_intel: bool = false,
3683 pipeline_enable_intel: bool = false,
3684 loop_coalesce_intel: bool = false,
3685 max_interleaving_intel: bool = false,
3686 speculated_iterations_intel: bool = false,
3687 no_fusion_intel: bool = false,
3688 loop_count_intel: bool = false,
3689 max_reinvocation_delay_intel: bool = false,
3690 _reserved_bit_26: bool = false,
3691 _reserved_bit_27: bool = false,
3692 _reserved_bit_28: bool = false,
3693 _reserved_bit_29: bool = false,
3694 _reserved_bit_30: bool = false,
3695 _reserved_bit_31: bool = false,
3696
3697 pub const Extended = struct {
3698 unroll: bool = false,
3699 dont_unroll: bool = false,
3700 dependency_infinite: bool = false,
3701 dependency_length: ?struct { literal_integer: LiteralInteger } = null,
3702 min_iterations: ?struct { literal_integer: LiteralInteger } = null,
3703 max_iterations: ?struct { literal_integer: LiteralInteger } = null,
3704 iteration_multiple: ?struct { literal_integer: LiteralInteger } = null,
3705 peel_count: ?struct { literal_integer: LiteralInteger } = null,
3706 partial_count: ?struct { literal_integer: LiteralInteger } = null,
3707 _reserved_bit_9: bool = false,
3708 _reserved_bit_10: bool = false,
3709 _reserved_bit_11: bool = false,
3710 _reserved_bit_12: bool = false,
3711 _reserved_bit_13: bool = false,
3712 _reserved_bit_14: bool = false,
3713 _reserved_bit_15: bool = false,
3714 initiation_interval_intel: ?struct { literal_integer: LiteralInteger } = null,
3715 max_concurrency_intel: ?struct { literal_integer: LiteralInteger } = null,
3716 dependency_array_intel: ?struct { literal_integer: LiteralInteger } = null,
3717 pipeline_enable_intel: ?struct { literal_integer: LiteralInteger } = null,
3718 loop_coalesce_intel: ?struct { literal_integer: LiteralInteger } = null,
3719 max_interleaving_intel: ?struct { literal_integer: LiteralInteger } = null,
3720 speculated_iterations_intel: ?struct { literal_integer: LiteralInteger } = null,
3721 no_fusion_intel: bool = false,
3722 loop_count_intel: ?struct { literal_integer: LiteralInteger } = null,
3723 max_reinvocation_delay_intel: ?struct { literal_integer: LiteralInteger } = null,
3724 _reserved_bit_26: bool = false,
3725 _reserved_bit_27: bool = false,
3726 _reserved_bit_28: bool = false,
3727 _reserved_bit_29: bool = false,
3728 _reserved_bit_30: bool = false,
3729 _reserved_bit_31: bool = false,
3730 };
3731};
3732pub const FunctionControl = packed struct {
3733 @"inline": bool = false,
3734 dont_inline: bool = false,
3735 pure: bool = false,
3736 @"const": bool = false,
3737 _reserved_bit_4: bool = false,
3738 _reserved_bit_5: bool = false,
3739 _reserved_bit_6: bool = false,
3740 _reserved_bit_7: bool = false,
3741 _reserved_bit_8: bool = false,
3742 _reserved_bit_9: bool = false,
3743 _reserved_bit_10: bool = false,
3744 _reserved_bit_11: bool = false,
3745 _reserved_bit_12: bool = false,
3746 _reserved_bit_13: bool = false,
3747 _reserved_bit_14: bool = false,
3748 _reserved_bit_15: bool = false,
3749 opt_none_ext: bool = false,
3750 _reserved_bit_17: bool = false,
3751 _reserved_bit_18: bool = false,
3752 _reserved_bit_19: bool = false,
3753 _reserved_bit_20: bool = false,
3754 _reserved_bit_21: bool = false,
3755 _reserved_bit_22: bool = false,
3756 _reserved_bit_23: bool = false,
3757 _reserved_bit_24: bool = false,
3758 _reserved_bit_25: bool = false,
3759 _reserved_bit_26: bool = false,
3760 _reserved_bit_27: bool = false,
3761 _reserved_bit_28: bool = false,
3762 _reserved_bit_29: bool = false,
3763 _reserved_bit_30: bool = false,
3764 _reserved_bit_31: bool = false,
3765};
3766pub const MemorySemantics = packed struct {
3767 _reserved_bit_0: bool = false,
3768 acquire: bool = false,
3769 release: bool = false,
3770 acquire_release: bool = false,
3771 sequentially_consistent: bool = false,
3772 _reserved_bit_5: bool = false,
3773 uniform_memory: bool = false,
3774 subgroup_memory: bool = false,
3775 workgroup_memory: bool = false,
3776 cross_workgroup_memory: bool = false,
3777 atomic_counter_memory: bool = false,
3778 image_memory: bool = false,
3779 output_memory: bool = false,
3780 make_available: bool = false,
3781 make_visible: bool = false,
3782 @"volatile": bool = false,
3783 _reserved_bit_16: bool = false,
3784 _reserved_bit_17: bool = false,
3785 _reserved_bit_18: bool = false,
3786 _reserved_bit_19: bool = false,
3787 _reserved_bit_20: bool = false,
3788 _reserved_bit_21: bool = false,
3789 _reserved_bit_22: bool = false,
3790 _reserved_bit_23: bool = false,
3791 _reserved_bit_24: bool = false,
3792 _reserved_bit_25: bool = false,
3793 _reserved_bit_26: bool = false,
3794 _reserved_bit_27: bool = false,
3795 _reserved_bit_28: bool = false,
3796 _reserved_bit_29: bool = false,
3797 _reserved_bit_30: bool = false,
3798 _reserved_bit_31: bool = false,
3799};
3800pub const MemoryAccess = packed struct {
3801 @"volatile": bool = false,
3802 aligned: bool = false,
3803 nontemporal: bool = false,
3804 make_pointer_available: bool = false,
3805 make_pointer_visible: bool = false,
3806 non_private_pointer: bool = false,
3807 _reserved_bit_6: bool = false,
3808 _reserved_bit_7: bool = false,
3809 _reserved_bit_8: bool = false,
3810 _reserved_bit_9: bool = false,
3811 _reserved_bit_10: bool = false,
3812 _reserved_bit_11: bool = false,
3813 _reserved_bit_12: bool = false,
3814 _reserved_bit_13: bool = false,
3815 _reserved_bit_14: bool = false,
3816 _reserved_bit_15: bool = false,
3817 alias_scope_intel_mask: bool = false,
3818 no_alias_intel_mask: bool = false,
3819 _reserved_bit_18: bool = false,
3820 _reserved_bit_19: bool = false,
3821 _reserved_bit_20: bool = false,
3822 _reserved_bit_21: bool = false,
3823 _reserved_bit_22: bool = false,
3824 _reserved_bit_23: bool = false,
3825 _reserved_bit_24: bool = false,
3826 _reserved_bit_25: bool = false,
3827 _reserved_bit_26: bool = false,
3828 _reserved_bit_27: bool = false,
3829 _reserved_bit_28: bool = false,
3830 _reserved_bit_29: bool = false,
3831 _reserved_bit_30: bool = false,
3832 _reserved_bit_31: bool = false,
3833
3834 pub const Extended = struct {
3835 @"volatile": bool = false,
3836 aligned: ?struct { literal_integer: LiteralInteger } = null,
3837 nontemporal: bool = false,
3838 make_pointer_available: ?struct { id_scope: Id } = null,
3839 make_pointer_visible: ?struct { id_scope: Id } = null,
3840 non_private_pointer: bool = false,
3841 _reserved_bit_6: bool = false,
3842 _reserved_bit_7: bool = false,
3843 _reserved_bit_8: bool = false,
3844 _reserved_bit_9: bool = false,
3845 _reserved_bit_10: bool = false,
3846 _reserved_bit_11: bool = false,
3847 _reserved_bit_12: bool = false,
3848 _reserved_bit_13: bool = false,
3849 _reserved_bit_14: bool = false,
3850 _reserved_bit_15: bool = false,
3851 alias_scope_intel_mask: ?struct { id_ref: Id } = null,
3852 no_alias_intel_mask: ?struct { id_ref: Id } = null,
3853 _reserved_bit_18: bool = false,
3854 _reserved_bit_19: bool = false,
3855 _reserved_bit_20: bool = false,
3856 _reserved_bit_21: bool = false,
3857 _reserved_bit_22: bool = false,
3858 _reserved_bit_23: bool = false,
3859 _reserved_bit_24: bool = false,
3860 _reserved_bit_25: bool = false,
3861 _reserved_bit_26: bool = false,
3862 _reserved_bit_27: bool = false,
3863 _reserved_bit_28: bool = false,
3864 _reserved_bit_29: bool = false,
3865 _reserved_bit_30: bool = false,
3866 _reserved_bit_31: bool = false,
3867 };
3868};
3869pub const KernelProfilingInfo = packed struct {
3870 cmd_exec_time: bool = false,
3871 _reserved_bit_1: bool = false,
3872 _reserved_bit_2: bool = false,
3873 _reserved_bit_3: bool = false,
3874 _reserved_bit_4: bool = false,
3875 _reserved_bit_5: bool = false,
3876 _reserved_bit_6: bool = false,
3877 _reserved_bit_7: bool = false,
3878 _reserved_bit_8: bool = false,
3879 _reserved_bit_9: bool = false,
3880 _reserved_bit_10: bool = false,
3881 _reserved_bit_11: bool = false,
3882 _reserved_bit_12: bool = false,
3883 _reserved_bit_13: bool = false,
3884 _reserved_bit_14: bool = false,
3885 _reserved_bit_15: bool = false,
3886 _reserved_bit_16: bool = false,
3887 _reserved_bit_17: bool = false,
3888 _reserved_bit_18: bool = false,
3889 _reserved_bit_19: bool = false,
3890 _reserved_bit_20: bool = false,
3891 _reserved_bit_21: bool = false,
3892 _reserved_bit_22: bool = false,
3893 _reserved_bit_23: bool = false,
3894 _reserved_bit_24: bool = false,
3895 _reserved_bit_25: bool = false,
3896 _reserved_bit_26: bool = false,
3897 _reserved_bit_27: bool = false,
3898 _reserved_bit_28: bool = false,
3899 _reserved_bit_29: bool = false,
3900 _reserved_bit_30: bool = false,
3901 _reserved_bit_31: bool = false,
3902};
3903pub const RayFlags = packed struct {
3904 opaque_khr: bool = false,
3905 no_opaque_khr: bool = false,
3906 terminate_on_first_hit_khr: bool = false,
3907 skip_closest_hit_shader_khr: bool = false,
3908 cull_back_facing_triangles_khr: bool = false,
3909 cull_front_facing_triangles_khr: bool = false,
3910 cull_opaque_khr: bool = false,
3911 cull_no_opaque_khr: bool = false,
3912 skip_triangles_khr: bool = false,
3913 skip_aab_bs_khr: bool = false,
3914 force_opacity_micromap2state_ext: bool = false,
3915 _reserved_bit_11: bool = false,
3916 _reserved_bit_12: bool = false,
3917 _reserved_bit_13: bool = false,
3918 _reserved_bit_14: bool = false,
3919 _reserved_bit_15: bool = false,
3920 _reserved_bit_16: bool = false,
3921 _reserved_bit_17: bool = false,
3922 _reserved_bit_18: bool = false,
3923 _reserved_bit_19: bool = false,
3924 _reserved_bit_20: bool = false,
3925 _reserved_bit_21: bool = false,
3926 _reserved_bit_22: bool = false,
3927 _reserved_bit_23: bool = false,
3928 _reserved_bit_24: bool = false,
3929 _reserved_bit_25: bool = false,
3930 _reserved_bit_26: bool = false,
3931 _reserved_bit_27: bool = false,
3932 _reserved_bit_28: bool = false,
3933 _reserved_bit_29: bool = false,
3934 _reserved_bit_30: bool = false,
3935 _reserved_bit_31: bool = false,
3936};
3937pub const FragmentShadingRate = packed struct {
3938 vertical2pixels: bool = false,
3939 vertical4pixels: bool = false,
3940 horizontal2pixels: bool = false,
3941 horizontal4pixels: bool = false,
3942 _reserved_bit_4: bool = false,
3943 _reserved_bit_5: bool = false,
3944 _reserved_bit_6: bool = false,
3945 _reserved_bit_7: bool = false,
3946 _reserved_bit_8: bool = false,
3947 _reserved_bit_9: bool = false,
3948 _reserved_bit_10: bool = false,
3949 _reserved_bit_11: bool = false,
3950 _reserved_bit_12: bool = false,
3951 _reserved_bit_13: bool = false,
3952 _reserved_bit_14: bool = false,
3953 _reserved_bit_15: bool = false,
3954 _reserved_bit_16: bool = false,
3955 _reserved_bit_17: bool = false,
3956 _reserved_bit_18: bool = false,
3957 _reserved_bit_19: bool = false,
3958 _reserved_bit_20: bool = false,
3959 _reserved_bit_21: bool = false,
3960 _reserved_bit_22: bool = false,
3961 _reserved_bit_23: bool = false,
3962 _reserved_bit_24: bool = false,
3963 _reserved_bit_25: bool = false,
3964 _reserved_bit_26: bool = false,
3965 _reserved_bit_27: bool = false,
3966 _reserved_bit_28: bool = false,
3967 _reserved_bit_29: bool = false,
3968 _reserved_bit_30: bool = false,
3969 _reserved_bit_31: bool = false,
3970};
3971pub const RawAccessChainOperands = packed struct {
3972 robustness_per_component_nv: bool = false,
3973 robustness_per_element_nv: bool = false,
3974 _reserved_bit_2: bool = false,
3975 _reserved_bit_3: bool = false,
3976 _reserved_bit_4: bool = false,
3977 _reserved_bit_5: bool = false,
3978 _reserved_bit_6: bool = false,
3979 _reserved_bit_7: bool = false,
3980 _reserved_bit_8: bool = false,
3981 _reserved_bit_9: bool = false,
3982 _reserved_bit_10: bool = false,
3983 _reserved_bit_11: bool = false,
3984 _reserved_bit_12: bool = false,
3985 _reserved_bit_13: bool = false,
3986 _reserved_bit_14: bool = false,
3987 _reserved_bit_15: bool = false,
3988 _reserved_bit_16: bool = false,
3989 _reserved_bit_17: bool = false,
3990 _reserved_bit_18: bool = false,
3991 _reserved_bit_19: bool = false,
3992 _reserved_bit_20: bool = false,
3993 _reserved_bit_21: bool = false,
3994 _reserved_bit_22: bool = false,
3995 _reserved_bit_23: bool = false,
3996 _reserved_bit_24: bool = false,
3997 _reserved_bit_25: bool = false,
3998 _reserved_bit_26: bool = false,
3999 _reserved_bit_27: bool = false,
4000 _reserved_bit_28: bool = false,
4001 _reserved_bit_29: bool = false,
4002 _reserved_bit_30: bool = false,
4003 _reserved_bit_31: bool = false,
4004};
4005pub const SourceLanguage = enum(u32) {
4006 unknown = 0,
4007 essl = 1,
4008 glsl = 2,
4009 open_cl_c = 3,
4010 open_cl_cpp = 4,
4011 hlsl = 5,
4012 cpp_for_open_cl = 6,
4013 sycl = 7,
4014 hero_c = 8,
4015 nzsl = 9,
4016 wgsl = 10,
4017 slang = 11,
4018 zig = 12,
4019 rust = 13,
4020};
4021pub const ExecutionModel = enum(u32) {
4022 vertex = 0,
4023 tessellation_control = 1,
4024 tessellation_evaluation = 2,
4025 geometry = 3,
4026 fragment = 4,
4027 gl_compute = 5,
4028 kernel = 6,
4029 task_nv = 5267,
4030 mesh_nv = 5268,
4031 ray_generation_khr = 5313,
4032 intersection_khr = 5314,
4033 any_hit_khr = 5315,
4034 closest_hit_khr = 5316,
4035 miss_khr = 5317,
4036 callable_khr = 5318,
4037 task_ext = 5364,
4038 mesh_ext = 5365,
4039};
4040pub const AddressingModel = enum(u32) {
4041 logical = 0,
4042 physical32 = 1,
4043 physical64 = 2,
4044 physical_storage_buffer64 = 5348,
4045};
4046pub const MemoryModel = enum(u32) {
4047 simple = 0,
4048 glsl450 = 1,
4049 open_cl = 2,
4050 vulkan = 3,
4051};
4052pub const ExecutionMode = enum(u32) {
4053 invocations = 0,
4054 spacing_equal = 1,
4055 spacing_fractional_even = 2,
4056 spacing_fractional_odd = 3,
4057 vertex_order_cw = 4,
4058 vertex_order_ccw = 5,
4059 pixel_center_integer = 6,
4060 origin_upper_left = 7,
4061 origin_lower_left = 8,
4062 early_fragment_tests = 9,
4063 point_mode = 10,
4064 xfb = 11,
4065 depth_replacing = 12,
4066 depth_greater = 14,
4067 depth_less = 15,
4068 depth_unchanged = 16,
4069 local_size = 17,
4070 local_size_hint = 18,
4071 input_points = 19,
4072 input_lines = 20,
4073 input_lines_adjacency = 21,
4074 triangles = 22,
4075 input_triangles_adjacency = 23,
4076 quads = 24,
4077 isolines = 25,
4078 output_vertices = 26,
4079 output_points = 27,
4080 output_line_strip = 28,
4081 output_triangle_strip = 29,
4082 vec_type_hint = 30,
4083 contraction_off = 31,
4084 initializer = 33,
4085 finalizer = 34,
4086 subgroup_size = 35,
4087 subgroups_per_workgroup = 36,
4088 subgroups_per_workgroup_id = 37,
4089 local_size_id = 38,
4090 local_size_hint_id = 39,
4091 non_coherent_color_attachment_read_ext = 4169,
4092 non_coherent_depth_attachment_read_ext = 4170,
4093 non_coherent_stencil_attachment_read_ext = 4171,
4094 subgroup_uniform_control_flow_khr = 4421,
4095 post_depth_coverage = 4446,
4096 denorm_preserve = 4459,
4097 denorm_flush_to_zero = 4460,
4098 signed_zero_inf_nan_preserve = 4461,
4099 rounding_mode_rte = 4462,
4100 rounding_mode_rtz = 4463,
4101 non_coherent_tile_attachment_read_qcom = 4489,
4102 tile_shading_rate_qcom = 4490,
4103 early_and_late_fragment_tests_amd = 5017,
4104 stencil_ref_replacing_ext = 5027,
4105 coalescing_amdx = 5069,
4106 is_api_entry_amdx = 5070,
4107 max_node_recursion_amdx = 5071,
4108 static_num_workgroups_amdx = 5072,
4109 shader_index_amdx = 5073,
4110 max_num_workgroups_amdx = 5077,
4111 stencil_ref_unchanged_front_amd = 5079,
4112 stencil_ref_greater_front_amd = 5080,
4113 stencil_ref_less_front_amd = 5081,
4114 stencil_ref_unchanged_back_amd = 5082,
4115 stencil_ref_greater_back_amd = 5083,
4116 stencil_ref_less_back_amd = 5084,
4117 quad_derivatives_khr = 5088,
4118 require_full_quads_khr = 5089,
4119 shares_input_with_amdx = 5102,
4120 output_lines_ext = 5269,
4121 output_primitives_ext = 5270,
4122 derivative_group_quads_khr = 5289,
4123 derivative_group_linear_khr = 5290,
4124 output_triangles_ext = 5298,
4125 pixel_interlock_ordered_ext = 5366,
4126 pixel_interlock_unordered_ext = 5367,
4127 sample_interlock_ordered_ext = 5368,
4128 sample_interlock_unordered_ext = 5369,
4129 shading_rate_interlock_ordered_ext = 5370,
4130 shading_rate_interlock_unordered_ext = 5371,
4131 shared_local_memory_size_intel = 5618,
4132 rounding_mode_rtpintel = 5620,
4133 rounding_mode_rtnintel = 5621,
4134 floating_point_mode_altintel = 5622,
4135 floating_point_mode_ieeeintel = 5623,
4136 max_workgroup_size_intel = 5893,
4137 max_work_dim_intel = 5894,
4138 no_global_offset_intel = 5895,
4139 num_simd_workitems_intel = 5896,
4140 scheduler_target_fmax_mhz_intel = 5903,
4141 maximally_reconverges_khr = 6023,
4142 fp_fast_math_default = 6028,
4143 streaming_interface_intel = 6154,
4144 register_map_interface_intel = 6160,
4145 named_barrier_count_intel = 6417,
4146 maximum_registers_intel = 6461,
4147 maximum_registers_id_intel = 6462,
4148 named_maximum_registers_intel = 6463,
4149
4150 pub const Extended = union(ExecutionMode) {
4151 invocations: struct { literal_integer: LiteralInteger },
4152 spacing_equal,
4153 spacing_fractional_even,
4154 spacing_fractional_odd,
4155 vertex_order_cw,
4156 vertex_order_ccw,
4157 pixel_center_integer,
4158 origin_upper_left,
4159 origin_lower_left,
4160 early_fragment_tests,
4161 point_mode,
4162 xfb,
4163 depth_replacing,
4164 depth_greater,
4165 depth_less,
4166 depth_unchanged,
4167 local_size: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4168 local_size_hint: struct { x_size: LiteralInteger, y_size: LiteralInteger, z_size: LiteralInteger },
4169 input_points,
4170 input_lines,
4171 input_lines_adjacency,
4172 triangles,
4173 input_triangles_adjacency,
4174 quads,
4175 isolines,
4176 output_vertices: struct { vertex_count: LiteralInteger },
4177 output_points,
4178 output_line_strip,
4179 output_triangle_strip,
4180 vec_type_hint: struct { vector_type: LiteralInteger },
4181 contraction_off,
4182 initializer,
4183 finalizer,
4184 subgroup_size: struct { subgroup_size: LiteralInteger },
4185 subgroups_per_workgroup: struct { subgroups_per_workgroup: LiteralInteger },
4186 subgroups_per_workgroup_id: struct { subgroups_per_workgroup: Id },
4187 local_size_id: struct { x_size: Id, y_size: Id, z_size: Id },
4188 local_size_hint_id: struct { x_size_hint: Id, y_size_hint: Id, z_size_hint: Id },
4189 non_coherent_color_attachment_read_ext,
4190 non_coherent_depth_attachment_read_ext,
4191 non_coherent_stencil_attachment_read_ext,
4192 subgroup_uniform_control_flow_khr,
4193 post_depth_coverage,
4194 denorm_preserve: struct { target_width: LiteralInteger },
4195 denorm_flush_to_zero: struct { target_width: LiteralInteger },
4196 signed_zero_inf_nan_preserve: struct { target_width: LiteralInteger },
4197 rounding_mode_rte: struct { target_width: LiteralInteger },
4198 rounding_mode_rtz: struct { target_width: LiteralInteger },
4199 non_coherent_tile_attachment_read_qcom,
4200 tile_shading_rate_qcom: struct { x_rate: LiteralInteger, y_rate: LiteralInteger, z_rate: LiteralInteger },
4201 early_and_late_fragment_tests_amd,
4202 stencil_ref_replacing_ext,
4203 coalescing_amdx,
4204 is_api_entry_amdx: struct { is_entry: Id },
4205 max_node_recursion_amdx: struct { number_of_recursions: Id },
4206 static_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4207 shader_index_amdx: struct { shader_index: Id },
4208 max_num_workgroups_amdx: struct { x_size: Id, y_size: Id, z_size: Id },
4209 stencil_ref_unchanged_front_amd,
4210 stencil_ref_greater_front_amd,
4211 stencil_ref_less_front_amd,
4212 stencil_ref_unchanged_back_amd,
4213 stencil_ref_greater_back_amd,
4214 stencil_ref_less_back_amd,
4215 quad_derivatives_khr,
4216 require_full_quads_khr,
4217 shares_input_with_amdx: struct { node_name: Id, shader_index: Id },
4218 output_lines_ext,
4219 output_primitives_ext: struct { primitive_count: LiteralInteger },
4220 derivative_group_quads_khr,
4221 derivative_group_linear_khr,
4222 output_triangles_ext,
4223 pixel_interlock_ordered_ext,
4224 pixel_interlock_unordered_ext,
4225 sample_interlock_ordered_ext,
4226 sample_interlock_unordered_ext,
4227 shading_rate_interlock_ordered_ext,
4228 shading_rate_interlock_unordered_ext,
4229 shared_local_memory_size_intel: struct { size: LiteralInteger },
4230 rounding_mode_rtpintel: struct { target_width: LiteralInteger },
4231 rounding_mode_rtnintel: struct { target_width: LiteralInteger },
4232 floating_point_mode_altintel: struct { target_width: LiteralInteger },
4233 floating_point_mode_ieeeintel: struct { target_width: LiteralInteger },
4234 max_workgroup_size_intel: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger, literal_integer_2: LiteralInteger },
4235 max_work_dim_intel: struct { literal_integer: LiteralInteger },
4236 no_global_offset_intel,
4237 num_simd_workitems_intel: struct { literal_integer: LiteralInteger },
4238 scheduler_target_fmax_mhz_intel: struct { literal_integer: LiteralInteger },
4239 maximally_reconverges_khr,
4240 fp_fast_math_default: struct { target_type: Id, id_ref_1: Id },
4241 streaming_interface_intel: struct { stall_free_return: LiteralInteger },
4242 register_map_interface_intel: struct { wait_for_done_write: LiteralInteger },
4243 named_barrier_count_intel: struct { barrier_count: LiteralInteger },
4244 maximum_registers_intel: struct { number_of_registers: LiteralInteger },
4245 maximum_registers_id_intel: struct { number_of_registers: Id },
4246 named_maximum_registers_intel: struct { named_maximum_number_of_registers: NamedMaximumNumberOfRegisters },
4247 };
4248};
4249pub const StorageClass = enum(u32) {
4250 uniform_constant = 0,
4251 input = 1,
4252 uniform = 2,
4253 output = 3,
4254 workgroup = 4,
4255 cross_workgroup = 5,
4256 private = 6,
4257 function = 7,
4258 generic = 8,
4259 push_constant = 9,
4260 atomic_counter = 10,
4261 image = 11,
4262 storage_buffer = 12,
4263 tile_image_ext = 4172,
4264 tile_attachment_qcom = 4491,
4265 node_payload_amdx = 5068,
4266 callable_data_khr = 5328,
4267 incoming_callable_data_khr = 5329,
4268 ray_payload_khr = 5338,
4269 hit_attribute_khr = 5339,
4270 incoming_ray_payload_khr = 5342,
4271 shader_record_buffer_khr = 5343,
4272 physical_storage_buffer = 5349,
4273 hit_object_attribute_nv = 5385,
4274 task_payload_workgroup_ext = 5402,
4275 code_section_intel = 5605,
4276 device_only_intel = 5936,
4277 host_only_intel = 5937,
4278};
4279pub const Dim = enum(u32) {
4280 @"1d" = 0,
4281 @"2d" = 1,
4282 @"3d" = 2,
4283 cube = 3,
4284 rect = 4,
4285 buffer = 5,
4286 subpass_data = 6,
4287 tile_image_data_ext = 4173,
4288};
4289pub const SamplerAddressingMode = enum(u32) {
4290 none = 0,
4291 clamp_to_edge = 1,
4292 clamp = 2,
4293 repeat = 3,
4294 repeat_mirrored = 4,
4295};
4296pub const SamplerFilterMode = enum(u32) {
4297 nearest = 0,
4298 linear = 1,
4299};
4300pub const ImageFormat = enum(u32) {
4301 unknown = 0,
4302 rgba32f = 1,
4303 rgba16f = 2,
4304 r32f = 3,
4305 rgba8 = 4,
4306 rgba8snorm = 5,
4307 rg32f = 6,
4308 rg16f = 7,
4309 r11f_g11f_b10f = 8,
4310 r16f = 9,
4311 rgba16 = 10,
4312 rgb10a2 = 11,
4313 rg16 = 12,
4314 rg8 = 13,
4315 r16 = 14,
4316 r8 = 15,
4317 rgba16snorm = 16,
4318 rg16snorm = 17,
4319 rg8snorm = 18,
4320 r16snorm = 19,
4321 r8snorm = 20,
4322 rgba32i = 21,
4323 rgba16i = 22,
4324 rgba8i = 23,
4325 r32i = 24,
4326 rg32i = 25,
4327 rg16i = 26,
4328 rg8i = 27,
4329 r16i = 28,
4330 r8i = 29,
4331 rgba32ui = 30,
4332 rgba16ui = 31,
4333 rgba8ui = 32,
4334 r32ui = 33,
4335 rgb10a2ui = 34,
4336 rg32ui = 35,
4337 rg16ui = 36,
4338 rg8ui = 37,
4339 r16ui = 38,
4340 r8ui = 39,
4341 r64ui = 40,
4342 r64i = 41,
4343};
4344pub const ImageChannelOrder = enum(u32) {
4345 r = 0,
4346 a = 1,
4347 rg = 2,
4348 ra = 3,
4349 rgb = 4,
4350 rgba = 5,
4351 bgra = 6,
4352 argb = 7,
4353 intensity = 8,
4354 luminance = 9,
4355 rx = 10,
4356 r_gx = 11,
4357 rg_bx = 12,
4358 depth = 13,
4359 depth_stencil = 14,
4360 s_rgb = 15,
4361 s_rg_bx = 16,
4362 s_rgba = 17,
4363 s_bgra = 18,
4364 abgr = 19,
4365};
4366pub const ImageChannelDataType = enum(u32) {
4367 snorm_int8 = 0,
4368 snorm_int16 = 1,
4369 unorm_int8 = 2,
4370 unorm_int16 = 3,
4371 unorm_short565 = 4,
4372 unorm_short555 = 5,
4373 unorm_int101010 = 6,
4374 signed_int8 = 7,
4375 signed_int16 = 8,
4376 signed_int32 = 9,
4377 unsigned_int8 = 10,
4378 unsigned_int16 = 11,
4379 unsigned_int32 = 12,
4380 half_float = 13,
4381 float = 14,
4382 unorm_int24 = 15,
4383 unorm_int101010_2 = 16,
4384 unorm_int10x6ext = 17,
4385 unsigned_int_raw10ext = 19,
4386 unsigned_int_raw12ext = 20,
4387 unorm_int2_101010ext = 21,
4388 unsigned_int10x6ext = 22,
4389 unsigned_int12x4ext = 23,
4390 unsigned_int14x2ext = 24,
4391 unorm_int12x4ext = 25,
4392 unorm_int14x2ext = 26,
4393};
4394pub const FPRoundingMode = enum(u32) {
4395 rte = 0,
4396 rtz = 1,
4397 rtp = 2,
4398 rtn = 3,
4399};
4400pub const FPDenormMode = enum(u32) {
4401 preserve = 0,
4402 flush_to_zero = 1,
4403};
4404pub const QuantizationModes = enum(u32) {
4405 trn = 0,
4406 trn_zero = 1,
4407 rnd = 2,
4408 rnd_zero = 3,
4409 rnd_inf = 4,
4410 rnd_min_inf = 5,
4411 rnd_conv = 6,
4412 rnd_conv_odd = 7,
4413};
4414pub const FPOperationMode = enum(u32) {
4415 ieee = 0,
4416 alt = 1,
4417};
4418pub const OverflowModes = enum(u32) {
4419 wrap = 0,
4420 sat = 1,
4421 sat_zero = 2,
4422 sat_sym = 3,
4423};
4424pub const LinkageType = enum(u32) {
4425 @"export" = 0,
4426 import = 1,
4427 link_once_odr = 2,
4428};
4429pub const AccessQualifier = enum(u32) {
4430 read_only = 0,
4431 write_only = 1,
4432 read_write = 2,
4433};
4434pub const HostAccessQualifier = enum(u32) {
4435 none_intel = 0,
4436 read_intel = 1,
4437 write_intel = 2,
4438 read_write_intel = 3,
4439};
4440pub const FunctionParameterAttribute = enum(u32) {
4441 zext = 0,
4442 sext = 1,
4443 by_val = 2,
4444 sret = 3,
4445 no_alias = 4,
4446 no_capture = 5,
4447 no_write = 6,
4448 no_read_write = 7,
4449 runtime_aligned_intel = 5940,
4450};
4451pub const Decoration = enum(u32) {
4452 relaxed_precision = 0,
4453 spec_id = 1,
4454 block = 2,
4455 buffer_block = 3,
4456 row_major = 4,
4457 col_major = 5,
4458 array_stride = 6,
4459 matrix_stride = 7,
4460 glsl_shared = 8,
4461 glsl_packed = 9,
4462 c_packed = 10,
4463 built_in = 11,
4464 no_perspective = 13,
4465 flat = 14,
4466 patch = 15,
4467 centroid = 16,
4468 sample = 17,
4469 invariant = 18,
4470 restrict = 19,
4471 aliased = 20,
4472 @"volatile" = 21,
4473 constant = 22,
4474 coherent = 23,
4475 non_writable = 24,
4476 non_readable = 25,
4477 uniform = 26,
4478 uniform_id = 27,
4479 saturated_conversion = 28,
4480 stream = 29,
4481 location = 30,
4482 component = 31,
4483 index = 32,
4484 binding = 33,
4485 descriptor_set = 34,
4486 offset = 35,
4487 xfb_buffer = 36,
4488 xfb_stride = 37,
4489 func_param_attr = 38,
4490 fp_rounding_mode = 39,
4491 fp_fast_math_mode = 40,
4492 linkage_attributes = 41,
4493 no_contraction = 42,
4494 input_attachment_index = 43,
4495 alignment = 44,
4496 max_byte_offset = 45,
4497 alignment_id = 46,
4498 max_byte_offset_id = 47,
4499 saturated_to_largest_float8normal_conversion_ext = 4216,
4500 no_signed_wrap = 4469,
4501 no_unsigned_wrap = 4470,
4502 weight_texture_qcom = 4487,
4503 block_match_texture_qcom = 4488,
4504 block_match_sampler_qcom = 4499,
4505 explicit_interp_amd = 4999,
4506 node_shares_payload_limits_with_amdx = 5019,
4507 node_max_payloads_amdx = 5020,
4508 track_finish_writing_amdx = 5078,
4509 payload_node_name_amdx = 5091,
4510 payload_node_base_index_amdx = 5098,
4511 payload_node_sparse_array_amdx = 5099,
4512 payload_node_array_size_amdx = 5100,
4513 payload_dispatch_indirect_amdx = 5105,
4514 override_coverage_nv = 5248,
4515 passthrough_nv = 5250,
4516 viewport_relative_nv = 5252,
4517 secondary_viewport_relative_nv = 5256,
4518 per_primitive_ext = 5271,
4519 per_view_nv = 5272,
4520 per_task_nv = 5273,
4521 per_vertex_khr = 5285,
4522 non_uniform = 5300,
4523 restrict_pointer = 5355,
4524 aliased_pointer = 5356,
4525 hit_object_shader_record_buffer_nv = 5386,
4526 bindless_sampler_nv = 5398,
4527 bindless_image_nv = 5399,
4528 bound_sampler_nv = 5400,
4529 bound_image_nv = 5401,
4530 simt_call_intel = 5599,
4531 referenced_indirectly_intel = 5602,
4532 clobber_intel = 5607,
4533 side_effects_intel = 5608,
4534 vector_compute_variable_intel = 5624,
4535 func_param_io_kind_intel = 5625,
4536 vector_compute_function_intel = 5626,
4537 stack_call_intel = 5627,
4538 global_variable_offset_intel = 5628,
4539 counter_buffer = 5634,
4540 user_semantic = 5635,
4541 user_type_google = 5636,
4542 function_rounding_mode_intel = 5822,
4543 function_denorm_mode_intel = 5823,
4544 register_intel = 5825,
4545 memory_intel = 5826,
4546 numbanks_intel = 5827,
4547 bankwidth_intel = 5828,
4548 max_private_copies_intel = 5829,
4549 singlepump_intel = 5830,
4550 doublepump_intel = 5831,
4551 max_replicates_intel = 5832,
4552 simple_dual_port_intel = 5833,
4553 merge_intel = 5834,
4554 bank_bits_intel = 5835,
4555 force_pow2depth_intel = 5836,
4556 stridesize_intel = 5883,
4557 wordsize_intel = 5884,
4558 true_dual_port_intel = 5885,
4559 burst_coalesce_intel = 5899,
4560 cache_size_intel = 5900,
4561 dont_statically_coalesce_intel = 5901,
4562 prefetch_intel = 5902,
4563 stall_enable_intel = 5905,
4564 fuse_loops_in_function_intel = 5907,
4565 math_op_dsp_mode_intel = 5909,
4566 alias_scope_intel = 5914,
4567 no_alias_intel = 5915,
4568 initiation_interval_intel = 5917,
4569 max_concurrency_intel = 5918,
4570 pipeline_enable_intel = 5919,
4571 buffer_location_intel = 5921,
4572 io_pipe_storage_intel = 5944,
4573 function_floating_point_mode_intel = 6080,
4574 single_element_vector_intel = 6085,
4575 vector_compute_callable_function_intel = 6087,
4576 media_block_iointel = 6140,
4577 stall_free_intel = 6151,
4578 fp_max_error_decoration_intel = 6170,
4579 latency_control_label_intel = 6172,
4580 latency_control_constraint_intel = 6173,
4581 conduit_kernel_argument_intel = 6175,
4582 register_map_kernel_argument_intel = 6176,
4583 mm_host_interface_address_width_intel = 6177,
4584 mm_host_interface_data_width_intel = 6178,
4585 mm_host_interface_latency_intel = 6179,
4586 mm_host_interface_read_write_mode_intel = 6180,
4587 mm_host_interface_max_burst_intel = 6181,
4588 mm_host_interface_wait_request_intel = 6182,
4589 stable_kernel_argument_intel = 6183,
4590 host_access_intel = 6188,
4591 init_mode_intel = 6190,
4592 implement_in_register_map_intel = 6191,
4593 cache_control_load_intel = 6442,
4594 cache_control_store_intel = 6443,
4595
4596 pub const Extended = union(Decoration) {
4597 relaxed_precision,
4598 spec_id: struct { specialization_constant_id: LiteralInteger },
4599 block,
4600 buffer_block,
4601 row_major,
4602 col_major,
4603 array_stride: struct { array_stride: LiteralInteger },
4604 matrix_stride: struct { matrix_stride: LiteralInteger },
4605 glsl_shared,
4606 glsl_packed,
4607 c_packed,
4608 built_in: struct { built_in: BuiltIn },
4609 no_perspective,
4610 flat,
4611 patch,
4612 centroid,
4613 sample,
4614 invariant,
4615 restrict,
4616 aliased,
4617 @"volatile",
4618 constant,
4619 coherent,
4620 non_writable,
4621 non_readable,
4622 uniform,
4623 uniform_id: struct { execution: Id },
4624 saturated_conversion,
4625 stream: struct { stream_number: LiteralInteger },
4626 location: struct { location: LiteralInteger },
4627 component: struct { component: LiteralInteger },
4628 index: struct { index: LiteralInteger },
4629 binding: struct { binding_point: LiteralInteger },
4630 descriptor_set: struct { descriptor_set: LiteralInteger },
4631 offset: struct { byte_offset: LiteralInteger },
4632 xfb_buffer: struct { xfb_buffer_number: LiteralInteger },
4633 xfb_stride: struct { xfb_stride: LiteralInteger },
4634 func_param_attr: struct { function_parameter_attribute: FunctionParameterAttribute },
4635 fp_rounding_mode: struct { fp_rounding_mode: FPRoundingMode },
4636 fp_fast_math_mode: struct { fp_fast_math_mode: FPFastMathMode },
4637 linkage_attributes: struct { name: LiteralString, linkage_type: LinkageType },
4638 no_contraction,
4639 input_attachment_index: struct { attachment_index: LiteralInteger },
4640 alignment: struct { alignment: LiteralInteger },
4641 max_byte_offset: struct { max_byte_offset: LiteralInteger },
4642 alignment_id: struct { alignment: Id },
4643 max_byte_offset_id: struct { max_byte_offset: Id },
4644 saturated_to_largest_float8normal_conversion_ext,
4645 no_signed_wrap,
4646 no_unsigned_wrap,
4647 weight_texture_qcom,
4648 block_match_texture_qcom,
4649 block_match_sampler_qcom,
4650 explicit_interp_amd,
4651 node_shares_payload_limits_with_amdx: struct { payload_type: Id },
4652 node_max_payloads_amdx: struct { max_number_of_payloads: Id },
4653 track_finish_writing_amdx,
4654 payload_node_name_amdx: struct { node_name: Id },
4655 payload_node_base_index_amdx: struct { base_index: Id },
4656 payload_node_sparse_array_amdx,
4657 payload_node_array_size_amdx: struct { array_size: Id },
4658 payload_dispatch_indirect_amdx,
4659 override_coverage_nv,
4660 passthrough_nv,
4661 viewport_relative_nv,
4662 secondary_viewport_relative_nv: struct { offset: LiteralInteger },
4663 per_primitive_ext,
4664 per_view_nv,
4665 per_task_nv,
4666 per_vertex_khr,
4667 non_uniform,
4668 restrict_pointer,
4669 aliased_pointer,
4670 hit_object_shader_record_buffer_nv,
4671 bindless_sampler_nv,
4672 bindless_image_nv,
4673 bound_sampler_nv,
4674 bound_image_nv,
4675 simt_call_intel: struct { n: LiteralInteger },
4676 referenced_indirectly_intel,
4677 clobber_intel: struct { register: LiteralString },
4678 side_effects_intel,
4679 vector_compute_variable_intel,
4680 func_param_io_kind_intel: struct { kind: LiteralInteger },
4681 vector_compute_function_intel,
4682 stack_call_intel,
4683 global_variable_offset_intel: struct { offset: LiteralInteger },
4684 counter_buffer: struct { counter_buffer: Id },
4685 user_semantic: struct { semantic: LiteralString },
4686 user_type_google: struct { user_type: LiteralString },
4687 function_rounding_mode_intel: struct { target_width: LiteralInteger, fp_rounding_mode: FPRoundingMode },
4688 function_denorm_mode_intel: struct { target_width: LiteralInteger, fp_denorm_mode: FPDenormMode },
4689 register_intel,
4690 memory_intel: struct { memory_type: LiteralString },
4691 numbanks_intel: struct { banks: LiteralInteger },
4692 bankwidth_intel: struct { bank_width: LiteralInteger },
4693 max_private_copies_intel: struct { maximum_copies: LiteralInteger },
4694 singlepump_intel,
4695 doublepump_intel,
4696 max_replicates_intel: struct { maximum_replicates: LiteralInteger },
4697 simple_dual_port_intel,
4698 merge_intel: struct { merge_key: LiteralString, merge_type: LiteralString },
4699 bank_bits_intel: struct { bank_bits: []const LiteralInteger = &.{} },
4700 force_pow2depth_intel: struct { force_key: LiteralInteger },
4701 stridesize_intel: struct { stride_size: LiteralInteger },
4702 wordsize_intel: struct { word_size: LiteralInteger },
4703 true_dual_port_intel,
4704 burst_coalesce_intel,
4705 cache_size_intel: struct { cache_size_in_bytes: LiteralInteger },
4706 dont_statically_coalesce_intel,
4707 prefetch_intel: struct { prefetcher_size_in_bytes: LiteralInteger },
4708 stall_enable_intel,
4709 fuse_loops_in_function_intel,
4710 math_op_dsp_mode_intel: struct { mode: LiteralInteger, propagate: LiteralInteger },
4711 alias_scope_intel: struct { aliasing_scopes_list: Id },
4712 no_alias_intel: struct { aliasing_scopes_list: Id },
4713 initiation_interval_intel: struct { cycles: LiteralInteger },
4714 max_concurrency_intel: struct { invocations: LiteralInteger },
4715 pipeline_enable_intel: struct { enable: LiteralInteger },
4716 buffer_location_intel: struct { buffer_location_id: LiteralInteger },
4717 io_pipe_storage_intel: struct { io_pipe_id: LiteralInteger },
4718 function_floating_point_mode_intel: struct { target_width: LiteralInteger, fp_operation_mode: FPOperationMode },
4719 single_element_vector_intel,
4720 vector_compute_callable_function_intel,
4721 media_block_iointel,
4722 stall_free_intel,
4723 fp_max_error_decoration_intel: struct { max_error: LiteralFloat },
4724 latency_control_label_intel: struct { latency_label: LiteralInteger },
4725 latency_control_constraint_intel: struct { relative_to: LiteralInteger, control_type: LiteralInteger, relative_cycle: LiteralInteger },
4726 conduit_kernel_argument_intel,
4727 register_map_kernel_argument_intel,
4728 mm_host_interface_address_width_intel: struct { address_width: LiteralInteger },
4729 mm_host_interface_data_width_intel: struct { data_width: LiteralInteger },
4730 mm_host_interface_latency_intel: struct { latency: LiteralInteger },
4731 mm_host_interface_read_write_mode_intel: struct { read_write_mode: AccessQualifier },
4732 mm_host_interface_max_burst_intel: struct { max_burst_count: LiteralInteger },
4733 mm_host_interface_wait_request_intel: struct { waitrequest: LiteralInteger },
4734 stable_kernel_argument_intel,
4735 host_access_intel: struct { access: HostAccessQualifier, name: LiteralString },
4736 init_mode_intel: struct { trigger: InitializationModeQualifier },
4737 implement_in_register_map_intel: struct { value: LiteralInteger },
4738 cache_control_load_intel: struct { cache_level: LiteralInteger, cache_control: LoadCacheControl },
4739 cache_control_store_intel: struct { cache_level: LiteralInteger, cache_control: StoreCacheControl },
4740 };
4741};
4742pub const BuiltIn = enum(u32) {
4743 position = 0,
4744 point_size = 1,
4745 clip_distance = 3,
4746 cull_distance = 4,
4747 vertex_id = 5,
4748 instance_id = 6,
4749 primitive_id = 7,
4750 invocation_id = 8,
4751 layer = 9,
4752 viewport_index = 10,
4753 tess_level_outer = 11,
4754 tess_level_inner = 12,
4755 tess_coord = 13,
4756 patch_vertices = 14,
4757 frag_coord = 15,
4758 point_coord = 16,
4759 front_facing = 17,
4760 sample_id = 18,
4761 sample_position = 19,
4762 sample_mask = 20,
4763 frag_depth = 22,
4764 helper_invocation = 23,
4765 num_workgroups = 24,
4766 workgroup_size = 25,
4767 workgroup_id = 26,
4768 local_invocation_id = 27,
4769 global_invocation_id = 28,
4770 local_invocation_index = 29,
4771 work_dim = 30,
4772 global_size = 31,
4773 enqueued_workgroup_size = 32,
4774 global_offset = 33,
4775 global_linear_id = 34,
4776 subgroup_size = 36,
4777 subgroup_max_size = 37,
4778 num_subgroups = 38,
4779 num_enqueued_subgroups = 39,
4780 subgroup_id = 40,
4781 subgroup_local_invocation_id = 41,
4782 vertex_index = 42,
4783 instance_index = 43,
4784 core_idarm = 4160,
4785 core_count_arm = 4161,
4786 core_max_idarm = 4162,
4787 warp_idarm = 4163,
4788 warp_max_idarm = 4164,
4789 subgroup_eq_mask = 4416,
4790 subgroup_ge_mask = 4417,
4791 subgroup_gt_mask = 4418,
4792 subgroup_le_mask = 4419,
4793 subgroup_lt_mask = 4420,
4794 base_vertex = 4424,
4795 base_instance = 4425,
4796 draw_index = 4426,
4797 primitive_shading_rate_khr = 4432,
4798 device_index = 4438,
4799 view_index = 4440,
4800 shading_rate_khr = 4444,
4801 tile_offset_qcom = 4492,
4802 tile_dimension_qcom = 4493,
4803 tile_apron_size_qcom = 4494,
4804 bary_coord_no_persp_amd = 4992,
4805 bary_coord_no_persp_centroid_amd = 4993,
4806 bary_coord_no_persp_sample_amd = 4994,
4807 bary_coord_smooth_amd = 4995,
4808 bary_coord_smooth_centroid_amd = 4996,
4809 bary_coord_smooth_sample_amd = 4997,
4810 bary_coord_pull_model_amd = 4998,
4811 frag_stencil_ref_ext = 5014,
4812 remaining_recursion_levels_amdx = 5021,
4813 shader_index_amdx = 5073,
4814 viewport_mask_nv = 5253,
4815 secondary_position_nv = 5257,
4816 secondary_viewport_mask_nv = 5258,
4817 position_per_view_nv = 5261,
4818 viewport_mask_per_view_nv = 5262,
4819 fully_covered_ext = 5264,
4820 task_count_nv = 5274,
4821 primitive_count_nv = 5275,
4822 primitive_indices_nv = 5276,
4823 clip_distance_per_view_nv = 5277,
4824 cull_distance_per_view_nv = 5278,
4825 layer_per_view_nv = 5279,
4826 mesh_view_count_nv = 5280,
4827 mesh_view_indices_nv = 5281,
4828 bary_coord_khr = 5286,
4829 bary_coord_no_persp_khr = 5287,
4830 frag_size_ext = 5292,
4831 frag_invocation_count_ext = 5293,
4832 primitive_point_indices_ext = 5294,
4833 primitive_line_indices_ext = 5295,
4834 primitive_triangle_indices_ext = 5296,
4835 cull_primitive_ext = 5299,
4836 launch_id_khr = 5319,
4837 launch_size_khr = 5320,
4838 world_ray_origin_khr = 5321,
4839 world_ray_direction_khr = 5322,
4840 object_ray_origin_khr = 5323,
4841 object_ray_direction_khr = 5324,
4842 ray_tmin_khr = 5325,
4843 ray_tmax_khr = 5326,
4844 instance_custom_index_khr = 5327,
4845 object_to_world_khr = 5330,
4846 world_to_object_khr = 5331,
4847 hit_tnv = 5332,
4848 hit_kind_khr = 5333,
4849 current_ray_time_nv = 5334,
4850 hit_triangle_vertex_positions_khr = 5335,
4851 hit_micro_triangle_vertex_positions_nv = 5337,
4852 hit_micro_triangle_vertex_barycentrics_nv = 5344,
4853 incoming_ray_flags_khr = 5351,
4854 ray_geometry_index_khr = 5352,
4855 hit_is_sphere_nv = 5359,
4856 hit_is_lssnv = 5360,
4857 hit_sphere_position_nv = 5361,
4858 warps_per_smnv = 5374,
4859 sm_count_nv = 5375,
4860 warp_idnv = 5376,
4861 smidnv = 5377,
4862 hit_lss_positions_nv = 5396,
4863 hit_kind_front_facing_micro_triangle_nv = 5405,
4864 hit_kind_back_facing_micro_triangle_nv = 5406,
4865 hit_sphere_radius_nv = 5420,
4866 hit_lss_radii_nv = 5421,
4867 cluster_idnv = 5436,
4868 cull_mask_khr = 6021,
4869};
4870pub const Scope = enum(u32) {
4871 cross_device = 0,
4872 device = 1,
4873 workgroup = 2,
4874 subgroup = 3,
4875 invocation = 4,
4876 queue_family = 5,
4877 shader_call_khr = 6,
4878};
4879pub const GroupOperation = enum(u32) {
4880 reduce = 0,
4881 inclusive_scan = 1,
4882 exclusive_scan = 2,
4883 clustered_reduce = 3,
4884 partitioned_reduce_nv = 6,
4885 partitioned_inclusive_scan_nv = 7,
4886 partitioned_exclusive_scan_nv = 8,
4887};
4888pub const KernelEnqueueFlags = enum(u32) {
4889 no_wait = 0,
4890 wait_kernel = 1,
4891 wait_work_group = 2,
4892};
4893pub const Capability = enum(u32) {
4894 matrix = 0,
4895 shader = 1,
4896 geometry = 2,
4897 tessellation = 3,
4898 addresses = 4,
4899 linkage = 5,
4900 kernel = 6,
4901 vector16 = 7,
4902 float16buffer = 8,
4903 float16 = 9,
4904 float64 = 10,
4905 int64 = 11,
4906 int64atomics = 12,
4907 image_basic = 13,
4908 image_read_write = 14,
4909 image_mipmap = 15,
4910 pipes = 17,
4911 groups = 18,
4912 device_enqueue = 19,
4913 literal_sampler = 20,
4914 atomic_storage = 21,
4915 int16 = 22,
4916 tessellation_point_size = 23,
4917 geometry_point_size = 24,
4918 image_gather_extended = 25,
4919 storage_image_multisample = 27,
4920 uniform_buffer_array_dynamic_indexing = 28,
4921 sampled_image_array_dynamic_indexing = 29,
4922 storage_buffer_array_dynamic_indexing = 30,
4923 storage_image_array_dynamic_indexing = 31,
4924 clip_distance = 32,
4925 cull_distance = 33,
4926 image_cube_array = 34,
4927 sample_rate_shading = 35,
4928 image_rect = 36,
4929 sampled_rect = 37,
4930 generic_pointer = 38,
4931 int8 = 39,
4932 input_attachment = 40,
4933 sparse_residency = 41,
4934 min_lod = 42,
4935 sampled1d = 43,
4936 image1d = 44,
4937 sampled_cube_array = 45,
4938 sampled_buffer = 46,
4939 image_buffer = 47,
4940 image_ms_array = 48,
4941 storage_image_extended_formats = 49,
4942 image_query = 50,
4943 derivative_control = 51,
4944 interpolation_function = 52,
4945 transform_feedback = 53,
4946 geometry_streams = 54,
4947 storage_image_read_without_format = 55,
4948 storage_image_write_without_format = 56,
4949 multi_viewport = 57,
4950 subgroup_dispatch = 58,
4951 named_barrier = 59,
4952 pipe_storage = 60,
4953 group_non_uniform = 61,
4954 group_non_uniform_vote = 62,
4955 group_non_uniform_arithmetic = 63,
4956 group_non_uniform_ballot = 64,
4957 group_non_uniform_shuffle = 65,
4958 group_non_uniform_shuffle_relative = 66,
4959 group_non_uniform_clustered = 67,
4960 group_non_uniform_quad = 68,
4961 shader_layer = 69,
4962 shader_viewport_index = 70,
4963 uniform_decoration = 71,
4964 core_builtins_arm = 4165,
4965 tile_image_color_read_access_ext = 4166,
4966 tile_image_depth_read_access_ext = 4167,
4967 tile_image_stencil_read_access_ext = 4168,
4968 tensors_arm = 4174,
4969 storage_tensor_array_dynamic_indexing_arm = 4175,
4970 storage_tensor_array_non_uniform_indexing_arm = 4176,
4971 graph_arm = 4191,
4972 cooperative_matrix_layouts_arm = 4201,
4973 float8ext = 4212,
4974 float8cooperative_matrix_ext = 4213,
4975 fragment_shading_rate_khr = 4422,
4976 subgroup_ballot_khr = 4423,
4977 draw_parameters = 4427,
4978 workgroup_memory_explicit_layout_khr = 4428,
4979 workgroup_memory_explicit_layout8bit_access_khr = 4429,
4980 workgroup_memory_explicit_layout16bit_access_khr = 4430,
4981 subgroup_vote_khr = 4431,
4982 storage_buffer16bit_access = 4433,
4983 uniform_and_storage_buffer16bit_access = 4434,
4984 storage_push_constant16 = 4435,
4985 storage_input_output16 = 4436,
4986 device_group = 4437,
4987 multi_view = 4439,
4988 variable_pointers_storage_buffer = 4441,
4989 variable_pointers = 4442,
4990 atomic_storage_ops = 4445,
4991 sample_mask_post_depth_coverage = 4447,
4992 storage_buffer8bit_access = 4448,
4993 uniform_and_storage_buffer8bit_access = 4449,
4994 storage_push_constant8 = 4450,
4995 denorm_preserve = 4464,
4996 denorm_flush_to_zero = 4465,
4997 signed_zero_inf_nan_preserve = 4466,
4998 rounding_mode_rte = 4467,
4999 rounding_mode_rtz = 4468,
5000 ray_query_provisional_khr = 4471,
5001 ray_query_khr = 4472,
5002 untyped_pointers_khr = 4473,
5003 ray_traversal_primitive_culling_khr = 4478,
5004 ray_tracing_khr = 4479,
5005 texture_sample_weighted_qcom = 4484,
5006 texture_box_filter_qcom = 4485,
5007 texture_block_match_qcom = 4486,
5008 tile_shading_qcom = 4495,
5009 texture_block_match2qcom = 4498,
5010 float16image_amd = 5008,
5011 image_gather_bias_lod_amd = 5009,
5012 fragment_mask_amd = 5010,
5013 stencil_export_ext = 5013,
5014 image_read_write_lod_amd = 5015,
5015 int64image_ext = 5016,
5016 shader_clock_khr = 5055,
5017 shader_enqueue_amdx = 5067,
5018 quad_control_khr = 5087,
5019 int4type_intel = 5112,
5020 int4cooperative_matrix_intel = 5114,
5021 b_float16type_khr = 5116,
5022 b_float16dot_product_khr = 5117,
5023 b_float16cooperative_matrix_khr = 5118,
5024 sample_mask_override_coverage_nv = 5249,
5025 geometry_shader_passthrough_nv = 5251,
5026 shader_viewport_index_layer_ext = 5254,
5027 shader_viewport_mask_nv = 5255,
5028 shader_stereo_view_nv = 5259,
5029 per_view_attributes_nv = 5260,
5030 fragment_fully_covered_ext = 5265,
5031 mesh_shading_nv = 5266,
5032 image_footprint_nv = 5282,
5033 mesh_shading_ext = 5283,
5034 fragment_barycentric_khr = 5284,
5035 compute_derivative_group_quads_khr = 5288,
5036 fragment_density_ext = 5291,
5037 group_non_uniform_partitioned_nv = 5297,
5038 shader_non_uniform = 5301,
5039 runtime_descriptor_array = 5302,
5040 input_attachment_array_dynamic_indexing = 5303,
5041 uniform_texel_buffer_array_dynamic_indexing = 5304,
5042 storage_texel_buffer_array_dynamic_indexing = 5305,
5043 uniform_buffer_array_non_uniform_indexing = 5306,
5044 sampled_image_array_non_uniform_indexing = 5307,
5045 storage_buffer_array_non_uniform_indexing = 5308,
5046 storage_image_array_non_uniform_indexing = 5309,
5047 input_attachment_array_non_uniform_indexing = 5310,
5048 uniform_texel_buffer_array_non_uniform_indexing = 5311,
5049 storage_texel_buffer_array_non_uniform_indexing = 5312,
5050 ray_tracing_position_fetch_khr = 5336,
5051 ray_tracing_nv = 5340,
5052 ray_tracing_motion_blur_nv = 5341,
5053 vulkan_memory_model = 5345,
5054 vulkan_memory_model_device_scope = 5346,
5055 physical_storage_buffer_addresses = 5347,
5056 compute_derivative_group_linear_khr = 5350,
5057 ray_tracing_provisional_khr = 5353,
5058 cooperative_matrix_nv = 5357,
5059 fragment_shader_sample_interlock_ext = 5363,
5060 fragment_shader_shading_rate_interlock_ext = 5372,
5061 shader_sm_builtins_nv = 5373,
5062 fragment_shader_pixel_interlock_ext = 5378,
5063 demote_to_helper_invocation = 5379,
5064 displacement_micromap_nv = 5380,
5065 ray_tracing_opacity_micromap_ext = 5381,
5066 shader_invocation_reorder_nv = 5383,
5067 bindless_texture_nv = 5390,
5068 ray_query_position_fetch_khr = 5391,
5069 cooperative_vector_nv = 5394,
5070 atomic_float16vector_nv = 5404,
5071 ray_tracing_displacement_micromap_nv = 5409,
5072 raw_access_chains_nv = 5414,
5073 ray_tracing_spheres_geometry_nv = 5418,
5074 ray_tracing_linear_swept_spheres_geometry_nv = 5419,
5075 cooperative_matrix_reductions_nv = 5430,
5076 cooperative_matrix_conversions_nv = 5431,
5077 cooperative_matrix_per_element_operations_nv = 5432,
5078 cooperative_matrix_tensor_addressing_nv = 5433,
5079 cooperative_matrix_block_loads_nv = 5434,
5080 cooperative_vector_training_nv = 5435,
5081 ray_tracing_cluster_acceleration_structure_nv = 5437,
5082 tensor_addressing_nv = 5439,
5083 subgroup_shuffle_intel = 5568,
5084 subgroup_buffer_block_iointel = 5569,
5085 subgroup_image_block_iointel = 5570,
5086 subgroup_image_media_block_iointel = 5579,
5087 round_to_infinity_intel = 5582,
5088 floating_point_mode_intel = 5583,
5089 integer_functions2intel = 5584,
5090 function_pointers_intel = 5603,
5091 indirect_references_intel = 5604,
5092 asm_intel = 5606,
5093 atomic_float32min_max_ext = 5612,
5094 atomic_float64min_max_ext = 5613,
5095 atomic_float16min_max_ext = 5616,
5096 vector_compute_intel = 5617,
5097 vector_any_intel = 5619,
5098 expect_assume_khr = 5629,
5099 subgroup_avc_motion_estimation_intel = 5696,
5100 subgroup_avc_motion_estimation_intra_intel = 5697,
5101 subgroup_avc_motion_estimation_chroma_intel = 5698,
5102 variable_length_array_intel = 5817,
5103 function_float_control_intel = 5821,
5104 fpga_memory_attributes_intel = 5824,
5105 fp_fast_math_mode_intel = 5837,
5106 arbitrary_precision_integers_intel = 5844,
5107 arbitrary_precision_floating_point_intel = 5845,
5108 unstructured_loop_controls_intel = 5886,
5109 fpga_loop_controls_intel = 5888,
5110 kernel_attributes_intel = 5892,
5111 fpga_kernel_attributes_intel = 5897,
5112 fpga_memory_accesses_intel = 5898,
5113 fpga_cluster_attributes_intel = 5904,
5114 loop_fuse_intel = 5906,
5115 fpgadsp_control_intel = 5908,
5116 memory_access_aliasing_intel = 5910,
5117 fpga_invocation_pipelining_attributes_intel = 5916,
5118 fpga_buffer_location_intel = 5920,
5119 arbitrary_precision_fixed_point_intel = 5922,
5120 usm_storage_classes_intel = 5935,
5121 runtime_aligned_attribute_intel = 5939,
5122 io_pipes_intel = 5943,
5123 blocking_pipes_intel = 5945,
5124 fpga_reg_intel = 5948,
5125 dot_product_input_all = 6016,
5126 dot_product_input4x8bit = 6017,
5127 dot_product_input4x8bit_packed = 6018,
5128 dot_product = 6019,
5129 ray_cull_mask_khr = 6020,
5130 cooperative_matrix_khr = 6022,
5131 replicated_composites_ext = 6024,
5132 bit_instructions = 6025,
5133 group_non_uniform_rotate_khr = 6026,
5134 float_controls2 = 6029,
5135 atomic_float32add_ext = 6033,
5136 atomic_float64add_ext = 6034,
5137 long_composites_intel = 6089,
5138 opt_none_ext = 6094,
5139 atomic_float16add_ext = 6095,
5140 debug_info_module_intel = 6114,
5141 b_float16conversion_intel = 6115,
5142 split_barrier_intel = 6141,
5143 arithmetic_fence_ext = 6144,
5144 fpga_cluster_attributes_v2intel = 6150,
5145 fpga_kernel_attributesv2intel = 6161,
5146 task_sequence_intel = 6162,
5147 fp_max_error_intel = 6169,
5148 fpga_latency_control_intel = 6171,
5149 fpga_argument_interfaces_intel = 6174,
5150 global_variable_host_access_intel = 6187,
5151 global_variable_fpga_decorations_intel = 6189,
5152 subgroup_buffer_prefetch_intel = 6220,
5153 subgroup2d_block_iointel = 6228,
5154 subgroup2d_block_transform_intel = 6229,
5155 subgroup2d_block_transpose_intel = 6230,
5156 subgroup_matrix_multiply_accumulate_intel = 6236,
5157 ternary_bitwise_function_intel = 6241,
5158 group_uniform_arithmetic_khr = 6400,
5159 tensor_float32rounding_intel = 6425,
5160 masked_gather_scatter_intel = 6427,
5161 cache_controls_intel = 6441,
5162 register_limits_intel = 6460,
5163 bindless_images_intel = 6528,
5164};
5165pub const RayQueryIntersection = enum(u32) {
5166 ray_query_candidate_intersection_khr = 0,
5167 ray_query_committed_intersection_khr = 1,
5168};
5169pub const RayQueryCommittedIntersectionType = enum(u32) {
5170 ray_query_committed_intersection_none_khr = 0,
5171 ray_query_committed_intersection_triangle_khr = 1,
5172 ray_query_committed_intersection_generated_khr = 2,
5173};
5174pub const RayQueryCandidateIntersectionType = enum(u32) {
5175 ray_query_candidate_intersection_triangle_khr = 0,
5176 ray_query_candidate_intersection_aabbkhr = 1,
5177};
5178pub const PackedVectorFormat = enum(u32) {
5179 packed_vector_format4x8bit = 0,
5180};
5181pub const CooperativeMatrixOperands = packed struct {
5182 matrix_a_signed_components_khr: bool = false,
5183 matrix_b_signed_components_khr: bool = false,
5184 matrix_c_signed_components_khr: bool = false,
5185 matrix_result_signed_components_khr: bool = false,
5186 saturating_accumulation_khr: bool = false,
5187 _reserved_bit_5: bool = false,
5188 _reserved_bit_6: bool = false,
5189 _reserved_bit_7: bool = false,
5190 _reserved_bit_8: bool = false,
5191 _reserved_bit_9: bool = false,
5192 _reserved_bit_10: bool = false,
5193 _reserved_bit_11: bool = false,
5194 _reserved_bit_12: bool = false,
5195 _reserved_bit_13: bool = false,
5196 _reserved_bit_14: bool = false,
5197 _reserved_bit_15: bool = false,
5198 _reserved_bit_16: bool = false,
5199 _reserved_bit_17: bool = false,
5200 _reserved_bit_18: bool = false,
5201 _reserved_bit_19: bool = false,
5202 _reserved_bit_20: bool = false,
5203 _reserved_bit_21: bool = false,
5204 _reserved_bit_22: bool = false,
5205 _reserved_bit_23: bool = false,
5206 _reserved_bit_24: bool = false,
5207 _reserved_bit_25: bool = false,
5208 _reserved_bit_26: bool = false,
5209 _reserved_bit_27: bool = false,
5210 _reserved_bit_28: bool = false,
5211 _reserved_bit_29: bool = false,
5212 _reserved_bit_30: bool = false,
5213 _reserved_bit_31: bool = false,
5214};
5215pub const CooperativeMatrixLayout = enum(u32) {
5216 row_major_khr = 0,
5217 column_major_khr = 1,
5218 row_blocked_interleaved_arm = 4202,
5219 column_blocked_interleaved_arm = 4203,
5220};
5221pub const CooperativeMatrixUse = enum(u32) {
5222 matrix_akhr = 0,
5223 matrix_bkhr = 1,
5224 matrix_accumulator_khr = 2,
5225};
5226pub const CooperativeMatrixReduce = packed struct {
5227 row: bool = false,
5228 column: bool = false,
5229 @"2x2": bool = false,
5230 _reserved_bit_3: bool = false,
5231 _reserved_bit_4: bool = false,
5232 _reserved_bit_5: bool = false,
5233 _reserved_bit_6: bool = false,
5234 _reserved_bit_7: bool = false,
5235 _reserved_bit_8: bool = false,
5236 _reserved_bit_9: bool = false,
5237 _reserved_bit_10: bool = false,
5238 _reserved_bit_11: bool = false,
5239 _reserved_bit_12: bool = false,
5240 _reserved_bit_13: bool = false,
5241 _reserved_bit_14: bool = false,
5242 _reserved_bit_15: bool = false,
5243 _reserved_bit_16: bool = false,
5244 _reserved_bit_17: bool = false,
5245 _reserved_bit_18: bool = false,
5246 _reserved_bit_19: bool = false,
5247 _reserved_bit_20: bool = false,
5248 _reserved_bit_21: bool = false,
5249 _reserved_bit_22: bool = false,
5250 _reserved_bit_23: bool = false,
5251 _reserved_bit_24: bool = false,
5252 _reserved_bit_25: bool = false,
5253 _reserved_bit_26: bool = false,
5254 _reserved_bit_27: bool = false,
5255 _reserved_bit_28: bool = false,
5256 _reserved_bit_29: bool = false,
5257 _reserved_bit_30: bool = false,
5258 _reserved_bit_31: bool = false,
5259};
5260pub const TensorClampMode = enum(u32) {
5261 undefined = 0,
5262 constant = 1,
5263 clamp_to_edge = 2,
5264 repeat = 3,
5265 repeat_mirrored = 4,
5266};
5267pub const TensorAddressingOperands = packed struct {
5268 tensor_view: bool = false,
5269 decode_func: bool = false,
5270 _reserved_bit_2: bool = false,
5271 _reserved_bit_3: bool = false,
5272 _reserved_bit_4: bool = false,
5273 _reserved_bit_5: bool = false,
5274 _reserved_bit_6: bool = false,
5275 _reserved_bit_7: bool = false,
5276 _reserved_bit_8: bool = false,
5277 _reserved_bit_9: bool = false,
5278 _reserved_bit_10: bool = false,
5279 _reserved_bit_11: bool = false,
5280 _reserved_bit_12: bool = false,
5281 _reserved_bit_13: bool = false,
5282 _reserved_bit_14: bool = false,
5283 _reserved_bit_15: bool = false,
5284 _reserved_bit_16: bool = false,
5285 _reserved_bit_17: bool = false,
5286 _reserved_bit_18: bool = false,
5287 _reserved_bit_19: bool = false,
5288 _reserved_bit_20: bool = false,
5289 _reserved_bit_21: bool = false,
5290 _reserved_bit_22: bool = false,
5291 _reserved_bit_23: bool = false,
5292 _reserved_bit_24: bool = false,
5293 _reserved_bit_25: bool = false,
5294 _reserved_bit_26: bool = false,
5295 _reserved_bit_27: bool = false,
5296 _reserved_bit_28: bool = false,
5297 _reserved_bit_29: bool = false,
5298 _reserved_bit_30: bool = false,
5299 _reserved_bit_31: bool = false,
5300
5301 pub const Extended = struct {
5302 tensor_view: ?struct { id_ref: Id } = null,
5303 decode_func: ?struct { id_ref: Id } = null,
5304 _reserved_bit_2: bool = false,
5305 _reserved_bit_3: bool = false,
5306 _reserved_bit_4: bool = false,
5307 _reserved_bit_5: bool = false,
5308 _reserved_bit_6: bool = false,
5309 _reserved_bit_7: bool = false,
5310 _reserved_bit_8: bool = false,
5311 _reserved_bit_9: bool = false,
5312 _reserved_bit_10: bool = false,
5313 _reserved_bit_11: bool = false,
5314 _reserved_bit_12: bool = false,
5315 _reserved_bit_13: bool = false,
5316 _reserved_bit_14: bool = false,
5317 _reserved_bit_15: bool = false,
5318 _reserved_bit_16: bool = false,
5319 _reserved_bit_17: bool = false,
5320 _reserved_bit_18: bool = false,
5321 _reserved_bit_19: bool = false,
5322 _reserved_bit_20: bool = false,
5323 _reserved_bit_21: bool = false,
5324 _reserved_bit_22: bool = false,
5325 _reserved_bit_23: bool = false,
5326 _reserved_bit_24: bool = false,
5327 _reserved_bit_25: bool = false,
5328 _reserved_bit_26: bool = false,
5329 _reserved_bit_27: bool = false,
5330 _reserved_bit_28: bool = false,
5331 _reserved_bit_29: bool = false,
5332 _reserved_bit_30: bool = false,
5333 _reserved_bit_31: bool = false,
5334 };
5335};
5336pub const InitializationModeQualifier = enum(u32) {
5337 init_on_device_reprogram_intel = 0,
5338 init_on_device_reset_intel = 1,
5339};
5340pub const LoadCacheControl = enum(u32) {
5341 uncached_intel = 0,
5342 cached_intel = 1,
5343 streaming_intel = 2,
5344 invalidate_after_read_intel = 3,
5345 const_cached_intel = 4,
5346};
5347pub const StoreCacheControl = enum(u32) {
5348 uncached_intel = 0,
5349 write_through_intel = 1,
5350 write_back_intel = 2,
5351 streaming_intel = 3,
5352};
5353pub const NamedMaximumNumberOfRegisters = enum(u32) {
5354 auto_intel = 0,
5355};
5356pub const MatrixMultiplyAccumulateOperands = packed struct {
5357 matrix_a_signed_components_intel: bool = false,
5358 matrix_b_signed_components_intel: bool = false,
5359 matrix_cb_float16intel: bool = false,
5360 matrix_result_b_float16intel: bool = false,
5361 matrix_a_packed_int8intel: bool = false,
5362 matrix_b_packed_int8intel: bool = false,
5363 matrix_a_packed_int4intel: bool = false,
5364 matrix_b_packed_int4intel: bool = false,
5365 matrix_atf32intel: bool = false,
5366 matrix_btf32intel: bool = false,
5367 matrix_a_packed_float16intel: bool = false,
5368 matrix_b_packed_float16intel: bool = false,
5369 matrix_a_packed_b_float16intel: bool = false,
5370 matrix_b_packed_b_float16intel: bool = false,
5371 _reserved_bit_14: bool = false,
5372 _reserved_bit_15: bool = false,
5373 _reserved_bit_16: bool = false,
5374 _reserved_bit_17: bool = false,
5375 _reserved_bit_18: bool = false,
5376 _reserved_bit_19: bool = false,
5377 _reserved_bit_20: bool = false,
5378 _reserved_bit_21: bool = false,
5379 _reserved_bit_22: bool = false,
5380 _reserved_bit_23: bool = false,
5381 _reserved_bit_24: bool = false,
5382 _reserved_bit_25: bool = false,
5383 _reserved_bit_26: bool = false,
5384 _reserved_bit_27: bool = false,
5385 _reserved_bit_28: bool = false,
5386 _reserved_bit_29: bool = false,
5387 _reserved_bit_30: bool = false,
5388 _reserved_bit_31: bool = false,
5389};
5390pub const FPEncoding = enum(u32) {
5391 b_float16khr = 0,
5392 float8e4m3ext = 4214,
5393 float8e5m2ext = 4215,
5394};
5395pub const CooperativeVectorMatrixLayout = enum(u32) {
5396 row_major_nv = 0,
5397 column_major_nv = 1,
5398 inferencing_optimal_nv = 2,
5399 training_optimal_nv = 3,
5400};
5401pub const ComponentType = enum(u32) {
5402 float16nv = 0,
5403 float32nv = 1,
5404 float64nv = 2,
5405 signed_int8nv = 3,
5406 signed_int16nv = 4,
5407 signed_int32nv = 5,
5408 signed_int64nv = 6,
5409 unsigned_int8nv = 7,
5410 unsigned_int16nv = 8,
5411 unsigned_int32nv = 9,
5412 unsigned_int64nv = 10,
5413 signed_int8packed_nv = 1000491000,
5414 unsigned_int8packed_nv = 1000491001,
5415 float_e4m3nv = 1000491002,
5416 float_e5m2nv = 1000491003,
5417};
5418pub const TensorOperands = packed struct {
5419 nontemporal_arm: bool = false,
5420 out_of_bounds_value_arm: bool = false,
5421 make_element_available_arm: bool = false,
5422 make_element_visible_arm: bool = false,
5423 non_private_element_arm: bool = false,
5424 _reserved_bit_5: bool = false,
5425 _reserved_bit_6: bool = false,
5426 _reserved_bit_7: bool = false,
5427 _reserved_bit_8: bool = false,
5428 _reserved_bit_9: bool = false,
5429 _reserved_bit_10: bool = false,
5430 _reserved_bit_11: bool = false,
5431 _reserved_bit_12: bool = false,
5432 _reserved_bit_13: bool = false,
5433 _reserved_bit_14: bool = false,
5434 _reserved_bit_15: bool = false,
5435 _reserved_bit_16: bool = false,
5436 _reserved_bit_17: bool = false,
5437 _reserved_bit_18: bool = false,
5438 _reserved_bit_19: bool = false,
5439 _reserved_bit_20: bool = false,
5440 _reserved_bit_21: bool = false,
5441 _reserved_bit_22: bool = false,
5442 _reserved_bit_23: bool = false,
5443 _reserved_bit_24: bool = false,
5444 _reserved_bit_25: bool = false,
5445 _reserved_bit_26: bool = false,
5446 _reserved_bit_27: bool = false,
5447 _reserved_bit_28: bool = false,
5448 _reserved_bit_29: bool = false,
5449 _reserved_bit_30: bool = false,
5450 _reserved_bit_31: bool = false,
5451
5452 pub const Extended = struct {
5453 nontemporal_arm: bool = false,
5454 out_of_bounds_value_arm: ?struct { id_ref: Id } = null,
5455 make_element_available_arm: ?struct { id_ref: Id } = null,
5456 make_element_visible_arm: ?struct { id_ref: Id } = null,
5457 non_private_element_arm: bool = false,
5458 _reserved_bit_5: bool = false,
5459 _reserved_bit_6: bool = false,
5460 _reserved_bit_7: bool = false,
5461 _reserved_bit_8: bool = false,
5462 _reserved_bit_9: bool = false,
5463 _reserved_bit_10: bool = false,
5464 _reserved_bit_11: bool = false,
5465 _reserved_bit_12: bool = false,
5466 _reserved_bit_13: bool = false,
5467 _reserved_bit_14: bool = false,
5468 _reserved_bit_15: bool = false,
5469 _reserved_bit_16: bool = false,
5470 _reserved_bit_17: bool = false,
5471 _reserved_bit_18: bool = false,
5472 _reserved_bit_19: bool = false,
5473 _reserved_bit_20: bool = false,
5474 _reserved_bit_21: bool = false,
5475 _reserved_bit_22: bool = false,
5476 _reserved_bit_23: bool = false,
5477 _reserved_bit_24: bool = false,
5478 _reserved_bit_25: bool = false,
5479 _reserved_bit_26: bool = false,
5480 _reserved_bit_27: bool = false,
5481 _reserved_bit_28: bool = false,
5482 _reserved_bit_29: bool = false,
5483 _reserved_bit_30: bool = false,
5484 _reserved_bit_31: bool = false,
5485 };
5486};
5487pub const @"DebugInfo.DebugInfoFlags" = packed struct {
5488 flag_is_protected: bool = false,
5489 flag_is_private: bool = false,
5490 flag_is_local: bool = false,
5491 flag_is_definition: bool = false,
5492 flag_fwd_decl: bool = false,
5493 flag_artificial: bool = false,
5494 flag_explicit: bool = false,
5495 flag_prototyped: bool = false,
5496 flag_object_pointer: bool = false,
5497 flag_static_member: bool = false,
5498 flag_indirect_variable: bool = false,
5499 flag_l_value_reference: bool = false,
5500 flag_r_value_reference: bool = false,
5501 flag_is_optimized: bool = false,
5502 _reserved_bit_14: bool = false,
5503 _reserved_bit_15: bool = false,
5504 _reserved_bit_16: bool = false,
5505 _reserved_bit_17: bool = false,
5506 _reserved_bit_18: bool = false,
5507 _reserved_bit_19: bool = false,
5508 _reserved_bit_20: bool = false,
5509 _reserved_bit_21: bool = false,
5510 _reserved_bit_22: bool = false,
5511 _reserved_bit_23: bool = false,
5512 _reserved_bit_24: bool = false,
5513 _reserved_bit_25: bool = false,
5514 _reserved_bit_26: bool = false,
5515 _reserved_bit_27: bool = false,
5516 _reserved_bit_28: bool = false,
5517 _reserved_bit_29: bool = false,
5518 _reserved_bit_30: bool = false,
5519 _reserved_bit_31: bool = false,
5520};
5521pub const @"DebugInfo.DebugBaseTypeAttributeEncoding" = enum(u32) {
5522 unspecified = 0,
5523 address = 1,
5524 boolean = 2,
5525 float = 4,
5526 signed = 5,
5527 signed_char = 6,
5528 unsigned = 7,
5529 unsigned_char = 8,
5530};
5531pub const @"DebugInfo.DebugCompositeType" = enum(u32) {
5532 class = 0,
5533 structure = 1,
5534 @"union" = 2,
5535};
5536pub const @"DebugInfo.DebugTypeQualifier" = enum(u32) {
5537 const_type = 0,
5538 volatile_type = 1,
5539 restrict_type = 2,
5540};
5541pub const @"DebugInfo.DebugOperation" = enum(u32) {
5542 deref = 0,
5543 plus = 1,
5544 minus = 2,
5545 plus_uconst = 3,
5546 bit_piece = 4,
5547 swap = 5,
5548 xderef = 6,
5549 stack_value = 7,
5550 constu = 8,
5551
5552 pub const Extended = union(@"DebugInfo.DebugOperation") {
5553 deref,
5554 plus,
5555 minus,
5556 plus_uconst: struct { literal_integer: LiteralInteger },
5557 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5558 swap,
5559 xderef,
5560 stack_value,
5561 constu: struct { literal_integer: LiteralInteger },
5562 };
5563};
5564pub const @"OpenCL.DebugInfo.100.DebugInfoFlags" = packed struct {
5565 flag_is_protected: bool = false,
5566 flag_is_private: bool = false,
5567 flag_is_local: bool = false,
5568 flag_is_definition: bool = false,
5569 flag_fwd_decl: bool = false,
5570 flag_artificial: bool = false,
5571 flag_explicit: bool = false,
5572 flag_prototyped: bool = false,
5573 flag_object_pointer: bool = false,
5574 flag_static_member: bool = false,
5575 flag_indirect_variable: bool = false,
5576 flag_l_value_reference: bool = false,
5577 flag_r_value_reference: bool = false,
5578 flag_is_optimized: bool = false,
5579 flag_is_enum_class: bool = false,
5580 flag_type_pass_by_value: bool = false,
5581 flag_type_pass_by_reference: bool = false,
5582 _reserved_bit_17: bool = false,
5583 _reserved_bit_18: bool = false,
5584 _reserved_bit_19: bool = false,
5585 _reserved_bit_20: bool = false,
5586 _reserved_bit_21: bool = false,
5587 _reserved_bit_22: bool = false,
5588 _reserved_bit_23: bool = false,
5589 _reserved_bit_24: bool = false,
5590 _reserved_bit_25: bool = false,
5591 _reserved_bit_26: bool = false,
5592 _reserved_bit_27: bool = false,
5593 _reserved_bit_28: bool = false,
5594 _reserved_bit_29: bool = false,
5595 _reserved_bit_30: bool = false,
5596 _reserved_bit_31: bool = false,
5597};
5598pub const @"OpenCL.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5599 unspecified = 0,
5600 address = 1,
5601 boolean = 2,
5602 float = 3,
5603 signed = 4,
5604 signed_char = 5,
5605 unsigned = 6,
5606 unsigned_char = 7,
5607};
5608pub const @"OpenCL.DebugInfo.100.DebugCompositeType" = enum(u32) {
5609 class = 0,
5610 structure = 1,
5611 @"union" = 2,
5612};
5613pub const @"OpenCL.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5614 const_type = 0,
5615 volatile_type = 1,
5616 restrict_type = 2,
5617 atomic_type = 3,
5618};
5619pub const @"OpenCL.DebugInfo.100.DebugOperation" = enum(u32) {
5620 deref = 0,
5621 plus = 1,
5622 minus = 2,
5623 plus_uconst = 3,
5624 bit_piece = 4,
5625 swap = 5,
5626 xderef = 6,
5627 stack_value = 7,
5628 constu = 8,
5629 fragment = 9,
5630
5631 pub const Extended = union(@"OpenCL.DebugInfo.100.DebugOperation") {
5632 deref,
5633 plus,
5634 minus,
5635 plus_uconst: struct { literal_integer: LiteralInteger },
5636 bit_piece: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5637 swap,
5638 xderef,
5639 stack_value,
5640 constu: struct { literal_integer: LiteralInteger },
5641 fragment: struct { literal_integer_0: LiteralInteger, literal_integer_1: LiteralInteger },
5642 };
5643};
5644pub const @"OpenCL.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5645 imported_module = 0,
5646 imported_declaration = 1,
5647};
5648pub const @"NonSemantic.ClspvReflection.6.KernelPropertyFlags" = packed struct {
5649 may_use_printf: bool = false,
5650 _reserved_bit_1: bool = false,
5651 _reserved_bit_2: bool = false,
5652 _reserved_bit_3: bool = false,
5653 _reserved_bit_4: bool = false,
5654 _reserved_bit_5: bool = false,
5655 _reserved_bit_6: bool = false,
5656 _reserved_bit_7: bool = false,
5657 _reserved_bit_8: bool = false,
5658 _reserved_bit_9: bool = false,
5659 _reserved_bit_10: bool = false,
5660 _reserved_bit_11: bool = false,
5661 _reserved_bit_12: bool = false,
5662 _reserved_bit_13: bool = false,
5663 _reserved_bit_14: bool = false,
5664 _reserved_bit_15: bool = false,
5665 _reserved_bit_16: bool = false,
5666 _reserved_bit_17: bool = false,
5667 _reserved_bit_18: bool = false,
5668 _reserved_bit_19: bool = false,
5669 _reserved_bit_20: bool = false,
5670 _reserved_bit_21: bool = false,
5671 _reserved_bit_22: bool = false,
5672 _reserved_bit_23: bool = false,
5673 _reserved_bit_24: bool = false,
5674 _reserved_bit_25: bool = false,
5675 _reserved_bit_26: bool = false,
5676 _reserved_bit_27: bool = false,
5677 _reserved_bit_28: bool = false,
5678 _reserved_bit_29: bool = false,
5679 _reserved_bit_30: bool = false,
5680 _reserved_bit_31: bool = false,
5681};
5682pub const @"NonSemantic.Shader.DebugInfo.100.DebugInfoFlags" = packed struct {
5683 flag_is_protected: bool = false,
5684 flag_is_private: bool = false,
5685 flag_is_local: bool = false,
5686 flag_is_definition: bool = false,
5687 flag_fwd_decl: bool = false,
5688 flag_artificial: bool = false,
5689 flag_explicit: bool = false,
5690 flag_prototyped: bool = false,
5691 flag_object_pointer: bool = false,
5692 flag_static_member: bool = false,
5693 flag_indirect_variable: bool = false,
5694 flag_l_value_reference: bool = false,
5695 flag_r_value_reference: bool = false,
5696 flag_is_optimized: bool = false,
5697 flag_is_enum_class: bool = false,
5698 flag_type_pass_by_value: bool = false,
5699 flag_type_pass_by_reference: bool = false,
5700 flag_unknown_physical_layout: bool = false,
5701 _reserved_bit_18: bool = false,
5702 _reserved_bit_19: bool = false,
5703 _reserved_bit_20: bool = false,
5704 _reserved_bit_21: bool = false,
5705 _reserved_bit_22: bool = false,
5706 _reserved_bit_23: bool = false,
5707 _reserved_bit_24: bool = false,
5708 _reserved_bit_25: bool = false,
5709 _reserved_bit_26: bool = false,
5710 _reserved_bit_27: bool = false,
5711 _reserved_bit_28: bool = false,
5712 _reserved_bit_29: bool = false,
5713 _reserved_bit_30: bool = false,
5714 _reserved_bit_31: bool = false,
5715};
5716pub const @"NonSemantic.Shader.DebugInfo.100.BuildIdentifierFlags" = packed struct {
5717 identifier_possible_duplicates: bool = false,
5718 _reserved_bit_1: bool = false,
5719 _reserved_bit_2: bool = false,
5720 _reserved_bit_3: bool = false,
5721 _reserved_bit_4: bool = false,
5722 _reserved_bit_5: bool = false,
5723 _reserved_bit_6: bool = false,
5724 _reserved_bit_7: bool = false,
5725 _reserved_bit_8: bool = false,
5726 _reserved_bit_9: bool = false,
5727 _reserved_bit_10: bool = false,
5728 _reserved_bit_11: bool = false,
5729 _reserved_bit_12: bool = false,
5730 _reserved_bit_13: bool = false,
5731 _reserved_bit_14: bool = false,
5732 _reserved_bit_15: bool = false,
5733 _reserved_bit_16: bool = false,
5734 _reserved_bit_17: bool = false,
5735 _reserved_bit_18: bool = false,
5736 _reserved_bit_19: bool = false,
5737 _reserved_bit_20: bool = false,
5738 _reserved_bit_21: bool = false,
5739 _reserved_bit_22: bool = false,
5740 _reserved_bit_23: bool = false,
5741 _reserved_bit_24: bool = false,
5742 _reserved_bit_25: bool = false,
5743 _reserved_bit_26: bool = false,
5744 _reserved_bit_27: bool = false,
5745 _reserved_bit_28: bool = false,
5746 _reserved_bit_29: bool = false,
5747 _reserved_bit_30: bool = false,
5748 _reserved_bit_31: bool = false,
5749};
5750pub const @"NonSemantic.Shader.DebugInfo.100.DebugBaseTypeAttributeEncoding" = enum(u32) {
5751 unspecified = 0,
5752 address = 1,
5753 boolean = 2,
5754 float = 3,
5755 signed = 4,
5756 signed_char = 5,
5757 unsigned = 6,
5758 unsigned_char = 7,
5759};
5760pub const @"NonSemantic.Shader.DebugInfo.100.DebugCompositeType" = enum(u32) {
5761 class = 0,
5762 structure = 1,
5763 @"union" = 2,
5764};
5765pub const @"NonSemantic.Shader.DebugInfo.100.DebugTypeQualifier" = enum(u32) {
5766 const_type = 0,
5767 volatile_type = 1,
5768 restrict_type = 2,
5769 atomic_type = 3,
5770};
5771pub const @"NonSemantic.Shader.DebugInfo.100.DebugOperation" = enum(u32) {
5772 deref = 0,
5773 plus = 1,
5774 minus = 2,
5775 plus_uconst = 3,
5776 bit_piece = 4,
5777 swap = 5,
5778 xderef = 6,
5779 stack_value = 7,
5780 constu = 8,
5781 fragment = 9,
5782
5783 pub const Extended = union(@"NonSemantic.Shader.DebugInfo.100.DebugOperation") {
5784 deref,
5785 plus,
5786 minus,
5787 plus_uconst: struct { id_ref: Id },
5788 bit_piece: struct { id_ref_0: Id, id_ref_1: Id },
5789 swap,
5790 xderef,
5791 stack_value,
5792 constu: struct { id_ref: Id },
5793 fragment: struct { id_ref_0: Id, id_ref_1: Id },
5794 };
5795};
5796pub const @"NonSemantic.Shader.DebugInfo.100.DebugImportedEntity" = enum(u32) {
5797 imported_module = 0,
5798 imported_declaration = 1,
5799};
5800pub const InstructionSet = enum {
5801 core,
5802 spv_amd_shader_trinary_minmax,
5803 spv_ext_inst_type_tosa_001000_1,
5804 non_semantic_vksp_reflection,
5805 spv_amd_shader_explicit_vertex_parameter,
5806 debug_info,
5807 non_semantic_debug_break,
5808 open_cl_debug_info_100,
5809 non_semantic_clspv_reflection_6,
5810 glsl_std_450,
5811 spv_amd_shader_ballot,
5812 non_semantic_debug_printf,
5813 spv_amd_gcn_shader,
5814 open_cl_std,
5815 non_semantic_shader_debug_info_100,
5816 zig,
5817
5818 pub fn instructions(self: InstructionSet) []const Instruction {
5819 return switch (self) {
5820 .core => &.{
5821 .{
5822 .name = "OpNop",
5823 .opcode = 0,
5824 .operands = &.{},
5825 },
5826 .{
5827 .name = "OpUndef",
5828 .opcode = 1,
5829 .operands = &.{
5830 .{ .kind = .id_result_type, .quantifier = .required },
5831 .{ .kind = .id_result, .quantifier = .required },
5832 },
5833 },
5834 .{
5835 .name = "OpSourceContinued",
5836 .opcode = 2,
5837 .operands = &.{
5838 .{ .kind = .literal_string, .quantifier = .required },
5839 },
5840 },
5841 .{
5842 .name = "OpSource",
5843 .opcode = 3,
5844 .operands = &.{
5845 .{ .kind = .source_language, .quantifier = .required },
5846 .{ .kind = .literal_integer, .quantifier = .required },
5847 .{ .kind = .id_ref, .quantifier = .optional },
5848 .{ .kind = .literal_string, .quantifier = .optional },
5849 },
5850 },
5851 .{
5852 .name = "OpSourceExtension",
5853 .opcode = 4,
5854 .operands = &.{
5855 .{ .kind = .literal_string, .quantifier = .required },
5856 },
5857 },
5858 .{
5859 .name = "OpName",
5860 .opcode = 5,
5861 .operands = &.{
5862 .{ .kind = .id_ref, .quantifier = .required },
5863 .{ .kind = .literal_string, .quantifier = .required },
5864 },
5865 },
5866 .{
5867 .name = "OpMemberName",
5868 .opcode = 6,
5869 .operands = &.{
5870 .{ .kind = .id_ref, .quantifier = .required },
5871 .{ .kind = .literal_integer, .quantifier = .required },
5872 .{ .kind = .literal_string, .quantifier = .required },
5873 },
5874 },
5875 .{
5876 .name = "OpString",
5877 .opcode = 7,
5878 .operands = &.{
5879 .{ .kind = .id_result, .quantifier = .required },
5880 .{ .kind = .literal_string, .quantifier = .required },
5881 },
5882 },
5883 .{
5884 .name = "OpLine",
5885 .opcode = 8,
5886 .operands = &.{
5887 .{ .kind = .id_ref, .quantifier = .required },
5888 .{ .kind = .literal_integer, .quantifier = .required },
5889 .{ .kind = .literal_integer, .quantifier = .required },
5890 },
5891 },
5892 .{
5893 .name = "OpExtension",
5894 .opcode = 10,
5895 .operands = &.{
5896 .{ .kind = .literal_string, .quantifier = .required },
5897 },
5898 },
5899 .{
5900 .name = "OpExtInstImport",
5901 .opcode = 11,
5902 .operands = &.{
5903 .{ .kind = .id_result, .quantifier = .required },
5904 .{ .kind = .literal_string, .quantifier = .required },
5905 },
5906 },
5907 .{
5908 .name = "OpExtInst",
5909 .opcode = 12,
5910 .operands = &.{
5911 .{ .kind = .id_result_type, .quantifier = .required },
5912 .{ .kind = .id_result, .quantifier = .required },
5913 .{ .kind = .id_ref, .quantifier = .required },
5914 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
5915 .{ .kind = .id_ref, .quantifier = .variadic },
5916 },
5917 },
5918 .{
5919 .name = "OpMemoryModel",
5920 .opcode = 14,
5921 .operands = &.{
5922 .{ .kind = .addressing_model, .quantifier = .required },
5923 .{ .kind = .memory_model, .quantifier = .required },
5924 },
5925 },
5926 .{
5927 .name = "OpEntryPoint",
5928 .opcode = 15,
5929 .operands = &.{
5930 .{ .kind = .execution_model, .quantifier = .required },
5931 .{ .kind = .id_ref, .quantifier = .required },
5932 .{ .kind = .literal_string, .quantifier = .required },
5933 .{ .kind = .id_ref, .quantifier = .variadic },
5934 },
5935 },
5936 .{
5937 .name = "OpExecutionMode",
5938 .opcode = 16,
5939 .operands = &.{
5940 .{ .kind = .id_ref, .quantifier = .required },
5941 .{ .kind = .execution_mode, .quantifier = .required },
5942 },
5943 },
5944 .{
5945 .name = "OpCapability",
5946 .opcode = 17,
5947 .operands = &.{
5948 .{ .kind = .capability, .quantifier = .required },
5949 },
5950 },
5951 .{
5952 .name = "OpTypeVoid",
5953 .opcode = 19,
5954 .operands = &.{
5955 .{ .kind = .id_result, .quantifier = .required },
5956 },
5957 },
5958 .{
5959 .name = "OpTypeBool",
5960 .opcode = 20,
5961 .operands = &.{
5962 .{ .kind = .id_result, .quantifier = .required },
5963 },
5964 },
5965 .{
5966 .name = "OpTypeInt",
5967 .opcode = 21,
5968 .operands = &.{
5969 .{ .kind = .id_result, .quantifier = .required },
5970 .{ .kind = .literal_integer, .quantifier = .required },
5971 .{ .kind = .literal_integer, .quantifier = .required },
5972 },
5973 },
5974 .{
5975 .name = "OpTypeFloat",
5976 .opcode = 22,
5977 .operands = &.{
5978 .{ .kind = .id_result, .quantifier = .required },
5979 .{ .kind = .literal_integer, .quantifier = .required },
5980 .{ .kind = .fp_encoding, .quantifier = .optional },
5981 },
5982 },
5983 .{
5984 .name = "OpTypeVector",
5985 .opcode = 23,
5986 .operands = &.{
5987 .{ .kind = .id_result, .quantifier = .required },
5988 .{ .kind = .id_ref, .quantifier = .required },
5989 .{ .kind = .literal_integer, .quantifier = .required },
5990 },
5991 },
5992 .{
5993 .name = "OpTypeMatrix",
5994 .opcode = 24,
5995 .operands = &.{
5996 .{ .kind = .id_result, .quantifier = .required },
5997 .{ .kind = .id_ref, .quantifier = .required },
5998 .{ .kind = .literal_integer, .quantifier = .required },
5999 },
6000 },
6001 .{
6002 .name = "OpTypeImage",
6003 .opcode = 25,
6004 .operands = &.{
6005 .{ .kind = .id_result, .quantifier = .required },
6006 .{ .kind = .id_ref, .quantifier = .required },
6007 .{ .kind = .dim, .quantifier = .required },
6008 .{ .kind = .literal_integer, .quantifier = .required },
6009 .{ .kind = .literal_integer, .quantifier = .required },
6010 .{ .kind = .literal_integer, .quantifier = .required },
6011 .{ .kind = .literal_integer, .quantifier = .required },
6012 .{ .kind = .image_format, .quantifier = .required },
6013 .{ .kind = .access_qualifier, .quantifier = .optional },
6014 },
6015 },
6016 .{
6017 .name = "OpTypeSampler",
6018 .opcode = 26,
6019 .operands = &.{
6020 .{ .kind = .id_result, .quantifier = .required },
6021 },
6022 },
6023 .{
6024 .name = "OpTypeSampledImage",
6025 .opcode = 27,
6026 .operands = &.{
6027 .{ .kind = .id_result, .quantifier = .required },
6028 .{ .kind = .id_ref, .quantifier = .required },
6029 },
6030 },
6031 .{
6032 .name = "OpTypeArray",
6033 .opcode = 28,
6034 .operands = &.{
6035 .{ .kind = .id_result, .quantifier = .required },
6036 .{ .kind = .id_ref, .quantifier = .required },
6037 .{ .kind = .id_ref, .quantifier = .required },
6038 },
6039 },
6040 .{
6041 .name = "OpTypeRuntimeArray",
6042 .opcode = 29,
6043 .operands = &.{
6044 .{ .kind = .id_result, .quantifier = .required },
6045 .{ .kind = .id_ref, .quantifier = .required },
6046 },
6047 },
6048 .{
6049 .name = "OpTypeStruct",
6050 .opcode = 30,
6051 .operands = &.{
6052 .{ .kind = .id_result, .quantifier = .required },
6053 .{ .kind = .id_ref, .quantifier = .variadic },
6054 },
6055 },
6056 .{
6057 .name = "OpTypeOpaque",
6058 .opcode = 31,
6059 .operands = &.{
6060 .{ .kind = .id_result, .quantifier = .required },
6061 .{ .kind = .literal_string, .quantifier = .required },
6062 },
6063 },
6064 .{
6065 .name = "OpTypePointer",
6066 .opcode = 32,
6067 .operands = &.{
6068 .{ .kind = .id_result, .quantifier = .required },
6069 .{ .kind = .storage_class, .quantifier = .required },
6070 .{ .kind = .id_ref, .quantifier = .required },
6071 },
6072 },
6073 .{
6074 .name = "OpTypeFunction",
6075 .opcode = 33,
6076 .operands = &.{
6077 .{ .kind = .id_result, .quantifier = .required },
6078 .{ .kind = .id_ref, .quantifier = .required },
6079 .{ .kind = .id_ref, .quantifier = .variadic },
6080 },
6081 },
6082 .{
6083 .name = "OpTypeEvent",
6084 .opcode = 34,
6085 .operands = &.{
6086 .{ .kind = .id_result, .quantifier = .required },
6087 },
6088 },
6089 .{
6090 .name = "OpTypeDeviceEvent",
6091 .opcode = 35,
6092 .operands = &.{
6093 .{ .kind = .id_result, .quantifier = .required },
6094 },
6095 },
6096 .{
6097 .name = "OpTypeReserveId",
6098 .opcode = 36,
6099 .operands = &.{
6100 .{ .kind = .id_result, .quantifier = .required },
6101 },
6102 },
6103 .{
6104 .name = "OpTypeQueue",
6105 .opcode = 37,
6106 .operands = &.{
6107 .{ .kind = .id_result, .quantifier = .required },
6108 },
6109 },
6110 .{
6111 .name = "OpTypePipe",
6112 .opcode = 38,
6113 .operands = &.{
6114 .{ .kind = .id_result, .quantifier = .required },
6115 .{ .kind = .access_qualifier, .quantifier = .required },
6116 },
6117 },
6118 .{
6119 .name = "OpTypeForwardPointer",
6120 .opcode = 39,
6121 .operands = &.{
6122 .{ .kind = .id_ref, .quantifier = .required },
6123 .{ .kind = .storage_class, .quantifier = .required },
6124 },
6125 },
6126 .{
6127 .name = "OpConstantTrue",
6128 .opcode = 41,
6129 .operands = &.{
6130 .{ .kind = .id_result_type, .quantifier = .required },
6131 .{ .kind = .id_result, .quantifier = .required },
6132 },
6133 },
6134 .{
6135 .name = "OpConstantFalse",
6136 .opcode = 42,
6137 .operands = &.{
6138 .{ .kind = .id_result_type, .quantifier = .required },
6139 .{ .kind = .id_result, .quantifier = .required },
6140 },
6141 },
6142 .{
6143 .name = "OpConstant",
6144 .opcode = 43,
6145 .operands = &.{
6146 .{ .kind = .id_result_type, .quantifier = .required },
6147 .{ .kind = .id_result, .quantifier = .required },
6148 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6149 },
6150 },
6151 .{
6152 .name = "OpConstantComposite",
6153 .opcode = 44,
6154 .operands = &.{
6155 .{ .kind = .id_result_type, .quantifier = .required },
6156 .{ .kind = .id_result, .quantifier = .required },
6157 .{ .kind = .id_ref, .quantifier = .variadic },
6158 },
6159 },
6160 .{
6161 .name = "OpConstantSampler",
6162 .opcode = 45,
6163 .operands = &.{
6164 .{ .kind = .id_result_type, .quantifier = .required },
6165 .{ .kind = .id_result, .quantifier = .required },
6166 .{ .kind = .sampler_addressing_mode, .quantifier = .required },
6167 .{ .kind = .literal_integer, .quantifier = .required },
6168 .{ .kind = .sampler_filter_mode, .quantifier = .required },
6169 },
6170 },
6171 .{
6172 .name = "OpConstantNull",
6173 .opcode = 46,
6174 .operands = &.{
6175 .{ .kind = .id_result_type, .quantifier = .required },
6176 .{ .kind = .id_result, .quantifier = .required },
6177 },
6178 },
6179 .{
6180 .name = "OpSpecConstantTrue",
6181 .opcode = 48,
6182 .operands = &.{
6183 .{ .kind = .id_result_type, .quantifier = .required },
6184 .{ .kind = .id_result, .quantifier = .required },
6185 },
6186 },
6187 .{
6188 .name = "OpSpecConstantFalse",
6189 .opcode = 49,
6190 .operands = &.{
6191 .{ .kind = .id_result_type, .quantifier = .required },
6192 .{ .kind = .id_result, .quantifier = .required },
6193 },
6194 },
6195 .{
6196 .name = "OpSpecConstant",
6197 .opcode = 50,
6198 .operands = &.{
6199 .{ .kind = .id_result_type, .quantifier = .required },
6200 .{ .kind = .id_result, .quantifier = .required },
6201 .{ .kind = .literal_context_dependent_number, .quantifier = .required },
6202 },
6203 },
6204 .{
6205 .name = "OpSpecConstantComposite",
6206 .opcode = 51,
6207 .operands = &.{
6208 .{ .kind = .id_result_type, .quantifier = .required },
6209 .{ .kind = .id_result, .quantifier = .required },
6210 .{ .kind = .id_ref, .quantifier = .variadic },
6211 },
6212 },
6213 .{
6214 .name = "OpSpecConstantOp",
6215 .opcode = 52,
6216 .operands = &.{
6217 .{ .kind = .id_result_type, .quantifier = .required },
6218 .{ .kind = .id_result, .quantifier = .required },
6219 .{ .kind = .literal_spec_constant_op_integer, .quantifier = .required },
6220 },
6221 },
6222 .{
6223 .name = "OpFunction",
6224 .opcode = 54,
6225 .operands = &.{
6226 .{ .kind = .id_result_type, .quantifier = .required },
6227 .{ .kind = .id_result, .quantifier = .required },
6228 .{ .kind = .function_control, .quantifier = .required },
6229 .{ .kind = .id_ref, .quantifier = .required },
6230 },
6231 },
6232 .{
6233 .name = "OpFunctionParameter",
6234 .opcode = 55,
6235 .operands = &.{
6236 .{ .kind = .id_result_type, .quantifier = .required },
6237 .{ .kind = .id_result, .quantifier = .required },
6238 },
6239 },
6240 .{
6241 .name = "OpFunctionEnd",
6242 .opcode = 56,
6243 .operands = &.{},
6244 },
6245 .{
6246 .name = "OpFunctionCall",
6247 .opcode = 57,
6248 .operands = &.{
6249 .{ .kind = .id_result_type, .quantifier = .required },
6250 .{ .kind = .id_result, .quantifier = .required },
6251 .{ .kind = .id_ref, .quantifier = .required },
6252 .{ .kind = .id_ref, .quantifier = .variadic },
6253 },
6254 },
6255 .{
6256 .name = "OpVariable",
6257 .opcode = 59,
6258 .operands = &.{
6259 .{ .kind = .id_result_type, .quantifier = .required },
6260 .{ .kind = .id_result, .quantifier = .required },
6261 .{ .kind = .storage_class, .quantifier = .required },
6262 .{ .kind = .id_ref, .quantifier = .optional },
6263 },
6264 },
6265 .{
6266 .name = "OpImageTexelPointer",
6267 .opcode = 60,
6268 .operands = &.{
6269 .{ .kind = .id_result_type, .quantifier = .required },
6270 .{ .kind = .id_result, .quantifier = .required },
6271 .{ .kind = .id_ref, .quantifier = .required },
6272 .{ .kind = .id_ref, .quantifier = .required },
6273 .{ .kind = .id_ref, .quantifier = .required },
6274 },
6275 },
6276 .{
6277 .name = "OpLoad",
6278 .opcode = 61,
6279 .operands = &.{
6280 .{ .kind = .id_result_type, .quantifier = .required },
6281 .{ .kind = .id_result, .quantifier = .required },
6282 .{ .kind = .id_ref, .quantifier = .required },
6283 .{ .kind = .memory_access, .quantifier = .optional },
6284 },
6285 },
6286 .{
6287 .name = "OpStore",
6288 .opcode = 62,
6289 .operands = &.{
6290 .{ .kind = .id_ref, .quantifier = .required },
6291 .{ .kind = .id_ref, .quantifier = .required },
6292 .{ .kind = .memory_access, .quantifier = .optional },
6293 },
6294 },
6295 .{
6296 .name = "OpCopyMemory",
6297 .opcode = 63,
6298 .operands = &.{
6299 .{ .kind = .id_ref, .quantifier = .required },
6300 .{ .kind = .id_ref, .quantifier = .required },
6301 .{ .kind = .memory_access, .quantifier = .optional },
6302 .{ .kind = .memory_access, .quantifier = .optional },
6303 },
6304 },
6305 .{
6306 .name = "OpCopyMemorySized",
6307 .opcode = 64,
6308 .operands = &.{
6309 .{ .kind = .id_ref, .quantifier = .required },
6310 .{ .kind = .id_ref, .quantifier = .required },
6311 .{ .kind = .id_ref, .quantifier = .required },
6312 .{ .kind = .memory_access, .quantifier = .optional },
6313 .{ .kind = .memory_access, .quantifier = .optional },
6314 },
6315 },
6316 .{
6317 .name = "OpAccessChain",
6318 .opcode = 65,
6319 .operands = &.{
6320 .{ .kind = .id_result_type, .quantifier = .required },
6321 .{ .kind = .id_result, .quantifier = .required },
6322 .{ .kind = .id_ref, .quantifier = .required },
6323 .{ .kind = .id_ref, .quantifier = .variadic },
6324 },
6325 },
6326 .{
6327 .name = "OpInBoundsAccessChain",
6328 .opcode = 66,
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 = "OpPtrAccessChain",
6338 .opcode = 67,
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 = .required },
6344 .{ .kind = .id_ref, .quantifier = .variadic },
6345 },
6346 },
6347 .{
6348 .name = "OpArrayLength",
6349 .opcode = 68,
6350 .operands = &.{
6351 .{ .kind = .id_result_type, .quantifier = .required },
6352 .{ .kind = .id_result, .quantifier = .required },
6353 .{ .kind = .id_ref, .quantifier = .required },
6354 .{ .kind = .literal_integer, .quantifier = .required },
6355 },
6356 },
6357 .{
6358 .name = "OpGenericPtrMemSemantics",
6359 .opcode = 69,
6360 .operands = &.{
6361 .{ .kind = .id_result_type, .quantifier = .required },
6362 .{ .kind = .id_result, .quantifier = .required },
6363 .{ .kind = .id_ref, .quantifier = .required },
6364 },
6365 },
6366 .{
6367 .name = "OpInBoundsPtrAccessChain",
6368 .opcode = 70,
6369 .operands = &.{
6370 .{ .kind = .id_result_type, .quantifier = .required },
6371 .{ .kind = .id_result, .quantifier = .required },
6372 .{ .kind = .id_ref, .quantifier = .required },
6373 .{ .kind = .id_ref, .quantifier = .required },
6374 .{ .kind = .id_ref, .quantifier = .variadic },
6375 },
6376 },
6377 .{
6378 .name = "OpDecorate",
6379 .opcode = 71,
6380 .operands = &.{
6381 .{ .kind = .id_ref, .quantifier = .required },
6382 .{ .kind = .decoration, .quantifier = .required },
6383 },
6384 },
6385 .{
6386 .name = "OpMemberDecorate",
6387 .opcode = 72,
6388 .operands = &.{
6389 .{ .kind = .id_ref, .quantifier = .required },
6390 .{ .kind = .literal_integer, .quantifier = .required },
6391 .{ .kind = .decoration, .quantifier = .required },
6392 },
6393 },
6394 .{
6395 .name = "OpDecorationGroup",
6396 .opcode = 73,
6397 .operands = &.{
6398 .{ .kind = .id_result, .quantifier = .required },
6399 },
6400 },
6401 .{
6402 .name = "OpGroupDecorate",
6403 .opcode = 74,
6404 .operands = &.{
6405 .{ .kind = .id_ref, .quantifier = .required },
6406 .{ .kind = .id_ref, .quantifier = .variadic },
6407 },
6408 },
6409 .{
6410 .name = "OpGroupMemberDecorate",
6411 .opcode = 75,
6412 .operands = &.{
6413 .{ .kind = .id_ref, .quantifier = .required },
6414 .{ .kind = .pair_id_ref_literal_integer, .quantifier = .variadic },
6415 },
6416 },
6417 .{
6418 .name = "OpVectorExtractDynamic",
6419 .opcode = 77,
6420 .operands = &.{
6421 .{ .kind = .id_result_type, .quantifier = .required },
6422 .{ .kind = .id_result, .quantifier = .required },
6423 .{ .kind = .id_ref, .quantifier = .required },
6424 .{ .kind = .id_ref, .quantifier = .required },
6425 },
6426 },
6427 .{
6428 .name = "OpVectorInsertDynamic",
6429 .opcode = 78,
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 .{ .kind = .id_ref, .quantifier = .required },
6436 },
6437 },
6438 .{
6439 .name = "OpVectorShuffle",
6440 .opcode = 79,
6441 .operands = &.{
6442 .{ .kind = .id_result_type, .quantifier = .required },
6443 .{ .kind = .id_result, .quantifier = .required },
6444 .{ .kind = .id_ref, .quantifier = .required },
6445 .{ .kind = .id_ref, .quantifier = .required },
6446 .{ .kind = .literal_integer, .quantifier = .variadic },
6447 },
6448 },
6449 .{
6450 .name = "OpCompositeConstruct",
6451 .opcode = 80,
6452 .operands = &.{
6453 .{ .kind = .id_result_type, .quantifier = .required },
6454 .{ .kind = .id_result, .quantifier = .required },
6455 .{ .kind = .id_ref, .quantifier = .variadic },
6456 },
6457 },
6458 .{
6459 .name = "OpCompositeExtract",
6460 .opcode = 81,
6461 .operands = &.{
6462 .{ .kind = .id_result_type, .quantifier = .required },
6463 .{ .kind = .id_result, .quantifier = .required },
6464 .{ .kind = .id_ref, .quantifier = .required },
6465 .{ .kind = .literal_integer, .quantifier = .variadic },
6466 },
6467 },
6468 .{
6469 .name = "OpCompositeInsert",
6470 .opcode = 82,
6471 .operands = &.{
6472 .{ .kind = .id_result_type, .quantifier = .required },
6473 .{ .kind = .id_result, .quantifier = .required },
6474 .{ .kind = .id_ref, .quantifier = .required },
6475 .{ .kind = .id_ref, .quantifier = .required },
6476 .{ .kind = .literal_integer, .quantifier = .variadic },
6477 },
6478 },
6479 .{
6480 .name = "OpCopyObject",
6481 .opcode = 83,
6482 .operands = &.{
6483 .{ .kind = .id_result_type, .quantifier = .required },
6484 .{ .kind = .id_result, .quantifier = .required },
6485 .{ .kind = .id_ref, .quantifier = .required },
6486 },
6487 },
6488 .{
6489 .name = "OpTranspose",
6490 .opcode = 84,
6491 .operands = &.{
6492 .{ .kind = .id_result_type, .quantifier = .required },
6493 .{ .kind = .id_result, .quantifier = .required },
6494 .{ .kind = .id_ref, .quantifier = .required },
6495 },
6496 },
6497 .{
6498 .name = "OpSampledImage",
6499 .opcode = 86,
6500 .operands = &.{
6501 .{ .kind = .id_result_type, .quantifier = .required },
6502 .{ .kind = .id_result, .quantifier = .required },
6503 .{ .kind = .id_ref, .quantifier = .required },
6504 .{ .kind = .id_ref, .quantifier = .required },
6505 },
6506 },
6507 .{
6508 .name = "OpImageSampleImplicitLod",
6509 .opcode = 87,
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 .{ .kind = .image_operands, .quantifier = .optional },
6516 },
6517 },
6518 .{
6519 .name = "OpImageSampleExplicitLod",
6520 .opcode = 88,
6521 .operands = &.{
6522 .{ .kind = .id_result_type, .quantifier = .required },
6523 .{ .kind = .id_result, .quantifier = .required },
6524 .{ .kind = .id_ref, .quantifier = .required },
6525 .{ .kind = .id_ref, .quantifier = .required },
6526 .{ .kind = .image_operands, .quantifier = .required },
6527 },
6528 },
6529 .{
6530 .name = "OpImageSampleDrefImplicitLod",
6531 .opcode = 89,
6532 .operands = &.{
6533 .{ .kind = .id_result_type, .quantifier = .required },
6534 .{ .kind = .id_result, .quantifier = .required },
6535 .{ .kind = .id_ref, .quantifier = .required },
6536 .{ .kind = .id_ref, .quantifier = .required },
6537 .{ .kind = .id_ref, .quantifier = .required },
6538 .{ .kind = .image_operands, .quantifier = .optional },
6539 },
6540 },
6541 .{
6542 .name = "OpImageSampleDrefExplicitLod",
6543 .opcode = 90,
6544 .operands = &.{
6545 .{ .kind = .id_result_type, .quantifier = .required },
6546 .{ .kind = .id_result, .quantifier = .required },
6547 .{ .kind = .id_ref, .quantifier = .required },
6548 .{ .kind = .id_ref, .quantifier = .required },
6549 .{ .kind = .id_ref, .quantifier = .required },
6550 .{ .kind = .image_operands, .quantifier = .required },
6551 },
6552 },
6553 .{
6554 .name = "OpImageSampleProjImplicitLod",
6555 .opcode = 91,
6556 .operands = &.{
6557 .{ .kind = .id_result_type, .quantifier = .required },
6558 .{ .kind = .id_result, .quantifier = .required },
6559 .{ .kind = .id_ref, .quantifier = .required },
6560 .{ .kind = .id_ref, .quantifier = .required },
6561 .{ .kind = .image_operands, .quantifier = .optional },
6562 },
6563 },
6564 .{
6565 .name = "OpImageSampleProjExplicitLod",
6566 .opcode = 92,
6567 .operands = &.{
6568 .{ .kind = .id_result_type, .quantifier = .required },
6569 .{ .kind = .id_result, .quantifier = .required },
6570 .{ .kind = .id_ref, .quantifier = .required },
6571 .{ .kind = .id_ref, .quantifier = .required },
6572 .{ .kind = .image_operands, .quantifier = .required },
6573 },
6574 },
6575 .{
6576 .name = "OpImageSampleProjDrefImplicitLod",
6577 .opcode = 93,
6578 .operands = &.{
6579 .{ .kind = .id_result_type, .quantifier = .required },
6580 .{ .kind = .id_result, .quantifier = .required },
6581 .{ .kind = .id_ref, .quantifier = .required },
6582 .{ .kind = .id_ref, .quantifier = .required },
6583 .{ .kind = .id_ref, .quantifier = .required },
6584 .{ .kind = .image_operands, .quantifier = .optional },
6585 },
6586 },
6587 .{
6588 .name = "OpImageSampleProjDrefExplicitLod",
6589 .opcode = 94,
6590 .operands = &.{
6591 .{ .kind = .id_result_type, .quantifier = .required },
6592 .{ .kind = .id_result, .quantifier = .required },
6593 .{ .kind = .id_ref, .quantifier = .required },
6594 .{ .kind = .id_ref, .quantifier = .required },
6595 .{ .kind = .id_ref, .quantifier = .required },
6596 .{ .kind = .image_operands, .quantifier = .required },
6597 },
6598 },
6599 .{
6600 .name = "OpImageFetch",
6601 .opcode = 95,
6602 .operands = &.{
6603 .{ .kind = .id_result_type, .quantifier = .required },
6604 .{ .kind = .id_result, .quantifier = .required },
6605 .{ .kind = .id_ref, .quantifier = .required },
6606 .{ .kind = .id_ref, .quantifier = .required },
6607 .{ .kind = .image_operands, .quantifier = .optional },
6608 },
6609 },
6610 .{
6611 .name = "OpImageGather",
6612 .opcode = 96,
6613 .operands = &.{
6614 .{ .kind = .id_result_type, .quantifier = .required },
6615 .{ .kind = .id_result, .quantifier = .required },
6616 .{ .kind = .id_ref, .quantifier = .required },
6617 .{ .kind = .id_ref, .quantifier = .required },
6618 .{ .kind = .id_ref, .quantifier = .required },
6619 .{ .kind = .image_operands, .quantifier = .optional },
6620 },
6621 },
6622 .{
6623 .name = "OpImageDrefGather",
6624 .opcode = 97,
6625 .operands = &.{
6626 .{ .kind = .id_result_type, .quantifier = .required },
6627 .{ .kind = .id_result, .quantifier = .required },
6628 .{ .kind = .id_ref, .quantifier = .required },
6629 .{ .kind = .id_ref, .quantifier = .required },
6630 .{ .kind = .id_ref, .quantifier = .required },
6631 .{ .kind = .image_operands, .quantifier = .optional },
6632 },
6633 },
6634 .{
6635 .name = "OpImageRead",
6636 .opcode = 98,
6637 .operands = &.{
6638 .{ .kind = .id_result_type, .quantifier = .required },
6639 .{ .kind = .id_result, .quantifier = .required },
6640 .{ .kind = .id_ref, .quantifier = .required },
6641 .{ .kind = .id_ref, .quantifier = .required },
6642 .{ .kind = .image_operands, .quantifier = .optional },
6643 },
6644 },
6645 .{
6646 .name = "OpImageWrite",
6647 .opcode = 99,
6648 .operands = &.{
6649 .{ .kind = .id_ref, .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 = "OpImage",
6657 .opcode = 100,
6658 .operands = &.{
6659 .{ .kind = .id_result_type, .quantifier = .required },
6660 .{ .kind = .id_result, .quantifier = .required },
6661 .{ .kind = .id_ref, .quantifier = .required },
6662 },
6663 },
6664 .{
6665 .name = "OpImageQueryFormat",
6666 .opcode = 101,
6667 .operands = &.{
6668 .{ .kind = .id_result_type, .quantifier = .required },
6669 .{ .kind = .id_result, .quantifier = .required },
6670 .{ .kind = .id_ref, .quantifier = .required },
6671 },
6672 },
6673 .{
6674 .name = "OpImageQueryOrder",
6675 .opcode = 102,
6676 .operands = &.{
6677 .{ .kind = .id_result_type, .quantifier = .required },
6678 .{ .kind = .id_result, .quantifier = .required },
6679 .{ .kind = .id_ref, .quantifier = .required },
6680 },
6681 },
6682 .{
6683 .name = "OpImageQuerySizeLod",
6684 .opcode = 103,
6685 .operands = &.{
6686 .{ .kind = .id_result_type, .quantifier = .required },
6687 .{ .kind = .id_result, .quantifier = .required },
6688 .{ .kind = .id_ref, .quantifier = .required },
6689 .{ .kind = .id_ref, .quantifier = .required },
6690 },
6691 },
6692 .{
6693 .name = "OpImageQuerySize",
6694 .opcode = 104,
6695 .operands = &.{
6696 .{ .kind = .id_result_type, .quantifier = .required },
6697 .{ .kind = .id_result, .quantifier = .required },
6698 .{ .kind = .id_ref, .quantifier = .required },
6699 },
6700 },
6701 .{
6702 .name = "OpImageQueryLod",
6703 .opcode = 105,
6704 .operands = &.{
6705 .{ .kind = .id_result_type, .quantifier = .required },
6706 .{ .kind = .id_result, .quantifier = .required },
6707 .{ .kind = .id_ref, .quantifier = .required },
6708 .{ .kind = .id_ref, .quantifier = .required },
6709 },
6710 },
6711 .{
6712 .name = "OpImageQueryLevels",
6713 .opcode = 106,
6714 .operands = &.{
6715 .{ .kind = .id_result_type, .quantifier = .required },
6716 .{ .kind = .id_result, .quantifier = .required },
6717 .{ .kind = .id_ref, .quantifier = .required },
6718 },
6719 },
6720 .{
6721 .name = "OpImageQuerySamples",
6722 .opcode = 107,
6723 .operands = &.{
6724 .{ .kind = .id_result_type, .quantifier = .required },
6725 .{ .kind = .id_result, .quantifier = .required },
6726 .{ .kind = .id_ref, .quantifier = .required },
6727 },
6728 },
6729 .{
6730 .name = "OpConvertFToU",
6731 .opcode = 109,
6732 .operands = &.{
6733 .{ .kind = .id_result_type, .quantifier = .required },
6734 .{ .kind = .id_result, .quantifier = .required },
6735 .{ .kind = .id_ref, .quantifier = .required },
6736 },
6737 },
6738 .{
6739 .name = "OpConvertFToS",
6740 .opcode = 110,
6741 .operands = &.{
6742 .{ .kind = .id_result_type, .quantifier = .required },
6743 .{ .kind = .id_result, .quantifier = .required },
6744 .{ .kind = .id_ref, .quantifier = .required },
6745 },
6746 },
6747 .{
6748 .name = "OpConvertSToF",
6749 .opcode = 111,
6750 .operands = &.{
6751 .{ .kind = .id_result_type, .quantifier = .required },
6752 .{ .kind = .id_result, .quantifier = .required },
6753 .{ .kind = .id_ref, .quantifier = .required },
6754 },
6755 },
6756 .{
6757 .name = "OpConvertUToF",
6758 .opcode = 112,
6759 .operands = &.{
6760 .{ .kind = .id_result_type, .quantifier = .required },
6761 .{ .kind = .id_result, .quantifier = .required },
6762 .{ .kind = .id_ref, .quantifier = .required },
6763 },
6764 },
6765 .{
6766 .name = "OpUConvert",
6767 .opcode = 113,
6768 .operands = &.{
6769 .{ .kind = .id_result_type, .quantifier = .required },
6770 .{ .kind = .id_result, .quantifier = .required },
6771 .{ .kind = .id_ref, .quantifier = .required },
6772 },
6773 },
6774 .{
6775 .name = "OpSConvert",
6776 .opcode = 114,
6777 .operands = &.{
6778 .{ .kind = .id_result_type, .quantifier = .required },
6779 .{ .kind = .id_result, .quantifier = .required },
6780 .{ .kind = .id_ref, .quantifier = .required },
6781 },
6782 },
6783 .{
6784 .name = "OpFConvert",
6785 .opcode = 115,
6786 .operands = &.{
6787 .{ .kind = .id_result_type, .quantifier = .required },
6788 .{ .kind = .id_result, .quantifier = .required },
6789 .{ .kind = .id_ref, .quantifier = .required },
6790 },
6791 },
6792 .{
6793 .name = "OpQuantizeToF16",
6794 .opcode = 116,
6795 .operands = &.{
6796 .{ .kind = .id_result_type, .quantifier = .required },
6797 .{ .kind = .id_result, .quantifier = .required },
6798 .{ .kind = .id_ref, .quantifier = .required },
6799 },
6800 },
6801 .{
6802 .name = "OpConvertPtrToU",
6803 .opcode = 117,
6804 .operands = &.{
6805 .{ .kind = .id_result_type, .quantifier = .required },
6806 .{ .kind = .id_result, .quantifier = .required },
6807 .{ .kind = .id_ref, .quantifier = .required },
6808 },
6809 },
6810 .{
6811 .name = "OpSatConvertSToU",
6812 .opcode = 118,
6813 .operands = &.{
6814 .{ .kind = .id_result_type, .quantifier = .required },
6815 .{ .kind = .id_result, .quantifier = .required },
6816 .{ .kind = .id_ref, .quantifier = .required },
6817 },
6818 },
6819 .{
6820 .name = "OpSatConvertUToS",
6821 .opcode = 119,
6822 .operands = &.{
6823 .{ .kind = .id_result_type, .quantifier = .required },
6824 .{ .kind = .id_result, .quantifier = .required },
6825 .{ .kind = .id_ref, .quantifier = .required },
6826 },
6827 },
6828 .{
6829 .name = "OpConvertUToPtr",
6830 .opcode = 120,
6831 .operands = &.{
6832 .{ .kind = .id_result_type, .quantifier = .required },
6833 .{ .kind = .id_result, .quantifier = .required },
6834 .{ .kind = .id_ref, .quantifier = .required },
6835 },
6836 },
6837 .{
6838 .name = "OpPtrCastToGeneric",
6839 .opcode = 121,
6840 .operands = &.{
6841 .{ .kind = .id_result_type, .quantifier = .required },
6842 .{ .kind = .id_result, .quantifier = .required },
6843 .{ .kind = .id_ref, .quantifier = .required },
6844 },
6845 },
6846 .{
6847 .name = "OpGenericCastToPtr",
6848 .opcode = 122,
6849 .operands = &.{
6850 .{ .kind = .id_result_type, .quantifier = .required },
6851 .{ .kind = .id_result, .quantifier = .required },
6852 .{ .kind = .id_ref, .quantifier = .required },
6853 },
6854 },
6855 .{
6856 .name = "OpGenericCastToPtrExplicit",
6857 .opcode = 123,
6858 .operands = &.{
6859 .{ .kind = .id_result_type, .quantifier = .required },
6860 .{ .kind = .id_result, .quantifier = .required },
6861 .{ .kind = .id_ref, .quantifier = .required },
6862 .{ .kind = .storage_class, .quantifier = .required },
6863 },
6864 },
6865 .{
6866 .name = "OpBitcast",
6867 .opcode = 124,
6868 .operands = &.{
6869 .{ .kind = .id_result_type, .quantifier = .required },
6870 .{ .kind = .id_result, .quantifier = .required },
6871 .{ .kind = .id_ref, .quantifier = .required },
6872 },
6873 },
6874 .{
6875 .name = "OpSNegate",
6876 .opcode = 126,
6877 .operands = &.{
6878 .{ .kind = .id_result_type, .quantifier = .required },
6879 .{ .kind = .id_result, .quantifier = .required },
6880 .{ .kind = .id_ref, .quantifier = .required },
6881 },
6882 },
6883 .{
6884 .name = "OpFNegate",
6885 .opcode = 127,
6886 .operands = &.{
6887 .{ .kind = .id_result_type, .quantifier = .required },
6888 .{ .kind = .id_result, .quantifier = .required },
6889 .{ .kind = .id_ref, .quantifier = .required },
6890 },
6891 },
6892 .{
6893 .name = "OpIAdd",
6894 .opcode = 128,
6895 .operands = &.{
6896 .{ .kind = .id_result_type, .quantifier = .required },
6897 .{ .kind = .id_result, .quantifier = .required },
6898 .{ .kind = .id_ref, .quantifier = .required },
6899 .{ .kind = .id_ref, .quantifier = .required },
6900 },
6901 },
6902 .{
6903 .name = "OpFAdd",
6904 .opcode = 129,
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 = "OpISub",
6914 .opcode = 130,
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 = "OpFSub",
6924 .opcode = 131,
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 = "OpIMul",
6934 .opcode = 132,
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 = "OpFMul",
6944 .opcode = 133,
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 = "OpUDiv",
6954 .opcode = 134,
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 = "OpSDiv",
6964 .opcode = 135,
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 = "OpFDiv",
6974 .opcode = 136,
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 = "OpUMod",
6984 .opcode = 137,
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 = "OpSRem",
6994 .opcode = 138,
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 = "OpSMod",
7004 .opcode = 139,
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 = "OpFRem",
7014 .opcode = 140,
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 = "OpFMod",
7024 .opcode = 141,
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 = "OpVectorTimesScalar",
7034 .opcode = 142,
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 = "OpMatrixTimesScalar",
7044 .opcode = 143,
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 = "OpVectorTimesMatrix",
7054 .opcode = 144,
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 = "OpMatrixTimesVector",
7064 .opcode = 145,
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 = "OpMatrixTimesMatrix",
7074 .opcode = 146,
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 = "OpOuterProduct",
7084 .opcode = 147,
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 = "OpDot",
7094 .opcode = 148,
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 = "OpIAddCarry",
7104 .opcode = 149,
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 = "OpISubBorrow",
7114 .opcode = 150,
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 = "OpUMulExtended",
7124 .opcode = 151,
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 = "OpSMulExtended",
7134 .opcode = 152,
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 = "OpAny",
7144 .opcode = 154,
7145 .operands = &.{
7146 .{ .kind = .id_result_type, .quantifier = .required },
7147 .{ .kind = .id_result, .quantifier = .required },
7148 .{ .kind = .id_ref, .quantifier = .required },
7149 },
7150 },
7151 .{
7152 .name = "OpAll",
7153 .opcode = 155,
7154 .operands = &.{
7155 .{ .kind = .id_result_type, .quantifier = .required },
7156 .{ .kind = .id_result, .quantifier = .required },
7157 .{ .kind = .id_ref, .quantifier = .required },
7158 },
7159 },
7160 .{
7161 .name = "OpIsNan",
7162 .opcode = 156,
7163 .operands = &.{
7164 .{ .kind = .id_result_type, .quantifier = .required },
7165 .{ .kind = .id_result, .quantifier = .required },
7166 .{ .kind = .id_ref, .quantifier = .required },
7167 },
7168 },
7169 .{
7170 .name = "OpIsInf",
7171 .opcode = 157,
7172 .operands = &.{
7173 .{ .kind = .id_result_type, .quantifier = .required },
7174 .{ .kind = .id_result, .quantifier = .required },
7175 .{ .kind = .id_ref, .quantifier = .required },
7176 },
7177 },
7178 .{
7179 .name = "OpIsFinite",
7180 .opcode = 158,
7181 .operands = &.{
7182 .{ .kind = .id_result_type, .quantifier = .required },
7183 .{ .kind = .id_result, .quantifier = .required },
7184 .{ .kind = .id_ref, .quantifier = .required },
7185 },
7186 },
7187 .{
7188 .name = "OpIsNormal",
7189 .opcode = 159,
7190 .operands = &.{
7191 .{ .kind = .id_result_type, .quantifier = .required },
7192 .{ .kind = .id_result, .quantifier = .required },
7193 .{ .kind = .id_ref, .quantifier = .required },
7194 },
7195 },
7196 .{
7197 .name = "OpSignBitSet",
7198 .opcode = 160,
7199 .operands = &.{
7200 .{ .kind = .id_result_type, .quantifier = .required },
7201 .{ .kind = .id_result, .quantifier = .required },
7202 .{ .kind = .id_ref, .quantifier = .required },
7203 },
7204 },
7205 .{
7206 .name = "OpLessOrGreater",
7207 .opcode = 161,
7208 .operands = &.{
7209 .{ .kind = .id_result_type, .quantifier = .required },
7210 .{ .kind = .id_result, .quantifier = .required },
7211 .{ .kind = .id_ref, .quantifier = .required },
7212 .{ .kind = .id_ref, .quantifier = .required },
7213 },
7214 },
7215 .{
7216 .name = "OpOrdered",
7217 .opcode = 162,
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 = "OpUnordered",
7227 .opcode = 163,
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 = "OpLogicalEqual",
7237 .opcode = 164,
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 = "OpLogicalNotEqual",
7247 .opcode = 165,
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 = "OpLogicalOr",
7257 .opcode = 166,
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 = "OpLogicalAnd",
7267 .opcode = 167,
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 = "OpLogicalNot",
7277 .opcode = 168,
7278 .operands = &.{
7279 .{ .kind = .id_result_type, .quantifier = .required },
7280 .{ .kind = .id_result, .quantifier = .required },
7281 .{ .kind = .id_ref, .quantifier = .required },
7282 },
7283 },
7284 .{
7285 .name = "OpSelect",
7286 .opcode = 169,
7287 .operands = &.{
7288 .{ .kind = .id_result_type, .quantifier = .required },
7289 .{ .kind = .id_result, .quantifier = .required },
7290 .{ .kind = .id_ref, .quantifier = .required },
7291 .{ .kind = .id_ref, .quantifier = .required },
7292 .{ .kind = .id_ref, .quantifier = .required },
7293 },
7294 },
7295 .{
7296 .name = "OpIEqual",
7297 .opcode = 170,
7298 .operands = &.{
7299 .{ .kind = .id_result_type, .quantifier = .required },
7300 .{ .kind = .id_result, .quantifier = .required },
7301 .{ .kind = .id_ref, .quantifier = .required },
7302 .{ .kind = .id_ref, .quantifier = .required },
7303 },
7304 },
7305 .{
7306 .name = "OpINotEqual",
7307 .opcode = 171,
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 = "OpUGreaterThan",
7317 .opcode = 172,
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 = "OpSGreaterThan",
7327 .opcode = 173,
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 = "OpUGreaterThanEqual",
7337 .opcode = 174,
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 = "OpSGreaterThanEqual",
7347 .opcode = 175,
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 = "OpULessThan",
7357 .opcode = 176,
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 = "OpSLessThan",
7367 .opcode = 177,
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 = "OpULessThanEqual",
7377 .opcode = 178,
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 = "OpSLessThanEqual",
7387 .opcode = 179,
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 = "OpFOrdEqual",
7397 .opcode = 180,
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 = "OpFUnordEqual",
7407 .opcode = 181,
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 = "OpFOrdNotEqual",
7417 .opcode = 182,
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 = "OpFUnordNotEqual",
7427 .opcode = 183,
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 = "OpFOrdLessThan",
7437 .opcode = 184,
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 = "OpFUnordLessThan",
7447 .opcode = 185,
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 = "OpFOrdGreaterThan",
7457 .opcode = 186,
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 = "OpFUnordGreaterThan",
7467 .opcode = 187,
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 = "OpFOrdLessThanEqual",
7477 .opcode = 188,
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 = "OpFUnordLessThanEqual",
7487 .opcode = 189,
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 = "OpFOrdGreaterThanEqual",
7497 .opcode = 190,
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 = "OpFUnordGreaterThanEqual",
7507 .opcode = 191,
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 = "OpShiftRightLogical",
7517 .opcode = 194,
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 = "OpShiftRightArithmetic",
7527 .opcode = 195,
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 = "OpShiftLeftLogical",
7537 .opcode = 196,
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 = "OpBitwiseOr",
7547 .opcode = 197,
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 = "OpBitwiseXor",
7557 .opcode = 198,
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 = "OpBitwiseAnd",
7567 .opcode = 199,
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 = "OpNot",
7577 .opcode = 200,
7578 .operands = &.{
7579 .{ .kind = .id_result_type, .quantifier = .required },
7580 .{ .kind = .id_result, .quantifier = .required },
7581 .{ .kind = .id_ref, .quantifier = .required },
7582 },
7583 },
7584 .{
7585 .name = "OpBitFieldInsert",
7586 .opcode = 201,
7587 .operands = &.{
7588 .{ .kind = .id_result_type, .quantifier = .required },
7589 .{ .kind = .id_result, .quantifier = .required },
7590 .{ .kind = .id_ref, .quantifier = .required },
7591 .{ .kind = .id_ref, .quantifier = .required },
7592 .{ .kind = .id_ref, .quantifier = .required },
7593 .{ .kind = .id_ref, .quantifier = .required },
7594 },
7595 },
7596 .{
7597 .name = "OpBitFieldSExtract",
7598 .opcode = 202,
7599 .operands = &.{
7600 .{ .kind = .id_result_type, .quantifier = .required },
7601 .{ .kind = .id_result, .quantifier = .required },
7602 .{ .kind = .id_ref, .quantifier = .required },
7603 .{ .kind = .id_ref, .quantifier = .required },
7604 .{ .kind = .id_ref, .quantifier = .required },
7605 },
7606 },
7607 .{
7608 .name = "OpBitFieldUExtract",
7609 .opcode = 203,
7610 .operands = &.{
7611 .{ .kind = .id_result_type, .quantifier = .required },
7612 .{ .kind = .id_result, .quantifier = .required },
7613 .{ .kind = .id_ref, .quantifier = .required },
7614 .{ .kind = .id_ref, .quantifier = .required },
7615 .{ .kind = .id_ref, .quantifier = .required },
7616 },
7617 },
7618 .{
7619 .name = "OpBitReverse",
7620 .opcode = 204,
7621 .operands = &.{
7622 .{ .kind = .id_result_type, .quantifier = .required },
7623 .{ .kind = .id_result, .quantifier = .required },
7624 .{ .kind = .id_ref, .quantifier = .required },
7625 },
7626 },
7627 .{
7628 .name = "OpBitCount",
7629 .opcode = 205,
7630 .operands = &.{
7631 .{ .kind = .id_result_type, .quantifier = .required },
7632 .{ .kind = .id_result, .quantifier = .required },
7633 .{ .kind = .id_ref, .quantifier = .required },
7634 },
7635 },
7636 .{
7637 .name = "OpDPdx",
7638 .opcode = 207,
7639 .operands = &.{
7640 .{ .kind = .id_result_type, .quantifier = .required },
7641 .{ .kind = .id_result, .quantifier = .required },
7642 .{ .kind = .id_ref, .quantifier = .required },
7643 },
7644 },
7645 .{
7646 .name = "OpDPdy",
7647 .opcode = 208,
7648 .operands = &.{
7649 .{ .kind = .id_result_type, .quantifier = .required },
7650 .{ .kind = .id_result, .quantifier = .required },
7651 .{ .kind = .id_ref, .quantifier = .required },
7652 },
7653 },
7654 .{
7655 .name = "OpFwidth",
7656 .opcode = 209,
7657 .operands = &.{
7658 .{ .kind = .id_result_type, .quantifier = .required },
7659 .{ .kind = .id_result, .quantifier = .required },
7660 .{ .kind = .id_ref, .quantifier = .required },
7661 },
7662 },
7663 .{
7664 .name = "OpDPdxFine",
7665 .opcode = 210,
7666 .operands = &.{
7667 .{ .kind = .id_result_type, .quantifier = .required },
7668 .{ .kind = .id_result, .quantifier = .required },
7669 .{ .kind = .id_ref, .quantifier = .required },
7670 },
7671 },
7672 .{
7673 .name = "OpDPdyFine",
7674 .opcode = 211,
7675 .operands = &.{
7676 .{ .kind = .id_result_type, .quantifier = .required },
7677 .{ .kind = .id_result, .quantifier = .required },
7678 .{ .kind = .id_ref, .quantifier = .required },
7679 },
7680 },
7681 .{
7682 .name = "OpFwidthFine",
7683 .opcode = 212,
7684 .operands = &.{
7685 .{ .kind = .id_result_type, .quantifier = .required },
7686 .{ .kind = .id_result, .quantifier = .required },
7687 .{ .kind = .id_ref, .quantifier = .required },
7688 },
7689 },
7690 .{
7691 .name = "OpDPdxCoarse",
7692 .opcode = 213,
7693 .operands = &.{
7694 .{ .kind = .id_result_type, .quantifier = .required },
7695 .{ .kind = .id_result, .quantifier = .required },
7696 .{ .kind = .id_ref, .quantifier = .required },
7697 },
7698 },
7699 .{
7700 .name = "OpDPdyCoarse",
7701 .opcode = 214,
7702 .operands = &.{
7703 .{ .kind = .id_result_type, .quantifier = .required },
7704 .{ .kind = .id_result, .quantifier = .required },
7705 .{ .kind = .id_ref, .quantifier = .required },
7706 },
7707 },
7708 .{
7709 .name = "OpFwidthCoarse",
7710 .opcode = 215,
7711 .operands = &.{
7712 .{ .kind = .id_result_type, .quantifier = .required },
7713 .{ .kind = .id_result, .quantifier = .required },
7714 .{ .kind = .id_ref, .quantifier = .required },
7715 },
7716 },
7717 .{
7718 .name = "OpEmitVertex",
7719 .opcode = 218,
7720 .operands = &.{},
7721 },
7722 .{
7723 .name = "OpEndPrimitive",
7724 .opcode = 219,
7725 .operands = &.{},
7726 },
7727 .{
7728 .name = "OpEmitStreamVertex",
7729 .opcode = 220,
7730 .operands = &.{
7731 .{ .kind = .id_ref, .quantifier = .required },
7732 },
7733 },
7734 .{
7735 .name = "OpEndStreamPrimitive",
7736 .opcode = 221,
7737 .operands = &.{
7738 .{ .kind = .id_ref, .quantifier = .required },
7739 },
7740 },
7741 .{
7742 .name = "OpControlBarrier",
7743 .opcode = 224,
7744 .operands = &.{
7745 .{ .kind = .id_scope, .quantifier = .required },
7746 .{ .kind = .id_scope, .quantifier = .required },
7747 .{ .kind = .id_memory_semantics, .quantifier = .required },
7748 },
7749 },
7750 .{
7751 .name = "OpMemoryBarrier",
7752 .opcode = 225,
7753 .operands = &.{
7754 .{ .kind = .id_scope, .quantifier = .required },
7755 .{ .kind = .id_memory_semantics, .quantifier = .required },
7756 },
7757 },
7758 .{
7759 .name = "OpAtomicLoad",
7760 .opcode = 227,
7761 .operands = &.{
7762 .{ .kind = .id_result_type, .quantifier = .required },
7763 .{ .kind = .id_result, .quantifier = .required },
7764 .{ .kind = .id_ref, .quantifier = .required },
7765 .{ .kind = .id_scope, .quantifier = .required },
7766 .{ .kind = .id_memory_semantics, .quantifier = .required },
7767 },
7768 },
7769 .{
7770 .name = "OpAtomicStore",
7771 .opcode = 228,
7772 .operands = &.{
7773 .{ .kind = .id_ref, .quantifier = .required },
7774 .{ .kind = .id_scope, .quantifier = .required },
7775 .{ .kind = .id_memory_semantics, .quantifier = .required },
7776 .{ .kind = .id_ref, .quantifier = .required },
7777 },
7778 },
7779 .{
7780 .name = "OpAtomicExchange",
7781 .opcode = 229,
7782 .operands = &.{
7783 .{ .kind = .id_result_type, .quantifier = .required },
7784 .{ .kind = .id_result, .quantifier = .required },
7785 .{ .kind = .id_ref, .quantifier = .required },
7786 .{ .kind = .id_scope, .quantifier = .required },
7787 .{ .kind = .id_memory_semantics, .quantifier = .required },
7788 .{ .kind = .id_ref, .quantifier = .required },
7789 },
7790 },
7791 .{
7792 .name = "OpAtomicCompareExchange",
7793 .opcode = 230,
7794 .operands = &.{
7795 .{ .kind = .id_result_type, .quantifier = .required },
7796 .{ .kind = .id_result, .quantifier = .required },
7797 .{ .kind = .id_ref, .quantifier = .required },
7798 .{ .kind = .id_scope, .quantifier = .required },
7799 .{ .kind = .id_memory_semantics, .quantifier = .required },
7800 .{ .kind = .id_memory_semantics, .quantifier = .required },
7801 .{ .kind = .id_ref, .quantifier = .required },
7802 .{ .kind = .id_ref, .quantifier = .required },
7803 },
7804 },
7805 .{
7806 .name = "OpAtomicCompareExchangeWeak",
7807 .opcode = 231,
7808 .operands = &.{
7809 .{ .kind = .id_result_type, .quantifier = .required },
7810 .{ .kind = .id_result, .quantifier = .required },
7811 .{ .kind = .id_ref, .quantifier = .required },
7812 .{ .kind = .id_scope, .quantifier = .required },
7813 .{ .kind = .id_memory_semantics, .quantifier = .required },
7814 .{ .kind = .id_memory_semantics, .quantifier = .required },
7815 .{ .kind = .id_ref, .quantifier = .required },
7816 .{ .kind = .id_ref, .quantifier = .required },
7817 },
7818 },
7819 .{
7820 .name = "OpAtomicIIncrement",
7821 .opcode = 232,
7822 .operands = &.{
7823 .{ .kind = .id_result_type, .quantifier = .required },
7824 .{ .kind = .id_result, .quantifier = .required },
7825 .{ .kind = .id_ref, .quantifier = .required },
7826 .{ .kind = .id_scope, .quantifier = .required },
7827 .{ .kind = .id_memory_semantics, .quantifier = .required },
7828 },
7829 },
7830 .{
7831 .name = "OpAtomicIDecrement",
7832 .opcode = 233,
7833 .operands = &.{
7834 .{ .kind = .id_result_type, .quantifier = .required },
7835 .{ .kind = .id_result, .quantifier = .required },
7836 .{ .kind = .id_ref, .quantifier = .required },
7837 .{ .kind = .id_scope, .quantifier = .required },
7838 .{ .kind = .id_memory_semantics, .quantifier = .required },
7839 },
7840 },
7841 .{
7842 .name = "OpAtomicIAdd",
7843 .opcode = 234,
7844 .operands = &.{
7845 .{ .kind = .id_result_type, .quantifier = .required },
7846 .{ .kind = .id_result, .quantifier = .required },
7847 .{ .kind = .id_ref, .quantifier = .required },
7848 .{ .kind = .id_scope, .quantifier = .required },
7849 .{ .kind = .id_memory_semantics, .quantifier = .required },
7850 .{ .kind = .id_ref, .quantifier = .required },
7851 },
7852 },
7853 .{
7854 .name = "OpAtomicISub",
7855 .opcode = 235,
7856 .operands = &.{
7857 .{ .kind = .id_result_type, .quantifier = .required },
7858 .{ .kind = .id_result, .quantifier = .required },
7859 .{ .kind = .id_ref, .quantifier = .required },
7860 .{ .kind = .id_scope, .quantifier = .required },
7861 .{ .kind = .id_memory_semantics, .quantifier = .required },
7862 .{ .kind = .id_ref, .quantifier = .required },
7863 },
7864 },
7865 .{
7866 .name = "OpAtomicSMin",
7867 .opcode = 236,
7868 .operands = &.{
7869 .{ .kind = .id_result_type, .quantifier = .required },
7870 .{ .kind = .id_result, .quantifier = .required },
7871 .{ .kind = .id_ref, .quantifier = .required },
7872 .{ .kind = .id_scope, .quantifier = .required },
7873 .{ .kind = .id_memory_semantics, .quantifier = .required },
7874 .{ .kind = .id_ref, .quantifier = .required },
7875 },
7876 },
7877 .{
7878 .name = "OpAtomicUMin",
7879 .opcode = 237,
7880 .operands = &.{
7881 .{ .kind = .id_result_type, .quantifier = .required },
7882 .{ .kind = .id_result, .quantifier = .required },
7883 .{ .kind = .id_ref, .quantifier = .required },
7884 .{ .kind = .id_scope, .quantifier = .required },
7885 .{ .kind = .id_memory_semantics, .quantifier = .required },
7886 .{ .kind = .id_ref, .quantifier = .required },
7887 },
7888 },
7889 .{
7890 .name = "OpAtomicSMax",
7891 .opcode = 238,
7892 .operands = &.{
7893 .{ .kind = .id_result_type, .quantifier = .required },
7894 .{ .kind = .id_result, .quantifier = .required },
7895 .{ .kind = .id_ref, .quantifier = .required },
7896 .{ .kind = .id_scope, .quantifier = .required },
7897 .{ .kind = .id_memory_semantics, .quantifier = .required },
7898 .{ .kind = .id_ref, .quantifier = .required },
7899 },
7900 },
7901 .{
7902 .name = "OpAtomicUMax",
7903 .opcode = 239,
7904 .operands = &.{
7905 .{ .kind = .id_result_type, .quantifier = .required },
7906 .{ .kind = .id_result, .quantifier = .required },
7907 .{ .kind = .id_ref, .quantifier = .required },
7908 .{ .kind = .id_scope, .quantifier = .required },
7909 .{ .kind = .id_memory_semantics, .quantifier = .required },
7910 .{ .kind = .id_ref, .quantifier = .required },
7911 },
7912 },
7913 .{
7914 .name = "OpAtomicAnd",
7915 .opcode = 240,
7916 .operands = &.{
7917 .{ .kind = .id_result_type, .quantifier = .required },
7918 .{ .kind = .id_result, .quantifier = .required },
7919 .{ .kind = .id_ref, .quantifier = .required },
7920 .{ .kind = .id_scope, .quantifier = .required },
7921 .{ .kind = .id_memory_semantics, .quantifier = .required },
7922 .{ .kind = .id_ref, .quantifier = .required },
7923 },
7924 },
7925 .{
7926 .name = "OpAtomicOr",
7927 .opcode = 241,
7928 .operands = &.{
7929 .{ .kind = .id_result_type, .quantifier = .required },
7930 .{ .kind = .id_result, .quantifier = .required },
7931 .{ .kind = .id_ref, .quantifier = .required },
7932 .{ .kind = .id_scope, .quantifier = .required },
7933 .{ .kind = .id_memory_semantics, .quantifier = .required },
7934 .{ .kind = .id_ref, .quantifier = .required },
7935 },
7936 },
7937 .{
7938 .name = "OpAtomicXor",
7939 .opcode = 242,
7940 .operands = &.{
7941 .{ .kind = .id_result_type, .quantifier = .required },
7942 .{ .kind = .id_result, .quantifier = .required },
7943 .{ .kind = .id_ref, .quantifier = .required },
7944 .{ .kind = .id_scope, .quantifier = .required },
7945 .{ .kind = .id_memory_semantics, .quantifier = .required },
7946 .{ .kind = .id_ref, .quantifier = .required },
7947 },
7948 },
7949 .{
7950 .name = "OpPhi",
7951 .opcode = 245,
7952 .operands = &.{
7953 .{ .kind = .id_result_type, .quantifier = .required },
7954 .{ .kind = .id_result, .quantifier = .required },
7955 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
7956 },
7957 },
7958 .{
7959 .name = "OpLoopMerge",
7960 .opcode = 246,
7961 .operands = &.{
7962 .{ .kind = .id_ref, .quantifier = .required },
7963 .{ .kind = .id_ref, .quantifier = .required },
7964 .{ .kind = .loop_control, .quantifier = .required },
7965 },
7966 },
7967 .{
7968 .name = "OpSelectionMerge",
7969 .opcode = 247,
7970 .operands = &.{
7971 .{ .kind = .id_ref, .quantifier = .required },
7972 .{ .kind = .selection_control, .quantifier = .required },
7973 },
7974 },
7975 .{
7976 .name = "OpLabel",
7977 .opcode = 248,
7978 .operands = &.{
7979 .{ .kind = .id_result, .quantifier = .required },
7980 },
7981 },
7982 .{
7983 .name = "OpBranch",
7984 .opcode = 249,
7985 .operands = &.{
7986 .{ .kind = .id_ref, .quantifier = .required },
7987 },
7988 },
7989 .{
7990 .name = "OpBranchConditional",
7991 .opcode = 250,
7992 .operands = &.{
7993 .{ .kind = .id_ref, .quantifier = .required },
7994 .{ .kind = .id_ref, .quantifier = .required },
7995 .{ .kind = .id_ref, .quantifier = .required },
7996 .{ .kind = .literal_integer, .quantifier = .variadic },
7997 },
7998 },
7999 .{
8000 .name = "OpSwitch",
8001 .opcode = 251,
8002 .operands = &.{
8003 .{ .kind = .id_ref, .quantifier = .required },
8004 .{ .kind = .id_ref, .quantifier = .required },
8005 .{ .kind = .pair_literal_integer_id_ref, .quantifier = .variadic },
8006 },
8007 },
8008 .{
8009 .name = "OpKill",
8010 .opcode = 252,
8011 .operands = &.{},
8012 },
8013 .{
8014 .name = "OpReturn",
8015 .opcode = 253,
8016 .operands = &.{},
8017 },
8018 .{
8019 .name = "OpReturnValue",
8020 .opcode = 254,
8021 .operands = &.{
8022 .{ .kind = .id_ref, .quantifier = .required },
8023 },
8024 },
8025 .{
8026 .name = "OpUnreachable",
8027 .opcode = 255,
8028 .operands = &.{},
8029 },
8030 .{
8031 .name = "OpLifetimeStart",
8032 .opcode = 256,
8033 .operands = &.{
8034 .{ .kind = .id_ref, .quantifier = .required },
8035 .{ .kind = .literal_integer, .quantifier = .required },
8036 },
8037 },
8038 .{
8039 .name = "OpLifetimeStop",
8040 .opcode = 257,
8041 .operands = &.{
8042 .{ .kind = .id_ref, .quantifier = .required },
8043 .{ .kind = .literal_integer, .quantifier = .required },
8044 },
8045 },
8046 .{
8047 .name = "OpGroupAsyncCopy",
8048 .opcode = 259,
8049 .operands = &.{
8050 .{ .kind = .id_result_type, .quantifier = .required },
8051 .{ .kind = .id_result, .quantifier = .required },
8052 .{ .kind = .id_scope, .quantifier = .required },
8053 .{ .kind = .id_ref, .quantifier = .required },
8054 .{ .kind = .id_ref, .quantifier = .required },
8055 .{ .kind = .id_ref, .quantifier = .required },
8056 .{ .kind = .id_ref, .quantifier = .required },
8057 .{ .kind = .id_ref, .quantifier = .required },
8058 },
8059 },
8060 .{
8061 .name = "OpGroupWaitEvents",
8062 .opcode = 260,
8063 .operands = &.{
8064 .{ .kind = .id_scope, .quantifier = .required },
8065 .{ .kind = .id_ref, .quantifier = .required },
8066 .{ .kind = .id_ref, .quantifier = .required },
8067 },
8068 },
8069 .{
8070 .name = "OpGroupAll",
8071 .opcode = 261,
8072 .operands = &.{
8073 .{ .kind = .id_result_type, .quantifier = .required },
8074 .{ .kind = .id_result, .quantifier = .required },
8075 .{ .kind = .id_scope, .quantifier = .required },
8076 .{ .kind = .id_ref, .quantifier = .required },
8077 },
8078 },
8079 .{
8080 .name = "OpGroupAny",
8081 .opcode = 262,
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 = "OpGroupBroadcast",
8091 .opcode = 263,
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 .{ .kind = .id_ref, .quantifier = .required },
8098 },
8099 },
8100 .{
8101 .name = "OpGroupIAdd",
8102 .opcode = 264,
8103 .operands = &.{
8104 .{ .kind = .id_result_type, .quantifier = .required },
8105 .{ .kind = .id_result, .quantifier = .required },
8106 .{ .kind = .id_scope, .quantifier = .required },
8107 .{ .kind = .group_operation, .quantifier = .required },
8108 .{ .kind = .id_ref, .quantifier = .required },
8109 },
8110 },
8111 .{
8112 .name = "OpGroupFAdd",
8113 .opcode = 265,
8114 .operands = &.{
8115 .{ .kind = .id_result_type, .quantifier = .required },
8116 .{ .kind = .id_result, .quantifier = .required },
8117 .{ .kind = .id_scope, .quantifier = .required },
8118 .{ .kind = .group_operation, .quantifier = .required },
8119 .{ .kind = .id_ref, .quantifier = .required },
8120 },
8121 },
8122 .{
8123 .name = "OpGroupFMin",
8124 .opcode = 266,
8125 .operands = &.{
8126 .{ .kind = .id_result_type, .quantifier = .required },
8127 .{ .kind = .id_result, .quantifier = .required },
8128 .{ .kind = .id_scope, .quantifier = .required },
8129 .{ .kind = .group_operation, .quantifier = .required },
8130 .{ .kind = .id_ref, .quantifier = .required },
8131 },
8132 },
8133 .{
8134 .name = "OpGroupUMin",
8135 .opcode = 267,
8136 .operands = &.{
8137 .{ .kind = .id_result_type, .quantifier = .required },
8138 .{ .kind = .id_result, .quantifier = .required },
8139 .{ .kind = .id_scope, .quantifier = .required },
8140 .{ .kind = .group_operation, .quantifier = .required },
8141 .{ .kind = .id_ref, .quantifier = .required },
8142 },
8143 },
8144 .{
8145 .name = "OpGroupSMin",
8146 .opcode = 268,
8147 .operands = &.{
8148 .{ .kind = .id_result_type, .quantifier = .required },
8149 .{ .kind = .id_result, .quantifier = .required },
8150 .{ .kind = .id_scope, .quantifier = .required },
8151 .{ .kind = .group_operation, .quantifier = .required },
8152 .{ .kind = .id_ref, .quantifier = .required },
8153 },
8154 },
8155 .{
8156 .name = "OpGroupFMax",
8157 .opcode = 269,
8158 .operands = &.{
8159 .{ .kind = .id_result_type, .quantifier = .required },
8160 .{ .kind = .id_result, .quantifier = .required },
8161 .{ .kind = .id_scope, .quantifier = .required },
8162 .{ .kind = .group_operation, .quantifier = .required },
8163 .{ .kind = .id_ref, .quantifier = .required },
8164 },
8165 },
8166 .{
8167 .name = "OpGroupUMax",
8168 .opcode = 270,
8169 .operands = &.{
8170 .{ .kind = .id_result_type, .quantifier = .required },
8171 .{ .kind = .id_result, .quantifier = .required },
8172 .{ .kind = .id_scope, .quantifier = .required },
8173 .{ .kind = .group_operation, .quantifier = .required },
8174 .{ .kind = .id_ref, .quantifier = .required },
8175 },
8176 },
8177 .{
8178 .name = "OpGroupSMax",
8179 .opcode = 271,
8180 .operands = &.{
8181 .{ .kind = .id_result_type, .quantifier = .required },
8182 .{ .kind = .id_result, .quantifier = .required },
8183 .{ .kind = .id_scope, .quantifier = .required },
8184 .{ .kind = .group_operation, .quantifier = .required },
8185 .{ .kind = .id_ref, .quantifier = .required },
8186 },
8187 },
8188 .{
8189 .name = "OpReadPipe",
8190 .opcode = 274,
8191 .operands = &.{
8192 .{ .kind = .id_result_type, .quantifier = .required },
8193 .{ .kind = .id_result, .quantifier = .required },
8194 .{ .kind = .id_ref, .quantifier = .required },
8195 .{ .kind = .id_ref, .quantifier = .required },
8196 .{ .kind = .id_ref, .quantifier = .required },
8197 .{ .kind = .id_ref, .quantifier = .required },
8198 },
8199 },
8200 .{
8201 .name = "OpWritePipe",
8202 .opcode = 275,
8203 .operands = &.{
8204 .{ .kind = .id_result_type, .quantifier = .required },
8205 .{ .kind = .id_result, .quantifier = .required },
8206 .{ .kind = .id_ref, .quantifier = .required },
8207 .{ .kind = .id_ref, .quantifier = .required },
8208 .{ .kind = .id_ref, .quantifier = .required },
8209 .{ .kind = .id_ref, .quantifier = .required },
8210 },
8211 },
8212 .{
8213 .name = "OpReservedReadPipe",
8214 .opcode = 276,
8215 .operands = &.{
8216 .{ .kind = .id_result_type, .quantifier = .required },
8217 .{ .kind = .id_result, .quantifier = .required },
8218 .{ .kind = .id_ref, .quantifier = .required },
8219 .{ .kind = .id_ref, .quantifier = .required },
8220 .{ .kind = .id_ref, .quantifier = .required },
8221 .{ .kind = .id_ref, .quantifier = .required },
8222 .{ .kind = .id_ref, .quantifier = .required },
8223 .{ .kind = .id_ref, .quantifier = .required },
8224 },
8225 },
8226 .{
8227 .name = "OpReservedWritePipe",
8228 .opcode = 277,
8229 .operands = &.{
8230 .{ .kind = .id_result_type, .quantifier = .required },
8231 .{ .kind = .id_result, .quantifier = .required },
8232 .{ .kind = .id_ref, .quantifier = .required },
8233 .{ .kind = .id_ref, .quantifier = .required },
8234 .{ .kind = .id_ref, .quantifier = .required },
8235 .{ .kind = .id_ref, .quantifier = .required },
8236 .{ .kind = .id_ref, .quantifier = .required },
8237 .{ .kind = .id_ref, .quantifier = .required },
8238 },
8239 },
8240 .{
8241 .name = "OpReserveReadPipePackets",
8242 .opcode = 278,
8243 .operands = &.{
8244 .{ .kind = .id_result_type, .quantifier = .required },
8245 .{ .kind = .id_result, .quantifier = .required },
8246 .{ .kind = .id_ref, .quantifier = .required },
8247 .{ .kind = .id_ref, .quantifier = .required },
8248 .{ .kind = .id_ref, .quantifier = .required },
8249 .{ .kind = .id_ref, .quantifier = .required },
8250 },
8251 },
8252 .{
8253 .name = "OpReserveWritePipePackets",
8254 .opcode = 279,
8255 .operands = &.{
8256 .{ .kind = .id_result_type, .quantifier = .required },
8257 .{ .kind = .id_result, .quantifier = .required },
8258 .{ .kind = .id_ref, .quantifier = .required },
8259 .{ .kind = .id_ref, .quantifier = .required },
8260 .{ .kind = .id_ref, .quantifier = .required },
8261 .{ .kind = .id_ref, .quantifier = .required },
8262 },
8263 },
8264 .{
8265 .name = "OpCommitReadPipe",
8266 .opcode = 280,
8267 .operands = &.{
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 = "OpCommitWritePipe",
8276 .opcode = 281,
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 = "OpIsValidReserveId",
8286 .opcode = 282,
8287 .operands = &.{
8288 .{ .kind = .id_result_type, .quantifier = .required },
8289 .{ .kind = .id_result, .quantifier = .required },
8290 .{ .kind = .id_ref, .quantifier = .required },
8291 },
8292 },
8293 .{
8294 .name = "OpGetNumPipePackets",
8295 .opcode = 283,
8296 .operands = &.{
8297 .{ .kind = .id_result_type, .quantifier = .required },
8298 .{ .kind = .id_result, .quantifier = .required },
8299 .{ .kind = .id_ref, .quantifier = .required },
8300 .{ .kind = .id_ref, .quantifier = .required },
8301 .{ .kind = .id_ref, .quantifier = .required },
8302 },
8303 },
8304 .{
8305 .name = "OpGetMaxPipePackets",
8306 .opcode = 284,
8307 .operands = &.{
8308 .{ .kind = .id_result_type, .quantifier = .required },
8309 .{ .kind = .id_result, .quantifier = .required },
8310 .{ .kind = .id_ref, .quantifier = .required },
8311 .{ .kind = .id_ref, .quantifier = .required },
8312 .{ .kind = .id_ref, .quantifier = .required },
8313 },
8314 },
8315 .{
8316 .name = "OpGroupReserveReadPipePackets",
8317 .opcode = 285,
8318 .operands = &.{
8319 .{ .kind = .id_result_type, .quantifier = .required },
8320 .{ .kind = .id_result, .quantifier = .required },
8321 .{ .kind = .id_scope, .quantifier = .required },
8322 .{ .kind = .id_ref, .quantifier = .required },
8323 .{ .kind = .id_ref, .quantifier = .required },
8324 .{ .kind = .id_ref, .quantifier = .required },
8325 .{ .kind = .id_ref, .quantifier = .required },
8326 },
8327 },
8328 .{
8329 .name = "OpGroupReserveWritePipePackets",
8330 .opcode = 286,
8331 .operands = &.{
8332 .{ .kind = .id_result_type, .quantifier = .required },
8333 .{ .kind = .id_result, .quantifier = .required },
8334 .{ .kind = .id_scope, .quantifier = .required },
8335 .{ .kind = .id_ref, .quantifier = .required },
8336 .{ .kind = .id_ref, .quantifier = .required },
8337 .{ .kind = .id_ref, .quantifier = .required },
8338 .{ .kind = .id_ref, .quantifier = .required },
8339 },
8340 },
8341 .{
8342 .name = "OpGroupCommitReadPipe",
8343 .opcode = 287,
8344 .operands = &.{
8345 .{ .kind = .id_scope, .quantifier = .required },
8346 .{ .kind = .id_ref, .quantifier = .required },
8347 .{ .kind = .id_ref, .quantifier = .required },
8348 .{ .kind = .id_ref, .quantifier = .required },
8349 .{ .kind = .id_ref, .quantifier = .required },
8350 },
8351 },
8352 .{
8353 .name = "OpGroupCommitWritePipe",
8354 .opcode = 288,
8355 .operands = &.{
8356 .{ .kind = .id_scope, .quantifier = .required },
8357 .{ .kind = .id_ref, .quantifier = .required },
8358 .{ .kind = .id_ref, .quantifier = .required },
8359 .{ .kind = .id_ref, .quantifier = .required },
8360 .{ .kind = .id_ref, .quantifier = .required },
8361 },
8362 },
8363 .{
8364 .name = "OpEnqueueMarker",
8365 .opcode = 291,
8366 .operands = &.{
8367 .{ .kind = .id_result_type, .quantifier = .required },
8368 .{ .kind = .id_result, .quantifier = .required },
8369 .{ .kind = .id_ref, .quantifier = .required },
8370 .{ .kind = .id_ref, .quantifier = .required },
8371 .{ .kind = .id_ref, .quantifier = .required },
8372 .{ .kind = .id_ref, .quantifier = .required },
8373 },
8374 },
8375 .{
8376 .name = "OpEnqueueKernel",
8377 .opcode = 292,
8378 .operands = &.{
8379 .{ .kind = .id_result_type, .quantifier = .required },
8380 .{ .kind = .id_result, .quantifier = .required },
8381 .{ .kind = .id_ref, .quantifier = .required },
8382 .{ .kind = .id_ref, .quantifier = .required },
8383 .{ .kind = .id_ref, .quantifier = .required },
8384 .{ .kind = .id_ref, .quantifier = .required },
8385 .{ .kind = .id_ref, .quantifier = .required },
8386 .{ .kind = .id_ref, .quantifier = .required },
8387 .{ .kind = .id_ref, .quantifier = .required },
8388 .{ .kind = .id_ref, .quantifier = .required },
8389 .{ .kind = .id_ref, .quantifier = .required },
8390 .{ .kind = .id_ref, .quantifier = .required },
8391 .{ .kind = .id_ref, .quantifier = .variadic },
8392 },
8393 },
8394 .{
8395 .name = "OpGetKernelNDrangeSubGroupCount",
8396 .opcode = 293,
8397 .operands = &.{
8398 .{ .kind = .id_result_type, .quantifier = .required },
8399 .{ .kind = .id_result, .quantifier = .required },
8400 .{ .kind = .id_ref, .quantifier = .required },
8401 .{ .kind = .id_ref, .quantifier = .required },
8402 .{ .kind = .id_ref, .quantifier = .required },
8403 .{ .kind = .id_ref, .quantifier = .required },
8404 .{ .kind = .id_ref, .quantifier = .required },
8405 },
8406 },
8407 .{
8408 .name = "OpGetKernelNDrangeMaxSubGroupSize",
8409 .opcode = 294,
8410 .operands = &.{
8411 .{ .kind = .id_result_type, .quantifier = .required },
8412 .{ .kind = .id_result, .quantifier = .required },
8413 .{ .kind = .id_ref, .quantifier = .required },
8414 .{ .kind = .id_ref, .quantifier = .required },
8415 .{ .kind = .id_ref, .quantifier = .required },
8416 .{ .kind = .id_ref, .quantifier = .required },
8417 .{ .kind = .id_ref, .quantifier = .required },
8418 },
8419 },
8420 .{
8421 .name = "OpGetKernelWorkGroupSize",
8422 .opcode = 295,
8423 .operands = &.{
8424 .{ .kind = .id_result_type, .quantifier = .required },
8425 .{ .kind = .id_result, .quantifier = .required },
8426 .{ .kind = .id_ref, .quantifier = .required },
8427 .{ .kind = .id_ref, .quantifier = .required },
8428 .{ .kind = .id_ref, .quantifier = .required },
8429 .{ .kind = .id_ref, .quantifier = .required },
8430 },
8431 },
8432 .{
8433 .name = "OpGetKernelPreferredWorkGroupSizeMultiple",
8434 .opcode = 296,
8435 .operands = &.{
8436 .{ .kind = .id_result_type, .quantifier = .required },
8437 .{ .kind = .id_result, .quantifier = .required },
8438 .{ .kind = .id_ref, .quantifier = .required },
8439 .{ .kind = .id_ref, .quantifier = .required },
8440 .{ .kind = .id_ref, .quantifier = .required },
8441 .{ .kind = .id_ref, .quantifier = .required },
8442 },
8443 },
8444 .{
8445 .name = "OpRetainEvent",
8446 .opcode = 297,
8447 .operands = &.{
8448 .{ .kind = .id_ref, .quantifier = .required },
8449 },
8450 },
8451 .{
8452 .name = "OpReleaseEvent",
8453 .opcode = 298,
8454 .operands = &.{
8455 .{ .kind = .id_ref, .quantifier = .required },
8456 },
8457 },
8458 .{
8459 .name = "OpCreateUserEvent",
8460 .opcode = 299,
8461 .operands = &.{
8462 .{ .kind = .id_result_type, .quantifier = .required },
8463 .{ .kind = .id_result, .quantifier = .required },
8464 },
8465 },
8466 .{
8467 .name = "OpIsValidEvent",
8468 .opcode = 300,
8469 .operands = &.{
8470 .{ .kind = .id_result_type, .quantifier = .required },
8471 .{ .kind = .id_result, .quantifier = .required },
8472 .{ .kind = .id_ref, .quantifier = .required },
8473 },
8474 },
8475 .{
8476 .name = "OpSetUserEventStatus",
8477 .opcode = 301,
8478 .operands = &.{
8479 .{ .kind = .id_ref, .quantifier = .required },
8480 .{ .kind = .id_ref, .quantifier = .required },
8481 },
8482 },
8483 .{
8484 .name = "OpCaptureEventProfilingInfo",
8485 .opcode = 302,
8486 .operands = &.{
8487 .{ .kind = .id_ref, .quantifier = .required },
8488 .{ .kind = .id_ref, .quantifier = .required },
8489 .{ .kind = .id_ref, .quantifier = .required },
8490 },
8491 },
8492 .{
8493 .name = "OpGetDefaultQueue",
8494 .opcode = 303,
8495 .operands = &.{
8496 .{ .kind = .id_result_type, .quantifier = .required },
8497 .{ .kind = .id_result, .quantifier = .required },
8498 },
8499 },
8500 .{
8501 .name = "OpBuildNDRange",
8502 .opcode = 304,
8503 .operands = &.{
8504 .{ .kind = .id_result_type, .quantifier = .required },
8505 .{ .kind = .id_result, .quantifier = .required },
8506 .{ .kind = .id_ref, .quantifier = .required },
8507 .{ .kind = .id_ref, .quantifier = .required },
8508 .{ .kind = .id_ref, .quantifier = .required },
8509 },
8510 },
8511 .{
8512 .name = "OpImageSparseSampleImplicitLod",
8513 .opcode = 305,
8514 .operands = &.{
8515 .{ .kind = .id_result_type, .quantifier = .required },
8516 .{ .kind = .id_result, .quantifier = .required },
8517 .{ .kind = .id_ref, .quantifier = .required },
8518 .{ .kind = .id_ref, .quantifier = .required },
8519 .{ .kind = .image_operands, .quantifier = .optional },
8520 },
8521 },
8522 .{
8523 .name = "OpImageSparseSampleExplicitLod",
8524 .opcode = 306,
8525 .operands = &.{
8526 .{ .kind = .id_result_type, .quantifier = .required },
8527 .{ .kind = .id_result, .quantifier = .required },
8528 .{ .kind = .id_ref, .quantifier = .required },
8529 .{ .kind = .id_ref, .quantifier = .required },
8530 .{ .kind = .image_operands, .quantifier = .required },
8531 },
8532 },
8533 .{
8534 .name = "OpImageSparseSampleDrefImplicitLod",
8535 .opcode = 307,
8536 .operands = &.{
8537 .{ .kind = .id_result_type, .quantifier = .required },
8538 .{ .kind = .id_result, .quantifier = .required },
8539 .{ .kind = .id_ref, .quantifier = .required },
8540 .{ .kind = .id_ref, .quantifier = .required },
8541 .{ .kind = .id_ref, .quantifier = .required },
8542 .{ .kind = .image_operands, .quantifier = .optional },
8543 },
8544 },
8545 .{
8546 .name = "OpImageSparseSampleDrefExplicitLod",
8547 .opcode = 308,
8548 .operands = &.{
8549 .{ .kind = .id_result_type, .quantifier = .required },
8550 .{ .kind = .id_result, .quantifier = .required },
8551 .{ .kind = .id_ref, .quantifier = .required },
8552 .{ .kind = .id_ref, .quantifier = .required },
8553 .{ .kind = .id_ref, .quantifier = .required },
8554 .{ .kind = .image_operands, .quantifier = .required },
8555 },
8556 },
8557 .{
8558 .name = "OpImageSparseSampleProjImplicitLod",
8559 .opcode = 309,
8560 .operands = &.{
8561 .{ .kind = .id_result_type, .quantifier = .required },
8562 .{ .kind = .id_result, .quantifier = .required },
8563 .{ .kind = .id_ref, .quantifier = .required },
8564 .{ .kind = .id_ref, .quantifier = .required },
8565 .{ .kind = .image_operands, .quantifier = .optional },
8566 },
8567 },
8568 .{
8569 .name = "OpImageSparseSampleProjExplicitLod",
8570 .opcode = 310,
8571 .operands = &.{
8572 .{ .kind = .id_result_type, .quantifier = .required },
8573 .{ .kind = .id_result, .quantifier = .required },
8574 .{ .kind = .id_ref, .quantifier = .required },
8575 .{ .kind = .id_ref, .quantifier = .required },
8576 .{ .kind = .image_operands, .quantifier = .required },
8577 },
8578 },
8579 .{
8580 .name = "OpImageSparseSampleProjDrefImplicitLod",
8581 .opcode = 311,
8582 .operands = &.{
8583 .{ .kind = .id_result_type, .quantifier = .required },
8584 .{ .kind = .id_result, .quantifier = .required },
8585 .{ .kind = .id_ref, .quantifier = .required },
8586 .{ .kind = .id_ref, .quantifier = .required },
8587 .{ .kind = .id_ref, .quantifier = .required },
8588 .{ .kind = .image_operands, .quantifier = .optional },
8589 },
8590 },
8591 .{
8592 .name = "OpImageSparseSampleProjDrefExplicitLod",
8593 .opcode = 312,
8594 .operands = &.{
8595 .{ .kind = .id_result_type, .quantifier = .required },
8596 .{ .kind = .id_result, .quantifier = .required },
8597 .{ .kind = .id_ref, .quantifier = .required },
8598 .{ .kind = .id_ref, .quantifier = .required },
8599 .{ .kind = .id_ref, .quantifier = .required },
8600 .{ .kind = .image_operands, .quantifier = .required },
8601 },
8602 },
8603 .{
8604 .name = "OpImageSparseFetch",
8605 .opcode = 313,
8606 .operands = &.{
8607 .{ .kind = .id_result_type, .quantifier = .required },
8608 .{ .kind = .id_result, .quantifier = .required },
8609 .{ .kind = .id_ref, .quantifier = .required },
8610 .{ .kind = .id_ref, .quantifier = .required },
8611 .{ .kind = .image_operands, .quantifier = .optional },
8612 },
8613 },
8614 .{
8615 .name = "OpImageSparseGather",
8616 .opcode = 314,
8617 .operands = &.{
8618 .{ .kind = .id_result_type, .quantifier = .required },
8619 .{ .kind = .id_result, .quantifier = .required },
8620 .{ .kind = .id_ref, .quantifier = .required },
8621 .{ .kind = .id_ref, .quantifier = .required },
8622 .{ .kind = .id_ref, .quantifier = .required },
8623 .{ .kind = .image_operands, .quantifier = .optional },
8624 },
8625 },
8626 .{
8627 .name = "OpImageSparseDrefGather",
8628 .opcode = 315,
8629 .operands = &.{
8630 .{ .kind = .id_result_type, .quantifier = .required },
8631 .{ .kind = .id_result, .quantifier = .required },
8632 .{ .kind = .id_ref, .quantifier = .required },
8633 .{ .kind = .id_ref, .quantifier = .required },
8634 .{ .kind = .id_ref, .quantifier = .required },
8635 .{ .kind = .image_operands, .quantifier = .optional },
8636 },
8637 },
8638 .{
8639 .name = "OpImageSparseTexelsResident",
8640 .opcode = 316,
8641 .operands = &.{
8642 .{ .kind = .id_result_type, .quantifier = .required },
8643 .{ .kind = .id_result, .quantifier = .required },
8644 .{ .kind = .id_ref, .quantifier = .required },
8645 },
8646 },
8647 .{
8648 .name = "OpNoLine",
8649 .opcode = 317,
8650 .operands = &.{},
8651 },
8652 .{
8653 .name = "OpAtomicFlagTestAndSet",
8654 .opcode = 318,
8655 .operands = &.{
8656 .{ .kind = .id_result_type, .quantifier = .required },
8657 .{ .kind = .id_result, .quantifier = .required },
8658 .{ .kind = .id_ref, .quantifier = .required },
8659 .{ .kind = .id_scope, .quantifier = .required },
8660 .{ .kind = .id_memory_semantics, .quantifier = .required },
8661 },
8662 },
8663 .{
8664 .name = "OpAtomicFlagClear",
8665 .opcode = 319,
8666 .operands = &.{
8667 .{ .kind = .id_ref, .quantifier = .required },
8668 .{ .kind = .id_scope, .quantifier = .required },
8669 .{ .kind = .id_memory_semantics, .quantifier = .required },
8670 },
8671 },
8672 .{
8673 .name = "OpImageSparseRead",
8674 .opcode = 320,
8675 .operands = &.{
8676 .{ .kind = .id_result_type, .quantifier = .required },
8677 .{ .kind = .id_result, .quantifier = .required },
8678 .{ .kind = .id_ref, .quantifier = .required },
8679 .{ .kind = .id_ref, .quantifier = .required },
8680 .{ .kind = .image_operands, .quantifier = .optional },
8681 },
8682 },
8683 .{
8684 .name = "OpSizeOf",
8685 .opcode = 321,
8686 .operands = &.{
8687 .{ .kind = .id_result_type, .quantifier = .required },
8688 .{ .kind = .id_result, .quantifier = .required },
8689 .{ .kind = .id_ref, .quantifier = .required },
8690 },
8691 },
8692 .{
8693 .name = "OpTypePipeStorage",
8694 .opcode = 322,
8695 .operands = &.{
8696 .{ .kind = .id_result, .quantifier = .required },
8697 },
8698 },
8699 .{
8700 .name = "OpConstantPipeStorage",
8701 .opcode = 323,
8702 .operands = &.{
8703 .{ .kind = .id_result_type, .quantifier = .required },
8704 .{ .kind = .id_result, .quantifier = .required },
8705 .{ .kind = .literal_integer, .quantifier = .required },
8706 .{ .kind = .literal_integer, .quantifier = .required },
8707 .{ .kind = .literal_integer, .quantifier = .required },
8708 },
8709 },
8710 .{
8711 .name = "OpCreatePipeFromPipeStorage",
8712 .opcode = 324,
8713 .operands = &.{
8714 .{ .kind = .id_result_type, .quantifier = .required },
8715 .{ .kind = .id_result, .quantifier = .required },
8716 .{ .kind = .id_ref, .quantifier = .required },
8717 },
8718 },
8719 .{
8720 .name = "OpGetKernelLocalSizeForSubgroupCount",
8721 .opcode = 325,
8722 .operands = &.{
8723 .{ .kind = .id_result_type, .quantifier = .required },
8724 .{ .kind = .id_result, .quantifier = .required },
8725 .{ .kind = .id_ref, .quantifier = .required },
8726 .{ .kind = .id_ref, .quantifier = .required },
8727 .{ .kind = .id_ref, .quantifier = .required },
8728 .{ .kind = .id_ref, .quantifier = .required },
8729 .{ .kind = .id_ref, .quantifier = .required },
8730 },
8731 },
8732 .{
8733 .name = "OpGetKernelMaxNumSubgroups",
8734 .opcode = 326,
8735 .operands = &.{
8736 .{ .kind = .id_result_type, .quantifier = .required },
8737 .{ .kind = .id_result, .quantifier = .required },
8738 .{ .kind = .id_ref, .quantifier = .required },
8739 .{ .kind = .id_ref, .quantifier = .required },
8740 .{ .kind = .id_ref, .quantifier = .required },
8741 .{ .kind = .id_ref, .quantifier = .required },
8742 },
8743 },
8744 .{
8745 .name = "OpTypeNamedBarrier",
8746 .opcode = 327,
8747 .operands = &.{
8748 .{ .kind = .id_result, .quantifier = .required },
8749 },
8750 },
8751 .{
8752 .name = "OpNamedBarrierInitialize",
8753 .opcode = 328,
8754 .operands = &.{
8755 .{ .kind = .id_result_type, .quantifier = .required },
8756 .{ .kind = .id_result, .quantifier = .required },
8757 .{ .kind = .id_ref, .quantifier = .required },
8758 },
8759 },
8760 .{
8761 .name = "OpMemoryNamedBarrier",
8762 .opcode = 329,
8763 .operands = &.{
8764 .{ .kind = .id_ref, .quantifier = .required },
8765 .{ .kind = .id_scope, .quantifier = .required },
8766 .{ .kind = .id_memory_semantics, .quantifier = .required },
8767 },
8768 },
8769 .{
8770 .name = "OpModuleProcessed",
8771 .opcode = 330,
8772 .operands = &.{
8773 .{ .kind = .literal_string, .quantifier = .required },
8774 },
8775 },
8776 .{
8777 .name = "OpExecutionModeId",
8778 .opcode = 331,
8779 .operands = &.{
8780 .{ .kind = .id_ref, .quantifier = .required },
8781 .{ .kind = .execution_mode, .quantifier = .required },
8782 },
8783 },
8784 .{
8785 .name = "OpDecorateId",
8786 .opcode = 332,
8787 .operands = &.{
8788 .{ .kind = .id_ref, .quantifier = .required },
8789 .{ .kind = .decoration, .quantifier = .required },
8790 },
8791 },
8792 .{
8793 .name = "OpGroupNonUniformElect",
8794 .opcode = 333,
8795 .operands = &.{
8796 .{ .kind = .id_result_type, .quantifier = .required },
8797 .{ .kind = .id_result, .quantifier = .required },
8798 .{ .kind = .id_scope, .quantifier = .required },
8799 },
8800 },
8801 .{
8802 .name = "OpGroupNonUniformAll",
8803 .opcode = 334,
8804 .operands = &.{
8805 .{ .kind = .id_result_type, .quantifier = .required },
8806 .{ .kind = .id_result, .quantifier = .required },
8807 .{ .kind = .id_scope, .quantifier = .required },
8808 .{ .kind = .id_ref, .quantifier = .required },
8809 },
8810 },
8811 .{
8812 .name = "OpGroupNonUniformAny",
8813 .opcode = 335,
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 = "OpGroupNonUniformAllEqual",
8823 .opcode = 336,
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 = "OpGroupNonUniformBroadcast",
8833 .opcode = 337,
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 .{ .kind = .id_ref, .quantifier = .required },
8840 },
8841 },
8842 .{
8843 .name = "OpGroupNonUniformBroadcastFirst",
8844 .opcode = 338,
8845 .operands = &.{
8846 .{ .kind = .id_result_type, .quantifier = .required },
8847 .{ .kind = .id_result, .quantifier = .required },
8848 .{ .kind = .id_scope, .quantifier = .required },
8849 .{ .kind = .id_ref, .quantifier = .required },
8850 },
8851 },
8852 .{
8853 .name = "OpGroupNonUniformBallot",
8854 .opcode = 339,
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 = "OpGroupNonUniformInverseBallot",
8864 .opcode = 340,
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 = "OpGroupNonUniformBallotBitExtract",
8874 .opcode = 341,
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 .{ .kind = .id_ref, .quantifier = .required },
8881 },
8882 },
8883 .{
8884 .name = "OpGroupNonUniformBallotBitCount",
8885 .opcode = 342,
8886 .operands = &.{
8887 .{ .kind = .id_result_type, .quantifier = .required },
8888 .{ .kind = .id_result, .quantifier = .required },
8889 .{ .kind = .id_scope, .quantifier = .required },
8890 .{ .kind = .group_operation, .quantifier = .required },
8891 .{ .kind = .id_ref, .quantifier = .required },
8892 },
8893 },
8894 .{
8895 .name = "OpGroupNonUniformBallotFindLSB",
8896 .opcode = 343,
8897 .operands = &.{
8898 .{ .kind = .id_result_type, .quantifier = .required },
8899 .{ .kind = .id_result, .quantifier = .required },
8900 .{ .kind = .id_scope, .quantifier = .required },
8901 .{ .kind = .id_ref, .quantifier = .required },
8902 },
8903 },
8904 .{
8905 .name = "OpGroupNonUniformBallotFindMSB",
8906 .opcode = 344,
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 = "OpGroupNonUniformShuffle",
8916 .opcode = 345,
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 .{ .kind = .id_ref, .quantifier = .required },
8923 },
8924 },
8925 .{
8926 .name = "OpGroupNonUniformShuffleXor",
8927 .opcode = 346,
8928 .operands = &.{
8929 .{ .kind = .id_result_type, .quantifier = .required },
8930 .{ .kind = .id_result, .quantifier = .required },
8931 .{ .kind = .id_scope, .quantifier = .required },
8932 .{ .kind = .id_ref, .quantifier = .required },
8933 .{ .kind = .id_ref, .quantifier = .required },
8934 },
8935 },
8936 .{
8937 .name = "OpGroupNonUniformShuffleUp",
8938 .opcode = 347,
8939 .operands = &.{
8940 .{ .kind = .id_result_type, .quantifier = .required },
8941 .{ .kind = .id_result, .quantifier = .required },
8942 .{ .kind = .id_scope, .quantifier = .required },
8943 .{ .kind = .id_ref, .quantifier = .required },
8944 .{ .kind = .id_ref, .quantifier = .required },
8945 },
8946 },
8947 .{
8948 .name = "OpGroupNonUniformShuffleDown",
8949 .opcode = 348,
8950 .operands = &.{
8951 .{ .kind = .id_result_type, .quantifier = .required },
8952 .{ .kind = .id_result, .quantifier = .required },
8953 .{ .kind = .id_scope, .quantifier = .required },
8954 .{ .kind = .id_ref, .quantifier = .required },
8955 .{ .kind = .id_ref, .quantifier = .required },
8956 },
8957 },
8958 .{
8959 .name = "OpGroupNonUniformIAdd",
8960 .opcode = 349,
8961 .operands = &.{
8962 .{ .kind = .id_result_type, .quantifier = .required },
8963 .{ .kind = .id_result, .quantifier = .required },
8964 .{ .kind = .id_scope, .quantifier = .required },
8965 .{ .kind = .group_operation, .quantifier = .required },
8966 .{ .kind = .id_ref, .quantifier = .required },
8967 .{ .kind = .id_ref, .quantifier = .optional },
8968 },
8969 },
8970 .{
8971 .name = "OpGroupNonUniformFAdd",
8972 .opcode = 350,
8973 .operands = &.{
8974 .{ .kind = .id_result_type, .quantifier = .required },
8975 .{ .kind = .id_result, .quantifier = .required },
8976 .{ .kind = .id_scope, .quantifier = .required },
8977 .{ .kind = .group_operation, .quantifier = .required },
8978 .{ .kind = .id_ref, .quantifier = .required },
8979 .{ .kind = .id_ref, .quantifier = .optional },
8980 },
8981 },
8982 .{
8983 .name = "OpGroupNonUniformIMul",
8984 .opcode = 351,
8985 .operands = &.{
8986 .{ .kind = .id_result_type, .quantifier = .required },
8987 .{ .kind = .id_result, .quantifier = .required },
8988 .{ .kind = .id_scope, .quantifier = .required },
8989 .{ .kind = .group_operation, .quantifier = .required },
8990 .{ .kind = .id_ref, .quantifier = .required },
8991 .{ .kind = .id_ref, .quantifier = .optional },
8992 },
8993 },
8994 .{
8995 .name = "OpGroupNonUniformFMul",
8996 .opcode = 352,
8997 .operands = &.{
8998 .{ .kind = .id_result_type, .quantifier = .required },
8999 .{ .kind = .id_result, .quantifier = .required },
9000 .{ .kind = .id_scope, .quantifier = .required },
9001 .{ .kind = .group_operation, .quantifier = .required },
9002 .{ .kind = .id_ref, .quantifier = .required },
9003 .{ .kind = .id_ref, .quantifier = .optional },
9004 },
9005 },
9006 .{
9007 .name = "OpGroupNonUniformSMin",
9008 .opcode = 353,
9009 .operands = &.{
9010 .{ .kind = .id_result_type, .quantifier = .required },
9011 .{ .kind = .id_result, .quantifier = .required },
9012 .{ .kind = .id_scope, .quantifier = .required },
9013 .{ .kind = .group_operation, .quantifier = .required },
9014 .{ .kind = .id_ref, .quantifier = .required },
9015 .{ .kind = .id_ref, .quantifier = .optional },
9016 },
9017 },
9018 .{
9019 .name = "OpGroupNonUniformUMin",
9020 .opcode = 354,
9021 .operands = &.{
9022 .{ .kind = .id_result_type, .quantifier = .required },
9023 .{ .kind = .id_result, .quantifier = .required },
9024 .{ .kind = .id_scope, .quantifier = .required },
9025 .{ .kind = .group_operation, .quantifier = .required },
9026 .{ .kind = .id_ref, .quantifier = .required },
9027 .{ .kind = .id_ref, .quantifier = .optional },
9028 },
9029 },
9030 .{
9031 .name = "OpGroupNonUniformFMin",
9032 .opcode = 355,
9033 .operands = &.{
9034 .{ .kind = .id_result_type, .quantifier = .required },
9035 .{ .kind = .id_result, .quantifier = .required },
9036 .{ .kind = .id_scope, .quantifier = .required },
9037 .{ .kind = .group_operation, .quantifier = .required },
9038 .{ .kind = .id_ref, .quantifier = .required },
9039 .{ .kind = .id_ref, .quantifier = .optional },
9040 },
9041 },
9042 .{
9043 .name = "OpGroupNonUniformSMax",
9044 .opcode = 356,
9045 .operands = &.{
9046 .{ .kind = .id_result_type, .quantifier = .required },
9047 .{ .kind = .id_result, .quantifier = .required },
9048 .{ .kind = .id_scope, .quantifier = .required },
9049 .{ .kind = .group_operation, .quantifier = .required },
9050 .{ .kind = .id_ref, .quantifier = .required },
9051 .{ .kind = .id_ref, .quantifier = .optional },
9052 },
9053 },
9054 .{
9055 .name = "OpGroupNonUniformUMax",
9056 .opcode = 357,
9057 .operands = &.{
9058 .{ .kind = .id_result_type, .quantifier = .required },
9059 .{ .kind = .id_result, .quantifier = .required },
9060 .{ .kind = .id_scope, .quantifier = .required },
9061 .{ .kind = .group_operation, .quantifier = .required },
9062 .{ .kind = .id_ref, .quantifier = .required },
9063 .{ .kind = .id_ref, .quantifier = .optional },
9064 },
9065 },
9066 .{
9067 .name = "OpGroupNonUniformFMax",
9068 .opcode = 358,
9069 .operands = &.{
9070 .{ .kind = .id_result_type, .quantifier = .required },
9071 .{ .kind = .id_result, .quantifier = .required },
9072 .{ .kind = .id_scope, .quantifier = .required },
9073 .{ .kind = .group_operation, .quantifier = .required },
9074 .{ .kind = .id_ref, .quantifier = .required },
9075 .{ .kind = .id_ref, .quantifier = .optional },
9076 },
9077 },
9078 .{
9079 .name = "OpGroupNonUniformBitwiseAnd",
9080 .opcode = 359,
9081 .operands = &.{
9082 .{ .kind = .id_result_type, .quantifier = .required },
9083 .{ .kind = .id_result, .quantifier = .required },
9084 .{ .kind = .id_scope, .quantifier = .required },
9085 .{ .kind = .group_operation, .quantifier = .required },
9086 .{ .kind = .id_ref, .quantifier = .required },
9087 .{ .kind = .id_ref, .quantifier = .optional },
9088 },
9089 },
9090 .{
9091 .name = "OpGroupNonUniformBitwiseOr",
9092 .opcode = 360,
9093 .operands = &.{
9094 .{ .kind = .id_result_type, .quantifier = .required },
9095 .{ .kind = .id_result, .quantifier = .required },
9096 .{ .kind = .id_scope, .quantifier = .required },
9097 .{ .kind = .group_operation, .quantifier = .required },
9098 .{ .kind = .id_ref, .quantifier = .required },
9099 .{ .kind = .id_ref, .quantifier = .optional },
9100 },
9101 },
9102 .{
9103 .name = "OpGroupNonUniformBitwiseXor",
9104 .opcode = 361,
9105 .operands = &.{
9106 .{ .kind = .id_result_type, .quantifier = .required },
9107 .{ .kind = .id_result, .quantifier = .required },
9108 .{ .kind = .id_scope, .quantifier = .required },
9109 .{ .kind = .group_operation, .quantifier = .required },
9110 .{ .kind = .id_ref, .quantifier = .required },
9111 .{ .kind = .id_ref, .quantifier = .optional },
9112 },
9113 },
9114 .{
9115 .name = "OpGroupNonUniformLogicalAnd",
9116 .opcode = 362,
9117 .operands = &.{
9118 .{ .kind = .id_result_type, .quantifier = .required },
9119 .{ .kind = .id_result, .quantifier = .required },
9120 .{ .kind = .id_scope, .quantifier = .required },
9121 .{ .kind = .group_operation, .quantifier = .required },
9122 .{ .kind = .id_ref, .quantifier = .required },
9123 .{ .kind = .id_ref, .quantifier = .optional },
9124 },
9125 },
9126 .{
9127 .name = "OpGroupNonUniformLogicalOr",
9128 .opcode = 363,
9129 .operands = &.{
9130 .{ .kind = .id_result_type, .quantifier = .required },
9131 .{ .kind = .id_result, .quantifier = .required },
9132 .{ .kind = .id_scope, .quantifier = .required },
9133 .{ .kind = .group_operation, .quantifier = .required },
9134 .{ .kind = .id_ref, .quantifier = .required },
9135 .{ .kind = .id_ref, .quantifier = .optional },
9136 },
9137 },
9138 .{
9139 .name = "OpGroupNonUniformLogicalXor",
9140 .opcode = 364,
9141 .operands = &.{
9142 .{ .kind = .id_result_type, .quantifier = .required },
9143 .{ .kind = .id_result, .quantifier = .required },
9144 .{ .kind = .id_scope, .quantifier = .required },
9145 .{ .kind = .group_operation, .quantifier = .required },
9146 .{ .kind = .id_ref, .quantifier = .required },
9147 .{ .kind = .id_ref, .quantifier = .optional },
9148 },
9149 },
9150 .{
9151 .name = "OpGroupNonUniformQuadBroadcast",
9152 .opcode = 365,
9153 .operands = &.{
9154 .{ .kind = .id_result_type, .quantifier = .required },
9155 .{ .kind = .id_result, .quantifier = .required },
9156 .{ .kind = .id_scope, .quantifier = .required },
9157 .{ .kind = .id_ref, .quantifier = .required },
9158 .{ .kind = .id_ref, .quantifier = .required },
9159 },
9160 },
9161 .{
9162 .name = "OpGroupNonUniformQuadSwap",
9163 .opcode = 366,
9164 .operands = &.{
9165 .{ .kind = .id_result_type, .quantifier = .required },
9166 .{ .kind = .id_result, .quantifier = .required },
9167 .{ .kind = .id_scope, .quantifier = .required },
9168 .{ .kind = .id_ref, .quantifier = .required },
9169 .{ .kind = .id_ref, .quantifier = .required },
9170 },
9171 },
9172 .{
9173 .name = "OpCopyLogical",
9174 .opcode = 400,
9175 .operands = &.{
9176 .{ .kind = .id_result_type, .quantifier = .required },
9177 .{ .kind = .id_result, .quantifier = .required },
9178 .{ .kind = .id_ref, .quantifier = .required },
9179 },
9180 },
9181 .{
9182 .name = "OpPtrEqual",
9183 .opcode = 401,
9184 .operands = &.{
9185 .{ .kind = .id_result_type, .quantifier = .required },
9186 .{ .kind = .id_result, .quantifier = .required },
9187 .{ .kind = .id_ref, .quantifier = .required },
9188 .{ .kind = .id_ref, .quantifier = .required },
9189 },
9190 },
9191 .{
9192 .name = "OpPtrNotEqual",
9193 .opcode = 402,
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 = "OpPtrDiff",
9203 .opcode = 403,
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 = "OpColorAttachmentReadEXT",
9213 .opcode = 4160,
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 = .optional },
9219 },
9220 },
9221 .{
9222 .name = "OpDepthAttachmentReadEXT",
9223 .opcode = 4161,
9224 .operands = &.{
9225 .{ .kind = .id_result_type, .quantifier = .required },
9226 .{ .kind = .id_result, .quantifier = .required },
9227 .{ .kind = .id_ref, .quantifier = .optional },
9228 },
9229 },
9230 .{
9231 .name = "OpStencilAttachmentReadEXT",
9232 .opcode = 4162,
9233 .operands = &.{
9234 .{ .kind = .id_result_type, .quantifier = .required },
9235 .{ .kind = .id_result, .quantifier = .required },
9236 .{ .kind = .id_ref, .quantifier = .optional },
9237 },
9238 },
9239 .{
9240 .name = "OpTypeTensorARM",
9241 .opcode = 4163,
9242 .operands = &.{
9243 .{ .kind = .id_result, .quantifier = .required },
9244 .{ .kind = .id_ref, .quantifier = .required },
9245 .{ .kind = .id_ref, .quantifier = .optional },
9246 .{ .kind = .id_ref, .quantifier = .optional },
9247 },
9248 },
9249 .{
9250 .name = "OpTensorReadARM",
9251 .opcode = 4164,
9252 .operands = &.{
9253 .{ .kind = .id_result_type, .quantifier = .required },
9254 .{ .kind = .id_result, .quantifier = .required },
9255 .{ .kind = .id_ref, .quantifier = .required },
9256 .{ .kind = .id_ref, .quantifier = .required },
9257 .{ .kind = .tensor_operands, .quantifier = .optional },
9258 },
9259 },
9260 .{
9261 .name = "OpTensorWriteARM",
9262 .opcode = 4165,
9263 .operands = &.{
9264 .{ .kind = .id_ref, .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 = "OpTensorQuerySizeARM",
9272 .opcode = 4166,
9273 .operands = &.{
9274 .{ .kind = .id_result_type, .quantifier = .required },
9275 .{ .kind = .id_result, .quantifier = .required },
9276 .{ .kind = .id_ref, .quantifier = .required },
9277 .{ .kind = .id_ref, .quantifier = .required },
9278 },
9279 },
9280 .{
9281 .name = "OpGraphConstantARM",
9282 .opcode = 4181,
9283 .operands = &.{
9284 .{ .kind = .id_result_type, .quantifier = .required },
9285 .{ .kind = .id_result, .quantifier = .required },
9286 .{ .kind = .literal_integer, .quantifier = .required },
9287 },
9288 },
9289 .{
9290 .name = "OpGraphEntryPointARM",
9291 .opcode = 4182,
9292 .operands = &.{
9293 .{ .kind = .id_ref, .quantifier = .required },
9294 .{ .kind = .literal_string, .quantifier = .required },
9295 .{ .kind = .id_ref, .quantifier = .variadic },
9296 },
9297 },
9298 .{
9299 .name = "OpGraphARM",
9300 .opcode = 4183,
9301 .operands = &.{
9302 .{ .kind = .id_result_type, .quantifier = .required },
9303 .{ .kind = .id_result, .quantifier = .required },
9304 },
9305 },
9306 .{
9307 .name = "OpGraphInputARM",
9308 .opcode = 4184,
9309 .operands = &.{
9310 .{ .kind = .id_result_type, .quantifier = .required },
9311 .{ .kind = .id_result, .quantifier = .required },
9312 .{ .kind = .id_ref, .quantifier = .required },
9313 .{ .kind = .id_ref, .quantifier = .variadic },
9314 },
9315 },
9316 .{
9317 .name = "OpGraphSetOutputARM",
9318 .opcode = 4185,
9319 .operands = &.{
9320 .{ .kind = .id_ref, .quantifier = .required },
9321 .{ .kind = .id_ref, .quantifier = .required },
9322 .{ .kind = .id_ref, .quantifier = .variadic },
9323 },
9324 },
9325 .{
9326 .name = "OpGraphEndARM",
9327 .opcode = 4186,
9328 .operands = &.{},
9329 },
9330 .{
9331 .name = "OpTypeGraphARM",
9332 .opcode = 4190,
9333 .operands = &.{
9334 .{ .kind = .id_result, .quantifier = .required },
9335 .{ .kind = .literal_integer, .quantifier = .required },
9336 .{ .kind = .id_ref, .quantifier = .variadic },
9337 },
9338 },
9339 .{
9340 .name = "OpTerminateInvocation",
9341 .opcode = 4416,
9342 .operands = &.{},
9343 },
9344 .{
9345 .name = "OpTypeUntypedPointerKHR",
9346 .opcode = 4417,
9347 .operands = &.{
9348 .{ .kind = .id_result, .quantifier = .required },
9349 .{ .kind = .storage_class, .quantifier = .required },
9350 },
9351 },
9352 .{
9353 .name = "OpUntypedVariableKHR",
9354 .opcode = 4418,
9355 .operands = &.{
9356 .{ .kind = .id_result_type, .quantifier = .required },
9357 .{ .kind = .id_result, .quantifier = .required },
9358 .{ .kind = .storage_class, .quantifier = .required },
9359 .{ .kind = .id_ref, .quantifier = .optional },
9360 .{ .kind = .id_ref, .quantifier = .optional },
9361 },
9362 },
9363 .{
9364 .name = "OpUntypedAccessChainKHR",
9365 .opcode = 4419,
9366 .operands = &.{
9367 .{ .kind = .id_result_type, .quantifier = .required },
9368 .{ .kind = .id_result, .quantifier = .required },
9369 .{ .kind = .id_ref, .quantifier = .required },
9370 .{ .kind = .id_ref, .quantifier = .required },
9371 .{ .kind = .id_ref, .quantifier = .variadic },
9372 },
9373 },
9374 .{
9375 .name = "OpUntypedInBoundsAccessChainKHR",
9376 .opcode = 4420,
9377 .operands = &.{
9378 .{ .kind = .id_result_type, .quantifier = .required },
9379 .{ .kind = .id_result, .quantifier = .required },
9380 .{ .kind = .id_ref, .quantifier = .required },
9381 .{ .kind = .id_ref, .quantifier = .required },
9382 .{ .kind = .id_ref, .quantifier = .variadic },
9383 },
9384 },
9385 .{
9386 .name = "OpSubgroupBallotKHR",
9387 .opcode = 4421,
9388 .operands = &.{
9389 .{ .kind = .id_result_type, .quantifier = .required },
9390 .{ .kind = .id_result, .quantifier = .required },
9391 .{ .kind = .id_ref, .quantifier = .required },
9392 },
9393 },
9394 .{
9395 .name = "OpSubgroupFirstInvocationKHR",
9396 .opcode = 4422,
9397 .operands = &.{
9398 .{ .kind = .id_result_type, .quantifier = .required },
9399 .{ .kind = .id_result, .quantifier = .required },
9400 .{ .kind = .id_ref, .quantifier = .required },
9401 },
9402 },
9403 .{
9404 .name = "OpUntypedPtrAccessChainKHR",
9405 .opcode = 4423,
9406 .operands = &.{
9407 .{ .kind = .id_result_type, .quantifier = .required },
9408 .{ .kind = .id_result, .quantifier = .required },
9409 .{ .kind = .id_ref, .quantifier = .required },
9410 .{ .kind = .id_ref, .quantifier = .required },
9411 .{ .kind = .id_ref, .quantifier = .required },
9412 .{ .kind = .id_ref, .quantifier = .variadic },
9413 },
9414 },
9415 .{
9416 .name = "OpUntypedInBoundsPtrAccessChainKHR",
9417 .opcode = 4424,
9418 .operands = &.{
9419 .{ .kind = .id_result_type, .quantifier = .required },
9420 .{ .kind = .id_result, .quantifier = .required },
9421 .{ .kind = .id_ref, .quantifier = .required },
9422 .{ .kind = .id_ref, .quantifier = .required },
9423 .{ .kind = .id_ref, .quantifier = .required },
9424 .{ .kind = .id_ref, .quantifier = .variadic },
9425 },
9426 },
9427 .{
9428 .name = "OpUntypedArrayLengthKHR",
9429 .opcode = 4425,
9430 .operands = &.{
9431 .{ .kind = .id_result_type, .quantifier = .required },
9432 .{ .kind = .id_result, .quantifier = .required },
9433 .{ .kind = .id_ref, .quantifier = .required },
9434 .{ .kind = .id_ref, .quantifier = .required },
9435 .{ .kind = .literal_integer, .quantifier = .required },
9436 },
9437 },
9438 .{
9439 .name = "OpUntypedPrefetchKHR",
9440 .opcode = 4426,
9441 .operands = &.{
9442 .{ .kind = .id_ref, .quantifier = .required },
9443 .{ .kind = .id_ref, .quantifier = .required },
9444 .{ .kind = .id_ref, .quantifier = .optional },
9445 .{ .kind = .id_ref, .quantifier = .optional },
9446 .{ .kind = .id_ref, .quantifier = .optional },
9447 },
9448 },
9449 .{
9450 .name = "OpSubgroupAllKHR",
9451 .opcode = 4428,
9452 .operands = &.{
9453 .{ .kind = .id_result_type, .quantifier = .required },
9454 .{ .kind = .id_result, .quantifier = .required },
9455 .{ .kind = .id_ref, .quantifier = .required },
9456 },
9457 },
9458 .{
9459 .name = "OpSubgroupAnyKHR",
9460 .opcode = 4429,
9461 .operands = &.{
9462 .{ .kind = .id_result_type, .quantifier = .required },
9463 .{ .kind = .id_result, .quantifier = .required },
9464 .{ .kind = .id_ref, .quantifier = .required },
9465 },
9466 },
9467 .{
9468 .name = "OpSubgroupAllEqualKHR",
9469 .opcode = 4430,
9470 .operands = &.{
9471 .{ .kind = .id_result_type, .quantifier = .required },
9472 .{ .kind = .id_result, .quantifier = .required },
9473 .{ .kind = .id_ref, .quantifier = .required },
9474 },
9475 },
9476 .{
9477 .name = "OpGroupNonUniformRotateKHR",
9478 .opcode = 4431,
9479 .operands = &.{
9480 .{ .kind = .id_result_type, .quantifier = .required },
9481 .{ .kind = .id_result, .quantifier = .required },
9482 .{ .kind = .id_scope, .quantifier = .required },
9483 .{ .kind = .id_ref, .quantifier = .required },
9484 .{ .kind = .id_ref, .quantifier = .required },
9485 .{ .kind = .id_ref, .quantifier = .optional },
9486 },
9487 },
9488 .{
9489 .name = "OpSubgroupReadInvocationKHR",
9490 .opcode = 4432,
9491 .operands = &.{
9492 .{ .kind = .id_result_type, .quantifier = .required },
9493 .{ .kind = .id_result, .quantifier = .required },
9494 .{ .kind = .id_ref, .quantifier = .required },
9495 .{ .kind = .id_ref, .quantifier = .required },
9496 },
9497 },
9498 .{
9499 .name = "OpExtInstWithForwardRefsKHR",
9500 .opcode = 4433,
9501 .operands = &.{
9502 .{ .kind = .id_result_type, .quantifier = .required },
9503 .{ .kind = .id_result, .quantifier = .required },
9504 .{ .kind = .id_ref, .quantifier = .required },
9505 .{ .kind = .literal_ext_inst_integer, .quantifier = .required },
9506 .{ .kind = .id_ref, .quantifier = .variadic },
9507 },
9508 },
9509 .{
9510 .name = "OpTraceRayKHR",
9511 .opcode = 4445,
9512 .operands = &.{
9513 .{ .kind = .id_ref, .quantifier = .required },
9514 .{ .kind = .id_ref, .quantifier = .required },
9515 .{ .kind = .id_ref, .quantifier = .required },
9516 .{ .kind = .id_ref, .quantifier = .required },
9517 .{ .kind = .id_ref, .quantifier = .required },
9518 .{ .kind = .id_ref, .quantifier = .required },
9519 .{ .kind = .id_ref, .quantifier = .required },
9520 .{ .kind = .id_ref, .quantifier = .required },
9521 .{ .kind = .id_ref, .quantifier = .required },
9522 .{ .kind = .id_ref, .quantifier = .required },
9523 .{ .kind = .id_ref, .quantifier = .required },
9524 },
9525 },
9526 .{
9527 .name = "OpExecuteCallableKHR",
9528 .opcode = 4446,
9529 .operands = &.{
9530 .{ .kind = .id_ref, .quantifier = .required },
9531 .{ .kind = .id_ref, .quantifier = .required },
9532 },
9533 },
9534 .{
9535 .name = "OpConvertUToAccelerationStructureKHR",
9536 .opcode = 4447,
9537 .operands = &.{
9538 .{ .kind = .id_result_type, .quantifier = .required },
9539 .{ .kind = .id_result, .quantifier = .required },
9540 .{ .kind = .id_ref, .quantifier = .required },
9541 },
9542 },
9543 .{
9544 .name = "OpIgnoreIntersectionKHR",
9545 .opcode = 4448,
9546 .operands = &.{},
9547 },
9548 .{
9549 .name = "OpTerminateRayKHR",
9550 .opcode = 4449,
9551 .operands = &.{},
9552 },
9553 .{
9554 .name = "OpSDot",
9555 .opcode = 4450,
9556 .operands = &.{
9557 .{ .kind = .id_result_type, .quantifier = .required },
9558 .{ .kind = .id_result, .quantifier = .required },
9559 .{ .kind = .id_ref, .quantifier = .required },
9560 .{ .kind = .id_ref, .quantifier = .required },
9561 .{ .kind = .packed_vector_format, .quantifier = .optional },
9562 },
9563 },
9564 .{
9565 .name = "OpUDot",
9566 .opcode = 4451,
9567 .operands = &.{
9568 .{ .kind = .id_result_type, .quantifier = .required },
9569 .{ .kind = .id_result, .quantifier = .required },
9570 .{ .kind = .id_ref, .quantifier = .required },
9571 .{ .kind = .id_ref, .quantifier = .required },
9572 .{ .kind = .packed_vector_format, .quantifier = .optional },
9573 },
9574 },
9575 .{
9576 .name = "OpSUDot",
9577 .opcode = 4452,
9578 .operands = &.{
9579 .{ .kind = .id_result_type, .quantifier = .required },
9580 .{ .kind = .id_result, .quantifier = .required },
9581 .{ .kind = .id_ref, .quantifier = .required },
9582 .{ .kind = .id_ref, .quantifier = .required },
9583 .{ .kind = .packed_vector_format, .quantifier = .optional },
9584 },
9585 },
9586 .{
9587 .name = "OpSDotAccSat",
9588 .opcode = 4453,
9589 .operands = &.{
9590 .{ .kind = .id_result_type, .quantifier = .required },
9591 .{ .kind = .id_result, .quantifier = .required },
9592 .{ .kind = .id_ref, .quantifier = .required },
9593 .{ .kind = .id_ref, .quantifier = .required },
9594 .{ .kind = .id_ref, .quantifier = .required },
9595 .{ .kind = .packed_vector_format, .quantifier = .optional },
9596 },
9597 },
9598 .{
9599 .name = "OpUDotAccSat",
9600 .opcode = 4454,
9601 .operands = &.{
9602 .{ .kind = .id_result_type, .quantifier = .required },
9603 .{ .kind = .id_result, .quantifier = .required },
9604 .{ .kind = .id_ref, .quantifier = .required },
9605 .{ .kind = .id_ref, .quantifier = .required },
9606 .{ .kind = .id_ref, .quantifier = .required },
9607 .{ .kind = .packed_vector_format, .quantifier = .optional },
9608 },
9609 },
9610 .{
9611 .name = "OpSUDotAccSat",
9612 .opcode = 4455,
9613 .operands = &.{
9614 .{ .kind = .id_result_type, .quantifier = .required },
9615 .{ .kind = .id_result, .quantifier = .required },
9616 .{ .kind = .id_ref, .quantifier = .required },
9617 .{ .kind = .id_ref, .quantifier = .required },
9618 .{ .kind = .id_ref, .quantifier = .required },
9619 .{ .kind = .packed_vector_format, .quantifier = .optional },
9620 },
9621 },
9622 .{
9623 .name = "OpTypeCooperativeMatrixKHR",
9624 .opcode = 4456,
9625 .operands = &.{
9626 .{ .kind = .id_result, .quantifier = .required },
9627 .{ .kind = .id_ref, .quantifier = .required },
9628 .{ .kind = .id_scope, .quantifier = .required },
9629 .{ .kind = .id_ref, .quantifier = .required },
9630 .{ .kind = .id_ref, .quantifier = .required },
9631 .{ .kind = .id_ref, .quantifier = .required },
9632 },
9633 },
9634 .{
9635 .name = "OpCooperativeMatrixLoadKHR",
9636 .opcode = 4457,
9637 .operands = &.{
9638 .{ .kind = .id_result_type, .quantifier = .required },
9639 .{ .kind = .id_result, .quantifier = .required },
9640 .{ .kind = .id_ref, .quantifier = .required },
9641 .{ .kind = .id_ref, .quantifier = .required },
9642 .{ .kind = .id_ref, .quantifier = .optional },
9643 .{ .kind = .memory_access, .quantifier = .optional },
9644 },
9645 },
9646 .{
9647 .name = "OpCooperativeMatrixStoreKHR",
9648 .opcode = 4458,
9649 .operands = &.{
9650 .{ .kind = .id_ref, .quantifier = .required },
9651 .{ .kind = .id_ref, .quantifier = .required },
9652 .{ .kind = .id_ref, .quantifier = .required },
9653 .{ .kind = .id_ref, .quantifier = .optional },
9654 .{ .kind = .memory_access, .quantifier = .optional },
9655 },
9656 },
9657 .{
9658 .name = "OpCooperativeMatrixMulAddKHR",
9659 .opcode = 4459,
9660 .operands = &.{
9661 .{ .kind = .id_result_type, .quantifier = .required },
9662 .{ .kind = .id_result, .quantifier = .required },
9663 .{ .kind = .id_ref, .quantifier = .required },
9664 .{ .kind = .id_ref, .quantifier = .required },
9665 .{ .kind = .id_ref, .quantifier = .required },
9666 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
9667 },
9668 },
9669 .{
9670 .name = "OpCooperativeMatrixLengthKHR",
9671 .opcode = 4460,
9672 .operands = &.{
9673 .{ .kind = .id_result_type, .quantifier = .required },
9674 .{ .kind = .id_result, .quantifier = .required },
9675 .{ .kind = .id_ref, .quantifier = .required },
9676 },
9677 },
9678 .{
9679 .name = "OpConstantCompositeReplicateEXT",
9680 .opcode = 4461,
9681 .operands = &.{
9682 .{ .kind = .id_result_type, .quantifier = .required },
9683 .{ .kind = .id_result, .quantifier = .required },
9684 .{ .kind = .id_ref, .quantifier = .required },
9685 },
9686 },
9687 .{
9688 .name = "OpSpecConstantCompositeReplicateEXT",
9689 .opcode = 4462,
9690 .operands = &.{
9691 .{ .kind = .id_result_type, .quantifier = .required },
9692 .{ .kind = .id_result, .quantifier = .required },
9693 .{ .kind = .id_ref, .quantifier = .required },
9694 },
9695 },
9696 .{
9697 .name = "OpCompositeConstructReplicateEXT",
9698 .opcode = 4463,
9699 .operands = &.{
9700 .{ .kind = .id_result_type, .quantifier = .required },
9701 .{ .kind = .id_result, .quantifier = .required },
9702 .{ .kind = .id_ref, .quantifier = .required },
9703 },
9704 },
9705 .{
9706 .name = "OpTypeRayQueryKHR",
9707 .opcode = 4472,
9708 .operands = &.{
9709 .{ .kind = .id_result, .quantifier = .required },
9710 },
9711 },
9712 .{
9713 .name = "OpRayQueryInitializeKHR",
9714 .opcode = 4473,
9715 .operands = &.{
9716 .{ .kind = .id_ref, .quantifier = .required },
9717 .{ .kind = .id_ref, .quantifier = .required },
9718 .{ .kind = .id_ref, .quantifier = .required },
9719 .{ .kind = .id_ref, .quantifier = .required },
9720 .{ .kind = .id_ref, .quantifier = .required },
9721 .{ .kind = .id_ref, .quantifier = .required },
9722 .{ .kind = .id_ref, .quantifier = .required },
9723 .{ .kind = .id_ref, .quantifier = .required },
9724 },
9725 },
9726 .{
9727 .name = "OpRayQueryTerminateKHR",
9728 .opcode = 4474,
9729 .operands = &.{
9730 .{ .kind = .id_ref, .quantifier = .required },
9731 },
9732 },
9733 .{
9734 .name = "OpRayQueryGenerateIntersectionKHR",
9735 .opcode = 4475,
9736 .operands = &.{
9737 .{ .kind = .id_ref, .quantifier = .required },
9738 .{ .kind = .id_ref, .quantifier = .required },
9739 },
9740 },
9741 .{
9742 .name = "OpRayQueryConfirmIntersectionKHR",
9743 .opcode = 4476,
9744 .operands = &.{
9745 .{ .kind = .id_ref, .quantifier = .required },
9746 },
9747 },
9748 .{
9749 .name = "OpRayQueryProceedKHR",
9750 .opcode = 4477,
9751 .operands = &.{
9752 .{ .kind = .id_result_type, .quantifier = .required },
9753 .{ .kind = .id_result, .quantifier = .required },
9754 .{ .kind = .id_ref, .quantifier = .required },
9755 },
9756 },
9757 .{
9758 .name = "OpRayQueryGetIntersectionTypeKHR",
9759 .opcode = 4479,
9760 .operands = &.{
9761 .{ .kind = .id_result_type, .quantifier = .required },
9762 .{ .kind = .id_result, .quantifier = .required },
9763 .{ .kind = .id_ref, .quantifier = .required },
9764 .{ .kind = .id_ref, .quantifier = .required },
9765 },
9766 },
9767 .{
9768 .name = "OpImageSampleWeightedQCOM",
9769 .opcode = 4480,
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 .{ .kind = .id_ref, .quantifier = .required },
9776 },
9777 },
9778 .{
9779 .name = "OpImageBoxFilterQCOM",
9780 .opcode = 4481,
9781 .operands = &.{
9782 .{ .kind = .id_result_type, .quantifier = .required },
9783 .{ .kind = .id_result, .quantifier = .required },
9784 .{ .kind = .id_ref, .quantifier = .required },
9785 .{ .kind = .id_ref, .quantifier = .required },
9786 .{ .kind = .id_ref, .quantifier = .required },
9787 },
9788 },
9789 .{
9790 .name = "OpImageBlockMatchSSDQCOM",
9791 .opcode = 4482,
9792 .operands = &.{
9793 .{ .kind = .id_result_type, .quantifier = .required },
9794 .{ .kind = .id_result, .quantifier = .required },
9795 .{ .kind = .id_ref, .quantifier = .required },
9796 .{ .kind = .id_ref, .quantifier = .required },
9797 .{ .kind = .id_ref, .quantifier = .required },
9798 .{ .kind = .id_ref, .quantifier = .required },
9799 .{ .kind = .id_ref, .quantifier = .required },
9800 },
9801 },
9802 .{
9803 .name = "OpImageBlockMatchSADQCOM",
9804 .opcode = 4483,
9805 .operands = &.{
9806 .{ .kind = .id_result_type, .quantifier = .required },
9807 .{ .kind = .id_result, .quantifier = .required },
9808 .{ .kind = .id_ref, .quantifier = .required },
9809 .{ .kind = .id_ref, .quantifier = .required },
9810 .{ .kind = .id_ref, .quantifier = .required },
9811 .{ .kind = .id_ref, .quantifier = .required },
9812 .{ .kind = .id_ref, .quantifier = .required },
9813 },
9814 },
9815 .{
9816 .name = "OpImageBlockMatchWindowSSDQCOM",
9817 .opcode = 4500,
9818 .operands = &.{
9819 .{ .kind = .id_result_type, .quantifier = .required },
9820 .{ .kind = .id_result, .quantifier = .required },
9821 .{ .kind = .id_ref, .quantifier = .required },
9822 .{ .kind = .id_ref, .quantifier = .required },
9823 .{ .kind = .id_ref, .quantifier = .required },
9824 .{ .kind = .id_ref, .quantifier = .required },
9825 .{ .kind = .id_ref, .quantifier = .required },
9826 },
9827 },
9828 .{
9829 .name = "OpImageBlockMatchWindowSADQCOM",
9830 .opcode = 4501,
9831 .operands = &.{
9832 .{ .kind = .id_result_type, .quantifier = .required },
9833 .{ .kind = .id_result, .quantifier = .required },
9834 .{ .kind = .id_ref, .quantifier = .required },
9835 .{ .kind = .id_ref, .quantifier = .required },
9836 .{ .kind = .id_ref, .quantifier = .required },
9837 .{ .kind = .id_ref, .quantifier = .required },
9838 .{ .kind = .id_ref, .quantifier = .required },
9839 },
9840 },
9841 .{
9842 .name = "OpImageBlockMatchGatherSSDQCOM",
9843 .opcode = 4502,
9844 .operands = &.{
9845 .{ .kind = .id_result_type, .quantifier = .required },
9846 .{ .kind = .id_result, .quantifier = .required },
9847 .{ .kind = .id_ref, .quantifier = .required },
9848 .{ .kind = .id_ref, .quantifier = .required },
9849 .{ .kind = .id_ref, .quantifier = .required },
9850 .{ .kind = .id_ref, .quantifier = .required },
9851 .{ .kind = .id_ref, .quantifier = .required },
9852 },
9853 },
9854 .{
9855 .name = "OpImageBlockMatchGatherSADQCOM",
9856 .opcode = 4503,
9857 .operands = &.{
9858 .{ .kind = .id_result_type, .quantifier = .required },
9859 .{ .kind = .id_result, .quantifier = .required },
9860 .{ .kind = .id_ref, .quantifier = .required },
9861 .{ .kind = .id_ref, .quantifier = .required },
9862 .{ .kind = .id_ref, .quantifier = .required },
9863 .{ .kind = .id_ref, .quantifier = .required },
9864 .{ .kind = .id_ref, .quantifier = .required },
9865 },
9866 },
9867 .{
9868 .name = "OpGroupIAddNonUniformAMD",
9869 .opcode = 5000,
9870 .operands = &.{
9871 .{ .kind = .id_result_type, .quantifier = .required },
9872 .{ .kind = .id_result, .quantifier = .required },
9873 .{ .kind = .id_scope, .quantifier = .required },
9874 .{ .kind = .group_operation, .quantifier = .required },
9875 .{ .kind = .id_ref, .quantifier = .required },
9876 },
9877 },
9878 .{
9879 .name = "OpGroupFAddNonUniformAMD",
9880 .opcode = 5001,
9881 .operands = &.{
9882 .{ .kind = .id_result_type, .quantifier = .required },
9883 .{ .kind = .id_result, .quantifier = .required },
9884 .{ .kind = .id_scope, .quantifier = .required },
9885 .{ .kind = .group_operation, .quantifier = .required },
9886 .{ .kind = .id_ref, .quantifier = .required },
9887 },
9888 },
9889 .{
9890 .name = "OpGroupFMinNonUniformAMD",
9891 .opcode = 5002,
9892 .operands = &.{
9893 .{ .kind = .id_result_type, .quantifier = .required },
9894 .{ .kind = .id_result, .quantifier = .required },
9895 .{ .kind = .id_scope, .quantifier = .required },
9896 .{ .kind = .group_operation, .quantifier = .required },
9897 .{ .kind = .id_ref, .quantifier = .required },
9898 },
9899 },
9900 .{
9901 .name = "OpGroupUMinNonUniformAMD",
9902 .opcode = 5003,
9903 .operands = &.{
9904 .{ .kind = .id_result_type, .quantifier = .required },
9905 .{ .kind = .id_result, .quantifier = .required },
9906 .{ .kind = .id_scope, .quantifier = .required },
9907 .{ .kind = .group_operation, .quantifier = .required },
9908 .{ .kind = .id_ref, .quantifier = .required },
9909 },
9910 },
9911 .{
9912 .name = "OpGroupSMinNonUniformAMD",
9913 .opcode = 5004,
9914 .operands = &.{
9915 .{ .kind = .id_result_type, .quantifier = .required },
9916 .{ .kind = .id_result, .quantifier = .required },
9917 .{ .kind = .id_scope, .quantifier = .required },
9918 .{ .kind = .group_operation, .quantifier = .required },
9919 .{ .kind = .id_ref, .quantifier = .required },
9920 },
9921 },
9922 .{
9923 .name = "OpGroupFMaxNonUniformAMD",
9924 .opcode = 5005,
9925 .operands = &.{
9926 .{ .kind = .id_result_type, .quantifier = .required },
9927 .{ .kind = .id_result, .quantifier = .required },
9928 .{ .kind = .id_scope, .quantifier = .required },
9929 .{ .kind = .group_operation, .quantifier = .required },
9930 .{ .kind = .id_ref, .quantifier = .required },
9931 },
9932 },
9933 .{
9934 .name = "OpGroupUMaxNonUniformAMD",
9935 .opcode = 5006,
9936 .operands = &.{
9937 .{ .kind = .id_result_type, .quantifier = .required },
9938 .{ .kind = .id_result, .quantifier = .required },
9939 .{ .kind = .id_scope, .quantifier = .required },
9940 .{ .kind = .group_operation, .quantifier = .required },
9941 .{ .kind = .id_ref, .quantifier = .required },
9942 },
9943 },
9944 .{
9945 .name = "OpGroupSMaxNonUniformAMD",
9946 .opcode = 5007,
9947 .operands = &.{
9948 .{ .kind = .id_result_type, .quantifier = .required },
9949 .{ .kind = .id_result, .quantifier = .required },
9950 .{ .kind = .id_scope, .quantifier = .required },
9951 .{ .kind = .group_operation, .quantifier = .required },
9952 .{ .kind = .id_ref, .quantifier = .required },
9953 },
9954 },
9955 .{
9956 .name = "OpFragmentMaskFetchAMD",
9957 .opcode = 5011,
9958 .operands = &.{
9959 .{ .kind = .id_result_type, .quantifier = .required },
9960 .{ .kind = .id_result, .quantifier = .required },
9961 .{ .kind = .id_ref, .quantifier = .required },
9962 .{ .kind = .id_ref, .quantifier = .required },
9963 },
9964 },
9965 .{
9966 .name = "OpFragmentFetchAMD",
9967 .opcode = 5012,
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 .{ .kind = .id_ref, .quantifier = .required },
9974 },
9975 },
9976 .{
9977 .name = "OpReadClockKHR",
9978 .opcode = 5056,
9979 .operands = &.{
9980 .{ .kind = .id_result_type, .quantifier = .required },
9981 .{ .kind = .id_result, .quantifier = .required },
9982 .{ .kind = .id_scope, .quantifier = .required },
9983 },
9984 },
9985 .{
9986 .name = "OpAllocateNodePayloadsAMDX",
9987 .opcode = 5074,
9988 .operands = &.{
9989 .{ .kind = .id_result_type, .quantifier = .required },
9990 .{ .kind = .id_result, .quantifier = .required },
9991 .{ .kind = .id_scope, .quantifier = .required },
9992 .{ .kind = .id_ref, .quantifier = .required },
9993 .{ .kind = .id_ref, .quantifier = .required },
9994 },
9995 },
9996 .{
9997 .name = "OpEnqueueNodePayloadsAMDX",
9998 .opcode = 5075,
9999 .operands = &.{
10000 .{ .kind = .id_ref, .quantifier = .required },
10001 },
10002 },
10003 .{
10004 .name = "OpTypeNodePayloadArrayAMDX",
10005 .opcode = 5076,
10006 .operands = &.{
10007 .{ .kind = .id_result, .quantifier = .required },
10008 .{ .kind = .id_ref, .quantifier = .required },
10009 },
10010 },
10011 .{
10012 .name = "OpFinishWritingNodePayloadAMDX",
10013 .opcode = 5078,
10014 .operands = &.{
10015 .{ .kind = .id_result_type, .quantifier = .required },
10016 .{ .kind = .id_result, .quantifier = .required },
10017 .{ .kind = .id_ref, .quantifier = .required },
10018 },
10019 },
10020 .{
10021 .name = "OpNodePayloadArrayLengthAMDX",
10022 .opcode = 5090,
10023 .operands = &.{
10024 .{ .kind = .id_result_type, .quantifier = .required },
10025 .{ .kind = .id_result, .quantifier = .required },
10026 .{ .kind = .id_ref, .quantifier = .required },
10027 },
10028 },
10029 .{
10030 .name = "OpIsNodePayloadValidAMDX",
10031 .opcode = 5101,
10032 .operands = &.{
10033 .{ .kind = .id_result_type, .quantifier = .required },
10034 .{ .kind = .id_result, .quantifier = .required },
10035 .{ .kind = .id_ref, .quantifier = .required },
10036 .{ .kind = .id_ref, .quantifier = .required },
10037 },
10038 },
10039 .{
10040 .name = "OpConstantStringAMDX",
10041 .opcode = 5103,
10042 .operands = &.{
10043 .{ .kind = .id_result, .quantifier = .required },
10044 .{ .kind = .literal_string, .quantifier = .required },
10045 },
10046 },
10047 .{
10048 .name = "OpSpecConstantStringAMDX",
10049 .opcode = 5104,
10050 .operands = &.{
10051 .{ .kind = .id_result, .quantifier = .required },
10052 .{ .kind = .literal_string, .quantifier = .required },
10053 },
10054 },
10055 .{
10056 .name = "OpGroupNonUniformQuadAllKHR",
10057 .opcode = 5110,
10058 .operands = &.{
10059 .{ .kind = .id_result_type, .quantifier = .required },
10060 .{ .kind = .id_result, .quantifier = .required },
10061 .{ .kind = .id_ref, .quantifier = .required },
10062 },
10063 },
10064 .{
10065 .name = "OpGroupNonUniformQuadAnyKHR",
10066 .opcode = 5111,
10067 .operands = &.{
10068 .{ .kind = .id_result_type, .quantifier = .required },
10069 .{ .kind = .id_result, .quantifier = .required },
10070 .{ .kind = .id_ref, .quantifier = .required },
10071 },
10072 },
10073 .{
10074 .name = "OpHitObjectRecordHitMotionNV",
10075 .opcode = 5249,
10076 .operands = &.{
10077 .{ .kind = .id_ref, .quantifier = .required },
10078 .{ .kind = .id_ref, .quantifier = .required },
10079 .{ .kind = .id_ref, .quantifier = .required },
10080 .{ .kind = .id_ref, .quantifier = .required },
10081 .{ .kind = .id_ref, .quantifier = .required },
10082 .{ .kind = .id_ref, .quantifier = .required },
10083 .{ .kind = .id_ref, .quantifier = .required },
10084 .{ .kind = .id_ref, .quantifier = .required },
10085 .{ .kind = .id_ref, .quantifier = .required },
10086 .{ .kind = .id_ref, .quantifier = .required },
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 },
10092 },
10093 .{
10094 .name = "OpHitObjectRecordHitWithIndexMotionNV",
10095 .opcode = 5250,
10096 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10102 .{ .kind = .id_ref, .quantifier = .required },
10103 .{ .kind = .id_ref, .quantifier = .required },
10104 .{ .kind = .id_ref, .quantifier = .required },
10105 .{ .kind = .id_ref, .quantifier = .required },
10106 .{ .kind = .id_ref, .quantifier = .required },
10107 .{ .kind = .id_ref, .quantifier = .required },
10108 .{ .kind = .id_ref, .quantifier = .required },
10109 .{ .kind = .id_ref, .quantifier = .required },
10110 },
10111 },
10112 .{
10113 .name = "OpHitObjectRecordMissMotionNV",
10114 .opcode = 5251,
10115 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10121 .{ .kind = .id_ref, .quantifier = .required },
10122 .{ .kind = .id_ref, .quantifier = .required },
10123 },
10124 },
10125 .{
10126 .name = "OpHitObjectGetWorldToObjectNV",
10127 .opcode = 5252,
10128 .operands = &.{
10129 .{ .kind = .id_result_type, .quantifier = .required },
10130 .{ .kind = .id_result, .quantifier = .required },
10131 .{ .kind = .id_ref, .quantifier = .required },
10132 },
10133 },
10134 .{
10135 .name = "OpHitObjectGetObjectToWorldNV",
10136 .opcode = 5253,
10137 .operands = &.{
10138 .{ .kind = .id_result_type, .quantifier = .required },
10139 .{ .kind = .id_result, .quantifier = .required },
10140 .{ .kind = .id_ref, .quantifier = .required },
10141 },
10142 },
10143 .{
10144 .name = "OpHitObjectGetObjectRayDirectionNV",
10145 .opcode = 5254,
10146 .operands = &.{
10147 .{ .kind = .id_result_type, .quantifier = .required },
10148 .{ .kind = .id_result, .quantifier = .required },
10149 .{ .kind = .id_ref, .quantifier = .required },
10150 },
10151 },
10152 .{
10153 .name = "OpHitObjectGetObjectRayOriginNV",
10154 .opcode = 5255,
10155 .operands = &.{
10156 .{ .kind = .id_result_type, .quantifier = .required },
10157 .{ .kind = .id_result, .quantifier = .required },
10158 .{ .kind = .id_ref, .quantifier = .required },
10159 },
10160 },
10161 .{
10162 .name = "OpHitObjectTraceRayMotionNV",
10163 .opcode = 5256,
10164 .operands = &.{
10165 .{ .kind = .id_ref, .quantifier = .required },
10166 .{ .kind = .id_ref, .quantifier = .required },
10167 .{ .kind = .id_ref, .quantifier = .required },
10168 .{ .kind = .id_ref, .quantifier = .required },
10169 .{ .kind = .id_ref, .quantifier = .required },
10170 .{ .kind = .id_ref, .quantifier = .required },
10171 .{ .kind = .id_ref, .quantifier = .required },
10172 .{ .kind = .id_ref, .quantifier = .required },
10173 .{ .kind = .id_ref, .quantifier = .required },
10174 .{ .kind = .id_ref, .quantifier = .required },
10175 .{ .kind = .id_ref, .quantifier = .required },
10176 .{ .kind = .id_ref, .quantifier = .required },
10177 .{ .kind = .id_ref, .quantifier = .required },
10178 },
10179 },
10180 .{
10181 .name = "OpHitObjectGetShaderRecordBufferHandleNV",
10182 .opcode = 5257,
10183 .operands = &.{
10184 .{ .kind = .id_result_type, .quantifier = .required },
10185 .{ .kind = .id_result, .quantifier = .required },
10186 .{ .kind = .id_ref, .quantifier = .required },
10187 },
10188 },
10189 .{
10190 .name = "OpHitObjectGetShaderBindingTableRecordIndexNV",
10191 .opcode = 5258,
10192 .operands = &.{
10193 .{ .kind = .id_result_type, .quantifier = .required },
10194 .{ .kind = .id_result, .quantifier = .required },
10195 .{ .kind = .id_ref, .quantifier = .required },
10196 },
10197 },
10198 .{
10199 .name = "OpHitObjectRecordEmptyNV",
10200 .opcode = 5259,
10201 .operands = &.{
10202 .{ .kind = .id_ref, .quantifier = .required },
10203 },
10204 },
10205 .{
10206 .name = "OpHitObjectTraceRayNV",
10207 .opcode = 5260,
10208 .operands = &.{
10209 .{ .kind = .id_ref, .quantifier = .required },
10210 .{ .kind = .id_ref, .quantifier = .required },
10211 .{ .kind = .id_ref, .quantifier = .required },
10212 .{ .kind = .id_ref, .quantifier = .required },
10213 .{ .kind = .id_ref, .quantifier = .required },
10214 .{ .kind = .id_ref, .quantifier = .required },
10215 .{ .kind = .id_ref, .quantifier = .required },
10216 .{ .kind = .id_ref, .quantifier = .required },
10217 .{ .kind = .id_ref, .quantifier = .required },
10218 .{ .kind = .id_ref, .quantifier = .required },
10219 .{ .kind = .id_ref, .quantifier = .required },
10220 .{ .kind = .id_ref, .quantifier = .required },
10221 },
10222 },
10223 .{
10224 .name = "OpHitObjectRecordHitNV",
10225 .opcode = 5261,
10226 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10232 .{ .kind = .id_ref, .quantifier = .required },
10233 .{ .kind = .id_ref, .quantifier = .required },
10234 .{ .kind = .id_ref, .quantifier = .required },
10235 .{ .kind = .id_ref, .quantifier = .required },
10236 .{ .kind = .id_ref, .quantifier = .required },
10237 .{ .kind = .id_ref, .quantifier = .required },
10238 .{ .kind = .id_ref, .quantifier = .required },
10239 .{ .kind = .id_ref, .quantifier = .required },
10240 },
10241 },
10242 .{
10243 .name = "OpHitObjectRecordHitWithIndexNV",
10244 .opcode = 5262,
10245 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10251 .{ .kind = .id_ref, .quantifier = .required },
10252 .{ .kind = .id_ref, .quantifier = .required },
10253 .{ .kind = .id_ref, .quantifier = .required },
10254 .{ .kind = .id_ref, .quantifier = .required },
10255 .{ .kind = .id_ref, .quantifier = .required },
10256 .{ .kind = .id_ref, .quantifier = .required },
10257 .{ .kind = .id_ref, .quantifier = .required },
10258 },
10259 },
10260 .{
10261 .name = "OpHitObjectRecordMissNV",
10262 .opcode = 5263,
10263 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10269 .{ .kind = .id_ref, .quantifier = .required },
10270 },
10271 },
10272 .{
10273 .name = "OpHitObjectExecuteShaderNV",
10274 .opcode = 5264,
10275 .operands = &.{
10276 .{ .kind = .id_ref, .quantifier = .required },
10277 .{ .kind = .id_ref, .quantifier = .required },
10278 },
10279 },
10280 .{
10281 .name = "OpHitObjectGetCurrentTimeNV",
10282 .opcode = 5265,
10283 .operands = &.{
10284 .{ .kind = .id_result_type, .quantifier = .required },
10285 .{ .kind = .id_result, .quantifier = .required },
10286 .{ .kind = .id_ref, .quantifier = .required },
10287 },
10288 },
10289 .{
10290 .name = "OpHitObjectGetAttributesNV",
10291 .opcode = 5266,
10292 .operands = &.{
10293 .{ .kind = .id_ref, .quantifier = .required },
10294 .{ .kind = .id_ref, .quantifier = .required },
10295 },
10296 },
10297 .{
10298 .name = "OpHitObjectGetHitKindNV",
10299 .opcode = 5267,
10300 .operands = &.{
10301 .{ .kind = .id_result_type, .quantifier = .required },
10302 .{ .kind = .id_result, .quantifier = .required },
10303 .{ .kind = .id_ref, .quantifier = .required },
10304 },
10305 },
10306 .{
10307 .name = "OpHitObjectGetPrimitiveIndexNV",
10308 .opcode = 5268,
10309 .operands = &.{
10310 .{ .kind = .id_result_type, .quantifier = .required },
10311 .{ .kind = .id_result, .quantifier = .required },
10312 .{ .kind = .id_ref, .quantifier = .required },
10313 },
10314 },
10315 .{
10316 .name = "OpHitObjectGetGeometryIndexNV",
10317 .opcode = 5269,
10318 .operands = &.{
10319 .{ .kind = .id_result_type, .quantifier = .required },
10320 .{ .kind = .id_result, .quantifier = .required },
10321 .{ .kind = .id_ref, .quantifier = .required },
10322 },
10323 },
10324 .{
10325 .name = "OpHitObjectGetInstanceIdNV",
10326 .opcode = 5270,
10327 .operands = &.{
10328 .{ .kind = .id_result_type, .quantifier = .required },
10329 .{ .kind = .id_result, .quantifier = .required },
10330 .{ .kind = .id_ref, .quantifier = .required },
10331 },
10332 },
10333 .{
10334 .name = "OpHitObjectGetInstanceCustomIndexNV",
10335 .opcode = 5271,
10336 .operands = &.{
10337 .{ .kind = .id_result_type, .quantifier = .required },
10338 .{ .kind = .id_result, .quantifier = .required },
10339 .{ .kind = .id_ref, .quantifier = .required },
10340 },
10341 },
10342 .{
10343 .name = "OpHitObjectGetWorldRayDirectionNV",
10344 .opcode = 5272,
10345 .operands = &.{
10346 .{ .kind = .id_result_type, .quantifier = .required },
10347 .{ .kind = .id_result, .quantifier = .required },
10348 .{ .kind = .id_ref, .quantifier = .required },
10349 },
10350 },
10351 .{
10352 .name = "OpHitObjectGetWorldRayOriginNV",
10353 .opcode = 5273,
10354 .operands = &.{
10355 .{ .kind = .id_result_type, .quantifier = .required },
10356 .{ .kind = .id_result, .quantifier = .required },
10357 .{ .kind = .id_ref, .quantifier = .required },
10358 },
10359 },
10360 .{
10361 .name = "OpHitObjectGetRayTMaxNV",
10362 .opcode = 5274,
10363 .operands = &.{
10364 .{ .kind = .id_result_type, .quantifier = .required },
10365 .{ .kind = .id_result, .quantifier = .required },
10366 .{ .kind = .id_ref, .quantifier = .required },
10367 },
10368 },
10369 .{
10370 .name = "OpHitObjectGetRayTMinNV",
10371 .opcode = 5275,
10372 .operands = &.{
10373 .{ .kind = .id_result_type, .quantifier = .required },
10374 .{ .kind = .id_result, .quantifier = .required },
10375 .{ .kind = .id_ref, .quantifier = .required },
10376 },
10377 },
10378 .{
10379 .name = "OpHitObjectIsEmptyNV",
10380 .opcode = 5276,
10381 .operands = &.{
10382 .{ .kind = .id_result_type, .quantifier = .required },
10383 .{ .kind = .id_result, .quantifier = .required },
10384 .{ .kind = .id_ref, .quantifier = .required },
10385 },
10386 },
10387 .{
10388 .name = "OpHitObjectIsHitNV",
10389 .opcode = 5277,
10390 .operands = &.{
10391 .{ .kind = .id_result_type, .quantifier = .required },
10392 .{ .kind = .id_result, .quantifier = .required },
10393 .{ .kind = .id_ref, .quantifier = .required },
10394 },
10395 },
10396 .{
10397 .name = "OpHitObjectIsMissNV",
10398 .opcode = 5278,
10399 .operands = &.{
10400 .{ .kind = .id_result_type, .quantifier = .required },
10401 .{ .kind = .id_result, .quantifier = .required },
10402 .{ .kind = .id_ref, .quantifier = .required },
10403 },
10404 },
10405 .{
10406 .name = "OpReorderThreadWithHitObjectNV",
10407 .opcode = 5279,
10408 .operands = &.{
10409 .{ .kind = .id_ref, .quantifier = .required },
10410 .{ .kind = .id_ref, .quantifier = .optional },
10411 .{ .kind = .id_ref, .quantifier = .optional },
10412 },
10413 },
10414 .{
10415 .name = "OpReorderThreadWithHintNV",
10416 .opcode = 5280,
10417 .operands = &.{
10418 .{ .kind = .id_ref, .quantifier = .required },
10419 .{ .kind = .id_ref, .quantifier = .required },
10420 },
10421 },
10422 .{
10423 .name = "OpTypeHitObjectNV",
10424 .opcode = 5281,
10425 .operands = &.{
10426 .{ .kind = .id_result, .quantifier = .required },
10427 },
10428 },
10429 .{
10430 .name = "OpImageSampleFootprintNV",
10431 .opcode = 5283,
10432 .operands = &.{
10433 .{ .kind = .id_result_type, .quantifier = .required },
10434 .{ .kind = .id_result, .quantifier = .required },
10435 .{ .kind = .id_ref, .quantifier = .required },
10436 .{ .kind = .id_ref, .quantifier = .required },
10437 .{ .kind = .id_ref, .quantifier = .required },
10438 .{ .kind = .id_ref, .quantifier = .required },
10439 .{ .kind = .image_operands, .quantifier = .optional },
10440 },
10441 },
10442 .{
10443 .name = "OpTypeCooperativeVectorNV",
10444 .opcode = 5288,
10445 .operands = &.{
10446 .{ .kind = .id_result, .quantifier = .required },
10447 .{ .kind = .id_ref, .quantifier = .required },
10448 .{ .kind = .id_ref, .quantifier = .required },
10449 },
10450 },
10451 .{
10452 .name = "OpCooperativeVectorMatrixMulNV",
10453 .opcode = 5289,
10454 .operands = &.{
10455 .{ .kind = .id_result_type, .quantifier = .required },
10456 .{ .kind = .id_result, .quantifier = .required },
10457 .{ .kind = .id_ref, .quantifier = .required },
10458 .{ .kind = .id_ref, .quantifier = .required },
10459 .{ .kind = .id_ref, .quantifier = .required },
10460 .{ .kind = .id_ref, .quantifier = .required },
10461 .{ .kind = .id_ref, .quantifier = .required },
10462 .{ .kind = .id_ref, .quantifier = .required },
10463 .{ .kind = .id_ref, .quantifier = .required },
10464 .{ .kind = .id_ref, .quantifier = .required },
10465 .{ .kind = .id_ref, .quantifier = .required },
10466 .{ .kind = .id_ref, .quantifier = .optional },
10467 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10468 },
10469 },
10470 .{
10471 .name = "OpCooperativeVectorOuterProductAccumulateNV",
10472 .opcode = 5290,
10473 .operands = &.{
10474 .{ .kind = .id_ref, .quantifier = .required },
10475 .{ .kind = .id_ref, .quantifier = .required },
10476 .{ .kind = .id_ref, .quantifier = .required },
10477 .{ .kind = .id_ref, .quantifier = .required },
10478 .{ .kind = .id_ref, .quantifier = .required },
10479 .{ .kind = .id_ref, .quantifier = .required },
10480 .{ .kind = .id_ref, .quantifier = .optional },
10481 },
10482 },
10483 .{
10484 .name = "OpCooperativeVectorReduceSumAccumulateNV",
10485 .opcode = 5291,
10486 .operands = &.{
10487 .{ .kind = .id_ref, .quantifier = .required },
10488 .{ .kind = .id_ref, .quantifier = .required },
10489 .{ .kind = .id_ref, .quantifier = .required },
10490 },
10491 },
10492 .{
10493 .name = "OpCooperativeVectorMatrixMulAddNV",
10494 .opcode = 5292,
10495 .operands = &.{
10496 .{ .kind = .id_result_type, .quantifier = .required },
10497 .{ .kind = .id_result, .quantifier = .required },
10498 .{ .kind = .id_ref, .quantifier = .required },
10499 .{ .kind = .id_ref, .quantifier = .required },
10500 .{ .kind = .id_ref, .quantifier = .required },
10501 .{ .kind = .id_ref, .quantifier = .required },
10502 .{ .kind = .id_ref, .quantifier = .required },
10503 .{ .kind = .id_ref, .quantifier = .required },
10504 .{ .kind = .id_ref, .quantifier = .required },
10505 .{ .kind = .id_ref, .quantifier = .required },
10506 .{ .kind = .id_ref, .quantifier = .required },
10507 .{ .kind = .id_ref, .quantifier = .required },
10508 .{ .kind = .id_ref, .quantifier = .required },
10509 .{ .kind = .id_ref, .quantifier = .required },
10510 .{ .kind = .id_ref, .quantifier = .optional },
10511 .{ .kind = .cooperative_matrix_operands, .quantifier = .optional },
10512 },
10513 },
10514 .{
10515 .name = "OpCooperativeMatrixConvertNV",
10516 .opcode = 5293,
10517 .operands = &.{
10518 .{ .kind = .id_result_type, .quantifier = .required },
10519 .{ .kind = .id_result, .quantifier = .required },
10520 .{ .kind = .id_ref, .quantifier = .required },
10521 },
10522 },
10523 .{
10524 .name = "OpEmitMeshTasksEXT",
10525 .opcode = 5294,
10526 .operands = &.{
10527 .{ .kind = .id_ref, .quantifier = .required },
10528 .{ .kind = .id_ref, .quantifier = .required },
10529 .{ .kind = .id_ref, .quantifier = .required },
10530 .{ .kind = .id_ref, .quantifier = .optional },
10531 },
10532 },
10533 .{
10534 .name = "OpSetMeshOutputsEXT",
10535 .opcode = 5295,
10536 .operands = &.{
10537 .{ .kind = .id_ref, .quantifier = .required },
10538 .{ .kind = .id_ref, .quantifier = .required },
10539 },
10540 },
10541 .{
10542 .name = "OpGroupNonUniformPartitionNV",
10543 .opcode = 5296,
10544 .operands = &.{
10545 .{ .kind = .id_result_type, .quantifier = .required },
10546 .{ .kind = .id_result, .quantifier = .required },
10547 .{ .kind = .id_ref, .quantifier = .required },
10548 },
10549 },
10550 .{
10551 .name = "OpWritePackedPrimitiveIndices4x8NV",
10552 .opcode = 5299,
10553 .operands = &.{
10554 .{ .kind = .id_ref, .quantifier = .required },
10555 .{ .kind = .id_ref, .quantifier = .required },
10556 },
10557 },
10558 .{
10559 .name = "OpFetchMicroTriangleVertexPositionNV",
10560 .opcode = 5300,
10561 .operands = &.{
10562 .{ .kind = .id_result_type, .quantifier = .required },
10563 .{ .kind = .id_result, .quantifier = .required },
10564 .{ .kind = .id_ref, .quantifier = .required },
10565 .{ .kind = .id_ref, .quantifier = .required },
10566 .{ .kind = .id_ref, .quantifier = .required },
10567 .{ .kind = .id_ref, .quantifier = .required },
10568 .{ .kind = .id_ref, .quantifier = .required },
10569 },
10570 },
10571 .{
10572 .name = "OpFetchMicroTriangleVertexBarycentricNV",
10573 .opcode = 5301,
10574 .operands = &.{
10575 .{ .kind = .id_result_type, .quantifier = .required },
10576 .{ .kind = .id_result, .quantifier = .required },
10577 .{ .kind = .id_ref, .quantifier = .required },
10578 .{ .kind = .id_ref, .quantifier = .required },
10579 .{ .kind = .id_ref, .quantifier = .required },
10580 .{ .kind = .id_ref, .quantifier = .required },
10581 .{ .kind = .id_ref, .quantifier = .required },
10582 },
10583 },
10584 .{
10585 .name = "OpCooperativeVectorLoadNV",
10586 .opcode = 5302,
10587 .operands = &.{
10588 .{ .kind = .id_result_type, .quantifier = .required },
10589 .{ .kind = .id_result, .quantifier = .required },
10590 .{ .kind = .id_ref, .quantifier = .required },
10591 .{ .kind = .id_ref, .quantifier = .required },
10592 .{ .kind = .memory_access, .quantifier = .optional },
10593 },
10594 },
10595 .{
10596 .name = "OpCooperativeVectorStoreNV",
10597 .opcode = 5303,
10598 .operands = &.{
10599 .{ .kind = .id_ref, .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 = "OpReportIntersectionKHR",
10607 .opcode = 5334,
10608 .operands = &.{
10609 .{ .kind = .id_result_type, .quantifier = .required },
10610 .{ .kind = .id_result, .quantifier = .required },
10611 .{ .kind = .id_ref, .quantifier = .required },
10612 .{ .kind = .id_ref, .quantifier = .required },
10613 },
10614 },
10615 .{
10616 .name = "OpIgnoreIntersectionNV",
10617 .opcode = 5335,
10618 .operands = &.{},
10619 },
10620 .{
10621 .name = "OpTerminateRayNV",
10622 .opcode = 5336,
10623 .operands = &.{},
10624 },
10625 .{
10626 .name = "OpTraceNV",
10627 .opcode = 5337,
10628 .operands = &.{
10629 .{ .kind = .id_ref, .quantifier = .required },
10630 .{ .kind = .id_ref, .quantifier = .required },
10631 .{ .kind = .id_ref, .quantifier = .required },
10632 .{ .kind = .id_ref, .quantifier = .required },
10633 .{ .kind = .id_ref, .quantifier = .required },
10634 .{ .kind = .id_ref, .quantifier = .required },
10635 .{ .kind = .id_ref, .quantifier = .required },
10636 .{ .kind = .id_ref, .quantifier = .required },
10637 .{ .kind = .id_ref, .quantifier = .required },
10638 .{ .kind = .id_ref, .quantifier = .required },
10639 .{ .kind = .id_ref, .quantifier = .required },
10640 },
10641 },
10642 .{
10643 .name = "OpTraceMotionNV",
10644 .opcode = 5338,
10645 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10651 .{ .kind = .id_ref, .quantifier = .required },
10652 .{ .kind = .id_ref, .quantifier = .required },
10653 .{ .kind = .id_ref, .quantifier = .required },
10654 .{ .kind = .id_ref, .quantifier = .required },
10655 .{ .kind = .id_ref, .quantifier = .required },
10656 .{ .kind = .id_ref, .quantifier = .required },
10657 .{ .kind = .id_ref, .quantifier = .required },
10658 },
10659 },
10660 .{
10661 .name = "OpTraceRayMotionNV",
10662 .opcode = 5339,
10663 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
10669 .{ .kind = .id_ref, .quantifier = .required },
10670 .{ .kind = .id_ref, .quantifier = .required },
10671 .{ .kind = .id_ref, .quantifier = .required },
10672 .{ .kind = .id_ref, .quantifier = .required },
10673 .{ .kind = .id_ref, .quantifier = .required },
10674 .{ .kind = .id_ref, .quantifier = .required },
10675 .{ .kind = .id_ref, .quantifier = .required },
10676 },
10677 },
10678 .{
10679 .name = "OpRayQueryGetIntersectionTriangleVertexPositionsKHR",
10680 .opcode = 5340,
10681 .operands = &.{
10682 .{ .kind = .id_result_type, .quantifier = .required },
10683 .{ .kind = .id_result, .quantifier = .required },
10684 .{ .kind = .id_ref, .quantifier = .required },
10685 .{ .kind = .id_ref, .quantifier = .required },
10686 },
10687 },
10688 .{
10689 .name = "OpTypeAccelerationStructureKHR",
10690 .opcode = 5341,
10691 .operands = &.{
10692 .{ .kind = .id_result, .quantifier = .required },
10693 },
10694 },
10695 .{
10696 .name = "OpExecuteCallableNV",
10697 .opcode = 5344,
10698 .operands = &.{
10699 .{ .kind = .id_ref, .quantifier = .required },
10700 .{ .kind = .id_ref, .quantifier = .required },
10701 },
10702 },
10703 .{
10704 .name = "OpRayQueryGetClusterIdNV",
10705 .opcode = 5345,
10706 .operands = &.{
10707 .{ .kind = .id_result_type, .quantifier = .required },
10708 .{ .kind = .id_result, .quantifier = .required },
10709 .{ .kind = .id_ref, .quantifier = .required },
10710 .{ .kind = .id_ref, .quantifier = .required },
10711 },
10712 },
10713 .{
10714 .name = "OpHitObjectGetClusterIdNV",
10715 .opcode = 5346,
10716 .operands = &.{
10717 .{ .kind = .id_result_type, .quantifier = .required },
10718 .{ .kind = .id_result, .quantifier = .required },
10719 .{ .kind = .id_ref, .quantifier = .required },
10720 },
10721 },
10722 .{
10723 .name = "OpTypeCooperativeMatrixNV",
10724 .opcode = 5358,
10725 .operands = &.{
10726 .{ .kind = .id_result, .quantifier = .required },
10727 .{ .kind = .id_ref, .quantifier = .required },
10728 .{ .kind = .id_scope, .quantifier = .required },
10729 .{ .kind = .id_ref, .quantifier = .required },
10730 .{ .kind = .id_ref, .quantifier = .required },
10731 },
10732 },
10733 .{
10734 .name = "OpCooperativeMatrixLoadNV",
10735 .opcode = 5359,
10736 .operands = &.{
10737 .{ .kind = .id_result_type, .quantifier = .required },
10738 .{ .kind = .id_result, .quantifier = .required },
10739 .{ .kind = .id_ref, .quantifier = .required },
10740 .{ .kind = .id_ref, .quantifier = .required },
10741 .{ .kind = .id_ref, .quantifier = .required },
10742 .{ .kind = .memory_access, .quantifier = .optional },
10743 },
10744 },
10745 .{
10746 .name = "OpCooperativeMatrixStoreNV",
10747 .opcode = 5360,
10748 .operands = &.{
10749 .{ .kind = .id_ref, .quantifier = .required },
10750 .{ .kind = .id_ref, .quantifier = .required },
10751 .{ .kind = .id_ref, .quantifier = .required },
10752 .{ .kind = .id_ref, .quantifier = .required },
10753 .{ .kind = .memory_access, .quantifier = .optional },
10754 },
10755 },
10756 .{
10757 .name = "OpCooperativeMatrixMulAddNV",
10758 .opcode = 5361,
10759 .operands = &.{
10760 .{ .kind = .id_result_type, .quantifier = .required },
10761 .{ .kind = .id_result, .quantifier = .required },
10762 .{ .kind = .id_ref, .quantifier = .required },
10763 .{ .kind = .id_ref, .quantifier = .required },
10764 .{ .kind = .id_ref, .quantifier = .required },
10765 },
10766 },
10767 .{
10768 .name = "OpCooperativeMatrixLengthNV",
10769 .opcode = 5362,
10770 .operands = &.{
10771 .{ .kind = .id_result_type, .quantifier = .required },
10772 .{ .kind = .id_result, .quantifier = .required },
10773 .{ .kind = .id_ref, .quantifier = .required },
10774 },
10775 },
10776 .{
10777 .name = "OpBeginInvocationInterlockEXT",
10778 .opcode = 5364,
10779 .operands = &.{},
10780 },
10781 .{
10782 .name = "OpEndInvocationInterlockEXT",
10783 .opcode = 5365,
10784 .operands = &.{},
10785 },
10786 .{
10787 .name = "OpCooperativeMatrixReduceNV",
10788 .opcode = 5366,
10789 .operands = &.{
10790 .{ .kind = .id_result_type, .quantifier = .required },
10791 .{ .kind = .id_result, .quantifier = .required },
10792 .{ .kind = .id_ref, .quantifier = .required },
10793 .{ .kind = .cooperative_matrix_reduce, .quantifier = .required },
10794 .{ .kind = .id_ref, .quantifier = .required },
10795 },
10796 },
10797 .{
10798 .name = "OpCooperativeMatrixLoadTensorNV",
10799 .opcode = 5367,
10800 .operands = &.{
10801 .{ .kind = .id_result_type, .quantifier = .required },
10802 .{ .kind = .id_result, .quantifier = .required },
10803 .{ .kind = .id_ref, .quantifier = .required },
10804 .{ .kind = .id_ref, .quantifier = .required },
10805 .{ .kind = .id_ref, .quantifier = .required },
10806 .{ .kind = .memory_access, .quantifier = .required },
10807 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10808 },
10809 },
10810 .{
10811 .name = "OpCooperativeMatrixStoreTensorNV",
10812 .opcode = 5368,
10813 .operands = &.{
10814 .{ .kind = .id_ref, .quantifier = .required },
10815 .{ .kind = .id_ref, .quantifier = .required },
10816 .{ .kind = .id_ref, .quantifier = .required },
10817 .{ .kind = .memory_access, .quantifier = .required },
10818 .{ .kind = .tensor_addressing_operands, .quantifier = .required },
10819 },
10820 },
10821 .{
10822 .name = "OpCooperativeMatrixPerElementOpNV",
10823 .opcode = 5369,
10824 .operands = &.{
10825 .{ .kind = .id_result_type, .quantifier = .required },
10826 .{ .kind = .id_result, .quantifier = .required },
10827 .{ .kind = .id_ref, .quantifier = .required },
10828 .{ .kind = .id_ref, .quantifier = .required },
10829 .{ .kind = .id_ref, .quantifier = .variadic },
10830 },
10831 },
10832 .{
10833 .name = "OpTypeTensorLayoutNV",
10834 .opcode = 5370,
10835 .operands = &.{
10836 .{ .kind = .id_result, .quantifier = .required },
10837 .{ .kind = .id_ref, .quantifier = .required },
10838 .{ .kind = .id_ref, .quantifier = .required },
10839 },
10840 },
10841 .{
10842 .name = "OpTypeTensorViewNV",
10843 .opcode = 5371,
10844 .operands = &.{
10845 .{ .kind = .id_result, .quantifier = .required },
10846 .{ .kind = .id_ref, .quantifier = .required },
10847 .{ .kind = .id_ref, .quantifier = .required },
10848 .{ .kind = .id_ref, .quantifier = .variadic },
10849 },
10850 },
10851 .{
10852 .name = "OpCreateTensorLayoutNV",
10853 .opcode = 5372,
10854 .operands = &.{
10855 .{ .kind = .id_result_type, .quantifier = .required },
10856 .{ .kind = .id_result, .quantifier = .required },
10857 },
10858 },
10859 .{
10860 .name = "OpTensorLayoutSetDimensionNV",
10861 .opcode = 5373,
10862 .operands = &.{
10863 .{ .kind = .id_result_type, .quantifier = .required },
10864 .{ .kind = .id_result, .quantifier = .required },
10865 .{ .kind = .id_ref, .quantifier = .required },
10866 .{ .kind = .id_ref, .quantifier = .variadic },
10867 },
10868 },
10869 .{
10870 .name = "OpTensorLayoutSetStrideNV",
10871 .opcode = 5374,
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 = "OpTensorLayoutSliceNV",
10881 .opcode = 5375,
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 = "OpTensorLayoutSetClampValueNV",
10891 .opcode = 5376,
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 = .required },
10897 },
10898 },
10899 .{
10900 .name = "OpCreateTensorViewNV",
10901 .opcode = 5377,
10902 .operands = &.{
10903 .{ .kind = .id_result_type, .quantifier = .required },
10904 .{ .kind = .id_result, .quantifier = .required },
10905 },
10906 },
10907 .{
10908 .name = "OpTensorViewSetDimensionNV",
10909 .opcode = 5378,
10910 .operands = &.{
10911 .{ .kind = .id_result_type, .quantifier = .required },
10912 .{ .kind = .id_result, .quantifier = .required },
10913 .{ .kind = .id_ref, .quantifier = .required },
10914 .{ .kind = .id_ref, .quantifier = .variadic },
10915 },
10916 },
10917 .{
10918 .name = "OpTensorViewSetStrideNV",
10919 .opcode = 5379,
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 = "OpDemoteToHelperInvocation",
10929 .opcode = 5380,
10930 .operands = &.{},
10931 },
10932 .{
10933 .name = "OpIsHelperInvocationEXT",
10934 .opcode = 5381,
10935 .operands = &.{
10936 .{ .kind = .id_result_type, .quantifier = .required },
10937 .{ .kind = .id_result, .quantifier = .required },
10938 },
10939 },
10940 .{
10941 .name = "OpTensorViewSetClipNV",
10942 .opcode = 5382,
10943 .operands = &.{
10944 .{ .kind = .id_result_type, .quantifier = .required },
10945 .{ .kind = .id_result, .quantifier = .required },
10946 .{ .kind = .id_ref, .quantifier = .required },
10947 .{ .kind = .id_ref, .quantifier = .required },
10948 .{ .kind = .id_ref, .quantifier = .required },
10949 .{ .kind = .id_ref, .quantifier = .required },
10950 .{ .kind = .id_ref, .quantifier = .required },
10951 },
10952 },
10953 .{
10954 .name = "OpTensorLayoutSetBlockSizeNV",
10955 .opcode = 5384,
10956 .operands = &.{
10957 .{ .kind = .id_result_type, .quantifier = .required },
10958 .{ .kind = .id_result, .quantifier = .required },
10959 .{ .kind = .id_ref, .quantifier = .required },
10960 .{ .kind = .id_ref, .quantifier = .variadic },
10961 },
10962 },
10963 .{
10964 .name = "OpCooperativeMatrixTransposeNV",
10965 .opcode = 5390,
10966 .operands = &.{
10967 .{ .kind = .id_result_type, .quantifier = .required },
10968 .{ .kind = .id_result, .quantifier = .required },
10969 .{ .kind = .id_ref, .quantifier = .required },
10970 },
10971 },
10972 .{
10973 .name = "OpConvertUToImageNV",
10974 .opcode = 5391,
10975 .operands = &.{
10976 .{ .kind = .id_result_type, .quantifier = .required },
10977 .{ .kind = .id_result, .quantifier = .required },
10978 .{ .kind = .id_ref, .quantifier = .required },
10979 },
10980 },
10981 .{
10982 .name = "OpConvertUToSamplerNV",
10983 .opcode = 5392,
10984 .operands = &.{
10985 .{ .kind = .id_result_type, .quantifier = .required },
10986 .{ .kind = .id_result, .quantifier = .required },
10987 .{ .kind = .id_ref, .quantifier = .required },
10988 },
10989 },
10990 .{
10991 .name = "OpConvertImageToUNV",
10992 .opcode = 5393,
10993 .operands = &.{
10994 .{ .kind = .id_result_type, .quantifier = .required },
10995 .{ .kind = .id_result, .quantifier = .required },
10996 .{ .kind = .id_ref, .quantifier = .required },
10997 },
10998 },
10999 .{
11000 .name = "OpConvertSamplerToUNV",
11001 .opcode = 5394,
11002 .operands = &.{
11003 .{ .kind = .id_result_type, .quantifier = .required },
11004 .{ .kind = .id_result, .quantifier = .required },
11005 .{ .kind = .id_ref, .quantifier = .required },
11006 },
11007 },
11008 .{
11009 .name = "OpConvertUToSampledImageNV",
11010 .opcode = 5395,
11011 .operands = &.{
11012 .{ .kind = .id_result_type, .quantifier = .required },
11013 .{ .kind = .id_result, .quantifier = .required },
11014 .{ .kind = .id_ref, .quantifier = .required },
11015 },
11016 },
11017 .{
11018 .name = "OpConvertSampledImageToUNV",
11019 .opcode = 5396,
11020 .operands = &.{
11021 .{ .kind = .id_result_type, .quantifier = .required },
11022 .{ .kind = .id_result, .quantifier = .required },
11023 .{ .kind = .id_ref, .quantifier = .required },
11024 },
11025 },
11026 .{
11027 .name = "OpSamplerImageAddressingModeNV",
11028 .opcode = 5397,
11029 .operands = &.{
11030 .{ .kind = .literal_integer, .quantifier = .required },
11031 },
11032 },
11033 .{
11034 .name = "OpRawAccessChainNV",
11035 .opcode = 5398,
11036 .operands = &.{
11037 .{ .kind = .id_result_type, .quantifier = .required },
11038 .{ .kind = .id_result, .quantifier = .required },
11039 .{ .kind = .id_ref, .quantifier = .required },
11040 .{ .kind = .id_ref, .quantifier = .required },
11041 .{ .kind = .id_ref, .quantifier = .required },
11042 .{ .kind = .id_ref, .quantifier = .required },
11043 .{ .kind = .raw_access_chain_operands, .quantifier = .optional },
11044 },
11045 },
11046 .{
11047 .name = "OpRayQueryGetIntersectionSpherePositionNV",
11048 .opcode = 5427,
11049 .operands = &.{
11050 .{ .kind = .id_result_type, .quantifier = .required },
11051 .{ .kind = .id_result, .quantifier = .required },
11052 .{ .kind = .id_ref, .quantifier = .required },
11053 .{ .kind = .id_ref, .quantifier = .required },
11054 },
11055 },
11056 .{
11057 .name = "OpRayQueryGetIntersectionSphereRadiusNV",
11058 .opcode = 5428,
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 = "OpRayQueryGetIntersectionLSSPositionsNV",
11068 .opcode = 5429,
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 = "OpRayQueryGetIntersectionLSSRadiiNV",
11078 .opcode = 5430,
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 = "OpRayQueryGetIntersectionLSSHitValueNV",
11088 .opcode = 5431,
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 = "OpHitObjectGetSpherePositionNV",
11098 .opcode = 5432,
11099 .operands = &.{
11100 .{ .kind = .id_result_type, .quantifier = .required },
11101 .{ .kind = .id_result, .quantifier = .required },
11102 .{ .kind = .id_ref, .quantifier = .required },
11103 },
11104 },
11105 .{
11106 .name = "OpHitObjectGetSphereRadiusNV",
11107 .opcode = 5433,
11108 .operands = &.{
11109 .{ .kind = .id_result_type, .quantifier = .required },
11110 .{ .kind = .id_result, .quantifier = .required },
11111 .{ .kind = .id_ref, .quantifier = .required },
11112 },
11113 },
11114 .{
11115 .name = "OpHitObjectGetLSSPositionsNV",
11116 .opcode = 5434,
11117 .operands = &.{
11118 .{ .kind = .id_result_type, .quantifier = .required },
11119 .{ .kind = .id_result, .quantifier = .required },
11120 .{ .kind = .id_ref, .quantifier = .required },
11121 },
11122 },
11123 .{
11124 .name = "OpHitObjectGetLSSRadiiNV",
11125 .opcode = 5435,
11126 .operands = &.{
11127 .{ .kind = .id_result_type, .quantifier = .required },
11128 .{ .kind = .id_result, .quantifier = .required },
11129 .{ .kind = .id_ref, .quantifier = .required },
11130 },
11131 },
11132 .{
11133 .name = "OpHitObjectIsSphereHitNV",
11134 .opcode = 5436,
11135 .operands = &.{
11136 .{ .kind = .id_result_type, .quantifier = .required },
11137 .{ .kind = .id_result, .quantifier = .required },
11138 .{ .kind = .id_ref, .quantifier = .required },
11139 },
11140 },
11141 .{
11142 .name = "OpHitObjectIsLSSHitNV",
11143 .opcode = 5437,
11144 .operands = &.{
11145 .{ .kind = .id_result_type, .quantifier = .required },
11146 .{ .kind = .id_result, .quantifier = .required },
11147 .{ .kind = .id_ref, .quantifier = .required },
11148 },
11149 },
11150 .{
11151 .name = "OpRayQueryIsSphereHitNV",
11152 .opcode = 5438,
11153 .operands = &.{
11154 .{ .kind = .id_result_type, .quantifier = .required },
11155 .{ .kind = .id_result, .quantifier = .required },
11156 .{ .kind = .id_ref, .quantifier = .required },
11157 .{ .kind = .id_ref, .quantifier = .required },
11158 },
11159 },
11160 .{
11161 .name = "OpRayQueryIsLSSHitNV",
11162 .opcode = 5439,
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 = "OpSubgroupShuffleINTEL",
11172 .opcode = 5571,
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 = "OpSubgroupShuffleDownINTEL",
11182 .opcode = 5572,
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 .{ .kind = .id_ref, .quantifier = .required },
11189 },
11190 },
11191 .{
11192 .name = "OpSubgroupShuffleUpINTEL",
11193 .opcode = 5573,
11194 .operands = &.{
11195 .{ .kind = .id_result_type, .quantifier = .required },
11196 .{ .kind = .id_result, .quantifier = .required },
11197 .{ .kind = .id_ref, .quantifier = .required },
11198 .{ .kind = .id_ref, .quantifier = .required },
11199 .{ .kind = .id_ref, .quantifier = .required },
11200 },
11201 },
11202 .{
11203 .name = "OpSubgroupShuffleXorINTEL",
11204 .opcode = 5574,
11205 .operands = &.{
11206 .{ .kind = .id_result_type, .quantifier = .required },
11207 .{ .kind = .id_result, .quantifier = .required },
11208 .{ .kind = .id_ref, .quantifier = .required },
11209 .{ .kind = .id_ref, .quantifier = .required },
11210 },
11211 },
11212 .{
11213 .name = "OpSubgroupBlockReadINTEL",
11214 .opcode = 5575,
11215 .operands = &.{
11216 .{ .kind = .id_result_type, .quantifier = .required },
11217 .{ .kind = .id_result, .quantifier = .required },
11218 .{ .kind = .id_ref, .quantifier = .required },
11219 },
11220 },
11221 .{
11222 .name = "OpSubgroupBlockWriteINTEL",
11223 .opcode = 5576,
11224 .operands = &.{
11225 .{ .kind = .id_ref, .quantifier = .required },
11226 .{ .kind = .id_ref, .quantifier = .required },
11227 },
11228 },
11229 .{
11230 .name = "OpSubgroupImageBlockReadINTEL",
11231 .opcode = 5577,
11232 .operands = &.{
11233 .{ .kind = .id_result_type, .quantifier = .required },
11234 .{ .kind = .id_result, .quantifier = .required },
11235 .{ .kind = .id_ref, .quantifier = .required },
11236 .{ .kind = .id_ref, .quantifier = .required },
11237 },
11238 },
11239 .{
11240 .name = "OpSubgroupImageBlockWriteINTEL",
11241 .opcode = 5578,
11242 .operands = &.{
11243 .{ .kind = .id_ref, .quantifier = .required },
11244 .{ .kind = .id_ref, .quantifier = .required },
11245 .{ .kind = .id_ref, .quantifier = .required },
11246 },
11247 },
11248 .{
11249 .name = "OpSubgroupImageMediaBlockReadINTEL",
11250 .opcode = 5580,
11251 .operands = &.{
11252 .{ .kind = .id_result_type, .quantifier = .required },
11253 .{ .kind = .id_result, .quantifier = .required },
11254 .{ .kind = .id_ref, .quantifier = .required },
11255 .{ .kind = .id_ref, .quantifier = .required },
11256 .{ .kind = .id_ref, .quantifier = .required },
11257 .{ .kind = .id_ref, .quantifier = .required },
11258 },
11259 },
11260 .{
11261 .name = "OpSubgroupImageMediaBlockWriteINTEL",
11262 .opcode = 5581,
11263 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
11269 },
11270 },
11271 .{
11272 .name = "OpUCountLeadingZerosINTEL",
11273 .opcode = 5585,
11274 .operands = &.{
11275 .{ .kind = .id_result_type, .quantifier = .required },
11276 .{ .kind = .id_result, .quantifier = .required },
11277 .{ .kind = .id_ref, .quantifier = .required },
11278 },
11279 },
11280 .{
11281 .name = "OpUCountTrailingZerosINTEL",
11282 .opcode = 5586,
11283 .operands = &.{
11284 .{ .kind = .id_result_type, .quantifier = .required },
11285 .{ .kind = .id_result, .quantifier = .required },
11286 .{ .kind = .id_ref, .quantifier = .required },
11287 },
11288 },
11289 .{
11290 .name = "OpAbsISubINTEL",
11291 .opcode = 5587,
11292 .operands = &.{
11293 .{ .kind = .id_result_type, .quantifier = .required },
11294 .{ .kind = .id_result, .quantifier = .required },
11295 .{ .kind = .id_ref, .quantifier = .required },
11296 .{ .kind = .id_ref, .quantifier = .required },
11297 },
11298 },
11299 .{
11300 .name = "OpAbsUSubINTEL",
11301 .opcode = 5588,
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 = "OpIAddSatINTEL",
11311 .opcode = 5589,
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 = "OpUAddSatINTEL",
11321 .opcode = 5590,
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 = "OpIAverageINTEL",
11331 .opcode = 5591,
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 = "OpUAverageINTEL",
11341 .opcode = 5592,
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 = "OpIAverageRoundedINTEL",
11351 .opcode = 5593,
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 = "OpUAverageRoundedINTEL",
11361 .opcode = 5594,
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 = "OpISubSatINTEL",
11371 .opcode = 5595,
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 = "OpUSubSatINTEL",
11381 .opcode = 5596,
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 = "OpIMul32x16INTEL",
11391 .opcode = 5597,
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 = "OpUMul32x16INTEL",
11401 .opcode = 5598,
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 = "OpConstantFunctionPointerINTEL",
11411 .opcode = 5600,
11412 .operands = &.{
11413 .{ .kind = .id_result_type, .quantifier = .required },
11414 .{ .kind = .id_result, .quantifier = .required },
11415 .{ .kind = .id_ref, .quantifier = .required },
11416 },
11417 },
11418 .{
11419 .name = "OpFunctionPointerCallINTEL",
11420 .opcode = 5601,
11421 .operands = &.{
11422 .{ .kind = .id_result_type, .quantifier = .required },
11423 .{ .kind = .id_result, .quantifier = .required },
11424 .{ .kind = .id_ref, .quantifier = .variadic },
11425 },
11426 },
11427 .{
11428 .name = "OpAsmTargetINTEL",
11429 .opcode = 5609,
11430 .operands = &.{
11431 .{ .kind = .id_result, .quantifier = .required },
11432 .{ .kind = .literal_string, .quantifier = .required },
11433 },
11434 },
11435 .{
11436 .name = "OpAsmINTEL",
11437 .opcode = 5610,
11438 .operands = &.{
11439 .{ .kind = .id_result_type, .quantifier = .required },
11440 .{ .kind = .id_result, .quantifier = .required },
11441 .{ .kind = .id_ref, .quantifier = .required },
11442 .{ .kind = .id_ref, .quantifier = .required },
11443 .{ .kind = .literal_string, .quantifier = .required },
11444 .{ .kind = .literal_string, .quantifier = .required },
11445 },
11446 },
11447 .{
11448 .name = "OpAsmCallINTEL",
11449 .opcode = 5611,
11450 .operands = &.{
11451 .{ .kind = .id_result_type, .quantifier = .required },
11452 .{ .kind = .id_result, .quantifier = .required },
11453 .{ .kind = .id_ref, .quantifier = .required },
11454 .{ .kind = .id_ref, .quantifier = .variadic },
11455 },
11456 },
11457 .{
11458 .name = "OpAtomicFMinEXT",
11459 .opcode = 5614,
11460 .operands = &.{
11461 .{ .kind = .id_result_type, .quantifier = .required },
11462 .{ .kind = .id_result, .quantifier = .required },
11463 .{ .kind = .id_ref, .quantifier = .required },
11464 .{ .kind = .id_scope, .quantifier = .required },
11465 .{ .kind = .id_memory_semantics, .quantifier = .required },
11466 .{ .kind = .id_ref, .quantifier = .required },
11467 },
11468 },
11469 .{
11470 .name = "OpAtomicFMaxEXT",
11471 .opcode = 5615,
11472 .operands = &.{
11473 .{ .kind = .id_result_type, .quantifier = .required },
11474 .{ .kind = .id_result, .quantifier = .required },
11475 .{ .kind = .id_ref, .quantifier = .required },
11476 .{ .kind = .id_scope, .quantifier = .required },
11477 .{ .kind = .id_memory_semantics, .quantifier = .required },
11478 .{ .kind = .id_ref, .quantifier = .required },
11479 },
11480 },
11481 .{
11482 .name = "OpAssumeTrueKHR",
11483 .opcode = 5630,
11484 .operands = &.{
11485 .{ .kind = .id_ref, .quantifier = .required },
11486 },
11487 },
11488 .{
11489 .name = "OpExpectKHR",
11490 .opcode = 5631,
11491 .operands = &.{
11492 .{ .kind = .id_result_type, .quantifier = .required },
11493 .{ .kind = .id_result, .quantifier = .required },
11494 .{ .kind = .id_ref, .quantifier = .required },
11495 .{ .kind = .id_ref, .quantifier = .required },
11496 },
11497 },
11498 .{
11499 .name = "OpDecorateString",
11500 .opcode = 5632,
11501 .operands = &.{
11502 .{ .kind = .id_ref, .quantifier = .required },
11503 .{ .kind = .decoration, .quantifier = .required },
11504 },
11505 },
11506 .{
11507 .name = "OpMemberDecorateString",
11508 .opcode = 5633,
11509 .operands = &.{
11510 .{ .kind = .id_ref, .quantifier = .required },
11511 .{ .kind = .literal_integer, .quantifier = .required },
11512 .{ .kind = .decoration, .quantifier = .required },
11513 },
11514 },
11515 .{
11516 .name = "OpVmeImageINTEL",
11517 .opcode = 5699,
11518 .operands = &.{
11519 .{ .kind = .id_result_type, .quantifier = .required },
11520 .{ .kind = .id_result, .quantifier = .required },
11521 .{ .kind = .id_ref, .quantifier = .required },
11522 .{ .kind = .id_ref, .quantifier = .required },
11523 },
11524 },
11525 .{
11526 .name = "OpTypeVmeImageINTEL",
11527 .opcode = 5700,
11528 .operands = &.{
11529 .{ .kind = .id_result, .quantifier = .required },
11530 .{ .kind = .id_ref, .quantifier = .required },
11531 },
11532 },
11533 .{
11534 .name = "OpTypeAvcImePayloadINTEL",
11535 .opcode = 5701,
11536 .operands = &.{
11537 .{ .kind = .id_result, .quantifier = .required },
11538 },
11539 },
11540 .{
11541 .name = "OpTypeAvcRefPayloadINTEL",
11542 .opcode = 5702,
11543 .operands = &.{
11544 .{ .kind = .id_result, .quantifier = .required },
11545 },
11546 },
11547 .{
11548 .name = "OpTypeAvcSicPayloadINTEL",
11549 .opcode = 5703,
11550 .operands = &.{
11551 .{ .kind = .id_result, .quantifier = .required },
11552 },
11553 },
11554 .{
11555 .name = "OpTypeAvcMcePayloadINTEL",
11556 .opcode = 5704,
11557 .operands = &.{
11558 .{ .kind = .id_result, .quantifier = .required },
11559 },
11560 },
11561 .{
11562 .name = "OpTypeAvcMceResultINTEL",
11563 .opcode = 5705,
11564 .operands = &.{
11565 .{ .kind = .id_result, .quantifier = .required },
11566 },
11567 },
11568 .{
11569 .name = "OpTypeAvcImeResultINTEL",
11570 .opcode = 5706,
11571 .operands = &.{
11572 .{ .kind = .id_result, .quantifier = .required },
11573 },
11574 },
11575 .{
11576 .name = "OpTypeAvcImeResultSingleReferenceStreamoutINTEL",
11577 .opcode = 5707,
11578 .operands = &.{
11579 .{ .kind = .id_result, .quantifier = .required },
11580 },
11581 },
11582 .{
11583 .name = "OpTypeAvcImeResultDualReferenceStreamoutINTEL",
11584 .opcode = 5708,
11585 .operands = &.{
11586 .{ .kind = .id_result, .quantifier = .required },
11587 },
11588 },
11589 .{
11590 .name = "OpTypeAvcImeSingleReferenceStreaminINTEL",
11591 .opcode = 5709,
11592 .operands = &.{
11593 .{ .kind = .id_result, .quantifier = .required },
11594 },
11595 },
11596 .{
11597 .name = "OpTypeAvcImeDualReferenceStreaminINTEL",
11598 .opcode = 5710,
11599 .operands = &.{
11600 .{ .kind = .id_result, .quantifier = .required },
11601 },
11602 },
11603 .{
11604 .name = "OpTypeAvcRefResultINTEL",
11605 .opcode = 5711,
11606 .operands = &.{
11607 .{ .kind = .id_result, .quantifier = .required },
11608 },
11609 },
11610 .{
11611 .name = "OpTypeAvcSicResultINTEL",
11612 .opcode = 5712,
11613 .operands = &.{
11614 .{ .kind = .id_result, .quantifier = .required },
11615 },
11616 },
11617 .{
11618 .name = "OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL",
11619 .opcode = 5713,
11620 .operands = &.{
11621 .{ .kind = .id_result_type, .quantifier = .required },
11622 .{ .kind = .id_result, .quantifier = .required },
11623 .{ .kind = .id_ref, .quantifier = .required },
11624 .{ .kind = .id_ref, .quantifier = .required },
11625 },
11626 },
11627 .{
11628 .name = "OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL",
11629 .opcode = 5714,
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 = "OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL",
11639 .opcode = 5715,
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 = "OpSubgroupAvcMceSetInterShapePenaltyINTEL",
11649 .opcode = 5716,
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 = "OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL",
11659 .opcode = 5717,
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 = "OpSubgroupAvcMceSetInterDirectionPenaltyINTEL",
11669 .opcode = 5718,
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 = "OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL",
11679 .opcode = 5719,
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 = "OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL",
11689 .opcode = 5720,
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 = "OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL",
11699 .opcode = 5721,
11700 .operands = &.{
11701 .{ .kind = .id_result_type, .quantifier = .required },
11702 .{ .kind = .id_result, .quantifier = .required },
11703 },
11704 },
11705 .{
11706 .name = "OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL",
11707 .opcode = 5722,
11708 .operands = &.{
11709 .{ .kind = .id_result_type, .quantifier = .required },
11710 .{ .kind = .id_result, .quantifier = .required },
11711 },
11712 },
11713 .{
11714 .name = "OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL",
11715 .opcode = 5723,
11716 .operands = &.{
11717 .{ .kind = .id_result_type, .quantifier = .required },
11718 .{ .kind = .id_result, .quantifier = .required },
11719 },
11720 },
11721 .{
11722 .name = "OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL",
11723 .opcode = 5724,
11724 .operands = &.{
11725 .{ .kind = .id_result_type, .quantifier = .required },
11726 .{ .kind = .id_result, .quantifier = .required },
11727 .{ .kind = .id_ref, .quantifier = .required },
11728 .{ .kind = .id_ref, .quantifier = .required },
11729 .{ .kind = .id_ref, .quantifier = .required },
11730 .{ .kind = .id_ref, .quantifier = .required },
11731 },
11732 },
11733 .{
11734 .name = "OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL",
11735 .opcode = 5725,
11736 .operands = &.{
11737 .{ .kind = .id_result_type, .quantifier = .required },
11738 .{ .kind = .id_result, .quantifier = .required },
11739 .{ .kind = .id_ref, .quantifier = .required },
11740 .{ .kind = .id_ref, .quantifier = .required },
11741 },
11742 },
11743 .{
11744 .name = "OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL",
11745 .opcode = 5726,
11746 .operands = &.{
11747 .{ .kind = .id_result_type, .quantifier = .required },
11748 .{ .kind = .id_result, .quantifier = .required },
11749 },
11750 },
11751 .{
11752 .name = "OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL",
11753 .opcode = 5727,
11754 .operands = &.{
11755 .{ .kind = .id_result_type, .quantifier = .required },
11756 .{ .kind = .id_result, .quantifier = .required },
11757 },
11758 },
11759 .{
11760 .name = "OpSubgroupAvcMceSetAcOnlyHaarINTEL",
11761 .opcode = 5728,
11762 .operands = &.{
11763 .{ .kind = .id_result_type, .quantifier = .required },
11764 .{ .kind = .id_result, .quantifier = .required },
11765 .{ .kind = .id_ref, .quantifier = .required },
11766 },
11767 },
11768 .{
11769 .name = "OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL",
11770 .opcode = 5729,
11771 .operands = &.{
11772 .{ .kind = .id_result_type, .quantifier = .required },
11773 .{ .kind = .id_result, .quantifier = .required },
11774 .{ .kind = .id_ref, .quantifier = .required },
11775 .{ .kind = .id_ref, .quantifier = .required },
11776 },
11777 },
11778 .{
11779 .name = "OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL",
11780 .opcode = 5730,
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 = "OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL",
11790 .opcode = 5731,
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 .{ .kind = .id_ref, .quantifier = .required },
11797 },
11798 },
11799 .{
11800 .name = "OpSubgroupAvcMceConvertToImePayloadINTEL",
11801 .opcode = 5732,
11802 .operands = &.{
11803 .{ .kind = .id_result_type, .quantifier = .required },
11804 .{ .kind = .id_result, .quantifier = .required },
11805 .{ .kind = .id_ref, .quantifier = .required },
11806 },
11807 },
11808 .{
11809 .name = "OpSubgroupAvcMceConvertToImeResultINTEL",
11810 .opcode = 5733,
11811 .operands = &.{
11812 .{ .kind = .id_result_type, .quantifier = .required },
11813 .{ .kind = .id_result, .quantifier = .required },
11814 .{ .kind = .id_ref, .quantifier = .required },
11815 },
11816 },
11817 .{
11818 .name = "OpSubgroupAvcMceConvertToRefPayloadINTEL",
11819 .opcode = 5734,
11820 .operands = &.{
11821 .{ .kind = .id_result_type, .quantifier = .required },
11822 .{ .kind = .id_result, .quantifier = .required },
11823 .{ .kind = .id_ref, .quantifier = .required },
11824 },
11825 },
11826 .{
11827 .name = "OpSubgroupAvcMceConvertToRefResultINTEL",
11828 .opcode = 5735,
11829 .operands = &.{
11830 .{ .kind = .id_result_type, .quantifier = .required },
11831 .{ .kind = .id_result, .quantifier = .required },
11832 .{ .kind = .id_ref, .quantifier = .required },
11833 },
11834 },
11835 .{
11836 .name = "OpSubgroupAvcMceConvertToSicPayloadINTEL",
11837 .opcode = 5736,
11838 .operands = &.{
11839 .{ .kind = .id_result_type, .quantifier = .required },
11840 .{ .kind = .id_result, .quantifier = .required },
11841 .{ .kind = .id_ref, .quantifier = .required },
11842 },
11843 },
11844 .{
11845 .name = "OpSubgroupAvcMceConvertToSicResultINTEL",
11846 .opcode = 5737,
11847 .operands = &.{
11848 .{ .kind = .id_result_type, .quantifier = .required },
11849 .{ .kind = .id_result, .quantifier = .required },
11850 .{ .kind = .id_ref, .quantifier = .required },
11851 },
11852 },
11853 .{
11854 .name = "OpSubgroupAvcMceGetMotionVectorsINTEL",
11855 .opcode = 5738,
11856 .operands = &.{
11857 .{ .kind = .id_result_type, .quantifier = .required },
11858 .{ .kind = .id_result, .quantifier = .required },
11859 .{ .kind = .id_ref, .quantifier = .required },
11860 },
11861 },
11862 .{
11863 .name = "OpSubgroupAvcMceGetInterDistortionsINTEL",
11864 .opcode = 5739,
11865 .operands = &.{
11866 .{ .kind = .id_result_type, .quantifier = .required },
11867 .{ .kind = .id_result, .quantifier = .required },
11868 .{ .kind = .id_ref, .quantifier = .required },
11869 },
11870 },
11871 .{
11872 .name = "OpSubgroupAvcMceGetBestInterDistortionsINTEL",
11873 .opcode = 5740,
11874 .operands = &.{
11875 .{ .kind = .id_result_type, .quantifier = .required },
11876 .{ .kind = .id_result, .quantifier = .required },
11877 .{ .kind = .id_ref, .quantifier = .required },
11878 },
11879 },
11880 .{
11881 .name = "OpSubgroupAvcMceGetInterMajorShapeINTEL",
11882 .opcode = 5741,
11883 .operands = &.{
11884 .{ .kind = .id_result_type, .quantifier = .required },
11885 .{ .kind = .id_result, .quantifier = .required },
11886 .{ .kind = .id_ref, .quantifier = .required },
11887 },
11888 },
11889 .{
11890 .name = "OpSubgroupAvcMceGetInterMinorShapeINTEL",
11891 .opcode = 5742,
11892 .operands = &.{
11893 .{ .kind = .id_result_type, .quantifier = .required },
11894 .{ .kind = .id_result, .quantifier = .required },
11895 .{ .kind = .id_ref, .quantifier = .required },
11896 },
11897 },
11898 .{
11899 .name = "OpSubgroupAvcMceGetInterDirectionsINTEL",
11900 .opcode = 5743,
11901 .operands = &.{
11902 .{ .kind = .id_result_type, .quantifier = .required },
11903 .{ .kind = .id_result, .quantifier = .required },
11904 .{ .kind = .id_ref, .quantifier = .required },
11905 },
11906 },
11907 .{
11908 .name = "OpSubgroupAvcMceGetInterMotionVectorCountINTEL",
11909 .opcode = 5744,
11910 .operands = &.{
11911 .{ .kind = .id_result_type, .quantifier = .required },
11912 .{ .kind = .id_result, .quantifier = .required },
11913 .{ .kind = .id_ref, .quantifier = .required },
11914 },
11915 },
11916 .{
11917 .name = "OpSubgroupAvcMceGetInterReferenceIdsINTEL",
11918 .opcode = 5745,
11919 .operands = &.{
11920 .{ .kind = .id_result_type, .quantifier = .required },
11921 .{ .kind = .id_result, .quantifier = .required },
11922 .{ .kind = .id_ref, .quantifier = .required },
11923 },
11924 },
11925 .{
11926 .name = "OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL",
11927 .opcode = 5746,
11928 .operands = &.{
11929 .{ .kind = .id_result_type, .quantifier = .required },
11930 .{ .kind = .id_result, .quantifier = .required },
11931 .{ .kind = .id_ref, .quantifier = .required },
11932 .{ .kind = .id_ref, .quantifier = .required },
11933 .{ .kind = .id_ref, .quantifier = .required },
11934 },
11935 },
11936 .{
11937 .name = "OpSubgroupAvcImeInitializeINTEL",
11938 .opcode = 5747,
11939 .operands = &.{
11940 .{ .kind = .id_result_type, .quantifier = .required },
11941 .{ .kind = .id_result, .quantifier = .required },
11942 .{ .kind = .id_ref, .quantifier = .required },
11943 .{ .kind = .id_ref, .quantifier = .required },
11944 .{ .kind = .id_ref, .quantifier = .required },
11945 },
11946 },
11947 .{
11948 .name = "OpSubgroupAvcImeSetSingleReferenceINTEL",
11949 .opcode = 5748,
11950 .operands = &.{
11951 .{ .kind = .id_result_type, .quantifier = .required },
11952 .{ .kind = .id_result, .quantifier = .required },
11953 .{ .kind = .id_ref, .quantifier = .required },
11954 .{ .kind = .id_ref, .quantifier = .required },
11955 .{ .kind = .id_ref, .quantifier = .required },
11956 },
11957 },
11958 .{
11959 .name = "OpSubgroupAvcImeSetDualReferenceINTEL",
11960 .opcode = 5749,
11961 .operands = &.{
11962 .{ .kind = .id_result_type, .quantifier = .required },
11963 .{ .kind = .id_result, .quantifier = .required },
11964 .{ .kind = .id_ref, .quantifier = .required },
11965 .{ .kind = .id_ref, .quantifier = .required },
11966 .{ .kind = .id_ref, .quantifier = .required },
11967 .{ .kind = .id_ref, .quantifier = .required },
11968 },
11969 },
11970 .{
11971 .name = "OpSubgroupAvcImeRefWindowSizeINTEL",
11972 .opcode = 5750,
11973 .operands = &.{
11974 .{ .kind = .id_result_type, .quantifier = .required },
11975 .{ .kind = .id_result, .quantifier = .required },
11976 .{ .kind = .id_ref, .quantifier = .required },
11977 .{ .kind = .id_ref, .quantifier = .required },
11978 },
11979 },
11980 .{
11981 .name = "OpSubgroupAvcImeAdjustRefOffsetINTEL",
11982 .opcode = 5751,
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 .{ .kind = .id_ref, .quantifier = .required },
11989 .{ .kind = .id_ref, .quantifier = .required },
11990 },
11991 },
11992 .{
11993 .name = "OpSubgroupAvcImeConvertToMcePayloadINTEL",
11994 .opcode = 5752,
11995 .operands = &.{
11996 .{ .kind = .id_result_type, .quantifier = .required },
11997 .{ .kind = .id_result, .quantifier = .required },
11998 .{ .kind = .id_ref, .quantifier = .required },
11999 },
12000 },
12001 .{
12002 .name = "OpSubgroupAvcImeSetMaxMotionVectorCountINTEL",
12003 .opcode = 5753,
12004 .operands = &.{
12005 .{ .kind = .id_result_type, .quantifier = .required },
12006 .{ .kind = .id_result, .quantifier = .required },
12007 .{ .kind = .id_ref, .quantifier = .required },
12008 .{ .kind = .id_ref, .quantifier = .required },
12009 },
12010 },
12011 .{
12012 .name = "OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL",
12013 .opcode = 5754,
12014 .operands = &.{
12015 .{ .kind = .id_result_type, .quantifier = .required },
12016 .{ .kind = .id_result, .quantifier = .required },
12017 .{ .kind = .id_ref, .quantifier = .required },
12018 },
12019 },
12020 .{
12021 .name = "OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL",
12022 .opcode = 5755,
12023 .operands = &.{
12024 .{ .kind = .id_result_type, .quantifier = .required },
12025 .{ .kind = .id_result, .quantifier = .required },
12026 .{ .kind = .id_ref, .quantifier = .required },
12027 .{ .kind = .id_ref, .quantifier = .required },
12028 },
12029 },
12030 .{
12031 .name = "OpSubgroupAvcImeSetWeightedSadINTEL",
12032 .opcode = 5756,
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 = "OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL",
12042 .opcode = 5757,
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 .{ .kind = .id_ref, .quantifier = .required },
12049 },
12050 },
12051 .{
12052 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceINTEL",
12053 .opcode = 5758,
12054 .operands = &.{
12055 .{ .kind = .id_result_type, .quantifier = .required },
12056 .{ .kind = .id_result, .quantifier = .required },
12057 .{ .kind = .id_ref, .quantifier = .required },
12058 .{ .kind = .id_ref, .quantifier = .required },
12059 .{ .kind = .id_ref, .quantifier = .required },
12060 .{ .kind = .id_ref, .quantifier = .required },
12061 },
12062 },
12063 .{
12064 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL",
12065 .opcode = 5759,
12066 .operands = &.{
12067 .{ .kind = .id_result_type, .quantifier = .required },
12068 .{ .kind = .id_result, .quantifier = .required },
12069 .{ .kind = .id_ref, .quantifier = .required },
12070 .{ .kind = .id_ref, .quantifier = .required },
12071 .{ .kind = .id_ref, .quantifier = .required },
12072 .{ .kind = .id_ref, .quantifier = .required },
12073 },
12074 },
12075 .{
12076 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL",
12077 .opcode = 5760,
12078 .operands = &.{
12079 .{ .kind = .id_result_type, .quantifier = .required },
12080 .{ .kind = .id_result, .quantifier = .required },
12081 .{ .kind = .id_ref, .quantifier = .required },
12082 .{ .kind = .id_ref, .quantifier = .required },
12083 .{ .kind = .id_ref, .quantifier = .required },
12084 .{ .kind = .id_ref, .quantifier = .required },
12085 .{ .kind = .id_ref, .quantifier = .required },
12086 },
12087 },
12088 .{
12089 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL",
12090 .opcode = 5761,
12091 .operands = &.{
12092 .{ .kind = .id_result_type, .quantifier = .required },
12093 .{ .kind = .id_result, .quantifier = .required },
12094 .{ .kind = .id_ref, .quantifier = .required },
12095 .{ .kind = .id_ref, .quantifier = .required },
12096 .{ .kind = .id_ref, .quantifier = .required },
12097 },
12098 },
12099 .{
12100 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL",
12101 .opcode = 5762,
12102 .operands = &.{
12103 .{ .kind = .id_result_type, .quantifier = .required },
12104 .{ .kind = .id_result, .quantifier = .required },
12105 .{ .kind = .id_ref, .quantifier = .required },
12106 .{ .kind = .id_ref, .quantifier = .required },
12107 .{ .kind = .id_ref, .quantifier = .required },
12108 .{ .kind = .id_ref, .quantifier = .required },
12109 },
12110 },
12111 .{
12112 .name = "OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL",
12113 .opcode = 5763,
12114 .operands = &.{
12115 .{ .kind = .id_result_type, .quantifier = .required },
12116 .{ .kind = .id_result, .quantifier = .required },
12117 .{ .kind = .id_ref, .quantifier = .required },
12118 .{ .kind = .id_ref, .quantifier = .required },
12119 .{ .kind = .id_ref, .quantifier = .required },
12120 .{ .kind = .id_ref, .quantifier = .required },
12121 },
12122 },
12123 .{
12124 .name = "OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL",
12125 .opcode = 5764,
12126 .operands = &.{
12127 .{ .kind = .id_result_type, .quantifier = .required },
12128 .{ .kind = .id_result, .quantifier = .required },
12129 .{ .kind = .id_ref, .quantifier = .required },
12130 .{ .kind = .id_ref, .quantifier = .required },
12131 .{ .kind = .id_ref, .quantifier = .required },
12132 .{ .kind = .id_ref, .quantifier = .required },
12133 .{ .kind = .id_ref, .quantifier = .required },
12134 },
12135 },
12136 .{
12137 .name = "OpSubgroupAvcImeConvertToMceResultINTEL",
12138 .opcode = 5765,
12139 .operands = &.{
12140 .{ .kind = .id_result_type, .quantifier = .required },
12141 .{ .kind = .id_result, .quantifier = .required },
12142 .{ .kind = .id_ref, .quantifier = .required },
12143 },
12144 },
12145 .{
12146 .name = "OpSubgroupAvcImeGetSingleReferenceStreaminINTEL",
12147 .opcode = 5766,
12148 .operands = &.{
12149 .{ .kind = .id_result_type, .quantifier = .required },
12150 .{ .kind = .id_result, .quantifier = .required },
12151 .{ .kind = .id_ref, .quantifier = .required },
12152 },
12153 },
12154 .{
12155 .name = "OpSubgroupAvcImeGetDualReferenceStreaminINTEL",
12156 .opcode = 5767,
12157 .operands = &.{
12158 .{ .kind = .id_result_type, .quantifier = .required },
12159 .{ .kind = .id_result, .quantifier = .required },
12160 .{ .kind = .id_ref, .quantifier = .required },
12161 },
12162 },
12163 .{
12164 .name = "OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL",
12165 .opcode = 5768,
12166 .operands = &.{
12167 .{ .kind = .id_result_type, .quantifier = .required },
12168 .{ .kind = .id_result, .quantifier = .required },
12169 .{ .kind = .id_ref, .quantifier = .required },
12170 },
12171 },
12172 .{
12173 .name = "OpSubgroupAvcImeStripDualReferenceStreamoutINTEL",
12174 .opcode = 5769,
12175 .operands = &.{
12176 .{ .kind = .id_result_type, .quantifier = .required },
12177 .{ .kind = .id_result, .quantifier = .required },
12178 .{ .kind = .id_ref, .quantifier = .required },
12179 },
12180 },
12181 .{
12182 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL",
12183 .opcode = 5770,
12184 .operands = &.{
12185 .{ .kind = .id_result_type, .quantifier = .required },
12186 .{ .kind = .id_result, .quantifier = .required },
12187 .{ .kind = .id_ref, .quantifier = .required },
12188 .{ .kind = .id_ref, .quantifier = .required },
12189 },
12190 },
12191 .{
12192 .name = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL",
12193 .opcode = 5771,
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 = "OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL",
12203 .opcode = 5772,
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 = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL",
12213 .opcode = 5773,
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 .{ .kind = .id_ref, .quantifier = .required },
12220 },
12221 },
12222 .{
12223 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL",
12224 .opcode = 5774,
12225 .operands = &.{
12226 .{ .kind = .id_result_type, .quantifier = .required },
12227 .{ .kind = .id_result, .quantifier = .required },
12228 .{ .kind = .id_ref, .quantifier = .required },
12229 .{ .kind = .id_ref, .quantifier = .required },
12230 .{ .kind = .id_ref, .quantifier = .required },
12231 },
12232 },
12233 .{
12234 .name = "OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL",
12235 .opcode = 5775,
12236 .operands = &.{
12237 .{ .kind = .id_result_type, .quantifier = .required },
12238 .{ .kind = .id_result, .quantifier = .required },
12239 .{ .kind = .id_ref, .quantifier = .required },
12240 .{ .kind = .id_ref, .quantifier = .required },
12241 .{ .kind = .id_ref, .quantifier = .required },
12242 },
12243 },
12244 .{
12245 .name = "OpSubgroupAvcImeGetBorderReachedINTEL",
12246 .opcode = 5776,
12247 .operands = &.{
12248 .{ .kind = .id_result_type, .quantifier = .required },
12249 .{ .kind = .id_result, .quantifier = .required },
12250 .{ .kind = .id_ref, .quantifier = .required },
12251 .{ .kind = .id_ref, .quantifier = .required },
12252 },
12253 },
12254 .{
12255 .name = "OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL",
12256 .opcode = 5777,
12257 .operands = &.{
12258 .{ .kind = .id_result_type, .quantifier = .required },
12259 .{ .kind = .id_result, .quantifier = .required },
12260 .{ .kind = .id_ref, .quantifier = .required },
12261 },
12262 },
12263 .{
12264 .name = "OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL",
12265 .opcode = 5778,
12266 .operands = &.{
12267 .{ .kind = .id_result_type, .quantifier = .required },
12268 .{ .kind = .id_result, .quantifier = .required },
12269 .{ .kind = .id_ref, .quantifier = .required },
12270 },
12271 },
12272 .{
12273 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL",
12274 .opcode = 5779,
12275 .operands = &.{
12276 .{ .kind = .id_result_type, .quantifier = .required },
12277 .{ .kind = .id_result, .quantifier = .required },
12278 .{ .kind = .id_ref, .quantifier = .required },
12279 },
12280 },
12281 .{
12282 .name = "OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL",
12283 .opcode = 5780,
12284 .operands = &.{
12285 .{ .kind = .id_result_type, .quantifier = .required },
12286 .{ .kind = .id_result, .quantifier = .required },
12287 .{ .kind = .id_ref, .quantifier = .required },
12288 },
12289 },
12290 .{
12291 .name = "OpSubgroupAvcFmeInitializeINTEL",
12292 .opcode = 5781,
12293 .operands = &.{
12294 .{ .kind = .id_result_type, .quantifier = .required },
12295 .{ .kind = .id_result, .quantifier = .required },
12296 .{ .kind = .id_ref, .quantifier = .required },
12297 .{ .kind = .id_ref, .quantifier = .required },
12298 .{ .kind = .id_ref, .quantifier = .required },
12299 .{ .kind = .id_ref, .quantifier = .required },
12300 .{ .kind = .id_ref, .quantifier = .required },
12301 .{ .kind = .id_ref, .quantifier = .required },
12302 .{ .kind = .id_ref, .quantifier = .required },
12303 },
12304 },
12305 .{
12306 .name = "OpSubgroupAvcBmeInitializeINTEL",
12307 .opcode = 5782,
12308 .operands = &.{
12309 .{ .kind = .id_result_type, .quantifier = .required },
12310 .{ .kind = .id_result, .quantifier = .required },
12311 .{ .kind = .id_ref, .quantifier = .required },
12312 .{ .kind = .id_ref, .quantifier = .required },
12313 .{ .kind = .id_ref, .quantifier = .required },
12314 .{ .kind = .id_ref, .quantifier = .required },
12315 .{ .kind = .id_ref, .quantifier = .required },
12316 .{ .kind = .id_ref, .quantifier = .required },
12317 .{ .kind = .id_ref, .quantifier = .required },
12318 .{ .kind = .id_ref, .quantifier = .required },
12319 },
12320 },
12321 .{
12322 .name = "OpSubgroupAvcRefConvertToMcePayloadINTEL",
12323 .opcode = 5783,
12324 .operands = &.{
12325 .{ .kind = .id_result_type, .quantifier = .required },
12326 .{ .kind = .id_result, .quantifier = .required },
12327 .{ .kind = .id_ref, .quantifier = .required },
12328 },
12329 },
12330 .{
12331 .name = "OpSubgroupAvcRefSetBidirectionalMixDisableINTEL",
12332 .opcode = 5784,
12333 .operands = &.{
12334 .{ .kind = .id_result_type, .quantifier = .required },
12335 .{ .kind = .id_result, .quantifier = .required },
12336 .{ .kind = .id_ref, .quantifier = .required },
12337 },
12338 },
12339 .{
12340 .name = "OpSubgroupAvcRefSetBilinearFilterEnableINTEL",
12341 .opcode = 5785,
12342 .operands = &.{
12343 .{ .kind = .id_result_type, .quantifier = .required },
12344 .{ .kind = .id_result, .quantifier = .required },
12345 .{ .kind = .id_ref, .quantifier = .required },
12346 },
12347 },
12348 .{
12349 .name = "OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL",
12350 .opcode = 5786,
12351 .operands = &.{
12352 .{ .kind = .id_result_type, .quantifier = .required },
12353 .{ .kind = .id_result, .quantifier = .required },
12354 .{ .kind = .id_ref, .quantifier = .required },
12355 .{ .kind = .id_ref, .quantifier = .required },
12356 .{ .kind = .id_ref, .quantifier = .required },
12357 },
12358 },
12359 .{
12360 .name = "OpSubgroupAvcRefEvaluateWithDualReferenceINTEL",
12361 .opcode = 5787,
12362 .operands = &.{
12363 .{ .kind = .id_result_type, .quantifier = .required },
12364 .{ .kind = .id_result, .quantifier = .required },
12365 .{ .kind = .id_ref, .quantifier = .required },
12366 .{ .kind = .id_ref, .quantifier = .required },
12367 .{ .kind = .id_ref, .quantifier = .required },
12368 .{ .kind = .id_ref, .quantifier = .required },
12369 },
12370 },
12371 .{
12372 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL",
12373 .opcode = 5788,
12374 .operands = &.{
12375 .{ .kind = .id_result_type, .quantifier = .required },
12376 .{ .kind = .id_result, .quantifier = .required },
12377 .{ .kind = .id_ref, .quantifier = .required },
12378 .{ .kind = .id_ref, .quantifier = .required },
12379 .{ .kind = .id_ref, .quantifier = .required },
12380 },
12381 },
12382 .{
12383 .name = "OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL",
12384 .opcode = 5789,
12385 .operands = &.{
12386 .{ .kind = .id_result_type, .quantifier = .required },
12387 .{ .kind = .id_result, .quantifier = .required },
12388 .{ .kind = .id_ref, .quantifier = .required },
12389 .{ .kind = .id_ref, .quantifier = .required },
12390 .{ .kind = .id_ref, .quantifier = .required },
12391 .{ .kind = .id_ref, .quantifier = .required },
12392 },
12393 },
12394 .{
12395 .name = "OpSubgroupAvcRefConvertToMceResultINTEL",
12396 .opcode = 5790,
12397 .operands = &.{
12398 .{ .kind = .id_result_type, .quantifier = .required },
12399 .{ .kind = .id_result, .quantifier = .required },
12400 .{ .kind = .id_ref, .quantifier = .required },
12401 },
12402 },
12403 .{
12404 .name = "OpSubgroupAvcSicInitializeINTEL",
12405 .opcode = 5791,
12406 .operands = &.{
12407 .{ .kind = .id_result_type, .quantifier = .required },
12408 .{ .kind = .id_result, .quantifier = .required },
12409 .{ .kind = .id_ref, .quantifier = .required },
12410 },
12411 },
12412 .{
12413 .name = "OpSubgroupAvcSicConfigureSkcINTEL",
12414 .opcode = 5792,
12415 .operands = &.{
12416 .{ .kind = .id_result_type, .quantifier = .required },
12417 .{ .kind = .id_result, .quantifier = .required },
12418 .{ .kind = .id_ref, .quantifier = .required },
12419 .{ .kind = .id_ref, .quantifier = .required },
12420 .{ .kind = .id_ref, .quantifier = .required },
12421 .{ .kind = .id_ref, .quantifier = .required },
12422 .{ .kind = .id_ref, .quantifier = .required },
12423 .{ .kind = .id_ref, .quantifier = .required },
12424 },
12425 },
12426 .{
12427 .name = "OpSubgroupAvcSicConfigureIpeLumaINTEL",
12428 .opcode = 5793,
12429 .operands = &.{
12430 .{ .kind = .id_result_type, .quantifier = .required },
12431 .{ .kind = .id_result, .quantifier = .required },
12432 .{ .kind = .id_ref, .quantifier = .required },
12433 .{ .kind = .id_ref, .quantifier = .required },
12434 .{ .kind = .id_ref, .quantifier = .required },
12435 .{ .kind = .id_ref, .quantifier = .required },
12436 .{ .kind = .id_ref, .quantifier = .required },
12437 .{ .kind = .id_ref, .quantifier = .required },
12438 .{ .kind = .id_ref, .quantifier = .required },
12439 .{ .kind = .id_ref, .quantifier = .required },
12440 },
12441 },
12442 .{
12443 .name = "OpSubgroupAvcSicConfigureIpeLumaChromaINTEL",
12444 .opcode = 5794,
12445 .operands = &.{
12446 .{ .kind = .id_result_type, .quantifier = .required },
12447 .{ .kind = .id_result, .quantifier = .required },
12448 .{ .kind = .id_ref, .quantifier = .required },
12449 .{ .kind = .id_ref, .quantifier = .required },
12450 .{ .kind = .id_ref, .quantifier = .required },
12451 .{ .kind = .id_ref, .quantifier = .required },
12452 .{ .kind = .id_ref, .quantifier = .required },
12453 .{ .kind = .id_ref, .quantifier = .required },
12454 .{ .kind = .id_ref, .quantifier = .required },
12455 .{ .kind = .id_ref, .quantifier = .required },
12456 .{ .kind = .id_ref, .quantifier = .required },
12457 .{ .kind = .id_ref, .quantifier = .required },
12458 .{ .kind = .id_ref, .quantifier = .required },
12459 },
12460 },
12461 .{
12462 .name = "OpSubgroupAvcSicGetMotionVectorMaskINTEL",
12463 .opcode = 5795,
12464 .operands = &.{
12465 .{ .kind = .id_result_type, .quantifier = .required },
12466 .{ .kind = .id_result, .quantifier = .required },
12467 .{ .kind = .id_ref, .quantifier = .required },
12468 .{ .kind = .id_ref, .quantifier = .required },
12469 },
12470 },
12471 .{
12472 .name = "OpSubgroupAvcSicConvertToMcePayloadINTEL",
12473 .opcode = 5796,
12474 .operands = &.{
12475 .{ .kind = .id_result_type, .quantifier = .required },
12476 .{ .kind = .id_result, .quantifier = .required },
12477 .{ .kind = .id_ref, .quantifier = .required },
12478 },
12479 },
12480 .{
12481 .name = "OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL",
12482 .opcode = 5797,
12483 .operands = &.{
12484 .{ .kind = .id_result_type, .quantifier = .required },
12485 .{ .kind = .id_result, .quantifier = .required },
12486 .{ .kind = .id_ref, .quantifier = .required },
12487 .{ .kind = .id_ref, .quantifier = .required },
12488 },
12489 },
12490 .{
12491 .name = "OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL",
12492 .opcode = 5798,
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 .{ .kind = .id_ref, .quantifier = .required },
12499 .{ .kind = .id_ref, .quantifier = .required },
12500 },
12501 },
12502 .{
12503 .name = "OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL",
12504 .opcode = 5799,
12505 .operands = &.{
12506 .{ .kind = .id_result_type, .quantifier = .required },
12507 .{ .kind = .id_result, .quantifier = .required },
12508 .{ .kind = .id_ref, .quantifier = .required },
12509 .{ .kind = .id_ref, .quantifier = .required },
12510 },
12511 },
12512 .{
12513 .name = "OpSubgroupAvcSicSetBilinearFilterEnableINTEL",
12514 .opcode = 5800,
12515 .operands = &.{
12516 .{ .kind = .id_result_type, .quantifier = .required },
12517 .{ .kind = .id_result, .quantifier = .required },
12518 .{ .kind = .id_ref, .quantifier = .required },
12519 },
12520 },
12521 .{
12522 .name = "OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL",
12523 .opcode = 5801,
12524 .operands = &.{
12525 .{ .kind = .id_result_type, .quantifier = .required },
12526 .{ .kind = .id_result, .quantifier = .required },
12527 .{ .kind = .id_ref, .quantifier = .required },
12528 .{ .kind = .id_ref, .quantifier = .required },
12529 },
12530 },
12531 .{
12532 .name = "OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL",
12533 .opcode = 5802,
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 = "OpSubgroupAvcSicEvaluateIpeINTEL",
12543 .opcode = 5803,
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 = "OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL",
12553 .opcode = 5804,
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 .{ .kind = .id_ref, .quantifier = .required },
12560 },
12561 },
12562 .{
12563 .name = "OpSubgroupAvcSicEvaluateWithDualReferenceINTEL",
12564 .opcode = 5805,
12565 .operands = &.{
12566 .{ .kind = .id_result_type, .quantifier = .required },
12567 .{ .kind = .id_result, .quantifier = .required },
12568 .{ .kind = .id_ref, .quantifier = .required },
12569 .{ .kind = .id_ref, .quantifier = .required },
12570 .{ .kind = .id_ref, .quantifier = .required },
12571 .{ .kind = .id_ref, .quantifier = .required },
12572 },
12573 },
12574 .{
12575 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL",
12576 .opcode = 5806,
12577 .operands = &.{
12578 .{ .kind = .id_result_type, .quantifier = .required },
12579 .{ .kind = .id_result, .quantifier = .required },
12580 .{ .kind = .id_ref, .quantifier = .required },
12581 .{ .kind = .id_ref, .quantifier = .required },
12582 .{ .kind = .id_ref, .quantifier = .required },
12583 },
12584 },
12585 .{
12586 .name = "OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL",
12587 .opcode = 5807,
12588 .operands = &.{
12589 .{ .kind = .id_result_type, .quantifier = .required },
12590 .{ .kind = .id_result, .quantifier = .required },
12591 .{ .kind = .id_ref, .quantifier = .required },
12592 .{ .kind = .id_ref, .quantifier = .required },
12593 .{ .kind = .id_ref, .quantifier = .required },
12594 .{ .kind = .id_ref, .quantifier = .required },
12595 },
12596 },
12597 .{
12598 .name = "OpSubgroupAvcSicConvertToMceResultINTEL",
12599 .opcode = 5808,
12600 .operands = &.{
12601 .{ .kind = .id_result_type, .quantifier = .required },
12602 .{ .kind = .id_result, .quantifier = .required },
12603 .{ .kind = .id_ref, .quantifier = .required },
12604 },
12605 },
12606 .{
12607 .name = "OpSubgroupAvcSicGetIpeLumaShapeINTEL",
12608 .opcode = 5809,
12609 .operands = &.{
12610 .{ .kind = .id_result_type, .quantifier = .required },
12611 .{ .kind = .id_result, .quantifier = .required },
12612 .{ .kind = .id_ref, .quantifier = .required },
12613 },
12614 },
12615 .{
12616 .name = "OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL",
12617 .opcode = 5810,
12618 .operands = &.{
12619 .{ .kind = .id_result_type, .quantifier = .required },
12620 .{ .kind = .id_result, .quantifier = .required },
12621 .{ .kind = .id_ref, .quantifier = .required },
12622 },
12623 },
12624 .{
12625 .name = "OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL",
12626 .opcode = 5811,
12627 .operands = &.{
12628 .{ .kind = .id_result_type, .quantifier = .required },
12629 .{ .kind = .id_result, .quantifier = .required },
12630 .{ .kind = .id_ref, .quantifier = .required },
12631 },
12632 },
12633 .{
12634 .name = "OpSubgroupAvcSicGetPackedIpeLumaModesINTEL",
12635 .opcode = 5812,
12636 .operands = &.{
12637 .{ .kind = .id_result_type, .quantifier = .required },
12638 .{ .kind = .id_result, .quantifier = .required },
12639 .{ .kind = .id_ref, .quantifier = .required },
12640 },
12641 },
12642 .{
12643 .name = "OpSubgroupAvcSicGetIpeChromaModeINTEL",
12644 .opcode = 5813,
12645 .operands = &.{
12646 .{ .kind = .id_result_type, .quantifier = .required },
12647 .{ .kind = .id_result, .quantifier = .required },
12648 .{ .kind = .id_ref, .quantifier = .required },
12649 },
12650 },
12651 .{
12652 .name = "OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL",
12653 .opcode = 5814,
12654 .operands = &.{
12655 .{ .kind = .id_result_type, .quantifier = .required },
12656 .{ .kind = .id_result, .quantifier = .required },
12657 .{ .kind = .id_ref, .quantifier = .required },
12658 },
12659 },
12660 .{
12661 .name = "OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL",
12662 .opcode = 5815,
12663 .operands = &.{
12664 .{ .kind = .id_result_type, .quantifier = .required },
12665 .{ .kind = .id_result, .quantifier = .required },
12666 .{ .kind = .id_ref, .quantifier = .required },
12667 },
12668 },
12669 .{
12670 .name = "OpSubgroupAvcSicGetInterRawSadsINTEL",
12671 .opcode = 5816,
12672 .operands = &.{
12673 .{ .kind = .id_result_type, .quantifier = .required },
12674 .{ .kind = .id_result, .quantifier = .required },
12675 .{ .kind = .id_ref, .quantifier = .required },
12676 },
12677 },
12678 .{
12679 .name = "OpVariableLengthArrayINTEL",
12680 .opcode = 5818,
12681 .operands = &.{
12682 .{ .kind = .id_result_type, .quantifier = .required },
12683 .{ .kind = .id_result, .quantifier = .required },
12684 .{ .kind = .id_ref, .quantifier = .required },
12685 },
12686 },
12687 .{
12688 .name = "OpSaveMemoryINTEL",
12689 .opcode = 5819,
12690 .operands = &.{
12691 .{ .kind = .id_result_type, .quantifier = .required },
12692 .{ .kind = .id_result, .quantifier = .required },
12693 },
12694 },
12695 .{
12696 .name = "OpRestoreMemoryINTEL",
12697 .opcode = 5820,
12698 .operands = &.{
12699 .{ .kind = .id_ref, .quantifier = .required },
12700 },
12701 },
12702 .{
12703 .name = "OpArbitraryFloatSinCosPiINTEL",
12704 .opcode = 5840,
12705 .operands = &.{
12706 .{ .kind = .id_result_type, .quantifier = .required },
12707 .{ .kind = .id_result, .quantifier = .required },
12708 .{ .kind = .id_ref, .quantifier = .required },
12709 .{ .kind = .literal_integer, .quantifier = .required },
12710 .{ .kind = .literal_integer, .quantifier = .required },
12711 .{ .kind = .literal_integer, .quantifier = .required },
12712 .{ .kind = .literal_integer, .quantifier = .required },
12713 .{ .kind = .literal_integer, .quantifier = .required },
12714 },
12715 },
12716 .{
12717 .name = "OpArbitraryFloatCastINTEL",
12718 .opcode = 5841,
12719 .operands = &.{
12720 .{ .kind = .id_result_type, .quantifier = .required },
12721 .{ .kind = .id_result, .quantifier = .required },
12722 .{ .kind = .id_ref, .quantifier = .required },
12723 .{ .kind = .literal_integer, .quantifier = .required },
12724 .{ .kind = .literal_integer, .quantifier = .required },
12725 .{ .kind = .literal_integer, .quantifier = .required },
12726 .{ .kind = .literal_integer, .quantifier = .required },
12727 .{ .kind = .literal_integer, .quantifier = .required },
12728 },
12729 },
12730 .{
12731 .name = "OpArbitraryFloatCastFromIntINTEL",
12732 .opcode = 5842,
12733 .operands = &.{
12734 .{ .kind = .id_result_type, .quantifier = .required },
12735 .{ .kind = .id_result, .quantifier = .required },
12736 .{ .kind = .id_ref, .quantifier = .required },
12737 .{ .kind = .literal_integer, .quantifier = .required },
12738 .{ .kind = .literal_integer, .quantifier = .required },
12739 .{ .kind = .literal_integer, .quantifier = .required },
12740 .{ .kind = .literal_integer, .quantifier = .required },
12741 .{ .kind = .literal_integer, .quantifier = .required },
12742 },
12743 },
12744 .{
12745 .name = "OpArbitraryFloatCastToIntINTEL",
12746 .opcode = 5843,
12747 .operands = &.{
12748 .{ .kind = .id_result_type, .quantifier = .required },
12749 .{ .kind = .id_result, .quantifier = .required },
12750 .{ .kind = .id_ref, .quantifier = .required },
12751 .{ .kind = .literal_integer, .quantifier = .required },
12752 .{ .kind = .literal_integer, .quantifier = .required },
12753 .{ .kind = .literal_integer, .quantifier = .required },
12754 .{ .kind = .literal_integer, .quantifier = .required },
12755 .{ .kind = .literal_integer, .quantifier = .required },
12756 },
12757 },
12758 .{
12759 .name = "OpArbitraryFloatAddINTEL",
12760 .opcode = 5846,
12761 .operands = &.{
12762 .{ .kind = .id_result_type, .quantifier = .required },
12763 .{ .kind = .id_result, .quantifier = .required },
12764 .{ .kind = .id_ref, .quantifier = .required },
12765 .{ .kind = .literal_integer, .quantifier = .required },
12766 .{ .kind = .id_ref, .quantifier = .required },
12767 .{ .kind = .literal_integer, .quantifier = .required },
12768 .{ .kind = .literal_integer, .quantifier = .required },
12769 .{ .kind = .literal_integer, .quantifier = .required },
12770 .{ .kind = .literal_integer, .quantifier = .required },
12771 .{ .kind = .literal_integer, .quantifier = .required },
12772 },
12773 },
12774 .{
12775 .name = "OpArbitraryFloatSubINTEL",
12776 .opcode = 5847,
12777 .operands = &.{
12778 .{ .kind = .id_result_type, .quantifier = .required },
12779 .{ .kind = .id_result, .quantifier = .required },
12780 .{ .kind = .id_ref, .quantifier = .required },
12781 .{ .kind = .literal_integer, .quantifier = .required },
12782 .{ .kind = .id_ref, .quantifier = .required },
12783 .{ .kind = .literal_integer, .quantifier = .required },
12784 .{ .kind = .literal_integer, .quantifier = .required },
12785 .{ .kind = .literal_integer, .quantifier = .required },
12786 .{ .kind = .literal_integer, .quantifier = .required },
12787 .{ .kind = .literal_integer, .quantifier = .required },
12788 },
12789 },
12790 .{
12791 .name = "OpArbitraryFloatMulINTEL",
12792 .opcode = 5848,
12793 .operands = &.{
12794 .{ .kind = .id_result_type, .quantifier = .required },
12795 .{ .kind = .id_result, .quantifier = .required },
12796 .{ .kind = .id_ref, .quantifier = .required },
12797 .{ .kind = .literal_integer, .quantifier = .required },
12798 .{ .kind = .id_ref, .quantifier = .required },
12799 .{ .kind = .literal_integer, .quantifier = .required },
12800 .{ .kind = .literal_integer, .quantifier = .required },
12801 .{ .kind = .literal_integer, .quantifier = .required },
12802 .{ .kind = .literal_integer, .quantifier = .required },
12803 .{ .kind = .literal_integer, .quantifier = .required },
12804 },
12805 },
12806 .{
12807 .name = "OpArbitraryFloatDivINTEL",
12808 .opcode = 5849,
12809 .operands = &.{
12810 .{ .kind = .id_result_type, .quantifier = .required },
12811 .{ .kind = .id_result, .quantifier = .required },
12812 .{ .kind = .id_ref, .quantifier = .required },
12813 .{ .kind = .literal_integer, .quantifier = .required },
12814 .{ .kind = .id_ref, .quantifier = .required },
12815 .{ .kind = .literal_integer, .quantifier = .required },
12816 .{ .kind = .literal_integer, .quantifier = .required },
12817 .{ .kind = .literal_integer, .quantifier = .required },
12818 .{ .kind = .literal_integer, .quantifier = .required },
12819 .{ .kind = .literal_integer, .quantifier = .required },
12820 },
12821 },
12822 .{
12823 .name = "OpArbitraryFloatGTINTEL",
12824 .opcode = 5850,
12825 .operands = &.{
12826 .{ .kind = .id_result_type, .quantifier = .required },
12827 .{ .kind = .id_result, .quantifier = .required },
12828 .{ .kind = .id_ref, .quantifier = .required },
12829 .{ .kind = .literal_integer, .quantifier = .required },
12830 .{ .kind = .id_ref, .quantifier = .required },
12831 .{ .kind = .literal_integer, .quantifier = .required },
12832 },
12833 },
12834 .{
12835 .name = "OpArbitraryFloatGEINTEL",
12836 .opcode = 5851,
12837 .operands = &.{
12838 .{ .kind = .id_result_type, .quantifier = .required },
12839 .{ .kind = .id_result, .quantifier = .required },
12840 .{ .kind = .id_ref, .quantifier = .required },
12841 .{ .kind = .literal_integer, .quantifier = .required },
12842 .{ .kind = .id_ref, .quantifier = .required },
12843 .{ .kind = .literal_integer, .quantifier = .required },
12844 },
12845 },
12846 .{
12847 .name = "OpArbitraryFloatLTINTEL",
12848 .opcode = 5852,
12849 .operands = &.{
12850 .{ .kind = .id_result_type, .quantifier = .required },
12851 .{ .kind = .id_result, .quantifier = .required },
12852 .{ .kind = .id_ref, .quantifier = .required },
12853 .{ .kind = .literal_integer, .quantifier = .required },
12854 .{ .kind = .id_ref, .quantifier = .required },
12855 .{ .kind = .literal_integer, .quantifier = .required },
12856 },
12857 },
12858 .{
12859 .name = "OpArbitraryFloatLEINTEL",
12860 .opcode = 5853,
12861 .operands = &.{
12862 .{ .kind = .id_result_type, .quantifier = .required },
12863 .{ .kind = .id_result, .quantifier = .required },
12864 .{ .kind = .id_ref, .quantifier = .required },
12865 .{ .kind = .literal_integer, .quantifier = .required },
12866 .{ .kind = .id_ref, .quantifier = .required },
12867 .{ .kind = .literal_integer, .quantifier = .required },
12868 },
12869 },
12870 .{
12871 .name = "OpArbitraryFloatEQINTEL",
12872 .opcode = 5854,
12873 .operands = &.{
12874 .{ .kind = .id_result_type, .quantifier = .required },
12875 .{ .kind = .id_result, .quantifier = .required },
12876 .{ .kind = .id_ref, .quantifier = .required },
12877 .{ .kind = .literal_integer, .quantifier = .required },
12878 .{ .kind = .id_ref, .quantifier = .required },
12879 .{ .kind = .literal_integer, .quantifier = .required },
12880 },
12881 },
12882 .{
12883 .name = "OpArbitraryFloatRecipINTEL",
12884 .opcode = 5855,
12885 .operands = &.{
12886 .{ .kind = .id_result_type, .quantifier = .required },
12887 .{ .kind = .id_result, .quantifier = .required },
12888 .{ .kind = .id_ref, .quantifier = .required },
12889 .{ .kind = .literal_integer, .quantifier = .required },
12890 .{ .kind = .literal_integer, .quantifier = .required },
12891 .{ .kind = .literal_integer, .quantifier = .required },
12892 .{ .kind = .literal_integer, .quantifier = .required },
12893 .{ .kind = .literal_integer, .quantifier = .required },
12894 },
12895 },
12896 .{
12897 .name = "OpArbitraryFloatRSqrtINTEL",
12898 .opcode = 5856,
12899 .operands = &.{
12900 .{ .kind = .id_result_type, .quantifier = .required },
12901 .{ .kind = .id_result, .quantifier = .required },
12902 .{ .kind = .id_ref, .quantifier = .required },
12903 .{ .kind = .literal_integer, .quantifier = .required },
12904 .{ .kind = .literal_integer, .quantifier = .required },
12905 .{ .kind = .literal_integer, .quantifier = .required },
12906 .{ .kind = .literal_integer, .quantifier = .required },
12907 .{ .kind = .literal_integer, .quantifier = .required },
12908 },
12909 },
12910 .{
12911 .name = "OpArbitraryFloatCbrtINTEL",
12912 .opcode = 5857,
12913 .operands = &.{
12914 .{ .kind = .id_result_type, .quantifier = .required },
12915 .{ .kind = .id_result, .quantifier = .required },
12916 .{ .kind = .id_ref, .quantifier = .required },
12917 .{ .kind = .literal_integer, .quantifier = .required },
12918 .{ .kind = .literal_integer, .quantifier = .required },
12919 .{ .kind = .literal_integer, .quantifier = .required },
12920 .{ .kind = .literal_integer, .quantifier = .required },
12921 .{ .kind = .literal_integer, .quantifier = .required },
12922 },
12923 },
12924 .{
12925 .name = "OpArbitraryFloatHypotINTEL",
12926 .opcode = 5858,
12927 .operands = &.{
12928 .{ .kind = .id_result_type, .quantifier = .required },
12929 .{ .kind = .id_result, .quantifier = .required },
12930 .{ .kind = .id_ref, .quantifier = .required },
12931 .{ .kind = .literal_integer, .quantifier = .required },
12932 .{ .kind = .id_ref, .quantifier = .required },
12933 .{ .kind = .literal_integer, .quantifier = .required },
12934 .{ .kind = .literal_integer, .quantifier = .required },
12935 .{ .kind = .literal_integer, .quantifier = .required },
12936 .{ .kind = .literal_integer, .quantifier = .required },
12937 .{ .kind = .literal_integer, .quantifier = .required },
12938 },
12939 },
12940 .{
12941 .name = "OpArbitraryFloatSqrtINTEL",
12942 .opcode = 5859,
12943 .operands = &.{
12944 .{ .kind = .id_result_type, .quantifier = .required },
12945 .{ .kind = .id_result, .quantifier = .required },
12946 .{ .kind = .id_ref, .quantifier = .required },
12947 .{ .kind = .literal_integer, .quantifier = .required },
12948 .{ .kind = .literal_integer, .quantifier = .required },
12949 .{ .kind = .literal_integer, .quantifier = .required },
12950 .{ .kind = .literal_integer, .quantifier = .required },
12951 .{ .kind = .literal_integer, .quantifier = .required },
12952 },
12953 },
12954 .{
12955 .name = "OpArbitraryFloatLogINTEL",
12956 .opcode = 5860,
12957 .operands = &.{
12958 .{ .kind = .id_result_type, .quantifier = .required },
12959 .{ .kind = .id_result, .quantifier = .required },
12960 .{ .kind = .id_ref, .quantifier = .required },
12961 .{ .kind = .literal_integer, .quantifier = .required },
12962 .{ .kind = .literal_integer, .quantifier = .required },
12963 .{ .kind = .literal_integer, .quantifier = .required },
12964 .{ .kind = .literal_integer, .quantifier = .required },
12965 .{ .kind = .literal_integer, .quantifier = .required },
12966 },
12967 },
12968 .{
12969 .name = "OpArbitraryFloatLog2INTEL",
12970 .opcode = 5861,
12971 .operands = &.{
12972 .{ .kind = .id_result_type, .quantifier = .required },
12973 .{ .kind = .id_result, .quantifier = .required },
12974 .{ .kind = .id_ref, .quantifier = .required },
12975 .{ .kind = .literal_integer, .quantifier = .required },
12976 .{ .kind = .literal_integer, .quantifier = .required },
12977 .{ .kind = .literal_integer, .quantifier = .required },
12978 .{ .kind = .literal_integer, .quantifier = .required },
12979 .{ .kind = .literal_integer, .quantifier = .required },
12980 },
12981 },
12982 .{
12983 .name = "OpArbitraryFloatLog10INTEL",
12984 .opcode = 5862,
12985 .operands = &.{
12986 .{ .kind = .id_result_type, .quantifier = .required },
12987 .{ .kind = .id_result, .quantifier = .required },
12988 .{ .kind = .id_ref, .quantifier = .required },
12989 .{ .kind = .literal_integer, .quantifier = .required },
12990 .{ .kind = .literal_integer, .quantifier = .required },
12991 .{ .kind = .literal_integer, .quantifier = .required },
12992 .{ .kind = .literal_integer, .quantifier = .required },
12993 .{ .kind = .literal_integer, .quantifier = .required },
12994 },
12995 },
12996 .{
12997 .name = "OpArbitraryFloatLog1pINTEL",
12998 .opcode = 5863,
12999 .operands = &.{
13000 .{ .kind = .id_result_type, .quantifier = .required },
13001 .{ .kind = .id_result, .quantifier = .required },
13002 .{ .kind = .id_ref, .quantifier = .required },
13003 .{ .kind = .literal_integer, .quantifier = .required },
13004 .{ .kind = .literal_integer, .quantifier = .required },
13005 .{ .kind = .literal_integer, .quantifier = .required },
13006 .{ .kind = .literal_integer, .quantifier = .required },
13007 .{ .kind = .literal_integer, .quantifier = .required },
13008 },
13009 },
13010 .{
13011 .name = "OpArbitraryFloatExpINTEL",
13012 .opcode = 5864,
13013 .operands = &.{
13014 .{ .kind = .id_result_type, .quantifier = .required },
13015 .{ .kind = .id_result, .quantifier = .required },
13016 .{ .kind = .id_ref, .quantifier = .required },
13017 .{ .kind = .literal_integer, .quantifier = .required },
13018 .{ .kind = .literal_integer, .quantifier = .required },
13019 .{ .kind = .literal_integer, .quantifier = .required },
13020 .{ .kind = .literal_integer, .quantifier = .required },
13021 .{ .kind = .literal_integer, .quantifier = .required },
13022 },
13023 },
13024 .{
13025 .name = "OpArbitraryFloatExp2INTEL",
13026 .opcode = 5865,
13027 .operands = &.{
13028 .{ .kind = .id_result_type, .quantifier = .required },
13029 .{ .kind = .id_result, .quantifier = .required },
13030 .{ .kind = .id_ref, .quantifier = .required },
13031 .{ .kind = .literal_integer, .quantifier = .required },
13032 .{ .kind = .literal_integer, .quantifier = .required },
13033 .{ .kind = .literal_integer, .quantifier = .required },
13034 .{ .kind = .literal_integer, .quantifier = .required },
13035 .{ .kind = .literal_integer, .quantifier = .required },
13036 },
13037 },
13038 .{
13039 .name = "OpArbitraryFloatExp10INTEL",
13040 .opcode = 5866,
13041 .operands = &.{
13042 .{ .kind = .id_result_type, .quantifier = .required },
13043 .{ .kind = .id_result, .quantifier = .required },
13044 .{ .kind = .id_ref, .quantifier = .required },
13045 .{ .kind = .literal_integer, .quantifier = .required },
13046 .{ .kind = .literal_integer, .quantifier = .required },
13047 .{ .kind = .literal_integer, .quantifier = .required },
13048 .{ .kind = .literal_integer, .quantifier = .required },
13049 .{ .kind = .literal_integer, .quantifier = .required },
13050 },
13051 },
13052 .{
13053 .name = "OpArbitraryFloatExpm1INTEL",
13054 .opcode = 5867,
13055 .operands = &.{
13056 .{ .kind = .id_result_type, .quantifier = .required },
13057 .{ .kind = .id_result, .quantifier = .required },
13058 .{ .kind = .id_ref, .quantifier = .required },
13059 .{ .kind = .literal_integer, .quantifier = .required },
13060 .{ .kind = .literal_integer, .quantifier = .required },
13061 .{ .kind = .literal_integer, .quantifier = .required },
13062 .{ .kind = .literal_integer, .quantifier = .required },
13063 .{ .kind = .literal_integer, .quantifier = .required },
13064 },
13065 },
13066 .{
13067 .name = "OpArbitraryFloatSinINTEL",
13068 .opcode = 5868,
13069 .operands = &.{
13070 .{ .kind = .id_result_type, .quantifier = .required },
13071 .{ .kind = .id_result, .quantifier = .required },
13072 .{ .kind = .id_ref, .quantifier = .required },
13073 .{ .kind = .literal_integer, .quantifier = .required },
13074 .{ .kind = .literal_integer, .quantifier = .required },
13075 .{ .kind = .literal_integer, .quantifier = .required },
13076 .{ .kind = .literal_integer, .quantifier = .required },
13077 .{ .kind = .literal_integer, .quantifier = .required },
13078 },
13079 },
13080 .{
13081 .name = "OpArbitraryFloatCosINTEL",
13082 .opcode = 5869,
13083 .operands = &.{
13084 .{ .kind = .id_result_type, .quantifier = .required },
13085 .{ .kind = .id_result, .quantifier = .required },
13086 .{ .kind = .id_ref, .quantifier = .required },
13087 .{ .kind = .literal_integer, .quantifier = .required },
13088 .{ .kind = .literal_integer, .quantifier = .required },
13089 .{ .kind = .literal_integer, .quantifier = .required },
13090 .{ .kind = .literal_integer, .quantifier = .required },
13091 .{ .kind = .literal_integer, .quantifier = .required },
13092 },
13093 },
13094 .{
13095 .name = "OpArbitraryFloatSinCosINTEL",
13096 .opcode = 5870,
13097 .operands = &.{
13098 .{ .kind = .id_result_type, .quantifier = .required },
13099 .{ .kind = .id_result, .quantifier = .required },
13100 .{ .kind = .id_ref, .quantifier = .required },
13101 .{ .kind = .literal_integer, .quantifier = .required },
13102 .{ .kind = .literal_integer, .quantifier = .required },
13103 .{ .kind = .literal_integer, .quantifier = .required },
13104 .{ .kind = .literal_integer, .quantifier = .required },
13105 .{ .kind = .literal_integer, .quantifier = .required },
13106 },
13107 },
13108 .{
13109 .name = "OpArbitraryFloatSinPiINTEL",
13110 .opcode = 5871,
13111 .operands = &.{
13112 .{ .kind = .id_result_type, .quantifier = .required },
13113 .{ .kind = .id_result, .quantifier = .required },
13114 .{ .kind = .id_ref, .quantifier = .required },
13115 .{ .kind = .literal_integer, .quantifier = .required },
13116 .{ .kind = .literal_integer, .quantifier = .required },
13117 .{ .kind = .literal_integer, .quantifier = .required },
13118 .{ .kind = .literal_integer, .quantifier = .required },
13119 .{ .kind = .literal_integer, .quantifier = .required },
13120 },
13121 },
13122 .{
13123 .name = "OpArbitraryFloatCosPiINTEL",
13124 .opcode = 5872,
13125 .operands = &.{
13126 .{ .kind = .id_result_type, .quantifier = .required },
13127 .{ .kind = .id_result, .quantifier = .required },
13128 .{ .kind = .id_ref, .quantifier = .required },
13129 .{ .kind = .literal_integer, .quantifier = .required },
13130 .{ .kind = .literal_integer, .quantifier = .required },
13131 .{ .kind = .literal_integer, .quantifier = .required },
13132 .{ .kind = .literal_integer, .quantifier = .required },
13133 .{ .kind = .literal_integer, .quantifier = .required },
13134 },
13135 },
13136 .{
13137 .name = "OpArbitraryFloatASinINTEL",
13138 .opcode = 5873,
13139 .operands = &.{
13140 .{ .kind = .id_result_type, .quantifier = .required },
13141 .{ .kind = .id_result, .quantifier = .required },
13142 .{ .kind = .id_ref, .quantifier = .required },
13143 .{ .kind = .literal_integer, .quantifier = .required },
13144 .{ .kind = .literal_integer, .quantifier = .required },
13145 .{ .kind = .literal_integer, .quantifier = .required },
13146 .{ .kind = .literal_integer, .quantifier = .required },
13147 .{ .kind = .literal_integer, .quantifier = .required },
13148 },
13149 },
13150 .{
13151 .name = "OpArbitraryFloatASinPiINTEL",
13152 .opcode = 5874,
13153 .operands = &.{
13154 .{ .kind = .id_result_type, .quantifier = .required },
13155 .{ .kind = .id_result, .quantifier = .required },
13156 .{ .kind = .id_ref, .quantifier = .required },
13157 .{ .kind = .literal_integer, .quantifier = .required },
13158 .{ .kind = .literal_integer, .quantifier = .required },
13159 .{ .kind = .literal_integer, .quantifier = .required },
13160 .{ .kind = .literal_integer, .quantifier = .required },
13161 .{ .kind = .literal_integer, .quantifier = .required },
13162 },
13163 },
13164 .{
13165 .name = "OpArbitraryFloatACosINTEL",
13166 .opcode = 5875,
13167 .operands = &.{
13168 .{ .kind = .id_result_type, .quantifier = .required },
13169 .{ .kind = .id_result, .quantifier = .required },
13170 .{ .kind = .id_ref, .quantifier = .required },
13171 .{ .kind = .literal_integer, .quantifier = .required },
13172 .{ .kind = .literal_integer, .quantifier = .required },
13173 .{ .kind = .literal_integer, .quantifier = .required },
13174 .{ .kind = .literal_integer, .quantifier = .required },
13175 .{ .kind = .literal_integer, .quantifier = .required },
13176 },
13177 },
13178 .{
13179 .name = "OpArbitraryFloatACosPiINTEL",
13180 .opcode = 5876,
13181 .operands = &.{
13182 .{ .kind = .id_result_type, .quantifier = .required },
13183 .{ .kind = .id_result, .quantifier = .required },
13184 .{ .kind = .id_ref, .quantifier = .required },
13185 .{ .kind = .literal_integer, .quantifier = .required },
13186 .{ .kind = .literal_integer, .quantifier = .required },
13187 .{ .kind = .literal_integer, .quantifier = .required },
13188 .{ .kind = .literal_integer, .quantifier = .required },
13189 .{ .kind = .literal_integer, .quantifier = .required },
13190 },
13191 },
13192 .{
13193 .name = "OpArbitraryFloatATanINTEL",
13194 .opcode = 5877,
13195 .operands = &.{
13196 .{ .kind = .id_result_type, .quantifier = .required },
13197 .{ .kind = .id_result, .quantifier = .required },
13198 .{ .kind = .id_ref, .quantifier = .required },
13199 .{ .kind = .literal_integer, .quantifier = .required },
13200 .{ .kind = .literal_integer, .quantifier = .required },
13201 .{ .kind = .literal_integer, .quantifier = .required },
13202 .{ .kind = .literal_integer, .quantifier = .required },
13203 .{ .kind = .literal_integer, .quantifier = .required },
13204 },
13205 },
13206 .{
13207 .name = "OpArbitraryFloatATanPiINTEL",
13208 .opcode = 5878,
13209 .operands = &.{
13210 .{ .kind = .id_result_type, .quantifier = .required },
13211 .{ .kind = .id_result, .quantifier = .required },
13212 .{ .kind = .id_ref, .quantifier = .required },
13213 .{ .kind = .literal_integer, .quantifier = .required },
13214 .{ .kind = .literal_integer, .quantifier = .required },
13215 .{ .kind = .literal_integer, .quantifier = .required },
13216 .{ .kind = .literal_integer, .quantifier = .required },
13217 .{ .kind = .literal_integer, .quantifier = .required },
13218 },
13219 },
13220 .{
13221 .name = "OpArbitraryFloatATan2INTEL",
13222 .opcode = 5879,
13223 .operands = &.{
13224 .{ .kind = .id_result_type, .quantifier = .required },
13225 .{ .kind = .id_result, .quantifier = .required },
13226 .{ .kind = .id_ref, .quantifier = .required },
13227 .{ .kind = .literal_integer, .quantifier = .required },
13228 .{ .kind = .id_ref, .quantifier = .required },
13229 .{ .kind = .literal_integer, .quantifier = .required },
13230 .{ .kind = .literal_integer, .quantifier = .required },
13231 .{ .kind = .literal_integer, .quantifier = .required },
13232 .{ .kind = .literal_integer, .quantifier = .required },
13233 .{ .kind = .literal_integer, .quantifier = .required },
13234 },
13235 },
13236 .{
13237 .name = "OpArbitraryFloatPowINTEL",
13238 .opcode = 5880,
13239 .operands = &.{
13240 .{ .kind = .id_result_type, .quantifier = .required },
13241 .{ .kind = .id_result, .quantifier = .required },
13242 .{ .kind = .id_ref, .quantifier = .required },
13243 .{ .kind = .literal_integer, .quantifier = .required },
13244 .{ .kind = .id_ref, .quantifier = .required },
13245 .{ .kind = .literal_integer, .quantifier = .required },
13246 .{ .kind = .literal_integer, .quantifier = .required },
13247 .{ .kind = .literal_integer, .quantifier = .required },
13248 .{ .kind = .literal_integer, .quantifier = .required },
13249 .{ .kind = .literal_integer, .quantifier = .required },
13250 },
13251 },
13252 .{
13253 .name = "OpArbitraryFloatPowRINTEL",
13254 .opcode = 5881,
13255 .operands = &.{
13256 .{ .kind = .id_result_type, .quantifier = .required },
13257 .{ .kind = .id_result, .quantifier = .required },
13258 .{ .kind = .id_ref, .quantifier = .required },
13259 .{ .kind = .literal_integer, .quantifier = .required },
13260 .{ .kind = .id_ref, .quantifier = .required },
13261 .{ .kind = .literal_integer, .quantifier = .required },
13262 .{ .kind = .literal_integer, .quantifier = .required },
13263 .{ .kind = .literal_integer, .quantifier = .required },
13264 .{ .kind = .literal_integer, .quantifier = .required },
13265 .{ .kind = .literal_integer, .quantifier = .required },
13266 },
13267 },
13268 .{
13269 .name = "OpArbitraryFloatPowNINTEL",
13270 .opcode = 5882,
13271 .operands = &.{
13272 .{ .kind = .id_result_type, .quantifier = .required },
13273 .{ .kind = .id_result, .quantifier = .required },
13274 .{ .kind = .id_ref, .quantifier = .required },
13275 .{ .kind = .literal_integer, .quantifier = .required },
13276 .{ .kind = .id_ref, .quantifier = .required },
13277 .{ .kind = .literal_integer, .quantifier = .required },
13278 .{ .kind = .literal_integer, .quantifier = .required },
13279 .{ .kind = .literal_integer, .quantifier = .required },
13280 .{ .kind = .literal_integer, .quantifier = .required },
13281 .{ .kind = .literal_integer, .quantifier = .required },
13282 },
13283 },
13284 .{
13285 .name = "OpLoopControlINTEL",
13286 .opcode = 5887,
13287 .operands = &.{
13288 .{ .kind = .literal_integer, .quantifier = .variadic },
13289 },
13290 },
13291 .{
13292 .name = "OpAliasDomainDeclINTEL",
13293 .opcode = 5911,
13294 .operands = &.{
13295 .{ .kind = .id_result, .quantifier = .required },
13296 .{ .kind = .id_ref, .quantifier = .optional },
13297 },
13298 },
13299 .{
13300 .name = "OpAliasScopeDeclINTEL",
13301 .opcode = 5912,
13302 .operands = &.{
13303 .{ .kind = .id_result, .quantifier = .required },
13304 .{ .kind = .id_ref, .quantifier = .required },
13305 .{ .kind = .id_ref, .quantifier = .optional },
13306 },
13307 },
13308 .{
13309 .name = "OpAliasScopeListDeclINTEL",
13310 .opcode = 5913,
13311 .operands = &.{
13312 .{ .kind = .id_result, .quantifier = .required },
13313 .{ .kind = .id_ref, .quantifier = .variadic },
13314 },
13315 },
13316 .{
13317 .name = "OpFixedSqrtINTEL",
13318 .opcode = 5923,
13319 .operands = &.{
13320 .{ .kind = .id_result_type, .quantifier = .required },
13321 .{ .kind = .id_result, .quantifier = .required },
13322 .{ .kind = .id_ref, .quantifier = .required },
13323 .{ .kind = .literal_integer, .quantifier = .required },
13324 .{ .kind = .literal_integer, .quantifier = .required },
13325 .{ .kind = .literal_integer, .quantifier = .required },
13326 .{ .kind = .literal_integer, .quantifier = .required },
13327 .{ .kind = .literal_integer, .quantifier = .required },
13328 },
13329 },
13330 .{
13331 .name = "OpFixedRecipINTEL",
13332 .opcode = 5924,
13333 .operands = &.{
13334 .{ .kind = .id_result_type, .quantifier = .required },
13335 .{ .kind = .id_result, .quantifier = .required },
13336 .{ .kind = .id_ref, .quantifier = .required },
13337 .{ .kind = .literal_integer, .quantifier = .required },
13338 .{ .kind = .literal_integer, .quantifier = .required },
13339 .{ .kind = .literal_integer, .quantifier = .required },
13340 .{ .kind = .literal_integer, .quantifier = .required },
13341 .{ .kind = .literal_integer, .quantifier = .required },
13342 },
13343 },
13344 .{
13345 .name = "OpFixedRsqrtINTEL",
13346 .opcode = 5925,
13347 .operands = &.{
13348 .{ .kind = .id_result_type, .quantifier = .required },
13349 .{ .kind = .id_result, .quantifier = .required },
13350 .{ .kind = .id_ref, .quantifier = .required },
13351 .{ .kind = .literal_integer, .quantifier = .required },
13352 .{ .kind = .literal_integer, .quantifier = .required },
13353 .{ .kind = .literal_integer, .quantifier = .required },
13354 .{ .kind = .literal_integer, .quantifier = .required },
13355 .{ .kind = .literal_integer, .quantifier = .required },
13356 },
13357 },
13358 .{
13359 .name = "OpFixedSinINTEL",
13360 .opcode = 5926,
13361 .operands = &.{
13362 .{ .kind = .id_result_type, .quantifier = .required },
13363 .{ .kind = .id_result, .quantifier = .required },
13364 .{ .kind = .id_ref, .quantifier = .required },
13365 .{ .kind = .literal_integer, .quantifier = .required },
13366 .{ .kind = .literal_integer, .quantifier = .required },
13367 .{ .kind = .literal_integer, .quantifier = .required },
13368 .{ .kind = .literal_integer, .quantifier = .required },
13369 .{ .kind = .literal_integer, .quantifier = .required },
13370 },
13371 },
13372 .{
13373 .name = "OpFixedCosINTEL",
13374 .opcode = 5927,
13375 .operands = &.{
13376 .{ .kind = .id_result_type, .quantifier = .required },
13377 .{ .kind = .id_result, .quantifier = .required },
13378 .{ .kind = .id_ref, .quantifier = .required },
13379 .{ .kind = .literal_integer, .quantifier = .required },
13380 .{ .kind = .literal_integer, .quantifier = .required },
13381 .{ .kind = .literal_integer, .quantifier = .required },
13382 .{ .kind = .literal_integer, .quantifier = .required },
13383 .{ .kind = .literal_integer, .quantifier = .required },
13384 },
13385 },
13386 .{
13387 .name = "OpFixedSinCosINTEL",
13388 .opcode = 5928,
13389 .operands = &.{
13390 .{ .kind = .id_result_type, .quantifier = .required },
13391 .{ .kind = .id_result, .quantifier = .required },
13392 .{ .kind = .id_ref, .quantifier = .required },
13393 .{ .kind = .literal_integer, .quantifier = .required },
13394 .{ .kind = .literal_integer, .quantifier = .required },
13395 .{ .kind = .literal_integer, .quantifier = .required },
13396 .{ .kind = .literal_integer, .quantifier = .required },
13397 .{ .kind = .literal_integer, .quantifier = .required },
13398 },
13399 },
13400 .{
13401 .name = "OpFixedSinPiINTEL",
13402 .opcode = 5929,
13403 .operands = &.{
13404 .{ .kind = .id_result_type, .quantifier = .required },
13405 .{ .kind = .id_result, .quantifier = .required },
13406 .{ .kind = .id_ref, .quantifier = .required },
13407 .{ .kind = .literal_integer, .quantifier = .required },
13408 .{ .kind = .literal_integer, .quantifier = .required },
13409 .{ .kind = .literal_integer, .quantifier = .required },
13410 .{ .kind = .literal_integer, .quantifier = .required },
13411 .{ .kind = .literal_integer, .quantifier = .required },
13412 },
13413 },
13414 .{
13415 .name = "OpFixedCosPiINTEL",
13416 .opcode = 5930,
13417 .operands = &.{
13418 .{ .kind = .id_result_type, .quantifier = .required },
13419 .{ .kind = .id_result, .quantifier = .required },
13420 .{ .kind = .id_ref, .quantifier = .required },
13421 .{ .kind = .literal_integer, .quantifier = .required },
13422 .{ .kind = .literal_integer, .quantifier = .required },
13423 .{ .kind = .literal_integer, .quantifier = .required },
13424 .{ .kind = .literal_integer, .quantifier = .required },
13425 .{ .kind = .literal_integer, .quantifier = .required },
13426 },
13427 },
13428 .{
13429 .name = "OpFixedSinCosPiINTEL",
13430 .opcode = 5931,
13431 .operands = &.{
13432 .{ .kind = .id_result_type, .quantifier = .required },
13433 .{ .kind = .id_result, .quantifier = .required },
13434 .{ .kind = .id_ref, .quantifier = .required },
13435 .{ .kind = .literal_integer, .quantifier = .required },
13436 .{ .kind = .literal_integer, .quantifier = .required },
13437 .{ .kind = .literal_integer, .quantifier = .required },
13438 .{ .kind = .literal_integer, .quantifier = .required },
13439 .{ .kind = .literal_integer, .quantifier = .required },
13440 },
13441 },
13442 .{
13443 .name = "OpFixedLogINTEL",
13444 .opcode = 5932,
13445 .operands = &.{
13446 .{ .kind = .id_result_type, .quantifier = .required },
13447 .{ .kind = .id_result, .quantifier = .required },
13448 .{ .kind = .id_ref, .quantifier = .required },
13449 .{ .kind = .literal_integer, .quantifier = .required },
13450 .{ .kind = .literal_integer, .quantifier = .required },
13451 .{ .kind = .literal_integer, .quantifier = .required },
13452 .{ .kind = .literal_integer, .quantifier = .required },
13453 .{ .kind = .literal_integer, .quantifier = .required },
13454 },
13455 },
13456 .{
13457 .name = "OpFixedExpINTEL",
13458 .opcode = 5933,
13459 .operands = &.{
13460 .{ .kind = .id_result_type, .quantifier = .required },
13461 .{ .kind = .id_result, .quantifier = .required },
13462 .{ .kind = .id_ref, .quantifier = .required },
13463 .{ .kind = .literal_integer, .quantifier = .required },
13464 .{ .kind = .literal_integer, .quantifier = .required },
13465 .{ .kind = .literal_integer, .quantifier = .required },
13466 .{ .kind = .literal_integer, .quantifier = .required },
13467 .{ .kind = .literal_integer, .quantifier = .required },
13468 },
13469 },
13470 .{
13471 .name = "OpPtrCastToCrossWorkgroupINTEL",
13472 .opcode = 5934,
13473 .operands = &.{
13474 .{ .kind = .id_result_type, .quantifier = .required },
13475 .{ .kind = .id_result, .quantifier = .required },
13476 .{ .kind = .id_ref, .quantifier = .required },
13477 },
13478 },
13479 .{
13480 .name = "OpCrossWorkgroupCastToPtrINTEL",
13481 .opcode = 5938,
13482 .operands = &.{
13483 .{ .kind = .id_result_type, .quantifier = .required },
13484 .{ .kind = .id_result, .quantifier = .required },
13485 .{ .kind = .id_ref, .quantifier = .required },
13486 },
13487 },
13488 .{
13489 .name = "OpReadPipeBlockingINTEL",
13490 .opcode = 5946,
13491 .operands = &.{
13492 .{ .kind = .id_result_type, .quantifier = .required },
13493 .{ .kind = .id_result, .quantifier = .required },
13494 .{ .kind = .id_ref, .quantifier = .required },
13495 .{ .kind = .id_ref, .quantifier = .required },
13496 },
13497 },
13498 .{
13499 .name = "OpWritePipeBlockingINTEL",
13500 .opcode = 5947,
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 = "OpFPGARegINTEL",
13510 .opcode = 5949,
13511 .operands = &.{
13512 .{ .kind = .id_result_type, .quantifier = .required },
13513 .{ .kind = .id_result, .quantifier = .required },
13514 .{ .kind = .id_ref, .quantifier = .required },
13515 },
13516 },
13517 .{
13518 .name = "OpRayQueryGetRayTMinKHR",
13519 .opcode = 6016,
13520 .operands = &.{
13521 .{ .kind = .id_result_type, .quantifier = .required },
13522 .{ .kind = .id_result, .quantifier = .required },
13523 .{ .kind = .id_ref, .quantifier = .required },
13524 },
13525 },
13526 .{
13527 .name = "OpRayQueryGetRayFlagsKHR",
13528 .opcode = 6017,
13529 .operands = &.{
13530 .{ .kind = .id_result_type, .quantifier = .required },
13531 .{ .kind = .id_result, .quantifier = .required },
13532 .{ .kind = .id_ref, .quantifier = .required },
13533 },
13534 },
13535 .{
13536 .name = "OpRayQueryGetIntersectionTKHR",
13537 .opcode = 6018,
13538 .operands = &.{
13539 .{ .kind = .id_result_type, .quantifier = .required },
13540 .{ .kind = .id_result, .quantifier = .required },
13541 .{ .kind = .id_ref, .quantifier = .required },
13542 .{ .kind = .id_ref, .quantifier = .required },
13543 },
13544 },
13545 .{
13546 .name = "OpRayQueryGetIntersectionInstanceCustomIndexKHR",
13547 .opcode = 6019,
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 = "OpRayQueryGetIntersectionInstanceIdKHR",
13557 .opcode = 6020,
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 = "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR",
13567 .opcode = 6021,
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 = "OpRayQueryGetIntersectionGeometryIndexKHR",
13577 .opcode = 6022,
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 = "OpRayQueryGetIntersectionPrimitiveIndexKHR",
13587 .opcode = 6023,
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 = "OpRayQueryGetIntersectionBarycentricsKHR",
13597 .opcode = 6024,
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 = "OpRayQueryGetIntersectionFrontFaceKHR",
13607 .opcode = 6025,
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 = "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR",
13617 .opcode = 6026,
13618 .operands = &.{
13619 .{ .kind = .id_result_type, .quantifier = .required },
13620 .{ .kind = .id_result, .quantifier = .required },
13621 .{ .kind = .id_ref, .quantifier = .required },
13622 },
13623 },
13624 .{
13625 .name = "OpRayQueryGetIntersectionObjectRayDirectionKHR",
13626 .opcode = 6027,
13627 .operands = &.{
13628 .{ .kind = .id_result_type, .quantifier = .required },
13629 .{ .kind = .id_result, .quantifier = .required },
13630 .{ .kind = .id_ref, .quantifier = .required },
13631 .{ .kind = .id_ref, .quantifier = .required },
13632 },
13633 },
13634 .{
13635 .name = "OpRayQueryGetIntersectionObjectRayOriginKHR",
13636 .opcode = 6028,
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 = "OpRayQueryGetWorldRayDirectionKHR",
13646 .opcode = 6029,
13647 .operands = &.{
13648 .{ .kind = .id_result_type, .quantifier = .required },
13649 .{ .kind = .id_result, .quantifier = .required },
13650 .{ .kind = .id_ref, .quantifier = .required },
13651 },
13652 },
13653 .{
13654 .name = "OpRayQueryGetWorldRayOriginKHR",
13655 .opcode = 6030,
13656 .operands = &.{
13657 .{ .kind = .id_result_type, .quantifier = .required },
13658 .{ .kind = .id_result, .quantifier = .required },
13659 .{ .kind = .id_ref, .quantifier = .required },
13660 },
13661 },
13662 .{
13663 .name = "OpRayQueryGetIntersectionObjectToWorldKHR",
13664 .opcode = 6031,
13665 .operands = &.{
13666 .{ .kind = .id_result_type, .quantifier = .required },
13667 .{ .kind = .id_result, .quantifier = .required },
13668 .{ .kind = .id_ref, .quantifier = .required },
13669 .{ .kind = .id_ref, .quantifier = .required },
13670 },
13671 },
13672 .{
13673 .name = "OpRayQueryGetIntersectionWorldToObjectKHR",
13674 .opcode = 6032,
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 = "OpAtomicFAddEXT",
13684 .opcode = 6035,
13685 .operands = &.{
13686 .{ .kind = .id_result_type, .quantifier = .required },
13687 .{ .kind = .id_result, .quantifier = .required },
13688 .{ .kind = .id_ref, .quantifier = .required },
13689 .{ .kind = .id_scope, .quantifier = .required },
13690 .{ .kind = .id_memory_semantics, .quantifier = .required },
13691 .{ .kind = .id_ref, .quantifier = .required },
13692 },
13693 },
13694 .{
13695 .name = "OpTypeBufferSurfaceINTEL",
13696 .opcode = 6086,
13697 .operands = &.{
13698 .{ .kind = .id_result, .quantifier = .required },
13699 .{ .kind = .access_qualifier, .quantifier = .required },
13700 },
13701 },
13702 .{
13703 .name = "OpTypeStructContinuedINTEL",
13704 .opcode = 6090,
13705 .operands = &.{
13706 .{ .kind = .id_ref, .quantifier = .variadic },
13707 },
13708 },
13709 .{
13710 .name = "OpConstantCompositeContinuedINTEL",
13711 .opcode = 6091,
13712 .operands = &.{
13713 .{ .kind = .id_ref, .quantifier = .variadic },
13714 },
13715 },
13716 .{
13717 .name = "OpSpecConstantCompositeContinuedINTEL",
13718 .opcode = 6092,
13719 .operands = &.{
13720 .{ .kind = .id_ref, .quantifier = .variadic },
13721 },
13722 },
13723 .{
13724 .name = "OpCompositeConstructContinuedINTEL",
13725 .opcode = 6096,
13726 .operands = &.{
13727 .{ .kind = .id_result_type, .quantifier = .required },
13728 .{ .kind = .id_result, .quantifier = .required },
13729 .{ .kind = .id_ref, .quantifier = .variadic },
13730 },
13731 },
13732 .{
13733 .name = "OpConvertFToBF16INTEL",
13734 .opcode = 6116,
13735 .operands = &.{
13736 .{ .kind = .id_result_type, .quantifier = .required },
13737 .{ .kind = .id_result, .quantifier = .required },
13738 .{ .kind = .id_ref, .quantifier = .required },
13739 },
13740 },
13741 .{
13742 .name = "OpConvertBF16ToFINTEL",
13743 .opcode = 6117,
13744 .operands = &.{
13745 .{ .kind = .id_result_type, .quantifier = .required },
13746 .{ .kind = .id_result, .quantifier = .required },
13747 .{ .kind = .id_ref, .quantifier = .required },
13748 },
13749 },
13750 .{
13751 .name = "OpControlBarrierArriveINTEL",
13752 .opcode = 6142,
13753 .operands = &.{
13754 .{ .kind = .id_scope, .quantifier = .required },
13755 .{ .kind = .id_scope, .quantifier = .required },
13756 .{ .kind = .id_memory_semantics, .quantifier = .required },
13757 },
13758 },
13759 .{
13760 .name = "OpControlBarrierWaitINTEL",
13761 .opcode = 6143,
13762 .operands = &.{
13763 .{ .kind = .id_scope, .quantifier = .required },
13764 .{ .kind = .id_scope, .quantifier = .required },
13765 .{ .kind = .id_memory_semantics, .quantifier = .required },
13766 },
13767 },
13768 .{
13769 .name = "OpArithmeticFenceEXT",
13770 .opcode = 6145,
13771 .operands = &.{
13772 .{ .kind = .id_result_type, .quantifier = .required },
13773 .{ .kind = .id_result, .quantifier = .required },
13774 .{ .kind = .id_ref, .quantifier = .required },
13775 },
13776 },
13777 .{
13778 .name = "OpTaskSequenceCreateINTEL",
13779 .opcode = 6163,
13780 .operands = &.{
13781 .{ .kind = .id_result_type, .quantifier = .required },
13782 .{ .kind = .id_result, .quantifier = .required },
13783 .{ .kind = .id_ref, .quantifier = .required },
13784 .{ .kind = .literal_integer, .quantifier = .required },
13785 .{ .kind = .literal_integer, .quantifier = .required },
13786 .{ .kind = .literal_integer, .quantifier = .required },
13787 .{ .kind = .literal_integer, .quantifier = .required },
13788 },
13789 },
13790 .{
13791 .name = "OpTaskSequenceAsyncINTEL",
13792 .opcode = 6164,
13793 .operands = &.{
13794 .{ .kind = .id_ref, .quantifier = .required },
13795 .{ .kind = .id_ref, .quantifier = .variadic },
13796 },
13797 },
13798 .{
13799 .name = "OpTaskSequenceGetINTEL",
13800 .opcode = 6165,
13801 .operands = &.{
13802 .{ .kind = .id_result_type, .quantifier = .required },
13803 .{ .kind = .id_result, .quantifier = .required },
13804 .{ .kind = .id_ref, .quantifier = .required },
13805 },
13806 },
13807 .{
13808 .name = "OpTaskSequenceReleaseINTEL",
13809 .opcode = 6166,
13810 .operands = &.{
13811 .{ .kind = .id_ref, .quantifier = .required },
13812 },
13813 },
13814 .{
13815 .name = "OpTypeTaskSequenceINTEL",
13816 .opcode = 6199,
13817 .operands = &.{
13818 .{ .kind = .id_result, .quantifier = .required },
13819 },
13820 },
13821 .{
13822 .name = "OpSubgroupBlockPrefetchINTEL",
13823 .opcode = 6221,
13824 .operands = &.{
13825 .{ .kind = .id_ref, .quantifier = .required },
13826 .{ .kind = .id_ref, .quantifier = .required },
13827 .{ .kind = .memory_access, .quantifier = .optional },
13828 },
13829 },
13830 .{
13831 .name = "OpSubgroup2DBlockLoadINTEL",
13832 .opcode = 6231,
13833 .operands = &.{
13834 .{ .kind = .id_ref, .quantifier = .required },
13835 .{ .kind = .id_ref, .quantifier = .required },
13836 .{ .kind = .id_ref, .quantifier = .required },
13837 .{ .kind = .id_ref, .quantifier = .required },
13838 .{ .kind = .id_ref, .quantifier = .required },
13839 .{ .kind = .id_ref, .quantifier = .required },
13840 .{ .kind = .id_ref, .quantifier = .required },
13841 .{ .kind = .id_ref, .quantifier = .required },
13842 .{ .kind = .id_ref, .quantifier = .required },
13843 .{ .kind = .id_ref, .quantifier = .required },
13844 },
13845 },
13846 .{
13847 .name = "OpSubgroup2DBlockLoadTransformINTEL",
13848 .opcode = 6232,
13849 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
13855 .{ .kind = .id_ref, .quantifier = .required },
13856 .{ .kind = .id_ref, .quantifier = .required },
13857 .{ .kind = .id_ref, .quantifier = .required },
13858 .{ .kind = .id_ref, .quantifier = .required },
13859 .{ .kind = .id_ref, .quantifier = .required },
13860 },
13861 },
13862 .{
13863 .name = "OpSubgroup2DBlockLoadTransposeINTEL",
13864 .opcode = 6233,
13865 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
13871 .{ .kind = .id_ref, .quantifier = .required },
13872 .{ .kind = .id_ref, .quantifier = .required },
13873 .{ .kind = .id_ref, .quantifier = .required },
13874 .{ .kind = .id_ref, .quantifier = .required },
13875 .{ .kind = .id_ref, .quantifier = .required },
13876 },
13877 },
13878 .{
13879 .name = "OpSubgroup2DBlockPrefetchINTEL",
13880 .opcode = 6234,
13881 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
13887 .{ .kind = .id_ref, .quantifier = .required },
13888 .{ .kind = .id_ref, .quantifier = .required },
13889 .{ .kind = .id_ref, .quantifier = .required },
13890 .{ .kind = .id_ref, .quantifier = .required },
13891 },
13892 },
13893 .{
13894 .name = "OpSubgroup2DBlockStoreINTEL",
13895 .opcode = 6235,
13896 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
13902 .{ .kind = .id_ref, .quantifier = .required },
13903 .{ .kind = .id_ref, .quantifier = .required },
13904 .{ .kind = .id_ref, .quantifier = .required },
13905 .{ .kind = .id_ref, .quantifier = .required },
13906 .{ .kind = .id_ref, .quantifier = .required },
13907 },
13908 },
13909 .{
13910 .name = "OpSubgroupMatrixMultiplyAccumulateINTEL",
13911 .opcode = 6237,
13912 .operands = &.{
13913 .{ .kind = .id_result_type, .quantifier = .required },
13914 .{ .kind = .id_result, .quantifier = .required },
13915 .{ .kind = .id_ref, .quantifier = .required },
13916 .{ .kind = .id_ref, .quantifier = .required },
13917 .{ .kind = .id_ref, .quantifier = .required },
13918 .{ .kind = .id_ref, .quantifier = .required },
13919 .{ .kind = .matrix_multiply_accumulate_operands, .quantifier = .optional },
13920 },
13921 },
13922 .{
13923 .name = "OpBitwiseFunctionINTEL",
13924 .opcode = 6242,
13925 .operands = &.{
13926 .{ .kind = .id_result_type, .quantifier = .required },
13927 .{ .kind = .id_result, .quantifier = .required },
13928 .{ .kind = .id_ref, .quantifier = .required },
13929 .{ .kind = .id_ref, .quantifier = .required },
13930 .{ .kind = .id_ref, .quantifier = .required },
13931 .{ .kind = .id_ref, .quantifier = .required },
13932 },
13933 },
13934 .{
13935 .name = "OpGroupIMulKHR",
13936 .opcode = 6401,
13937 .operands = &.{
13938 .{ .kind = .id_result_type, .quantifier = .required },
13939 .{ .kind = .id_result, .quantifier = .required },
13940 .{ .kind = .id_scope, .quantifier = .required },
13941 .{ .kind = .group_operation, .quantifier = .required },
13942 .{ .kind = .id_ref, .quantifier = .required },
13943 },
13944 },
13945 .{
13946 .name = "OpGroupFMulKHR",
13947 .opcode = 6402,
13948 .operands = &.{
13949 .{ .kind = .id_result_type, .quantifier = .required },
13950 .{ .kind = .id_result, .quantifier = .required },
13951 .{ .kind = .id_scope, .quantifier = .required },
13952 .{ .kind = .group_operation, .quantifier = .required },
13953 .{ .kind = .id_ref, .quantifier = .required },
13954 },
13955 },
13956 .{
13957 .name = "OpGroupBitwiseAndKHR",
13958 .opcode = 6403,
13959 .operands = &.{
13960 .{ .kind = .id_result_type, .quantifier = .required },
13961 .{ .kind = .id_result, .quantifier = .required },
13962 .{ .kind = .id_scope, .quantifier = .required },
13963 .{ .kind = .group_operation, .quantifier = .required },
13964 .{ .kind = .id_ref, .quantifier = .required },
13965 },
13966 },
13967 .{
13968 .name = "OpGroupBitwiseOrKHR",
13969 .opcode = 6404,
13970 .operands = &.{
13971 .{ .kind = .id_result_type, .quantifier = .required },
13972 .{ .kind = .id_result, .quantifier = .required },
13973 .{ .kind = .id_scope, .quantifier = .required },
13974 .{ .kind = .group_operation, .quantifier = .required },
13975 .{ .kind = .id_ref, .quantifier = .required },
13976 },
13977 },
13978 .{
13979 .name = "OpGroupBitwiseXorKHR",
13980 .opcode = 6405,
13981 .operands = &.{
13982 .{ .kind = .id_result_type, .quantifier = .required },
13983 .{ .kind = .id_result, .quantifier = .required },
13984 .{ .kind = .id_scope, .quantifier = .required },
13985 .{ .kind = .group_operation, .quantifier = .required },
13986 .{ .kind = .id_ref, .quantifier = .required },
13987 },
13988 },
13989 .{
13990 .name = "OpGroupLogicalAndKHR",
13991 .opcode = 6406,
13992 .operands = &.{
13993 .{ .kind = .id_result_type, .quantifier = .required },
13994 .{ .kind = .id_result, .quantifier = .required },
13995 .{ .kind = .id_scope, .quantifier = .required },
13996 .{ .kind = .group_operation, .quantifier = .required },
13997 .{ .kind = .id_ref, .quantifier = .required },
13998 },
13999 },
14000 .{
14001 .name = "OpGroupLogicalOrKHR",
14002 .opcode = 6407,
14003 .operands = &.{
14004 .{ .kind = .id_result_type, .quantifier = .required },
14005 .{ .kind = .id_result, .quantifier = .required },
14006 .{ .kind = .id_scope, .quantifier = .required },
14007 .{ .kind = .group_operation, .quantifier = .required },
14008 .{ .kind = .id_ref, .quantifier = .required },
14009 },
14010 },
14011 .{
14012 .name = "OpGroupLogicalXorKHR",
14013 .opcode = 6408,
14014 .operands = &.{
14015 .{ .kind = .id_result_type, .quantifier = .required },
14016 .{ .kind = .id_result, .quantifier = .required },
14017 .{ .kind = .id_scope, .quantifier = .required },
14018 .{ .kind = .group_operation, .quantifier = .required },
14019 .{ .kind = .id_ref, .quantifier = .required },
14020 },
14021 },
14022 .{
14023 .name = "OpRoundFToTF32INTEL",
14024 .opcode = 6426,
14025 .operands = &.{
14026 .{ .kind = .id_result_type, .quantifier = .required },
14027 .{ .kind = .id_result, .quantifier = .required },
14028 .{ .kind = .id_ref, .quantifier = .required },
14029 },
14030 },
14031 .{
14032 .name = "OpMaskedGatherINTEL",
14033 .opcode = 6428,
14034 .operands = &.{
14035 .{ .kind = .id_result_type, .quantifier = .required },
14036 .{ .kind = .id_result, .quantifier = .required },
14037 .{ .kind = .id_ref, .quantifier = .required },
14038 .{ .kind = .literal_integer, .quantifier = .required },
14039 .{ .kind = .id_ref, .quantifier = .required },
14040 .{ .kind = .id_ref, .quantifier = .required },
14041 },
14042 },
14043 .{
14044 .name = "OpMaskedScatterINTEL",
14045 .opcode = 6429,
14046 .operands = &.{
14047 .{ .kind = .id_ref, .quantifier = .required },
14048 .{ .kind = .id_ref, .quantifier = .required },
14049 .{ .kind = .literal_integer, .quantifier = .required },
14050 .{ .kind = .id_ref, .quantifier = .required },
14051 },
14052 },
14053 .{
14054 .name = "OpConvertHandleToImageINTEL",
14055 .opcode = 6529,
14056 .operands = &.{
14057 .{ .kind = .id_result_type, .quantifier = .required },
14058 .{ .kind = .id_result, .quantifier = .required },
14059 .{ .kind = .id_ref, .quantifier = .required },
14060 },
14061 },
14062 .{
14063 .name = "OpConvertHandleToSamplerINTEL",
14064 .opcode = 6530,
14065 .operands = &.{
14066 .{ .kind = .id_result_type, .quantifier = .required },
14067 .{ .kind = .id_result, .quantifier = .required },
14068 .{ .kind = .id_ref, .quantifier = .required },
14069 },
14070 },
14071 .{
14072 .name = "OpConvertHandleToSampledImageINTEL",
14073 .opcode = 6531,
14074 .operands = &.{
14075 .{ .kind = .id_result_type, .quantifier = .required },
14076 .{ .kind = .id_result, .quantifier = .required },
14077 .{ .kind = .id_ref, .quantifier = .required },
14078 },
14079 },
14080 },
14081 .spv_amd_shader_trinary_minmax => &.{
14082 .{
14083 .name = "FMin3AMD",
14084 .opcode = 1,
14085 .operands = &.{
14086 .{ .kind = .id_ref, .quantifier = .required },
14087 .{ .kind = .id_ref, .quantifier = .required },
14088 .{ .kind = .id_ref, .quantifier = .required },
14089 },
14090 },
14091 .{
14092 .name = "UMin3AMD",
14093 .opcode = 2,
14094 .operands = &.{
14095 .{ .kind = .id_ref, .quantifier = .required },
14096 .{ .kind = .id_ref, .quantifier = .required },
14097 .{ .kind = .id_ref, .quantifier = .required },
14098 },
14099 },
14100 .{
14101 .name = "SMin3AMD",
14102 .opcode = 3,
14103 .operands = &.{
14104 .{ .kind = .id_ref, .quantifier = .required },
14105 .{ .kind = .id_ref, .quantifier = .required },
14106 .{ .kind = .id_ref, .quantifier = .required },
14107 },
14108 },
14109 .{
14110 .name = "FMax3AMD",
14111 .opcode = 4,
14112 .operands = &.{
14113 .{ .kind = .id_ref, .quantifier = .required },
14114 .{ .kind = .id_ref, .quantifier = .required },
14115 .{ .kind = .id_ref, .quantifier = .required },
14116 },
14117 },
14118 .{
14119 .name = "UMax3AMD",
14120 .opcode = 5,
14121 .operands = &.{
14122 .{ .kind = .id_ref, .quantifier = .required },
14123 .{ .kind = .id_ref, .quantifier = .required },
14124 .{ .kind = .id_ref, .quantifier = .required },
14125 },
14126 },
14127 .{
14128 .name = "SMax3AMD",
14129 .opcode = 6,
14130 .operands = &.{
14131 .{ .kind = .id_ref, .quantifier = .required },
14132 .{ .kind = .id_ref, .quantifier = .required },
14133 .{ .kind = .id_ref, .quantifier = .required },
14134 },
14135 },
14136 .{
14137 .name = "FMid3AMD",
14138 .opcode = 7,
14139 .operands = &.{
14140 .{ .kind = .id_ref, .quantifier = .required },
14141 .{ .kind = .id_ref, .quantifier = .required },
14142 .{ .kind = .id_ref, .quantifier = .required },
14143 },
14144 },
14145 .{
14146 .name = "UMid3AMD",
14147 .opcode = 8,
14148 .operands = &.{
14149 .{ .kind = .id_ref, .quantifier = .required },
14150 .{ .kind = .id_ref, .quantifier = .required },
14151 .{ .kind = .id_ref, .quantifier = .required },
14152 },
14153 },
14154 .{
14155 .name = "SMid3AMD",
14156 .opcode = 9,
14157 .operands = &.{
14158 .{ .kind = .id_ref, .quantifier = .required },
14159 .{ .kind = .id_ref, .quantifier = .required },
14160 .{ .kind = .id_ref, .quantifier = .required },
14161 },
14162 },
14163 },
14164 .spv_ext_inst_type_tosa_001000_1 => &.{
14165 .{
14166 .name = "ARGMAX",
14167 .opcode = 0,
14168 .operands = &.{
14169 .{ .kind = .id_ref, .quantifier = .required },
14170 .{ .kind = .id_ref, .quantifier = .required },
14171 .{ .kind = .id_ref, .quantifier = .required },
14172 },
14173 },
14174 .{
14175 .name = "AVG_POOL2D",
14176 .opcode = 1,
14177 .operands = &.{
14178 .{ .kind = .id_ref, .quantifier = .required },
14179 .{ .kind = .id_ref, .quantifier = .required },
14180 .{ .kind = .id_ref, .quantifier = .required },
14181 .{ .kind = .id_ref, .quantifier = .required },
14182 .{ .kind = .id_ref, .quantifier = .required },
14183 .{ .kind = .id_ref, .quantifier = .required },
14184 .{ .kind = .id_ref, .quantifier = .required },
14185 },
14186 },
14187 .{
14188 .name = "CONV2D",
14189 .opcode = 2,
14190 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
14196 .{ .kind = .id_ref, .quantifier = .required },
14197 .{ .kind = .id_ref, .quantifier = .required },
14198 .{ .kind = .id_ref, .quantifier = .required },
14199 .{ .kind = .id_ref, .quantifier = .required },
14200 .{ .kind = .id_ref, .quantifier = .required },
14201 },
14202 },
14203 .{
14204 .name = "CONV3D",
14205 .opcode = 3,
14206 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
14212 .{ .kind = .id_ref, .quantifier = .required },
14213 .{ .kind = .id_ref, .quantifier = .required },
14214 .{ .kind = .id_ref, .quantifier = .required },
14215 .{ .kind = .id_ref, .quantifier = .required },
14216 .{ .kind = .id_ref, .quantifier = .required },
14217 },
14218 },
14219 .{
14220 .name = "DEPTHWISE_CONV2D",
14221 .opcode = 4,
14222 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
14228 .{ .kind = .id_ref, .quantifier = .required },
14229 .{ .kind = .id_ref, .quantifier = .required },
14230 .{ .kind = .id_ref, .quantifier = .required },
14231 .{ .kind = .id_ref, .quantifier = .required },
14232 .{ .kind = .id_ref, .quantifier = .required },
14233 },
14234 },
14235 .{
14236 .name = "FFT2D",
14237 .opcode = 5,
14238 .operands = &.{
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 = "MATMUL",
14247 .opcode = 6,
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 = "MAX_POOL2D",
14257 .opcode = 7,
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 .{ .kind = .id_ref, .quantifier = .required },
14264 },
14265 },
14266 .{
14267 .name = "RFFT2D",
14268 .opcode = 8,
14269 .operands = &.{
14270 .{ .kind = .id_ref, .quantifier = .required },
14271 .{ .kind = .id_ref, .quantifier = .required },
14272 },
14273 },
14274 .{
14275 .name = "TRANSPOSE_CONV2D",
14276 .opcode = 9,
14277 .operands = &.{
14278 .{ .kind = .id_ref, .quantifier = .required },
14279 .{ .kind = .id_ref, .quantifier = .required },
14280 .{ .kind = .id_ref, .quantifier = .required },
14281 .{ .kind = .id_ref, .quantifier = .required },
14282 .{ .kind = .id_ref, .quantifier = .required },
14283 .{ .kind = .id_ref, .quantifier = .required },
14284 .{ .kind = .id_ref, .quantifier = .required },
14285 .{ .kind = .id_ref, .quantifier = .required },
14286 .{ .kind = .id_ref, .quantifier = .required },
14287 },
14288 },
14289 .{
14290 .name = "CLAMP",
14291 .opcode = 10,
14292 .operands = &.{
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 = "ERF",
14301 .opcode = 11,
14302 .operands = &.{
14303 .{ .kind = .id_ref, .quantifier = .required },
14304 },
14305 },
14306 .{
14307 .name = "SIGMOID",
14308 .opcode = 12,
14309 .operands = &.{
14310 .{ .kind = .id_ref, .quantifier = .required },
14311 },
14312 },
14313 .{
14314 .name = "TANH",
14315 .opcode = 13,
14316 .operands = &.{
14317 .{ .kind = .id_ref, .quantifier = .required },
14318 },
14319 },
14320 .{
14321 .name = "ADD",
14322 .opcode = 14,
14323 .operands = &.{
14324 .{ .kind = .id_ref, .quantifier = .required },
14325 .{ .kind = .id_ref, .quantifier = .required },
14326 },
14327 },
14328 .{
14329 .name = "ARITHMETIC_RIGHT_SHIFT",
14330 .opcode = 15,
14331 .operands = &.{
14332 .{ .kind = .id_ref, .quantifier = .required },
14333 .{ .kind = .id_ref, .quantifier = .required },
14334 .{ .kind = .id_ref, .quantifier = .required },
14335 },
14336 },
14337 .{
14338 .name = "BITWISE_AND",
14339 .opcode = 16,
14340 .operands = &.{
14341 .{ .kind = .id_ref, .quantifier = .required },
14342 .{ .kind = .id_ref, .quantifier = .required },
14343 },
14344 },
14345 .{
14346 .name = "BITWISE_OR",
14347 .opcode = 17,
14348 .operands = &.{
14349 .{ .kind = .id_ref, .quantifier = .required },
14350 .{ .kind = .id_ref, .quantifier = .required },
14351 },
14352 },
14353 .{
14354 .name = "BITWISE_XOR",
14355 .opcode = 18,
14356 .operands = &.{
14357 .{ .kind = .id_ref, .quantifier = .required },
14358 .{ .kind = .id_ref, .quantifier = .required },
14359 },
14360 },
14361 .{
14362 .name = "INTDIV",
14363 .opcode = 19,
14364 .operands = &.{
14365 .{ .kind = .id_ref, .quantifier = .required },
14366 .{ .kind = .id_ref, .quantifier = .required },
14367 },
14368 },
14369 .{
14370 .name = "LOGICAL_AND",
14371 .opcode = 20,
14372 .operands = &.{
14373 .{ .kind = .id_ref, .quantifier = .required },
14374 .{ .kind = .id_ref, .quantifier = .required },
14375 },
14376 },
14377 .{
14378 .name = "LOGICAL_LEFT_SHIFT",
14379 .opcode = 21,
14380 .operands = &.{
14381 .{ .kind = .id_ref, .quantifier = .required },
14382 .{ .kind = .id_ref, .quantifier = .required },
14383 },
14384 },
14385 .{
14386 .name = "LOGICAL_RIGHT_SHIFT",
14387 .opcode = 22,
14388 .operands = &.{
14389 .{ .kind = .id_ref, .quantifier = .required },
14390 .{ .kind = .id_ref, .quantifier = .required },
14391 },
14392 },
14393 .{
14394 .name = "LOGICAL_OR",
14395 .opcode = 23,
14396 .operands = &.{
14397 .{ .kind = .id_ref, .quantifier = .required },
14398 .{ .kind = .id_ref, .quantifier = .required },
14399 },
14400 },
14401 .{
14402 .name = "LOGICAL_XOR",
14403 .opcode = 24,
14404 .operands = &.{
14405 .{ .kind = .id_ref, .quantifier = .required },
14406 .{ .kind = .id_ref, .quantifier = .required },
14407 },
14408 },
14409 .{
14410 .name = "MAXIMUM",
14411 .opcode = 25,
14412 .operands = &.{
14413 .{ .kind = .id_ref, .quantifier = .required },
14414 .{ .kind = .id_ref, .quantifier = .required },
14415 .{ .kind = .id_ref, .quantifier = .required },
14416 },
14417 },
14418 .{
14419 .name = "MINIMUM",
14420 .opcode = 26,
14421 .operands = &.{
14422 .{ .kind = .id_ref, .quantifier = .required },
14423 .{ .kind = .id_ref, .quantifier = .required },
14424 .{ .kind = .id_ref, .quantifier = .required },
14425 },
14426 },
14427 .{
14428 .name = "MUL",
14429 .opcode = 27,
14430 .operands = &.{
14431 .{ .kind = .id_ref, .quantifier = .required },
14432 .{ .kind = .id_ref, .quantifier = .required },
14433 .{ .kind = .id_ref, .quantifier = .required },
14434 },
14435 },
14436 .{
14437 .name = "POW",
14438 .opcode = 28,
14439 .operands = &.{
14440 .{ .kind = .id_ref, .quantifier = .required },
14441 .{ .kind = .id_ref, .quantifier = .required },
14442 },
14443 },
14444 .{
14445 .name = "SUB",
14446 .opcode = 29,
14447 .operands = &.{
14448 .{ .kind = .id_ref, .quantifier = .required },
14449 .{ .kind = .id_ref, .quantifier = .required },
14450 },
14451 },
14452 .{
14453 .name = "TABLE",
14454 .opcode = 30,
14455 .operands = &.{
14456 .{ .kind = .id_ref, .quantifier = .required },
14457 .{ .kind = .id_ref, .quantifier = .required },
14458 },
14459 },
14460 .{
14461 .name = "ABS",
14462 .opcode = 31,
14463 .operands = &.{
14464 .{ .kind = .id_ref, .quantifier = .required },
14465 },
14466 },
14467 .{
14468 .name = "BITWISE_NOT",
14469 .opcode = 32,
14470 .operands = &.{
14471 .{ .kind = .id_ref, .quantifier = .required },
14472 },
14473 },
14474 .{
14475 .name = "CEIL",
14476 .opcode = 33,
14477 .operands = &.{
14478 .{ .kind = .id_ref, .quantifier = .required },
14479 },
14480 },
14481 .{
14482 .name = "CLZ",
14483 .opcode = 34,
14484 .operands = &.{
14485 .{ .kind = .id_ref, .quantifier = .required },
14486 },
14487 },
14488 .{
14489 .name = "COS",
14490 .opcode = 35,
14491 .operands = &.{
14492 .{ .kind = .id_ref, .quantifier = .required },
14493 },
14494 },
14495 .{
14496 .name = "EXP",
14497 .opcode = 36,
14498 .operands = &.{
14499 .{ .kind = .id_ref, .quantifier = .required },
14500 },
14501 },
14502 .{
14503 .name = "FLOOR",
14504 .opcode = 37,
14505 .operands = &.{
14506 .{ .kind = .id_ref, .quantifier = .required },
14507 },
14508 },
14509 .{
14510 .name = "LOG",
14511 .opcode = 38,
14512 .operands = &.{
14513 .{ .kind = .id_ref, .quantifier = .required },
14514 },
14515 },
14516 .{
14517 .name = "LOGICAL_NOT",
14518 .opcode = 39,
14519 .operands = &.{
14520 .{ .kind = .id_ref, .quantifier = .required },
14521 },
14522 },
14523 .{
14524 .name = "NEGATE",
14525 .opcode = 40,
14526 .operands = &.{
14527 .{ .kind = .id_ref, .quantifier = .required },
14528 .{ .kind = .id_ref, .quantifier = .required },
14529 .{ .kind = .id_ref, .quantifier = .required },
14530 },
14531 },
14532 .{
14533 .name = "RECIPROCAL",
14534 .opcode = 41,
14535 .operands = &.{
14536 .{ .kind = .id_ref, .quantifier = .required },
14537 },
14538 },
14539 .{
14540 .name = "RSQRT",
14541 .opcode = 42,
14542 .operands = &.{
14543 .{ .kind = .id_ref, .quantifier = .required },
14544 },
14545 },
14546 .{
14547 .name = "SIN",
14548 .opcode = 43,
14549 .operands = &.{
14550 .{ .kind = .id_ref, .quantifier = .required },
14551 },
14552 },
14553 .{
14554 .name = "SELECT",
14555 .opcode = 44,
14556 .operands = &.{
14557 .{ .kind = .id_ref, .quantifier = .required },
14558 .{ .kind = .id_ref, .quantifier = .required },
14559 .{ .kind = .id_ref, .quantifier = .required },
14560 },
14561 },
14562 .{
14563 .name = "EQUAL",
14564 .opcode = 45,
14565 .operands = &.{
14566 .{ .kind = .id_ref, .quantifier = .required },
14567 .{ .kind = .id_ref, .quantifier = .required },
14568 },
14569 },
14570 .{
14571 .name = "GREATER",
14572 .opcode = 46,
14573 .operands = &.{
14574 .{ .kind = .id_ref, .quantifier = .required },
14575 .{ .kind = .id_ref, .quantifier = .required },
14576 },
14577 },
14578 .{
14579 .name = "GREATER_EQUAL",
14580 .opcode = 47,
14581 .operands = &.{
14582 .{ .kind = .id_ref, .quantifier = .required },
14583 .{ .kind = .id_ref, .quantifier = .required },
14584 },
14585 },
14586 .{
14587 .name = "REDUCE_ALL",
14588 .opcode = 48,
14589 .operands = &.{
14590 .{ .kind = .id_ref, .quantifier = .required },
14591 .{ .kind = .id_ref, .quantifier = .required },
14592 },
14593 },
14594 .{
14595 .name = "REDUCE_ANY",
14596 .opcode = 49,
14597 .operands = &.{
14598 .{ .kind = .id_ref, .quantifier = .required },
14599 .{ .kind = .id_ref, .quantifier = .required },
14600 },
14601 },
14602 .{
14603 .name = "REDUCE_MAX",
14604 .opcode = 50,
14605 .operands = &.{
14606 .{ .kind = .id_ref, .quantifier = .required },
14607 .{ .kind = .id_ref, .quantifier = .required },
14608 .{ .kind = .id_ref, .quantifier = .required },
14609 },
14610 },
14611 .{
14612 .name = "REDUCE_MIN",
14613 .opcode = 51,
14614 .operands = &.{
14615 .{ .kind = .id_ref, .quantifier = .required },
14616 .{ .kind = .id_ref, .quantifier = .required },
14617 .{ .kind = .id_ref, .quantifier = .required },
14618 },
14619 },
14620 .{
14621 .name = "REDUCE_PRODUCT",
14622 .opcode = 52,
14623 .operands = &.{
14624 .{ .kind = .id_ref, .quantifier = .required },
14625 .{ .kind = .id_ref, .quantifier = .required },
14626 },
14627 },
14628 .{
14629 .name = "REDUCE_SUM",
14630 .opcode = 53,
14631 .operands = &.{
14632 .{ .kind = .id_ref, .quantifier = .required },
14633 .{ .kind = .id_ref, .quantifier = .required },
14634 },
14635 },
14636 .{
14637 .name = "CONCAT",
14638 .opcode = 54,
14639 .operands = &.{
14640 .{ .kind = .id_ref, .quantifier = .required },
14641 .{ .kind = .id_ref, .quantifier = .variadic },
14642 },
14643 },
14644 .{
14645 .name = "PAD",
14646 .opcode = 55,
14647 .operands = &.{
14648 .{ .kind = .id_ref, .quantifier = .required },
14649 .{ .kind = .id_ref, .quantifier = .required },
14650 .{ .kind = .id_ref, .quantifier = .required },
14651 },
14652 },
14653 .{
14654 .name = "RESHAPE",
14655 .opcode = 56,
14656 .operands = &.{
14657 .{ .kind = .id_ref, .quantifier = .required },
14658 .{ .kind = .id_ref, .quantifier = .required },
14659 },
14660 },
14661 .{
14662 .name = "REVERSE",
14663 .opcode = 57,
14664 .operands = &.{
14665 .{ .kind = .id_ref, .quantifier = .required },
14666 .{ .kind = .id_ref, .quantifier = .required },
14667 },
14668 },
14669 .{
14670 .name = "SLICE",
14671 .opcode = 58,
14672 .operands = &.{
14673 .{ .kind = .id_ref, .quantifier = .required },
14674 .{ .kind = .id_ref, .quantifier = .required },
14675 .{ .kind = .id_ref, .quantifier = .required },
14676 },
14677 },
14678 .{
14679 .name = "TILE",
14680 .opcode = 59,
14681 .operands = &.{
14682 .{ .kind = .id_ref, .quantifier = .required },
14683 .{ .kind = .id_ref, .quantifier = .required },
14684 },
14685 },
14686 .{
14687 .name = "TRANSPOSE",
14688 .opcode = 60,
14689 .operands = &.{
14690 .{ .kind = .id_ref, .quantifier = .required },
14691 .{ .kind = .id_ref, .quantifier = .required },
14692 },
14693 },
14694 .{
14695 .name = "GATHER",
14696 .opcode = 61,
14697 .operands = &.{
14698 .{ .kind = .id_ref, .quantifier = .required },
14699 .{ .kind = .id_ref, .quantifier = .required },
14700 },
14701 },
14702 .{
14703 .name = "SCATTER",
14704 .opcode = 62,
14705 .operands = &.{
14706 .{ .kind = .id_ref, .quantifier = .required },
14707 .{ .kind = .id_ref, .quantifier = .required },
14708 .{ .kind = .id_ref, .quantifier = .required },
14709 },
14710 },
14711 .{
14712 .name = "RESIZE",
14713 .opcode = 63,
14714 .operands = &.{
14715 .{ .kind = .id_ref, .quantifier = .required },
14716 .{ .kind = .id_ref, .quantifier = .required },
14717 .{ .kind = .id_ref, .quantifier = .required },
14718 .{ .kind = .id_ref, .quantifier = .required },
14719 .{ .kind = .id_ref, .quantifier = .required },
14720 },
14721 },
14722 .{
14723 .name = "CAST",
14724 .opcode = 64,
14725 .operands = &.{
14726 .{ .kind = .id_ref, .quantifier = .required },
14727 },
14728 },
14729 .{
14730 .name = "RESCALE",
14731 .opcode = 65,
14732 .operands = &.{
14733 .{ .kind = .id_ref, .quantifier = .required },
14734 .{ .kind = .id_ref, .quantifier = .required },
14735 .{ .kind = .id_ref, .quantifier = .required },
14736 .{ .kind = .id_ref, .quantifier = .required },
14737 .{ .kind = .id_ref, .quantifier = .required },
14738 .{ .kind = .id_ref, .quantifier = .required },
14739 .{ .kind = .id_ref, .quantifier = .required },
14740 .{ .kind = .id_ref, .quantifier = .required },
14741 .{ .kind = .id_ref, .quantifier = .required },
14742 .{ .kind = .id_ref, .quantifier = .required },
14743 },
14744 },
14745 },
14746 .non_semantic_vksp_reflection => &.{
14747 .{
14748 .name = "Configuration",
14749 .opcode = 1,
14750 .operands = &.{
14751 .{ .kind = .id_ref, .quantifier = .required },
14752 .{ .kind = .id_ref, .quantifier = .required },
14753 .{ .kind = .id_ref, .quantifier = .required },
14754 .{ .kind = .id_ref, .quantifier = .required },
14755 .{ .kind = .id_ref, .quantifier = .required },
14756 .{ .kind = .id_ref, .quantifier = .required },
14757 .{ .kind = .id_ref, .quantifier = .required },
14758 .{ .kind = .id_ref, .quantifier = .required },
14759 .{ .kind = .id_ref, .quantifier = .required },
14760 },
14761 },
14762 .{
14763 .name = "StartCounter",
14764 .opcode = 2,
14765 .operands = &.{
14766 .{ .kind = .id_ref, .quantifier = .required },
14767 },
14768 },
14769 .{
14770 .name = "StopCounter",
14771 .opcode = 3,
14772 .operands = &.{
14773 .{ .kind = .id_ref, .quantifier = .required },
14774 },
14775 },
14776 .{
14777 .name = "PushConstants",
14778 .opcode = 4,
14779 .operands = &.{
14780 .{ .kind = .id_ref, .quantifier = .required },
14781 .{ .kind = .id_ref, .quantifier = .required },
14782 .{ .kind = .id_ref, .quantifier = .required },
14783 .{ .kind = .id_ref, .quantifier = .required },
14784 },
14785 },
14786 .{
14787 .name = "SpecializationMapEntry",
14788 .opcode = 5,
14789 .operands = &.{
14790 .{ .kind = .id_ref, .quantifier = .required },
14791 .{ .kind = .id_ref, .quantifier = .required },
14792 .{ .kind = .id_ref, .quantifier = .required },
14793 },
14794 },
14795 .{
14796 .name = "DescriptorSetBuffer",
14797 .opcode = 6,
14798 .operands = &.{
14799 .{ .kind = .id_ref, .quantifier = .required },
14800 .{ .kind = .id_ref, .quantifier = .required },
14801 .{ .kind = .id_ref, .quantifier = .required },
14802 .{ .kind = .id_ref, .quantifier = .required },
14803 .{ .kind = .id_ref, .quantifier = .required },
14804 .{ .kind = .id_ref, .quantifier = .required },
14805 .{ .kind = .id_ref, .quantifier = .required },
14806 .{ .kind = .id_ref, .quantifier = .required },
14807 .{ .kind = .id_ref, .quantifier = .required },
14808 .{ .kind = .id_ref, .quantifier = .required },
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 },
14815 },
14816 .{
14817 .name = "DescriptorSetImage",
14818 .opcode = 7,
14819 .operands = &.{
14820 .{ .kind = .id_ref, .quantifier = .required },
14821 .{ .kind = .id_ref, .quantifier = .required },
14822 .{ .kind = .id_ref, .quantifier = .required },
14823 .{ .kind = .id_ref, .quantifier = .required },
14824 .{ .kind = .id_ref, .quantifier = .required },
14825 .{ .kind = .id_ref, .quantifier = .required },
14826 .{ .kind = .id_ref, .quantifier = .required },
14827 .{ .kind = .id_ref, .quantifier = .required },
14828 .{ .kind = .id_ref, .quantifier = .required },
14829 .{ .kind = .id_ref, .quantifier = .required },
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 },
14854 },
14855 .{
14856 .name = "DescriptorSetSampler",
14857 .opcode = 8,
14858 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
14864 .{ .kind = .id_ref, .quantifier = .required },
14865 .{ .kind = .id_ref, .quantifier = .required },
14866 .{ .kind = .id_ref, .quantifier = .required },
14867 .{ .kind = .id_ref, .quantifier = .required },
14868 .{ .kind = .id_ref, .quantifier = .required },
14869 .{ .kind = .id_ref, .quantifier = .required },
14870 .{ .kind = .id_ref, .quantifier = .required },
14871 .{ .kind = .id_ref, .quantifier = .required },
14872 .{ .kind = .id_ref, .quantifier = .required },
14873 .{ .kind = .id_ref, .quantifier = .required },
14874 .{ .kind = .id_ref, .quantifier = .required },
14875 .{ .kind = .id_ref, .quantifier = .required },
14876 .{ .kind = .id_ref, .quantifier = .required },
14877 .{ .kind = .id_ref, .quantifier = .required },
14878 },
14879 },
14880 },
14881 .spv_amd_shader_explicit_vertex_parameter => &.{
14882 .{
14883 .name = "InterpolateAtVertexAMD",
14884 .opcode = 1,
14885 .operands = &.{
14886 .{ .kind = .id_ref, .quantifier = .required },
14887 .{ .kind = .id_ref, .quantifier = .required },
14888 },
14889 },
14890 },
14891 .debug_info => &.{
14892 .{
14893 .name = "DebugInfoNone",
14894 .opcode = 0,
14895 .operands = &.{},
14896 },
14897 .{
14898 .name = "DebugCompilationUnit",
14899 .opcode = 1,
14900 .operands = &.{
14901 .{ .kind = .id_ref, .quantifier = .required },
14902 .{ .kind = .literal_integer, .quantifier = .required },
14903 .{ .kind = .literal_integer, .quantifier = .required },
14904 },
14905 },
14906 .{
14907 .name = "DebugTypeBasic",
14908 .opcode = 2,
14909 .operands = &.{
14910 .{ .kind = .id_ref, .quantifier = .required },
14911 .{ .kind = .id_ref, .quantifier = .required },
14912 .{ .kind = .debug_info_debug_base_type_attribute_encoding, .quantifier = .required },
14913 },
14914 },
14915 .{
14916 .name = "DebugTypePointer",
14917 .opcode = 3,
14918 .operands = &.{
14919 .{ .kind = .id_ref, .quantifier = .required },
14920 .{ .kind = .storage_class, .quantifier = .required },
14921 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14922 },
14923 },
14924 .{
14925 .name = "DebugTypeQualifier",
14926 .opcode = 4,
14927 .operands = &.{
14928 .{ .kind = .id_ref, .quantifier = .required },
14929 .{ .kind = .debug_info_debug_type_qualifier, .quantifier = .required },
14930 },
14931 },
14932 .{
14933 .name = "DebugTypeArray",
14934 .opcode = 5,
14935 .operands = &.{
14936 .{ .kind = .id_ref, .quantifier = .required },
14937 .{ .kind = .id_ref, .quantifier = .variadic },
14938 },
14939 },
14940 .{
14941 .name = "DebugTypeVector",
14942 .opcode = 6,
14943 .operands = &.{
14944 .{ .kind = .id_ref, .quantifier = .required },
14945 .{ .kind = .literal_integer, .quantifier = .required },
14946 },
14947 },
14948 .{
14949 .name = "DebugTypedef",
14950 .opcode = 7,
14951 .operands = &.{
14952 .{ .kind = .id_ref, .quantifier = .required },
14953 .{ .kind = .id_ref, .quantifier = .required },
14954 .{ .kind = .id_ref, .quantifier = .required },
14955 .{ .kind = .literal_integer, .quantifier = .required },
14956 .{ .kind = .literal_integer, .quantifier = .required },
14957 .{ .kind = .id_ref, .quantifier = .required },
14958 },
14959 },
14960 .{
14961 .name = "DebugTypeFunction",
14962 .opcode = 8,
14963 .operands = &.{
14964 .{ .kind = .id_ref, .quantifier = .required },
14965 .{ .kind = .id_ref, .quantifier = .variadic },
14966 },
14967 },
14968 .{
14969 .name = "DebugTypeEnum",
14970 .opcode = 9,
14971 .operands = &.{
14972 .{ .kind = .id_ref, .quantifier = .required },
14973 .{ .kind = .id_ref, .quantifier = .required },
14974 .{ .kind = .id_ref, .quantifier = .required },
14975 .{ .kind = .literal_integer, .quantifier = .required },
14976 .{ .kind = .literal_integer, .quantifier = .required },
14977 .{ .kind = .id_ref, .quantifier = .required },
14978 .{ .kind = .id_ref, .quantifier = .required },
14979 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14980 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
14981 },
14982 },
14983 .{
14984 .name = "DebugTypeComposite",
14985 .opcode = 10,
14986 .operands = &.{
14987 .{ .kind = .id_ref, .quantifier = .required },
14988 .{ .kind = .debug_info_debug_composite_type, .quantifier = .required },
14989 .{ .kind = .id_ref, .quantifier = .required },
14990 .{ .kind = .literal_integer, .quantifier = .required },
14991 .{ .kind = .literal_integer, .quantifier = .required },
14992 .{ .kind = .id_ref, .quantifier = .required },
14993 .{ .kind = .id_ref, .quantifier = .required },
14994 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
14995 .{ .kind = .id_ref, .quantifier = .variadic },
14996 },
14997 },
14998 .{
14999 .name = "DebugTypeMember",
15000 .opcode = 11,
15001 .operands = &.{
15002 .{ .kind = .id_ref, .quantifier = .required },
15003 .{ .kind = .id_ref, .quantifier = .required },
15004 .{ .kind = .id_ref, .quantifier = .required },
15005 .{ .kind = .literal_integer, .quantifier = .required },
15006 .{ .kind = .literal_integer, .quantifier = .required },
15007 .{ .kind = .id_ref, .quantifier = .required },
15008 .{ .kind = .id_ref, .quantifier = .required },
15009 .{ .kind = .id_ref, .quantifier = .required },
15010 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15011 .{ .kind = .id_ref, .quantifier = .optional },
15012 },
15013 },
15014 .{
15015 .name = "DebugTypeInheritance",
15016 .opcode = 12,
15017 .operands = &.{
15018 .{ .kind = .id_ref, .quantifier = .required },
15019 .{ .kind = .id_ref, .quantifier = .required },
15020 .{ .kind = .id_ref, .quantifier = .required },
15021 .{ .kind = .id_ref, .quantifier = .required },
15022 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15023 },
15024 },
15025 .{
15026 .name = "DebugTypePtrToMember",
15027 .opcode = 13,
15028 .operands = &.{
15029 .{ .kind = .id_ref, .quantifier = .required },
15030 .{ .kind = .id_ref, .quantifier = .required },
15031 },
15032 },
15033 .{
15034 .name = "DebugTypeTemplate",
15035 .opcode = 14,
15036 .operands = &.{
15037 .{ .kind = .id_ref, .quantifier = .required },
15038 .{ .kind = .id_ref, .quantifier = .variadic },
15039 },
15040 },
15041 .{
15042 .name = "DebugTypeTemplateParameter",
15043 .opcode = 15,
15044 .operands = &.{
15045 .{ .kind = .id_ref, .quantifier = .required },
15046 .{ .kind = .id_ref, .quantifier = .required },
15047 .{ .kind = .id_ref, .quantifier = .required },
15048 .{ .kind = .id_ref, .quantifier = .required },
15049 .{ .kind = .literal_integer, .quantifier = .required },
15050 .{ .kind = .literal_integer, .quantifier = .required },
15051 },
15052 },
15053 .{
15054 .name = "DebugTypeTemplateTemplateParameter",
15055 .opcode = 16,
15056 .operands = &.{
15057 .{ .kind = .id_ref, .quantifier = .required },
15058 .{ .kind = .id_ref, .quantifier = .required },
15059 .{ .kind = .id_ref, .quantifier = .required },
15060 .{ .kind = .literal_integer, .quantifier = .required },
15061 .{ .kind = .literal_integer, .quantifier = .required },
15062 },
15063 },
15064 .{
15065 .name = "DebugTypeTemplateParameterPack",
15066 .opcode = 17,
15067 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .variadic },
15073 },
15074 },
15075 .{
15076 .name = "DebugGlobalVariable",
15077 .opcode = 18,
15078 .operands = &.{
15079 .{ .kind = .id_ref, .quantifier = .required },
15080 .{ .kind = .id_ref, .quantifier = .required },
15081 .{ .kind = .id_ref, .quantifier = .required },
15082 .{ .kind = .literal_integer, .quantifier = .required },
15083 .{ .kind = .literal_integer, .quantifier = .required },
15084 .{ .kind = .id_ref, .quantifier = .required },
15085 .{ .kind = .id_ref, .quantifier = .required },
15086 .{ .kind = .id_ref, .quantifier = .required },
15087 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15088 .{ .kind = .id_ref, .quantifier = .optional },
15089 },
15090 },
15091 .{
15092 .name = "DebugFunctionDeclaration",
15093 .opcode = 19,
15094 .operands = &.{
15095 .{ .kind = .id_ref, .quantifier = .required },
15096 .{ .kind = .id_ref, .quantifier = .required },
15097 .{ .kind = .id_ref, .quantifier = .required },
15098 .{ .kind = .literal_integer, .quantifier = .required },
15099 .{ .kind = .literal_integer, .quantifier = .required },
15100 .{ .kind = .id_ref, .quantifier = .required },
15101 .{ .kind = .id_ref, .quantifier = .required },
15102 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15103 },
15104 },
15105 .{
15106 .name = "DebugFunction",
15107 .opcode = 20,
15108 .operands = &.{
15109 .{ .kind = .id_ref, .quantifier = .required },
15110 .{ .kind = .id_ref, .quantifier = .required },
15111 .{ .kind = .id_ref, .quantifier = .required },
15112 .{ .kind = .literal_integer, .quantifier = .required },
15113 .{ .kind = .literal_integer, .quantifier = .required },
15114 .{ .kind = .id_ref, .quantifier = .required },
15115 .{ .kind = .id_ref, .quantifier = .required },
15116 .{ .kind = .debug_info_debug_info_flags, .quantifier = .required },
15117 .{ .kind = .literal_integer, .quantifier = .required },
15118 .{ .kind = .id_ref, .quantifier = .required },
15119 .{ .kind = .id_ref, .quantifier = .optional },
15120 },
15121 },
15122 .{
15123 .name = "DebugLexicalBlock",
15124 .opcode = 21,
15125 .operands = &.{
15126 .{ .kind = .id_ref, .quantifier = .required },
15127 .{ .kind = .literal_integer, .quantifier = .required },
15128 .{ .kind = .literal_integer, .quantifier = .required },
15129 .{ .kind = .id_ref, .quantifier = .required },
15130 .{ .kind = .id_ref, .quantifier = .optional },
15131 },
15132 },
15133 .{
15134 .name = "DebugLexicalBlockDiscriminator",
15135 .opcode = 22,
15136 .operands = &.{
15137 .{ .kind = .id_ref, .quantifier = .required },
15138 .{ .kind = .literal_integer, .quantifier = .required },
15139 .{ .kind = .id_ref, .quantifier = .required },
15140 },
15141 },
15142 .{
15143 .name = "DebugScope",
15144 .opcode = 23,
15145 .operands = &.{
15146 .{ .kind = .id_ref, .quantifier = .required },
15147 .{ .kind = .id_ref, .quantifier = .optional },
15148 },
15149 },
15150 .{
15151 .name = "DebugNoScope",
15152 .opcode = 24,
15153 .operands = &.{},
15154 },
15155 .{
15156 .name = "DebugInlinedAt",
15157 .opcode = 25,
15158 .operands = &.{
15159 .{ .kind = .literal_integer, .quantifier = .required },
15160 .{ .kind = .id_ref, .quantifier = .required },
15161 .{ .kind = .id_ref, .quantifier = .optional },
15162 },
15163 },
15164 .{
15165 .name = "DebugLocalVariable",
15166 .opcode = 26,
15167 .operands = &.{
15168 .{ .kind = .id_ref, .quantifier = .required },
15169 .{ .kind = .id_ref, .quantifier = .required },
15170 .{ .kind = .id_ref, .quantifier = .required },
15171 .{ .kind = .literal_integer, .quantifier = .required },
15172 .{ .kind = .literal_integer, .quantifier = .required },
15173 .{ .kind = .id_ref, .quantifier = .required },
15174 .{ .kind = .literal_integer, .quantifier = .optional },
15175 },
15176 },
15177 .{
15178 .name = "DebugInlinedVariable",
15179 .opcode = 27,
15180 .operands = &.{
15181 .{ .kind = .id_ref, .quantifier = .required },
15182 .{ .kind = .id_ref, .quantifier = .required },
15183 },
15184 },
15185 .{
15186 .name = "DebugDeclare",
15187 .opcode = 28,
15188 .operands = &.{
15189 .{ .kind = .id_ref, .quantifier = .required },
15190 .{ .kind = .id_ref, .quantifier = .required },
15191 .{ .kind = .id_ref, .quantifier = .required },
15192 },
15193 },
15194 .{
15195 .name = "DebugValue",
15196 .opcode = 29,
15197 .operands = &.{
15198 .{ .kind = .id_ref, .quantifier = .required },
15199 .{ .kind = .id_ref, .quantifier = .required },
15200 .{ .kind = .id_ref, .quantifier = .variadic },
15201 },
15202 },
15203 .{
15204 .name = "DebugOperation",
15205 .opcode = 30,
15206 .operands = &.{
15207 .{ .kind = .debug_info_debug_operation, .quantifier = .required },
15208 .{ .kind = .literal_integer, .quantifier = .variadic },
15209 },
15210 },
15211 .{
15212 .name = "DebugExpression",
15213 .opcode = 31,
15214 .operands = &.{
15215 .{ .kind = .id_ref, .quantifier = .variadic },
15216 },
15217 },
15218 .{
15219 .name = "DebugMacroDef",
15220 .opcode = 32,
15221 .operands = &.{
15222 .{ .kind = .id_ref, .quantifier = .required },
15223 .{ .kind = .literal_integer, .quantifier = .required },
15224 .{ .kind = .id_ref, .quantifier = .required },
15225 .{ .kind = .id_ref, .quantifier = .optional },
15226 },
15227 },
15228 .{
15229 .name = "DebugMacroUndef",
15230 .opcode = 33,
15231 .operands = &.{
15232 .{ .kind = .id_ref, .quantifier = .required },
15233 .{ .kind = .literal_integer, .quantifier = .required },
15234 .{ .kind = .id_ref, .quantifier = .required },
15235 },
15236 },
15237 },
15238 .non_semantic_debug_break => &.{
15239 .{
15240 .name = "DebugBreak",
15241 .opcode = 1,
15242 .operands = &.{},
15243 },
15244 },
15245 .open_cl_debug_info_100 => &.{
15246 .{
15247 .name = "DebugInfoNone",
15248 .opcode = 0,
15249 .operands = &.{},
15250 },
15251 .{
15252 .name = "DebugCompilationUnit",
15253 .opcode = 1,
15254 .operands = &.{
15255 .{ .kind = .literal_integer, .quantifier = .required },
15256 .{ .kind = .literal_integer, .quantifier = .required },
15257 .{ .kind = .id_ref, .quantifier = .required },
15258 .{ .kind = .source_language, .quantifier = .required },
15259 },
15260 },
15261 .{
15262 .name = "DebugTypeBasic",
15263 .opcode = 2,
15264 .operands = &.{
15265 .{ .kind = .id_ref, .quantifier = .required },
15266 .{ .kind = .id_ref, .quantifier = .required },
15267 .{ .kind = .open_cl_debug_info_100_debug_base_type_attribute_encoding, .quantifier = .required },
15268 },
15269 },
15270 .{
15271 .name = "DebugTypePointer",
15272 .opcode = 3,
15273 .operands = &.{
15274 .{ .kind = .id_ref, .quantifier = .required },
15275 .{ .kind = .storage_class, .quantifier = .required },
15276 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15277 },
15278 },
15279 .{
15280 .name = "DebugTypeQualifier",
15281 .opcode = 4,
15282 .operands = &.{
15283 .{ .kind = .id_ref, .quantifier = .required },
15284 .{ .kind = .open_cl_debug_info_100_debug_type_qualifier, .quantifier = .required },
15285 },
15286 },
15287 .{
15288 .name = "DebugTypeArray",
15289 .opcode = 5,
15290 .operands = &.{
15291 .{ .kind = .id_ref, .quantifier = .required },
15292 .{ .kind = .id_ref, .quantifier = .variadic },
15293 },
15294 },
15295 .{
15296 .name = "DebugTypeVector",
15297 .opcode = 6,
15298 .operands = &.{
15299 .{ .kind = .id_ref, .quantifier = .required },
15300 .{ .kind = .literal_integer, .quantifier = .required },
15301 },
15302 },
15303 .{
15304 .name = "DebugTypedef",
15305 .opcode = 7,
15306 .operands = &.{
15307 .{ .kind = .id_ref, .quantifier = .required },
15308 .{ .kind = .id_ref, .quantifier = .required },
15309 .{ .kind = .id_ref, .quantifier = .required },
15310 .{ .kind = .literal_integer, .quantifier = .required },
15311 .{ .kind = .literal_integer, .quantifier = .required },
15312 .{ .kind = .id_ref, .quantifier = .required },
15313 },
15314 },
15315 .{
15316 .name = "DebugTypeFunction",
15317 .opcode = 8,
15318 .operands = &.{
15319 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15320 .{ .kind = .id_ref, .quantifier = .required },
15321 .{ .kind = .id_ref, .quantifier = .variadic },
15322 },
15323 },
15324 .{
15325 .name = "DebugTypeEnum",
15326 .opcode = 9,
15327 .operands = &.{
15328 .{ .kind = .id_ref, .quantifier = .required },
15329 .{ .kind = .id_ref, .quantifier = .required },
15330 .{ .kind = .id_ref, .quantifier = .required },
15331 .{ .kind = .literal_integer, .quantifier = .required },
15332 .{ .kind = .literal_integer, .quantifier = .required },
15333 .{ .kind = .id_ref, .quantifier = .required },
15334 .{ .kind = .id_ref, .quantifier = .required },
15335 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15336 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
15337 },
15338 },
15339 .{
15340 .name = "DebugTypeComposite",
15341 .opcode = 10,
15342 .operands = &.{
15343 .{ .kind = .id_ref, .quantifier = .required },
15344 .{ .kind = .open_cl_debug_info_100_debug_composite_type, .quantifier = .required },
15345 .{ .kind = .id_ref, .quantifier = .required },
15346 .{ .kind = .literal_integer, .quantifier = .required },
15347 .{ .kind = .literal_integer, .quantifier = .required },
15348 .{ .kind = .id_ref, .quantifier = .required },
15349 .{ .kind = .id_ref, .quantifier = .required },
15350 .{ .kind = .id_ref, .quantifier = .required },
15351 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15352 .{ .kind = .id_ref, .quantifier = .variadic },
15353 },
15354 },
15355 .{
15356 .name = "DebugTypeMember",
15357 .opcode = 11,
15358 .operands = &.{
15359 .{ .kind = .id_ref, .quantifier = .required },
15360 .{ .kind = .id_ref, .quantifier = .required },
15361 .{ .kind = .id_ref, .quantifier = .required },
15362 .{ .kind = .literal_integer, .quantifier = .required },
15363 .{ .kind = .literal_integer, .quantifier = .required },
15364 .{ .kind = .id_ref, .quantifier = .required },
15365 .{ .kind = .id_ref, .quantifier = .required },
15366 .{ .kind = .id_ref, .quantifier = .required },
15367 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15368 .{ .kind = .id_ref, .quantifier = .optional },
15369 },
15370 },
15371 .{
15372 .name = "DebugTypeInheritance",
15373 .opcode = 12,
15374 .operands = &.{
15375 .{ .kind = .id_ref, .quantifier = .required },
15376 .{ .kind = .id_ref, .quantifier = .required },
15377 .{ .kind = .id_ref, .quantifier = .required },
15378 .{ .kind = .id_ref, .quantifier = .required },
15379 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15380 },
15381 },
15382 .{
15383 .name = "DebugTypePtrToMember",
15384 .opcode = 13,
15385 .operands = &.{
15386 .{ .kind = .id_ref, .quantifier = .required },
15387 .{ .kind = .id_ref, .quantifier = .required },
15388 },
15389 },
15390 .{
15391 .name = "DebugTypeTemplate",
15392 .opcode = 14,
15393 .operands = &.{
15394 .{ .kind = .id_ref, .quantifier = .required },
15395 .{ .kind = .id_ref, .quantifier = .variadic },
15396 },
15397 },
15398 .{
15399 .name = "DebugTypeTemplateParameter",
15400 .opcode = 15,
15401 .operands = &.{
15402 .{ .kind = .id_ref, .quantifier = .required },
15403 .{ .kind = .id_ref, .quantifier = .required },
15404 .{ .kind = .id_ref, .quantifier = .required },
15405 .{ .kind = .id_ref, .quantifier = .required },
15406 .{ .kind = .literal_integer, .quantifier = .required },
15407 .{ .kind = .literal_integer, .quantifier = .required },
15408 },
15409 },
15410 .{
15411 .name = "DebugTypeTemplateTemplateParameter",
15412 .opcode = 16,
15413 .operands = &.{
15414 .{ .kind = .id_ref, .quantifier = .required },
15415 .{ .kind = .id_ref, .quantifier = .required },
15416 .{ .kind = .id_ref, .quantifier = .required },
15417 .{ .kind = .literal_integer, .quantifier = .required },
15418 .{ .kind = .literal_integer, .quantifier = .required },
15419 },
15420 },
15421 .{
15422 .name = "DebugTypeTemplateParameterPack",
15423 .opcode = 17,
15424 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .variadic },
15430 },
15431 },
15432 .{
15433 .name = "DebugGlobalVariable",
15434 .opcode = 18,
15435 .operands = &.{
15436 .{ .kind = .id_ref, .quantifier = .required },
15437 .{ .kind = .id_ref, .quantifier = .required },
15438 .{ .kind = .id_ref, .quantifier = .required },
15439 .{ .kind = .literal_integer, .quantifier = .required },
15440 .{ .kind = .literal_integer, .quantifier = .required },
15441 .{ .kind = .id_ref, .quantifier = .required },
15442 .{ .kind = .id_ref, .quantifier = .required },
15443 .{ .kind = .id_ref, .quantifier = .required },
15444 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15445 .{ .kind = .id_ref, .quantifier = .optional },
15446 },
15447 },
15448 .{
15449 .name = "DebugFunctionDeclaration",
15450 .opcode = 19,
15451 .operands = &.{
15452 .{ .kind = .id_ref, .quantifier = .required },
15453 .{ .kind = .id_ref, .quantifier = .required },
15454 .{ .kind = .id_ref, .quantifier = .required },
15455 .{ .kind = .literal_integer, .quantifier = .required },
15456 .{ .kind = .literal_integer, .quantifier = .required },
15457 .{ .kind = .id_ref, .quantifier = .required },
15458 .{ .kind = .id_ref, .quantifier = .required },
15459 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15460 },
15461 },
15462 .{
15463 .name = "DebugFunction",
15464 .opcode = 20,
15465 .operands = &.{
15466 .{ .kind = .id_ref, .quantifier = .required },
15467 .{ .kind = .id_ref, .quantifier = .required },
15468 .{ .kind = .id_ref, .quantifier = .required },
15469 .{ .kind = .literal_integer, .quantifier = .required },
15470 .{ .kind = .literal_integer, .quantifier = .required },
15471 .{ .kind = .id_ref, .quantifier = .required },
15472 .{ .kind = .id_ref, .quantifier = .required },
15473 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15474 .{ .kind = .literal_integer, .quantifier = .required },
15475 .{ .kind = .id_ref, .quantifier = .required },
15476 .{ .kind = .id_ref, .quantifier = .optional },
15477 },
15478 },
15479 .{
15480 .name = "DebugLexicalBlock",
15481 .opcode = 21,
15482 .operands = &.{
15483 .{ .kind = .id_ref, .quantifier = .required },
15484 .{ .kind = .literal_integer, .quantifier = .required },
15485 .{ .kind = .literal_integer, .quantifier = .required },
15486 .{ .kind = .id_ref, .quantifier = .required },
15487 .{ .kind = .id_ref, .quantifier = .optional },
15488 },
15489 },
15490 .{
15491 .name = "DebugLexicalBlockDiscriminator",
15492 .opcode = 22,
15493 .operands = &.{
15494 .{ .kind = .id_ref, .quantifier = .required },
15495 .{ .kind = .literal_integer, .quantifier = .required },
15496 .{ .kind = .id_ref, .quantifier = .required },
15497 },
15498 },
15499 .{
15500 .name = "DebugScope",
15501 .opcode = 23,
15502 .operands = &.{
15503 .{ .kind = .id_ref, .quantifier = .required },
15504 .{ .kind = .id_ref, .quantifier = .optional },
15505 },
15506 },
15507 .{
15508 .name = "DebugNoScope",
15509 .opcode = 24,
15510 .operands = &.{},
15511 },
15512 .{
15513 .name = "DebugInlinedAt",
15514 .opcode = 25,
15515 .operands = &.{
15516 .{ .kind = .literal_integer, .quantifier = .required },
15517 .{ .kind = .id_ref, .quantifier = .required },
15518 .{ .kind = .id_ref, .quantifier = .optional },
15519 },
15520 },
15521 .{
15522 .name = "DebugLocalVariable",
15523 .opcode = 26,
15524 .operands = &.{
15525 .{ .kind = .id_ref, .quantifier = .required },
15526 .{ .kind = .id_ref, .quantifier = .required },
15527 .{ .kind = .id_ref, .quantifier = .required },
15528 .{ .kind = .literal_integer, .quantifier = .required },
15529 .{ .kind = .literal_integer, .quantifier = .required },
15530 .{ .kind = .id_ref, .quantifier = .required },
15531 .{ .kind = .open_cl_debug_info_100_debug_info_flags, .quantifier = .required },
15532 .{ .kind = .literal_integer, .quantifier = .optional },
15533 },
15534 },
15535 .{
15536 .name = "DebugInlinedVariable",
15537 .opcode = 27,
15538 .operands = &.{
15539 .{ .kind = .id_ref, .quantifier = .required },
15540 .{ .kind = .id_ref, .quantifier = .required },
15541 },
15542 },
15543 .{
15544 .name = "DebugDeclare",
15545 .opcode = 28,
15546 .operands = &.{
15547 .{ .kind = .id_ref, .quantifier = .required },
15548 .{ .kind = .id_ref, .quantifier = .required },
15549 .{ .kind = .id_ref, .quantifier = .required },
15550 },
15551 },
15552 .{
15553 .name = "DebugValue",
15554 .opcode = 29,
15555 .operands = &.{
15556 .{ .kind = .id_ref, .quantifier = .required },
15557 .{ .kind = .id_ref, .quantifier = .required },
15558 .{ .kind = .id_ref, .quantifier = .required },
15559 .{ .kind = .id_ref, .quantifier = .variadic },
15560 },
15561 },
15562 .{
15563 .name = "DebugOperation",
15564 .opcode = 30,
15565 .operands = &.{
15566 .{ .kind = .open_cl_debug_info_100_debug_operation, .quantifier = .required },
15567 .{ .kind = .literal_integer, .quantifier = .variadic },
15568 },
15569 },
15570 .{
15571 .name = "DebugExpression",
15572 .opcode = 31,
15573 .operands = &.{
15574 .{ .kind = .id_ref, .quantifier = .variadic },
15575 },
15576 },
15577 .{
15578 .name = "DebugMacroDef",
15579 .opcode = 32,
15580 .operands = &.{
15581 .{ .kind = .id_ref, .quantifier = .required },
15582 .{ .kind = .literal_integer, .quantifier = .required },
15583 .{ .kind = .id_ref, .quantifier = .required },
15584 .{ .kind = .id_ref, .quantifier = .optional },
15585 },
15586 },
15587 .{
15588 .name = "DebugMacroUndef",
15589 .opcode = 33,
15590 .operands = &.{
15591 .{ .kind = .id_ref, .quantifier = .required },
15592 .{ .kind = .literal_integer, .quantifier = .required },
15593 .{ .kind = .id_ref, .quantifier = .required },
15594 },
15595 },
15596 .{
15597 .name = "DebugImportedEntity",
15598 .opcode = 34,
15599 .operands = &.{
15600 .{ .kind = .id_ref, .quantifier = .required },
15601 .{ .kind = .open_cl_debug_info_100_debug_imported_entity, .quantifier = .required },
15602 .{ .kind = .id_ref, .quantifier = .required },
15603 .{ .kind = .id_ref, .quantifier = .required },
15604 .{ .kind = .literal_integer, .quantifier = .required },
15605 .{ .kind = .literal_integer, .quantifier = .required },
15606 .{ .kind = .id_ref, .quantifier = .required },
15607 },
15608 },
15609 .{
15610 .name = "DebugSource",
15611 .opcode = 35,
15612 .operands = &.{
15613 .{ .kind = .id_ref, .quantifier = .required },
15614 .{ .kind = .id_ref, .quantifier = .optional },
15615 },
15616 },
15617 .{
15618 .name = "DebugModuleINTEL",
15619 .opcode = 36,
15620 .operands = &.{
15621 .{ .kind = .id_ref, .quantifier = .required },
15622 .{ .kind = .id_ref, .quantifier = .required },
15623 .{ .kind = .id_ref, .quantifier = .required },
15624 .{ .kind = .literal_integer, .quantifier = .required },
15625 .{ .kind = .id_ref, .quantifier = .required },
15626 .{ .kind = .id_ref, .quantifier = .required },
15627 .{ .kind = .id_ref, .quantifier = .required },
15628 .{ .kind = .literal_integer, .quantifier = .required },
15629 },
15630 },
15631 },
15632 .non_semantic_clspv_reflection_6 => &.{
15633 .{
15634 .name = "Kernel",
15635 .opcode = 1,
15636 .operands = &.{
15637 .{ .kind = .id_ref, .quantifier = .required },
15638 .{ .kind = .id_ref, .quantifier = .required },
15639 .{ .kind = .id_ref, .quantifier = .optional },
15640 .{ .kind = .id_ref, .quantifier = .optional },
15641 .{ .kind = .id_ref, .quantifier = .optional },
15642 },
15643 },
15644 .{
15645 .name = "ArgumentInfo",
15646 .opcode = 2,
15647 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .optional },
15653 },
15654 },
15655 .{
15656 .name = "ArgumentStorageBuffer",
15657 .opcode = 3,
15658 .operands = &.{
15659 .{ .kind = .id_ref, .quantifier = .required },
15660 .{ .kind = .id_ref, .quantifier = .required },
15661 .{ .kind = .id_ref, .quantifier = .required },
15662 .{ .kind = .id_ref, .quantifier = .required },
15663 .{ .kind = .id_ref, .quantifier = .optional },
15664 },
15665 },
15666 .{
15667 .name = "ArgumentUniform",
15668 .opcode = 4,
15669 .operands = &.{
15670 .{ .kind = .id_ref, .quantifier = .required },
15671 .{ .kind = .id_ref, .quantifier = .required },
15672 .{ .kind = .id_ref, .quantifier = .required },
15673 .{ .kind = .id_ref, .quantifier = .required },
15674 .{ .kind = .id_ref, .quantifier = .optional },
15675 },
15676 },
15677 .{
15678 .name = "ArgumentPodStorageBuffer",
15679 .opcode = 5,
15680 .operands = &.{
15681 .{ .kind = .id_ref, .quantifier = .required },
15682 .{ .kind = .id_ref, .quantifier = .required },
15683 .{ .kind = .id_ref, .quantifier = .required },
15684 .{ .kind = .id_ref, .quantifier = .required },
15685 .{ .kind = .id_ref, .quantifier = .required },
15686 .{ .kind = .id_ref, .quantifier = .required },
15687 .{ .kind = .id_ref, .quantifier = .optional },
15688 },
15689 },
15690 .{
15691 .name = "ArgumentPodUniform",
15692 .opcode = 6,
15693 .operands = &.{
15694 .{ .kind = .id_ref, .quantifier = .required },
15695 .{ .kind = .id_ref, .quantifier = .required },
15696 .{ .kind = .id_ref, .quantifier = .required },
15697 .{ .kind = .id_ref, .quantifier = .required },
15698 .{ .kind = .id_ref, .quantifier = .required },
15699 .{ .kind = .id_ref, .quantifier = .required },
15700 .{ .kind = .id_ref, .quantifier = .optional },
15701 },
15702 },
15703 .{
15704 .name = "ArgumentPodPushConstant",
15705 .opcode = 7,
15706 .operands = &.{
15707 .{ .kind = .id_ref, .quantifier = .required },
15708 .{ .kind = .id_ref, .quantifier = .required },
15709 .{ .kind = .id_ref, .quantifier = .required },
15710 .{ .kind = .id_ref, .quantifier = .required },
15711 .{ .kind = .id_ref, .quantifier = .optional },
15712 },
15713 },
15714 .{
15715 .name = "ArgumentSampledImage",
15716 .opcode = 8,
15717 .operands = &.{
15718 .{ .kind = .id_ref, .quantifier = .required },
15719 .{ .kind = .id_ref, .quantifier = .required },
15720 .{ .kind = .id_ref, .quantifier = .required },
15721 .{ .kind = .id_ref, .quantifier = .required },
15722 .{ .kind = .id_ref, .quantifier = .optional },
15723 },
15724 },
15725 .{
15726 .name = "ArgumentStorageImage",
15727 .opcode = 9,
15728 .operands = &.{
15729 .{ .kind = .id_ref, .quantifier = .required },
15730 .{ .kind = .id_ref, .quantifier = .required },
15731 .{ .kind = .id_ref, .quantifier = .required },
15732 .{ .kind = .id_ref, .quantifier = .required },
15733 .{ .kind = .id_ref, .quantifier = .optional },
15734 },
15735 },
15736 .{
15737 .name = "ArgumentSampler",
15738 .opcode = 10,
15739 .operands = &.{
15740 .{ .kind = .id_ref, .quantifier = .required },
15741 .{ .kind = .id_ref, .quantifier = .required },
15742 .{ .kind = .id_ref, .quantifier = .required },
15743 .{ .kind = .id_ref, .quantifier = .required },
15744 .{ .kind = .id_ref, .quantifier = .optional },
15745 },
15746 },
15747 .{
15748 .name = "ArgumentWorkgroup",
15749 .opcode = 11,
15750 .operands = &.{
15751 .{ .kind = .id_ref, .quantifier = .required },
15752 .{ .kind = .id_ref, .quantifier = .required },
15753 .{ .kind = .id_ref, .quantifier = .required },
15754 .{ .kind = .id_ref, .quantifier = .required },
15755 .{ .kind = .id_ref, .quantifier = .optional },
15756 },
15757 },
15758 .{
15759 .name = "SpecConstantWorkgroupSize",
15760 .opcode = 12,
15761 .operands = &.{
15762 .{ .kind = .id_ref, .quantifier = .required },
15763 .{ .kind = .id_ref, .quantifier = .required },
15764 .{ .kind = .id_ref, .quantifier = .required },
15765 },
15766 },
15767 .{
15768 .name = "SpecConstantGlobalOffset",
15769 .opcode = 13,
15770 .operands = &.{
15771 .{ .kind = .id_ref, .quantifier = .required },
15772 .{ .kind = .id_ref, .quantifier = .required },
15773 .{ .kind = .id_ref, .quantifier = .required },
15774 },
15775 },
15776 .{
15777 .name = "SpecConstantWorkDim",
15778 .opcode = 14,
15779 .operands = &.{
15780 .{ .kind = .id_ref, .quantifier = .required },
15781 },
15782 },
15783 .{
15784 .name = "PushConstantGlobalOffset",
15785 .opcode = 15,
15786 .operands = &.{
15787 .{ .kind = .id_ref, .quantifier = .required },
15788 .{ .kind = .id_ref, .quantifier = .required },
15789 },
15790 },
15791 .{
15792 .name = "PushConstantEnqueuedLocalSize",
15793 .opcode = 16,
15794 .operands = &.{
15795 .{ .kind = .id_ref, .quantifier = .required },
15796 .{ .kind = .id_ref, .quantifier = .required },
15797 },
15798 },
15799 .{
15800 .name = "PushConstantGlobalSize",
15801 .opcode = 17,
15802 .operands = &.{
15803 .{ .kind = .id_ref, .quantifier = .required },
15804 .{ .kind = .id_ref, .quantifier = .required },
15805 },
15806 },
15807 .{
15808 .name = "PushConstantRegionOffset",
15809 .opcode = 18,
15810 .operands = &.{
15811 .{ .kind = .id_ref, .quantifier = .required },
15812 .{ .kind = .id_ref, .quantifier = .required },
15813 },
15814 },
15815 .{
15816 .name = "PushConstantNumWorkgroups",
15817 .opcode = 19,
15818 .operands = &.{
15819 .{ .kind = .id_ref, .quantifier = .required },
15820 .{ .kind = .id_ref, .quantifier = .required },
15821 },
15822 },
15823 .{
15824 .name = "PushConstantRegionGroupOffset",
15825 .opcode = 20,
15826 .operands = &.{
15827 .{ .kind = .id_ref, .quantifier = .required },
15828 .{ .kind = .id_ref, .quantifier = .required },
15829 },
15830 },
15831 .{
15832 .name = "ConstantDataStorageBuffer",
15833 .opcode = 21,
15834 .operands = &.{
15835 .{ .kind = .id_ref, .quantifier = .required },
15836 .{ .kind = .id_ref, .quantifier = .required },
15837 .{ .kind = .id_ref, .quantifier = .required },
15838 },
15839 },
15840 .{
15841 .name = "ConstantDataUniform",
15842 .opcode = 22,
15843 .operands = &.{
15844 .{ .kind = .id_ref, .quantifier = .required },
15845 .{ .kind = .id_ref, .quantifier = .required },
15846 .{ .kind = .id_ref, .quantifier = .required },
15847 },
15848 },
15849 .{
15850 .name = "LiteralSampler",
15851 .opcode = 23,
15852 .operands = &.{
15853 .{ .kind = .id_ref, .quantifier = .required },
15854 .{ .kind = .id_ref, .quantifier = .required },
15855 .{ .kind = .id_ref, .quantifier = .required },
15856 },
15857 },
15858 .{
15859 .name = "PropertyRequiredWorkgroupSize",
15860 .opcode = 24,
15861 .operands = &.{
15862 .{ .kind = .id_ref, .quantifier = .required },
15863 .{ .kind = .id_ref, .quantifier = .required },
15864 .{ .kind = .id_ref, .quantifier = .required },
15865 .{ .kind = .id_ref, .quantifier = .required },
15866 },
15867 },
15868 .{
15869 .name = "SpecConstantSubgroupMaxSize",
15870 .opcode = 25,
15871 .operands = &.{
15872 .{ .kind = .id_ref, .quantifier = .required },
15873 },
15874 },
15875 .{
15876 .name = "ArgumentPointerPushConstant",
15877 .opcode = 26,
15878 .operands = &.{
15879 .{ .kind = .id_ref, .quantifier = .required },
15880 .{ .kind = .id_ref, .quantifier = .required },
15881 .{ .kind = .id_ref, .quantifier = .required },
15882 .{ .kind = .id_ref, .quantifier = .required },
15883 .{ .kind = .id_ref, .quantifier = .optional },
15884 },
15885 },
15886 .{
15887 .name = "ArgumentPointerUniform",
15888 .opcode = 27,
15889 .operands = &.{
15890 .{ .kind = .id_ref, .quantifier = .required },
15891 .{ .kind = .id_ref, .quantifier = .required },
15892 .{ .kind = .id_ref, .quantifier = .required },
15893 .{ .kind = .id_ref, .quantifier = .required },
15894 .{ .kind = .id_ref, .quantifier = .required },
15895 .{ .kind = .id_ref, .quantifier = .required },
15896 .{ .kind = .id_ref, .quantifier = .optional },
15897 },
15898 },
15899 .{
15900 .name = "ProgramScopeVariablesStorageBuffer",
15901 .opcode = 28,
15902 .operands = &.{
15903 .{ .kind = .id_ref, .quantifier = .required },
15904 .{ .kind = .id_ref, .quantifier = .required },
15905 .{ .kind = .id_ref, .quantifier = .required },
15906 },
15907 },
15908 .{
15909 .name = "ProgramScopeVariablePointerRelocation",
15910 .opcode = 29,
15911 .operands = &.{
15912 .{ .kind = .id_ref, .quantifier = .required },
15913 .{ .kind = .id_ref, .quantifier = .required },
15914 .{ .kind = .id_ref, .quantifier = .required },
15915 },
15916 },
15917 .{
15918 .name = "ImageArgumentInfoChannelOrderPushConstant",
15919 .opcode = 30,
15920 .operands = &.{
15921 .{ .kind = .id_ref, .quantifier = .required },
15922 .{ .kind = .id_ref, .quantifier = .required },
15923 .{ .kind = .id_ref, .quantifier = .required },
15924 .{ .kind = .id_ref, .quantifier = .required },
15925 },
15926 },
15927 .{
15928 .name = "ImageArgumentInfoChannelDataTypePushConstant",
15929 .opcode = 31,
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 = "ImageArgumentInfoChannelOrderUniform",
15939 .opcode = 32,
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 .{ .kind = .id_ref, .quantifier = .required },
15946 .{ .kind = .id_ref, .quantifier = .required },
15947 },
15948 },
15949 .{
15950 .name = "ImageArgumentInfoChannelDataTypeUniform",
15951 .opcode = 33,
15952 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
15958 .{ .kind = .id_ref, .quantifier = .required },
15959 },
15960 },
15961 .{
15962 .name = "ArgumentStorageTexelBuffer",
15963 .opcode = 34,
15964 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .optional },
15970 },
15971 },
15972 .{
15973 .name = "ArgumentUniformTexelBuffer",
15974 .opcode = 35,
15975 .operands = &.{
15976 .{ .kind = .id_ref, .quantifier = .required },
15977 .{ .kind = .id_ref, .quantifier = .required },
15978 .{ .kind = .id_ref, .quantifier = .required },
15979 .{ .kind = .id_ref, .quantifier = .required },
15980 .{ .kind = .id_ref, .quantifier = .optional },
15981 },
15982 },
15983 .{
15984 .name = "ConstantDataPointerPushConstant",
15985 .opcode = 36,
15986 .operands = &.{
15987 .{ .kind = .id_ref, .quantifier = .required },
15988 .{ .kind = .id_ref, .quantifier = .required },
15989 .{ .kind = .id_ref, .quantifier = .required },
15990 },
15991 },
15992 .{
15993 .name = "ProgramScopeVariablePointerPushConstant",
15994 .opcode = 37,
15995 .operands = &.{
15996 .{ .kind = .id_ref, .quantifier = .required },
15997 .{ .kind = .id_ref, .quantifier = .required },
15998 .{ .kind = .id_ref, .quantifier = .required },
15999 },
16000 },
16001 .{
16002 .name = "PrintfInfo",
16003 .opcode = 38,
16004 .operands = &.{
16005 .{ .kind = .id_ref, .quantifier = .required },
16006 .{ .kind = .id_ref, .quantifier = .required },
16007 .{ .kind = .id_ref, .quantifier = .variadic },
16008 },
16009 },
16010 .{
16011 .name = "PrintfBufferStorageBuffer",
16012 .opcode = 39,
16013 .operands = &.{
16014 .{ .kind = .id_ref, .quantifier = .required },
16015 .{ .kind = .id_ref, .quantifier = .required },
16016 .{ .kind = .id_ref, .quantifier = .required },
16017 },
16018 },
16019 .{
16020 .name = "PrintfBufferPointerPushConstant",
16021 .opcode = 40,
16022 .operands = &.{
16023 .{ .kind = .id_ref, .quantifier = .required },
16024 .{ .kind = .id_ref, .quantifier = .required },
16025 .{ .kind = .id_ref, .quantifier = .required },
16026 },
16027 },
16028 .{
16029 .name = "NormalizedSamplerMaskPushConstant",
16030 .opcode = 41,
16031 .operands = &.{
16032 .{ .kind = .id_ref, .quantifier = .required },
16033 .{ .kind = .id_ref, .quantifier = .required },
16034 .{ .kind = .id_ref, .quantifier = .required },
16035 .{ .kind = .id_ref, .quantifier = .required },
16036 },
16037 },
16038 .{
16039 .name = "WorkgroupVariableSize",
16040 .opcode = 42,
16041 .operands = &.{
16042 .{ .kind = .id_ref, .quantifier = .required },
16043 .{ .kind = .id_ref, .quantifier = .required },
16044 },
16045 },
16046 },
16047 .glsl_std_450 => &.{
16048 .{
16049 .name = "Round",
16050 .opcode = 1,
16051 .operands = &.{
16052 .{ .kind = .id_ref, .quantifier = .required },
16053 },
16054 },
16055 .{
16056 .name = "RoundEven",
16057 .opcode = 2,
16058 .operands = &.{
16059 .{ .kind = .id_ref, .quantifier = .required },
16060 },
16061 },
16062 .{
16063 .name = "Trunc",
16064 .opcode = 3,
16065 .operands = &.{
16066 .{ .kind = .id_ref, .quantifier = .required },
16067 },
16068 },
16069 .{
16070 .name = "FAbs",
16071 .opcode = 4,
16072 .operands = &.{
16073 .{ .kind = .id_ref, .quantifier = .required },
16074 },
16075 },
16076 .{
16077 .name = "SAbs",
16078 .opcode = 5,
16079 .operands = &.{
16080 .{ .kind = .id_ref, .quantifier = .required },
16081 },
16082 },
16083 .{
16084 .name = "FSign",
16085 .opcode = 6,
16086 .operands = &.{
16087 .{ .kind = .id_ref, .quantifier = .required },
16088 },
16089 },
16090 .{
16091 .name = "SSign",
16092 .opcode = 7,
16093 .operands = &.{
16094 .{ .kind = .id_ref, .quantifier = .required },
16095 },
16096 },
16097 .{
16098 .name = "Floor",
16099 .opcode = 8,
16100 .operands = &.{
16101 .{ .kind = .id_ref, .quantifier = .required },
16102 },
16103 },
16104 .{
16105 .name = "Ceil",
16106 .opcode = 9,
16107 .operands = &.{
16108 .{ .kind = .id_ref, .quantifier = .required },
16109 },
16110 },
16111 .{
16112 .name = "Fract",
16113 .opcode = 10,
16114 .operands = &.{
16115 .{ .kind = .id_ref, .quantifier = .required },
16116 },
16117 },
16118 .{
16119 .name = "Radians",
16120 .opcode = 11,
16121 .operands = &.{
16122 .{ .kind = .id_ref, .quantifier = .required },
16123 },
16124 },
16125 .{
16126 .name = "Degrees",
16127 .opcode = 12,
16128 .operands = &.{
16129 .{ .kind = .id_ref, .quantifier = .required },
16130 },
16131 },
16132 .{
16133 .name = "Sin",
16134 .opcode = 13,
16135 .operands = &.{
16136 .{ .kind = .id_ref, .quantifier = .required },
16137 },
16138 },
16139 .{
16140 .name = "Cos",
16141 .opcode = 14,
16142 .operands = &.{
16143 .{ .kind = .id_ref, .quantifier = .required },
16144 },
16145 },
16146 .{
16147 .name = "Tan",
16148 .opcode = 15,
16149 .operands = &.{
16150 .{ .kind = .id_ref, .quantifier = .required },
16151 },
16152 },
16153 .{
16154 .name = "Asin",
16155 .opcode = 16,
16156 .operands = &.{
16157 .{ .kind = .id_ref, .quantifier = .required },
16158 },
16159 },
16160 .{
16161 .name = "Acos",
16162 .opcode = 17,
16163 .operands = &.{
16164 .{ .kind = .id_ref, .quantifier = .required },
16165 },
16166 },
16167 .{
16168 .name = "Atan",
16169 .opcode = 18,
16170 .operands = &.{
16171 .{ .kind = .id_ref, .quantifier = .required },
16172 },
16173 },
16174 .{
16175 .name = "Sinh",
16176 .opcode = 19,
16177 .operands = &.{
16178 .{ .kind = .id_ref, .quantifier = .required },
16179 },
16180 },
16181 .{
16182 .name = "Cosh",
16183 .opcode = 20,
16184 .operands = &.{
16185 .{ .kind = .id_ref, .quantifier = .required },
16186 },
16187 },
16188 .{
16189 .name = "Tanh",
16190 .opcode = 21,
16191 .operands = &.{
16192 .{ .kind = .id_ref, .quantifier = .required },
16193 },
16194 },
16195 .{
16196 .name = "Asinh",
16197 .opcode = 22,
16198 .operands = &.{
16199 .{ .kind = .id_ref, .quantifier = .required },
16200 },
16201 },
16202 .{
16203 .name = "Acosh",
16204 .opcode = 23,
16205 .operands = &.{
16206 .{ .kind = .id_ref, .quantifier = .required },
16207 },
16208 },
16209 .{
16210 .name = "Atanh",
16211 .opcode = 24,
16212 .operands = &.{
16213 .{ .kind = .id_ref, .quantifier = .required },
16214 },
16215 },
16216 .{
16217 .name = "Atan2",
16218 .opcode = 25,
16219 .operands = &.{
16220 .{ .kind = .id_ref, .quantifier = .required },
16221 .{ .kind = .id_ref, .quantifier = .required },
16222 },
16223 },
16224 .{
16225 .name = "Pow",
16226 .opcode = 26,
16227 .operands = &.{
16228 .{ .kind = .id_ref, .quantifier = .required },
16229 .{ .kind = .id_ref, .quantifier = .required },
16230 },
16231 },
16232 .{
16233 .name = "Exp",
16234 .opcode = 27,
16235 .operands = &.{
16236 .{ .kind = .id_ref, .quantifier = .required },
16237 },
16238 },
16239 .{
16240 .name = "Log",
16241 .opcode = 28,
16242 .operands = &.{
16243 .{ .kind = .id_ref, .quantifier = .required },
16244 },
16245 },
16246 .{
16247 .name = "Exp2",
16248 .opcode = 29,
16249 .operands = &.{
16250 .{ .kind = .id_ref, .quantifier = .required },
16251 },
16252 },
16253 .{
16254 .name = "Log2",
16255 .opcode = 30,
16256 .operands = &.{
16257 .{ .kind = .id_ref, .quantifier = .required },
16258 },
16259 },
16260 .{
16261 .name = "Sqrt",
16262 .opcode = 31,
16263 .operands = &.{
16264 .{ .kind = .id_ref, .quantifier = .required },
16265 },
16266 },
16267 .{
16268 .name = "InverseSqrt",
16269 .opcode = 32,
16270 .operands = &.{
16271 .{ .kind = .id_ref, .quantifier = .required },
16272 },
16273 },
16274 .{
16275 .name = "Determinant",
16276 .opcode = 33,
16277 .operands = &.{
16278 .{ .kind = .id_ref, .quantifier = .required },
16279 },
16280 },
16281 .{
16282 .name = "MatrixInverse",
16283 .opcode = 34,
16284 .operands = &.{
16285 .{ .kind = .id_ref, .quantifier = .required },
16286 },
16287 },
16288 .{
16289 .name = "Modf",
16290 .opcode = 35,
16291 .operands = &.{
16292 .{ .kind = .id_ref, .quantifier = .required },
16293 .{ .kind = .id_ref, .quantifier = .required },
16294 },
16295 },
16296 .{
16297 .name = "ModfStruct",
16298 .opcode = 36,
16299 .operands = &.{
16300 .{ .kind = .id_ref, .quantifier = .required },
16301 },
16302 },
16303 .{
16304 .name = "FMin",
16305 .opcode = 37,
16306 .operands = &.{
16307 .{ .kind = .id_ref, .quantifier = .required },
16308 .{ .kind = .id_ref, .quantifier = .required },
16309 },
16310 },
16311 .{
16312 .name = "UMin",
16313 .opcode = 38,
16314 .operands = &.{
16315 .{ .kind = .id_ref, .quantifier = .required },
16316 .{ .kind = .id_ref, .quantifier = .required },
16317 },
16318 },
16319 .{
16320 .name = "SMin",
16321 .opcode = 39,
16322 .operands = &.{
16323 .{ .kind = .id_ref, .quantifier = .required },
16324 .{ .kind = .id_ref, .quantifier = .required },
16325 },
16326 },
16327 .{
16328 .name = "FMax",
16329 .opcode = 40,
16330 .operands = &.{
16331 .{ .kind = .id_ref, .quantifier = .required },
16332 .{ .kind = .id_ref, .quantifier = .required },
16333 },
16334 },
16335 .{
16336 .name = "UMax",
16337 .opcode = 41,
16338 .operands = &.{
16339 .{ .kind = .id_ref, .quantifier = .required },
16340 .{ .kind = .id_ref, .quantifier = .required },
16341 },
16342 },
16343 .{
16344 .name = "SMax",
16345 .opcode = 42,
16346 .operands = &.{
16347 .{ .kind = .id_ref, .quantifier = .required },
16348 .{ .kind = .id_ref, .quantifier = .required },
16349 },
16350 },
16351 .{
16352 .name = "FClamp",
16353 .opcode = 43,
16354 .operands = &.{
16355 .{ .kind = .id_ref, .quantifier = .required },
16356 .{ .kind = .id_ref, .quantifier = .required },
16357 .{ .kind = .id_ref, .quantifier = .required },
16358 },
16359 },
16360 .{
16361 .name = "UClamp",
16362 .opcode = 44,
16363 .operands = &.{
16364 .{ .kind = .id_ref, .quantifier = .required },
16365 .{ .kind = .id_ref, .quantifier = .required },
16366 .{ .kind = .id_ref, .quantifier = .required },
16367 },
16368 },
16369 .{
16370 .name = "SClamp",
16371 .opcode = 45,
16372 .operands = &.{
16373 .{ .kind = .id_ref, .quantifier = .required },
16374 .{ .kind = .id_ref, .quantifier = .required },
16375 .{ .kind = .id_ref, .quantifier = .required },
16376 },
16377 },
16378 .{
16379 .name = "FMix",
16380 .opcode = 46,
16381 .operands = &.{
16382 .{ .kind = .id_ref, .quantifier = .required },
16383 .{ .kind = .id_ref, .quantifier = .required },
16384 .{ .kind = .id_ref, .quantifier = .required },
16385 },
16386 },
16387 .{
16388 .name = "IMix",
16389 .opcode = 47,
16390 .operands = &.{
16391 .{ .kind = .id_ref, .quantifier = .required },
16392 .{ .kind = .id_ref, .quantifier = .required },
16393 .{ .kind = .id_ref, .quantifier = .required },
16394 },
16395 },
16396 .{
16397 .name = "Step",
16398 .opcode = 48,
16399 .operands = &.{
16400 .{ .kind = .id_ref, .quantifier = .required },
16401 .{ .kind = .id_ref, .quantifier = .required },
16402 },
16403 },
16404 .{
16405 .name = "SmoothStep",
16406 .opcode = 49,
16407 .operands = &.{
16408 .{ .kind = .id_ref, .quantifier = .required },
16409 .{ .kind = .id_ref, .quantifier = .required },
16410 .{ .kind = .id_ref, .quantifier = .required },
16411 },
16412 },
16413 .{
16414 .name = "Fma",
16415 .opcode = 50,
16416 .operands = &.{
16417 .{ .kind = .id_ref, .quantifier = .required },
16418 .{ .kind = .id_ref, .quantifier = .required },
16419 .{ .kind = .id_ref, .quantifier = .required },
16420 },
16421 },
16422 .{
16423 .name = "Frexp",
16424 .opcode = 51,
16425 .operands = &.{
16426 .{ .kind = .id_ref, .quantifier = .required },
16427 .{ .kind = .id_ref, .quantifier = .required },
16428 },
16429 },
16430 .{
16431 .name = "FrexpStruct",
16432 .opcode = 52,
16433 .operands = &.{
16434 .{ .kind = .id_ref, .quantifier = .required },
16435 },
16436 },
16437 .{
16438 .name = "Ldexp",
16439 .opcode = 53,
16440 .operands = &.{
16441 .{ .kind = .id_ref, .quantifier = .required },
16442 .{ .kind = .id_ref, .quantifier = .required },
16443 },
16444 },
16445 .{
16446 .name = "PackSnorm4x8",
16447 .opcode = 54,
16448 .operands = &.{
16449 .{ .kind = .id_ref, .quantifier = .required },
16450 },
16451 },
16452 .{
16453 .name = "PackUnorm4x8",
16454 .opcode = 55,
16455 .operands = &.{
16456 .{ .kind = .id_ref, .quantifier = .required },
16457 },
16458 },
16459 .{
16460 .name = "PackSnorm2x16",
16461 .opcode = 56,
16462 .operands = &.{
16463 .{ .kind = .id_ref, .quantifier = .required },
16464 },
16465 },
16466 .{
16467 .name = "PackUnorm2x16",
16468 .opcode = 57,
16469 .operands = &.{
16470 .{ .kind = .id_ref, .quantifier = .required },
16471 },
16472 },
16473 .{
16474 .name = "PackHalf2x16",
16475 .opcode = 58,
16476 .operands = &.{
16477 .{ .kind = .id_ref, .quantifier = .required },
16478 },
16479 },
16480 .{
16481 .name = "PackDouble2x32",
16482 .opcode = 59,
16483 .operands = &.{
16484 .{ .kind = .id_ref, .quantifier = .required },
16485 },
16486 },
16487 .{
16488 .name = "UnpackSnorm2x16",
16489 .opcode = 60,
16490 .operands = &.{
16491 .{ .kind = .id_ref, .quantifier = .required },
16492 },
16493 },
16494 .{
16495 .name = "UnpackUnorm2x16",
16496 .opcode = 61,
16497 .operands = &.{
16498 .{ .kind = .id_ref, .quantifier = .required },
16499 },
16500 },
16501 .{
16502 .name = "UnpackHalf2x16",
16503 .opcode = 62,
16504 .operands = &.{
16505 .{ .kind = .id_ref, .quantifier = .required },
16506 },
16507 },
16508 .{
16509 .name = "UnpackSnorm4x8",
16510 .opcode = 63,
16511 .operands = &.{
16512 .{ .kind = .id_ref, .quantifier = .required },
16513 },
16514 },
16515 .{
16516 .name = "UnpackUnorm4x8",
16517 .opcode = 64,
16518 .operands = &.{
16519 .{ .kind = .id_ref, .quantifier = .required },
16520 },
16521 },
16522 .{
16523 .name = "UnpackDouble2x32",
16524 .opcode = 65,
16525 .operands = &.{
16526 .{ .kind = .id_ref, .quantifier = .required },
16527 },
16528 },
16529 .{
16530 .name = "Length",
16531 .opcode = 66,
16532 .operands = &.{
16533 .{ .kind = .id_ref, .quantifier = .required },
16534 },
16535 },
16536 .{
16537 .name = "Distance",
16538 .opcode = 67,
16539 .operands = &.{
16540 .{ .kind = .id_ref, .quantifier = .required },
16541 .{ .kind = .id_ref, .quantifier = .required },
16542 },
16543 },
16544 .{
16545 .name = "Cross",
16546 .opcode = 68,
16547 .operands = &.{
16548 .{ .kind = .id_ref, .quantifier = .required },
16549 .{ .kind = .id_ref, .quantifier = .required },
16550 },
16551 },
16552 .{
16553 .name = "Normalize",
16554 .opcode = 69,
16555 .operands = &.{
16556 .{ .kind = .id_ref, .quantifier = .required },
16557 },
16558 },
16559 .{
16560 .name = "FaceForward",
16561 .opcode = 70,
16562 .operands = &.{
16563 .{ .kind = .id_ref, .quantifier = .required },
16564 .{ .kind = .id_ref, .quantifier = .required },
16565 .{ .kind = .id_ref, .quantifier = .required },
16566 },
16567 },
16568 .{
16569 .name = "Reflect",
16570 .opcode = 71,
16571 .operands = &.{
16572 .{ .kind = .id_ref, .quantifier = .required },
16573 .{ .kind = .id_ref, .quantifier = .required },
16574 },
16575 },
16576 .{
16577 .name = "Refract",
16578 .opcode = 72,
16579 .operands = &.{
16580 .{ .kind = .id_ref, .quantifier = .required },
16581 .{ .kind = .id_ref, .quantifier = .required },
16582 .{ .kind = .id_ref, .quantifier = .required },
16583 },
16584 },
16585 .{
16586 .name = "FindILsb",
16587 .opcode = 73,
16588 .operands = &.{
16589 .{ .kind = .id_ref, .quantifier = .required },
16590 },
16591 },
16592 .{
16593 .name = "FindSMsb",
16594 .opcode = 74,
16595 .operands = &.{
16596 .{ .kind = .id_ref, .quantifier = .required },
16597 },
16598 },
16599 .{
16600 .name = "FindUMsb",
16601 .opcode = 75,
16602 .operands = &.{
16603 .{ .kind = .id_ref, .quantifier = .required },
16604 },
16605 },
16606 .{
16607 .name = "InterpolateAtCentroid",
16608 .opcode = 76,
16609 .operands = &.{
16610 .{ .kind = .id_ref, .quantifier = .required },
16611 },
16612 },
16613 .{
16614 .name = "InterpolateAtSample",
16615 .opcode = 77,
16616 .operands = &.{
16617 .{ .kind = .id_ref, .quantifier = .required },
16618 .{ .kind = .id_ref, .quantifier = .required },
16619 },
16620 },
16621 .{
16622 .name = "InterpolateAtOffset",
16623 .opcode = 78,
16624 .operands = &.{
16625 .{ .kind = .id_ref, .quantifier = .required },
16626 .{ .kind = .id_ref, .quantifier = .required },
16627 },
16628 },
16629 .{
16630 .name = "NMin",
16631 .opcode = 79,
16632 .operands = &.{
16633 .{ .kind = .id_ref, .quantifier = .required },
16634 .{ .kind = .id_ref, .quantifier = .required },
16635 },
16636 },
16637 .{
16638 .name = "NMax",
16639 .opcode = 80,
16640 .operands = &.{
16641 .{ .kind = .id_ref, .quantifier = .required },
16642 .{ .kind = .id_ref, .quantifier = .required },
16643 },
16644 },
16645 .{
16646 .name = "NClamp",
16647 .opcode = 81,
16648 .operands = &.{
16649 .{ .kind = .id_ref, .quantifier = .required },
16650 .{ .kind = .id_ref, .quantifier = .required },
16651 .{ .kind = .id_ref, .quantifier = .required },
16652 },
16653 },
16654 },
16655 .spv_amd_shader_ballot => &.{
16656 .{
16657 .name = "SwizzleInvocationsAMD",
16658 .opcode = 1,
16659 .operands = &.{
16660 .{ .kind = .id_ref, .quantifier = .required },
16661 .{ .kind = .id_ref, .quantifier = .required },
16662 },
16663 },
16664 .{
16665 .name = "SwizzleInvocationsMaskedAMD",
16666 .opcode = 2,
16667 .operands = &.{
16668 .{ .kind = .id_ref, .quantifier = .required },
16669 .{ .kind = .id_ref, .quantifier = .required },
16670 },
16671 },
16672 .{
16673 .name = "WriteInvocationAMD",
16674 .opcode = 3,
16675 .operands = &.{
16676 .{ .kind = .id_ref, .quantifier = .required },
16677 .{ .kind = .id_ref, .quantifier = .required },
16678 .{ .kind = .id_ref, .quantifier = .required },
16679 },
16680 },
16681 .{
16682 .name = "MbcntAMD",
16683 .opcode = 4,
16684 .operands = &.{
16685 .{ .kind = .id_ref, .quantifier = .required },
16686 },
16687 },
16688 },
16689 .non_semantic_debug_printf => &.{
16690 .{
16691 .name = "DebugPrintf",
16692 .opcode = 1,
16693 .operands = &.{
16694 .{ .kind = .id_ref, .quantifier = .required },
16695 .{ .kind = .id_ref, .quantifier = .variadic },
16696 },
16697 },
16698 },
16699 .spv_amd_gcn_shader => &.{
16700 .{
16701 .name = "CubeFaceIndexAMD",
16702 .opcode = 1,
16703 .operands = &.{
16704 .{ .kind = .id_ref, .quantifier = .required },
16705 },
16706 },
16707 .{
16708 .name = "CubeFaceCoordAMD",
16709 .opcode = 2,
16710 .operands = &.{
16711 .{ .kind = .id_ref, .quantifier = .required },
16712 },
16713 },
16714 .{
16715 .name = "TimeAMD",
16716 .opcode = 3,
16717 .operands = &.{},
16718 },
16719 },
16720 .open_cl_std => &.{
16721 .{
16722 .name = "acos",
16723 .opcode = 0,
16724 .operands = &.{
16725 .{ .kind = .id_ref, .quantifier = .required },
16726 },
16727 },
16728 .{
16729 .name = "acosh",
16730 .opcode = 1,
16731 .operands = &.{
16732 .{ .kind = .id_ref, .quantifier = .required },
16733 },
16734 },
16735 .{
16736 .name = "acospi",
16737 .opcode = 2,
16738 .operands = &.{
16739 .{ .kind = .id_ref, .quantifier = .required },
16740 },
16741 },
16742 .{
16743 .name = "asin",
16744 .opcode = 3,
16745 .operands = &.{
16746 .{ .kind = .id_ref, .quantifier = .required },
16747 },
16748 },
16749 .{
16750 .name = "asinh",
16751 .opcode = 4,
16752 .operands = &.{
16753 .{ .kind = .id_ref, .quantifier = .required },
16754 },
16755 },
16756 .{
16757 .name = "asinpi",
16758 .opcode = 5,
16759 .operands = &.{
16760 .{ .kind = .id_ref, .quantifier = .required },
16761 },
16762 },
16763 .{
16764 .name = "atan",
16765 .opcode = 6,
16766 .operands = &.{
16767 .{ .kind = .id_ref, .quantifier = .required },
16768 },
16769 },
16770 .{
16771 .name = "atan2",
16772 .opcode = 7,
16773 .operands = &.{
16774 .{ .kind = .id_ref, .quantifier = .required },
16775 .{ .kind = .id_ref, .quantifier = .required },
16776 },
16777 },
16778 .{
16779 .name = "atanh",
16780 .opcode = 8,
16781 .operands = &.{
16782 .{ .kind = .id_ref, .quantifier = .required },
16783 },
16784 },
16785 .{
16786 .name = "atanpi",
16787 .opcode = 9,
16788 .operands = &.{
16789 .{ .kind = .id_ref, .quantifier = .required },
16790 },
16791 },
16792 .{
16793 .name = "atan2pi",
16794 .opcode = 10,
16795 .operands = &.{
16796 .{ .kind = .id_ref, .quantifier = .required },
16797 .{ .kind = .id_ref, .quantifier = .required },
16798 },
16799 },
16800 .{
16801 .name = "cbrt",
16802 .opcode = 11,
16803 .operands = &.{
16804 .{ .kind = .id_ref, .quantifier = .required },
16805 },
16806 },
16807 .{
16808 .name = "ceil",
16809 .opcode = 12,
16810 .operands = &.{
16811 .{ .kind = .id_ref, .quantifier = .required },
16812 },
16813 },
16814 .{
16815 .name = "copysign",
16816 .opcode = 13,
16817 .operands = &.{
16818 .{ .kind = .id_ref, .quantifier = .required },
16819 .{ .kind = .id_ref, .quantifier = .required },
16820 },
16821 },
16822 .{
16823 .name = "cos",
16824 .opcode = 14,
16825 .operands = &.{
16826 .{ .kind = .id_ref, .quantifier = .required },
16827 },
16828 },
16829 .{
16830 .name = "cosh",
16831 .opcode = 15,
16832 .operands = &.{
16833 .{ .kind = .id_ref, .quantifier = .required },
16834 },
16835 },
16836 .{
16837 .name = "cospi",
16838 .opcode = 16,
16839 .operands = &.{
16840 .{ .kind = .id_ref, .quantifier = .required },
16841 },
16842 },
16843 .{
16844 .name = "erfc",
16845 .opcode = 17,
16846 .operands = &.{
16847 .{ .kind = .id_ref, .quantifier = .required },
16848 },
16849 },
16850 .{
16851 .name = "erf",
16852 .opcode = 18,
16853 .operands = &.{
16854 .{ .kind = .id_ref, .quantifier = .required },
16855 },
16856 },
16857 .{
16858 .name = "exp",
16859 .opcode = 19,
16860 .operands = &.{
16861 .{ .kind = .id_ref, .quantifier = .required },
16862 },
16863 },
16864 .{
16865 .name = "exp2",
16866 .opcode = 20,
16867 .operands = &.{
16868 .{ .kind = .id_ref, .quantifier = .required },
16869 },
16870 },
16871 .{
16872 .name = "exp10",
16873 .opcode = 21,
16874 .operands = &.{
16875 .{ .kind = .id_ref, .quantifier = .required },
16876 },
16877 },
16878 .{
16879 .name = "expm1",
16880 .opcode = 22,
16881 .operands = &.{
16882 .{ .kind = .id_ref, .quantifier = .required },
16883 },
16884 },
16885 .{
16886 .name = "fabs",
16887 .opcode = 23,
16888 .operands = &.{
16889 .{ .kind = .id_ref, .quantifier = .required },
16890 },
16891 },
16892 .{
16893 .name = "fdim",
16894 .opcode = 24,
16895 .operands = &.{
16896 .{ .kind = .id_ref, .quantifier = .required },
16897 .{ .kind = .id_ref, .quantifier = .required },
16898 },
16899 },
16900 .{
16901 .name = "floor",
16902 .opcode = 25,
16903 .operands = &.{
16904 .{ .kind = .id_ref, .quantifier = .required },
16905 },
16906 },
16907 .{
16908 .name = "fma",
16909 .opcode = 26,
16910 .operands = &.{
16911 .{ .kind = .id_ref, .quantifier = .required },
16912 .{ .kind = .id_ref, .quantifier = .required },
16913 .{ .kind = .id_ref, .quantifier = .required },
16914 },
16915 },
16916 .{
16917 .name = "fmax",
16918 .opcode = 27,
16919 .operands = &.{
16920 .{ .kind = .id_ref, .quantifier = .required },
16921 .{ .kind = .id_ref, .quantifier = .required },
16922 },
16923 },
16924 .{
16925 .name = "fmin",
16926 .opcode = 28,
16927 .operands = &.{
16928 .{ .kind = .id_ref, .quantifier = .required },
16929 .{ .kind = .id_ref, .quantifier = .required },
16930 },
16931 },
16932 .{
16933 .name = "fmod",
16934 .opcode = 29,
16935 .operands = &.{
16936 .{ .kind = .id_ref, .quantifier = .required },
16937 .{ .kind = .id_ref, .quantifier = .required },
16938 },
16939 },
16940 .{
16941 .name = "fract",
16942 .opcode = 30,
16943 .operands = &.{
16944 .{ .kind = .id_ref, .quantifier = .required },
16945 .{ .kind = .id_ref, .quantifier = .required },
16946 },
16947 },
16948 .{
16949 .name = "frexp",
16950 .opcode = 31,
16951 .operands = &.{
16952 .{ .kind = .id_ref, .quantifier = .required },
16953 .{ .kind = .id_ref, .quantifier = .required },
16954 },
16955 },
16956 .{
16957 .name = "hypot",
16958 .opcode = 32,
16959 .operands = &.{
16960 .{ .kind = .id_ref, .quantifier = .required },
16961 .{ .kind = .id_ref, .quantifier = .required },
16962 },
16963 },
16964 .{
16965 .name = "ilogb",
16966 .opcode = 33,
16967 .operands = &.{
16968 .{ .kind = .id_ref, .quantifier = .required },
16969 },
16970 },
16971 .{
16972 .name = "ldexp",
16973 .opcode = 34,
16974 .operands = &.{
16975 .{ .kind = .id_ref, .quantifier = .required },
16976 .{ .kind = .id_ref, .quantifier = .required },
16977 },
16978 },
16979 .{
16980 .name = "lgamma",
16981 .opcode = 35,
16982 .operands = &.{
16983 .{ .kind = .id_ref, .quantifier = .required },
16984 },
16985 },
16986 .{
16987 .name = "lgamma_r",
16988 .opcode = 36,
16989 .operands = &.{
16990 .{ .kind = .id_ref, .quantifier = .required },
16991 .{ .kind = .id_ref, .quantifier = .required },
16992 },
16993 },
16994 .{
16995 .name = "log",
16996 .opcode = 37,
16997 .operands = &.{
16998 .{ .kind = .id_ref, .quantifier = .required },
16999 },
17000 },
17001 .{
17002 .name = "log2",
17003 .opcode = 38,
17004 .operands = &.{
17005 .{ .kind = .id_ref, .quantifier = .required },
17006 },
17007 },
17008 .{
17009 .name = "log10",
17010 .opcode = 39,
17011 .operands = &.{
17012 .{ .kind = .id_ref, .quantifier = .required },
17013 },
17014 },
17015 .{
17016 .name = "log1p",
17017 .opcode = 40,
17018 .operands = &.{
17019 .{ .kind = .id_ref, .quantifier = .required },
17020 },
17021 },
17022 .{
17023 .name = "logb",
17024 .opcode = 41,
17025 .operands = &.{
17026 .{ .kind = .id_ref, .quantifier = .required },
17027 },
17028 },
17029 .{
17030 .name = "mad",
17031 .opcode = 42,
17032 .operands = &.{
17033 .{ .kind = .id_ref, .quantifier = .required },
17034 .{ .kind = .id_ref, .quantifier = .required },
17035 .{ .kind = .id_ref, .quantifier = .required },
17036 },
17037 },
17038 .{
17039 .name = "maxmag",
17040 .opcode = 43,
17041 .operands = &.{
17042 .{ .kind = .id_ref, .quantifier = .required },
17043 .{ .kind = .id_ref, .quantifier = .required },
17044 },
17045 },
17046 .{
17047 .name = "minmag",
17048 .opcode = 44,
17049 .operands = &.{
17050 .{ .kind = .id_ref, .quantifier = .required },
17051 .{ .kind = .id_ref, .quantifier = .required },
17052 },
17053 },
17054 .{
17055 .name = "modf",
17056 .opcode = 45,
17057 .operands = &.{
17058 .{ .kind = .id_ref, .quantifier = .required },
17059 .{ .kind = .id_ref, .quantifier = .required },
17060 },
17061 },
17062 .{
17063 .name = "nan",
17064 .opcode = 46,
17065 .operands = &.{
17066 .{ .kind = .id_ref, .quantifier = .required },
17067 },
17068 },
17069 .{
17070 .name = "nextafter",
17071 .opcode = 47,
17072 .operands = &.{
17073 .{ .kind = .id_ref, .quantifier = .required },
17074 .{ .kind = .id_ref, .quantifier = .required },
17075 },
17076 },
17077 .{
17078 .name = "pow",
17079 .opcode = 48,
17080 .operands = &.{
17081 .{ .kind = .id_ref, .quantifier = .required },
17082 .{ .kind = .id_ref, .quantifier = .required },
17083 },
17084 },
17085 .{
17086 .name = "pown",
17087 .opcode = 49,
17088 .operands = &.{
17089 .{ .kind = .id_ref, .quantifier = .required },
17090 .{ .kind = .id_ref, .quantifier = .required },
17091 },
17092 },
17093 .{
17094 .name = "powr",
17095 .opcode = 50,
17096 .operands = &.{
17097 .{ .kind = .id_ref, .quantifier = .required },
17098 .{ .kind = .id_ref, .quantifier = .required },
17099 },
17100 },
17101 .{
17102 .name = "remainder",
17103 .opcode = 51,
17104 .operands = &.{
17105 .{ .kind = .id_ref, .quantifier = .required },
17106 .{ .kind = .id_ref, .quantifier = .required },
17107 },
17108 },
17109 .{
17110 .name = "remquo",
17111 .opcode = 52,
17112 .operands = &.{
17113 .{ .kind = .id_ref, .quantifier = .required },
17114 .{ .kind = .id_ref, .quantifier = .required },
17115 .{ .kind = .id_ref, .quantifier = .required },
17116 },
17117 },
17118 .{
17119 .name = "rint",
17120 .opcode = 53,
17121 .operands = &.{
17122 .{ .kind = .id_ref, .quantifier = .required },
17123 },
17124 },
17125 .{
17126 .name = "rootn",
17127 .opcode = 54,
17128 .operands = &.{
17129 .{ .kind = .id_ref, .quantifier = .required },
17130 .{ .kind = .id_ref, .quantifier = .required },
17131 },
17132 },
17133 .{
17134 .name = "round",
17135 .opcode = 55,
17136 .operands = &.{
17137 .{ .kind = .id_ref, .quantifier = .required },
17138 },
17139 },
17140 .{
17141 .name = "rsqrt",
17142 .opcode = 56,
17143 .operands = &.{
17144 .{ .kind = .id_ref, .quantifier = .required },
17145 },
17146 },
17147 .{
17148 .name = "sin",
17149 .opcode = 57,
17150 .operands = &.{
17151 .{ .kind = .id_ref, .quantifier = .required },
17152 },
17153 },
17154 .{
17155 .name = "sincos",
17156 .opcode = 58,
17157 .operands = &.{
17158 .{ .kind = .id_ref, .quantifier = .required },
17159 .{ .kind = .id_ref, .quantifier = .required },
17160 },
17161 },
17162 .{
17163 .name = "sinh",
17164 .opcode = 59,
17165 .operands = &.{
17166 .{ .kind = .id_ref, .quantifier = .required },
17167 },
17168 },
17169 .{
17170 .name = "sinpi",
17171 .opcode = 60,
17172 .operands = &.{
17173 .{ .kind = .id_ref, .quantifier = .required },
17174 },
17175 },
17176 .{
17177 .name = "sqrt",
17178 .opcode = 61,
17179 .operands = &.{
17180 .{ .kind = .id_ref, .quantifier = .required },
17181 },
17182 },
17183 .{
17184 .name = "tan",
17185 .opcode = 62,
17186 .operands = &.{
17187 .{ .kind = .id_ref, .quantifier = .required },
17188 },
17189 },
17190 .{
17191 .name = "tanh",
17192 .opcode = 63,
17193 .operands = &.{
17194 .{ .kind = .id_ref, .quantifier = .required },
17195 },
17196 },
17197 .{
17198 .name = "tanpi",
17199 .opcode = 64,
17200 .operands = &.{
17201 .{ .kind = .id_ref, .quantifier = .required },
17202 },
17203 },
17204 .{
17205 .name = "tgamma",
17206 .opcode = 65,
17207 .operands = &.{
17208 .{ .kind = .id_ref, .quantifier = .required },
17209 },
17210 },
17211 .{
17212 .name = "trunc",
17213 .opcode = 66,
17214 .operands = &.{
17215 .{ .kind = .id_ref, .quantifier = .required },
17216 },
17217 },
17218 .{
17219 .name = "half_cos",
17220 .opcode = 67,
17221 .operands = &.{
17222 .{ .kind = .id_ref, .quantifier = .required },
17223 },
17224 },
17225 .{
17226 .name = "half_divide",
17227 .opcode = 68,
17228 .operands = &.{
17229 .{ .kind = .id_ref, .quantifier = .required },
17230 .{ .kind = .id_ref, .quantifier = .required },
17231 },
17232 },
17233 .{
17234 .name = "half_exp",
17235 .opcode = 69,
17236 .operands = &.{
17237 .{ .kind = .id_ref, .quantifier = .required },
17238 },
17239 },
17240 .{
17241 .name = "half_exp2",
17242 .opcode = 70,
17243 .operands = &.{
17244 .{ .kind = .id_ref, .quantifier = .required },
17245 },
17246 },
17247 .{
17248 .name = "half_exp10",
17249 .opcode = 71,
17250 .operands = &.{
17251 .{ .kind = .id_ref, .quantifier = .required },
17252 },
17253 },
17254 .{
17255 .name = "half_log",
17256 .opcode = 72,
17257 .operands = &.{
17258 .{ .kind = .id_ref, .quantifier = .required },
17259 },
17260 },
17261 .{
17262 .name = "half_log2",
17263 .opcode = 73,
17264 .operands = &.{
17265 .{ .kind = .id_ref, .quantifier = .required },
17266 },
17267 },
17268 .{
17269 .name = "half_log10",
17270 .opcode = 74,
17271 .operands = &.{
17272 .{ .kind = .id_ref, .quantifier = .required },
17273 },
17274 },
17275 .{
17276 .name = "half_powr",
17277 .opcode = 75,
17278 .operands = &.{
17279 .{ .kind = .id_ref, .quantifier = .required },
17280 .{ .kind = .id_ref, .quantifier = .required },
17281 },
17282 },
17283 .{
17284 .name = "half_recip",
17285 .opcode = 76,
17286 .operands = &.{
17287 .{ .kind = .id_ref, .quantifier = .required },
17288 },
17289 },
17290 .{
17291 .name = "half_rsqrt",
17292 .opcode = 77,
17293 .operands = &.{
17294 .{ .kind = .id_ref, .quantifier = .required },
17295 },
17296 },
17297 .{
17298 .name = "half_sin",
17299 .opcode = 78,
17300 .operands = &.{
17301 .{ .kind = .id_ref, .quantifier = .required },
17302 },
17303 },
17304 .{
17305 .name = "half_sqrt",
17306 .opcode = 79,
17307 .operands = &.{
17308 .{ .kind = .id_ref, .quantifier = .required },
17309 },
17310 },
17311 .{
17312 .name = "half_tan",
17313 .opcode = 80,
17314 .operands = &.{
17315 .{ .kind = .id_ref, .quantifier = .required },
17316 },
17317 },
17318 .{
17319 .name = "native_cos",
17320 .opcode = 81,
17321 .operands = &.{
17322 .{ .kind = .id_ref, .quantifier = .required },
17323 },
17324 },
17325 .{
17326 .name = "native_divide",
17327 .opcode = 82,
17328 .operands = &.{
17329 .{ .kind = .id_ref, .quantifier = .required },
17330 .{ .kind = .id_ref, .quantifier = .required },
17331 },
17332 },
17333 .{
17334 .name = "native_exp",
17335 .opcode = 83,
17336 .operands = &.{
17337 .{ .kind = .id_ref, .quantifier = .required },
17338 },
17339 },
17340 .{
17341 .name = "native_exp2",
17342 .opcode = 84,
17343 .operands = &.{
17344 .{ .kind = .id_ref, .quantifier = .required },
17345 },
17346 },
17347 .{
17348 .name = "native_exp10",
17349 .opcode = 85,
17350 .operands = &.{
17351 .{ .kind = .id_ref, .quantifier = .required },
17352 },
17353 },
17354 .{
17355 .name = "native_log",
17356 .opcode = 86,
17357 .operands = &.{
17358 .{ .kind = .id_ref, .quantifier = .required },
17359 },
17360 },
17361 .{
17362 .name = "native_log2",
17363 .opcode = 87,
17364 .operands = &.{
17365 .{ .kind = .id_ref, .quantifier = .required },
17366 },
17367 },
17368 .{
17369 .name = "native_log10",
17370 .opcode = 88,
17371 .operands = &.{
17372 .{ .kind = .id_ref, .quantifier = .required },
17373 },
17374 },
17375 .{
17376 .name = "native_powr",
17377 .opcode = 89,
17378 .operands = &.{
17379 .{ .kind = .id_ref, .quantifier = .required },
17380 .{ .kind = .id_ref, .quantifier = .required },
17381 },
17382 },
17383 .{
17384 .name = "native_recip",
17385 .opcode = 90,
17386 .operands = &.{
17387 .{ .kind = .id_ref, .quantifier = .required },
17388 },
17389 },
17390 .{
17391 .name = "native_rsqrt",
17392 .opcode = 91,
17393 .operands = &.{
17394 .{ .kind = .id_ref, .quantifier = .required },
17395 },
17396 },
17397 .{
17398 .name = "native_sin",
17399 .opcode = 92,
17400 .operands = &.{
17401 .{ .kind = .id_ref, .quantifier = .required },
17402 },
17403 },
17404 .{
17405 .name = "native_sqrt",
17406 .opcode = 93,
17407 .operands = &.{
17408 .{ .kind = .id_ref, .quantifier = .required },
17409 },
17410 },
17411 .{
17412 .name = "native_tan",
17413 .opcode = 94,
17414 .operands = &.{
17415 .{ .kind = .id_ref, .quantifier = .required },
17416 },
17417 },
17418 .{
17419 .name = "fclamp",
17420 .opcode = 95,
17421 .operands = &.{
17422 .{ .kind = .id_ref, .quantifier = .required },
17423 .{ .kind = .id_ref, .quantifier = .required },
17424 .{ .kind = .id_ref, .quantifier = .required },
17425 },
17426 },
17427 .{
17428 .name = "degrees",
17429 .opcode = 96,
17430 .operands = &.{
17431 .{ .kind = .id_ref, .quantifier = .required },
17432 },
17433 },
17434 .{
17435 .name = "fmax_common",
17436 .opcode = 97,
17437 .operands = &.{
17438 .{ .kind = .id_ref, .quantifier = .required },
17439 .{ .kind = .id_ref, .quantifier = .required },
17440 },
17441 },
17442 .{
17443 .name = "fmin_common",
17444 .opcode = 98,
17445 .operands = &.{
17446 .{ .kind = .id_ref, .quantifier = .required },
17447 .{ .kind = .id_ref, .quantifier = .required },
17448 },
17449 },
17450 .{
17451 .name = "mix",
17452 .opcode = 99,
17453 .operands = &.{
17454 .{ .kind = .id_ref, .quantifier = .required },
17455 .{ .kind = .id_ref, .quantifier = .required },
17456 .{ .kind = .id_ref, .quantifier = .required },
17457 },
17458 },
17459 .{
17460 .name = "radians",
17461 .opcode = 100,
17462 .operands = &.{
17463 .{ .kind = .id_ref, .quantifier = .required },
17464 },
17465 },
17466 .{
17467 .name = "step",
17468 .opcode = 101,
17469 .operands = &.{
17470 .{ .kind = .id_ref, .quantifier = .required },
17471 .{ .kind = .id_ref, .quantifier = .required },
17472 },
17473 },
17474 .{
17475 .name = "smoothstep",
17476 .opcode = 102,
17477 .operands = &.{
17478 .{ .kind = .id_ref, .quantifier = .required },
17479 .{ .kind = .id_ref, .quantifier = .required },
17480 .{ .kind = .id_ref, .quantifier = .required },
17481 },
17482 },
17483 .{
17484 .name = "sign",
17485 .opcode = 103,
17486 .operands = &.{
17487 .{ .kind = .id_ref, .quantifier = .required },
17488 },
17489 },
17490 .{
17491 .name = "cross",
17492 .opcode = 104,
17493 .operands = &.{
17494 .{ .kind = .id_ref, .quantifier = .required },
17495 .{ .kind = .id_ref, .quantifier = .required },
17496 },
17497 },
17498 .{
17499 .name = "distance",
17500 .opcode = 105,
17501 .operands = &.{
17502 .{ .kind = .id_ref, .quantifier = .required },
17503 .{ .kind = .id_ref, .quantifier = .required },
17504 },
17505 },
17506 .{
17507 .name = "length",
17508 .opcode = 106,
17509 .operands = &.{
17510 .{ .kind = .id_ref, .quantifier = .required },
17511 },
17512 },
17513 .{
17514 .name = "normalize",
17515 .opcode = 107,
17516 .operands = &.{
17517 .{ .kind = .id_ref, .quantifier = .required },
17518 },
17519 },
17520 .{
17521 .name = "fast_distance",
17522 .opcode = 108,
17523 .operands = &.{
17524 .{ .kind = .id_ref, .quantifier = .required },
17525 .{ .kind = .id_ref, .quantifier = .required },
17526 },
17527 },
17528 .{
17529 .name = "fast_length",
17530 .opcode = 109,
17531 .operands = &.{
17532 .{ .kind = .id_ref, .quantifier = .required },
17533 },
17534 },
17535 .{
17536 .name = "fast_normalize",
17537 .opcode = 110,
17538 .operands = &.{
17539 .{ .kind = .id_ref, .quantifier = .required },
17540 },
17541 },
17542 .{
17543 .name = "s_abs",
17544 .opcode = 141,
17545 .operands = &.{
17546 .{ .kind = .id_ref, .quantifier = .required },
17547 },
17548 },
17549 .{
17550 .name = "s_abs_diff",
17551 .opcode = 142,
17552 .operands = &.{
17553 .{ .kind = .id_ref, .quantifier = .required },
17554 .{ .kind = .id_ref, .quantifier = .required },
17555 },
17556 },
17557 .{
17558 .name = "s_add_sat",
17559 .opcode = 143,
17560 .operands = &.{
17561 .{ .kind = .id_ref, .quantifier = .required },
17562 .{ .kind = .id_ref, .quantifier = .required },
17563 },
17564 },
17565 .{
17566 .name = "u_add_sat",
17567 .opcode = 144,
17568 .operands = &.{
17569 .{ .kind = .id_ref, .quantifier = .required },
17570 .{ .kind = .id_ref, .quantifier = .required },
17571 },
17572 },
17573 .{
17574 .name = "s_hadd",
17575 .opcode = 145,
17576 .operands = &.{
17577 .{ .kind = .id_ref, .quantifier = .required },
17578 .{ .kind = .id_ref, .quantifier = .required },
17579 },
17580 },
17581 .{
17582 .name = "u_hadd",
17583 .opcode = 146,
17584 .operands = &.{
17585 .{ .kind = .id_ref, .quantifier = .required },
17586 .{ .kind = .id_ref, .quantifier = .required },
17587 },
17588 },
17589 .{
17590 .name = "s_rhadd",
17591 .opcode = 147,
17592 .operands = &.{
17593 .{ .kind = .id_ref, .quantifier = .required },
17594 .{ .kind = .id_ref, .quantifier = .required },
17595 },
17596 },
17597 .{
17598 .name = "u_rhadd",
17599 .opcode = 148,
17600 .operands = &.{
17601 .{ .kind = .id_ref, .quantifier = .required },
17602 .{ .kind = .id_ref, .quantifier = .required },
17603 },
17604 },
17605 .{
17606 .name = "s_clamp",
17607 .opcode = 149,
17608 .operands = &.{
17609 .{ .kind = .id_ref, .quantifier = .required },
17610 .{ .kind = .id_ref, .quantifier = .required },
17611 .{ .kind = .id_ref, .quantifier = .required },
17612 },
17613 },
17614 .{
17615 .name = "u_clamp",
17616 .opcode = 150,
17617 .operands = &.{
17618 .{ .kind = .id_ref, .quantifier = .required },
17619 .{ .kind = .id_ref, .quantifier = .required },
17620 .{ .kind = .id_ref, .quantifier = .required },
17621 },
17622 },
17623 .{
17624 .name = "clz",
17625 .opcode = 151,
17626 .operands = &.{
17627 .{ .kind = .id_ref, .quantifier = .required },
17628 },
17629 },
17630 .{
17631 .name = "ctz",
17632 .opcode = 152,
17633 .operands = &.{
17634 .{ .kind = .id_ref, .quantifier = .required },
17635 },
17636 },
17637 .{
17638 .name = "s_mad_hi",
17639 .opcode = 153,
17640 .operands = &.{
17641 .{ .kind = .id_ref, .quantifier = .required },
17642 .{ .kind = .id_ref, .quantifier = .required },
17643 .{ .kind = .id_ref, .quantifier = .required },
17644 },
17645 },
17646 .{
17647 .name = "u_mad_sat",
17648 .opcode = 154,
17649 .operands = &.{
17650 .{ .kind = .id_ref, .quantifier = .required },
17651 .{ .kind = .id_ref, .quantifier = .required },
17652 .{ .kind = .id_ref, .quantifier = .required },
17653 },
17654 },
17655 .{
17656 .name = "s_mad_sat",
17657 .opcode = 155,
17658 .operands = &.{
17659 .{ .kind = .id_ref, .quantifier = .required },
17660 .{ .kind = .id_ref, .quantifier = .required },
17661 .{ .kind = .id_ref, .quantifier = .required },
17662 },
17663 },
17664 .{
17665 .name = "s_max",
17666 .opcode = 156,
17667 .operands = &.{
17668 .{ .kind = .id_ref, .quantifier = .required },
17669 .{ .kind = .id_ref, .quantifier = .required },
17670 },
17671 },
17672 .{
17673 .name = "u_max",
17674 .opcode = 157,
17675 .operands = &.{
17676 .{ .kind = .id_ref, .quantifier = .required },
17677 .{ .kind = .id_ref, .quantifier = .required },
17678 },
17679 },
17680 .{
17681 .name = "s_min",
17682 .opcode = 158,
17683 .operands = &.{
17684 .{ .kind = .id_ref, .quantifier = .required },
17685 .{ .kind = .id_ref, .quantifier = .required },
17686 },
17687 },
17688 .{
17689 .name = "u_min",
17690 .opcode = 159,
17691 .operands = &.{
17692 .{ .kind = .id_ref, .quantifier = .required },
17693 .{ .kind = .id_ref, .quantifier = .required },
17694 },
17695 },
17696 .{
17697 .name = "s_mul_hi",
17698 .opcode = 160,
17699 .operands = &.{
17700 .{ .kind = .id_ref, .quantifier = .required },
17701 .{ .kind = .id_ref, .quantifier = .required },
17702 },
17703 },
17704 .{
17705 .name = "rotate",
17706 .opcode = 161,
17707 .operands = &.{
17708 .{ .kind = .id_ref, .quantifier = .required },
17709 .{ .kind = .id_ref, .quantifier = .required },
17710 },
17711 },
17712 .{
17713 .name = "s_sub_sat",
17714 .opcode = 162,
17715 .operands = &.{
17716 .{ .kind = .id_ref, .quantifier = .required },
17717 .{ .kind = .id_ref, .quantifier = .required },
17718 },
17719 },
17720 .{
17721 .name = "u_sub_sat",
17722 .opcode = 163,
17723 .operands = &.{
17724 .{ .kind = .id_ref, .quantifier = .required },
17725 .{ .kind = .id_ref, .quantifier = .required },
17726 },
17727 },
17728 .{
17729 .name = "u_upsample",
17730 .opcode = 164,
17731 .operands = &.{
17732 .{ .kind = .id_ref, .quantifier = .required },
17733 .{ .kind = .id_ref, .quantifier = .required },
17734 },
17735 },
17736 .{
17737 .name = "s_upsample",
17738 .opcode = 165,
17739 .operands = &.{
17740 .{ .kind = .id_ref, .quantifier = .required },
17741 .{ .kind = .id_ref, .quantifier = .required },
17742 },
17743 },
17744 .{
17745 .name = "popcount",
17746 .opcode = 166,
17747 .operands = &.{
17748 .{ .kind = .id_ref, .quantifier = .required },
17749 },
17750 },
17751 .{
17752 .name = "s_mad24",
17753 .opcode = 167,
17754 .operands = &.{
17755 .{ .kind = .id_ref, .quantifier = .required },
17756 .{ .kind = .id_ref, .quantifier = .required },
17757 .{ .kind = .id_ref, .quantifier = .required },
17758 },
17759 },
17760 .{
17761 .name = "u_mad24",
17762 .opcode = 168,
17763 .operands = &.{
17764 .{ .kind = .id_ref, .quantifier = .required },
17765 .{ .kind = .id_ref, .quantifier = .required },
17766 .{ .kind = .id_ref, .quantifier = .required },
17767 },
17768 },
17769 .{
17770 .name = "s_mul24",
17771 .opcode = 169,
17772 .operands = &.{
17773 .{ .kind = .id_ref, .quantifier = .required },
17774 .{ .kind = .id_ref, .quantifier = .required },
17775 },
17776 },
17777 .{
17778 .name = "u_mul24",
17779 .opcode = 170,
17780 .operands = &.{
17781 .{ .kind = .id_ref, .quantifier = .required },
17782 .{ .kind = .id_ref, .quantifier = .required },
17783 },
17784 },
17785 .{
17786 .name = "vloadn",
17787 .opcode = 171,
17788 .operands = &.{
17789 .{ .kind = .id_ref, .quantifier = .required },
17790 .{ .kind = .id_ref, .quantifier = .required },
17791 .{ .kind = .literal_integer, .quantifier = .required },
17792 },
17793 },
17794 .{
17795 .name = "vstoren",
17796 .opcode = 172,
17797 .operands = &.{
17798 .{ .kind = .id_ref, .quantifier = .required },
17799 .{ .kind = .id_ref, .quantifier = .required },
17800 .{ .kind = .id_ref, .quantifier = .required },
17801 },
17802 },
17803 .{
17804 .name = "vload_half",
17805 .opcode = 173,
17806 .operands = &.{
17807 .{ .kind = .id_ref, .quantifier = .required },
17808 .{ .kind = .id_ref, .quantifier = .required },
17809 },
17810 },
17811 .{
17812 .name = "vload_halfn",
17813 .opcode = 174,
17814 .operands = &.{
17815 .{ .kind = .id_ref, .quantifier = .required },
17816 .{ .kind = .id_ref, .quantifier = .required },
17817 .{ .kind = .literal_integer, .quantifier = .required },
17818 },
17819 },
17820 .{
17821 .name = "vstore_half",
17822 .opcode = 175,
17823 .operands = &.{
17824 .{ .kind = .id_ref, .quantifier = .required },
17825 .{ .kind = .id_ref, .quantifier = .required },
17826 .{ .kind = .id_ref, .quantifier = .required },
17827 },
17828 },
17829 .{
17830 .name = "vstore_half_r",
17831 .opcode = 176,
17832 .operands = &.{
17833 .{ .kind = .id_ref, .quantifier = .required },
17834 .{ .kind = .id_ref, .quantifier = .required },
17835 .{ .kind = .id_ref, .quantifier = .required },
17836 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17837 },
17838 },
17839 .{
17840 .name = "vstore_halfn",
17841 .opcode = 177,
17842 .operands = &.{
17843 .{ .kind = .id_ref, .quantifier = .required },
17844 .{ .kind = .id_ref, .quantifier = .required },
17845 .{ .kind = .id_ref, .quantifier = .required },
17846 },
17847 },
17848 .{
17849 .name = "vstore_halfn_r",
17850 .opcode = 178,
17851 .operands = &.{
17852 .{ .kind = .id_ref, .quantifier = .required },
17853 .{ .kind = .id_ref, .quantifier = .required },
17854 .{ .kind = .id_ref, .quantifier = .required },
17855 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17856 },
17857 },
17858 .{
17859 .name = "vloada_halfn",
17860 .opcode = 179,
17861 .operands = &.{
17862 .{ .kind = .id_ref, .quantifier = .required },
17863 .{ .kind = .id_ref, .quantifier = .required },
17864 .{ .kind = .literal_integer, .quantifier = .required },
17865 },
17866 },
17867 .{
17868 .name = "vstorea_halfn",
17869 .opcode = 180,
17870 .operands = &.{
17871 .{ .kind = .id_ref, .quantifier = .required },
17872 .{ .kind = .id_ref, .quantifier = .required },
17873 .{ .kind = .id_ref, .quantifier = .required },
17874 },
17875 },
17876 .{
17877 .name = "vstorea_halfn_r",
17878 .opcode = 181,
17879 .operands = &.{
17880 .{ .kind = .id_ref, .quantifier = .required },
17881 .{ .kind = .id_ref, .quantifier = .required },
17882 .{ .kind = .id_ref, .quantifier = .required },
17883 .{ .kind = .fp_rounding_mode, .quantifier = .required },
17884 },
17885 },
17886 .{
17887 .name = "shuffle",
17888 .opcode = 182,
17889 .operands = &.{
17890 .{ .kind = .id_ref, .quantifier = .required },
17891 .{ .kind = .id_ref, .quantifier = .required },
17892 },
17893 },
17894 .{
17895 .name = "shuffle2",
17896 .opcode = 183,
17897 .operands = &.{
17898 .{ .kind = .id_ref, .quantifier = .required },
17899 .{ .kind = .id_ref, .quantifier = .required },
17900 .{ .kind = .id_ref, .quantifier = .required },
17901 },
17902 },
17903 .{
17904 .name = "printf",
17905 .opcode = 184,
17906 .operands = &.{
17907 .{ .kind = .id_ref, .quantifier = .required },
17908 .{ .kind = .id_ref, .quantifier = .variadic },
17909 },
17910 },
17911 .{
17912 .name = "prefetch",
17913 .opcode = 185,
17914 .operands = &.{
17915 .{ .kind = .id_ref, .quantifier = .required },
17916 .{ .kind = .id_ref, .quantifier = .required },
17917 },
17918 },
17919 .{
17920 .name = "bitselect",
17921 .opcode = 186,
17922 .operands = &.{
17923 .{ .kind = .id_ref, .quantifier = .required },
17924 .{ .kind = .id_ref, .quantifier = .required },
17925 .{ .kind = .id_ref, .quantifier = .required },
17926 },
17927 },
17928 .{
17929 .name = "select",
17930 .opcode = 187,
17931 .operands = &.{
17932 .{ .kind = .id_ref, .quantifier = .required },
17933 .{ .kind = .id_ref, .quantifier = .required },
17934 .{ .kind = .id_ref, .quantifier = .required },
17935 },
17936 },
17937 .{
17938 .name = "u_abs",
17939 .opcode = 201,
17940 .operands = &.{
17941 .{ .kind = .id_ref, .quantifier = .required },
17942 },
17943 },
17944 .{
17945 .name = "u_abs_diff",
17946 .opcode = 202,
17947 .operands = &.{
17948 .{ .kind = .id_ref, .quantifier = .required },
17949 .{ .kind = .id_ref, .quantifier = .required },
17950 },
17951 },
17952 .{
17953 .name = "u_mul_hi",
17954 .opcode = 203,
17955 .operands = &.{
17956 .{ .kind = .id_ref, .quantifier = .required },
17957 .{ .kind = .id_ref, .quantifier = .required },
17958 },
17959 },
17960 .{
17961 .name = "u_mad_hi",
17962 .opcode = 204,
17963 .operands = &.{
17964 .{ .kind = .id_ref, .quantifier = .required },
17965 .{ .kind = .id_ref, .quantifier = .required },
17966 .{ .kind = .id_ref, .quantifier = .required },
17967 },
17968 },
17969 },
17970 .non_semantic_shader_debug_info_100 => &.{
17971 .{
17972 .name = "DebugInfoNone",
17973 .opcode = 0,
17974 .operands = &.{},
17975 },
17976 .{
17977 .name = "DebugCompilationUnit",
17978 .opcode = 1,
17979 .operands = &.{
17980 .{ .kind = .id_ref, .quantifier = .required },
17981 .{ .kind = .id_ref, .quantifier = .required },
17982 .{ .kind = .id_ref, .quantifier = .required },
17983 .{ .kind = .id_ref, .quantifier = .required },
17984 },
17985 },
17986 .{
17987 .name = "DebugTypeBasic",
17988 .opcode = 2,
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 = "DebugTypePointer",
17998 .opcode = 3,
17999 .operands = &.{
18000 .{ .kind = .id_ref, .quantifier = .required },
18001 .{ .kind = .id_ref, .quantifier = .required },
18002 .{ .kind = .id_ref, .quantifier = .required },
18003 },
18004 },
18005 .{
18006 .name = "DebugTypeQualifier",
18007 .opcode = 4,
18008 .operands = &.{
18009 .{ .kind = .id_ref, .quantifier = .required },
18010 .{ .kind = .id_ref, .quantifier = .required },
18011 },
18012 },
18013 .{
18014 .name = "DebugTypeArray",
18015 .opcode = 5,
18016 .operands = &.{
18017 .{ .kind = .id_ref, .quantifier = .required },
18018 .{ .kind = .id_ref, .quantifier = .variadic },
18019 },
18020 },
18021 .{
18022 .name = "DebugTypeVector",
18023 .opcode = 6,
18024 .operands = &.{
18025 .{ .kind = .id_ref, .quantifier = .required },
18026 .{ .kind = .id_ref, .quantifier = .required },
18027 },
18028 },
18029 .{
18030 .name = "DebugTypedef",
18031 .opcode = 7,
18032 .operands = &.{
18033 .{ .kind = .id_ref, .quantifier = .required },
18034 .{ .kind = .id_ref, .quantifier = .required },
18035 .{ .kind = .id_ref, .quantifier = .required },
18036 .{ .kind = .id_ref, .quantifier = .required },
18037 .{ .kind = .id_ref, .quantifier = .required },
18038 .{ .kind = .id_ref, .quantifier = .required },
18039 },
18040 },
18041 .{
18042 .name = "DebugTypeFunction",
18043 .opcode = 8,
18044 .operands = &.{
18045 .{ .kind = .id_ref, .quantifier = .required },
18046 .{ .kind = .id_ref, .quantifier = .required },
18047 .{ .kind = .id_ref, .quantifier = .variadic },
18048 },
18049 },
18050 .{
18051 .name = "DebugTypeEnum",
18052 .opcode = 9,
18053 .operands = &.{
18054 .{ .kind = .id_ref, .quantifier = .required },
18055 .{ .kind = .id_ref, .quantifier = .required },
18056 .{ .kind = .id_ref, .quantifier = .required },
18057 .{ .kind = .id_ref, .quantifier = .required },
18058 .{ .kind = .id_ref, .quantifier = .required },
18059 .{ .kind = .id_ref, .quantifier = .required },
18060 .{ .kind = .id_ref, .quantifier = .required },
18061 .{ .kind = .id_ref, .quantifier = .required },
18062 .{ .kind = .pair_id_ref_id_ref, .quantifier = .variadic },
18063 },
18064 },
18065 .{
18066 .name = "DebugTypeComposite",
18067 .opcode = 10,
18068 .operands = &.{
18069 .{ .kind = .id_ref, .quantifier = .required },
18070 .{ .kind = .id_ref, .quantifier = .required },
18071 .{ .kind = .id_ref, .quantifier = .required },
18072 .{ .kind = .id_ref, .quantifier = .required },
18073 .{ .kind = .id_ref, .quantifier = .required },
18074 .{ .kind = .id_ref, .quantifier = .required },
18075 .{ .kind = .id_ref, .quantifier = .required },
18076 .{ .kind = .id_ref, .quantifier = .required },
18077 .{ .kind = .id_ref, .quantifier = .required },
18078 .{ .kind = .id_ref, .quantifier = .variadic },
18079 },
18080 },
18081 .{
18082 .name = "DebugTypeMember",
18083 .opcode = 11,
18084 .operands = &.{
18085 .{ .kind = .id_ref, .quantifier = .required },
18086 .{ .kind = .id_ref, .quantifier = .required },
18087 .{ .kind = .id_ref, .quantifier = .required },
18088 .{ .kind = .id_ref, .quantifier = .required },
18089 .{ .kind = .id_ref, .quantifier = .required },
18090 .{ .kind = .id_ref, .quantifier = .required },
18091 .{ .kind = .id_ref, .quantifier = .required },
18092 .{ .kind = .id_ref, .quantifier = .required },
18093 .{ .kind = .id_ref, .quantifier = .optional },
18094 },
18095 },
18096 .{
18097 .name = "DebugTypeInheritance",
18098 .opcode = 12,
18099 .operands = &.{
18100 .{ .kind = .id_ref, .quantifier = .required },
18101 .{ .kind = .id_ref, .quantifier = .required },
18102 .{ .kind = .id_ref, .quantifier = .required },
18103 .{ .kind = .id_ref, .quantifier = .required },
18104 },
18105 },
18106 .{
18107 .name = "DebugTypePtrToMember",
18108 .opcode = 13,
18109 .operands = &.{
18110 .{ .kind = .id_ref, .quantifier = .required },
18111 .{ .kind = .id_ref, .quantifier = .required },
18112 },
18113 },
18114 .{
18115 .name = "DebugTypeTemplate",
18116 .opcode = 14,
18117 .operands = &.{
18118 .{ .kind = .id_ref, .quantifier = .required },
18119 .{ .kind = .id_ref, .quantifier = .variadic },
18120 },
18121 },
18122 .{
18123 .name = "DebugTypeTemplateParameter",
18124 .opcode = 15,
18125 .operands = &.{
18126 .{ .kind = .id_ref, .quantifier = .required },
18127 .{ .kind = .id_ref, .quantifier = .required },
18128 .{ .kind = .id_ref, .quantifier = .required },
18129 .{ .kind = .id_ref, .quantifier = .required },
18130 .{ .kind = .id_ref, .quantifier = .required },
18131 .{ .kind = .id_ref, .quantifier = .required },
18132 },
18133 },
18134 .{
18135 .name = "DebugTypeTemplateTemplateParameter",
18136 .opcode = 16,
18137 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
18143 },
18144 },
18145 .{
18146 .name = "DebugTypeTemplateParameterPack",
18147 .opcode = 17,
18148 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .variadic },
18154 },
18155 },
18156 .{
18157 .name = "DebugGlobalVariable",
18158 .opcode = 18,
18159 .operands = &.{
18160 .{ .kind = .id_ref, .quantifier = .required },
18161 .{ .kind = .id_ref, .quantifier = .required },
18162 .{ .kind = .id_ref, .quantifier = .required },
18163 .{ .kind = .id_ref, .quantifier = .required },
18164 .{ .kind = .id_ref, .quantifier = .required },
18165 .{ .kind = .id_ref, .quantifier = .required },
18166 .{ .kind = .id_ref, .quantifier = .required },
18167 .{ .kind = .id_ref, .quantifier = .required },
18168 .{ .kind = .id_ref, .quantifier = .required },
18169 .{ .kind = .id_ref, .quantifier = .optional },
18170 },
18171 },
18172 .{
18173 .name = "DebugFunctionDeclaration",
18174 .opcode = 19,
18175 .operands = &.{
18176 .{ .kind = .id_ref, .quantifier = .required },
18177 .{ .kind = .id_ref, .quantifier = .required },
18178 .{ .kind = .id_ref, .quantifier = .required },
18179 .{ .kind = .id_ref, .quantifier = .required },
18180 .{ .kind = .id_ref, .quantifier = .required },
18181 .{ .kind = .id_ref, .quantifier = .required },
18182 .{ .kind = .id_ref, .quantifier = .required },
18183 .{ .kind = .id_ref, .quantifier = .required },
18184 },
18185 },
18186 .{
18187 .name = "DebugFunction",
18188 .opcode = 20,
18189 .operands = &.{
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 .{ .kind = .id_ref, .quantifier = .required },
18195 .{ .kind = .id_ref, .quantifier = .required },
18196 .{ .kind = .id_ref, .quantifier = .required },
18197 .{ .kind = .id_ref, .quantifier = .required },
18198 .{ .kind = .id_ref, .quantifier = .required },
18199 .{ .kind = .id_ref, .quantifier = .optional },
18200 },
18201 },
18202 .{
18203 .name = "DebugLexicalBlock",
18204 .opcode = 21,
18205 .operands = &.{
18206 .{ .kind = .id_ref, .quantifier = .required },
18207 .{ .kind = .id_ref, .quantifier = .required },
18208 .{ .kind = .id_ref, .quantifier = .required },
18209 .{ .kind = .id_ref, .quantifier = .required },
18210 .{ .kind = .id_ref, .quantifier = .optional },
18211 },
18212 },
18213 .{
18214 .name = "DebugLexicalBlockDiscriminator",
18215 .opcode = 22,
18216 .operands = &.{
18217 .{ .kind = .id_ref, .quantifier = .required },
18218 .{ .kind = .id_ref, .quantifier = .required },
18219 .{ .kind = .id_ref, .quantifier = .required },
18220 },
18221 },
18222 .{
18223 .name = "DebugScope",
18224 .opcode = 23,
18225 .operands = &.{
18226 .{ .kind = .id_ref, .quantifier = .required },
18227 .{ .kind = .id_ref, .quantifier = .optional },
18228 },
18229 },
18230 .{
18231 .name = "DebugNoScope",
18232 .opcode = 24,
18233 .operands = &.{},
18234 },
18235 .{
18236 .name = "DebugInlinedAt",
18237 .opcode = 25,
18238 .operands = &.{
18239 .{ .kind = .id_ref, .quantifier = .required },
18240 .{ .kind = .id_ref, .quantifier = .required },
18241 .{ .kind = .id_ref, .quantifier = .optional },
18242 },
18243 },
18244 .{
18245 .name = "DebugLocalVariable",
18246 .opcode = 26,
18247 .operands = &.{
18248 .{ .kind = .id_ref, .quantifier = .required },
18249 .{ .kind = .id_ref, .quantifier = .required },
18250 .{ .kind = .id_ref, .quantifier = .required },
18251 .{ .kind = .id_ref, .quantifier = .required },
18252 .{ .kind = .id_ref, .quantifier = .required },
18253 .{ .kind = .id_ref, .quantifier = .required },
18254 .{ .kind = .id_ref, .quantifier = .required },
18255 .{ .kind = .id_ref, .quantifier = .optional },
18256 },
18257 },
18258 .{
18259 .name = "DebugInlinedVariable",
18260 .opcode = 27,
18261 .operands = &.{
18262 .{ .kind = .id_ref, .quantifier = .required },
18263 .{ .kind = .id_ref, .quantifier = .required },
18264 },
18265 },
18266 .{
18267 .name = "DebugDeclare",
18268 .opcode = 28,
18269 .operands = &.{
18270 .{ .kind = .id_ref, .quantifier = .required },
18271 .{ .kind = .id_ref, .quantifier = .required },
18272 .{ .kind = .id_ref, .quantifier = .required },
18273 .{ .kind = .id_ref, .quantifier = .variadic },
18274 },
18275 },
18276 .{
18277 .name = "DebugValue",
18278 .opcode = 29,
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 = "DebugOperation",
18288 .opcode = 30,
18289 .operands = &.{
18290 .{ .kind = .id_ref, .quantifier = .required },
18291 .{ .kind = .id_ref, .quantifier = .variadic },
18292 },
18293 },
18294 .{
18295 .name = "DebugExpression",
18296 .opcode = 31,
18297 .operands = &.{
18298 .{ .kind = .id_ref, .quantifier = .variadic },
18299 },
18300 },
18301 .{
18302 .name = "DebugMacroDef",
18303 .opcode = 32,
18304 .operands = &.{
18305 .{ .kind = .id_ref, .quantifier = .required },
18306 .{ .kind = .id_ref, .quantifier = .required },
18307 .{ .kind = .id_ref, .quantifier = .required },
18308 .{ .kind = .id_ref, .quantifier = .optional },
18309 },
18310 },
18311 .{
18312 .name = "DebugMacroUndef",
18313 .opcode = 33,
18314 .operands = &.{
18315 .{ .kind = .id_ref, .quantifier = .required },
18316 .{ .kind = .id_ref, .quantifier = .required },
18317 .{ .kind = .id_ref, .quantifier = .required },
18318 },
18319 },
18320 .{
18321 .name = "DebugImportedEntity",
18322 .opcode = 34,
18323 .operands = &.{
18324 .{ .kind = .id_ref, .quantifier = .required },
18325 .{ .kind = .id_ref, .quantifier = .required },
18326 .{ .kind = .id_ref, .quantifier = .required },
18327 .{ .kind = .id_ref, .quantifier = .required },
18328 .{ .kind = .id_ref, .quantifier = .required },
18329 .{ .kind = .id_ref, .quantifier = .required },
18330 .{ .kind = .id_ref, .quantifier = .required },
18331 },
18332 },
18333 .{
18334 .name = "DebugSource",
18335 .opcode = 35,
18336 .operands = &.{
18337 .{ .kind = .id_ref, .quantifier = .required },
18338 .{ .kind = .id_ref, .quantifier = .optional },
18339 },
18340 },
18341 .{
18342 .name = "DebugFunctionDefinition",
18343 .opcode = 101,
18344 .operands = &.{
18345 .{ .kind = .id_ref, .quantifier = .required },
18346 .{ .kind = .id_ref, .quantifier = .required },
18347 },
18348 },
18349 .{
18350 .name = "DebugSourceContinued",
18351 .opcode = 102,
18352 .operands = &.{
18353 .{ .kind = .id_ref, .quantifier = .required },
18354 },
18355 },
18356 .{
18357 .name = "DebugLine",
18358 .opcode = 103,
18359 .operands = &.{
18360 .{ .kind = .id_ref, .quantifier = .required },
18361 .{ .kind = .id_ref, .quantifier = .required },
18362 .{ .kind = .id_ref, .quantifier = .required },
18363 .{ .kind = .id_ref, .quantifier = .required },
18364 .{ .kind = .id_ref, .quantifier = .required },
18365 },
18366 },
18367 .{
18368 .name = "DebugNoLine",
18369 .opcode = 104,
18370 .operands = &.{},
18371 },
18372 .{
18373 .name = "DebugBuildIdentifier",
18374 .opcode = 105,
18375 .operands = &.{
18376 .{ .kind = .id_ref, .quantifier = .required },
18377 .{ .kind = .id_ref, .quantifier = .required },
18378 },
18379 },
18380 .{
18381 .name = "DebugStoragePath",
18382 .opcode = 106,
18383 .operands = &.{
18384 .{ .kind = .id_ref, .quantifier = .required },
18385 },
18386 },
18387 .{
18388 .name = "DebugEntryPoint",
18389 .opcode = 107,
18390 .operands = &.{
18391 .{ .kind = .id_ref, .quantifier = .required },
18392 .{ .kind = .id_ref, .quantifier = .required },
18393 .{ .kind = .id_ref, .quantifier = .required },
18394 .{ .kind = .id_ref, .quantifier = .required },
18395 },
18396 },
18397 .{
18398 .name = "DebugTypeMatrix",
18399 .opcode = 108,
18400 .operands = &.{
18401 .{ .kind = .id_ref, .quantifier = .required },
18402 .{ .kind = .id_ref, .quantifier = .required },
18403 .{ .kind = .id_ref, .quantifier = .required },
18404 },
18405 },
18406 },
18407 .zig => &.{
18408 .{
18409 .name = "InvocationGlobal",
18410 .opcode = 0,
18411 .operands = &.{
18412 .{ .kind = .id_ref, .quantifier = .required },
18413 },
18414 },
18415 },
18416 };
18417 }
18418};
src/dev.zig+1
......@@ -191,6 +191,7 @@ pub const Env = enum {
191191 .spirv => switch (feature) {
192192 .spirv_backend,
193193 .spirv_linker,
194 .legalize,
194195 => true,
195196 else => Env.sema.supports(feature),
196197 },
src/link/SpirV.zig+82-65
......@@ -1,62 +1,36 @@
1//! SPIR-V Spec documentation: https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html
2//! According to above documentation, a SPIR-V module has the following logical layout:
3//! Header.
4//! OpCapability instructions.
5//! OpExtension instructions.
6//! OpExtInstImport instructions.
7//! A single OpMemoryModel instruction.
8//! All entry points, declared with OpEntryPoint instructions.
9//! All execution-mode declarators; OpExecutionMode and OpExecutionModeId instructions.
10//! Debug instructions:
11//! - First, OpString, OpSourceExtension, OpSource, OpSourceContinued (no forward references).
12//! - OpName and OpMemberName instructions.
13//! - OpModuleProcessed instructions.
14//! All annotation (decoration) instructions.
15//! All type declaration instructions, constant instructions, global variable declarations, (preferably) OpUndef instructions.
16//! All function declarations without a body (extern functions presumably).
17//! All regular functions.
18
19// Because SPIR-V requires re-compilation anyway, and so hot swapping will not work
20// anyway, we simply generate all the code in flush. This keeps
21// things considerably simpler.
22
23const SpirV = @This();
24
251const std = @import("std");
262const Allocator = std.mem.Allocator;
3const Path = std.Build.Cache.Path;
274const assert = std.debug.assert;
285const log = std.log.scoped(.link);
29const Path = std.Build.Cache.Path;
306
317const Zcu = @import("../Zcu.zig");
328const InternPool = @import("../InternPool.zig");
339const Compilation = @import("../Compilation.zig");
3410const link = @import("../link.zig");
35const codegen = @import("../codegen/spirv.zig");
36const trace = @import("../tracy.zig").trace;
37const build_options = @import("build_options");
3811const Air = @import("../Air.zig");
3912const Type = @import("../Type.zig");
40const Value = @import("../Value.zig");
13const BinaryModule = @import("SpirV/BinaryModule.zig");
14const CodeGen = @import("../arch/spirv/CodeGen.zig");
15const SpvModule = @import("../arch/spirv/Module.zig");
16const Section = @import("../arch/spirv/Section.zig");
17const trace = @import("../tracy.zig").trace;
4118
42const SpvModule = @import("../codegen/spirv/Module.zig");
43const Section = @import("../codegen/spirv/Section.zig");
44const spec = @import("../codegen/spirv/spec.zig");
19const spec = @import("../arch/spirv/spec.zig");
4520const Id = spec.Id;
4621const Word = spec.Word;
4722
48const BinaryModule = @import("SpirV/BinaryModule.zig");
23const Linker = @This();
4924
5025base: link.File,
51
52object: codegen.Object,
26module: SpvModule,
5327
5428pub fn createEmpty(
5529 arena: Allocator,
5630 comp: *Compilation,
5731 emit: Path,
5832 options: link.File.OpenOptions,
59) !*SpirV {
33) !*Linker {
6034 const gpa = comp.gpa;
6135 const target = &comp.root_mod.resolved_target.result;
6236
......@@ -72,7 +46,7 @@ pub fn createEmpty(
7246 else => unreachable, // Caught by Compilation.Config.resolve.
7347 }
7448
75 const self = try arena.create(SpirV);
49 const self = try arena.create(Linker);
7650 self.* = .{
7751 .base = .{
7852 .tag = .spirv,
......@@ -85,11 +59,10 @@ pub fn createEmpty(
8559 .file = null,
8660 .build_id = options.build_id,
8761 },
88 .object = codegen.Object.init(gpa, comp.getTarget()),
62 .module = .{ .gpa = gpa, .target = comp.getTarget() },
8963 };
9064 errdefer self.deinit();
9165
92 // TODO: read the file and keep valid parts instead of truncating
9366 self.base.file = try emit.root_dir.handle.createFile(emit.sub_path, .{
9467 .truncate = true,
9568 .read = true,
......@@ -103,27 +76,77 @@ pub fn open(
10376 comp: *Compilation,
10477 emit: Path,
10578 options: link.File.OpenOptions,
106) !*SpirV {
79) !*Linker {
10780 return createEmpty(arena, comp, emit, options);
10881}
10982
110pub fn deinit(self: *SpirV) void {
111 self.object.deinit();
83pub fn deinit(self: *Linker) void {
84 self.module.deinit();
11285}
11386
114pub fn updateNav(self: *SpirV, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {
115 if (build_options.skip_non_native) {
116 @panic("Attempted to compile for architecture that was disabled by build configuration");
117 }
87fn genNav(
88 self: *Linker,
89 pt: Zcu.PerThread,
90 nav_index: InternPool.Nav.Index,
91 air: Air,
92 liveness: Air.Liveness,
93 do_codegen: bool,
94) !void {
95 const zcu = pt.zcu;
96 const gpa = zcu.gpa;
97 const structured_cfg = zcu.navFileScope(nav_index).mod.?.structured_cfg;
98
99 var nav_gen: CodeGen = .{
100 .pt = pt,
101 .module = &self.module,
102 .owner_nav = nav_index,
103 .air = air,
104 .liveness = liveness,
105 .control_flow = switch (structured_cfg) {
106 true => .{ .structured = .{} },
107 false => .{ .unstructured = .{} },
108 },
109 .base_line = zcu.navSrcLine(nav_index),
110 };
111 defer nav_gen.deinit();
118112
113 nav_gen.genNav(do_codegen) catch |err| switch (err) {
114 error.CodegenFail => switch (zcu.codegenFailMsg(nav_index, nav_gen.error_msg.?)) {
115 error.CodegenFail => {},
116 error.OutOfMemory => |e| return e,
117 },
118 else => |other| {
119 // There might be an error that happened *after* self.error_msg
120 // was already allocated, so be sure to free it.
121 if (nav_gen.error_msg) |error_msg| {
122 error_msg.deinit(gpa);
123 }
124
125 return other;
126 },
127 };
128}
129
130pub fn updateFunc(
131 self: *Linker,
132 pt: Zcu.PerThread,
133 func_index: InternPool.Index,
134 air: *const Air,
135 liveness: *const ?Air.Liveness,
136) !void {
137 const nav = pt.zcu.funcInfo(func_index).owner_nav;
138 // TODO: Separate types for generating decls and functions?
139 try self.genNav(pt, nav, air.*, liveness.*.?, true);
140}
141
142pub fn updateNav(self: *Linker, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {
119143 const ip = &pt.zcu.intern_pool;
120144 log.debug("lowering nav {f}({d})", .{ ip.getNav(nav).fqn.fmt(ip), nav });
121
122 try self.object.updateNav(pt, nav);
145 try self.genNav(pt, nav, undefined, undefined, false);
123146}
124147
125148pub fn updateExports(
126 self: *SpirV,
149 self: *Linker,
127150 pt: Zcu.PerThread,
128151 exported: Zcu.Exported,
129152 export_indices: []const Zcu.Export.Index,
......@@ -134,13 +157,13 @@ pub fn updateExports(
134157 .nav => |nav| nav,
135158 .uav => |uav| {
136159 _ = uav;
137 @panic("TODO: implement SpirV linker code for exporting a constant value");
160 @panic("TODO: implement Linker linker code for exporting a constant value");
138161 },
139162 };
140163 const nav_ty = ip.getNav(nav_index).typeOf(ip);
141164 const target = zcu.getTarget();
142165 if (ip.isFunctionType(nav_ty)) {
143 const spv_decl_index = try self.object.resolveNav(zcu, nav_index);
166 const spv_decl_index = try self.module.resolveNav(ip, nav_index);
144167 const cc = Type.fromInterned(nav_ty).fnCallingConvention(zcu);
145168 const exec_model: spec.ExecutionModel = switch (target.os.tag) {
146169 .vulkan, .opengl => switch (cc) {
......@@ -162,7 +185,7 @@ pub fn updateExports(
162185
163186 for (export_indices) |export_idx| {
164187 const exp = export_idx.ptr(zcu);
165 try self.object.spv.declareEntryPoint(
188 try self.module.declareEntryPoint(
166189 spv_decl_index,
167190 exp.opts.name.toSlice(ip),
168191 exec_model,
......@@ -175,7 +198,7 @@ pub fn updateExports(
175198}
176199
177200pub fn flush(
178 self: *SpirV,
201 self: *Linker,
179202 arena: Allocator,
180203 tid: Zcu.PerThread.Id,
181204 prog_node: std.Progress.Node,
......@@ -185,10 +208,6 @@ pub fn flush(
185208 // InternPool.
186209 _ = tid;
187210
188 if (build_options.skip_non_native) {
189 @panic("Attempted to compile for architecture that was disabled by build configuration");
190 }
191
192211 const tracy = trace(@src());
193212 defer tracy.end();
194213
......@@ -196,14 +215,13 @@ pub fn flush(
196215 defer sub_prog_node.end();
197216
198217 const comp = self.base.comp;
199 const spv = &self.object.spv;
200218 const diags = &comp.link_diags;
201219 const gpa = comp.gpa;
202220
203221 // We need to export the list of error names somewhere so that we can pretty-print them in the
204222 // executor. This is not really an important thing though, so we can just dump it in any old
205223 // nonsemantic instruction. For now, just put it in OpSourceExtension with a special name.
206 var error_info: std.io.Writer.Allocating = .init(self.object.gpa);
224 var error_info: std.io.Writer.Allocating = .init(self.module.gpa);
207225 defer error_info.deinit();
208226
209227 error_info.writer.writeAll("zig_errors:") catch return error.OutOfMemory;
......@@ -213,7 +231,6 @@ pub fn flush(
213231 // them somehow. Easiest here is to use some established scheme, one which also preseves the
214232 // name if it contains no strange characters is nice for debugging. URI encoding fits the bill.
215233 // We're using : as separator, which is a reserved character.
216
217234 error_info.writer.writeByte(':') catch return error.OutOfMemory;
218235 std.Uri.Component.percentEncode(
219236 &error_info.writer,
......@@ -228,11 +245,11 @@ pub fn flush(
228245 }.isValidChar,
229246 ) catch return error.OutOfMemory;
230247 }
231 try spv.sections.debug_strings.emit(gpa, .OpSourceExtension, .{
248 try self.module.sections.debug_strings.emit(gpa, .OpSourceExtension, .{
232249 .extension = error_info.getWritten(),
233250 });
234251
235 const module = try spv.finalize(arena);
252 const module = try self.module.finalize(arena);
236253 errdefer arena.free(module);
237254
238255 const linked_module = self.linkModule(arena, module, sub_prog_node) catch |err| switch (err) {
......@@ -244,14 +261,14 @@ pub fn flush(
244261 return diags.fail("failed to write: {s}", .{@errorName(err)});
245262}
246263
247fn linkModule(self: *SpirV, a: Allocator, module: []Word, progress: std.Progress.Node) ![]Word {
264fn linkModule(self: *Linker, arena: Allocator, module: []Word, progress: std.Progress.Node) ![]Word {
248265 _ = self;
249266
250267 const lower_invocation_globals = @import("SpirV/lower_invocation_globals.zig");
251268 const prune_unused = @import("SpirV/prune_unused.zig");
252269 const dedup = @import("SpirV/deduplicate.zig");
253270
254 var parser = try BinaryModule.Parser.init(a);
271 var parser = try BinaryModule.Parser.init(arena);
255272 defer parser.deinit();
256273 var binary = try parser.parse(module);
257274
......@@ -259,5 +276,5 @@ fn linkModule(self: *SpirV, a: Allocator, module: []Word, progress: std.Progress
259276 try prune_unused.run(&parser, &binary, progress);
260277 try dedup.run(&parser, &binary, progress);
261278
262 return binary.finalize(a);
279 return binary.finalize(arena);
263280}
src/link/SpirV/BinaryModule.zig+1-1
......@@ -3,7 +3,7 @@ const assert = std.debug.assert;
33const Allocator = std.mem.Allocator;
44const log = std.log.scoped(.spirv_parse);
55
6const spec = @import("../../codegen/spirv/spec.zig");
6const spec = @import("../../arch/spirv/spec.zig");
77const Opcode = spec.Opcode;
88const Word = spec.Word;
99const InstructionSet = spec.InstructionSet;
src/link/SpirV/deduplicate.zig+2-2
......@@ -4,8 +4,8 @@ const log = std.log.scoped(.spirv_link);
44const assert = std.debug.assert;
55
66const BinaryModule = @import("BinaryModule.zig");
7const Section = @import("../../codegen/spirv/Section.zig");
8const spec = @import("../../codegen/spirv/spec.zig");
7const Section = @import("../../arch/spirv/Section.zig");
8const spec = @import("../../arch/spirv/spec.zig");
99const Opcode = spec.Opcode;
1010const ResultId = spec.Id;
1111const Word = spec.Word;
src/link/SpirV/lower_invocation_globals.zig+2-2
......@@ -4,8 +4,8 @@ const assert = std.debug.assert;
44const log = std.log.scoped(.spirv_link);
55
66const BinaryModule = @import("BinaryModule.zig");
7const Section = @import("../../codegen/spirv/Section.zig");
8const spec = @import("../../codegen/spirv/spec.zig");
7const Section = @import("../../arch/spirv/Section.zig");
8const spec = @import("../../arch/spirv/spec.zig");
99const ResultId = spec.Id;
1010const Word = spec.Word;
1111
src/link/SpirV/prune_unused.zig+2-2
......@@ -12,8 +12,8 @@ const assert = std.debug.assert;
1212const log = std.log.scoped(.spirv_link);
1313
1414const BinaryModule = @import("BinaryModule.zig");
15const Section = @import("../../codegen/spirv/Section.zig");
16const spec = @import("../../codegen/spirv/spec.zig");
15const Section = @import("../../arch/spirv/Section.zig");
16const spec = @import("../../arch/spirv/spec.zig");
1717const Opcode = spec.Opcode;
1818const ResultId = spec.Id;
1919const Word = spec.Word;
test/behavior/packed-union.zig+1
......@@ -140,6 +140,7 @@ test "packed union initialized with a runtime value" {
140140 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
141141 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
142142 if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
143 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
143144
144145 const Fields = packed struct {
145146 timestamp: u50,
test/behavior/slice.zig+2
......@@ -1036,6 +1036,8 @@ test "sentinel-terminated 0-length slices" {
10361036}
10371037
10381038test "peer slices keep abi alignment with empty struct" {
1039 if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
1040
10391041 var cond: bool = undefined;
10401042 cond = false;
10411043 const slice = if (cond) &[1]u32{42} else &.{};
tools/gen_spirv_spec.zig+12-2
......@@ -221,6 +221,16 @@ fn render(writer: *std.io.Writer, registry: CoreRegistry, extensions: []const Ex
221221 \\ }
222222 \\};
223223 \\
224 \\pub const IdRange = struct {
225 \\ base: u32,
226 \\ len: u32,
227 \\
228 \\ pub fn at(range: IdRange, i: usize) Id {
229 \\ std.debug.assert(i < range.len);
230 \\ return @enumFromInt(range.base + i);
231 \\ }
232 \\};
233 \\
224234 \\pub const LiteralInteger = Word;
225235 \\pub const LiteralFloat = Word;
226236 \\pub const LiteralString = []const u8;
......@@ -324,7 +334,7 @@ fn renderInstructionSet(
324334 );
325335
326336 for (extensions) |ext| {
327 try writer.print("{f},\n", .{formatId(ext.name)});
337 try writer.print("{f},\n", .{std.zig.fmtId(ext.name)});
328338 }
329339
330340 try writer.writeAll(
......@@ -357,7 +367,7 @@ fn renderInstructionsCase(
357367 // but there aren't so many total aliases and that would add more overhead in total. We will
358368 // just filter those out when needed.
359369
360 try writer.print(".{f} => &.{{\n", .{formatId(set_name)});
370 try writer.print(".{f} => &.{{\n", .{std.zig.fmtId(set_name)});
361371
362372 for (instructions) |inst| {
363373 try writer.print(