1 //===- SPIRVIsValidEnum.h - SPIR-V isValid enums ----------------*- C++ -*-===//
2 //
3 // The LLVM/SPIRV Translator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 // Copyright (c) 2014 Advanced Micro Devices, Inc. All rights reserved.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal with the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // Redistributions of source code must retain the above copyright notice,
18 // this list of conditions and the following disclaimers.
19 // Redistributions in binary form must reproduce the above copyright notice,
20 // this list of conditions and the following disclaimers in the documentation
21 // and/or other materials provided with the distribution.
22 // Neither the names of Advanced Micro Devices, Inc., nor the names of its
23 // contributors may be used to endorse or promote products derived from this
24 // Software without specific prior written permission.
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 // CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
31 // THE SOFTWARE.
32 //
33 //===----------------------------------------------------------------------===//
34 /// \file
35 ///
36 /// This file defines SPIR-V isValid enums.
37 ///
38 //===----------------------------------------------------------------------===//
39 // WARNING:
40 //
41 // This file has been generated using `tools/spirv-tool/gen_spirv.bash` and
42 // should not be modified manually. If the file needs to be updated, edit the
43 // script and any other source file instead, before re-generating this file.
44 //===----------------------------------------------------------------------===//
45
46 #ifndef SPIRVISVALIDENUM_H_
47 #define SPIRVISVALIDENUM_H_
48
49 #include "spirv.hpp"
50 #include "SPIRVEnum.h"
51
52 using namespace spv;
53
54 namespace SPIRV{
55
56 inline bool
isValid(spv::SourceLanguage V)57 isValid(spv::SourceLanguage V) {
58 switch(V) {
59 case SourceLanguageUnknown:
60 case SourceLanguageESSL:
61 case SourceLanguageGLSL:
62 case SourceLanguageOpenCL_C:
63 case SourceLanguageOpenCL_CPP:
64 return true;
65 default:
66 return false;
67 }
68 }
69
70 inline bool
isValid(spv::ExecutionModel V)71 isValid(spv::ExecutionModel V) {
72 switch(V) {
73 case ExecutionModelVertex:
74 case ExecutionModelTessellationControl:
75 case ExecutionModelTessellationEvaluation:
76 case ExecutionModelGeometry:
77 case ExecutionModelFragment:
78 case ExecutionModelGLCompute:
79 case ExecutionModelKernel:
80 return true;
81 default:
82 return false;
83 }
84 }
85
86 inline bool
isValid(spv::AddressingModel V)87 isValid(spv::AddressingModel V) {
88 switch(V) {
89 case AddressingModelLogical:
90 case AddressingModelPhysical32:
91 case AddressingModelPhysical64:
92 return true;
93 default:
94 return false;
95 }
96 }
97
98 inline bool
isValid(spv::MemoryModel V)99 isValid(spv::MemoryModel V) {
100 switch(V) {
101 case MemoryModelSimple:
102 case MemoryModelGLSL450:
103 case MemoryModelOpenCL:
104 return true;
105 default:
106 return false;
107 }
108 }
109
110 inline bool
isValid(spv::ExecutionMode V)111 isValid(spv::ExecutionMode V) {
112 switch(V) {
113 case ExecutionModeInvocations:
114 case ExecutionModeSpacingEqual:
115 case ExecutionModeSpacingFractionalEven:
116 case ExecutionModeSpacingFractionalOdd:
117 case ExecutionModeVertexOrderCw:
118 case ExecutionModeVertexOrderCcw:
119 case ExecutionModePixelCenterInteger:
120 case ExecutionModeOriginUpperLeft:
121 case ExecutionModeOriginLowerLeft:
122 case ExecutionModeEarlyFragmentTests:
123 case ExecutionModePointMode:
124 case ExecutionModeXfb:
125 case ExecutionModeDepthReplacing:
126 case ExecutionModeDepthGreater:
127 case ExecutionModeDepthLess:
128 case ExecutionModeDepthUnchanged:
129 case ExecutionModeLocalSize:
130 case ExecutionModeLocalSizeHint:
131 case ExecutionModeInputPoints:
132 case ExecutionModeInputLines:
133 case ExecutionModeInputLinesAdjacency:
134 case ExecutionModeTriangles:
135 case ExecutionModeInputTrianglesAdjacency:
136 case ExecutionModeQuads:
137 case ExecutionModeIsolines:
138 case ExecutionModeOutputVertices:
139 case ExecutionModeOutputPoints:
140 case ExecutionModeOutputLineStrip:
141 case ExecutionModeOutputTriangleStrip:
142 case ExecutionModeVecTypeHint:
143 case ExecutionModeContractionOff:
144 case ExecutionModeInitializer:
145 case ExecutionModeFinalizer:
146 case ExecutionModeSubgroupSize:
147 case ExecutionModeSubgroupsPerWorkgroup:
148 return true;
149 default:
150 return false;
151 }
152 }
153
154 inline bool
isValid(spv::StorageClass V)155 isValid(spv::StorageClass V) {
156 switch(V) {
157 case StorageClassUniformConstant:
158 case StorageClassInput:
159 case StorageClassUniform:
160 case StorageClassOutput:
161 case StorageClassWorkgroup:
162 case StorageClassCrossWorkgroup:
163 case StorageClassPrivate:
164 case StorageClassFunction:
165 case StorageClassGeneric:
166 case StorageClassPushConstant:
167 case StorageClassAtomicCounter:
168 case StorageClassImage:
169 return true;
170 default:
171 return false;
172 }
173 }
174
175 inline bool
isValid(spv::Dim V)176 isValid(spv::Dim V) {
177 switch(V) {
178 case Dim1D:
179 case Dim2D:
180 case Dim3D:
181 case DimCube:
182 case DimRect:
183 case DimBuffer:
184 case DimSubpassData:
185 return true;
186 default:
187 return false;
188 }
189 }
190
191 inline bool
isValid(spv::SamplerAddressingMode V)192 isValid(spv::SamplerAddressingMode V) {
193 switch(V) {
194 case SamplerAddressingModeNone:
195 case SamplerAddressingModeClampToEdge:
196 case SamplerAddressingModeClamp:
197 case SamplerAddressingModeRepeat:
198 case SamplerAddressingModeRepeatMirrored:
199 return true;
200 default:
201 return false;
202 }
203 }
204
205 inline bool
isValid(spv::SamplerFilterMode V)206 isValid(spv::SamplerFilterMode V) {
207 switch(V) {
208 case SamplerFilterModeNearest:
209 case SamplerFilterModeLinear:
210 return true;
211 default:
212 return false;
213 }
214 }
215
216 inline bool
isValid(spv::ImageFormat V)217 isValid(spv::ImageFormat V) {
218 switch(V) {
219 case ImageFormatUnknown:
220 case ImageFormatRgba32f:
221 case ImageFormatRgba16f:
222 case ImageFormatR32f:
223 case ImageFormatRgba8:
224 case ImageFormatRgba8Snorm:
225 case ImageFormatRg32f:
226 case ImageFormatRg16f:
227 case ImageFormatR11fG11fB10f:
228 case ImageFormatR16f:
229 case ImageFormatRgba16:
230 case ImageFormatRgb10A2:
231 case ImageFormatRg16:
232 case ImageFormatRg8:
233 case ImageFormatR16:
234 case ImageFormatR8:
235 case ImageFormatRgba16Snorm:
236 case ImageFormatRg16Snorm:
237 case ImageFormatRg8Snorm:
238 case ImageFormatR16Snorm:
239 case ImageFormatR8Snorm:
240 case ImageFormatRgba32i:
241 case ImageFormatRgba16i:
242 case ImageFormatRgba8i:
243 case ImageFormatR32i:
244 case ImageFormatRg32i:
245 case ImageFormatRg16i:
246 case ImageFormatRg8i:
247 case ImageFormatR16i:
248 case ImageFormatR8i:
249 case ImageFormatRgba32ui:
250 case ImageFormatRgba16ui:
251 case ImageFormatRgba8ui:
252 case ImageFormatR32ui:
253 case ImageFormatRgb10a2ui:
254 case ImageFormatRg32ui:
255 case ImageFormatRg16ui:
256 case ImageFormatRg8ui:
257 case ImageFormatR16ui:
258 case ImageFormatR8ui:
259 return true;
260 default:
261 return false;
262 }
263 }
264
265 inline bool
isValid(spv::ImageChannelOrder V)266 isValid(spv::ImageChannelOrder V) {
267 switch(V) {
268 case ImageChannelOrderR:
269 case ImageChannelOrderA:
270 case ImageChannelOrderRG:
271 case ImageChannelOrderRA:
272 case ImageChannelOrderRGB:
273 case ImageChannelOrderRGBA:
274 case ImageChannelOrderBGRA:
275 case ImageChannelOrderARGB:
276 case ImageChannelOrderIntensity:
277 case ImageChannelOrderLuminance:
278 case ImageChannelOrderRx:
279 case ImageChannelOrderRGx:
280 case ImageChannelOrderRGBx:
281 case ImageChannelOrderDepth:
282 case ImageChannelOrderDepthStencil:
283 case ImageChannelOrderABGR:
284 return true;
285 default:
286 return false;
287 }
288 }
289
290 inline bool
isValid(spv::ImageChannelDataType V)291 isValid(spv::ImageChannelDataType V) {
292 switch(V) {
293 case ImageChannelDataTypeSnormInt8:
294 case ImageChannelDataTypeSnormInt16:
295 case ImageChannelDataTypeUnormInt8:
296 case ImageChannelDataTypeUnormInt16:
297 case ImageChannelDataTypeUnormShort565:
298 case ImageChannelDataTypeUnormShort555:
299 case ImageChannelDataTypeUnormInt101010:
300 case ImageChannelDataTypeSignedInt8:
301 case ImageChannelDataTypeSignedInt16:
302 case ImageChannelDataTypeSignedInt32:
303 case ImageChannelDataTypeUnsignedInt8:
304 case ImageChannelDataTypeUnsignedInt16:
305 case ImageChannelDataTypeUnsignedInt32:
306 case ImageChannelDataTypeHalfFloat:
307 case ImageChannelDataTypeFloat:
308 case ImageChannelDataTypeUnormInt24:
309 case ImageChannelDataTypeUnormInt101010_2:
310 return true;
311 default:
312 return false;
313 }
314 }
315
316 inline bool
isValid(spv::FPRoundingMode V)317 isValid(spv::FPRoundingMode V) {
318 switch(V) {
319 case FPRoundingModeRTE:
320 case FPRoundingModeRTZ:
321 case FPRoundingModeRTP:
322 case FPRoundingModeRTN:
323 return true;
324 default:
325 return false;
326 }
327 }
328
329 inline bool
isValid(spv::LinkageType V)330 isValid(spv::LinkageType V) {
331 switch(V) {
332 case LinkageTypeExport:
333 case LinkageTypeImport:
334 case LinkageTypeInternal:
335 return true;
336 default:
337 return false;
338 }
339 }
340
341 inline bool
isValid(spv::AccessQualifier V)342 isValid(spv::AccessQualifier V) {
343 switch(V) {
344 case AccessQualifierReadOnly:
345 case AccessQualifierWriteOnly:
346 case AccessQualifierReadWrite:
347 return true;
348 default:
349 return false;
350 }
351 }
352
353 inline bool
isValid(spv::FunctionParameterAttribute V)354 isValid(spv::FunctionParameterAttribute V) {
355 switch(V) {
356 case FunctionParameterAttributeZext:
357 case FunctionParameterAttributeSext:
358 case FunctionParameterAttributeByVal:
359 case FunctionParameterAttributeSret:
360 case FunctionParameterAttributeNoAlias:
361 case FunctionParameterAttributeNoCapture:
362 case FunctionParameterAttributeNoWrite:
363 case FunctionParameterAttributeNoReadWrite:
364 return true;
365 default:
366 return false;
367 }
368 }
369
370 inline bool
isValid(spv::Decoration V)371 isValid(spv::Decoration V) {
372 switch(V) {
373 case DecorationRelaxedPrecision:
374 case DecorationSpecId:
375 case DecorationBlock:
376 case DecorationBufferBlock:
377 case DecorationRowMajor:
378 case DecorationColMajor:
379 case DecorationArrayStride:
380 case DecorationMatrixStride:
381 case DecorationGLSLShared:
382 case DecorationGLSLPacked:
383 case DecorationCPacked:
384 case DecorationBuiltIn:
385 case DecorationNoPerspective:
386 case DecorationFlat:
387 case DecorationPatch:
388 case DecorationCentroid:
389 case DecorationSample:
390 case DecorationInvariant:
391 case DecorationRestrict:
392 case DecorationAliased:
393 case DecorationVolatile:
394 case DecorationConstant:
395 case DecorationCoherent:
396 case DecorationNonWritable:
397 case DecorationNonReadable:
398 case DecorationUniform:
399 case DecorationSaturatedConversion:
400 case DecorationStream:
401 case DecorationLocation:
402 case DecorationComponent:
403 case DecorationIndex:
404 case DecorationBinding:
405 case DecorationDescriptorSet:
406 case DecorationOffset:
407 case DecorationXfbBuffer:
408 case DecorationXfbStride:
409 case DecorationFuncParamAttr:
410 case DecorationFPRoundingMode:
411 case DecorationFPFastMathMode:
412 case DecorationLinkageAttributes:
413 case DecorationNoContraction:
414 case DecorationInputAttachmentIndex:
415 case DecorationAlignment:
416 case DecorationMaxByteOffset:
417 return true;
418 default:
419 return false;
420 }
421 }
422
423 inline bool
isValid(spv::BuiltIn V)424 isValid(spv::BuiltIn V) {
425 switch(V) {
426 case BuiltInPosition:
427 case BuiltInPointSize:
428 case BuiltInClipDistance:
429 case BuiltInCullDistance:
430 case BuiltInVertexId:
431 case BuiltInInstanceId:
432 case BuiltInPrimitiveId:
433 case BuiltInInvocationId:
434 case BuiltInLayer:
435 case BuiltInViewportIndex:
436 case BuiltInTessLevelOuter:
437 case BuiltInTessLevelInner:
438 case BuiltInTessCoord:
439 case BuiltInPatchVertices:
440 case BuiltInFragCoord:
441 case BuiltInPointCoord:
442 case BuiltInFrontFacing:
443 case BuiltInSampleId:
444 case BuiltInSamplePosition:
445 case BuiltInSampleMask:
446 case BuiltInFragDepth:
447 case BuiltInHelperInvocation:
448 case BuiltInNumWorkgroups:
449 case BuiltInWorkgroupSize:
450 case BuiltInWorkgroupId:
451 case BuiltInLocalInvocationId:
452 case BuiltInGlobalInvocationId:
453 case BuiltInLocalInvocationIndex:
454 case BuiltInWorkDim:
455 case BuiltInGlobalSize:
456 case BuiltInEnqueuedWorkgroupSize:
457 case BuiltInGlobalOffset:
458 case BuiltInGlobalLinearId:
459 case BuiltInSubgroupSize:
460 case BuiltInSubgroupMaxSize:
461 case BuiltInNumSubgroups:
462 case BuiltInNumEnqueuedSubgroups:
463 case BuiltInSubgroupId:
464 case BuiltInSubgroupLocalInvocationId:
465 case BuiltInVertexIndex:
466 case BuiltInInstanceIndex:
467 return true;
468 default:
469 return false;
470 }
471 }
472
473 inline bool
isValid(spv::Scope V)474 isValid(spv::Scope V) {
475 switch(V) {
476 case ScopeCrossDevice:
477 case ScopeDevice:
478 case ScopeWorkgroup:
479 case ScopeSubgroup:
480 case ScopeInvocation:
481 return true;
482 default:
483 return false;
484 }
485 }
486
487 inline bool
isValid(spv::GroupOperation V)488 isValid(spv::GroupOperation V) {
489 switch(V) {
490 case GroupOperationReduce:
491 case GroupOperationInclusiveScan:
492 case GroupOperationExclusiveScan:
493 return true;
494 default:
495 return false;
496 }
497 }
498
499 inline bool
isValid(spv::KernelEnqueueFlags V)500 isValid(spv::KernelEnqueueFlags V) {
501 switch(V) {
502 case KernelEnqueueFlagsNoWait:
503 case KernelEnqueueFlagsWaitKernel:
504 case KernelEnqueueFlagsWaitWorkGroup:
505 return true;
506 default:
507 return false;
508 }
509 }
510
511 inline bool
isValid(spv::Capability V)512 isValid(spv::Capability V) {
513 switch(V) {
514 case CapabilityMatrix:
515 case CapabilityShader:
516 case CapabilityGeometry:
517 case CapabilityTessellation:
518 case CapabilityAddresses:
519 case CapabilityLinkage:
520 case CapabilityKernel:
521 case CapabilityVector16:
522 case CapabilityFloat16Buffer:
523 case CapabilityFloat16:
524 case CapabilityFloat64:
525 case CapabilityInt64:
526 case CapabilityInt64Atomics:
527 case CapabilityImageBasic:
528 case CapabilityImageReadWrite:
529 case CapabilityImageMipmap:
530 case CapabilityPipes:
531 case CapabilityGroups:
532 case CapabilityDeviceEnqueue:
533 case CapabilityLiteralSampler:
534 case CapabilityAtomicStorage:
535 case CapabilityInt16:
536 case CapabilityTessellationPointSize:
537 case CapabilityGeometryPointSize:
538 case CapabilityImageGatherExtended:
539 case CapabilityStorageImageMultisample:
540 case CapabilityUniformBufferArrayDynamicIndexing:
541 case CapabilitySampledImageArrayDynamicIndexing:
542 case CapabilityStorageBufferArrayDynamicIndexing:
543 case CapabilityStorageImageArrayDynamicIndexing:
544 case CapabilityClipDistance:
545 case CapabilityCullDistance:
546 case CapabilityImageCubeArray:
547 case CapabilitySampleRateShading:
548 case CapabilityImageRect:
549 case CapabilitySampledRect:
550 case CapabilityGenericPointer:
551 case CapabilityInt8:
552 case CapabilityInputAttachment:
553 case CapabilitySparseResidency:
554 case CapabilityMinLod:
555 case CapabilitySampled1D:
556 case CapabilityImage1D:
557 case CapabilitySampledCubeArray:
558 case CapabilitySampledBuffer:
559 case CapabilityImageBuffer:
560 case CapabilityImageMSArray:
561 case CapabilityStorageImageExtendedFormats:
562 case CapabilityImageQuery:
563 case CapabilityDerivativeControl:
564 case CapabilityInterpolationFunction:
565 case CapabilityTransformFeedback:
566 case CapabilityGeometryStreams:
567 case CapabilityStorageImageReadWithoutFormat:
568 case CapabilityStorageImageWriteWithoutFormat:
569 case CapabilityMultiViewport:
570 case CapabilitySubgroupDispatch:
571 case CapabilityNamedBarrier:
572 case CapabilityPipeStorage:
573 return true;
574 default:
575 return false;
576 }
577 }
578
579 inline bool
isValid(spv::Op V)580 isValid(spv::Op V) {
581 switch(V) {
582 case OpNop:
583 case OpUndef:
584 case OpSourceContinued:
585 case OpSource:
586 case OpSourceExtension:
587 case OpName:
588 case OpMemberName:
589 case OpString:
590 case OpLine:
591 case OpExtension:
592 case OpExtInstImport:
593 case OpExtInst:
594 case OpMemoryModel:
595 case OpEntryPoint:
596 case OpExecutionMode:
597 case OpCapability:
598 case OpTypeVoid:
599 case OpTypeBool:
600 case OpTypeInt:
601 case OpTypeFloat:
602 case OpTypeVector:
603 case OpTypeMatrix:
604 case OpTypeImage:
605 case OpTypeSampler:
606 case OpTypeSampledImage:
607 case OpTypeArray:
608 case OpTypeRuntimeArray:
609 case OpTypeStruct:
610 case OpTypeOpaque:
611 case OpTypePointer:
612 case OpTypeFunction:
613 case OpTypeEvent:
614 case OpTypeDeviceEvent:
615 case OpTypeReserveId:
616 case OpTypeQueue:
617 case OpTypePipe:
618 case OpTypeForwardPointer:
619 case OpConstantTrue:
620 case OpConstantFalse:
621 case OpConstant:
622 case OpConstantComposite:
623 case OpConstantSampler:
624 case OpConstantNull:
625 case OpSpecConstantTrue:
626 case OpSpecConstantFalse:
627 case OpSpecConstant:
628 case OpSpecConstantComposite:
629 case OpSpecConstantOp:
630 case OpFunction:
631 case OpFunctionParameter:
632 case OpFunctionEnd:
633 case OpFunctionCall:
634 case OpVariable:
635 case OpImageTexelPointer:
636 case OpLoad:
637 case OpStore:
638 case OpCopyMemory:
639 case OpCopyMemorySized:
640 case OpAccessChain:
641 case OpInBoundsAccessChain:
642 case OpPtrAccessChain:
643 case OpArrayLength:
644 case OpGenericPtrMemSemantics:
645 case OpInBoundsPtrAccessChain:
646 case OpDecorate:
647 case OpMemberDecorate:
648 case OpDecorationGroup:
649 case OpGroupDecorate:
650 case OpGroupMemberDecorate:
651 case OpVectorExtractDynamic:
652 case OpVectorInsertDynamic:
653 case OpVectorShuffle:
654 case OpCompositeConstruct:
655 case OpCompositeExtract:
656 case OpCompositeInsert:
657 case OpCopyObject:
658 case OpTranspose:
659 case OpSampledImage:
660 case OpImageSampleImplicitLod:
661 case OpImageSampleExplicitLod:
662 case OpImageSampleDrefImplicitLod:
663 case OpImageSampleDrefExplicitLod:
664 case OpImageSampleProjImplicitLod:
665 case OpImageSampleProjExplicitLod:
666 case OpImageSampleProjDrefImplicitLod:
667 case OpImageSampleProjDrefExplicitLod:
668 case OpImageFetch:
669 case OpImageGather:
670 case OpImageDrefGather:
671 case OpImageRead:
672 case OpImageWrite:
673 case OpImage:
674 case OpImageQueryFormat:
675 case OpImageQueryOrder:
676 case OpImageQuerySizeLod:
677 case OpImageQuerySize:
678 case OpImageQueryLod:
679 case OpImageQueryLevels:
680 case OpImageQuerySamples:
681 case OpConvertFToU:
682 case OpConvertFToS:
683 case OpConvertSToF:
684 case OpConvertUToF:
685 case OpUConvert:
686 case OpSConvert:
687 case OpFConvert:
688 case OpQuantizeToF16:
689 case OpConvertPtrToU:
690 case OpSatConvertSToU:
691 case OpSatConvertUToS:
692 case OpConvertUToPtr:
693 case OpPtrCastToGeneric:
694 case OpGenericCastToPtr:
695 case OpGenericCastToPtrExplicit:
696 case OpBitcast:
697 case OpSNegate:
698 case OpFNegate:
699 case OpIAdd:
700 case OpFAdd:
701 case OpISub:
702 case OpFSub:
703 case OpIMul:
704 case OpFMul:
705 case OpUDiv:
706 case OpSDiv:
707 case OpFDiv:
708 case OpUMod:
709 case OpSRem:
710 case OpSMod:
711 case OpFRem:
712 case OpFMod:
713 case OpVectorTimesScalar:
714 case OpMatrixTimesScalar:
715 case OpVectorTimesMatrix:
716 case OpMatrixTimesVector:
717 case OpMatrixTimesMatrix:
718 case OpOuterProduct:
719 case OpDot:
720 case OpIAddCarry:
721 case OpISubBorrow:
722 case OpUMulExtended:
723 case OpSMulExtended:
724 case OpAny:
725 case OpAll:
726 case OpIsNan:
727 case OpIsInf:
728 case OpIsFinite:
729 case OpIsNormal:
730 case OpSignBitSet:
731 case OpLessOrGreater:
732 case OpOrdered:
733 case OpUnordered:
734 case OpLogicalEqual:
735 case OpLogicalNotEqual:
736 case OpLogicalOr:
737 case OpLogicalAnd:
738 case OpLogicalNot:
739 case OpSelect:
740 case OpIEqual:
741 case OpINotEqual:
742 case OpUGreaterThan:
743 case OpSGreaterThan:
744 case OpUGreaterThanEqual:
745 case OpSGreaterThanEqual:
746 case OpULessThan:
747 case OpSLessThan:
748 case OpULessThanEqual:
749 case OpSLessThanEqual:
750 case OpFOrdEqual:
751 case OpFUnordEqual:
752 case OpFOrdNotEqual:
753 case OpFUnordNotEqual:
754 case OpFOrdLessThan:
755 case OpFUnordLessThan:
756 case OpFOrdGreaterThan:
757 case OpFUnordGreaterThan:
758 case OpFOrdLessThanEqual:
759 case OpFUnordLessThanEqual:
760 case OpFOrdGreaterThanEqual:
761 case OpFUnordGreaterThanEqual:
762 case OpShiftRightLogical:
763 case OpShiftRightArithmetic:
764 case OpShiftLeftLogical:
765 case OpBitwiseOr:
766 case OpBitwiseXor:
767 case OpBitwiseAnd:
768 case OpNot:
769 case OpBitFieldInsert:
770 case OpBitFieldSExtract:
771 case OpBitFieldUExtract:
772 case OpBitReverse:
773 case OpBitCount:
774 case OpDPdx:
775 case OpDPdy:
776 case OpFwidth:
777 case OpDPdxFine:
778 case OpDPdyFine:
779 case OpFwidthFine:
780 case OpDPdxCoarse:
781 case OpDPdyCoarse:
782 case OpFwidthCoarse:
783 case OpEmitVertex:
784 case OpEndPrimitive:
785 case OpEmitStreamVertex:
786 case OpEndStreamPrimitive:
787 case OpControlBarrier:
788 case OpMemoryBarrier:
789 case OpAtomicLoad:
790 case OpAtomicStore:
791 case OpAtomicExchange:
792 case OpAtomicCompareExchange:
793 case OpAtomicCompareExchangeWeak:
794 case OpAtomicIIncrement:
795 case OpAtomicIDecrement:
796 case OpAtomicIAdd:
797 case OpAtomicISub:
798 case OpAtomicSMin:
799 case OpAtomicUMin:
800 case OpAtomicSMax:
801 case OpAtomicUMax:
802 case OpAtomicAnd:
803 case OpAtomicOr:
804 case OpAtomicXor:
805 case OpPhi:
806 case OpLoopMerge:
807 case OpSelectionMerge:
808 case OpLabel:
809 case OpBranch:
810 case OpBranchConditional:
811 case OpSwitch:
812 case OpKill:
813 case OpReturn:
814 case OpReturnValue:
815 case OpUnreachable:
816 case OpLifetimeStart:
817 case OpLifetimeStop:
818 case OpGroupAsyncCopy:
819 case OpGroupWaitEvents:
820 case OpGroupAll:
821 case OpGroupAny:
822 case OpGroupBroadcast:
823 case OpGroupIAdd:
824 case OpGroupFAdd:
825 case OpGroupFMin:
826 case OpGroupUMin:
827 case OpGroupSMin:
828 case OpGroupFMax:
829 case OpGroupUMax:
830 case OpGroupSMax:
831 case OpReadPipe:
832 case OpWritePipe:
833 case OpReservedReadPipe:
834 case OpReservedWritePipe:
835 case OpReserveReadPipePackets:
836 case OpReserveWritePipePackets:
837 case OpCommitReadPipe:
838 case OpCommitWritePipe:
839 case OpIsValidReserveId:
840 case OpGetNumPipePackets:
841 case OpGetMaxPipePackets:
842 case OpGroupReserveReadPipePackets:
843 case OpGroupReserveWritePipePackets:
844 case OpGroupCommitReadPipe:
845 case OpGroupCommitWritePipe:
846 case OpEnqueueMarker:
847 case OpEnqueueKernel:
848 case OpGetKernelNDrangeSubGroupCount:
849 case OpGetKernelNDrangeMaxSubGroupSize:
850 case OpGetKernelWorkGroupSize:
851 case OpGetKernelPreferredWorkGroupSizeMultiple:
852 case OpRetainEvent:
853 case OpReleaseEvent:
854 case OpCreateUserEvent:
855 case OpIsValidEvent:
856 case OpSetUserEventStatus:
857 case OpCaptureEventProfilingInfo:
858 case OpGetDefaultQueue:
859 case OpBuildNDRange:
860 case OpImageSparseSampleImplicitLod:
861 case OpImageSparseSampleExplicitLod:
862 case OpImageSparseSampleDrefImplicitLod:
863 case OpImageSparseSampleDrefExplicitLod:
864 case OpImageSparseSampleProjImplicitLod:
865 case OpImageSparseSampleProjExplicitLod:
866 case OpImageSparseSampleProjDrefImplicitLod:
867 case OpImageSparseSampleProjDrefExplicitLod:
868 case OpImageSparseFetch:
869 case OpImageSparseGather:
870 case OpImageSparseDrefGather:
871 case OpImageSparseTexelsResident:
872 case OpNoLine:
873 case OpAtomicFlagTestAndSet:
874 case OpAtomicFlagClear:
875 case OpImageSparseRead:
876 case OpSizeOf:
877 case OpTypePipeStorage:
878 case OpConstantPipeStorage:
879 case OpCreatePipeFromPipeStorage:
880 case OpGetKernelLocalSizeForSubgroupCount:
881 case OpGetKernelMaxNumSubgroups:
882 case OpTypeNamedBarrier:
883 case OpNamedBarrierInitialize:
884 case OpMemoryNamedBarrier:
885 case OpModuleProcessed:
886 case OpForward:
887 return true;
888 default:
889 return false;
890 }
891 }
892
893 inline bool
isValidImageOperandsMask(SPIRVWord Mask)894 isValidImageOperandsMask(SPIRVWord Mask) {
895 SPIRVWord ValidMask = 0u;
896 ValidMask |= ImageOperandsBiasMask;
897 ValidMask |= ImageOperandsLodMask;
898 ValidMask |= ImageOperandsGradMask;
899 ValidMask |= ImageOperandsConstOffsetMask;
900 ValidMask |= ImageOperandsOffsetMask;
901 ValidMask |= ImageOperandsConstOffsetsMask;
902 ValidMask |= ImageOperandsSampleMask;
903 ValidMask |= ImageOperandsMinLodMask;
904
905 return (Mask & ~ValidMask) == 0;
906 }
907
908 inline bool
isValidFPFastMathModeMask(SPIRVWord Mask)909 isValidFPFastMathModeMask(SPIRVWord Mask) {
910 SPIRVWord ValidMask = 0u;
911 ValidMask |= FPFastMathModeNotNaNMask;
912 ValidMask |= FPFastMathModeNotInfMask;
913 ValidMask |= FPFastMathModeNSZMask;
914 ValidMask |= FPFastMathModeAllowRecipMask;
915 ValidMask |= FPFastMathModeFastMask;
916
917 return (Mask & ~ValidMask) == 0;
918 }
919
920 inline bool
isValidSelectionControlMask(SPIRVWord Mask)921 isValidSelectionControlMask(SPIRVWord Mask) {
922 SPIRVWord ValidMask = 0u;
923 ValidMask |= SelectionControlFlattenMask;
924 ValidMask |= SelectionControlDontFlattenMask;
925
926 return (Mask & ~ValidMask) == 0;
927 }
928
929 inline bool
isValidLoopControlMask(SPIRVWord Mask)930 isValidLoopControlMask(SPIRVWord Mask) {
931 SPIRVWord ValidMask = 0u;
932 ValidMask |= LoopControlUnrollMask;
933 ValidMask |= LoopControlDontUnrollMask;
934 ValidMask |= LoopControlDependencyInfiniteMask;
935 ValidMask |= LoopControlDependencyLengthMask;
936
937 return (Mask & ~ValidMask) == 0;
938 }
939
940 inline bool
isValidFunctionControlMask(SPIRVWord Mask)941 isValidFunctionControlMask(SPIRVWord Mask) {
942 SPIRVWord ValidMask = 0u;
943 ValidMask |= FunctionControlInlineMask;
944 ValidMask |= FunctionControlDontInlineMask;
945 ValidMask |= FunctionControlPureMask;
946 ValidMask |= FunctionControlConstMask;
947
948 return (Mask & ~ValidMask) == 0;
949 }
950
951 inline bool
isValidMemorySemanticsMask(SPIRVWord Mask)952 isValidMemorySemanticsMask(SPIRVWord Mask) {
953 SPIRVWord ValidMask = 0u;
954 ValidMask |= MemorySemanticsAcquireMask;
955 ValidMask |= MemorySemanticsReleaseMask;
956 ValidMask |= MemorySemanticsAcquireReleaseMask;
957 ValidMask |= MemorySemanticsSequentiallyConsistentMask;
958 ValidMask |= MemorySemanticsUniformMemoryMask;
959 ValidMask |= MemorySemanticsSubgroupMemoryMask;
960 ValidMask |= MemorySemanticsWorkgroupMemoryMask;
961 ValidMask |= MemorySemanticsCrossWorkgroupMemoryMask;
962 ValidMask |= MemorySemanticsAtomicCounterMemoryMask;
963 ValidMask |= MemorySemanticsImageMemoryMask;
964
965 return (Mask & ~ValidMask) == 0;
966 }
967
968 inline bool
isValidMemoryAccessMask(SPIRVWord Mask)969 isValidMemoryAccessMask(SPIRVWord Mask) {
970 SPIRVWord ValidMask = 0u;
971 ValidMask |= MemoryAccessVolatileMask;
972 ValidMask |= MemoryAccessAlignedMask;
973 ValidMask |= MemoryAccessNontemporalMask;
974
975 return (Mask & ~ValidMask) == 0;
976 }
977
978 inline bool
isValidKernelProfilingInfoMask(SPIRVWord Mask)979 isValidKernelProfilingInfoMask(SPIRVWord Mask) {
980 SPIRVWord ValidMask = 0u;
981 ValidMask |= KernelProfilingInfoCmdExecTimeMask;
982
983 return (Mask & ~ValidMask) == 0;
984 }
985
986 } /* namespace SPIRV */
987
988 #endif /* SPIRVISVALIDENUM_H_ */
989