• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by gen_spirv_builder_and_parser.py using data from spirv.core.grammar.json.
3 //
4 // Copyright 2021 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // spirv_instruction_parser_autogen.cpp:
9 //   Functions to parse SPIR-V binary for each instruction.
10 
11 #include "spirv_instruction_parser_autogen.h"
12 
13 #include <string.h>
14 
15 #include "common/debug.h"
16 
17 namespace angle
18 {
19 namespace spirv
20 {
21 
GetInstructionOpAndLength(const uint32_t * _instruction,spv::Op * opOut,uint32_t * lengthOut)22 void GetInstructionOpAndLength(const uint32_t *_instruction, spv::Op *opOut, uint32_t *lengthOut)
23 {
24     constexpr uint32_t kOpMask = 0xFFFFu;
25     *opOut                     = static_cast<spv::Op>(_instruction[0] & kOpMask);
26     *lengthOut                 = _instruction[0] >> 16;
27 }
ParseUndef(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)28 void ParseUndef(const uint32_t *_instruction, IdResultType *idResultType, IdResult *idResult)
29 {
30     spv::Op _op;
31     uint32_t _length;
32     GetInstructionOpAndLength(_instruction, &_op, &_length);
33     ASSERT(_op == spv::OpUndef);
34     uint32_t _o   = 1;
35     *idResultType = IdResultType(_instruction[_o++]);
36     *idResult     = IdResult(_instruction[_o++]);
37 }
ParseSourceContinued(const uint32_t * _instruction,LiteralString * continuedSource)38 void ParseSourceContinued(const uint32_t *_instruction, LiteralString *continuedSource)
39 {
40     spv::Op _op;
41     uint32_t _length;
42     GetInstructionOpAndLength(_instruction, &_op, &_length);
43     ASSERT(_op == spv::OpSourceContinued);
44     uint32_t _o = 1;
45     ASSERT(IsLittleEndian());
46     *continuedSource = reinterpret_cast<const char *>(&_instruction[_o]);
47     _o += strlen(*continuedSource) / 4 + 1;
48 }
ParseSource(const uint32_t * _instruction,spv::SourceLanguage * sourceLanguage,LiteralInteger * version,IdRef * file,LiteralString * source)49 void ParseSource(const uint32_t *_instruction,
50                  spv::SourceLanguage *sourceLanguage,
51                  LiteralInteger *version,
52                  IdRef *file,
53                  LiteralString *source)
54 {
55     spv::Op _op;
56     uint32_t _length;
57     GetInstructionOpAndLength(_instruction, &_op, &_length);
58     ASSERT(_op == spv::OpSource);
59     uint32_t _o     = 1;
60     *sourceLanguage = spv::SourceLanguage(_instruction[_o++]);
61     *version        = LiteralInteger(_instruction[_o++]);
62     if (file && _o < _length)
63     {
64         *file = IdRef(_instruction[_o++]);
65     }
66     if (source && _o < _length)
67     {
68         ASSERT(IsLittleEndian());
69         *source = reinterpret_cast<const char *>(&_instruction[_o]);
70         _o += strlen(*source) / 4 + 1;
71     }
72 }
ParseSourceExtension(const uint32_t * _instruction,LiteralString * extension)73 void ParseSourceExtension(const uint32_t *_instruction, LiteralString *extension)
74 {
75     spv::Op _op;
76     uint32_t _length;
77     GetInstructionOpAndLength(_instruction, &_op, &_length);
78     ASSERT(_op == spv::OpSourceExtension);
79     uint32_t _o = 1;
80     ASSERT(IsLittleEndian());
81     *extension = reinterpret_cast<const char *>(&_instruction[_o]);
82     _o += strlen(*extension) / 4 + 1;
83 }
ParseName(const uint32_t * _instruction,IdRef * target,LiteralString * name)84 void ParseName(const uint32_t *_instruction, IdRef *target, LiteralString *name)
85 {
86     spv::Op _op;
87     uint32_t _length;
88     GetInstructionOpAndLength(_instruction, &_op, &_length);
89     ASSERT(_op == spv::OpName);
90     uint32_t _o = 1;
91     *target     = IdRef(_instruction[_o++]);
92     ASSERT(IsLittleEndian());
93     *name = reinterpret_cast<const char *>(&_instruction[_o]);
94     _o += strlen(*name) / 4 + 1;
95 }
ParseMemberName(const uint32_t * _instruction,IdRef * type,LiteralInteger * member,LiteralString * name)96 void ParseMemberName(const uint32_t *_instruction,
97                      IdRef *type,
98                      LiteralInteger *member,
99                      LiteralString *name)
100 {
101     spv::Op _op;
102     uint32_t _length;
103     GetInstructionOpAndLength(_instruction, &_op, &_length);
104     ASSERT(_op == spv::OpMemberName);
105     uint32_t _o = 1;
106     *type       = IdRef(_instruction[_o++]);
107     *member     = LiteralInteger(_instruction[_o++]);
108     ASSERT(IsLittleEndian());
109     *name = reinterpret_cast<const char *>(&_instruction[_o]);
110     _o += strlen(*name) / 4 + 1;
111 }
ParseString(const uint32_t * _instruction,IdResult * idResult,LiteralString * string)112 void ParseString(const uint32_t *_instruction, IdResult *idResult, LiteralString *string)
113 {
114     spv::Op _op;
115     uint32_t _length;
116     GetInstructionOpAndLength(_instruction, &_op, &_length);
117     ASSERT(_op == spv::OpString);
118     uint32_t _o = 1;
119     *idResult   = IdResult(_instruction[_o++]);
120     ASSERT(IsLittleEndian());
121     *string = reinterpret_cast<const char *>(&_instruction[_o]);
122     _o += strlen(*string) / 4 + 1;
123 }
ParseLine(const uint32_t * _instruction,IdRef * file,LiteralInteger * line,LiteralInteger * column)124 void ParseLine(const uint32_t *_instruction,
125                IdRef *file,
126                LiteralInteger *line,
127                LiteralInteger *column)
128 {
129     spv::Op _op;
130     uint32_t _length;
131     GetInstructionOpAndLength(_instruction, &_op, &_length);
132     ASSERT(_op == spv::OpLine);
133     uint32_t _o = 1;
134     *file       = IdRef(_instruction[_o++]);
135     *line       = LiteralInteger(_instruction[_o++]);
136     *column     = LiteralInteger(_instruction[_o++]);
137 }
ParseExtension(const uint32_t * _instruction,LiteralString * name)138 void ParseExtension(const uint32_t *_instruction, LiteralString *name)
139 {
140     spv::Op _op;
141     uint32_t _length;
142     GetInstructionOpAndLength(_instruction, &_op, &_length);
143     ASSERT(_op == spv::OpExtension);
144     uint32_t _o = 1;
145     ASSERT(IsLittleEndian());
146     *name = reinterpret_cast<const char *>(&_instruction[_o]);
147     _o += strlen(*name) / 4 + 1;
148 }
ParseExtInstImport(const uint32_t * _instruction,IdResult * idResult,LiteralString * name)149 void ParseExtInstImport(const uint32_t *_instruction, IdResult *idResult, LiteralString *name)
150 {
151     spv::Op _op;
152     uint32_t _length;
153     GetInstructionOpAndLength(_instruction, &_op, &_length);
154     ASSERT(_op == spv::OpExtInstImport);
155     uint32_t _o = 1;
156     *idResult   = IdResult(_instruction[_o++]);
157     ASSERT(IsLittleEndian());
158     *name = reinterpret_cast<const char *>(&_instruction[_o]);
159     _o += strlen(*name) / 4 + 1;
160 }
ParseExtInst(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * set,LiteralExtInstInteger * instruction,IdRefList * operandList)161 void ParseExtInst(const uint32_t *_instruction,
162                   IdResultType *idResultType,
163                   IdResult *idResult,
164                   IdRef *set,
165                   LiteralExtInstInteger *instruction,
166                   IdRefList *operandList)
167 {
168     spv::Op _op;
169     uint32_t _length;
170     GetInstructionOpAndLength(_instruction, &_op, &_length);
171     ASSERT(_op == spv::OpExtInst);
172     uint32_t _o   = 1;
173     *idResultType = IdResultType(_instruction[_o++]);
174     *idResult     = IdResult(_instruction[_o++]);
175     *set          = IdRef(_instruction[_o++]);
176     *instruction  = LiteralExtInstInteger(_instruction[_o++]);
177     if (operandList)
178     {
179         while (_o < _length)
180         {
181             operandList->emplace_back(_instruction[_o++]);
182         }
183     }
184 }
ParseMemoryModel(const uint32_t * _instruction,spv::AddressingModel * addressingModel,spv::MemoryModel * memoryModel)185 void ParseMemoryModel(const uint32_t *_instruction,
186                       spv::AddressingModel *addressingModel,
187                       spv::MemoryModel *memoryModel)
188 {
189     spv::Op _op;
190     uint32_t _length;
191     GetInstructionOpAndLength(_instruction, &_op, &_length);
192     ASSERT(_op == spv::OpMemoryModel);
193     uint32_t _o      = 1;
194     *addressingModel = spv::AddressingModel(_instruction[_o++]);
195     *memoryModel     = spv::MemoryModel(_instruction[_o++]);
196 }
ParseEntryPoint(const uint32_t * _instruction,spv::ExecutionModel * executionModel,IdRef * entryPoint,LiteralString * name,IdRefList * interfaceList)197 void ParseEntryPoint(const uint32_t *_instruction,
198                      spv::ExecutionModel *executionModel,
199                      IdRef *entryPoint,
200                      LiteralString *name,
201                      IdRefList *interfaceList)
202 {
203     spv::Op _op;
204     uint32_t _length;
205     GetInstructionOpAndLength(_instruction, &_op, &_length);
206     ASSERT(_op == spv::OpEntryPoint);
207     uint32_t _o     = 1;
208     *executionModel = spv::ExecutionModel(_instruction[_o++]);
209     *entryPoint     = IdRef(_instruction[_o++]);
210     ASSERT(IsLittleEndian());
211     *name = reinterpret_cast<const char *>(&_instruction[_o]);
212     _o += strlen(*name) / 4 + 1;
213     if (interfaceList)
214     {
215         while (_o < _length)
216         {
217             interfaceList->emplace_back(_instruction[_o++]);
218         }
219     }
220 }
ParseExecutionMode(const uint32_t * _instruction,IdRef * entryPoint,spv::ExecutionMode * mode,LiteralIntegerList * operandsList)221 void ParseExecutionMode(const uint32_t *_instruction,
222                         IdRef *entryPoint,
223                         spv::ExecutionMode *mode,
224                         LiteralIntegerList *operandsList)
225 {
226     spv::Op _op;
227     uint32_t _length;
228     GetInstructionOpAndLength(_instruction, &_op, &_length);
229     ASSERT(_op == spv::OpExecutionMode);
230     uint32_t _o = 1;
231     *entryPoint = IdRef(_instruction[_o++]);
232     *mode       = spv::ExecutionMode(_instruction[_o++]);
233     if (operandsList)
234     {
235         while (_o < _length)
236         {
237             operandsList->emplace_back(_instruction[_o++]);
238         }
239     }
240 }
ParseCapability(const uint32_t * _instruction,spv::Capability * capability)241 void ParseCapability(const uint32_t *_instruction, spv::Capability *capability)
242 {
243     spv::Op _op;
244     uint32_t _length;
245     GetInstructionOpAndLength(_instruction, &_op, &_length);
246     ASSERT(_op == spv::OpCapability);
247     uint32_t _o = 1;
248     *capability = spv::Capability(_instruction[_o++]);
249 }
ParseTypeVoid(const uint32_t * _instruction,IdResult * idResult)250 void ParseTypeVoid(const uint32_t *_instruction, IdResult *idResult)
251 {
252     spv::Op _op;
253     uint32_t _length;
254     GetInstructionOpAndLength(_instruction, &_op, &_length);
255     ASSERT(_op == spv::OpTypeVoid);
256     uint32_t _o = 1;
257     *idResult   = IdResult(_instruction[_o++]);
258 }
ParseTypeBool(const uint32_t * _instruction,IdResult * idResult)259 void ParseTypeBool(const uint32_t *_instruction, IdResult *idResult)
260 {
261     spv::Op _op;
262     uint32_t _length;
263     GetInstructionOpAndLength(_instruction, &_op, &_length);
264     ASSERT(_op == spv::OpTypeBool);
265     uint32_t _o = 1;
266     *idResult   = IdResult(_instruction[_o++]);
267 }
ParseTypeInt(const uint32_t * _instruction,IdResult * idResult,LiteralInteger * width,LiteralInteger * signedness)268 void ParseTypeInt(const uint32_t *_instruction,
269                   IdResult *idResult,
270                   LiteralInteger *width,
271                   LiteralInteger *signedness)
272 {
273     spv::Op _op;
274     uint32_t _length;
275     GetInstructionOpAndLength(_instruction, &_op, &_length);
276     ASSERT(_op == spv::OpTypeInt);
277     uint32_t _o = 1;
278     *idResult   = IdResult(_instruction[_o++]);
279     *width      = LiteralInteger(_instruction[_o++]);
280     *signedness = LiteralInteger(_instruction[_o++]);
281 }
ParseTypeFloat(const uint32_t * _instruction,IdResult * idResult,LiteralInteger * width)282 void ParseTypeFloat(const uint32_t *_instruction, IdResult *idResult, LiteralInteger *width)
283 {
284     spv::Op _op;
285     uint32_t _length;
286     GetInstructionOpAndLength(_instruction, &_op, &_length);
287     ASSERT(_op == spv::OpTypeFloat);
288     uint32_t _o = 1;
289     *idResult   = IdResult(_instruction[_o++]);
290     *width      = LiteralInteger(_instruction[_o++]);
291 }
ParseTypeVector(const uint32_t * _instruction,IdResult * idResult,IdRef * componentType,LiteralInteger * componentCount)292 void ParseTypeVector(const uint32_t *_instruction,
293                      IdResult *idResult,
294                      IdRef *componentType,
295                      LiteralInteger *componentCount)
296 {
297     spv::Op _op;
298     uint32_t _length;
299     GetInstructionOpAndLength(_instruction, &_op, &_length);
300     ASSERT(_op == spv::OpTypeVector);
301     uint32_t _o     = 1;
302     *idResult       = IdResult(_instruction[_o++]);
303     *componentType  = IdRef(_instruction[_o++]);
304     *componentCount = LiteralInteger(_instruction[_o++]);
305 }
ParseTypeMatrix(const uint32_t * _instruction,IdResult * idResult,IdRef * columnType,LiteralInteger * columnCount)306 void ParseTypeMatrix(const uint32_t *_instruction,
307                      IdResult *idResult,
308                      IdRef *columnType,
309                      LiteralInteger *columnCount)
310 {
311     spv::Op _op;
312     uint32_t _length;
313     GetInstructionOpAndLength(_instruction, &_op, &_length);
314     ASSERT(_op == spv::OpTypeMatrix);
315     uint32_t _o  = 1;
316     *idResult    = IdResult(_instruction[_o++]);
317     *columnType  = IdRef(_instruction[_o++]);
318     *columnCount = LiteralInteger(_instruction[_o++]);
319 }
ParseTypeImage(const uint32_t * _instruction,IdResult * idResult,IdRef * sampledType,spv::Dim * dim,LiteralInteger * depth,LiteralInteger * arrayed,LiteralInteger * mS,LiteralInteger * sampled,spv::ImageFormat * imageFormat,spv::AccessQualifier * accessQualifier)320 void ParseTypeImage(const uint32_t *_instruction,
321                     IdResult *idResult,
322                     IdRef *sampledType,
323                     spv::Dim *dim,
324                     LiteralInteger *depth,
325                     LiteralInteger *arrayed,
326                     LiteralInteger *mS,
327                     LiteralInteger *sampled,
328                     spv::ImageFormat *imageFormat,
329                     spv::AccessQualifier *accessQualifier)
330 {
331     spv::Op _op;
332     uint32_t _length;
333     GetInstructionOpAndLength(_instruction, &_op, &_length);
334     ASSERT(_op == spv::OpTypeImage);
335     uint32_t _o  = 1;
336     *idResult    = IdResult(_instruction[_o++]);
337     *sampledType = IdRef(_instruction[_o++]);
338     *dim         = spv::Dim(_instruction[_o++]);
339     *depth       = LiteralInteger(_instruction[_o++]);
340     *arrayed     = LiteralInteger(_instruction[_o++]);
341     *mS          = LiteralInteger(_instruction[_o++]);
342     *sampled     = LiteralInteger(_instruction[_o++]);
343     *imageFormat = spv::ImageFormat(_instruction[_o++]);
344     if (accessQualifier && _o < _length)
345     {
346         *accessQualifier = spv::AccessQualifier(_instruction[_o++]);
347     }
348 }
ParseTypeSampler(const uint32_t * _instruction,IdResult * idResult)349 void ParseTypeSampler(const uint32_t *_instruction, IdResult *idResult)
350 {
351     spv::Op _op;
352     uint32_t _length;
353     GetInstructionOpAndLength(_instruction, &_op, &_length);
354     ASSERT(_op == spv::OpTypeSampler);
355     uint32_t _o = 1;
356     *idResult   = IdResult(_instruction[_o++]);
357 }
ParseTypeSampledImage(const uint32_t * _instruction,IdResult * idResult,IdRef * imageType)358 void ParseTypeSampledImage(const uint32_t *_instruction, IdResult *idResult, IdRef *imageType)
359 {
360     spv::Op _op;
361     uint32_t _length;
362     GetInstructionOpAndLength(_instruction, &_op, &_length);
363     ASSERT(_op == spv::OpTypeSampledImage);
364     uint32_t _o = 1;
365     *idResult   = IdResult(_instruction[_o++]);
366     *imageType  = IdRef(_instruction[_o++]);
367 }
ParseTypeArray(const uint32_t * _instruction,IdResult * idResult,IdRef * elementType,IdRef * length)368 void ParseTypeArray(const uint32_t *_instruction,
369                     IdResult *idResult,
370                     IdRef *elementType,
371                     IdRef *length)
372 {
373     spv::Op _op;
374     uint32_t _length;
375     GetInstructionOpAndLength(_instruction, &_op, &_length);
376     ASSERT(_op == spv::OpTypeArray);
377     uint32_t _o  = 1;
378     *idResult    = IdResult(_instruction[_o++]);
379     *elementType = IdRef(_instruction[_o++]);
380     *length      = IdRef(_instruction[_o++]);
381 }
ParseTypeRuntimeArray(const uint32_t * _instruction,IdResult * idResult,IdRef * elementType)382 void ParseTypeRuntimeArray(const uint32_t *_instruction, IdResult *idResult, IdRef *elementType)
383 {
384     spv::Op _op;
385     uint32_t _length;
386     GetInstructionOpAndLength(_instruction, &_op, &_length);
387     ASSERT(_op == spv::OpTypeRuntimeArray);
388     uint32_t _o  = 1;
389     *idResult    = IdResult(_instruction[_o++]);
390     *elementType = IdRef(_instruction[_o++]);
391 }
ParseTypeStruct(const uint32_t * _instruction,IdResult * idResult,IdRefList * memberList)392 void ParseTypeStruct(const uint32_t *_instruction, IdResult *idResult, IdRefList *memberList)
393 {
394     spv::Op _op;
395     uint32_t _length;
396     GetInstructionOpAndLength(_instruction, &_op, &_length);
397     ASSERT(_op == spv::OpTypeStruct);
398     uint32_t _o = 1;
399     *idResult   = IdResult(_instruction[_o++]);
400     if (memberList)
401     {
402         while (_o < _length)
403         {
404             memberList->emplace_back(_instruction[_o++]);
405         }
406     }
407 }
ParseTypePointer(const uint32_t * _instruction,IdResult * idResult,spv::StorageClass * storageClass,IdRef * type)408 void ParseTypePointer(const uint32_t *_instruction,
409                       IdResult *idResult,
410                       spv::StorageClass *storageClass,
411                       IdRef *type)
412 {
413     spv::Op _op;
414     uint32_t _length;
415     GetInstructionOpAndLength(_instruction, &_op, &_length);
416     ASSERT(_op == spv::OpTypePointer);
417     uint32_t _o   = 1;
418     *idResult     = IdResult(_instruction[_o++]);
419     *storageClass = spv::StorageClass(_instruction[_o++]);
420     *type         = IdRef(_instruction[_o++]);
421 }
ParseTypeFunction(const uint32_t * _instruction,IdResult * idResult,IdRef * returnType,IdRefList * parameterList)422 void ParseTypeFunction(const uint32_t *_instruction,
423                        IdResult *idResult,
424                        IdRef *returnType,
425                        IdRefList *parameterList)
426 {
427     spv::Op _op;
428     uint32_t _length;
429     GetInstructionOpAndLength(_instruction, &_op, &_length);
430     ASSERT(_op == spv::OpTypeFunction);
431     uint32_t _o = 1;
432     *idResult   = IdResult(_instruction[_o++]);
433     *returnType = IdRef(_instruction[_o++]);
434     if (parameterList)
435     {
436         while (_o < _length)
437         {
438             parameterList->emplace_back(_instruction[_o++]);
439         }
440     }
441 }
ParseConstantTrue(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)442 void ParseConstantTrue(const uint32_t *_instruction, IdResultType *idResultType, IdResult *idResult)
443 {
444     spv::Op _op;
445     uint32_t _length;
446     GetInstructionOpAndLength(_instruction, &_op, &_length);
447     ASSERT(_op == spv::OpConstantTrue);
448     uint32_t _o   = 1;
449     *idResultType = IdResultType(_instruction[_o++]);
450     *idResult     = IdResult(_instruction[_o++]);
451 }
ParseConstantFalse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)452 void ParseConstantFalse(const uint32_t *_instruction,
453                         IdResultType *idResultType,
454                         IdResult *idResult)
455 {
456     spv::Op _op;
457     uint32_t _length;
458     GetInstructionOpAndLength(_instruction, &_op, &_length);
459     ASSERT(_op == spv::OpConstantFalse);
460     uint32_t _o   = 1;
461     *idResultType = IdResultType(_instruction[_o++]);
462     *idResult     = IdResult(_instruction[_o++]);
463 }
ParseConstant(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,LiteralContextDependentNumber * value)464 void ParseConstant(const uint32_t *_instruction,
465                    IdResultType *idResultType,
466                    IdResult *idResult,
467                    LiteralContextDependentNumber *value)
468 {
469     spv::Op _op;
470     uint32_t _length;
471     GetInstructionOpAndLength(_instruction, &_op, &_length);
472     ASSERT(_op == spv::OpConstant);
473     uint32_t _o   = 1;
474     *idResultType = IdResultType(_instruction[_o++]);
475     *idResult     = IdResult(_instruction[_o++]);
476     *value        = LiteralContextDependentNumber(_instruction[_o++]);
477 }
ParseConstantComposite(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRefList * constituentsList)478 void ParseConstantComposite(const uint32_t *_instruction,
479                             IdResultType *idResultType,
480                             IdResult *idResult,
481                             IdRefList *constituentsList)
482 {
483     spv::Op _op;
484     uint32_t _length;
485     GetInstructionOpAndLength(_instruction, &_op, &_length);
486     ASSERT(_op == spv::OpConstantComposite);
487     uint32_t _o   = 1;
488     *idResultType = IdResultType(_instruction[_o++]);
489     *idResult     = IdResult(_instruction[_o++]);
490     if (constituentsList)
491     {
492         while (_o < _length)
493         {
494             constituentsList->emplace_back(_instruction[_o++]);
495         }
496     }
497 }
ParseConstantNull(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)498 void ParseConstantNull(const uint32_t *_instruction, IdResultType *idResultType, IdResult *idResult)
499 {
500     spv::Op _op;
501     uint32_t _length;
502     GetInstructionOpAndLength(_instruction, &_op, &_length);
503     ASSERT(_op == spv::OpConstantNull);
504     uint32_t _o   = 1;
505     *idResultType = IdResultType(_instruction[_o++]);
506     *idResult     = IdResult(_instruction[_o++]);
507 }
ParseSpecConstantTrue(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)508 void ParseSpecConstantTrue(const uint32_t *_instruction,
509                            IdResultType *idResultType,
510                            IdResult *idResult)
511 {
512     spv::Op _op;
513     uint32_t _length;
514     GetInstructionOpAndLength(_instruction, &_op, &_length);
515     ASSERT(_op == spv::OpSpecConstantTrue);
516     uint32_t _o   = 1;
517     *idResultType = IdResultType(_instruction[_o++]);
518     *idResult     = IdResult(_instruction[_o++]);
519 }
ParseSpecConstantFalse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)520 void ParseSpecConstantFalse(const uint32_t *_instruction,
521                             IdResultType *idResultType,
522                             IdResult *idResult)
523 {
524     spv::Op _op;
525     uint32_t _length;
526     GetInstructionOpAndLength(_instruction, &_op, &_length);
527     ASSERT(_op == spv::OpSpecConstantFalse);
528     uint32_t _o   = 1;
529     *idResultType = IdResultType(_instruction[_o++]);
530     *idResult     = IdResult(_instruction[_o++]);
531 }
ParseSpecConstant(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,LiteralContextDependentNumber * value)532 void ParseSpecConstant(const uint32_t *_instruction,
533                        IdResultType *idResultType,
534                        IdResult *idResult,
535                        LiteralContextDependentNumber *value)
536 {
537     spv::Op _op;
538     uint32_t _length;
539     GetInstructionOpAndLength(_instruction, &_op, &_length);
540     ASSERT(_op == spv::OpSpecConstant);
541     uint32_t _o   = 1;
542     *idResultType = IdResultType(_instruction[_o++]);
543     *idResult     = IdResult(_instruction[_o++]);
544     *value        = LiteralContextDependentNumber(_instruction[_o++]);
545 }
ParseSpecConstantComposite(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRefList * constituentsList)546 void ParseSpecConstantComposite(const uint32_t *_instruction,
547                                 IdResultType *idResultType,
548                                 IdResult *idResult,
549                                 IdRefList *constituentsList)
550 {
551     spv::Op _op;
552     uint32_t _length;
553     GetInstructionOpAndLength(_instruction, &_op, &_length);
554     ASSERT(_op == spv::OpSpecConstantComposite);
555     uint32_t _o   = 1;
556     *idResultType = IdResultType(_instruction[_o++]);
557     *idResult     = IdResult(_instruction[_o++]);
558     if (constituentsList)
559     {
560         while (_o < _length)
561         {
562             constituentsList->emplace_back(_instruction[_o++]);
563         }
564     }
565 }
ParseFunction(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,spv::FunctionControlMask * functionControl,IdRef * functionType)566 void ParseFunction(const uint32_t *_instruction,
567                    IdResultType *idResultType,
568                    IdResult *idResult,
569                    spv::FunctionControlMask *functionControl,
570                    IdRef *functionType)
571 {
572     spv::Op _op;
573     uint32_t _length;
574     GetInstructionOpAndLength(_instruction, &_op, &_length);
575     ASSERT(_op == spv::OpFunction);
576     uint32_t _o      = 1;
577     *idResultType    = IdResultType(_instruction[_o++]);
578     *idResult        = IdResult(_instruction[_o++]);
579     *functionControl = spv::FunctionControlMask(_instruction[_o++]);
580     *functionType    = IdRef(_instruction[_o++]);
581 }
ParseFunctionParameter(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult)582 void ParseFunctionParameter(const uint32_t *_instruction,
583                             IdResultType *idResultType,
584                             IdResult *idResult)
585 {
586     spv::Op _op;
587     uint32_t _length;
588     GetInstructionOpAndLength(_instruction, &_op, &_length);
589     ASSERT(_op == spv::OpFunctionParameter);
590     uint32_t _o   = 1;
591     *idResultType = IdResultType(_instruction[_o++]);
592     *idResult     = IdResult(_instruction[_o++]);
593 }
ParseFunctionCall(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * function,IdRefList * argumentList)594 void ParseFunctionCall(const uint32_t *_instruction,
595                        IdResultType *idResultType,
596                        IdResult *idResult,
597                        IdRef *function,
598                        IdRefList *argumentList)
599 {
600     spv::Op _op;
601     uint32_t _length;
602     GetInstructionOpAndLength(_instruction, &_op, &_length);
603     ASSERT(_op == spv::OpFunctionCall);
604     uint32_t _o   = 1;
605     *idResultType = IdResultType(_instruction[_o++]);
606     *idResult     = IdResult(_instruction[_o++]);
607     *function     = IdRef(_instruction[_o++]);
608     if (argumentList)
609     {
610         while (_o < _length)
611         {
612             argumentList->emplace_back(_instruction[_o++]);
613         }
614     }
615 }
ParseVariable(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,spv::StorageClass * storageClass,IdRef * initializer)616 void ParseVariable(const uint32_t *_instruction,
617                    IdResultType *idResultType,
618                    IdResult *idResult,
619                    spv::StorageClass *storageClass,
620                    IdRef *initializer)
621 {
622     spv::Op _op;
623     uint32_t _length;
624     GetInstructionOpAndLength(_instruction, &_op, &_length);
625     ASSERT(_op == spv::OpVariable);
626     uint32_t _o   = 1;
627     *idResultType = IdResultType(_instruction[_o++]);
628     *idResult     = IdResult(_instruction[_o++]);
629     *storageClass = spv::StorageClass(_instruction[_o++]);
630     if (initializer && _o < _length)
631     {
632         *initializer = IdRef(_instruction[_o++]);
633     }
634 }
ParseImageTexelPointer(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * coordinate,IdRef * sample)635 void ParseImageTexelPointer(const uint32_t *_instruction,
636                             IdResultType *idResultType,
637                             IdResult *idResult,
638                             IdRef *image,
639                             IdRef *coordinate,
640                             IdRef *sample)
641 {
642     spv::Op _op;
643     uint32_t _length;
644     GetInstructionOpAndLength(_instruction, &_op, &_length);
645     ASSERT(_op == spv::OpImageTexelPointer);
646     uint32_t _o   = 1;
647     *idResultType = IdResultType(_instruction[_o++]);
648     *idResult     = IdResult(_instruction[_o++]);
649     *image        = IdRef(_instruction[_o++]);
650     *coordinate   = IdRef(_instruction[_o++]);
651     *sample       = IdRef(_instruction[_o++]);
652 }
ParseLoad(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,spv::MemoryAccessMask * memoryAccess)653 void ParseLoad(const uint32_t *_instruction,
654                IdResultType *idResultType,
655                IdResult *idResult,
656                IdRef *pointer,
657                spv::MemoryAccessMask *memoryAccess)
658 {
659     spv::Op _op;
660     uint32_t _length;
661     GetInstructionOpAndLength(_instruction, &_op, &_length);
662     ASSERT(_op == spv::OpLoad);
663     uint32_t _o   = 1;
664     *idResultType = IdResultType(_instruction[_o++]);
665     *idResult     = IdResult(_instruction[_o++]);
666     *pointer      = IdRef(_instruction[_o++]);
667     if (memoryAccess && _o < _length)
668     {
669         *memoryAccess = spv::MemoryAccessMask(_instruction[_o++]);
670     }
671 }
ParseStore(const uint32_t * _instruction,IdRef * pointer,IdRef * object,spv::MemoryAccessMask * memoryAccess)672 void ParseStore(const uint32_t *_instruction,
673                 IdRef *pointer,
674                 IdRef *object,
675                 spv::MemoryAccessMask *memoryAccess)
676 {
677     spv::Op _op;
678     uint32_t _length;
679     GetInstructionOpAndLength(_instruction, &_op, &_length);
680     ASSERT(_op == spv::OpStore);
681     uint32_t _o = 1;
682     *pointer    = IdRef(_instruction[_o++]);
683     *object     = IdRef(_instruction[_o++]);
684     if (memoryAccess && _o < _length)
685     {
686         *memoryAccess = spv::MemoryAccessMask(_instruction[_o++]);
687     }
688 }
ParseCopyMemory(const uint32_t * _instruction,IdRef * target,IdRef * source,spv::MemoryAccessMask * memoryAccess)689 void ParseCopyMemory(const uint32_t *_instruction,
690                      IdRef *target,
691                      IdRef *source,
692                      spv::MemoryAccessMask *memoryAccess)
693 {
694     spv::Op _op;
695     uint32_t _length;
696     GetInstructionOpAndLength(_instruction, &_op, &_length);
697     ASSERT(_op == spv::OpCopyMemory);
698     uint32_t _o = 1;
699     *target     = IdRef(_instruction[_o++]);
700     *source     = IdRef(_instruction[_o++]);
701     if (memoryAccess && _o < _length)
702     {
703         *memoryAccess = spv::MemoryAccessMask(_instruction[_o++]);
704     }
705 }
ParseAccessChain(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRefList * indexesList)706 void ParseAccessChain(const uint32_t *_instruction,
707                       IdResultType *idResultType,
708                       IdResult *idResult,
709                       IdRef *base,
710                       IdRefList *indexesList)
711 {
712     spv::Op _op;
713     uint32_t _length;
714     GetInstructionOpAndLength(_instruction, &_op, &_length);
715     ASSERT(_op == spv::OpAccessChain);
716     uint32_t _o   = 1;
717     *idResultType = IdResultType(_instruction[_o++]);
718     *idResult     = IdResult(_instruction[_o++]);
719     *base         = IdRef(_instruction[_o++]);
720     if (indexesList)
721     {
722         while (_o < _length)
723         {
724             indexesList->emplace_back(_instruction[_o++]);
725         }
726     }
727 }
ParseInBoundsAccessChain(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRefList * indexesList)728 void ParseInBoundsAccessChain(const uint32_t *_instruction,
729                               IdResultType *idResultType,
730                               IdResult *idResult,
731                               IdRef *base,
732                               IdRefList *indexesList)
733 {
734     spv::Op _op;
735     uint32_t _length;
736     GetInstructionOpAndLength(_instruction, &_op, &_length);
737     ASSERT(_op == spv::OpInBoundsAccessChain);
738     uint32_t _o   = 1;
739     *idResultType = IdResultType(_instruction[_o++]);
740     *idResult     = IdResult(_instruction[_o++]);
741     *base         = IdRef(_instruction[_o++]);
742     if (indexesList)
743     {
744         while (_o < _length)
745         {
746             indexesList->emplace_back(_instruction[_o++]);
747         }
748     }
749 }
ParseArrayLength(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * structure,LiteralInteger * arraymember)750 void ParseArrayLength(const uint32_t *_instruction,
751                       IdResultType *idResultType,
752                       IdResult *idResult,
753                       IdRef *structure,
754                       LiteralInteger *arraymember)
755 {
756     spv::Op _op;
757     uint32_t _length;
758     GetInstructionOpAndLength(_instruction, &_op, &_length);
759     ASSERT(_op == spv::OpArrayLength);
760     uint32_t _o   = 1;
761     *idResultType = IdResultType(_instruction[_o++]);
762     *idResult     = IdResult(_instruction[_o++]);
763     *structure    = IdRef(_instruction[_o++]);
764     *arraymember  = LiteralInteger(_instruction[_o++]);
765 }
ParseDecorate(const uint32_t * _instruction,IdRef * target,spv::Decoration * decoration,LiteralIntegerList * valuesList)766 void ParseDecorate(const uint32_t *_instruction,
767                    IdRef *target,
768                    spv::Decoration *decoration,
769                    LiteralIntegerList *valuesList)
770 {
771     spv::Op _op;
772     uint32_t _length;
773     GetInstructionOpAndLength(_instruction, &_op, &_length);
774     ASSERT(_op == spv::OpDecorate);
775     uint32_t _o = 1;
776     *target     = IdRef(_instruction[_o++]);
777     *decoration = spv::Decoration(_instruction[_o++]);
778     if (valuesList)
779     {
780         while (_o < _length)
781         {
782             valuesList->emplace_back(_instruction[_o++]);
783         }
784     }
785 }
ParseMemberDecorate(const uint32_t * _instruction,IdRef * structureType,LiteralInteger * member,spv::Decoration * decoration,LiteralIntegerList * valuesList)786 void ParseMemberDecorate(const uint32_t *_instruction,
787                          IdRef *structureType,
788                          LiteralInteger *member,
789                          spv::Decoration *decoration,
790                          LiteralIntegerList *valuesList)
791 {
792     spv::Op _op;
793     uint32_t _length;
794     GetInstructionOpAndLength(_instruction, &_op, &_length);
795     ASSERT(_op == spv::OpMemberDecorate);
796     uint32_t _o    = 1;
797     *structureType = IdRef(_instruction[_o++]);
798     *member        = LiteralInteger(_instruction[_o++]);
799     *decoration    = spv::Decoration(_instruction[_o++]);
800     if (valuesList)
801     {
802         while (_o < _length)
803         {
804             valuesList->emplace_back(_instruction[_o++]);
805         }
806     }
807 }
ParseDecorationGroup(const uint32_t * _instruction,IdResult * idResult)808 void ParseDecorationGroup(const uint32_t *_instruction, IdResult *idResult)
809 {
810     spv::Op _op;
811     uint32_t _length;
812     GetInstructionOpAndLength(_instruction, &_op, &_length);
813     ASSERT(_op == spv::OpDecorationGroup);
814     uint32_t _o = 1;
815     *idResult   = IdResult(_instruction[_o++]);
816 }
ParseGroupDecorate(const uint32_t * _instruction,IdRef * decorationGroup,IdRefList * targetsList)817 void ParseGroupDecorate(const uint32_t *_instruction,
818                         IdRef *decorationGroup,
819                         IdRefList *targetsList)
820 {
821     spv::Op _op;
822     uint32_t _length;
823     GetInstructionOpAndLength(_instruction, &_op, &_length);
824     ASSERT(_op == spv::OpGroupDecorate);
825     uint32_t _o      = 1;
826     *decorationGroup = IdRef(_instruction[_o++]);
827     if (targetsList)
828     {
829         while (_o < _length)
830         {
831             targetsList->emplace_back(_instruction[_o++]);
832         }
833     }
834 }
ParseGroupMemberDecorate(const uint32_t * _instruction,IdRef * decorationGroup,PairIdRefLiteralIntegerList * targetsPairList)835 void ParseGroupMemberDecorate(const uint32_t *_instruction,
836                               IdRef *decorationGroup,
837                               PairIdRefLiteralIntegerList *targetsPairList)
838 {
839     spv::Op _op;
840     uint32_t _length;
841     GetInstructionOpAndLength(_instruction, &_op, &_length);
842     ASSERT(_op == spv::OpGroupMemberDecorate);
843     uint32_t _o      = 1;
844     *decorationGroup = IdRef(_instruction[_o++]);
845     if (targetsPairList)
846     {
847         while (_o < _length)
848         {
849             targetsPairList->emplace_back(PairIdRefLiteralInteger{
850                 IdRef(_instruction[_o]), LiteralInteger(_instruction[_o + 1])});
851             _o += 2;
852         }
853     }
854 }
ParseVectorExtractDynamic(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector,IdRef * index)855 void ParseVectorExtractDynamic(const uint32_t *_instruction,
856                                IdResultType *idResultType,
857                                IdResult *idResult,
858                                IdRef *vector,
859                                IdRef *index)
860 {
861     spv::Op _op;
862     uint32_t _length;
863     GetInstructionOpAndLength(_instruction, &_op, &_length);
864     ASSERT(_op == spv::OpVectorExtractDynamic);
865     uint32_t _o   = 1;
866     *idResultType = IdResultType(_instruction[_o++]);
867     *idResult     = IdResult(_instruction[_o++]);
868     *vector       = IdRef(_instruction[_o++]);
869     *index        = IdRef(_instruction[_o++]);
870 }
ParseVectorInsertDynamic(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector,IdRef * component,IdRef * index)871 void ParseVectorInsertDynamic(const uint32_t *_instruction,
872                               IdResultType *idResultType,
873                               IdResult *idResult,
874                               IdRef *vector,
875                               IdRef *component,
876                               IdRef *index)
877 {
878     spv::Op _op;
879     uint32_t _length;
880     GetInstructionOpAndLength(_instruction, &_op, &_length);
881     ASSERT(_op == spv::OpVectorInsertDynamic);
882     uint32_t _o   = 1;
883     *idResultType = IdResultType(_instruction[_o++]);
884     *idResult     = IdResult(_instruction[_o++]);
885     *vector       = IdRef(_instruction[_o++]);
886     *component    = IdRef(_instruction[_o++]);
887     *index        = IdRef(_instruction[_o++]);
888 }
ParseVectorShuffle(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector1,IdRef * vector2,LiteralIntegerList * componentsList)889 void ParseVectorShuffle(const uint32_t *_instruction,
890                         IdResultType *idResultType,
891                         IdResult *idResult,
892                         IdRef *vector1,
893                         IdRef *vector2,
894                         LiteralIntegerList *componentsList)
895 {
896     spv::Op _op;
897     uint32_t _length;
898     GetInstructionOpAndLength(_instruction, &_op, &_length);
899     ASSERT(_op == spv::OpVectorShuffle);
900     uint32_t _o   = 1;
901     *idResultType = IdResultType(_instruction[_o++]);
902     *idResult     = IdResult(_instruction[_o++]);
903     *vector1      = IdRef(_instruction[_o++]);
904     *vector2      = IdRef(_instruction[_o++]);
905     if (componentsList)
906     {
907         while (_o < _length)
908         {
909             componentsList->emplace_back(_instruction[_o++]);
910         }
911     }
912 }
ParseCompositeConstruct(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRefList * constituentsList)913 void ParseCompositeConstruct(const uint32_t *_instruction,
914                              IdResultType *idResultType,
915                              IdResult *idResult,
916                              IdRefList *constituentsList)
917 {
918     spv::Op _op;
919     uint32_t _length;
920     GetInstructionOpAndLength(_instruction, &_op, &_length);
921     ASSERT(_op == spv::OpCompositeConstruct);
922     uint32_t _o   = 1;
923     *idResultType = IdResultType(_instruction[_o++]);
924     *idResult     = IdResult(_instruction[_o++]);
925     if (constituentsList)
926     {
927         while (_o < _length)
928         {
929             constituentsList->emplace_back(_instruction[_o++]);
930         }
931     }
932 }
ParseCompositeExtract(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * composite,LiteralIntegerList * indexesList)933 void ParseCompositeExtract(const uint32_t *_instruction,
934                            IdResultType *idResultType,
935                            IdResult *idResult,
936                            IdRef *composite,
937                            LiteralIntegerList *indexesList)
938 {
939     spv::Op _op;
940     uint32_t _length;
941     GetInstructionOpAndLength(_instruction, &_op, &_length);
942     ASSERT(_op == spv::OpCompositeExtract);
943     uint32_t _o   = 1;
944     *idResultType = IdResultType(_instruction[_o++]);
945     *idResult     = IdResult(_instruction[_o++]);
946     *composite    = IdRef(_instruction[_o++]);
947     if (indexesList)
948     {
949         while (_o < _length)
950         {
951             indexesList->emplace_back(_instruction[_o++]);
952         }
953     }
954 }
ParseCompositeInsert(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * object,IdRef * composite,LiteralIntegerList * indexesList)955 void ParseCompositeInsert(const uint32_t *_instruction,
956                           IdResultType *idResultType,
957                           IdResult *idResult,
958                           IdRef *object,
959                           IdRef *composite,
960                           LiteralIntegerList *indexesList)
961 {
962     spv::Op _op;
963     uint32_t _length;
964     GetInstructionOpAndLength(_instruction, &_op, &_length);
965     ASSERT(_op == spv::OpCompositeInsert);
966     uint32_t _o   = 1;
967     *idResultType = IdResultType(_instruction[_o++]);
968     *idResult     = IdResult(_instruction[_o++]);
969     *object       = IdRef(_instruction[_o++]);
970     *composite    = IdRef(_instruction[_o++]);
971     if (indexesList)
972     {
973         while (_o < _length)
974         {
975             indexesList->emplace_back(_instruction[_o++]);
976         }
977     }
978 }
ParseCopyObject(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)979 void ParseCopyObject(const uint32_t *_instruction,
980                      IdResultType *idResultType,
981                      IdResult *idResult,
982                      IdRef *operand)
983 {
984     spv::Op _op;
985     uint32_t _length;
986     GetInstructionOpAndLength(_instruction, &_op, &_length);
987     ASSERT(_op == spv::OpCopyObject);
988     uint32_t _o   = 1;
989     *idResultType = IdResultType(_instruction[_o++]);
990     *idResult     = IdResult(_instruction[_o++]);
991     *operand      = IdRef(_instruction[_o++]);
992 }
ParseTranspose(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * matrix)993 void ParseTranspose(const uint32_t *_instruction,
994                     IdResultType *idResultType,
995                     IdResult *idResult,
996                     IdRef *matrix)
997 {
998     spv::Op _op;
999     uint32_t _length;
1000     GetInstructionOpAndLength(_instruction, &_op, &_length);
1001     ASSERT(_op == spv::OpTranspose);
1002     uint32_t _o   = 1;
1003     *idResultType = IdResultType(_instruction[_o++]);
1004     *idResult     = IdResult(_instruction[_o++]);
1005     *matrix       = IdRef(_instruction[_o++]);
1006 }
ParseSampledImage(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * sampler)1007 void ParseSampledImage(const uint32_t *_instruction,
1008                        IdResultType *idResultType,
1009                        IdResult *idResult,
1010                        IdRef *image,
1011                        IdRef *sampler)
1012 {
1013     spv::Op _op;
1014     uint32_t _length;
1015     GetInstructionOpAndLength(_instruction, &_op, &_length);
1016     ASSERT(_op == spv::OpSampledImage);
1017     uint32_t _o   = 1;
1018     *idResultType = IdResultType(_instruction[_o++]);
1019     *idResult     = IdResult(_instruction[_o++]);
1020     *image        = IdRef(_instruction[_o++]);
1021     *sampler      = IdRef(_instruction[_o++]);
1022 }
ParseImageSampleImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1023 void ParseImageSampleImplicitLod(const uint32_t *_instruction,
1024                                  IdResultType *idResultType,
1025                                  IdResult *idResult,
1026                                  IdRef *sampledImage,
1027                                  IdRef *coordinate,
1028                                  spv::ImageOperandsMask *imageOperands,
1029                                  IdRefList *imageOperandIdsList)
1030 {
1031     spv::Op _op;
1032     uint32_t _length;
1033     GetInstructionOpAndLength(_instruction, &_op, &_length);
1034     ASSERT(_op == spv::OpImageSampleImplicitLod);
1035     uint32_t _o   = 1;
1036     *idResultType = IdResultType(_instruction[_o++]);
1037     *idResult     = IdResult(_instruction[_o++]);
1038     *sampledImage = IdRef(_instruction[_o++]);
1039     *coordinate   = IdRef(_instruction[_o++]);
1040     if (imageOperands && _o < _length)
1041     {
1042         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1043     }
1044     if (imageOperandIdsList)
1045     {
1046         while (_o < _length)
1047         {
1048             imageOperandIdsList->emplace_back(_instruction[_o++]);
1049         }
1050     }
1051 }
ParseImageSampleExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1052 void ParseImageSampleExplicitLod(const uint32_t *_instruction,
1053                                  IdResultType *idResultType,
1054                                  IdResult *idResult,
1055                                  IdRef *sampledImage,
1056                                  IdRef *coordinate,
1057                                  spv::ImageOperandsMask *imageOperands,
1058                                  IdRefList *imageOperandIdsList)
1059 {
1060     spv::Op _op;
1061     uint32_t _length;
1062     GetInstructionOpAndLength(_instruction, &_op, &_length);
1063     ASSERT(_op == spv::OpImageSampleExplicitLod);
1064     uint32_t _o    = 1;
1065     *idResultType  = IdResultType(_instruction[_o++]);
1066     *idResult      = IdResult(_instruction[_o++]);
1067     *sampledImage  = IdRef(_instruction[_o++]);
1068     *coordinate    = IdRef(_instruction[_o++]);
1069     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1070     if (imageOperandIdsList)
1071     {
1072         while (_o < _length)
1073         {
1074             imageOperandIdsList->emplace_back(_instruction[_o++]);
1075         }
1076     }
1077 }
ParseImageSampleDrefImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1078 void ParseImageSampleDrefImplicitLod(const uint32_t *_instruction,
1079                                      IdResultType *idResultType,
1080                                      IdResult *idResult,
1081                                      IdRef *sampledImage,
1082                                      IdRef *coordinate,
1083                                      IdRef *dref,
1084                                      spv::ImageOperandsMask *imageOperands,
1085                                      IdRefList *imageOperandIdsList)
1086 {
1087     spv::Op _op;
1088     uint32_t _length;
1089     GetInstructionOpAndLength(_instruction, &_op, &_length);
1090     ASSERT(_op == spv::OpImageSampleDrefImplicitLod);
1091     uint32_t _o   = 1;
1092     *idResultType = IdResultType(_instruction[_o++]);
1093     *idResult     = IdResult(_instruction[_o++]);
1094     *sampledImage = IdRef(_instruction[_o++]);
1095     *coordinate   = IdRef(_instruction[_o++]);
1096     *dref         = IdRef(_instruction[_o++]);
1097     if (imageOperands && _o < _length)
1098     {
1099         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1100     }
1101     if (imageOperandIdsList)
1102     {
1103         while (_o < _length)
1104         {
1105             imageOperandIdsList->emplace_back(_instruction[_o++]);
1106         }
1107     }
1108 }
ParseImageSampleDrefExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1109 void ParseImageSampleDrefExplicitLod(const uint32_t *_instruction,
1110                                      IdResultType *idResultType,
1111                                      IdResult *idResult,
1112                                      IdRef *sampledImage,
1113                                      IdRef *coordinate,
1114                                      IdRef *dref,
1115                                      spv::ImageOperandsMask *imageOperands,
1116                                      IdRefList *imageOperandIdsList)
1117 {
1118     spv::Op _op;
1119     uint32_t _length;
1120     GetInstructionOpAndLength(_instruction, &_op, &_length);
1121     ASSERT(_op == spv::OpImageSampleDrefExplicitLod);
1122     uint32_t _o    = 1;
1123     *idResultType  = IdResultType(_instruction[_o++]);
1124     *idResult      = IdResult(_instruction[_o++]);
1125     *sampledImage  = IdRef(_instruction[_o++]);
1126     *coordinate    = IdRef(_instruction[_o++]);
1127     *dref          = IdRef(_instruction[_o++]);
1128     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1129     if (imageOperandIdsList)
1130     {
1131         while (_o < _length)
1132         {
1133             imageOperandIdsList->emplace_back(_instruction[_o++]);
1134         }
1135     }
1136 }
ParseImageSampleProjImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1137 void ParseImageSampleProjImplicitLod(const uint32_t *_instruction,
1138                                      IdResultType *idResultType,
1139                                      IdResult *idResult,
1140                                      IdRef *sampledImage,
1141                                      IdRef *coordinate,
1142                                      spv::ImageOperandsMask *imageOperands,
1143                                      IdRefList *imageOperandIdsList)
1144 {
1145     spv::Op _op;
1146     uint32_t _length;
1147     GetInstructionOpAndLength(_instruction, &_op, &_length);
1148     ASSERT(_op == spv::OpImageSampleProjImplicitLod);
1149     uint32_t _o   = 1;
1150     *idResultType = IdResultType(_instruction[_o++]);
1151     *idResult     = IdResult(_instruction[_o++]);
1152     *sampledImage = IdRef(_instruction[_o++]);
1153     *coordinate   = IdRef(_instruction[_o++]);
1154     if (imageOperands && _o < _length)
1155     {
1156         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1157     }
1158     if (imageOperandIdsList)
1159     {
1160         while (_o < _length)
1161         {
1162             imageOperandIdsList->emplace_back(_instruction[_o++]);
1163         }
1164     }
1165 }
ParseImageSampleProjExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1166 void ParseImageSampleProjExplicitLod(const uint32_t *_instruction,
1167                                      IdResultType *idResultType,
1168                                      IdResult *idResult,
1169                                      IdRef *sampledImage,
1170                                      IdRef *coordinate,
1171                                      spv::ImageOperandsMask *imageOperands,
1172                                      IdRefList *imageOperandIdsList)
1173 {
1174     spv::Op _op;
1175     uint32_t _length;
1176     GetInstructionOpAndLength(_instruction, &_op, &_length);
1177     ASSERT(_op == spv::OpImageSampleProjExplicitLod);
1178     uint32_t _o    = 1;
1179     *idResultType  = IdResultType(_instruction[_o++]);
1180     *idResult      = IdResult(_instruction[_o++]);
1181     *sampledImage  = IdRef(_instruction[_o++]);
1182     *coordinate    = IdRef(_instruction[_o++]);
1183     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1184     if (imageOperandIdsList)
1185     {
1186         while (_o < _length)
1187         {
1188             imageOperandIdsList->emplace_back(_instruction[_o++]);
1189         }
1190     }
1191 }
ParseImageSampleProjDrefImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1192 void ParseImageSampleProjDrefImplicitLod(const uint32_t *_instruction,
1193                                          IdResultType *idResultType,
1194                                          IdResult *idResult,
1195                                          IdRef *sampledImage,
1196                                          IdRef *coordinate,
1197                                          IdRef *dref,
1198                                          spv::ImageOperandsMask *imageOperands,
1199                                          IdRefList *imageOperandIdsList)
1200 {
1201     spv::Op _op;
1202     uint32_t _length;
1203     GetInstructionOpAndLength(_instruction, &_op, &_length);
1204     ASSERT(_op == spv::OpImageSampleProjDrefImplicitLod);
1205     uint32_t _o   = 1;
1206     *idResultType = IdResultType(_instruction[_o++]);
1207     *idResult     = IdResult(_instruction[_o++]);
1208     *sampledImage = IdRef(_instruction[_o++]);
1209     *coordinate   = IdRef(_instruction[_o++]);
1210     *dref         = IdRef(_instruction[_o++]);
1211     if (imageOperands && _o < _length)
1212     {
1213         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1214     }
1215     if (imageOperandIdsList)
1216     {
1217         while (_o < _length)
1218         {
1219             imageOperandIdsList->emplace_back(_instruction[_o++]);
1220         }
1221     }
1222 }
ParseImageSampleProjDrefExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1223 void ParseImageSampleProjDrefExplicitLod(const uint32_t *_instruction,
1224                                          IdResultType *idResultType,
1225                                          IdResult *idResult,
1226                                          IdRef *sampledImage,
1227                                          IdRef *coordinate,
1228                                          IdRef *dref,
1229                                          spv::ImageOperandsMask *imageOperands,
1230                                          IdRefList *imageOperandIdsList)
1231 {
1232     spv::Op _op;
1233     uint32_t _length;
1234     GetInstructionOpAndLength(_instruction, &_op, &_length);
1235     ASSERT(_op == spv::OpImageSampleProjDrefExplicitLod);
1236     uint32_t _o    = 1;
1237     *idResultType  = IdResultType(_instruction[_o++]);
1238     *idResult      = IdResult(_instruction[_o++]);
1239     *sampledImage  = IdRef(_instruction[_o++]);
1240     *coordinate    = IdRef(_instruction[_o++]);
1241     *dref          = IdRef(_instruction[_o++]);
1242     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1243     if (imageOperandIdsList)
1244     {
1245         while (_o < _length)
1246         {
1247             imageOperandIdsList->emplace_back(_instruction[_o++]);
1248         }
1249     }
1250 }
ParseImageFetch(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1251 void ParseImageFetch(const uint32_t *_instruction,
1252                      IdResultType *idResultType,
1253                      IdResult *idResult,
1254                      IdRef *image,
1255                      IdRef *coordinate,
1256                      spv::ImageOperandsMask *imageOperands,
1257                      IdRefList *imageOperandIdsList)
1258 {
1259     spv::Op _op;
1260     uint32_t _length;
1261     GetInstructionOpAndLength(_instruction, &_op, &_length);
1262     ASSERT(_op == spv::OpImageFetch);
1263     uint32_t _o   = 1;
1264     *idResultType = IdResultType(_instruction[_o++]);
1265     *idResult     = IdResult(_instruction[_o++]);
1266     *image        = IdRef(_instruction[_o++]);
1267     *coordinate   = IdRef(_instruction[_o++]);
1268     if (imageOperands && _o < _length)
1269     {
1270         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1271     }
1272     if (imageOperandIdsList)
1273     {
1274         while (_o < _length)
1275         {
1276             imageOperandIdsList->emplace_back(_instruction[_o++]);
1277         }
1278     }
1279 }
ParseImageGather(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * component,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1280 void ParseImageGather(const uint32_t *_instruction,
1281                       IdResultType *idResultType,
1282                       IdResult *idResult,
1283                       IdRef *sampledImage,
1284                       IdRef *coordinate,
1285                       IdRef *component,
1286                       spv::ImageOperandsMask *imageOperands,
1287                       IdRefList *imageOperandIdsList)
1288 {
1289     spv::Op _op;
1290     uint32_t _length;
1291     GetInstructionOpAndLength(_instruction, &_op, &_length);
1292     ASSERT(_op == spv::OpImageGather);
1293     uint32_t _o   = 1;
1294     *idResultType = IdResultType(_instruction[_o++]);
1295     *idResult     = IdResult(_instruction[_o++]);
1296     *sampledImage = IdRef(_instruction[_o++]);
1297     *coordinate   = IdRef(_instruction[_o++]);
1298     *component    = IdRef(_instruction[_o++]);
1299     if (imageOperands && _o < _length)
1300     {
1301         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1302     }
1303     if (imageOperandIdsList)
1304     {
1305         while (_o < _length)
1306         {
1307             imageOperandIdsList->emplace_back(_instruction[_o++]);
1308         }
1309     }
1310 }
ParseImageDrefGather(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1311 void ParseImageDrefGather(const uint32_t *_instruction,
1312                           IdResultType *idResultType,
1313                           IdResult *idResult,
1314                           IdRef *sampledImage,
1315                           IdRef *coordinate,
1316                           IdRef *dref,
1317                           spv::ImageOperandsMask *imageOperands,
1318                           IdRefList *imageOperandIdsList)
1319 {
1320     spv::Op _op;
1321     uint32_t _length;
1322     GetInstructionOpAndLength(_instruction, &_op, &_length);
1323     ASSERT(_op == spv::OpImageDrefGather);
1324     uint32_t _o   = 1;
1325     *idResultType = IdResultType(_instruction[_o++]);
1326     *idResult     = IdResult(_instruction[_o++]);
1327     *sampledImage = IdRef(_instruction[_o++]);
1328     *coordinate   = IdRef(_instruction[_o++]);
1329     *dref         = IdRef(_instruction[_o++]);
1330     if (imageOperands && _o < _length)
1331     {
1332         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1333     }
1334     if (imageOperandIdsList)
1335     {
1336         while (_o < _length)
1337         {
1338             imageOperandIdsList->emplace_back(_instruction[_o++]);
1339         }
1340     }
1341 }
ParseImageRead(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1342 void ParseImageRead(const uint32_t *_instruction,
1343                     IdResultType *idResultType,
1344                     IdResult *idResult,
1345                     IdRef *image,
1346                     IdRef *coordinate,
1347                     spv::ImageOperandsMask *imageOperands,
1348                     IdRefList *imageOperandIdsList)
1349 {
1350     spv::Op _op;
1351     uint32_t _length;
1352     GetInstructionOpAndLength(_instruction, &_op, &_length);
1353     ASSERT(_op == spv::OpImageRead);
1354     uint32_t _o   = 1;
1355     *idResultType = IdResultType(_instruction[_o++]);
1356     *idResult     = IdResult(_instruction[_o++]);
1357     *image        = IdRef(_instruction[_o++]);
1358     *coordinate   = IdRef(_instruction[_o++]);
1359     if (imageOperands && _o < _length)
1360     {
1361         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1362     }
1363     if (imageOperandIdsList)
1364     {
1365         while (_o < _length)
1366         {
1367             imageOperandIdsList->emplace_back(_instruction[_o++]);
1368         }
1369     }
1370 }
ParseImageWrite(const uint32_t * _instruction,IdRef * image,IdRef * coordinate,IdRef * texel,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)1371 void ParseImageWrite(const uint32_t *_instruction,
1372                      IdRef *image,
1373                      IdRef *coordinate,
1374                      IdRef *texel,
1375                      spv::ImageOperandsMask *imageOperands,
1376                      IdRefList *imageOperandIdsList)
1377 {
1378     spv::Op _op;
1379     uint32_t _length;
1380     GetInstructionOpAndLength(_instruction, &_op, &_length);
1381     ASSERT(_op == spv::OpImageWrite);
1382     uint32_t _o = 1;
1383     *image      = IdRef(_instruction[_o++]);
1384     *coordinate = IdRef(_instruction[_o++]);
1385     *texel      = IdRef(_instruction[_o++]);
1386     if (imageOperands && _o < _length)
1387     {
1388         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
1389     }
1390     if (imageOperandIdsList)
1391     {
1392         while (_o < _length)
1393         {
1394             imageOperandIdsList->emplace_back(_instruction[_o++]);
1395         }
1396     }
1397 }
ParseImage(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage)1398 void ParseImage(const uint32_t *_instruction,
1399                 IdResultType *idResultType,
1400                 IdResult *idResult,
1401                 IdRef *sampledImage)
1402 {
1403     spv::Op _op;
1404     uint32_t _length;
1405     GetInstructionOpAndLength(_instruction, &_op, &_length);
1406     ASSERT(_op == spv::OpImage);
1407     uint32_t _o   = 1;
1408     *idResultType = IdResultType(_instruction[_o++]);
1409     *idResult     = IdResult(_instruction[_o++]);
1410     *sampledImage = IdRef(_instruction[_o++]);
1411 }
ParseImageQuerySizeLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * levelofDetail)1412 void ParseImageQuerySizeLod(const uint32_t *_instruction,
1413                             IdResultType *idResultType,
1414                             IdResult *idResult,
1415                             IdRef *image,
1416                             IdRef *levelofDetail)
1417 {
1418     spv::Op _op;
1419     uint32_t _length;
1420     GetInstructionOpAndLength(_instruction, &_op, &_length);
1421     ASSERT(_op == spv::OpImageQuerySizeLod);
1422     uint32_t _o    = 1;
1423     *idResultType  = IdResultType(_instruction[_o++]);
1424     *idResult      = IdResult(_instruction[_o++]);
1425     *image         = IdRef(_instruction[_o++]);
1426     *levelofDetail = IdRef(_instruction[_o++]);
1427 }
ParseImageQuerySize(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image)1428 void ParseImageQuerySize(const uint32_t *_instruction,
1429                          IdResultType *idResultType,
1430                          IdResult *idResult,
1431                          IdRef *image)
1432 {
1433     spv::Op _op;
1434     uint32_t _length;
1435     GetInstructionOpAndLength(_instruction, &_op, &_length);
1436     ASSERT(_op == spv::OpImageQuerySize);
1437     uint32_t _o   = 1;
1438     *idResultType = IdResultType(_instruction[_o++]);
1439     *idResult     = IdResult(_instruction[_o++]);
1440     *image        = IdRef(_instruction[_o++]);
1441 }
ParseImageQueryLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate)1442 void ParseImageQueryLod(const uint32_t *_instruction,
1443                         IdResultType *idResultType,
1444                         IdResult *idResult,
1445                         IdRef *sampledImage,
1446                         IdRef *coordinate)
1447 {
1448     spv::Op _op;
1449     uint32_t _length;
1450     GetInstructionOpAndLength(_instruction, &_op, &_length);
1451     ASSERT(_op == spv::OpImageQueryLod);
1452     uint32_t _o   = 1;
1453     *idResultType = IdResultType(_instruction[_o++]);
1454     *idResult     = IdResult(_instruction[_o++]);
1455     *sampledImage = IdRef(_instruction[_o++]);
1456     *coordinate   = IdRef(_instruction[_o++]);
1457 }
ParseImageQueryLevels(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image)1458 void ParseImageQueryLevels(const uint32_t *_instruction,
1459                            IdResultType *idResultType,
1460                            IdResult *idResult,
1461                            IdRef *image)
1462 {
1463     spv::Op _op;
1464     uint32_t _length;
1465     GetInstructionOpAndLength(_instruction, &_op, &_length);
1466     ASSERT(_op == spv::OpImageQueryLevels);
1467     uint32_t _o   = 1;
1468     *idResultType = IdResultType(_instruction[_o++]);
1469     *idResult     = IdResult(_instruction[_o++]);
1470     *image        = IdRef(_instruction[_o++]);
1471 }
ParseImageQuerySamples(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image)1472 void ParseImageQuerySamples(const uint32_t *_instruction,
1473                             IdResultType *idResultType,
1474                             IdResult *idResult,
1475                             IdRef *image)
1476 {
1477     spv::Op _op;
1478     uint32_t _length;
1479     GetInstructionOpAndLength(_instruction, &_op, &_length);
1480     ASSERT(_op == spv::OpImageQuerySamples);
1481     uint32_t _o   = 1;
1482     *idResultType = IdResultType(_instruction[_o++]);
1483     *idResult     = IdResult(_instruction[_o++]);
1484     *image        = IdRef(_instruction[_o++]);
1485 }
ParseConvertFToU(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * floatValue)1486 void ParseConvertFToU(const uint32_t *_instruction,
1487                       IdResultType *idResultType,
1488                       IdResult *idResult,
1489                       IdRef *floatValue)
1490 {
1491     spv::Op _op;
1492     uint32_t _length;
1493     GetInstructionOpAndLength(_instruction, &_op, &_length);
1494     ASSERT(_op == spv::OpConvertFToU);
1495     uint32_t _o   = 1;
1496     *idResultType = IdResultType(_instruction[_o++]);
1497     *idResult     = IdResult(_instruction[_o++]);
1498     *floatValue   = IdRef(_instruction[_o++]);
1499 }
ParseConvertFToS(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * floatValue)1500 void ParseConvertFToS(const uint32_t *_instruction,
1501                       IdResultType *idResultType,
1502                       IdResult *idResult,
1503                       IdRef *floatValue)
1504 {
1505     spv::Op _op;
1506     uint32_t _length;
1507     GetInstructionOpAndLength(_instruction, &_op, &_length);
1508     ASSERT(_op == spv::OpConvertFToS);
1509     uint32_t _o   = 1;
1510     *idResultType = IdResultType(_instruction[_o++]);
1511     *idResult     = IdResult(_instruction[_o++]);
1512     *floatValue   = IdRef(_instruction[_o++]);
1513 }
ParseConvertSToF(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * signedValue)1514 void ParseConvertSToF(const uint32_t *_instruction,
1515                       IdResultType *idResultType,
1516                       IdResult *idResult,
1517                       IdRef *signedValue)
1518 {
1519     spv::Op _op;
1520     uint32_t _length;
1521     GetInstructionOpAndLength(_instruction, &_op, &_length);
1522     ASSERT(_op == spv::OpConvertSToF);
1523     uint32_t _o   = 1;
1524     *idResultType = IdResultType(_instruction[_o++]);
1525     *idResult     = IdResult(_instruction[_o++]);
1526     *signedValue  = IdRef(_instruction[_o++]);
1527 }
ParseConvertUToF(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * unsignedValue)1528 void ParseConvertUToF(const uint32_t *_instruction,
1529                       IdResultType *idResultType,
1530                       IdResult *idResult,
1531                       IdRef *unsignedValue)
1532 {
1533     spv::Op _op;
1534     uint32_t _length;
1535     GetInstructionOpAndLength(_instruction, &_op, &_length);
1536     ASSERT(_op == spv::OpConvertUToF);
1537     uint32_t _o    = 1;
1538     *idResultType  = IdResultType(_instruction[_o++]);
1539     *idResult      = IdResult(_instruction[_o++]);
1540     *unsignedValue = IdRef(_instruction[_o++]);
1541 }
ParseUConvert(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * unsignedValue)1542 void ParseUConvert(const uint32_t *_instruction,
1543                    IdResultType *idResultType,
1544                    IdResult *idResult,
1545                    IdRef *unsignedValue)
1546 {
1547     spv::Op _op;
1548     uint32_t _length;
1549     GetInstructionOpAndLength(_instruction, &_op, &_length);
1550     ASSERT(_op == spv::OpUConvert);
1551     uint32_t _o    = 1;
1552     *idResultType  = IdResultType(_instruction[_o++]);
1553     *idResult      = IdResult(_instruction[_o++]);
1554     *unsignedValue = IdRef(_instruction[_o++]);
1555 }
ParseSConvert(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * signedValue)1556 void ParseSConvert(const uint32_t *_instruction,
1557                    IdResultType *idResultType,
1558                    IdResult *idResult,
1559                    IdRef *signedValue)
1560 {
1561     spv::Op _op;
1562     uint32_t _length;
1563     GetInstructionOpAndLength(_instruction, &_op, &_length);
1564     ASSERT(_op == spv::OpSConvert);
1565     uint32_t _o   = 1;
1566     *idResultType = IdResultType(_instruction[_o++]);
1567     *idResult     = IdResult(_instruction[_o++]);
1568     *signedValue  = IdRef(_instruction[_o++]);
1569 }
ParseFConvert(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * floatValue)1570 void ParseFConvert(const uint32_t *_instruction,
1571                    IdResultType *idResultType,
1572                    IdResult *idResult,
1573                    IdRef *floatValue)
1574 {
1575     spv::Op _op;
1576     uint32_t _length;
1577     GetInstructionOpAndLength(_instruction, &_op, &_length);
1578     ASSERT(_op == spv::OpFConvert);
1579     uint32_t _o   = 1;
1580     *idResultType = IdResultType(_instruction[_o++]);
1581     *idResult     = IdResult(_instruction[_o++]);
1582     *floatValue   = IdRef(_instruction[_o++]);
1583 }
ParseQuantizeToF16(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * value)1584 void ParseQuantizeToF16(const uint32_t *_instruction,
1585                         IdResultType *idResultType,
1586                         IdResult *idResult,
1587                         IdRef *value)
1588 {
1589     spv::Op _op;
1590     uint32_t _length;
1591     GetInstructionOpAndLength(_instruction, &_op, &_length);
1592     ASSERT(_op == spv::OpQuantizeToF16);
1593     uint32_t _o   = 1;
1594     *idResultType = IdResultType(_instruction[_o++]);
1595     *idResult     = IdResult(_instruction[_o++]);
1596     *value        = IdRef(_instruction[_o++]);
1597 }
ParseBitcast(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)1598 void ParseBitcast(const uint32_t *_instruction,
1599                   IdResultType *idResultType,
1600                   IdResult *idResult,
1601                   IdRef *operand)
1602 {
1603     spv::Op _op;
1604     uint32_t _length;
1605     GetInstructionOpAndLength(_instruction, &_op, &_length);
1606     ASSERT(_op == spv::OpBitcast);
1607     uint32_t _o   = 1;
1608     *idResultType = IdResultType(_instruction[_o++]);
1609     *idResult     = IdResult(_instruction[_o++]);
1610     *operand      = IdRef(_instruction[_o++]);
1611 }
ParseSNegate(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)1612 void ParseSNegate(const uint32_t *_instruction,
1613                   IdResultType *idResultType,
1614                   IdResult *idResult,
1615                   IdRef *operand)
1616 {
1617     spv::Op _op;
1618     uint32_t _length;
1619     GetInstructionOpAndLength(_instruction, &_op, &_length);
1620     ASSERT(_op == spv::OpSNegate);
1621     uint32_t _o   = 1;
1622     *idResultType = IdResultType(_instruction[_o++]);
1623     *idResult     = IdResult(_instruction[_o++]);
1624     *operand      = IdRef(_instruction[_o++]);
1625 }
ParseFNegate(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)1626 void ParseFNegate(const uint32_t *_instruction,
1627                   IdResultType *idResultType,
1628                   IdResult *idResult,
1629                   IdRef *operand)
1630 {
1631     spv::Op _op;
1632     uint32_t _length;
1633     GetInstructionOpAndLength(_instruction, &_op, &_length);
1634     ASSERT(_op == spv::OpFNegate);
1635     uint32_t _o   = 1;
1636     *idResultType = IdResultType(_instruction[_o++]);
1637     *idResult     = IdResult(_instruction[_o++]);
1638     *operand      = IdRef(_instruction[_o++]);
1639 }
ParseIAdd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1640 void ParseIAdd(const uint32_t *_instruction,
1641                IdResultType *idResultType,
1642                IdResult *idResult,
1643                IdRef *operand1,
1644                IdRef *operand2)
1645 {
1646     spv::Op _op;
1647     uint32_t _length;
1648     GetInstructionOpAndLength(_instruction, &_op, &_length);
1649     ASSERT(_op == spv::OpIAdd);
1650     uint32_t _o   = 1;
1651     *idResultType = IdResultType(_instruction[_o++]);
1652     *idResult     = IdResult(_instruction[_o++]);
1653     *operand1     = IdRef(_instruction[_o++]);
1654     *operand2     = IdRef(_instruction[_o++]);
1655 }
ParseFAdd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1656 void ParseFAdd(const uint32_t *_instruction,
1657                IdResultType *idResultType,
1658                IdResult *idResult,
1659                IdRef *operand1,
1660                IdRef *operand2)
1661 {
1662     spv::Op _op;
1663     uint32_t _length;
1664     GetInstructionOpAndLength(_instruction, &_op, &_length);
1665     ASSERT(_op == spv::OpFAdd);
1666     uint32_t _o   = 1;
1667     *idResultType = IdResultType(_instruction[_o++]);
1668     *idResult     = IdResult(_instruction[_o++]);
1669     *operand1     = IdRef(_instruction[_o++]);
1670     *operand2     = IdRef(_instruction[_o++]);
1671 }
ParseISub(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1672 void ParseISub(const uint32_t *_instruction,
1673                IdResultType *idResultType,
1674                IdResult *idResult,
1675                IdRef *operand1,
1676                IdRef *operand2)
1677 {
1678     spv::Op _op;
1679     uint32_t _length;
1680     GetInstructionOpAndLength(_instruction, &_op, &_length);
1681     ASSERT(_op == spv::OpISub);
1682     uint32_t _o   = 1;
1683     *idResultType = IdResultType(_instruction[_o++]);
1684     *idResult     = IdResult(_instruction[_o++]);
1685     *operand1     = IdRef(_instruction[_o++]);
1686     *operand2     = IdRef(_instruction[_o++]);
1687 }
ParseFSub(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1688 void ParseFSub(const uint32_t *_instruction,
1689                IdResultType *idResultType,
1690                IdResult *idResult,
1691                IdRef *operand1,
1692                IdRef *operand2)
1693 {
1694     spv::Op _op;
1695     uint32_t _length;
1696     GetInstructionOpAndLength(_instruction, &_op, &_length);
1697     ASSERT(_op == spv::OpFSub);
1698     uint32_t _o   = 1;
1699     *idResultType = IdResultType(_instruction[_o++]);
1700     *idResult     = IdResult(_instruction[_o++]);
1701     *operand1     = IdRef(_instruction[_o++]);
1702     *operand2     = IdRef(_instruction[_o++]);
1703 }
ParseIMul(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1704 void ParseIMul(const uint32_t *_instruction,
1705                IdResultType *idResultType,
1706                IdResult *idResult,
1707                IdRef *operand1,
1708                IdRef *operand2)
1709 {
1710     spv::Op _op;
1711     uint32_t _length;
1712     GetInstructionOpAndLength(_instruction, &_op, &_length);
1713     ASSERT(_op == spv::OpIMul);
1714     uint32_t _o   = 1;
1715     *idResultType = IdResultType(_instruction[_o++]);
1716     *idResult     = IdResult(_instruction[_o++]);
1717     *operand1     = IdRef(_instruction[_o++]);
1718     *operand2     = IdRef(_instruction[_o++]);
1719 }
ParseFMul(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1720 void ParseFMul(const uint32_t *_instruction,
1721                IdResultType *idResultType,
1722                IdResult *idResult,
1723                IdRef *operand1,
1724                IdRef *operand2)
1725 {
1726     spv::Op _op;
1727     uint32_t _length;
1728     GetInstructionOpAndLength(_instruction, &_op, &_length);
1729     ASSERT(_op == spv::OpFMul);
1730     uint32_t _o   = 1;
1731     *idResultType = IdResultType(_instruction[_o++]);
1732     *idResult     = IdResult(_instruction[_o++]);
1733     *operand1     = IdRef(_instruction[_o++]);
1734     *operand2     = IdRef(_instruction[_o++]);
1735 }
ParseUDiv(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1736 void ParseUDiv(const uint32_t *_instruction,
1737                IdResultType *idResultType,
1738                IdResult *idResult,
1739                IdRef *operand1,
1740                IdRef *operand2)
1741 {
1742     spv::Op _op;
1743     uint32_t _length;
1744     GetInstructionOpAndLength(_instruction, &_op, &_length);
1745     ASSERT(_op == spv::OpUDiv);
1746     uint32_t _o   = 1;
1747     *idResultType = IdResultType(_instruction[_o++]);
1748     *idResult     = IdResult(_instruction[_o++]);
1749     *operand1     = IdRef(_instruction[_o++]);
1750     *operand2     = IdRef(_instruction[_o++]);
1751 }
ParseSDiv(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1752 void ParseSDiv(const uint32_t *_instruction,
1753                IdResultType *idResultType,
1754                IdResult *idResult,
1755                IdRef *operand1,
1756                IdRef *operand2)
1757 {
1758     spv::Op _op;
1759     uint32_t _length;
1760     GetInstructionOpAndLength(_instruction, &_op, &_length);
1761     ASSERT(_op == spv::OpSDiv);
1762     uint32_t _o   = 1;
1763     *idResultType = IdResultType(_instruction[_o++]);
1764     *idResult     = IdResult(_instruction[_o++]);
1765     *operand1     = IdRef(_instruction[_o++]);
1766     *operand2     = IdRef(_instruction[_o++]);
1767 }
ParseFDiv(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1768 void ParseFDiv(const uint32_t *_instruction,
1769                IdResultType *idResultType,
1770                IdResult *idResult,
1771                IdRef *operand1,
1772                IdRef *operand2)
1773 {
1774     spv::Op _op;
1775     uint32_t _length;
1776     GetInstructionOpAndLength(_instruction, &_op, &_length);
1777     ASSERT(_op == spv::OpFDiv);
1778     uint32_t _o   = 1;
1779     *idResultType = IdResultType(_instruction[_o++]);
1780     *idResult     = IdResult(_instruction[_o++]);
1781     *operand1     = IdRef(_instruction[_o++]);
1782     *operand2     = IdRef(_instruction[_o++]);
1783 }
ParseUMod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1784 void ParseUMod(const uint32_t *_instruction,
1785                IdResultType *idResultType,
1786                IdResult *idResult,
1787                IdRef *operand1,
1788                IdRef *operand2)
1789 {
1790     spv::Op _op;
1791     uint32_t _length;
1792     GetInstructionOpAndLength(_instruction, &_op, &_length);
1793     ASSERT(_op == spv::OpUMod);
1794     uint32_t _o   = 1;
1795     *idResultType = IdResultType(_instruction[_o++]);
1796     *idResult     = IdResult(_instruction[_o++]);
1797     *operand1     = IdRef(_instruction[_o++]);
1798     *operand2     = IdRef(_instruction[_o++]);
1799 }
ParseSRem(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1800 void ParseSRem(const uint32_t *_instruction,
1801                IdResultType *idResultType,
1802                IdResult *idResult,
1803                IdRef *operand1,
1804                IdRef *operand2)
1805 {
1806     spv::Op _op;
1807     uint32_t _length;
1808     GetInstructionOpAndLength(_instruction, &_op, &_length);
1809     ASSERT(_op == spv::OpSRem);
1810     uint32_t _o   = 1;
1811     *idResultType = IdResultType(_instruction[_o++]);
1812     *idResult     = IdResult(_instruction[_o++]);
1813     *operand1     = IdRef(_instruction[_o++]);
1814     *operand2     = IdRef(_instruction[_o++]);
1815 }
ParseSMod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1816 void ParseSMod(const uint32_t *_instruction,
1817                IdResultType *idResultType,
1818                IdResult *idResult,
1819                IdRef *operand1,
1820                IdRef *operand2)
1821 {
1822     spv::Op _op;
1823     uint32_t _length;
1824     GetInstructionOpAndLength(_instruction, &_op, &_length);
1825     ASSERT(_op == spv::OpSMod);
1826     uint32_t _o   = 1;
1827     *idResultType = IdResultType(_instruction[_o++]);
1828     *idResult     = IdResult(_instruction[_o++]);
1829     *operand1     = IdRef(_instruction[_o++]);
1830     *operand2     = IdRef(_instruction[_o++]);
1831 }
ParseFRem(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1832 void ParseFRem(const uint32_t *_instruction,
1833                IdResultType *idResultType,
1834                IdResult *idResult,
1835                IdRef *operand1,
1836                IdRef *operand2)
1837 {
1838     spv::Op _op;
1839     uint32_t _length;
1840     GetInstructionOpAndLength(_instruction, &_op, &_length);
1841     ASSERT(_op == spv::OpFRem);
1842     uint32_t _o   = 1;
1843     *idResultType = IdResultType(_instruction[_o++]);
1844     *idResult     = IdResult(_instruction[_o++]);
1845     *operand1     = IdRef(_instruction[_o++]);
1846     *operand2     = IdRef(_instruction[_o++]);
1847 }
ParseFMod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1848 void ParseFMod(const uint32_t *_instruction,
1849                IdResultType *idResultType,
1850                IdResult *idResult,
1851                IdRef *operand1,
1852                IdRef *operand2)
1853 {
1854     spv::Op _op;
1855     uint32_t _length;
1856     GetInstructionOpAndLength(_instruction, &_op, &_length);
1857     ASSERT(_op == spv::OpFMod);
1858     uint32_t _o   = 1;
1859     *idResultType = IdResultType(_instruction[_o++]);
1860     *idResult     = IdResult(_instruction[_o++]);
1861     *operand1     = IdRef(_instruction[_o++]);
1862     *operand2     = IdRef(_instruction[_o++]);
1863 }
ParseVectorTimesScalar(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector,IdRef * scalar)1864 void ParseVectorTimesScalar(const uint32_t *_instruction,
1865                             IdResultType *idResultType,
1866                             IdResult *idResult,
1867                             IdRef *vector,
1868                             IdRef *scalar)
1869 {
1870     spv::Op _op;
1871     uint32_t _length;
1872     GetInstructionOpAndLength(_instruction, &_op, &_length);
1873     ASSERT(_op == spv::OpVectorTimesScalar);
1874     uint32_t _o   = 1;
1875     *idResultType = IdResultType(_instruction[_o++]);
1876     *idResult     = IdResult(_instruction[_o++]);
1877     *vector       = IdRef(_instruction[_o++]);
1878     *scalar       = IdRef(_instruction[_o++]);
1879 }
ParseMatrixTimesScalar(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * matrix,IdRef * scalar)1880 void ParseMatrixTimesScalar(const uint32_t *_instruction,
1881                             IdResultType *idResultType,
1882                             IdResult *idResult,
1883                             IdRef *matrix,
1884                             IdRef *scalar)
1885 {
1886     spv::Op _op;
1887     uint32_t _length;
1888     GetInstructionOpAndLength(_instruction, &_op, &_length);
1889     ASSERT(_op == spv::OpMatrixTimesScalar);
1890     uint32_t _o   = 1;
1891     *idResultType = IdResultType(_instruction[_o++]);
1892     *idResult     = IdResult(_instruction[_o++]);
1893     *matrix       = IdRef(_instruction[_o++]);
1894     *scalar       = IdRef(_instruction[_o++]);
1895 }
ParseVectorTimesMatrix(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector,IdRef * matrix)1896 void ParseVectorTimesMatrix(const uint32_t *_instruction,
1897                             IdResultType *idResultType,
1898                             IdResult *idResult,
1899                             IdRef *vector,
1900                             IdRef *matrix)
1901 {
1902     spv::Op _op;
1903     uint32_t _length;
1904     GetInstructionOpAndLength(_instruction, &_op, &_length);
1905     ASSERT(_op == spv::OpVectorTimesMatrix);
1906     uint32_t _o   = 1;
1907     *idResultType = IdResultType(_instruction[_o++]);
1908     *idResult     = IdResult(_instruction[_o++]);
1909     *vector       = IdRef(_instruction[_o++]);
1910     *matrix       = IdRef(_instruction[_o++]);
1911 }
ParseMatrixTimesVector(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * matrix,IdRef * vector)1912 void ParseMatrixTimesVector(const uint32_t *_instruction,
1913                             IdResultType *idResultType,
1914                             IdResult *idResult,
1915                             IdRef *matrix,
1916                             IdRef *vector)
1917 {
1918     spv::Op _op;
1919     uint32_t _length;
1920     GetInstructionOpAndLength(_instruction, &_op, &_length);
1921     ASSERT(_op == spv::OpMatrixTimesVector);
1922     uint32_t _o   = 1;
1923     *idResultType = IdResultType(_instruction[_o++]);
1924     *idResult     = IdResult(_instruction[_o++]);
1925     *matrix       = IdRef(_instruction[_o++]);
1926     *vector       = IdRef(_instruction[_o++]);
1927 }
ParseMatrixTimesMatrix(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * leftMatrix,IdRef * rightMatrix)1928 void ParseMatrixTimesMatrix(const uint32_t *_instruction,
1929                             IdResultType *idResultType,
1930                             IdResult *idResult,
1931                             IdRef *leftMatrix,
1932                             IdRef *rightMatrix)
1933 {
1934     spv::Op _op;
1935     uint32_t _length;
1936     GetInstructionOpAndLength(_instruction, &_op, &_length);
1937     ASSERT(_op == spv::OpMatrixTimesMatrix);
1938     uint32_t _o   = 1;
1939     *idResultType = IdResultType(_instruction[_o++]);
1940     *idResult     = IdResult(_instruction[_o++]);
1941     *leftMatrix   = IdRef(_instruction[_o++]);
1942     *rightMatrix  = IdRef(_instruction[_o++]);
1943 }
ParseOuterProduct(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector1,IdRef * vector2)1944 void ParseOuterProduct(const uint32_t *_instruction,
1945                        IdResultType *idResultType,
1946                        IdResult *idResult,
1947                        IdRef *vector1,
1948                        IdRef *vector2)
1949 {
1950     spv::Op _op;
1951     uint32_t _length;
1952     GetInstructionOpAndLength(_instruction, &_op, &_length);
1953     ASSERT(_op == spv::OpOuterProduct);
1954     uint32_t _o   = 1;
1955     *idResultType = IdResultType(_instruction[_o++]);
1956     *idResult     = IdResult(_instruction[_o++]);
1957     *vector1      = IdRef(_instruction[_o++]);
1958     *vector2      = IdRef(_instruction[_o++]);
1959 }
ParseDot(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector1,IdRef * vector2)1960 void ParseDot(const uint32_t *_instruction,
1961               IdResultType *idResultType,
1962               IdResult *idResult,
1963               IdRef *vector1,
1964               IdRef *vector2)
1965 {
1966     spv::Op _op;
1967     uint32_t _length;
1968     GetInstructionOpAndLength(_instruction, &_op, &_length);
1969     ASSERT(_op == spv::OpDot);
1970     uint32_t _o   = 1;
1971     *idResultType = IdResultType(_instruction[_o++]);
1972     *idResult     = IdResult(_instruction[_o++]);
1973     *vector1      = IdRef(_instruction[_o++]);
1974     *vector2      = IdRef(_instruction[_o++]);
1975 }
ParseIAddCarry(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1976 void ParseIAddCarry(const uint32_t *_instruction,
1977                     IdResultType *idResultType,
1978                     IdResult *idResult,
1979                     IdRef *operand1,
1980                     IdRef *operand2)
1981 {
1982     spv::Op _op;
1983     uint32_t _length;
1984     GetInstructionOpAndLength(_instruction, &_op, &_length);
1985     ASSERT(_op == spv::OpIAddCarry);
1986     uint32_t _o   = 1;
1987     *idResultType = IdResultType(_instruction[_o++]);
1988     *idResult     = IdResult(_instruction[_o++]);
1989     *operand1     = IdRef(_instruction[_o++]);
1990     *operand2     = IdRef(_instruction[_o++]);
1991 }
ParseISubBorrow(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)1992 void ParseISubBorrow(const uint32_t *_instruction,
1993                      IdResultType *idResultType,
1994                      IdResult *idResult,
1995                      IdRef *operand1,
1996                      IdRef *operand2)
1997 {
1998     spv::Op _op;
1999     uint32_t _length;
2000     GetInstructionOpAndLength(_instruction, &_op, &_length);
2001     ASSERT(_op == spv::OpISubBorrow);
2002     uint32_t _o   = 1;
2003     *idResultType = IdResultType(_instruction[_o++]);
2004     *idResult     = IdResult(_instruction[_o++]);
2005     *operand1     = IdRef(_instruction[_o++]);
2006     *operand2     = IdRef(_instruction[_o++]);
2007 }
ParseUMulExtended(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2008 void ParseUMulExtended(const uint32_t *_instruction,
2009                        IdResultType *idResultType,
2010                        IdResult *idResult,
2011                        IdRef *operand1,
2012                        IdRef *operand2)
2013 {
2014     spv::Op _op;
2015     uint32_t _length;
2016     GetInstructionOpAndLength(_instruction, &_op, &_length);
2017     ASSERT(_op == spv::OpUMulExtended);
2018     uint32_t _o   = 1;
2019     *idResultType = IdResultType(_instruction[_o++]);
2020     *idResult     = IdResult(_instruction[_o++]);
2021     *operand1     = IdRef(_instruction[_o++]);
2022     *operand2     = IdRef(_instruction[_o++]);
2023 }
ParseSMulExtended(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2024 void ParseSMulExtended(const uint32_t *_instruction,
2025                        IdResultType *idResultType,
2026                        IdResult *idResult,
2027                        IdRef *operand1,
2028                        IdRef *operand2)
2029 {
2030     spv::Op _op;
2031     uint32_t _length;
2032     GetInstructionOpAndLength(_instruction, &_op, &_length);
2033     ASSERT(_op == spv::OpSMulExtended);
2034     uint32_t _o   = 1;
2035     *idResultType = IdResultType(_instruction[_o++]);
2036     *idResult     = IdResult(_instruction[_o++]);
2037     *operand1     = IdRef(_instruction[_o++]);
2038     *operand2     = IdRef(_instruction[_o++]);
2039 }
ParseAny(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector)2040 void ParseAny(const uint32_t *_instruction,
2041               IdResultType *idResultType,
2042               IdResult *idResult,
2043               IdRef *vector)
2044 {
2045     spv::Op _op;
2046     uint32_t _length;
2047     GetInstructionOpAndLength(_instruction, &_op, &_length);
2048     ASSERT(_op == spv::OpAny);
2049     uint32_t _o   = 1;
2050     *idResultType = IdResultType(_instruction[_o++]);
2051     *idResult     = IdResult(_instruction[_o++]);
2052     *vector       = IdRef(_instruction[_o++]);
2053 }
ParseAll(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * vector)2054 void ParseAll(const uint32_t *_instruction,
2055               IdResultType *idResultType,
2056               IdResult *idResult,
2057               IdRef *vector)
2058 {
2059     spv::Op _op;
2060     uint32_t _length;
2061     GetInstructionOpAndLength(_instruction, &_op, &_length);
2062     ASSERT(_op == spv::OpAll);
2063     uint32_t _o   = 1;
2064     *idResultType = IdResultType(_instruction[_o++]);
2065     *idResult     = IdResult(_instruction[_o++]);
2066     *vector       = IdRef(_instruction[_o++]);
2067 }
ParseIsNan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * x)2068 void ParseIsNan(const uint32_t *_instruction,
2069                 IdResultType *idResultType,
2070                 IdResult *idResult,
2071                 IdRef *x)
2072 {
2073     spv::Op _op;
2074     uint32_t _length;
2075     GetInstructionOpAndLength(_instruction, &_op, &_length);
2076     ASSERT(_op == spv::OpIsNan);
2077     uint32_t _o   = 1;
2078     *idResultType = IdResultType(_instruction[_o++]);
2079     *idResult     = IdResult(_instruction[_o++]);
2080     *x            = IdRef(_instruction[_o++]);
2081 }
ParseIsInf(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * x)2082 void ParseIsInf(const uint32_t *_instruction,
2083                 IdResultType *idResultType,
2084                 IdResult *idResult,
2085                 IdRef *x)
2086 {
2087     spv::Op _op;
2088     uint32_t _length;
2089     GetInstructionOpAndLength(_instruction, &_op, &_length);
2090     ASSERT(_op == spv::OpIsInf);
2091     uint32_t _o   = 1;
2092     *idResultType = IdResultType(_instruction[_o++]);
2093     *idResult     = IdResult(_instruction[_o++]);
2094     *x            = IdRef(_instruction[_o++]);
2095 }
ParseLogicalEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2096 void ParseLogicalEqual(const uint32_t *_instruction,
2097                        IdResultType *idResultType,
2098                        IdResult *idResult,
2099                        IdRef *operand1,
2100                        IdRef *operand2)
2101 {
2102     spv::Op _op;
2103     uint32_t _length;
2104     GetInstructionOpAndLength(_instruction, &_op, &_length);
2105     ASSERT(_op == spv::OpLogicalEqual);
2106     uint32_t _o   = 1;
2107     *idResultType = IdResultType(_instruction[_o++]);
2108     *idResult     = IdResult(_instruction[_o++]);
2109     *operand1     = IdRef(_instruction[_o++]);
2110     *operand2     = IdRef(_instruction[_o++]);
2111 }
ParseLogicalNotEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2112 void ParseLogicalNotEqual(const uint32_t *_instruction,
2113                           IdResultType *idResultType,
2114                           IdResult *idResult,
2115                           IdRef *operand1,
2116                           IdRef *operand2)
2117 {
2118     spv::Op _op;
2119     uint32_t _length;
2120     GetInstructionOpAndLength(_instruction, &_op, &_length);
2121     ASSERT(_op == spv::OpLogicalNotEqual);
2122     uint32_t _o   = 1;
2123     *idResultType = IdResultType(_instruction[_o++]);
2124     *idResult     = IdResult(_instruction[_o++]);
2125     *operand1     = IdRef(_instruction[_o++]);
2126     *operand2     = IdRef(_instruction[_o++]);
2127 }
ParseLogicalOr(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2128 void ParseLogicalOr(const uint32_t *_instruction,
2129                     IdResultType *idResultType,
2130                     IdResult *idResult,
2131                     IdRef *operand1,
2132                     IdRef *operand2)
2133 {
2134     spv::Op _op;
2135     uint32_t _length;
2136     GetInstructionOpAndLength(_instruction, &_op, &_length);
2137     ASSERT(_op == spv::OpLogicalOr);
2138     uint32_t _o   = 1;
2139     *idResultType = IdResultType(_instruction[_o++]);
2140     *idResult     = IdResult(_instruction[_o++]);
2141     *operand1     = IdRef(_instruction[_o++]);
2142     *operand2     = IdRef(_instruction[_o++]);
2143 }
ParseLogicalAnd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2144 void ParseLogicalAnd(const uint32_t *_instruction,
2145                      IdResultType *idResultType,
2146                      IdResult *idResult,
2147                      IdRef *operand1,
2148                      IdRef *operand2)
2149 {
2150     spv::Op _op;
2151     uint32_t _length;
2152     GetInstructionOpAndLength(_instruction, &_op, &_length);
2153     ASSERT(_op == spv::OpLogicalAnd);
2154     uint32_t _o   = 1;
2155     *idResultType = IdResultType(_instruction[_o++]);
2156     *idResult     = IdResult(_instruction[_o++]);
2157     *operand1     = IdRef(_instruction[_o++]);
2158     *operand2     = IdRef(_instruction[_o++]);
2159 }
ParseLogicalNot(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)2160 void ParseLogicalNot(const uint32_t *_instruction,
2161                      IdResultType *idResultType,
2162                      IdResult *idResult,
2163                      IdRef *operand)
2164 {
2165     spv::Op _op;
2166     uint32_t _length;
2167     GetInstructionOpAndLength(_instruction, &_op, &_length);
2168     ASSERT(_op == spv::OpLogicalNot);
2169     uint32_t _o   = 1;
2170     *idResultType = IdResultType(_instruction[_o++]);
2171     *idResult     = IdResult(_instruction[_o++]);
2172     *operand      = IdRef(_instruction[_o++]);
2173 }
ParseSelect(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * condition,IdRef * object1,IdRef * object2)2174 void ParseSelect(const uint32_t *_instruction,
2175                  IdResultType *idResultType,
2176                  IdResult *idResult,
2177                  IdRef *condition,
2178                  IdRef *object1,
2179                  IdRef *object2)
2180 {
2181     spv::Op _op;
2182     uint32_t _length;
2183     GetInstructionOpAndLength(_instruction, &_op, &_length);
2184     ASSERT(_op == spv::OpSelect);
2185     uint32_t _o   = 1;
2186     *idResultType = IdResultType(_instruction[_o++]);
2187     *idResult     = IdResult(_instruction[_o++]);
2188     *condition    = IdRef(_instruction[_o++]);
2189     *object1      = IdRef(_instruction[_o++]);
2190     *object2      = IdRef(_instruction[_o++]);
2191 }
ParseIEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2192 void ParseIEqual(const uint32_t *_instruction,
2193                  IdResultType *idResultType,
2194                  IdResult *idResult,
2195                  IdRef *operand1,
2196                  IdRef *operand2)
2197 {
2198     spv::Op _op;
2199     uint32_t _length;
2200     GetInstructionOpAndLength(_instruction, &_op, &_length);
2201     ASSERT(_op == spv::OpIEqual);
2202     uint32_t _o   = 1;
2203     *idResultType = IdResultType(_instruction[_o++]);
2204     *idResult     = IdResult(_instruction[_o++]);
2205     *operand1     = IdRef(_instruction[_o++]);
2206     *operand2     = IdRef(_instruction[_o++]);
2207 }
ParseINotEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2208 void ParseINotEqual(const uint32_t *_instruction,
2209                     IdResultType *idResultType,
2210                     IdResult *idResult,
2211                     IdRef *operand1,
2212                     IdRef *operand2)
2213 {
2214     spv::Op _op;
2215     uint32_t _length;
2216     GetInstructionOpAndLength(_instruction, &_op, &_length);
2217     ASSERT(_op == spv::OpINotEqual);
2218     uint32_t _o   = 1;
2219     *idResultType = IdResultType(_instruction[_o++]);
2220     *idResult     = IdResult(_instruction[_o++]);
2221     *operand1     = IdRef(_instruction[_o++]);
2222     *operand2     = IdRef(_instruction[_o++]);
2223 }
ParseUGreaterThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2224 void ParseUGreaterThan(const uint32_t *_instruction,
2225                        IdResultType *idResultType,
2226                        IdResult *idResult,
2227                        IdRef *operand1,
2228                        IdRef *operand2)
2229 {
2230     spv::Op _op;
2231     uint32_t _length;
2232     GetInstructionOpAndLength(_instruction, &_op, &_length);
2233     ASSERT(_op == spv::OpUGreaterThan);
2234     uint32_t _o   = 1;
2235     *idResultType = IdResultType(_instruction[_o++]);
2236     *idResult     = IdResult(_instruction[_o++]);
2237     *operand1     = IdRef(_instruction[_o++]);
2238     *operand2     = IdRef(_instruction[_o++]);
2239 }
ParseSGreaterThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2240 void ParseSGreaterThan(const uint32_t *_instruction,
2241                        IdResultType *idResultType,
2242                        IdResult *idResult,
2243                        IdRef *operand1,
2244                        IdRef *operand2)
2245 {
2246     spv::Op _op;
2247     uint32_t _length;
2248     GetInstructionOpAndLength(_instruction, &_op, &_length);
2249     ASSERT(_op == spv::OpSGreaterThan);
2250     uint32_t _o   = 1;
2251     *idResultType = IdResultType(_instruction[_o++]);
2252     *idResult     = IdResult(_instruction[_o++]);
2253     *operand1     = IdRef(_instruction[_o++]);
2254     *operand2     = IdRef(_instruction[_o++]);
2255 }
ParseUGreaterThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2256 void ParseUGreaterThanEqual(const uint32_t *_instruction,
2257                             IdResultType *idResultType,
2258                             IdResult *idResult,
2259                             IdRef *operand1,
2260                             IdRef *operand2)
2261 {
2262     spv::Op _op;
2263     uint32_t _length;
2264     GetInstructionOpAndLength(_instruction, &_op, &_length);
2265     ASSERT(_op == spv::OpUGreaterThanEqual);
2266     uint32_t _o   = 1;
2267     *idResultType = IdResultType(_instruction[_o++]);
2268     *idResult     = IdResult(_instruction[_o++]);
2269     *operand1     = IdRef(_instruction[_o++]);
2270     *operand2     = IdRef(_instruction[_o++]);
2271 }
ParseSGreaterThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2272 void ParseSGreaterThanEqual(const uint32_t *_instruction,
2273                             IdResultType *idResultType,
2274                             IdResult *idResult,
2275                             IdRef *operand1,
2276                             IdRef *operand2)
2277 {
2278     spv::Op _op;
2279     uint32_t _length;
2280     GetInstructionOpAndLength(_instruction, &_op, &_length);
2281     ASSERT(_op == spv::OpSGreaterThanEqual);
2282     uint32_t _o   = 1;
2283     *idResultType = IdResultType(_instruction[_o++]);
2284     *idResult     = IdResult(_instruction[_o++]);
2285     *operand1     = IdRef(_instruction[_o++]);
2286     *operand2     = IdRef(_instruction[_o++]);
2287 }
ParseULessThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2288 void ParseULessThan(const uint32_t *_instruction,
2289                     IdResultType *idResultType,
2290                     IdResult *idResult,
2291                     IdRef *operand1,
2292                     IdRef *operand2)
2293 {
2294     spv::Op _op;
2295     uint32_t _length;
2296     GetInstructionOpAndLength(_instruction, &_op, &_length);
2297     ASSERT(_op == spv::OpULessThan);
2298     uint32_t _o   = 1;
2299     *idResultType = IdResultType(_instruction[_o++]);
2300     *idResult     = IdResult(_instruction[_o++]);
2301     *operand1     = IdRef(_instruction[_o++]);
2302     *operand2     = IdRef(_instruction[_o++]);
2303 }
ParseSLessThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2304 void ParseSLessThan(const uint32_t *_instruction,
2305                     IdResultType *idResultType,
2306                     IdResult *idResult,
2307                     IdRef *operand1,
2308                     IdRef *operand2)
2309 {
2310     spv::Op _op;
2311     uint32_t _length;
2312     GetInstructionOpAndLength(_instruction, &_op, &_length);
2313     ASSERT(_op == spv::OpSLessThan);
2314     uint32_t _o   = 1;
2315     *idResultType = IdResultType(_instruction[_o++]);
2316     *idResult     = IdResult(_instruction[_o++]);
2317     *operand1     = IdRef(_instruction[_o++]);
2318     *operand2     = IdRef(_instruction[_o++]);
2319 }
ParseULessThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2320 void ParseULessThanEqual(const uint32_t *_instruction,
2321                          IdResultType *idResultType,
2322                          IdResult *idResult,
2323                          IdRef *operand1,
2324                          IdRef *operand2)
2325 {
2326     spv::Op _op;
2327     uint32_t _length;
2328     GetInstructionOpAndLength(_instruction, &_op, &_length);
2329     ASSERT(_op == spv::OpULessThanEqual);
2330     uint32_t _o   = 1;
2331     *idResultType = IdResultType(_instruction[_o++]);
2332     *idResult     = IdResult(_instruction[_o++]);
2333     *operand1     = IdRef(_instruction[_o++]);
2334     *operand2     = IdRef(_instruction[_o++]);
2335 }
ParseSLessThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2336 void ParseSLessThanEqual(const uint32_t *_instruction,
2337                          IdResultType *idResultType,
2338                          IdResult *idResult,
2339                          IdRef *operand1,
2340                          IdRef *operand2)
2341 {
2342     spv::Op _op;
2343     uint32_t _length;
2344     GetInstructionOpAndLength(_instruction, &_op, &_length);
2345     ASSERT(_op == spv::OpSLessThanEqual);
2346     uint32_t _o   = 1;
2347     *idResultType = IdResultType(_instruction[_o++]);
2348     *idResult     = IdResult(_instruction[_o++]);
2349     *operand1     = IdRef(_instruction[_o++]);
2350     *operand2     = IdRef(_instruction[_o++]);
2351 }
ParseFOrdEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2352 void ParseFOrdEqual(const uint32_t *_instruction,
2353                     IdResultType *idResultType,
2354                     IdResult *idResult,
2355                     IdRef *operand1,
2356                     IdRef *operand2)
2357 {
2358     spv::Op _op;
2359     uint32_t _length;
2360     GetInstructionOpAndLength(_instruction, &_op, &_length);
2361     ASSERT(_op == spv::OpFOrdEqual);
2362     uint32_t _o   = 1;
2363     *idResultType = IdResultType(_instruction[_o++]);
2364     *idResult     = IdResult(_instruction[_o++]);
2365     *operand1     = IdRef(_instruction[_o++]);
2366     *operand2     = IdRef(_instruction[_o++]);
2367 }
ParseFUnordEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2368 void ParseFUnordEqual(const uint32_t *_instruction,
2369                       IdResultType *idResultType,
2370                       IdResult *idResult,
2371                       IdRef *operand1,
2372                       IdRef *operand2)
2373 {
2374     spv::Op _op;
2375     uint32_t _length;
2376     GetInstructionOpAndLength(_instruction, &_op, &_length);
2377     ASSERT(_op == spv::OpFUnordEqual);
2378     uint32_t _o   = 1;
2379     *idResultType = IdResultType(_instruction[_o++]);
2380     *idResult     = IdResult(_instruction[_o++]);
2381     *operand1     = IdRef(_instruction[_o++]);
2382     *operand2     = IdRef(_instruction[_o++]);
2383 }
ParseFOrdNotEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2384 void ParseFOrdNotEqual(const uint32_t *_instruction,
2385                        IdResultType *idResultType,
2386                        IdResult *idResult,
2387                        IdRef *operand1,
2388                        IdRef *operand2)
2389 {
2390     spv::Op _op;
2391     uint32_t _length;
2392     GetInstructionOpAndLength(_instruction, &_op, &_length);
2393     ASSERT(_op == spv::OpFOrdNotEqual);
2394     uint32_t _o   = 1;
2395     *idResultType = IdResultType(_instruction[_o++]);
2396     *idResult     = IdResult(_instruction[_o++]);
2397     *operand1     = IdRef(_instruction[_o++]);
2398     *operand2     = IdRef(_instruction[_o++]);
2399 }
ParseFUnordNotEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2400 void ParseFUnordNotEqual(const uint32_t *_instruction,
2401                          IdResultType *idResultType,
2402                          IdResult *idResult,
2403                          IdRef *operand1,
2404                          IdRef *operand2)
2405 {
2406     spv::Op _op;
2407     uint32_t _length;
2408     GetInstructionOpAndLength(_instruction, &_op, &_length);
2409     ASSERT(_op == spv::OpFUnordNotEqual);
2410     uint32_t _o   = 1;
2411     *idResultType = IdResultType(_instruction[_o++]);
2412     *idResult     = IdResult(_instruction[_o++]);
2413     *operand1     = IdRef(_instruction[_o++]);
2414     *operand2     = IdRef(_instruction[_o++]);
2415 }
ParseFOrdLessThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2416 void ParseFOrdLessThan(const uint32_t *_instruction,
2417                        IdResultType *idResultType,
2418                        IdResult *idResult,
2419                        IdRef *operand1,
2420                        IdRef *operand2)
2421 {
2422     spv::Op _op;
2423     uint32_t _length;
2424     GetInstructionOpAndLength(_instruction, &_op, &_length);
2425     ASSERT(_op == spv::OpFOrdLessThan);
2426     uint32_t _o   = 1;
2427     *idResultType = IdResultType(_instruction[_o++]);
2428     *idResult     = IdResult(_instruction[_o++]);
2429     *operand1     = IdRef(_instruction[_o++]);
2430     *operand2     = IdRef(_instruction[_o++]);
2431 }
ParseFUnordLessThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2432 void ParseFUnordLessThan(const uint32_t *_instruction,
2433                          IdResultType *idResultType,
2434                          IdResult *idResult,
2435                          IdRef *operand1,
2436                          IdRef *operand2)
2437 {
2438     spv::Op _op;
2439     uint32_t _length;
2440     GetInstructionOpAndLength(_instruction, &_op, &_length);
2441     ASSERT(_op == spv::OpFUnordLessThan);
2442     uint32_t _o   = 1;
2443     *idResultType = IdResultType(_instruction[_o++]);
2444     *idResult     = IdResult(_instruction[_o++]);
2445     *operand1     = IdRef(_instruction[_o++]);
2446     *operand2     = IdRef(_instruction[_o++]);
2447 }
ParseFOrdGreaterThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2448 void ParseFOrdGreaterThan(const uint32_t *_instruction,
2449                           IdResultType *idResultType,
2450                           IdResult *idResult,
2451                           IdRef *operand1,
2452                           IdRef *operand2)
2453 {
2454     spv::Op _op;
2455     uint32_t _length;
2456     GetInstructionOpAndLength(_instruction, &_op, &_length);
2457     ASSERT(_op == spv::OpFOrdGreaterThan);
2458     uint32_t _o   = 1;
2459     *idResultType = IdResultType(_instruction[_o++]);
2460     *idResult     = IdResult(_instruction[_o++]);
2461     *operand1     = IdRef(_instruction[_o++]);
2462     *operand2     = IdRef(_instruction[_o++]);
2463 }
ParseFUnordGreaterThan(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2464 void ParseFUnordGreaterThan(const uint32_t *_instruction,
2465                             IdResultType *idResultType,
2466                             IdResult *idResult,
2467                             IdRef *operand1,
2468                             IdRef *operand2)
2469 {
2470     spv::Op _op;
2471     uint32_t _length;
2472     GetInstructionOpAndLength(_instruction, &_op, &_length);
2473     ASSERT(_op == spv::OpFUnordGreaterThan);
2474     uint32_t _o   = 1;
2475     *idResultType = IdResultType(_instruction[_o++]);
2476     *idResult     = IdResult(_instruction[_o++]);
2477     *operand1     = IdRef(_instruction[_o++]);
2478     *operand2     = IdRef(_instruction[_o++]);
2479 }
ParseFOrdLessThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2480 void ParseFOrdLessThanEqual(const uint32_t *_instruction,
2481                             IdResultType *idResultType,
2482                             IdResult *idResult,
2483                             IdRef *operand1,
2484                             IdRef *operand2)
2485 {
2486     spv::Op _op;
2487     uint32_t _length;
2488     GetInstructionOpAndLength(_instruction, &_op, &_length);
2489     ASSERT(_op == spv::OpFOrdLessThanEqual);
2490     uint32_t _o   = 1;
2491     *idResultType = IdResultType(_instruction[_o++]);
2492     *idResult     = IdResult(_instruction[_o++]);
2493     *operand1     = IdRef(_instruction[_o++]);
2494     *operand2     = IdRef(_instruction[_o++]);
2495 }
ParseFUnordLessThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2496 void ParseFUnordLessThanEqual(const uint32_t *_instruction,
2497                               IdResultType *idResultType,
2498                               IdResult *idResult,
2499                               IdRef *operand1,
2500                               IdRef *operand2)
2501 {
2502     spv::Op _op;
2503     uint32_t _length;
2504     GetInstructionOpAndLength(_instruction, &_op, &_length);
2505     ASSERT(_op == spv::OpFUnordLessThanEqual);
2506     uint32_t _o   = 1;
2507     *idResultType = IdResultType(_instruction[_o++]);
2508     *idResult     = IdResult(_instruction[_o++]);
2509     *operand1     = IdRef(_instruction[_o++]);
2510     *operand2     = IdRef(_instruction[_o++]);
2511 }
ParseFOrdGreaterThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2512 void ParseFOrdGreaterThanEqual(const uint32_t *_instruction,
2513                                IdResultType *idResultType,
2514                                IdResult *idResult,
2515                                IdRef *operand1,
2516                                IdRef *operand2)
2517 {
2518     spv::Op _op;
2519     uint32_t _length;
2520     GetInstructionOpAndLength(_instruction, &_op, &_length);
2521     ASSERT(_op == spv::OpFOrdGreaterThanEqual);
2522     uint32_t _o   = 1;
2523     *idResultType = IdResultType(_instruction[_o++]);
2524     *idResult     = IdResult(_instruction[_o++]);
2525     *operand1     = IdRef(_instruction[_o++]);
2526     *operand2     = IdRef(_instruction[_o++]);
2527 }
ParseFUnordGreaterThanEqual(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2528 void ParseFUnordGreaterThanEqual(const uint32_t *_instruction,
2529                                  IdResultType *idResultType,
2530                                  IdResult *idResult,
2531                                  IdRef *operand1,
2532                                  IdRef *operand2)
2533 {
2534     spv::Op _op;
2535     uint32_t _length;
2536     GetInstructionOpAndLength(_instruction, &_op, &_length);
2537     ASSERT(_op == spv::OpFUnordGreaterThanEqual);
2538     uint32_t _o   = 1;
2539     *idResultType = IdResultType(_instruction[_o++]);
2540     *idResult     = IdResult(_instruction[_o++]);
2541     *operand1     = IdRef(_instruction[_o++]);
2542     *operand2     = IdRef(_instruction[_o++]);
2543 }
ParseShiftRightLogical(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * shift)2544 void ParseShiftRightLogical(const uint32_t *_instruction,
2545                             IdResultType *idResultType,
2546                             IdResult *idResult,
2547                             IdRef *base,
2548                             IdRef *shift)
2549 {
2550     spv::Op _op;
2551     uint32_t _length;
2552     GetInstructionOpAndLength(_instruction, &_op, &_length);
2553     ASSERT(_op == spv::OpShiftRightLogical);
2554     uint32_t _o   = 1;
2555     *idResultType = IdResultType(_instruction[_o++]);
2556     *idResult     = IdResult(_instruction[_o++]);
2557     *base         = IdRef(_instruction[_o++]);
2558     *shift        = IdRef(_instruction[_o++]);
2559 }
ParseShiftRightArithmetic(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * shift)2560 void ParseShiftRightArithmetic(const uint32_t *_instruction,
2561                                IdResultType *idResultType,
2562                                IdResult *idResult,
2563                                IdRef *base,
2564                                IdRef *shift)
2565 {
2566     spv::Op _op;
2567     uint32_t _length;
2568     GetInstructionOpAndLength(_instruction, &_op, &_length);
2569     ASSERT(_op == spv::OpShiftRightArithmetic);
2570     uint32_t _o   = 1;
2571     *idResultType = IdResultType(_instruction[_o++]);
2572     *idResult     = IdResult(_instruction[_o++]);
2573     *base         = IdRef(_instruction[_o++]);
2574     *shift        = IdRef(_instruction[_o++]);
2575 }
ParseShiftLeftLogical(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * shift)2576 void ParseShiftLeftLogical(const uint32_t *_instruction,
2577                            IdResultType *idResultType,
2578                            IdResult *idResult,
2579                            IdRef *base,
2580                            IdRef *shift)
2581 {
2582     spv::Op _op;
2583     uint32_t _length;
2584     GetInstructionOpAndLength(_instruction, &_op, &_length);
2585     ASSERT(_op == spv::OpShiftLeftLogical);
2586     uint32_t _o   = 1;
2587     *idResultType = IdResultType(_instruction[_o++]);
2588     *idResult     = IdResult(_instruction[_o++]);
2589     *base         = IdRef(_instruction[_o++]);
2590     *shift        = IdRef(_instruction[_o++]);
2591 }
ParseBitwiseOr(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2592 void ParseBitwiseOr(const uint32_t *_instruction,
2593                     IdResultType *idResultType,
2594                     IdResult *idResult,
2595                     IdRef *operand1,
2596                     IdRef *operand2)
2597 {
2598     spv::Op _op;
2599     uint32_t _length;
2600     GetInstructionOpAndLength(_instruction, &_op, &_length);
2601     ASSERT(_op == spv::OpBitwiseOr);
2602     uint32_t _o   = 1;
2603     *idResultType = IdResultType(_instruction[_o++]);
2604     *idResult     = IdResult(_instruction[_o++]);
2605     *operand1     = IdRef(_instruction[_o++]);
2606     *operand2     = IdRef(_instruction[_o++]);
2607 }
ParseBitwiseXor(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2608 void ParseBitwiseXor(const uint32_t *_instruction,
2609                      IdResultType *idResultType,
2610                      IdResult *idResult,
2611                      IdRef *operand1,
2612                      IdRef *operand2)
2613 {
2614     spv::Op _op;
2615     uint32_t _length;
2616     GetInstructionOpAndLength(_instruction, &_op, &_length);
2617     ASSERT(_op == spv::OpBitwiseXor);
2618     uint32_t _o   = 1;
2619     *idResultType = IdResultType(_instruction[_o++]);
2620     *idResult     = IdResult(_instruction[_o++]);
2621     *operand1     = IdRef(_instruction[_o++]);
2622     *operand2     = IdRef(_instruction[_o++]);
2623 }
ParseBitwiseAnd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand1,IdRef * operand2)2624 void ParseBitwiseAnd(const uint32_t *_instruction,
2625                      IdResultType *idResultType,
2626                      IdResult *idResult,
2627                      IdRef *operand1,
2628                      IdRef *operand2)
2629 {
2630     spv::Op _op;
2631     uint32_t _length;
2632     GetInstructionOpAndLength(_instruction, &_op, &_length);
2633     ASSERT(_op == spv::OpBitwiseAnd);
2634     uint32_t _o   = 1;
2635     *idResultType = IdResultType(_instruction[_o++]);
2636     *idResult     = IdResult(_instruction[_o++]);
2637     *operand1     = IdRef(_instruction[_o++]);
2638     *operand2     = IdRef(_instruction[_o++]);
2639 }
ParseNot(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * operand)2640 void ParseNot(const uint32_t *_instruction,
2641               IdResultType *idResultType,
2642               IdResult *idResult,
2643               IdRef *operand)
2644 {
2645     spv::Op _op;
2646     uint32_t _length;
2647     GetInstructionOpAndLength(_instruction, &_op, &_length);
2648     ASSERT(_op == spv::OpNot);
2649     uint32_t _o   = 1;
2650     *idResultType = IdResultType(_instruction[_o++]);
2651     *idResult     = IdResult(_instruction[_o++]);
2652     *operand      = IdRef(_instruction[_o++]);
2653 }
ParseBitFieldInsert(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * insert,IdRef * offset,IdRef * count)2654 void ParseBitFieldInsert(const uint32_t *_instruction,
2655                          IdResultType *idResultType,
2656                          IdResult *idResult,
2657                          IdRef *base,
2658                          IdRef *insert,
2659                          IdRef *offset,
2660                          IdRef *count)
2661 {
2662     spv::Op _op;
2663     uint32_t _length;
2664     GetInstructionOpAndLength(_instruction, &_op, &_length);
2665     ASSERT(_op == spv::OpBitFieldInsert);
2666     uint32_t _o   = 1;
2667     *idResultType = IdResultType(_instruction[_o++]);
2668     *idResult     = IdResult(_instruction[_o++]);
2669     *base         = IdRef(_instruction[_o++]);
2670     *insert       = IdRef(_instruction[_o++]);
2671     *offset       = IdRef(_instruction[_o++]);
2672     *count        = IdRef(_instruction[_o++]);
2673 }
ParseBitFieldSExtract(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * offset,IdRef * count)2674 void ParseBitFieldSExtract(const uint32_t *_instruction,
2675                            IdResultType *idResultType,
2676                            IdResult *idResult,
2677                            IdRef *base,
2678                            IdRef *offset,
2679                            IdRef *count)
2680 {
2681     spv::Op _op;
2682     uint32_t _length;
2683     GetInstructionOpAndLength(_instruction, &_op, &_length);
2684     ASSERT(_op == spv::OpBitFieldSExtract);
2685     uint32_t _o   = 1;
2686     *idResultType = IdResultType(_instruction[_o++]);
2687     *idResult     = IdResult(_instruction[_o++]);
2688     *base         = IdRef(_instruction[_o++]);
2689     *offset       = IdRef(_instruction[_o++]);
2690     *count        = IdRef(_instruction[_o++]);
2691 }
ParseBitFieldUExtract(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base,IdRef * offset,IdRef * count)2692 void ParseBitFieldUExtract(const uint32_t *_instruction,
2693                            IdResultType *idResultType,
2694                            IdResult *idResult,
2695                            IdRef *base,
2696                            IdRef *offset,
2697                            IdRef *count)
2698 {
2699     spv::Op _op;
2700     uint32_t _length;
2701     GetInstructionOpAndLength(_instruction, &_op, &_length);
2702     ASSERT(_op == spv::OpBitFieldUExtract);
2703     uint32_t _o   = 1;
2704     *idResultType = IdResultType(_instruction[_o++]);
2705     *idResult     = IdResult(_instruction[_o++]);
2706     *base         = IdRef(_instruction[_o++]);
2707     *offset       = IdRef(_instruction[_o++]);
2708     *count        = IdRef(_instruction[_o++]);
2709 }
ParseBitReverse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base)2710 void ParseBitReverse(const uint32_t *_instruction,
2711                      IdResultType *idResultType,
2712                      IdResult *idResult,
2713                      IdRef *base)
2714 {
2715     spv::Op _op;
2716     uint32_t _length;
2717     GetInstructionOpAndLength(_instruction, &_op, &_length);
2718     ASSERT(_op == spv::OpBitReverse);
2719     uint32_t _o   = 1;
2720     *idResultType = IdResultType(_instruction[_o++]);
2721     *idResult     = IdResult(_instruction[_o++]);
2722     *base         = IdRef(_instruction[_o++]);
2723 }
ParseBitCount(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * base)2724 void ParseBitCount(const uint32_t *_instruction,
2725                    IdResultType *idResultType,
2726                    IdResult *idResult,
2727                    IdRef *base)
2728 {
2729     spv::Op _op;
2730     uint32_t _length;
2731     GetInstructionOpAndLength(_instruction, &_op, &_length);
2732     ASSERT(_op == spv::OpBitCount);
2733     uint32_t _o   = 1;
2734     *idResultType = IdResultType(_instruction[_o++]);
2735     *idResult     = IdResult(_instruction[_o++]);
2736     *base         = IdRef(_instruction[_o++]);
2737 }
ParseDPdx(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2738 void ParseDPdx(const uint32_t *_instruction,
2739                IdResultType *idResultType,
2740                IdResult *idResult,
2741                IdRef *p)
2742 {
2743     spv::Op _op;
2744     uint32_t _length;
2745     GetInstructionOpAndLength(_instruction, &_op, &_length);
2746     ASSERT(_op == spv::OpDPdx);
2747     uint32_t _o   = 1;
2748     *idResultType = IdResultType(_instruction[_o++]);
2749     *idResult     = IdResult(_instruction[_o++]);
2750     *p            = IdRef(_instruction[_o++]);
2751 }
ParseDPdy(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2752 void ParseDPdy(const uint32_t *_instruction,
2753                IdResultType *idResultType,
2754                IdResult *idResult,
2755                IdRef *p)
2756 {
2757     spv::Op _op;
2758     uint32_t _length;
2759     GetInstructionOpAndLength(_instruction, &_op, &_length);
2760     ASSERT(_op == spv::OpDPdy);
2761     uint32_t _o   = 1;
2762     *idResultType = IdResultType(_instruction[_o++]);
2763     *idResult     = IdResult(_instruction[_o++]);
2764     *p            = IdRef(_instruction[_o++]);
2765 }
ParseFwidth(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2766 void ParseFwidth(const uint32_t *_instruction,
2767                  IdResultType *idResultType,
2768                  IdResult *idResult,
2769                  IdRef *p)
2770 {
2771     spv::Op _op;
2772     uint32_t _length;
2773     GetInstructionOpAndLength(_instruction, &_op, &_length);
2774     ASSERT(_op == spv::OpFwidth);
2775     uint32_t _o   = 1;
2776     *idResultType = IdResultType(_instruction[_o++]);
2777     *idResult     = IdResult(_instruction[_o++]);
2778     *p            = IdRef(_instruction[_o++]);
2779 }
ParseDPdxFine(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2780 void ParseDPdxFine(const uint32_t *_instruction,
2781                    IdResultType *idResultType,
2782                    IdResult *idResult,
2783                    IdRef *p)
2784 {
2785     spv::Op _op;
2786     uint32_t _length;
2787     GetInstructionOpAndLength(_instruction, &_op, &_length);
2788     ASSERT(_op == spv::OpDPdxFine);
2789     uint32_t _o   = 1;
2790     *idResultType = IdResultType(_instruction[_o++]);
2791     *idResult     = IdResult(_instruction[_o++]);
2792     *p            = IdRef(_instruction[_o++]);
2793 }
ParseDPdyFine(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2794 void ParseDPdyFine(const uint32_t *_instruction,
2795                    IdResultType *idResultType,
2796                    IdResult *idResult,
2797                    IdRef *p)
2798 {
2799     spv::Op _op;
2800     uint32_t _length;
2801     GetInstructionOpAndLength(_instruction, &_op, &_length);
2802     ASSERT(_op == spv::OpDPdyFine);
2803     uint32_t _o   = 1;
2804     *idResultType = IdResultType(_instruction[_o++]);
2805     *idResult     = IdResult(_instruction[_o++]);
2806     *p            = IdRef(_instruction[_o++]);
2807 }
ParseFwidthFine(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2808 void ParseFwidthFine(const uint32_t *_instruction,
2809                      IdResultType *idResultType,
2810                      IdResult *idResult,
2811                      IdRef *p)
2812 {
2813     spv::Op _op;
2814     uint32_t _length;
2815     GetInstructionOpAndLength(_instruction, &_op, &_length);
2816     ASSERT(_op == spv::OpFwidthFine);
2817     uint32_t _o   = 1;
2818     *idResultType = IdResultType(_instruction[_o++]);
2819     *idResult     = IdResult(_instruction[_o++]);
2820     *p            = IdRef(_instruction[_o++]);
2821 }
ParseDPdxCoarse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2822 void ParseDPdxCoarse(const uint32_t *_instruction,
2823                      IdResultType *idResultType,
2824                      IdResult *idResult,
2825                      IdRef *p)
2826 {
2827     spv::Op _op;
2828     uint32_t _length;
2829     GetInstructionOpAndLength(_instruction, &_op, &_length);
2830     ASSERT(_op == spv::OpDPdxCoarse);
2831     uint32_t _o   = 1;
2832     *idResultType = IdResultType(_instruction[_o++]);
2833     *idResult     = IdResult(_instruction[_o++]);
2834     *p            = IdRef(_instruction[_o++]);
2835 }
ParseDPdyCoarse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2836 void ParseDPdyCoarse(const uint32_t *_instruction,
2837                      IdResultType *idResultType,
2838                      IdResult *idResult,
2839                      IdRef *p)
2840 {
2841     spv::Op _op;
2842     uint32_t _length;
2843     GetInstructionOpAndLength(_instruction, &_op, &_length);
2844     ASSERT(_op == spv::OpDPdyCoarse);
2845     uint32_t _o   = 1;
2846     *idResultType = IdResultType(_instruction[_o++]);
2847     *idResult     = IdResult(_instruction[_o++]);
2848     *p            = IdRef(_instruction[_o++]);
2849 }
ParseFwidthCoarse(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * p)2850 void ParseFwidthCoarse(const uint32_t *_instruction,
2851                        IdResultType *idResultType,
2852                        IdResult *idResult,
2853                        IdRef *p)
2854 {
2855     spv::Op _op;
2856     uint32_t _length;
2857     GetInstructionOpAndLength(_instruction, &_op, &_length);
2858     ASSERT(_op == spv::OpFwidthCoarse);
2859     uint32_t _o   = 1;
2860     *idResultType = IdResultType(_instruction[_o++]);
2861     *idResult     = IdResult(_instruction[_o++]);
2862     *p            = IdRef(_instruction[_o++]);
2863 }
ParseEmitStreamVertex(const uint32_t * _instruction,IdRef * stream)2864 void ParseEmitStreamVertex(const uint32_t *_instruction, IdRef *stream)
2865 {
2866     spv::Op _op;
2867     uint32_t _length;
2868     GetInstructionOpAndLength(_instruction, &_op, &_length);
2869     ASSERT(_op == spv::OpEmitStreamVertex);
2870     uint32_t _o = 1;
2871     *stream     = IdRef(_instruction[_o++]);
2872 }
ParseEndStreamPrimitive(const uint32_t * _instruction,IdRef * stream)2873 void ParseEndStreamPrimitive(const uint32_t *_instruction, IdRef *stream)
2874 {
2875     spv::Op _op;
2876     uint32_t _length;
2877     GetInstructionOpAndLength(_instruction, &_op, &_length);
2878     ASSERT(_op == spv::OpEndStreamPrimitive);
2879     uint32_t _o = 1;
2880     *stream     = IdRef(_instruction[_o++]);
2881 }
ParseControlBarrier(const uint32_t * _instruction,IdScope * execution,IdScope * memory,IdMemorySemantics * semantics)2882 void ParseControlBarrier(const uint32_t *_instruction,
2883                          IdScope *execution,
2884                          IdScope *memory,
2885                          IdMemorySemantics *semantics)
2886 {
2887     spv::Op _op;
2888     uint32_t _length;
2889     GetInstructionOpAndLength(_instruction, &_op, &_length);
2890     ASSERT(_op == spv::OpControlBarrier);
2891     uint32_t _o = 1;
2892     *execution  = IdScope(_instruction[_o++]);
2893     *memory     = IdScope(_instruction[_o++]);
2894     *semantics  = IdMemorySemantics(_instruction[_o++]);
2895 }
ParseMemoryBarrier(const uint32_t * _instruction,IdScope * memory,IdMemorySemantics * semantics)2896 void ParseMemoryBarrier(const uint32_t *_instruction, IdScope *memory, IdMemorySemantics *semantics)
2897 {
2898     spv::Op _op;
2899     uint32_t _length;
2900     GetInstructionOpAndLength(_instruction, &_op, &_length);
2901     ASSERT(_op == spv::OpMemoryBarrier);
2902     uint32_t _o = 1;
2903     *memory     = IdScope(_instruction[_o++]);
2904     *semantics  = IdMemorySemantics(_instruction[_o++]);
2905 }
ParseAtomicLoad(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics)2906 void ParseAtomicLoad(const uint32_t *_instruction,
2907                      IdResultType *idResultType,
2908                      IdResult *idResult,
2909                      IdRef *pointer,
2910                      IdScope *scope,
2911                      IdMemorySemantics *semantics)
2912 {
2913     spv::Op _op;
2914     uint32_t _length;
2915     GetInstructionOpAndLength(_instruction, &_op, &_length);
2916     ASSERT(_op == spv::OpAtomicLoad);
2917     uint32_t _o   = 1;
2918     *idResultType = IdResultType(_instruction[_o++]);
2919     *idResult     = IdResult(_instruction[_o++]);
2920     *pointer      = IdRef(_instruction[_o++]);
2921     *scope        = IdScope(_instruction[_o++]);
2922     *semantics    = IdMemorySemantics(_instruction[_o++]);
2923 }
ParseAtomicStore(const uint32_t * _instruction,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)2924 void ParseAtomicStore(const uint32_t *_instruction,
2925                       IdRef *pointer,
2926                       IdScope *scope,
2927                       IdMemorySemantics *semantics,
2928                       IdRef *value)
2929 {
2930     spv::Op _op;
2931     uint32_t _length;
2932     GetInstructionOpAndLength(_instruction, &_op, &_length);
2933     ASSERT(_op == spv::OpAtomicStore);
2934     uint32_t _o = 1;
2935     *pointer    = IdRef(_instruction[_o++]);
2936     *scope      = IdScope(_instruction[_o++]);
2937     *semantics  = IdMemorySemantics(_instruction[_o++]);
2938     *value      = IdRef(_instruction[_o++]);
2939 }
ParseAtomicExchange(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)2940 void ParseAtomicExchange(const uint32_t *_instruction,
2941                          IdResultType *idResultType,
2942                          IdResult *idResult,
2943                          IdRef *pointer,
2944                          IdScope *scope,
2945                          IdMemorySemantics *semantics,
2946                          IdRef *value)
2947 {
2948     spv::Op _op;
2949     uint32_t _length;
2950     GetInstructionOpAndLength(_instruction, &_op, &_length);
2951     ASSERT(_op == spv::OpAtomicExchange);
2952     uint32_t _o   = 1;
2953     *idResultType = IdResultType(_instruction[_o++]);
2954     *idResult     = IdResult(_instruction[_o++]);
2955     *pointer      = IdRef(_instruction[_o++]);
2956     *scope        = IdScope(_instruction[_o++]);
2957     *semantics    = IdMemorySemantics(_instruction[_o++]);
2958     *value        = IdRef(_instruction[_o++]);
2959 }
ParseAtomicCompareExchange(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * equal,IdMemorySemantics * unequal,IdRef * value,IdRef * comparator)2960 void ParseAtomicCompareExchange(const uint32_t *_instruction,
2961                                 IdResultType *idResultType,
2962                                 IdResult *idResult,
2963                                 IdRef *pointer,
2964                                 IdScope *scope,
2965                                 IdMemorySemantics *equal,
2966                                 IdMemorySemantics *unequal,
2967                                 IdRef *value,
2968                                 IdRef *comparator)
2969 {
2970     spv::Op _op;
2971     uint32_t _length;
2972     GetInstructionOpAndLength(_instruction, &_op, &_length);
2973     ASSERT(_op == spv::OpAtomicCompareExchange);
2974     uint32_t _o   = 1;
2975     *idResultType = IdResultType(_instruction[_o++]);
2976     *idResult     = IdResult(_instruction[_o++]);
2977     *pointer      = IdRef(_instruction[_o++]);
2978     *scope        = IdScope(_instruction[_o++]);
2979     *equal        = IdMemorySemantics(_instruction[_o++]);
2980     *unequal      = IdMemorySemantics(_instruction[_o++]);
2981     *value        = IdRef(_instruction[_o++]);
2982     *comparator   = IdRef(_instruction[_o++]);
2983 }
ParseAtomicIIncrement(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics)2984 void ParseAtomicIIncrement(const uint32_t *_instruction,
2985                            IdResultType *idResultType,
2986                            IdResult *idResult,
2987                            IdRef *pointer,
2988                            IdScope *scope,
2989                            IdMemorySemantics *semantics)
2990 {
2991     spv::Op _op;
2992     uint32_t _length;
2993     GetInstructionOpAndLength(_instruction, &_op, &_length);
2994     ASSERT(_op == spv::OpAtomicIIncrement);
2995     uint32_t _o   = 1;
2996     *idResultType = IdResultType(_instruction[_o++]);
2997     *idResult     = IdResult(_instruction[_o++]);
2998     *pointer      = IdRef(_instruction[_o++]);
2999     *scope        = IdScope(_instruction[_o++]);
3000     *semantics    = IdMemorySemantics(_instruction[_o++]);
3001 }
ParseAtomicIDecrement(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics)3002 void ParseAtomicIDecrement(const uint32_t *_instruction,
3003                            IdResultType *idResultType,
3004                            IdResult *idResult,
3005                            IdRef *pointer,
3006                            IdScope *scope,
3007                            IdMemorySemantics *semantics)
3008 {
3009     spv::Op _op;
3010     uint32_t _length;
3011     GetInstructionOpAndLength(_instruction, &_op, &_length);
3012     ASSERT(_op == spv::OpAtomicIDecrement);
3013     uint32_t _o   = 1;
3014     *idResultType = IdResultType(_instruction[_o++]);
3015     *idResult     = IdResult(_instruction[_o++]);
3016     *pointer      = IdRef(_instruction[_o++]);
3017     *scope        = IdScope(_instruction[_o++]);
3018     *semantics    = IdMemorySemantics(_instruction[_o++]);
3019 }
ParseAtomicIAdd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3020 void ParseAtomicIAdd(const uint32_t *_instruction,
3021                      IdResultType *idResultType,
3022                      IdResult *idResult,
3023                      IdRef *pointer,
3024                      IdScope *scope,
3025                      IdMemorySemantics *semantics,
3026                      IdRef *value)
3027 {
3028     spv::Op _op;
3029     uint32_t _length;
3030     GetInstructionOpAndLength(_instruction, &_op, &_length);
3031     ASSERT(_op == spv::OpAtomicIAdd);
3032     uint32_t _o   = 1;
3033     *idResultType = IdResultType(_instruction[_o++]);
3034     *idResult     = IdResult(_instruction[_o++]);
3035     *pointer      = IdRef(_instruction[_o++]);
3036     *scope        = IdScope(_instruction[_o++]);
3037     *semantics    = IdMemorySemantics(_instruction[_o++]);
3038     *value        = IdRef(_instruction[_o++]);
3039 }
ParseAtomicISub(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3040 void ParseAtomicISub(const uint32_t *_instruction,
3041                      IdResultType *idResultType,
3042                      IdResult *idResult,
3043                      IdRef *pointer,
3044                      IdScope *scope,
3045                      IdMemorySemantics *semantics,
3046                      IdRef *value)
3047 {
3048     spv::Op _op;
3049     uint32_t _length;
3050     GetInstructionOpAndLength(_instruction, &_op, &_length);
3051     ASSERT(_op == spv::OpAtomicISub);
3052     uint32_t _o   = 1;
3053     *idResultType = IdResultType(_instruction[_o++]);
3054     *idResult     = IdResult(_instruction[_o++]);
3055     *pointer      = IdRef(_instruction[_o++]);
3056     *scope        = IdScope(_instruction[_o++]);
3057     *semantics    = IdMemorySemantics(_instruction[_o++]);
3058     *value        = IdRef(_instruction[_o++]);
3059 }
ParseAtomicSMin(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3060 void ParseAtomicSMin(const uint32_t *_instruction,
3061                      IdResultType *idResultType,
3062                      IdResult *idResult,
3063                      IdRef *pointer,
3064                      IdScope *scope,
3065                      IdMemorySemantics *semantics,
3066                      IdRef *value)
3067 {
3068     spv::Op _op;
3069     uint32_t _length;
3070     GetInstructionOpAndLength(_instruction, &_op, &_length);
3071     ASSERT(_op == spv::OpAtomicSMin);
3072     uint32_t _o   = 1;
3073     *idResultType = IdResultType(_instruction[_o++]);
3074     *idResult     = IdResult(_instruction[_o++]);
3075     *pointer      = IdRef(_instruction[_o++]);
3076     *scope        = IdScope(_instruction[_o++]);
3077     *semantics    = IdMemorySemantics(_instruction[_o++]);
3078     *value        = IdRef(_instruction[_o++]);
3079 }
ParseAtomicUMin(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3080 void ParseAtomicUMin(const uint32_t *_instruction,
3081                      IdResultType *idResultType,
3082                      IdResult *idResult,
3083                      IdRef *pointer,
3084                      IdScope *scope,
3085                      IdMemorySemantics *semantics,
3086                      IdRef *value)
3087 {
3088     spv::Op _op;
3089     uint32_t _length;
3090     GetInstructionOpAndLength(_instruction, &_op, &_length);
3091     ASSERT(_op == spv::OpAtomicUMin);
3092     uint32_t _o   = 1;
3093     *idResultType = IdResultType(_instruction[_o++]);
3094     *idResult     = IdResult(_instruction[_o++]);
3095     *pointer      = IdRef(_instruction[_o++]);
3096     *scope        = IdScope(_instruction[_o++]);
3097     *semantics    = IdMemorySemantics(_instruction[_o++]);
3098     *value        = IdRef(_instruction[_o++]);
3099 }
ParseAtomicSMax(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3100 void ParseAtomicSMax(const uint32_t *_instruction,
3101                      IdResultType *idResultType,
3102                      IdResult *idResult,
3103                      IdRef *pointer,
3104                      IdScope *scope,
3105                      IdMemorySemantics *semantics,
3106                      IdRef *value)
3107 {
3108     spv::Op _op;
3109     uint32_t _length;
3110     GetInstructionOpAndLength(_instruction, &_op, &_length);
3111     ASSERT(_op == spv::OpAtomicSMax);
3112     uint32_t _o   = 1;
3113     *idResultType = IdResultType(_instruction[_o++]);
3114     *idResult     = IdResult(_instruction[_o++]);
3115     *pointer      = IdRef(_instruction[_o++]);
3116     *scope        = IdScope(_instruction[_o++]);
3117     *semantics    = IdMemorySemantics(_instruction[_o++]);
3118     *value        = IdRef(_instruction[_o++]);
3119 }
ParseAtomicUMax(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3120 void ParseAtomicUMax(const uint32_t *_instruction,
3121                      IdResultType *idResultType,
3122                      IdResult *idResult,
3123                      IdRef *pointer,
3124                      IdScope *scope,
3125                      IdMemorySemantics *semantics,
3126                      IdRef *value)
3127 {
3128     spv::Op _op;
3129     uint32_t _length;
3130     GetInstructionOpAndLength(_instruction, &_op, &_length);
3131     ASSERT(_op == spv::OpAtomicUMax);
3132     uint32_t _o   = 1;
3133     *idResultType = IdResultType(_instruction[_o++]);
3134     *idResult     = IdResult(_instruction[_o++]);
3135     *pointer      = IdRef(_instruction[_o++]);
3136     *scope        = IdScope(_instruction[_o++]);
3137     *semantics    = IdMemorySemantics(_instruction[_o++]);
3138     *value        = IdRef(_instruction[_o++]);
3139 }
ParseAtomicAnd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3140 void ParseAtomicAnd(const uint32_t *_instruction,
3141                     IdResultType *idResultType,
3142                     IdResult *idResult,
3143                     IdRef *pointer,
3144                     IdScope *scope,
3145                     IdMemorySemantics *semantics,
3146                     IdRef *value)
3147 {
3148     spv::Op _op;
3149     uint32_t _length;
3150     GetInstructionOpAndLength(_instruction, &_op, &_length);
3151     ASSERT(_op == spv::OpAtomicAnd);
3152     uint32_t _o   = 1;
3153     *idResultType = IdResultType(_instruction[_o++]);
3154     *idResult     = IdResult(_instruction[_o++]);
3155     *pointer      = IdRef(_instruction[_o++]);
3156     *scope        = IdScope(_instruction[_o++]);
3157     *semantics    = IdMemorySemantics(_instruction[_o++]);
3158     *value        = IdRef(_instruction[_o++]);
3159 }
ParseAtomicOr(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3160 void ParseAtomicOr(const uint32_t *_instruction,
3161                    IdResultType *idResultType,
3162                    IdResult *idResult,
3163                    IdRef *pointer,
3164                    IdScope *scope,
3165                    IdMemorySemantics *semantics,
3166                    IdRef *value)
3167 {
3168     spv::Op _op;
3169     uint32_t _length;
3170     GetInstructionOpAndLength(_instruction, &_op, &_length);
3171     ASSERT(_op == spv::OpAtomicOr);
3172     uint32_t _o   = 1;
3173     *idResultType = IdResultType(_instruction[_o++]);
3174     *idResult     = IdResult(_instruction[_o++]);
3175     *pointer      = IdRef(_instruction[_o++]);
3176     *scope        = IdScope(_instruction[_o++]);
3177     *semantics    = IdMemorySemantics(_instruction[_o++]);
3178     *value        = IdRef(_instruction[_o++]);
3179 }
ParseAtomicXor(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * pointer,IdScope * scope,IdMemorySemantics * semantics,IdRef * value)3180 void ParseAtomicXor(const uint32_t *_instruction,
3181                     IdResultType *idResultType,
3182                     IdResult *idResult,
3183                     IdRef *pointer,
3184                     IdScope *scope,
3185                     IdMemorySemantics *semantics,
3186                     IdRef *value)
3187 {
3188     spv::Op _op;
3189     uint32_t _length;
3190     GetInstructionOpAndLength(_instruction, &_op, &_length);
3191     ASSERT(_op == spv::OpAtomicXor);
3192     uint32_t _o   = 1;
3193     *idResultType = IdResultType(_instruction[_o++]);
3194     *idResult     = IdResult(_instruction[_o++]);
3195     *pointer      = IdRef(_instruction[_o++]);
3196     *scope        = IdScope(_instruction[_o++]);
3197     *semantics    = IdMemorySemantics(_instruction[_o++]);
3198     *value        = IdRef(_instruction[_o++]);
3199 }
ParsePhi(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,PairIdRefIdRefList * variableParentPairList)3200 void ParsePhi(const uint32_t *_instruction,
3201               IdResultType *idResultType,
3202               IdResult *idResult,
3203               PairIdRefIdRefList *variableParentPairList)
3204 {
3205     spv::Op _op;
3206     uint32_t _length;
3207     GetInstructionOpAndLength(_instruction, &_op, &_length);
3208     ASSERT(_op == spv::OpPhi);
3209     uint32_t _o   = 1;
3210     *idResultType = IdResultType(_instruction[_o++]);
3211     *idResult     = IdResult(_instruction[_o++]);
3212     if (variableParentPairList)
3213     {
3214         while (_o < _length)
3215         {
3216             variableParentPairList->emplace_back(
3217                 PairIdRefIdRef{IdRef(_instruction[_o]), IdRef(_instruction[_o + 1])});
3218             _o += 2;
3219         }
3220     }
3221 }
ParseLoopMerge(const uint32_t * _instruction,IdRef * mergeBlock,IdRef * continueTarget,spv::LoopControlMask * loopControl)3222 void ParseLoopMerge(const uint32_t *_instruction,
3223                     IdRef *mergeBlock,
3224                     IdRef *continueTarget,
3225                     spv::LoopControlMask *loopControl)
3226 {
3227     spv::Op _op;
3228     uint32_t _length;
3229     GetInstructionOpAndLength(_instruction, &_op, &_length);
3230     ASSERT(_op == spv::OpLoopMerge);
3231     uint32_t _o     = 1;
3232     *mergeBlock     = IdRef(_instruction[_o++]);
3233     *continueTarget = IdRef(_instruction[_o++]);
3234     *loopControl    = spv::LoopControlMask(_instruction[_o++]);
3235 }
ParseSelectionMerge(const uint32_t * _instruction,IdRef * mergeBlock,spv::SelectionControlMask * selectionControl)3236 void ParseSelectionMerge(const uint32_t *_instruction,
3237                          IdRef *mergeBlock,
3238                          spv::SelectionControlMask *selectionControl)
3239 {
3240     spv::Op _op;
3241     uint32_t _length;
3242     GetInstructionOpAndLength(_instruction, &_op, &_length);
3243     ASSERT(_op == spv::OpSelectionMerge);
3244     uint32_t _o       = 1;
3245     *mergeBlock       = IdRef(_instruction[_o++]);
3246     *selectionControl = spv::SelectionControlMask(_instruction[_o++]);
3247 }
ParseLabel(const uint32_t * _instruction,IdResult * idResult)3248 void ParseLabel(const uint32_t *_instruction, IdResult *idResult)
3249 {
3250     spv::Op _op;
3251     uint32_t _length;
3252     GetInstructionOpAndLength(_instruction, &_op, &_length);
3253     ASSERT(_op == spv::OpLabel);
3254     uint32_t _o = 1;
3255     *idResult   = IdResult(_instruction[_o++]);
3256 }
ParseBranch(const uint32_t * _instruction,IdRef * targetLabel)3257 void ParseBranch(const uint32_t *_instruction, IdRef *targetLabel)
3258 {
3259     spv::Op _op;
3260     uint32_t _length;
3261     GetInstructionOpAndLength(_instruction, &_op, &_length);
3262     ASSERT(_op == spv::OpBranch);
3263     uint32_t _o  = 1;
3264     *targetLabel = IdRef(_instruction[_o++]);
3265 }
ParseBranchConditional(const uint32_t * _instruction,IdRef * condition,IdRef * trueLabel,IdRef * falseLabel,LiteralIntegerList * branchweightsList)3266 void ParseBranchConditional(const uint32_t *_instruction,
3267                             IdRef *condition,
3268                             IdRef *trueLabel,
3269                             IdRef *falseLabel,
3270                             LiteralIntegerList *branchweightsList)
3271 {
3272     spv::Op _op;
3273     uint32_t _length;
3274     GetInstructionOpAndLength(_instruction, &_op, &_length);
3275     ASSERT(_op == spv::OpBranchConditional);
3276     uint32_t _o = 1;
3277     *condition  = IdRef(_instruction[_o++]);
3278     *trueLabel  = IdRef(_instruction[_o++]);
3279     *falseLabel = IdRef(_instruction[_o++]);
3280     if (branchweightsList)
3281     {
3282         while (_o < _length)
3283         {
3284             branchweightsList->emplace_back(_instruction[_o++]);
3285         }
3286     }
3287 }
ParseSwitch(const uint32_t * _instruction,IdRef * selector,IdRef * default_,PairLiteralIntegerIdRefList * targetPairList)3288 void ParseSwitch(const uint32_t *_instruction,
3289                  IdRef *selector,
3290                  IdRef *default_,
3291                  PairLiteralIntegerIdRefList *targetPairList)
3292 {
3293     spv::Op _op;
3294     uint32_t _length;
3295     GetInstructionOpAndLength(_instruction, &_op, &_length);
3296     ASSERT(_op == spv::OpSwitch);
3297     uint32_t _o = 1;
3298     *selector   = IdRef(_instruction[_o++]);
3299     *default_   = IdRef(_instruction[_o++]);
3300     if (targetPairList)
3301     {
3302         while (_o < _length)
3303         {
3304             targetPairList->emplace_back(PairLiteralIntegerIdRef{LiteralInteger(_instruction[_o]),
3305                                                                  IdRef(_instruction[_o + 1])});
3306             _o += 2;
3307         }
3308     }
3309 }
ParseReturnValue(const uint32_t * _instruction,IdRef * value)3310 void ParseReturnValue(const uint32_t *_instruction, IdRef *value)
3311 {
3312     spv::Op _op;
3313     uint32_t _length;
3314     GetInstructionOpAndLength(_instruction, &_op, &_length);
3315     ASSERT(_op == spv::OpReturnValue);
3316     uint32_t _o = 1;
3317     *value      = IdRef(_instruction[_o++]);
3318 }
ParseGroupAll(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,IdRef * predicate)3319 void ParseGroupAll(const uint32_t *_instruction,
3320                    IdResultType *idResultType,
3321                    IdResult *idResult,
3322                    IdScope *execution,
3323                    IdRef *predicate)
3324 {
3325     spv::Op _op;
3326     uint32_t _length;
3327     GetInstructionOpAndLength(_instruction, &_op, &_length);
3328     ASSERT(_op == spv::OpGroupAll);
3329     uint32_t _o   = 1;
3330     *idResultType = IdResultType(_instruction[_o++]);
3331     *idResult     = IdResult(_instruction[_o++]);
3332     *execution    = IdScope(_instruction[_o++]);
3333     *predicate    = IdRef(_instruction[_o++]);
3334 }
ParseGroupAny(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,IdRef * predicate)3335 void ParseGroupAny(const uint32_t *_instruction,
3336                    IdResultType *idResultType,
3337                    IdResult *idResult,
3338                    IdScope *execution,
3339                    IdRef *predicate)
3340 {
3341     spv::Op _op;
3342     uint32_t _length;
3343     GetInstructionOpAndLength(_instruction, &_op, &_length);
3344     ASSERT(_op == spv::OpGroupAny);
3345     uint32_t _o   = 1;
3346     *idResultType = IdResultType(_instruction[_o++]);
3347     *idResult     = IdResult(_instruction[_o++]);
3348     *execution    = IdScope(_instruction[_o++]);
3349     *predicate    = IdRef(_instruction[_o++]);
3350 }
ParseGroupBroadcast(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,IdRef * value,IdRef * localId)3351 void ParseGroupBroadcast(const uint32_t *_instruction,
3352                          IdResultType *idResultType,
3353                          IdResult *idResult,
3354                          IdScope *execution,
3355                          IdRef *value,
3356                          IdRef *localId)
3357 {
3358     spv::Op _op;
3359     uint32_t _length;
3360     GetInstructionOpAndLength(_instruction, &_op, &_length);
3361     ASSERT(_op == spv::OpGroupBroadcast);
3362     uint32_t _o   = 1;
3363     *idResultType = IdResultType(_instruction[_o++]);
3364     *idResult     = IdResult(_instruction[_o++]);
3365     *execution    = IdScope(_instruction[_o++]);
3366     *value        = IdRef(_instruction[_o++]);
3367     *localId      = IdRef(_instruction[_o++]);
3368 }
ParseGroupIAdd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3369 void ParseGroupIAdd(const uint32_t *_instruction,
3370                     IdResultType *idResultType,
3371                     IdResult *idResult,
3372                     IdScope *execution,
3373                     spv::GroupOperation *operation,
3374                     IdRef *x)
3375 {
3376     spv::Op _op;
3377     uint32_t _length;
3378     GetInstructionOpAndLength(_instruction, &_op, &_length);
3379     ASSERT(_op == spv::OpGroupIAdd);
3380     uint32_t _o   = 1;
3381     *idResultType = IdResultType(_instruction[_o++]);
3382     *idResult     = IdResult(_instruction[_o++]);
3383     *execution    = IdScope(_instruction[_o++]);
3384     *operation    = spv::GroupOperation(_instruction[_o++]);
3385     *x            = IdRef(_instruction[_o++]);
3386 }
ParseGroupFAdd(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3387 void ParseGroupFAdd(const uint32_t *_instruction,
3388                     IdResultType *idResultType,
3389                     IdResult *idResult,
3390                     IdScope *execution,
3391                     spv::GroupOperation *operation,
3392                     IdRef *x)
3393 {
3394     spv::Op _op;
3395     uint32_t _length;
3396     GetInstructionOpAndLength(_instruction, &_op, &_length);
3397     ASSERT(_op == spv::OpGroupFAdd);
3398     uint32_t _o   = 1;
3399     *idResultType = IdResultType(_instruction[_o++]);
3400     *idResult     = IdResult(_instruction[_o++]);
3401     *execution    = IdScope(_instruction[_o++]);
3402     *operation    = spv::GroupOperation(_instruction[_o++]);
3403     *x            = IdRef(_instruction[_o++]);
3404 }
ParseGroupFMin(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3405 void ParseGroupFMin(const uint32_t *_instruction,
3406                     IdResultType *idResultType,
3407                     IdResult *idResult,
3408                     IdScope *execution,
3409                     spv::GroupOperation *operation,
3410                     IdRef *x)
3411 {
3412     spv::Op _op;
3413     uint32_t _length;
3414     GetInstructionOpAndLength(_instruction, &_op, &_length);
3415     ASSERT(_op == spv::OpGroupFMin);
3416     uint32_t _o   = 1;
3417     *idResultType = IdResultType(_instruction[_o++]);
3418     *idResult     = IdResult(_instruction[_o++]);
3419     *execution    = IdScope(_instruction[_o++]);
3420     *operation    = spv::GroupOperation(_instruction[_o++]);
3421     *x            = IdRef(_instruction[_o++]);
3422 }
ParseGroupUMin(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3423 void ParseGroupUMin(const uint32_t *_instruction,
3424                     IdResultType *idResultType,
3425                     IdResult *idResult,
3426                     IdScope *execution,
3427                     spv::GroupOperation *operation,
3428                     IdRef *x)
3429 {
3430     spv::Op _op;
3431     uint32_t _length;
3432     GetInstructionOpAndLength(_instruction, &_op, &_length);
3433     ASSERT(_op == spv::OpGroupUMin);
3434     uint32_t _o   = 1;
3435     *idResultType = IdResultType(_instruction[_o++]);
3436     *idResult     = IdResult(_instruction[_o++]);
3437     *execution    = IdScope(_instruction[_o++]);
3438     *operation    = spv::GroupOperation(_instruction[_o++]);
3439     *x            = IdRef(_instruction[_o++]);
3440 }
ParseGroupSMin(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3441 void ParseGroupSMin(const uint32_t *_instruction,
3442                     IdResultType *idResultType,
3443                     IdResult *idResult,
3444                     IdScope *execution,
3445                     spv::GroupOperation *operation,
3446                     IdRef *x)
3447 {
3448     spv::Op _op;
3449     uint32_t _length;
3450     GetInstructionOpAndLength(_instruction, &_op, &_length);
3451     ASSERT(_op == spv::OpGroupSMin);
3452     uint32_t _o   = 1;
3453     *idResultType = IdResultType(_instruction[_o++]);
3454     *idResult     = IdResult(_instruction[_o++]);
3455     *execution    = IdScope(_instruction[_o++]);
3456     *operation    = spv::GroupOperation(_instruction[_o++]);
3457     *x            = IdRef(_instruction[_o++]);
3458 }
ParseGroupFMax(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3459 void ParseGroupFMax(const uint32_t *_instruction,
3460                     IdResultType *idResultType,
3461                     IdResult *idResult,
3462                     IdScope *execution,
3463                     spv::GroupOperation *operation,
3464                     IdRef *x)
3465 {
3466     spv::Op _op;
3467     uint32_t _length;
3468     GetInstructionOpAndLength(_instruction, &_op, &_length);
3469     ASSERT(_op == spv::OpGroupFMax);
3470     uint32_t _o   = 1;
3471     *idResultType = IdResultType(_instruction[_o++]);
3472     *idResult     = IdResult(_instruction[_o++]);
3473     *execution    = IdScope(_instruction[_o++]);
3474     *operation    = spv::GroupOperation(_instruction[_o++]);
3475     *x            = IdRef(_instruction[_o++]);
3476 }
ParseGroupUMax(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3477 void ParseGroupUMax(const uint32_t *_instruction,
3478                     IdResultType *idResultType,
3479                     IdResult *idResult,
3480                     IdScope *execution,
3481                     spv::GroupOperation *operation,
3482                     IdRef *x)
3483 {
3484     spv::Op _op;
3485     uint32_t _length;
3486     GetInstructionOpAndLength(_instruction, &_op, &_length);
3487     ASSERT(_op == spv::OpGroupUMax);
3488     uint32_t _o   = 1;
3489     *idResultType = IdResultType(_instruction[_o++]);
3490     *idResult     = IdResult(_instruction[_o++]);
3491     *execution    = IdScope(_instruction[_o++]);
3492     *operation    = spv::GroupOperation(_instruction[_o++]);
3493     *x            = IdRef(_instruction[_o++]);
3494 }
ParseGroupSMax(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3495 void ParseGroupSMax(const uint32_t *_instruction,
3496                     IdResultType *idResultType,
3497                     IdResult *idResult,
3498                     IdScope *execution,
3499                     spv::GroupOperation *operation,
3500                     IdRef *x)
3501 {
3502     spv::Op _op;
3503     uint32_t _length;
3504     GetInstructionOpAndLength(_instruction, &_op, &_length);
3505     ASSERT(_op == spv::OpGroupSMax);
3506     uint32_t _o   = 1;
3507     *idResultType = IdResultType(_instruction[_o++]);
3508     *idResult     = IdResult(_instruction[_o++]);
3509     *execution    = IdScope(_instruction[_o++]);
3510     *operation    = spv::GroupOperation(_instruction[_o++]);
3511     *x            = IdRef(_instruction[_o++]);
3512 }
ParseImageSparseSampleImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3513 void ParseImageSparseSampleImplicitLod(const uint32_t *_instruction,
3514                                        IdResultType *idResultType,
3515                                        IdResult *idResult,
3516                                        IdRef *sampledImage,
3517                                        IdRef *coordinate,
3518                                        spv::ImageOperandsMask *imageOperands,
3519                                        IdRefList *imageOperandIdsList)
3520 {
3521     spv::Op _op;
3522     uint32_t _length;
3523     GetInstructionOpAndLength(_instruction, &_op, &_length);
3524     ASSERT(_op == spv::OpImageSparseSampleImplicitLod);
3525     uint32_t _o   = 1;
3526     *idResultType = IdResultType(_instruction[_o++]);
3527     *idResult     = IdResult(_instruction[_o++]);
3528     *sampledImage = IdRef(_instruction[_o++]);
3529     *coordinate   = IdRef(_instruction[_o++]);
3530     if (imageOperands && _o < _length)
3531     {
3532         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3533     }
3534     if (imageOperandIdsList)
3535     {
3536         while (_o < _length)
3537         {
3538             imageOperandIdsList->emplace_back(_instruction[_o++]);
3539         }
3540     }
3541 }
ParseImageSparseSampleExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3542 void ParseImageSparseSampleExplicitLod(const uint32_t *_instruction,
3543                                        IdResultType *idResultType,
3544                                        IdResult *idResult,
3545                                        IdRef *sampledImage,
3546                                        IdRef *coordinate,
3547                                        spv::ImageOperandsMask *imageOperands,
3548                                        IdRefList *imageOperandIdsList)
3549 {
3550     spv::Op _op;
3551     uint32_t _length;
3552     GetInstructionOpAndLength(_instruction, &_op, &_length);
3553     ASSERT(_op == spv::OpImageSparseSampleExplicitLod);
3554     uint32_t _o    = 1;
3555     *idResultType  = IdResultType(_instruction[_o++]);
3556     *idResult      = IdResult(_instruction[_o++]);
3557     *sampledImage  = IdRef(_instruction[_o++]);
3558     *coordinate    = IdRef(_instruction[_o++]);
3559     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3560     if (imageOperandIdsList)
3561     {
3562         while (_o < _length)
3563         {
3564             imageOperandIdsList->emplace_back(_instruction[_o++]);
3565         }
3566     }
3567 }
ParseImageSparseSampleDrefImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3568 void ParseImageSparseSampleDrefImplicitLod(const uint32_t *_instruction,
3569                                            IdResultType *idResultType,
3570                                            IdResult *idResult,
3571                                            IdRef *sampledImage,
3572                                            IdRef *coordinate,
3573                                            IdRef *dref,
3574                                            spv::ImageOperandsMask *imageOperands,
3575                                            IdRefList *imageOperandIdsList)
3576 {
3577     spv::Op _op;
3578     uint32_t _length;
3579     GetInstructionOpAndLength(_instruction, &_op, &_length);
3580     ASSERT(_op == spv::OpImageSparseSampleDrefImplicitLod);
3581     uint32_t _o   = 1;
3582     *idResultType = IdResultType(_instruction[_o++]);
3583     *idResult     = IdResult(_instruction[_o++]);
3584     *sampledImage = IdRef(_instruction[_o++]);
3585     *coordinate   = IdRef(_instruction[_o++]);
3586     *dref         = IdRef(_instruction[_o++]);
3587     if (imageOperands && _o < _length)
3588     {
3589         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3590     }
3591     if (imageOperandIdsList)
3592     {
3593         while (_o < _length)
3594         {
3595             imageOperandIdsList->emplace_back(_instruction[_o++]);
3596         }
3597     }
3598 }
ParseImageSparseSampleDrefExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3599 void ParseImageSparseSampleDrefExplicitLod(const uint32_t *_instruction,
3600                                            IdResultType *idResultType,
3601                                            IdResult *idResult,
3602                                            IdRef *sampledImage,
3603                                            IdRef *coordinate,
3604                                            IdRef *dref,
3605                                            spv::ImageOperandsMask *imageOperands,
3606                                            IdRefList *imageOperandIdsList)
3607 {
3608     spv::Op _op;
3609     uint32_t _length;
3610     GetInstructionOpAndLength(_instruction, &_op, &_length);
3611     ASSERT(_op == spv::OpImageSparseSampleDrefExplicitLod);
3612     uint32_t _o    = 1;
3613     *idResultType  = IdResultType(_instruction[_o++]);
3614     *idResult      = IdResult(_instruction[_o++]);
3615     *sampledImage  = IdRef(_instruction[_o++]);
3616     *coordinate    = IdRef(_instruction[_o++]);
3617     *dref          = IdRef(_instruction[_o++]);
3618     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3619     if (imageOperandIdsList)
3620     {
3621         while (_o < _length)
3622         {
3623             imageOperandIdsList->emplace_back(_instruction[_o++]);
3624         }
3625     }
3626 }
ParseImageSparseSampleProjImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3627 void ParseImageSparseSampleProjImplicitLod(const uint32_t *_instruction,
3628                                            IdResultType *idResultType,
3629                                            IdResult *idResult,
3630                                            IdRef *sampledImage,
3631                                            IdRef *coordinate,
3632                                            spv::ImageOperandsMask *imageOperands,
3633                                            IdRefList *imageOperandIdsList)
3634 {
3635     spv::Op _op;
3636     uint32_t _length;
3637     GetInstructionOpAndLength(_instruction, &_op, &_length);
3638     ASSERT(_op == spv::OpImageSparseSampleProjImplicitLod);
3639     uint32_t _o   = 1;
3640     *idResultType = IdResultType(_instruction[_o++]);
3641     *idResult     = IdResult(_instruction[_o++]);
3642     *sampledImage = IdRef(_instruction[_o++]);
3643     *coordinate   = IdRef(_instruction[_o++]);
3644     if (imageOperands && _o < _length)
3645     {
3646         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3647     }
3648     if (imageOperandIdsList)
3649     {
3650         while (_o < _length)
3651         {
3652             imageOperandIdsList->emplace_back(_instruction[_o++]);
3653         }
3654     }
3655 }
ParseImageSparseSampleProjExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3656 void ParseImageSparseSampleProjExplicitLod(const uint32_t *_instruction,
3657                                            IdResultType *idResultType,
3658                                            IdResult *idResult,
3659                                            IdRef *sampledImage,
3660                                            IdRef *coordinate,
3661                                            spv::ImageOperandsMask *imageOperands,
3662                                            IdRefList *imageOperandIdsList)
3663 {
3664     spv::Op _op;
3665     uint32_t _length;
3666     GetInstructionOpAndLength(_instruction, &_op, &_length);
3667     ASSERT(_op == spv::OpImageSparseSampleProjExplicitLod);
3668     uint32_t _o    = 1;
3669     *idResultType  = IdResultType(_instruction[_o++]);
3670     *idResult      = IdResult(_instruction[_o++]);
3671     *sampledImage  = IdRef(_instruction[_o++]);
3672     *coordinate    = IdRef(_instruction[_o++]);
3673     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3674     if (imageOperandIdsList)
3675     {
3676         while (_o < _length)
3677         {
3678             imageOperandIdsList->emplace_back(_instruction[_o++]);
3679         }
3680     }
3681 }
ParseImageSparseSampleProjDrefImplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3682 void ParseImageSparseSampleProjDrefImplicitLod(const uint32_t *_instruction,
3683                                                IdResultType *idResultType,
3684                                                IdResult *idResult,
3685                                                IdRef *sampledImage,
3686                                                IdRef *coordinate,
3687                                                IdRef *dref,
3688                                                spv::ImageOperandsMask *imageOperands,
3689                                                IdRefList *imageOperandIdsList)
3690 {
3691     spv::Op _op;
3692     uint32_t _length;
3693     GetInstructionOpAndLength(_instruction, &_op, &_length);
3694     ASSERT(_op == spv::OpImageSparseSampleProjDrefImplicitLod);
3695     uint32_t _o   = 1;
3696     *idResultType = IdResultType(_instruction[_o++]);
3697     *idResult     = IdResult(_instruction[_o++]);
3698     *sampledImage = IdRef(_instruction[_o++]);
3699     *coordinate   = IdRef(_instruction[_o++]);
3700     *dref         = IdRef(_instruction[_o++]);
3701     if (imageOperands && _o < _length)
3702     {
3703         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3704     }
3705     if (imageOperandIdsList)
3706     {
3707         while (_o < _length)
3708         {
3709             imageOperandIdsList->emplace_back(_instruction[_o++]);
3710         }
3711     }
3712 }
ParseImageSparseSampleProjDrefExplicitLod(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3713 void ParseImageSparseSampleProjDrefExplicitLod(const uint32_t *_instruction,
3714                                                IdResultType *idResultType,
3715                                                IdResult *idResult,
3716                                                IdRef *sampledImage,
3717                                                IdRef *coordinate,
3718                                                IdRef *dref,
3719                                                spv::ImageOperandsMask *imageOperands,
3720                                                IdRefList *imageOperandIdsList)
3721 {
3722     spv::Op _op;
3723     uint32_t _length;
3724     GetInstructionOpAndLength(_instruction, &_op, &_length);
3725     ASSERT(_op == spv::OpImageSparseSampleProjDrefExplicitLod);
3726     uint32_t _o    = 1;
3727     *idResultType  = IdResultType(_instruction[_o++]);
3728     *idResult      = IdResult(_instruction[_o++]);
3729     *sampledImage  = IdRef(_instruction[_o++]);
3730     *coordinate    = IdRef(_instruction[_o++]);
3731     *dref          = IdRef(_instruction[_o++]);
3732     *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3733     if (imageOperandIdsList)
3734     {
3735         while (_o < _length)
3736         {
3737             imageOperandIdsList->emplace_back(_instruction[_o++]);
3738         }
3739     }
3740 }
ParseImageSparseFetch(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3741 void ParseImageSparseFetch(const uint32_t *_instruction,
3742                            IdResultType *idResultType,
3743                            IdResult *idResult,
3744                            IdRef *image,
3745                            IdRef *coordinate,
3746                            spv::ImageOperandsMask *imageOperands,
3747                            IdRefList *imageOperandIdsList)
3748 {
3749     spv::Op _op;
3750     uint32_t _length;
3751     GetInstructionOpAndLength(_instruction, &_op, &_length);
3752     ASSERT(_op == spv::OpImageSparseFetch);
3753     uint32_t _o   = 1;
3754     *idResultType = IdResultType(_instruction[_o++]);
3755     *idResult     = IdResult(_instruction[_o++]);
3756     *image        = IdRef(_instruction[_o++]);
3757     *coordinate   = IdRef(_instruction[_o++]);
3758     if (imageOperands && _o < _length)
3759     {
3760         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3761     }
3762     if (imageOperandIdsList)
3763     {
3764         while (_o < _length)
3765         {
3766             imageOperandIdsList->emplace_back(_instruction[_o++]);
3767         }
3768     }
3769 }
ParseImageSparseGather(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * component,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3770 void ParseImageSparseGather(const uint32_t *_instruction,
3771                             IdResultType *idResultType,
3772                             IdResult *idResult,
3773                             IdRef *sampledImage,
3774                             IdRef *coordinate,
3775                             IdRef *component,
3776                             spv::ImageOperandsMask *imageOperands,
3777                             IdRefList *imageOperandIdsList)
3778 {
3779     spv::Op _op;
3780     uint32_t _length;
3781     GetInstructionOpAndLength(_instruction, &_op, &_length);
3782     ASSERT(_op == spv::OpImageSparseGather);
3783     uint32_t _o   = 1;
3784     *idResultType = IdResultType(_instruction[_o++]);
3785     *idResult     = IdResult(_instruction[_o++]);
3786     *sampledImage = IdRef(_instruction[_o++]);
3787     *coordinate   = IdRef(_instruction[_o++]);
3788     *component    = IdRef(_instruction[_o++]);
3789     if (imageOperands && _o < _length)
3790     {
3791         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3792     }
3793     if (imageOperandIdsList)
3794     {
3795         while (_o < _length)
3796         {
3797             imageOperandIdsList->emplace_back(_instruction[_o++]);
3798         }
3799     }
3800 }
ParseImageSparseDrefGather(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * sampledImage,IdRef * coordinate,IdRef * dref,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3801 void ParseImageSparseDrefGather(const uint32_t *_instruction,
3802                                 IdResultType *idResultType,
3803                                 IdResult *idResult,
3804                                 IdRef *sampledImage,
3805                                 IdRef *coordinate,
3806                                 IdRef *dref,
3807                                 spv::ImageOperandsMask *imageOperands,
3808                                 IdRefList *imageOperandIdsList)
3809 {
3810     spv::Op _op;
3811     uint32_t _length;
3812     GetInstructionOpAndLength(_instruction, &_op, &_length);
3813     ASSERT(_op == spv::OpImageSparseDrefGather);
3814     uint32_t _o   = 1;
3815     *idResultType = IdResultType(_instruction[_o++]);
3816     *idResult     = IdResult(_instruction[_o++]);
3817     *sampledImage = IdRef(_instruction[_o++]);
3818     *coordinate   = IdRef(_instruction[_o++]);
3819     *dref         = IdRef(_instruction[_o++]);
3820     if (imageOperands && _o < _length)
3821     {
3822         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3823     }
3824     if (imageOperandIdsList)
3825     {
3826         while (_o < _length)
3827         {
3828             imageOperandIdsList->emplace_back(_instruction[_o++]);
3829         }
3830     }
3831 }
ParseImageSparseTexelsResident(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * residentCode)3832 void ParseImageSparseTexelsResident(const uint32_t *_instruction,
3833                                     IdResultType *idResultType,
3834                                     IdResult *idResult,
3835                                     IdRef *residentCode)
3836 {
3837     spv::Op _op;
3838     uint32_t _length;
3839     GetInstructionOpAndLength(_instruction, &_op, &_length);
3840     ASSERT(_op == spv::OpImageSparseTexelsResident);
3841     uint32_t _o   = 1;
3842     *idResultType = IdResultType(_instruction[_o++]);
3843     *idResult     = IdResult(_instruction[_o++]);
3844     *residentCode = IdRef(_instruction[_o++]);
3845 }
ParseImageSparseRead(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdRef * image,IdRef * coordinate,spv::ImageOperandsMask * imageOperands,IdRefList * imageOperandIdsList)3846 void ParseImageSparseRead(const uint32_t *_instruction,
3847                           IdResultType *idResultType,
3848                           IdResult *idResult,
3849                           IdRef *image,
3850                           IdRef *coordinate,
3851                           spv::ImageOperandsMask *imageOperands,
3852                           IdRefList *imageOperandIdsList)
3853 {
3854     spv::Op _op;
3855     uint32_t _length;
3856     GetInstructionOpAndLength(_instruction, &_op, &_length);
3857     ASSERT(_op == spv::OpImageSparseRead);
3858     uint32_t _o   = 1;
3859     *idResultType = IdResultType(_instruction[_o++]);
3860     *idResult     = IdResult(_instruction[_o++]);
3861     *image        = IdRef(_instruction[_o++]);
3862     *coordinate   = IdRef(_instruction[_o++]);
3863     if (imageOperands && _o < _length)
3864     {
3865         *imageOperands = spv::ImageOperandsMask(_instruction[_o++]);
3866     }
3867     if (imageOperandIdsList)
3868     {
3869         while (_o < _length)
3870         {
3871             imageOperandIdsList->emplace_back(_instruction[_o++]);
3872         }
3873     }
3874 }
ParseGroupIAddNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3875 void ParseGroupIAddNonUniformAMD(const uint32_t *_instruction,
3876                                  IdResultType *idResultType,
3877                                  IdResult *idResult,
3878                                  IdScope *execution,
3879                                  spv::GroupOperation *operation,
3880                                  IdRef *x)
3881 {
3882     spv::Op _op;
3883     uint32_t _length;
3884     GetInstructionOpAndLength(_instruction, &_op, &_length);
3885     ASSERT(_op == spv::OpGroupIAddNonUniformAMD);
3886     uint32_t _o   = 1;
3887     *idResultType = IdResultType(_instruction[_o++]);
3888     *idResult     = IdResult(_instruction[_o++]);
3889     *execution    = IdScope(_instruction[_o++]);
3890     *operation    = spv::GroupOperation(_instruction[_o++]);
3891     *x            = IdRef(_instruction[_o++]);
3892 }
ParseGroupFAddNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3893 void ParseGroupFAddNonUniformAMD(const uint32_t *_instruction,
3894                                  IdResultType *idResultType,
3895                                  IdResult *idResult,
3896                                  IdScope *execution,
3897                                  spv::GroupOperation *operation,
3898                                  IdRef *x)
3899 {
3900     spv::Op _op;
3901     uint32_t _length;
3902     GetInstructionOpAndLength(_instruction, &_op, &_length);
3903     ASSERT(_op == spv::OpGroupFAddNonUniformAMD);
3904     uint32_t _o   = 1;
3905     *idResultType = IdResultType(_instruction[_o++]);
3906     *idResult     = IdResult(_instruction[_o++]);
3907     *execution    = IdScope(_instruction[_o++]);
3908     *operation    = spv::GroupOperation(_instruction[_o++]);
3909     *x            = IdRef(_instruction[_o++]);
3910 }
ParseGroupFMinNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3911 void ParseGroupFMinNonUniformAMD(const uint32_t *_instruction,
3912                                  IdResultType *idResultType,
3913                                  IdResult *idResult,
3914                                  IdScope *execution,
3915                                  spv::GroupOperation *operation,
3916                                  IdRef *x)
3917 {
3918     spv::Op _op;
3919     uint32_t _length;
3920     GetInstructionOpAndLength(_instruction, &_op, &_length);
3921     ASSERT(_op == spv::OpGroupFMinNonUniformAMD);
3922     uint32_t _o   = 1;
3923     *idResultType = IdResultType(_instruction[_o++]);
3924     *idResult     = IdResult(_instruction[_o++]);
3925     *execution    = IdScope(_instruction[_o++]);
3926     *operation    = spv::GroupOperation(_instruction[_o++]);
3927     *x            = IdRef(_instruction[_o++]);
3928 }
ParseGroupUMinNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3929 void ParseGroupUMinNonUniformAMD(const uint32_t *_instruction,
3930                                  IdResultType *idResultType,
3931                                  IdResult *idResult,
3932                                  IdScope *execution,
3933                                  spv::GroupOperation *operation,
3934                                  IdRef *x)
3935 {
3936     spv::Op _op;
3937     uint32_t _length;
3938     GetInstructionOpAndLength(_instruction, &_op, &_length);
3939     ASSERT(_op == spv::OpGroupUMinNonUniformAMD);
3940     uint32_t _o   = 1;
3941     *idResultType = IdResultType(_instruction[_o++]);
3942     *idResult     = IdResult(_instruction[_o++]);
3943     *execution    = IdScope(_instruction[_o++]);
3944     *operation    = spv::GroupOperation(_instruction[_o++]);
3945     *x            = IdRef(_instruction[_o++]);
3946 }
ParseGroupSMinNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3947 void ParseGroupSMinNonUniformAMD(const uint32_t *_instruction,
3948                                  IdResultType *idResultType,
3949                                  IdResult *idResult,
3950                                  IdScope *execution,
3951                                  spv::GroupOperation *operation,
3952                                  IdRef *x)
3953 {
3954     spv::Op _op;
3955     uint32_t _length;
3956     GetInstructionOpAndLength(_instruction, &_op, &_length);
3957     ASSERT(_op == spv::OpGroupSMinNonUniformAMD);
3958     uint32_t _o   = 1;
3959     *idResultType = IdResultType(_instruction[_o++]);
3960     *idResult     = IdResult(_instruction[_o++]);
3961     *execution    = IdScope(_instruction[_o++]);
3962     *operation    = spv::GroupOperation(_instruction[_o++]);
3963     *x            = IdRef(_instruction[_o++]);
3964 }
ParseGroupFMaxNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3965 void ParseGroupFMaxNonUniformAMD(const uint32_t *_instruction,
3966                                  IdResultType *idResultType,
3967                                  IdResult *idResult,
3968                                  IdScope *execution,
3969                                  spv::GroupOperation *operation,
3970                                  IdRef *x)
3971 {
3972     spv::Op _op;
3973     uint32_t _length;
3974     GetInstructionOpAndLength(_instruction, &_op, &_length);
3975     ASSERT(_op == spv::OpGroupFMaxNonUniformAMD);
3976     uint32_t _o   = 1;
3977     *idResultType = IdResultType(_instruction[_o++]);
3978     *idResult     = IdResult(_instruction[_o++]);
3979     *execution    = IdScope(_instruction[_o++]);
3980     *operation    = spv::GroupOperation(_instruction[_o++]);
3981     *x            = IdRef(_instruction[_o++]);
3982 }
ParseGroupUMaxNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)3983 void ParseGroupUMaxNonUniformAMD(const uint32_t *_instruction,
3984                                  IdResultType *idResultType,
3985                                  IdResult *idResult,
3986                                  IdScope *execution,
3987                                  spv::GroupOperation *operation,
3988                                  IdRef *x)
3989 {
3990     spv::Op _op;
3991     uint32_t _length;
3992     GetInstructionOpAndLength(_instruction, &_op, &_length);
3993     ASSERT(_op == spv::OpGroupUMaxNonUniformAMD);
3994     uint32_t _o   = 1;
3995     *idResultType = IdResultType(_instruction[_o++]);
3996     *idResult     = IdResult(_instruction[_o++]);
3997     *execution    = IdScope(_instruction[_o++]);
3998     *operation    = spv::GroupOperation(_instruction[_o++]);
3999     *x            = IdRef(_instruction[_o++]);
4000 }
ParseGroupSMaxNonUniformAMD(const uint32_t * _instruction,IdResultType * idResultType,IdResult * idResult,IdScope * execution,spv::GroupOperation * operation,IdRef * x)4001 void ParseGroupSMaxNonUniformAMD(const uint32_t *_instruction,
4002                                  IdResultType *idResultType,
4003                                  IdResult *idResult,
4004                                  IdScope *execution,
4005                                  spv::GroupOperation *operation,
4006                                  IdRef *x)
4007 {
4008     spv::Op _op;
4009     uint32_t _length;
4010     GetInstructionOpAndLength(_instruction, &_op, &_length);
4011     ASSERT(_op == spv::OpGroupSMaxNonUniformAMD);
4012     uint32_t _o   = 1;
4013     *idResultType = IdResultType(_instruction[_o++]);
4014     *idResult     = IdResult(_instruction[_o++]);
4015     *execution    = IdScope(_instruction[_o++]);
4016     *operation    = spv::GroupOperation(_instruction[_o++]);
4017     *x            = IdRef(_instruction[_o++]);
4018 }
4019 
4020 }  // namespace spirv
4021 }  // namespace angle
4022