12 #include <spirv/unified1/spirv.h>
20 const uint32_t *Operands,
const Type *ResultType)
29 memcpy(this->Operands, Operands, NumOperands *
sizeof(uint32_t));
34 assert(
Opcode != SpvOpLabel);
39 this->
Next->Previous =
this;
40 I->
Next = std::unique_ptr<Instruction>(
this);
68 O <<
" %" << Operands[i];
83 CASE(SourceContinued);
85 CASE(SourceExtension);
105 CASE(TypeSampledImage);
107 CASE(TypeRuntimeArray);
113 CASE(TypeDeviceEvent);
117 CASE(TypeForwardPointer);
121 CASE(ConstantComposite);
122 CASE(ConstantSampler);
124 CASE(SpecConstantTrue);
125 CASE(SpecConstantFalse);
127 CASE(SpecConstantComposite);
128 CASE(SpecConstantOp);
130 CASE(FunctionParameter);
134 CASE(ImageTexelPointer);
138 CASE(CopyMemorySized);
140 CASE(InBoundsAccessChain);
141 CASE(PtrAccessChain);
143 CASE(GenericPtrMemSemantics);
144 CASE(InBoundsPtrAccessChain);
146 CASE(MemberDecorate);
147 CASE(DecorationGroup);
149 CASE(GroupMemberDecorate);
150 CASE(VectorExtractDynamic);
151 CASE(VectorInsertDynamic);
153 CASE(CompositeConstruct);
154 CASE(CompositeExtract);
155 CASE(CompositeInsert);
159 CASE(ImageSampleImplicitLod);
160 CASE(ImageSampleExplicitLod);
161 CASE(ImageSampleDrefImplicitLod);
162 CASE(ImageSampleDrefExplicitLod);
163 CASE(ImageSampleProjImplicitLod);
164 CASE(ImageSampleProjExplicitLod);
165 CASE(ImageSampleProjDrefImplicitLod);
166 CASE(ImageSampleProjDrefExplicitLod);
169 CASE(ImageDrefGather);
173 CASE(ImageQueryFormat);
174 CASE(ImageQueryOrder);
175 CASE(ImageQuerySizeLod);
176 CASE(ImageQuerySize);
178 CASE(ImageQueryLevels);
179 CASE(ImageQuerySamples);
189 CASE(SatConvertSToU);
190 CASE(SatConvertUToS);
192 CASE(PtrCastToGeneric);
193 CASE(GenericCastToPtr);
194 CASE(GenericCastToPtrExplicit);
212 CASE(VectorTimesScalar);
213 CASE(MatrixTimesScalar);
214 CASE(VectorTimesMatrix);
215 CASE(MatrixTimesVector);
216 CASE(MatrixTimesMatrix);
234 CASE(LogicalNotEqual);
243 CASE(UGreaterThanEqual);
244 CASE(SGreaterThanEqual);
247 CASE(ULessThanEqual);
248 CASE(SLessThanEqual);
252 CASE(FUnordNotEqual);
254 CASE(FUnordLessThan);
255 CASE(FOrdGreaterThan);
256 CASE(FUnordGreaterThan);
257 CASE(FOrdLessThanEqual);
258 CASE(FUnordLessThanEqual);
259 CASE(FOrdGreaterThanEqual);
260 CASE(FUnordGreaterThanEqual);
261 CASE(ShiftRightLogical);
262 CASE(ShiftRightArithmetic);
263 CASE(ShiftLeftLogical);
268 CASE(BitFieldInsert);
269 CASE(BitFieldSExtract);
270 CASE(BitFieldUExtract);
284 CASE(EmitStreamVertex);
285 CASE(EndStreamPrimitive);
286 CASE(ControlBarrier);
290 CASE(AtomicExchange);
291 CASE(AtomicCompareExchange);
292 CASE(AtomicCompareExchangeWeak);
293 CASE(AtomicIIncrement);
294 CASE(AtomicIDecrement);
306 CASE(SelectionMerge);
309 CASE(BranchConditional);
317 CASE(GroupAsyncCopy);
318 CASE(GroupWaitEvents);
321 CASE(GroupBroadcast);
332 CASE(ReservedReadPipe);
333 CASE(ReservedWritePipe);
334 CASE(ReserveReadPipePackets);
335 CASE(ReserveWritePipePackets);
336 CASE(CommitReadPipe);
337 CASE(CommitWritePipe);
338 CASE(IsValidReserveId);
339 CASE(GetNumPipePackets);
340 CASE(GetMaxPipePackets);
341 CASE(GroupReserveReadPipePackets);
342 CASE(GroupReserveWritePipePackets);
343 CASE(GroupCommitReadPipe);
344 CASE(GroupCommitWritePipe);
347 CASE(GetKernelNDrangeSubGroupCount);
348 CASE(GetKernelNDrangeMaxSubGroupSize);
349 CASE(GetKernelWorkGroupSize);
350 CASE(GetKernelPreferredWorkGroupSizeMultiple);
353 CASE(CreateUserEvent);
355 CASE(SetUserEventStatus);
356 CASE(CaptureEventProfilingInfo);
357 CASE(GetDefaultQueue);
359 CASE(ImageSparseSampleImplicitLod);
360 CASE(ImageSparseSampleExplicitLod);
361 CASE(ImageSparseSampleDrefImplicitLod);
362 CASE(ImageSparseSampleDrefExplicitLod);
363 CASE(ImageSparseSampleProjImplicitLod);
364 CASE(ImageSparseSampleProjExplicitLod);
365 CASE(ImageSparseSampleProjDrefImplicitLod);
366 CASE(ImageSparseSampleProjDrefExplicitLod);
367 CASE(ImageSparseFetch);
368 CASE(ImageSparseGather);
369 CASE(ImageSparseDrefGather);
370 CASE(ImageSparseTexelsResident);
372 CASE(AtomicFlagTestAndSet);
373 CASE(AtomicFlagClear);
374 CASE(ImageSparseRead);
376 CASE(TypePipeStorage);
377 CASE(ConstantPipeStorage);
378 CASE(CreatePipeFromPipeStorage);
379 CASE(GetKernelLocalSizeForSubgroupCount);
380 CASE(GetKernelMaxNumSubgroups);
381 CASE(TypeNamedBarrier);
382 CASE(NamedBarrierInitialize);
383 CASE(MemoryNamedBarrier);
384 CASE(ModuleProcessed);
385 CASE(ExecutionModeId);
387 CASE(SubgroupBallotKHR);
388 CASE(SubgroupFirstInvocationKHR);
389 CASE(SubgroupAllKHR);
390 CASE(SubgroupAnyKHR);
391 CASE(SubgroupAllEqualKHR);
392 CASE(SubgroupReadInvocationKHR);
393 CASE(GroupIAddNonUniformAMD);
394 CASE(GroupFAddNonUniformAMD);
395 CASE(GroupFMinNonUniformAMD);
396 CASE(GroupUMinNonUniformAMD);
397 CASE(GroupSMinNonUniformAMD);
398 CASE(GroupFMaxNonUniformAMD);
399 CASE(GroupUMaxNonUniformAMD);
400 CASE(GroupSMaxNonUniformAMD);
401 CASE(FragmentMaskFetchAMD);
402 CASE(FragmentFetchAMD);
403 CASE(SubgroupShuffleINTEL);
404 CASE(SubgroupShuffleDownINTEL);
405 CASE(SubgroupShuffleUpINTEL);
406 CASE(SubgroupShuffleXorINTEL);
407 CASE(SubgroupBlockReadINTEL);
408 CASE(SubgroupBlockWriteINTEL);
409 CASE(SubgroupImageBlockReadINTEL);
410 CASE(SubgroupImageBlockWriteINTEL);
This class represents a module-scope variable declaration.
uint16_t Opcode
The instruction opcode.
This class represents an image object.
A combination of an image and a sampler used to access it.
std::unique_ptr< Instruction > Next
The next instruction in the block.
This class represents a function in a SPIR-V Module.
uint32_t * Operands
The operand values.
void insertAfter(Instruction *I)
Insert this instruction into a sequence, immediately following I.
const Type * ResultType
The type of the instruction result.
This file declares the Instruction class.
Instruction(uint16_t Opcode, uint16_t NumOperands, const uint32_t *Operands, const Type *ResultType)
Create a new instruction.
void print(std::ostream &O, bool Align=true) const
Print a human-readable form of this instruction to O.
uint16_t NumOperands
The number of operands in this instruction.
This class represents a SPIR-V type.
This class represents a SPIR-V instruction.
const Instruction * Previous
The previous instruction in the block.
static const char * opcodeToString(uint16_t Opcode)
Return the string representation of an instruction opcode.
This class represents a shader entry point.