1 /*===---- immintrin.h - Intel intrinsics -----------------------------------===
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:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
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
21 *===-----------------------------------------------------------------------===
29 #include <xmmintrin.h>
31 #include <emmintrin.h>
33 #include <pmmintrin.h>
35 #include <tmmintrin.h>
37 #include <smmintrin.h>
39 #include <wmmintrin.h>
41 #include <avxintrin.h>
43 #include <avx2intrin.h>
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. */
49 #define _mm256_cvtps_ph(a, imm) __extension__ ({ \
50 (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); })
52 static __inline __m256 __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
53 _mm256_cvtph_ps(__m128i __a)
55 return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);
58 #include <bmiintrin.h>
60 #include <bmi2intrin.h>
62 #include <lzcntintrin.h>
64 #include <fmaintrin.h>
66 #include <avx512fintrin.h>
68 #include <avx512vlintrin.h>
70 #include <avx512bwintrin.h>
72 #include <avx512cdintrin.h>
74 #include <avx512dqintrin.h>
76 #include <avx512vlbwintrin.h>
78 #include <avx512vldqintrin.h>
80 #include <avx512erintrin.h>
82 #include <pkuintrin.h>
84 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
85 _rdrand16_step(unsigned short *__p)
87 return __builtin_ia32_rdrand16_step(__p);
90 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
91 _rdrand32_step(unsigned int *__p)
93 return __builtin_ia32_rdrand32_step(__p);
97 static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
98 _rdrand64_step(unsigned long long *__p)
100 return __builtin_ia32_rdrand64_step(__p);
105 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
106 _readfsbase_u32(void)
108 return __builtin_ia32_rdfsbase32();
111 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
112 _readfsbase_u64(void)
114 return __builtin_ia32_rdfsbase64();
117 static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
118 _readgsbase_u32(void)
120 return __builtin_ia32_rdgsbase32();
123 static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
124 _readgsbase_u64(void)
126 return __builtin_ia32_rdgsbase64();
129 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
130 _writefsbase_u32(unsigned int __V)
132 return __builtin_ia32_wrfsbase32(__V);
135 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
136 _writefsbase_u64(unsigned long long __V)
138 return __builtin_ia32_wrfsbase64(__V);
141 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
142 _writegsbase_u32(unsigned int __V)
144 return __builtin_ia32_wrgsbase32(__V);
147 static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
148 _writegsbase_u64(unsigned long long __V)
150 return __builtin_ia32_wrgsbase64(__V);
154 #include <rtmintrin.h>
156 #include <xtestintrin.h>
158 #include <shaintrin.h>
160 #include <fxsrintrin.h>
162 #include <xsaveintrin.h>
164 #include <xsaveoptintrin.h>
166 #include <xsavecintrin.h>
168 #include <xsavesintrin.h>
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>
174 #endif /* __IMMINTRIN_H */