]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/lib/Headers/immintrin.h
MFV r296540: 4448 zfs diff misprints unicode characters
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / lib / Headers / immintrin.h
1 /*===---- immintrin.h - Intel intrinsics -----------------------------------===
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * 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 Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  *
21  *===-----------------------------------------------------------------------===
22  */
23
24 #ifndef __IMMINTRIN_H
25 #define __IMMINTRIN_H
26
27 #include <mmintrin.h>
28
29 #include <xmmintrin.h>
30
31 #include <emmintrin.h>
32
33 #include <pmmintrin.h>
34
35 #include <tmmintrin.h>
36
37 #include <smmintrin.h>
38
39 #include <wmmintrin.h>
40
41 #include <avxintrin.h>
42
43 #include <avx2intrin.h>
44
45 /* The 256-bit versions of functions in f16cintrin.h.
46    Intel documents these as being in immintrin.h, and
47    they depend on typedefs from avxintrin.h. */
48
49 #define _mm256_cvtps_ph(a, imm) __extension__ ({ \
50  (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); })
51
52 static __inline __m256 __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
53 _mm256_cvtph_ps(__m128i __a)
54 {
55   return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);
56 }
57
58 #include <bmiintrin.h>
59
60 #include <bmi2intrin.h>
61
62 #include <lzcntintrin.h>
63
64 #include <fmaintrin.h>
65
66 #include <avx512fintrin.h>
67
68 #include <avx512vlintrin.h>
69
70 #include <avx512bwintrin.h>
71
72 #include <avx512cdintrin.h>
73
74 #include <avx512dqintrin.h>
75
76 #include <avx512vlbwintrin.h>
77
78 #include <avx512vldqintrin.h>
79
80 #include <avx512erintrin.h>
81
82 #include <pkuintrin.h>
83
84 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
85 _rdrand16_step(unsigned short *__p)
86 {
87   return __builtin_ia32_rdrand16_step(__p);
88 }
89
90 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
91 _rdrand32_step(unsigned int *__p)
92 {
93   return __builtin_ia32_rdrand32_step(__p);
94 }
95
96 #ifdef __x86_64__
97 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
98 _rdrand64_step(unsigned long long *__p)
99 {
100   return __builtin_ia32_rdrand64_step(__p);
101 }
102 #endif
103
104 #ifdef __x86_64__
105 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
106 _readfsbase_u32(void)
107 {
108   return __builtin_ia32_rdfsbase32();
109 }
110
111 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
112 _readfsbase_u64(void)
113 {
114   return __builtin_ia32_rdfsbase64();
115 }
116
117 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
118 _readgsbase_u32(void)
119 {
120   return __builtin_ia32_rdgsbase32();
121 }
122
123 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
124 _readgsbase_u64(void)
125 {
126   return __builtin_ia32_rdgsbase64();
127 }
128
129 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
130 _writefsbase_u32(unsigned int __V)
131 {
132   return __builtin_ia32_wrfsbase32(__V);
133 }
134
135 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
136 _writefsbase_u64(unsigned long long __V)
137 {
138   return __builtin_ia32_wrfsbase64(__V);
139 }
140
141 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
142 _writegsbase_u32(unsigned int __V)
143 {
144   return __builtin_ia32_wrgsbase32(__V);
145 }
146
147 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
148 _writegsbase_u64(unsigned long long __V)
149 {
150   return __builtin_ia32_wrgsbase64(__V);
151 }
152 #endif
153
154 #include <rtmintrin.h>
155
156 #include <xtestintrin.h>
157
158 #include <shaintrin.h>
159
160 #include <fxsrintrin.h>
161
162 #include <xsaveintrin.h>
163
164 #include <xsaveoptintrin.h>
165
166 #include <xsavecintrin.h>
167
168 #include <xsavesintrin.h>
169
170 /* Some intrinsics inside adxintrin.h are available only on processors with ADX,
171  * whereas others are also available at all times. */
172 #include <adxintrin.h>
173
174 #endif /* __IMMINTRIN_H */