<div dir="ltr">Acked-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 16, 2018 at 7:29 AM Karol Herbst <<a href="mailto:kherbst@redhat.com">kherbst@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>><br>
<br>
Lightly edited to be valid 'C' code.<br>
<br>
Is there a bug open to fix this upstream?<br>
<br>
Signed-off-by: Karol Herbst <<a href="mailto:kherbst@redhat.com" target="_blank">kherbst@redhat.com</a>><br>
---<br>
src/compiler/spirv/OpenCL.std.h | 211 ++++++++++++++++++++++++++++++++<br>
1 file changed, 211 insertions(+)<br>
create mode 100644 src/compiler/spirv/OpenCL.std.h<br>
<br>
diff --git a/src/compiler/spirv/OpenCL.std.h b/src/compiler/spirv/OpenCL.std.h<br>
new file mode 100644<br>
index 00000000000..1e9e7fc8d8a<br>
--- /dev/null<br>
+++ b/src/compiler/spirv/OpenCL.std.h<br>
@@ -0,0 +1,211 @@<br>
+/*<br>
+** Copyright (c) 2015-2017 The Khronos Group Inc.<br>
+**<br>
+** Permission is hereby granted, free of charge, to any person obtaining a copy<br>
+** of this software and/or associated documentation files (the "Materials"),<br>
+** to deal in the Materials without restriction, including without limitation<br>
+** the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+** and/or sell copies of the Materials, and to permit persons to whom the<br>
+** Materials are furnished to do so, subject to the following conditions:<br>
+**<br>
+** The above copyright notice and this permission notice shall be included in<br>
+** all copies or substantial portions of the Materials.<br>
+**<br>
+** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS<br>
+** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND<br>
+** HEADER INFORMATION ARE LOCATED AT <a href="https://www.khronos.org/registry/" rel="noreferrer" target="_blank">https://www.khronos.org/registry/</a> <br>
+**<br>
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS<br>
+** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS<br>
+** IN THE MATERIALS.<br>
+*/<br>
+<br>
+#ifndef OpenCLstd_H<br>
+#define OpenCLstd_H<br>
+<br>
+enum OpenCLstd {<br>
+<br>
+ // Section 2.1: Math extended instructions<br>
+ Acos = 0,<br>
+ Acosh = 1,<br>
+ Acospi = 2,<br>
+ Asin = 3,<br>
+ Asinh = 4,<br>
+ Asinpi = 5,<br>
+ Atan = 6,<br>
+ Atan2 = 7,<br>
+ Atanh = 8,<br>
+ Atanpi = 9,<br>
+ Atan2pi = 10,<br>
+ Cbrt = 11,<br>
+ Ceil = 12,<br>
+ Copysign = 13,<br>
+ Cos = 14,<br>
+ Cosh = 15,<br>
+ Cospi = 16,<br>
+ Erfc = 17,<br>
+ Erf = 18,<br>
+ Exp = 19,<br>
+ Exp2 = 20,<br>
+ Exp10 = 21,<br>
+ Expm1 = 22,<br>
+ Fabs = 23,<br>
+ Fdim = 24,<br>
+ Floor = 25,<br>
+ Fma = 26,<br>
+ Fmax = 27,<br>
+ Fmin = 28,<br>
+ Fmod = 29,<br>
+ Fract = 30, <br>
+ Frexp = 31,<br>
+ Hypot = 32,<br>
+ Ilogb = 33,<br>
+ Ldexp = 34,<br>
+ Lgamma = 35,<br>
+ Lgamma_r = 36,<br>
+ Log = 37,<br>
+ Log2 = 38,<br>
+ Log10 = 39,<br>
+ Log1p = 40,<br>
+ Logb = 41,<br>
+ Mad = 42,<br>
+ Maxmag = 43,<br>
+ Minmag = 44,<br>
+ Modf = 45,<br>
+ Nan = 46,<br>
+ Nextafter = 47,<br>
+ Pow = 48,<br>
+ Pown = 49,<br>
+ Powr = 50,<br>
+ Remainder = 51,<br>
+ Remquo = 52,<br>
+ Rint = 53,<br>
+ Rootn = 54,<br>
+ Round = 55,<br>
+ Rsqrt = 56,<br>
+ Sin = 57,<br>
+ Sincos = 58,<br>
+ Sinh = 59,<br>
+ Sinpi = 60,<br>
+ Sqrt = 61,<br>
+ Tan = 62,<br>
+ Tanh = 63,<br>
+ Tanpi = 64,<br>
+ Tgamma = 65,<br>
+ Trunc = 66,<br>
+ Half_cos = 67,<br>
+ Half_divide = 68,<br>
+ Half_exp = 69,<br>
+ Half_exp2 = 70,<br>
+ Half_exp10 = 71,<br>
+ Half_log = 72,<br>
+ Half_log2 = 73,<br>
+ Half_log10 = 74,<br>
+ Half_powr = 75,<br>
+ Half_recip = 76,<br>
+ Half_rsqrt = 77,<br>
+ Half_sin = 78,<br>
+ Half_sqrt = 79,<br>
+ Half_tan = 80,<br>
+ Native_cos = 81,<br>
+ Native_divide = 82,<br>
+ Native_exp = 83,<br>
+ Native_exp2 = 84,<br>
+ Native_exp10 = 85,<br>
+ Native_log = 86,<br>
+ Native_log2 = 87,<br>
+ Native_log10 = 88,<br>
+ Native_powr = 89,<br>
+ Native_recip = 90,<br>
+ Native_rsqrt = 91,<br>
+ Native_sin = 92,<br>
+ Native_sqrt = 93,<br>
+ Native_tan = 94,<br>
+ <br>
+ // Section 2.2: Integer instructions<br>
+ SAbs = 141,<br>
+ SAbs_diff = 142,<br>
+ SAdd_sat = 143,<br>
+ UAdd_sat = 144,<br>
+ SHadd = 145,<br>
+ UHadd = 146,<br>
+ SRhadd = 147,<br>
+ URhadd = 148,<br>
+ SClamp = 149,<br>
+ UClamp = 150, <br>
+ Clz = 151,<br>
+ Ctz = 152, <br>
+ SMad_hi = 153,<br>
+ UMad_sat = 154,<br>
+ SMad_sat = 155,<br>
+ SMax = 156,<br>
+ UMax = 157,<br>
+ SMin = 158,<br>
+ UMin = 159,<br>
+ SMul_hi = 160,<br>
+ Rotate = 161,<br>
+ SSub_sat = 162,<br>
+ USub_sat = 163,<br>
+ U_Upsample = 164,<br>
+ S_Upsample = 165,<br>
+ Popcount = 166,<br>
+ SMad24 = 167,<br>
+ UMad24 = 168,<br>
+ SMul24 = 169,<br>
+ UMul24 = 170,<br>
+ UAbs = 201,<br>
+ UAbs_diff = 202,<br>
+ UMul_hi = 203,<br>
+ UMad_hi = 204,<br>
+<br>
+ // Section 2.3: Common instructions<br>
+ FClamp = 95,<br>
+ Degrees = 96,<br>
+ FMax_common = 97,<br>
+ FMin_common = 98, <br>
+ Mix = 99,<br>
+ Radians = 100,<br>
+ Step = 101,<br>
+ Smoothstep = 102,<br>
+ Sign = 103,<br>
+<br>
+ // Section 2.4: Geometric instructions<br>
+ Cross = 104,<br>
+ Distance = 105, <br>
+ Length = 106,<br>
+ Normalize = 107,<br>
+ Fast_distance = 108,<br>
+ Fast_length = 109,<br>
+ Fast_normalize = 110,<br>
+<br>
+ // Section 2.5: Relational instructions<br>
+ Bitselect = 186,<br>
+ Select = 187,<br>
+<br>
+ // Section 2.6: Vector Data Load and Store instructions<br>
+ Vloadn = 171,<br>
+ Vstoren = 172,<br>
+ Vload_half = 173,<br>
+ Vload_halfn = 174,<br>
+ Vstore_half = 175,<br>
+ Vstore_half_r = 176,<br>
+ Vstore_halfn = 177,<br>
+ Vstore_halfn_r = 178,<br>
+ Vloada_halfn = 179,<br>
+ Vstorea_halfn = 180,<br>
+ Vstorea_halfn_r = 181,<br>
+<br>
+ // Section 2.7: Miscellaneous Vector instructions<br>
+ Shuffle = 182,<br>
+ Shuffle2 = 183,<br>
+<br>
+ // Section 2.8: Misc instructions <br>
+ Printf = 184,<br>
+ Prefetch = 185,<br>
+};<br>
+<br>
+#endif<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>