1 // Copyright (c) 2020 The Khronos Group Inc.
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and/or associated documentation files (the "Materials"),
5 // to deal in the Materials without restriction, including without limitation
6 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 // and/or sell copies of the Materials, and to permit persons to whom the
8 // Materials are furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Materials.
12 //
13 // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 // FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
19 // IN THE MATERIALS.
20 
21 // The header is for SPIR-V to LLVM IR internal definitions, that are not a part
22 // of Khronos SPIR-V specification.
23 
24 #include "spirv/unified1/spirv.hpp"
25 
26 #ifndef spirv_internal_HPP
27 #define spirv_internal_HPP
28 
29 namespace spv {
30 namespace internal {
31 
32 enum InternalLinkageType {
33   ILTPrev = LinkageTypeMax - 2,
34   ILTInternal
35 };
36 
37 enum InternalOp {
38   IOpAliasDomainDeclINTEL = 5911,
39   IOpAliasScopeDeclINTEL = 5912,
40   IOpAliasScopeListDeclINTEL = 5913,
41   IOpTypeTokenINTEL = 6113,
42   IOpConvertFToBF16INTEL = 6116,
43   IOpConvertBF16ToFINTEL = 6117,
44   IOpArithmeticFenceINTEL = 6145,
45   IOpPrev = OpMax - 2,
46   IOpForward
47 };
48 
49 enum InternalDecoration {
50   IDecMathOpDSPModeINTEL = 5909,
51   IDecAliasScopeINTEL = 5914,
52   IDecNoAliasINTEL = 5915,
53   IDecInitiationIntervalINTEL = 5917,
54   IDecMaxConcurrencyINTEL = 5918,
55   IDecPipelineEnableINTEL = 5919,
56   IDecRuntimeAlignedINTEL = 5940,
57   IDecCallableFunctionINTEL = 6087
58 };
59 
60 enum InternalCapability {
61   ICapFPGADSPControlINTEL = 5908,
62   ICapMemoryAccessAliasingINTEL = 5910,
63   ICapFPGAInvocationPipeliningAttributesINTEL = 5916,
64   ICapRuntimeAlignedAttributeINTEL = 5939,
65   ICapFastCompositeINTEL = 6093,
66   ICapOptNoneINTEL = 6094,
67   ICapTokenTypeINTEL = 6112,
68   ICapBfloat16ConversionINTEL = 6115,
69   ICapFPArithmeticFenceINTEL = 6144
70 };
71 
72 enum InternalFunctionControlMask { IFunctionControlOptNoneINTELMask = 0x10000 };
73 
74 enum InternalMemoryAccessMask {
75   IMemAccessAliasScopeINTELMask = 0x10000,
76   IMemAccessNoAliasINTELMask = 0x20000
77 };
78 
79 enum InternalExecutionMode { IExecModeFastCompositeKernelINTEL = 6088 };
80 
81 enum InternalLoopControlMask { ILoopControlLoopCountINTELMask = 0x1000000 };
82 
83 constexpr LinkageType LinkageTypeInternal =
84     static_cast<LinkageType>(ILTInternal);
85 
86 constexpr Op OpForward = static_cast<Op>(IOpForward);
87 constexpr Op OpAliasDomainDeclINTEL = static_cast<Op>(IOpAliasDomainDeclINTEL);
88 constexpr Op OpAliasScopeDeclINTEL = static_cast<Op>(IOpAliasScopeDeclINTEL);
89 constexpr Op OpAliasScopeListDeclINTEL =
90     static_cast<Op>(IOpAliasScopeListDeclINTEL);
91 constexpr Op OpTypeTokenINTEL = static_cast<Op>(IOpTypeTokenINTEL);
92 constexpr Op OpArithmeticFenceINTEL = static_cast<Op>(IOpArithmeticFenceINTEL);
93 constexpr Op OpConvertFToBF16INTEL = static_cast<Op>(IOpConvertFToBF16INTEL);
94 constexpr Op OpConvertBF16ToFINTEL = static_cast<Op>(IOpConvertBF16ToFINTEL);
95 
96 constexpr Decoration DecorationAliasScopeINTEL =
97     static_cast<Decoration>(IDecAliasScopeINTEL );
98 constexpr Decoration DecorationNoAliasINTEL =
99     static_cast<Decoration>(IDecNoAliasINTEL);
100 constexpr Decoration DecorationInitiationIntervalINTEL =
101     static_cast<Decoration>(IDecInitiationIntervalINTEL);
102 constexpr Decoration DecorationMaxConcurrencyINTEL =
103     static_cast<Decoration>(IDecMaxConcurrencyINTEL);
104 constexpr Decoration DecorationPipelineEnableINTEL =
105     static_cast<Decoration>(IDecPipelineEnableINTEL);
106 constexpr Decoration DecorationCallableFunctionINTEL =
107     static_cast<Decoration>(IDecCallableFunctionINTEL);
108 constexpr Decoration DecorationRuntimeAlignedINTEL =
109     static_cast<Decoration>(IDecRuntimeAlignedINTEL);
110 
111 constexpr Capability CapabilityFastCompositeINTEL =
112     static_cast<Capability>(ICapFastCompositeINTEL);
113 constexpr Capability CapabilityOptNoneINTEL =
114     static_cast<Capability>(ICapOptNoneINTEL);
115 constexpr Capability CapabilityFPGADSPControlINTEL =
116     static_cast<Capability>(ICapFPGADSPControlINTEL);
117 constexpr Capability CapabilityMemoryAccessAliasingINTEL =
118     static_cast<Capability>(ICapMemoryAccessAliasingINTEL);
119 constexpr Capability CapabilityFPGAInvocationPipeliningAttributesINTEL =
120     static_cast<Capability>(ICapFPGAInvocationPipeliningAttributesINTEL);
121 constexpr Capability CapabilityTokenTypeINTEL =
122     static_cast<Capability>(ICapTokenTypeINTEL);
123 constexpr Capability CapabilityRuntimeAlignedAttributeINTEL =
124     static_cast<Capability>(ICapRuntimeAlignedAttributeINTEL);
125 constexpr Capability CapabilityFPArithmeticFenceINTEL =
126     static_cast<Capability>(ICapFPArithmeticFenceINTEL);
127 constexpr Capability CapabilityBfloat16ConversionINTEL =
128     static_cast<Capability>(ICapBfloat16ConversionINTEL);
129 
130 constexpr FunctionControlMask FunctionControlOptNoneINTELMask =
131     static_cast<FunctionControlMask>(IFunctionControlOptNoneINTELMask);
132 
133 constexpr Decoration DecorationMathOpDSPModeINTEL =
134     static_cast<Decoration>(IDecMathOpDSPModeINTEL);
135 
136 constexpr MemoryAccessMask MemoryAccessAliasScopeINTELMask =
137     static_cast<MemoryAccessMask>(IMemAccessAliasScopeINTELMask);
138 constexpr MemoryAccessMask MemoryAccessNoAliasINTELMask =
139     static_cast<MemoryAccessMask>(IMemAccessNoAliasINTELMask);
140 
141 constexpr ExecutionMode ExecutionModeFastCompositeKernelINTEL =
142     static_cast<ExecutionMode>(IExecModeFastCompositeKernelINTEL);
143 
144 constexpr LoopControlMask LoopControlLoopCountINTELMask =
145     static_cast<LoopControlMask>(ILoopControlLoopCountINTELMask);
146 
147 } // namespace internal
148 } // namespace spv
149 
150 #endif // #ifndef spirv_internal_HPP
151