Path: blob/21.2-virgl/src/compiler/spirv/OpenCL.std.h
4545 views
/*1** Copyright (c) 2015-2019 The Khronos Group Inc.2**3** Permission is hereby granted, free of charge, to any person obtaining a copy4** of this software and/or associated documentation files (the "Materials"),5** to deal in the Materials without restriction, including without limitation6** the rights to use, copy, modify, merge, publish, distribute, sublicense,7** and/or sell copies of the Materials, and to permit persons to whom the8** Materials are furnished to do so, subject to the following conditions:9**10** The above copyright notice and this permission notice shall be included in11** all copies or substantial portions of the Materials.12**13** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS14** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND15** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/16**17** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,19** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL20** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER21** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS23** IN THE MATERIALS.24*/2526#ifndef OPENCLstd_H27#define OPENCLstd_H2829#ifdef __cplusplus30namespace OpenCLLIB {3132enum Entrypoints {3334// Section 2.1: Math extended instructions35Acos = 0,36Acosh = 1,37Acospi = 2,38Asin = 3,39Asinh = 4,40Asinpi = 5,41Atan = 6,42Atan2 = 7,43Atanh = 8,44Atanpi = 9,45Atan2pi = 10,46Cbrt = 11,47Ceil = 12,48Copysign = 13,49Cos = 14,50Cosh = 15,51Cospi = 16,52Erfc = 17,53Erf = 18,54Exp = 19,55Exp2 = 20,56Exp10 = 21,57Expm1 = 22,58Fabs = 23,59Fdim = 24,60Floor = 25,61Fma = 26,62Fmax = 27,63Fmin = 28,64Fmod = 29,65Fract = 30,66Frexp = 31,67Hypot = 32,68Ilogb = 33,69Ldexp = 34,70Lgamma = 35,71Lgamma_r = 36,72Log = 37,73Log2 = 38,74Log10 = 39,75Log1p = 40,76Logb = 41,77Mad = 42,78Maxmag = 43,79Minmag = 44,80Modf = 45,81Nan = 46,82Nextafter = 47,83Pow = 48,84Pown = 49,85Powr = 50,86Remainder = 51,87Remquo = 52,88Rint = 53,89Rootn = 54,90Round = 55,91Rsqrt = 56,92Sin = 57,93Sincos = 58,94Sinh = 59,95Sinpi = 60,96Sqrt = 61,97Tan = 62,98Tanh = 63,99Tanpi = 64,100Tgamma = 65,101Trunc = 66,102Half_cos = 67,103Half_divide = 68,104Half_exp = 69,105Half_exp2 = 70,106Half_exp10 = 71,107Half_log = 72,108Half_log2 = 73,109Half_log10 = 74,110Half_powr = 75,111Half_recip = 76,112Half_rsqrt = 77,113Half_sin = 78,114Half_sqrt = 79,115Half_tan = 80,116Native_cos = 81,117Native_divide = 82,118Native_exp = 83,119Native_exp2 = 84,120Native_exp10 = 85,121Native_log = 86,122Native_log2 = 87,123Native_log10 = 88,124Native_powr = 89,125Native_recip = 90,126Native_rsqrt = 91,127Native_sin = 92,128Native_sqrt = 93,129Native_tan = 94,130131// Section 2.2: Integer instructions132SAbs = 141,133SAbs_diff = 142,134SAdd_sat = 143,135UAdd_sat = 144,136SHadd = 145,137UHadd = 146,138SRhadd = 147,139URhadd = 148,140SClamp = 149,141UClamp = 150,142Clz = 151,143Ctz = 152,144SMad_hi = 153,145UMad_sat = 154,146SMad_sat = 155,147SMax = 156,148UMax = 157,149SMin = 158,150UMin = 159,151SMul_hi = 160,152Rotate = 161,153SSub_sat = 162,154USub_sat = 163,155U_Upsample = 164,156S_Upsample = 165,157Popcount = 166,158SMad24 = 167,159UMad24 = 168,160SMul24 = 169,161UMul24 = 170,162UAbs = 201,163UAbs_diff = 202,164UMul_hi = 203,165UMad_hi = 204,166167// Section 2.3: Common instructions168FClamp = 95,169Degrees = 96,170FMax_common = 97,171FMin_common = 98,172Mix = 99,173Radians = 100,174Step = 101,175Smoothstep = 102,176Sign = 103,177178// Section 2.4: Geometric instructions179Cross = 104,180Distance = 105,181Length = 106,182Normalize = 107,183Fast_distance = 108,184Fast_length = 109,185Fast_normalize = 110,186187// Section 2.5: Relational instructions188Bitselect = 186,189Select = 187,190191// Section 2.6: Vector Data Load and Store instructions192Vloadn = 171,193Vstoren = 172,194Vload_half = 173,195Vload_halfn = 174,196Vstore_half = 175,197Vstore_half_r = 176,198Vstore_halfn = 177,199Vstore_halfn_r = 178,200Vloada_halfn = 179,201Vstorea_halfn = 180,202Vstorea_halfn_r = 181,203204// Section 2.7: Miscellaneous Vector instructions205Shuffle = 182,206Shuffle2 = 183,207208// Section 2.8: Misc instructions209Printf = 184,210Prefetch = 185,211};212213} // end namespace OpenCLLIB214215#else216217enum OpenCLstd_Entrypoints {218219// Section 2.1: Math extended instructions220OpenCLstd_Acos = 0,221OpenCLstd_Acosh = 1,222OpenCLstd_Acospi = 2,223OpenCLstd_Asin = 3,224OpenCLstd_Asinh = 4,225OpenCLstd_Asinpi = 5,226OpenCLstd_Atan = 6,227OpenCLstd_Atan2 = 7,228OpenCLstd_Atanh = 8,229OpenCLstd_Atanpi = 9,230OpenCLstd_Atan2pi = 10,231OpenCLstd_Cbrt = 11,232OpenCLstd_Ceil = 12,233OpenCLstd_Copysign = 13,234OpenCLstd_Cos = 14,235OpenCLstd_Cosh = 15,236OpenCLstd_Cospi = 16,237OpenCLstd_Erfc = 17,238OpenCLstd_Erf = 18,239OpenCLstd_Exp = 19,240OpenCLstd_Exp2 = 20,241OpenCLstd_Exp10 = 21,242OpenCLstd_Expm1 = 22,243OpenCLstd_Fabs = 23,244OpenCLstd_Fdim = 24,245OpenCLstd_Floor = 25,246OpenCLstd_Fma = 26,247OpenCLstd_Fmax = 27,248OpenCLstd_Fmin = 28,249OpenCLstd_Fmod = 29,250OpenCLstd_Fract = 30,251OpenCLstd_Frexp = 31,252OpenCLstd_Hypot = 32,253OpenCLstd_Ilogb = 33,254OpenCLstd_Ldexp = 34,255OpenCLstd_Lgamma = 35,256OpenCLstd_Lgamma_r = 36,257OpenCLstd_Log = 37,258OpenCLstd_Log2 = 38,259OpenCLstd_Log10 = 39,260OpenCLstd_Log1p = 40,261OpenCLstd_Logb = 41,262OpenCLstd_Mad = 42,263OpenCLstd_Maxmag = 43,264OpenCLstd_Minmag = 44,265OpenCLstd_Modf = 45,266OpenCLstd_Nan = 46,267OpenCLstd_Nextafter = 47,268OpenCLstd_Pow = 48,269OpenCLstd_Pown = 49,270OpenCLstd_Powr = 50,271OpenCLstd_Remainder = 51,272OpenCLstd_Remquo = 52,273OpenCLstd_Rint = 53,274OpenCLstd_Rootn = 54,275OpenCLstd_Round = 55,276OpenCLstd_Rsqrt = 56,277OpenCLstd_Sin = 57,278OpenCLstd_Sincos = 58,279OpenCLstd_Sinh = 59,280OpenCLstd_Sinpi = 60,281OpenCLstd_Sqrt = 61,282OpenCLstd_Tan = 62,283OpenCLstd_Tanh = 63,284OpenCLstd_Tanpi = 64,285OpenCLstd_Tgamma = 65,286OpenCLstd_Trunc = 66,287OpenCLstd_Half_cos = 67,288OpenCLstd_Half_divide = 68,289OpenCLstd_Half_exp = 69,290OpenCLstd_Half_exp2 = 70,291OpenCLstd_Half_exp10 = 71,292OpenCLstd_Half_log = 72,293OpenCLstd_Half_log2 = 73,294OpenCLstd_Half_log10 = 74,295OpenCLstd_Half_powr = 75,296OpenCLstd_Half_recip = 76,297OpenCLstd_Half_rsqrt = 77,298OpenCLstd_Half_sin = 78,299OpenCLstd_Half_sqrt = 79,300OpenCLstd_Half_tan = 80,301OpenCLstd_Native_cos = 81,302OpenCLstd_Native_divide = 82,303OpenCLstd_Native_exp = 83,304OpenCLstd_Native_exp2 = 84,305OpenCLstd_Native_exp10 = 85,306OpenCLstd_Native_log = 86,307OpenCLstd_Native_log2 = 87,308OpenCLstd_Native_log10 = 88,309OpenCLstd_Native_powr = 89,310OpenCLstd_Native_recip = 90,311OpenCLstd_Native_rsqrt = 91,312OpenCLstd_Native_sin = 92,313OpenCLstd_Native_sqrt = 93,314OpenCLstd_Native_tan = 94,315316// Section 2.2: Integer instructions317OpenCLstd_SAbs = 141,318OpenCLstd_SAbs_diff = 142,319OpenCLstd_SAdd_sat = 143,320OpenCLstd_UAdd_sat = 144,321OpenCLstd_SHadd = 145,322OpenCLstd_UHadd = 146,323OpenCLstd_SRhadd = 147,324OpenCLstd_URhadd = 148,325OpenCLstd_SClamp = 149,326OpenCLstd_UClamp = 150,327OpenCLstd_Clz = 151,328OpenCLstd_Ctz = 152,329OpenCLstd_SMad_hi = 153,330OpenCLstd_UMad_sat = 154,331OpenCLstd_SMad_sat = 155,332OpenCLstd_SMax = 156,333OpenCLstd_UMax = 157,334OpenCLstd_SMin = 158,335OpenCLstd_UMin = 159,336OpenCLstd_SMul_hi = 160,337OpenCLstd_Rotate = 161,338OpenCLstd_SSub_sat = 162,339OpenCLstd_USub_sat = 163,340OpenCLstd_U_Upsample = 164,341OpenCLstd_S_Upsample = 165,342OpenCLstd_Popcount = 166,343OpenCLstd_SMad24 = 167,344OpenCLstd_UMad24 = 168,345OpenCLstd_SMul24 = 169,346OpenCLstd_UMul24 = 170,347OpenCLstd_UAbs = 201,348OpenCLstd_UAbs_diff = 202,349OpenCLstd_UMul_hi = 203,350OpenCLstd_UMad_hi = 204,351352// Section 2.3: Common instructions353OpenCLstd_FClamp = 95,354OpenCLstd_Degrees = 96,355OpenCLstd_FMax_common = 97,356OpenCLstd_FMin_common = 98,357OpenCLstd_Mix = 99,358OpenCLstd_Radians = 100,359OpenCLstd_Step = 101,360OpenCLstd_Smoothstep = 102,361OpenCLstd_Sign = 103,362363// Section 2.4: Geometric instructions364OpenCLstd_Cross = 104,365OpenCLstd_Distance = 105,366OpenCLstd_Length = 106,367OpenCLstd_Normalize = 107,368OpenCLstd_Fast_distance = 108,369OpenCLstd_Fast_length = 109,370OpenCLstd_Fast_normalize = 110,371372// Section 2.5: Relational instructions373OpenCLstd_Bitselect = 186,374OpenCLstd_Select = 187,375376// Section 2.6: Vector Data Load and Store instructions377OpenCLstd_Vloadn = 171,378OpenCLstd_Vstoren = 172,379OpenCLstd_Vload_half = 173,380OpenCLstd_Vload_halfn = 174,381OpenCLstd_Vstore_half = 175,382OpenCLstd_Vstore_half_r = 176,383OpenCLstd_Vstore_halfn = 177,384OpenCLstd_Vstore_halfn_r = 178,385OpenCLstd_Vloada_halfn = 179,386OpenCLstd_Vstorea_halfn = 180,387OpenCLstd_Vstorea_halfn_r = 181,388389// Section 2.7: Miscellaneous Vector instructions390OpenCLstd_Shuffle = 182,391OpenCLstd_Shuffle2 = 183,392393// Section 2.8: Misc instructions394OpenCLstd_Printf = 184,395OpenCLstd_Prefetch = 185,396};397398#endif399400#endif // #ifndef OPENCLstd_H401402403