Skip to content

Commit afb8cd3

Browse files
committed
Import snapshot of spirv headers
Includes only the include/spirv/unified1 subtree. Based on git://github.com/KhronosGroup/spirv-tools revision 17da9f8231f78cf519b4958c2229463a63ead9e2 Bug: b/120799499 Change-Id: Ifb790bf95035d7feb2d54d07e1475013dfd298b1 Reviewed-on: https://swiftshader-review.googlesource.com/c/23048 Tested-by: Chris Forbes <chrisforbes@google.com> Reviewed-by: Corentin Wallez <cwallez@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
1 parent 7cfb50c commit afb8cd3

File tree

12 files changed

+18057
-0
lines changed

12 files changed

+18057
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/*
2+
** Copyright (c) 2014-2016 The Khronos Group Inc.
3+
**
4+
** Permission is hereby granted, free of charge, to any person obtaining a copy
5+
** of this software and/or associated documentation files (the "Materials"),
6+
** to deal in the Materials without restriction, including without limitation
7+
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
** and/or sell copies of the Materials, and to permit persons to whom the
9+
** Materials are furnished to do so, subject to the following conditions:
10+
**
11+
** The above copyright notice and this permission notice shall be included in
12+
** all copies or substantial portions of the Materials.
13+
**
14+
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
15+
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
16+
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
17+
**
18+
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19+
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
24+
** IN THE MATERIALS.
25+
*/
26+
27+
#ifndef GLSLstd450_H
28+
#define GLSLstd450_H
29+
30+
static const int GLSLstd450Version = 100;
31+
static const int GLSLstd450Revision = 3;
32+
33+
enum GLSLstd450 {
34+
GLSLstd450Bad = 0, // Don't use
35+
36+
GLSLstd450Round = 1,
37+
GLSLstd450RoundEven = 2,
38+
GLSLstd450Trunc = 3,
39+
GLSLstd450FAbs = 4,
40+
GLSLstd450SAbs = 5,
41+
GLSLstd450FSign = 6,
42+
GLSLstd450SSign = 7,
43+
GLSLstd450Floor = 8,
44+
GLSLstd450Ceil = 9,
45+
GLSLstd450Fract = 10,
46+
47+
GLSLstd450Radians = 11,
48+
GLSLstd450Degrees = 12,
49+
GLSLstd450Sin = 13,
50+
GLSLstd450Cos = 14,
51+
GLSLstd450Tan = 15,
52+
GLSLstd450Asin = 16,
53+
GLSLstd450Acos = 17,
54+
GLSLstd450Atan = 18,
55+
GLSLstd450Sinh = 19,
56+
GLSLstd450Cosh = 20,
57+
GLSLstd450Tanh = 21,
58+
GLSLstd450Asinh = 22,
59+
GLSLstd450Acosh = 23,
60+
GLSLstd450Atanh = 24,
61+
GLSLstd450Atan2 = 25,
62+
63+
GLSLstd450Pow = 26,
64+
GLSLstd450Exp = 27,
65+
GLSLstd450Log = 28,
66+
GLSLstd450Exp2 = 29,
67+
GLSLstd450Log2 = 30,
68+
GLSLstd450Sqrt = 31,
69+
GLSLstd450InverseSqrt = 32,
70+
71+
GLSLstd450Determinant = 33,
72+
GLSLstd450MatrixInverse = 34,
73+
74+
GLSLstd450Modf = 35, // second operand needs an OpVariable to write to
75+
GLSLstd450ModfStruct = 36, // no OpVariable operand
76+
GLSLstd450FMin = 37,
77+
GLSLstd450UMin = 38,
78+
GLSLstd450SMin = 39,
79+
GLSLstd450FMax = 40,
80+
GLSLstd450UMax = 41,
81+
GLSLstd450SMax = 42,
82+
GLSLstd450FClamp = 43,
83+
GLSLstd450UClamp = 44,
84+
GLSLstd450SClamp = 45,
85+
GLSLstd450FMix = 46,
86+
GLSLstd450IMix = 47, // Reserved
87+
GLSLstd450Step = 48,
88+
GLSLstd450SmoothStep = 49,
89+
90+
GLSLstd450Fma = 50,
91+
GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to
92+
GLSLstd450FrexpStruct = 52, // no OpVariable operand
93+
GLSLstd450Ldexp = 53,
94+
95+
GLSLstd450PackSnorm4x8 = 54,
96+
GLSLstd450PackUnorm4x8 = 55,
97+
GLSLstd450PackSnorm2x16 = 56,
98+
GLSLstd450PackUnorm2x16 = 57,
99+
GLSLstd450PackHalf2x16 = 58,
100+
GLSLstd450PackDouble2x32 = 59,
101+
GLSLstd450UnpackSnorm2x16 = 60,
102+
GLSLstd450UnpackUnorm2x16 = 61,
103+
GLSLstd450UnpackHalf2x16 = 62,
104+
GLSLstd450UnpackSnorm4x8 = 63,
105+
GLSLstd450UnpackUnorm4x8 = 64,
106+
GLSLstd450UnpackDouble2x32 = 65,
107+
108+
GLSLstd450Length = 66,
109+
GLSLstd450Distance = 67,
110+
GLSLstd450Cross = 68,
111+
GLSLstd450Normalize = 69,
112+
GLSLstd450FaceForward = 70,
113+
GLSLstd450Reflect = 71,
114+
GLSLstd450Refract = 72,
115+
116+
GLSLstd450FindILsb = 73,
117+
GLSLstd450FindSMsb = 74,
118+
GLSLstd450FindUMsb = 75,
119+
120+
GLSLstd450InterpolateAtCentroid = 76,
121+
GLSLstd450InterpolateAtSample = 77,
122+
GLSLstd450InterpolateAtOffset = 78,
123+
124+
GLSLstd450NMin = 79,
125+
GLSLstd450NMax = 80,
126+
GLSLstd450NClamp = 81,
127+
128+
GLSLstd450Count
129+
};
130+
131+
#endif // #ifndef GLSLstd450_H
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
/*
2+
** Copyright (c) 2015-2017 The Khronos Group Inc.
3+
**
4+
** Permission is hereby granted, free of charge, to any person obtaining a copy
5+
** of this software and/or associated documentation files (the "Materials"),
6+
** to deal in the Materials without restriction, including without limitation
7+
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
** and/or sell copies of the Materials, and to permit persons to whom the
9+
** Materials are furnished to do so, subject to the following conditions:
10+
**
11+
** The above copyright notice and this permission notice shall be included in
12+
** all copies or substantial portions of the Materials.
13+
**
14+
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
15+
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
16+
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
17+
**
18+
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19+
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21+
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
24+
** IN THE MATERIALS.
25+
*/
26+
27+
#ifndef OPENCLstd_H
28+
#define OPENCLstd_H
29+
30+
namespace OpenCLLIB {
31+
32+
enum Entrypoints {
33+
34+
// Section 2.1: Math extended instructions
35+
Acos = 0,
36+
Acosh = 1,
37+
Acospi = 2,
38+
Asin = 3,
39+
Asinh = 4,
40+
Asinpi = 5,
41+
Atan = 6,
42+
Atan2 = 7,
43+
Atanh = 8,
44+
Atanpi = 9,
45+
Atan2pi = 10,
46+
Cbrt = 11,
47+
Ceil = 12,
48+
Copysign = 13,
49+
Cos = 14,
50+
Cosh = 15,
51+
Cospi = 16,
52+
Erfc = 17,
53+
Erf = 18,
54+
Exp = 19,
55+
Exp2 = 20,
56+
Exp10 = 21,
57+
Expm1 = 22,
58+
Fabs = 23,
59+
Fdim = 24,
60+
Floor = 25,
61+
Fma = 26,
62+
Fmax = 27,
63+
Fmin = 28,
64+
Fmod = 29,
65+
Fract = 30,
66+
Frexp = 31,
67+
Hypot = 32,
68+
Ilogb = 33,
69+
Ldexp = 34,
70+
Lgamma = 35,
71+
Lgamma_r = 36,
72+
Log = 37,
73+
Log2 = 38,
74+
Log10 = 39,
75+
Log1p = 40,
76+
Logb = 41,
77+
Mad = 42,
78+
Maxmag = 43,
79+
Minmag = 44,
80+
Modf = 45,
81+
Nan = 46,
82+
Nextafter = 47,
83+
Pow = 48,
84+
Pown = 49,
85+
Powr = 50,
86+
Remainder = 51,
87+
Remquo = 52,
88+
Rint = 53,
89+
Rootn = 54,
90+
Round = 55,
91+
Rsqrt = 56,
92+
Sin = 57,
93+
Sincos = 58,
94+
Sinh = 59,
95+
Sinpi = 60,
96+
Sqrt = 61,
97+
Tan = 62,
98+
Tanh = 63,
99+
Tanpi = 64,
100+
Tgamma = 65,
101+
Trunc = 66,
102+
Half_cos = 67,
103+
Half_divide = 68,
104+
Half_exp = 69,
105+
Half_exp2 = 70,
106+
Half_exp10 = 71,
107+
Half_log = 72,
108+
Half_log2 = 73,
109+
Half_log10 = 74,
110+
Half_powr = 75,
111+
Half_recip = 76,
112+
Half_rsqrt = 77,
113+
Half_sin = 78,
114+
Half_sqrt = 79,
115+
Half_tan = 80,
116+
Native_cos = 81,
117+
Native_divide = 82,
118+
Native_exp = 83,
119+
Native_exp2 = 84,
120+
Native_exp10 = 85,
121+
Native_log = 86,
122+
Native_log2 = 87,
123+
Native_log10 = 88,
124+
Native_powr = 89,
125+
Native_recip = 90,
126+
Native_rsqrt = 91,
127+
Native_sin = 92,
128+
Native_sqrt = 93,
129+
Native_tan = 94,
130+
131+
// Section 2.2: Integer instructions
132+
SAbs = 141,
133+
SAbs_diff = 142,
134+
SAdd_sat = 143,
135+
UAdd_sat = 144,
136+
SHadd = 145,
137+
UHadd = 146,
138+
SRhadd = 147,
139+
URhadd = 148,
140+
SClamp = 149,
141+
UClamp = 150,
142+
Clz = 151,
143+
Ctz = 152,
144+
SMad_hi = 153,
145+
UMad_sat = 154,
146+
SMad_sat = 155,
147+
SMax = 156,
148+
UMax = 157,
149+
SMin = 158,
150+
UMin = 159,
151+
SMul_hi = 160,
152+
Rotate = 161,
153+
SSub_sat = 162,
154+
USub_sat = 163,
155+
U_Upsample = 164,
156+
S_Upsample = 165,
157+
Popcount = 166,
158+
SMad24 = 167,
159+
UMad24 = 168,
160+
SMul24 = 169,
161+
UMul24 = 170,
162+
UAbs = 201,
163+
UAbs_diff = 202,
164+
UMul_hi = 203,
165+
UMad_hi = 204,
166+
167+
// Section 2.3: Common instructions
168+
FClamp = 95,
169+
Degrees = 96,
170+
FMax_common = 97,
171+
FMin_common = 98,
172+
Mix = 99,
173+
Radians = 100,
174+
Step = 101,
175+
Smoothstep = 102,
176+
Sign = 103,
177+
178+
// Section 2.4: Geometric instructions
179+
Cross = 104,
180+
Distance = 105,
181+
Length = 106,
182+
Normalize = 107,
183+
Fast_distance = 108,
184+
Fast_length = 109,
185+
Fast_normalize = 110,
186+
187+
// Section 2.5: Relational instructions
188+
Bitselect = 186,
189+
Select = 187,
190+
191+
// Section 2.6: Vector Data Load and Store instructions
192+
Vloadn = 171,
193+
Vstoren = 172,
194+
Vload_half = 173,
195+
Vload_halfn = 174,
196+
Vstore_half = 175,
197+
Vstore_half_r = 176,
198+
Vstore_halfn = 177,
199+
Vstore_halfn_r = 178,
200+
Vloada_halfn = 179,
201+
Vstorea_halfn = 180,
202+
Vstorea_halfn_r = 181,
203+
204+
// Section 2.7: Miscellaneous Vector instructions
205+
Shuffle = 182,
206+
Shuffle2 = 183,
207+
208+
// Section 2.8: Misc instructions
209+
Printf = 184,
210+
Prefetch = 185,
211+
};
212+
213+
} // end namespace OpenCLLIB
214+
215+
#endif // #ifndef OPENCLstd_H

0 commit comments

Comments
 (0)