1 /*===---- avx512fintrin.h - AVX512F intrinsics -----------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
10 #error "Never use <avx512fintrin.h> directly; include <immintrin.h> instead."
13 #ifndef __AVX512FINTRIN_H
14 #define __AVX512FINTRIN_H
16 typedef char __v64qi
__attribute__((__vector_size__(64)));
17 typedef short __v32hi
__attribute__((__vector_size__(64)));
18 typedef double __v8df
__attribute__((__vector_size__(64)));
19 typedef float __v16sf
__attribute__((__vector_size__(64)));
20 typedef long long __v8di
__attribute__((__vector_size__(64)));
21 typedef int __v16si
__attribute__((__vector_size__(64)));
24 typedef unsigned char __v64qu
__attribute__((__vector_size__(64)));
25 typedef unsigned short __v32hu
__attribute__((__vector_size__(64)));
26 typedef unsigned long long __v8du
__attribute__((__vector_size__(64)));
27 typedef unsigned int __v16su
__attribute__((__vector_size__(64)));
29 /* We need an explicitly signed variant for char. Note that this shouldn't
30 * appear in the interface though. */
31 typedef signed char __v64qs
__attribute__((__vector_size__(64)));
33 typedef float __m512
__attribute__((__vector_size__(64), __aligned__(64)));
34 typedef double __m512d
__attribute__((__vector_size__(64), __aligned__(64)));
35 typedef long long __m512i
__attribute__((__vector_size__(64), __aligned__(64)));
37 typedef float __m512_u
__attribute__((__vector_size__(64), __aligned__(1)));
38 typedef double __m512d_u
__attribute__((__vector_size__(64), __aligned__(1)));
39 typedef long long __m512i_u
__attribute__((__vector_size__(64), __aligned__(1)));
41 typedef unsigned char __mmask8
;
42 typedef unsigned short __mmask16
;
44 /* Rounding mode macros. */
45 #define _MM_FROUND_TO_NEAREST_INT 0x00
46 #define _MM_FROUND_TO_NEG_INF 0x01
47 #define _MM_FROUND_TO_POS_INF 0x02
48 #define _MM_FROUND_TO_ZERO 0x03
49 #define _MM_FROUND_CUR_DIRECTION 0x04
51 /* Constants for integer comparison predicates */
53 _MM_CMPINT_EQ
, /* Equal */
54 _MM_CMPINT_LT
, /* Less than */
55 _MM_CMPINT_LE
, /* Less than or Equal */
57 _MM_CMPINT_NE
, /* Not Equal */
58 _MM_CMPINT_NLT
, /* Not Less than */
59 #define _MM_CMPINT_GE _MM_CMPINT_NLT /* Greater than or Equal */
60 _MM_CMPINT_NLE
/* Not Less than or Equal */
61 #define _MM_CMPINT_GT _MM_CMPINT_NLE /* Greater than */
66 _MM_PERM_AAAA
= 0x00, _MM_PERM_AAAB
= 0x01, _MM_PERM_AAAC
= 0x02,
67 _MM_PERM_AAAD
= 0x03, _MM_PERM_AABA
= 0x04, _MM_PERM_AABB
= 0x05,
68 _MM_PERM_AABC
= 0x06, _MM_PERM_AABD
= 0x07, _MM_PERM_AACA
= 0x08,
69 _MM_PERM_AACB
= 0x09, _MM_PERM_AACC
= 0x0A, _MM_PERM_AACD
= 0x0B,
70 _MM_PERM_AADA
= 0x0C, _MM_PERM_AADB
= 0x0D, _MM_PERM_AADC
= 0x0E,
71 _MM_PERM_AADD
= 0x0F, _MM_PERM_ABAA
= 0x10, _MM_PERM_ABAB
= 0x11,
72 _MM_PERM_ABAC
= 0x12, _MM_PERM_ABAD
= 0x13, _MM_PERM_ABBA
= 0x14,
73 _MM_PERM_ABBB
= 0x15, _MM_PERM_ABBC
= 0x16, _MM_PERM_ABBD
= 0x17,
74 _MM_PERM_ABCA
= 0x18, _MM_PERM_ABCB
= 0x19, _MM_PERM_ABCC
= 0x1A,
75 _MM_PERM_ABCD
= 0x1B, _MM_PERM_ABDA
= 0x1C, _MM_PERM_ABDB
= 0x1D,
76 _MM_PERM_ABDC
= 0x1E, _MM_PERM_ABDD
= 0x1F, _MM_PERM_ACAA
= 0x20,
77 _MM_PERM_ACAB
= 0x21, _MM_PERM_ACAC
= 0x22, _MM_PERM_ACAD
= 0x23,
78 _MM_PERM_ACBA
= 0x24, _MM_PERM_ACBB
= 0x25, _MM_PERM_ACBC
= 0x26,
79 _MM_PERM_ACBD
= 0x27, _MM_PERM_ACCA
= 0x28, _MM_PERM_ACCB
= 0x29,
80 _MM_PERM_ACCC
= 0x2A, _MM_PERM_ACCD
= 0x2B, _MM_PERM_ACDA
= 0x2C,
81 _MM_PERM_ACDB
= 0x2D, _MM_PERM_ACDC
= 0x2E, _MM_PERM_ACDD
= 0x2F,
82 _MM_PERM_ADAA
= 0x30, _MM_PERM_ADAB
= 0x31, _MM_PERM_ADAC
= 0x32,
83 _MM_PERM_ADAD
= 0x33, _MM_PERM_ADBA
= 0x34, _MM_PERM_ADBB
= 0x35,
84 _MM_PERM_ADBC
= 0x36, _MM_PERM_ADBD
= 0x37, _MM_PERM_ADCA
= 0x38,
85 _MM_PERM_ADCB
= 0x39, _MM_PERM_ADCC
= 0x3A, _MM_PERM_ADCD
= 0x3B,
86 _MM_PERM_ADDA
= 0x3C, _MM_PERM_ADDB
= 0x3D, _MM_PERM_ADDC
= 0x3E,
87 _MM_PERM_ADDD
= 0x3F, _MM_PERM_BAAA
= 0x40, _MM_PERM_BAAB
= 0x41,
88 _MM_PERM_BAAC
= 0x42, _MM_PERM_BAAD
= 0x43, _MM_PERM_BABA
= 0x44,
89 _MM_PERM_BABB
= 0x45, _MM_PERM_BABC
= 0x46, _MM_PERM_BABD
= 0x47,
90 _MM_PERM_BACA
= 0x48, _MM_PERM_BACB
= 0x49, _MM_PERM_BACC
= 0x4A,
91 _MM_PERM_BACD
= 0x4B, _MM_PERM_BADA
= 0x4C, _MM_PERM_BADB
= 0x4D,
92 _MM_PERM_BADC
= 0x4E, _MM_PERM_BADD
= 0x4F, _MM_PERM_BBAA
= 0x50,
93 _MM_PERM_BBAB
= 0x51, _MM_PERM_BBAC
= 0x52, _MM_PERM_BBAD
= 0x53,
94 _MM_PERM_BBBA
= 0x54, _MM_PERM_BBBB
= 0x55, _MM_PERM_BBBC
= 0x56,
95 _MM_PERM_BBBD
= 0x57, _MM_PERM_BBCA
= 0x58, _MM_PERM_BBCB
= 0x59,
96 _MM_PERM_BBCC
= 0x5A, _MM_PERM_BBCD
= 0x5B, _MM_PERM_BBDA
= 0x5C,
97 _MM_PERM_BBDB
= 0x5D, _MM_PERM_BBDC
= 0x5E, _MM_PERM_BBDD
= 0x5F,
98 _MM_PERM_BCAA
= 0x60, _MM_PERM_BCAB
= 0x61, _MM_PERM_BCAC
= 0x62,
99 _MM_PERM_BCAD
= 0x63, _MM_PERM_BCBA
= 0x64, _MM_PERM_BCBB
= 0x65,
100 _MM_PERM_BCBC
= 0x66, _MM_PERM_BCBD
= 0x67, _MM_PERM_BCCA
= 0x68,
101 _MM_PERM_BCCB
= 0x69, _MM_PERM_BCCC
= 0x6A, _MM_PERM_BCCD
= 0x6B,
102 _MM_PERM_BCDA
= 0x6C, _MM_PERM_BCDB
= 0x6D, _MM_PERM_BCDC
= 0x6E,
103 _MM_PERM_BCDD
= 0x6F, _MM_PERM_BDAA
= 0x70, _MM_PERM_BDAB
= 0x71,
104 _MM_PERM_BDAC
= 0x72, _MM_PERM_BDAD
= 0x73, _MM_PERM_BDBA
= 0x74,
105 _MM_PERM_BDBB
= 0x75, _MM_PERM_BDBC
= 0x76, _MM_PERM_BDBD
= 0x77,
106 _MM_PERM_BDCA
= 0x78, _MM_PERM_BDCB
= 0x79, _MM_PERM_BDCC
= 0x7A,
107 _MM_PERM_BDCD
= 0x7B, _MM_PERM_BDDA
= 0x7C, _MM_PERM_BDDB
= 0x7D,
108 _MM_PERM_BDDC
= 0x7E, _MM_PERM_BDDD
= 0x7F, _MM_PERM_CAAA
= 0x80,
109 _MM_PERM_CAAB
= 0x81, _MM_PERM_CAAC
= 0x82, _MM_PERM_CAAD
= 0x83,
110 _MM_PERM_CABA
= 0x84, _MM_PERM_CABB
= 0x85, _MM_PERM_CABC
= 0x86,
111 _MM_PERM_CABD
= 0x87, _MM_PERM_CACA
= 0x88, _MM_PERM_CACB
= 0x89,
112 _MM_PERM_CACC
= 0x8A, _MM_PERM_CACD
= 0x8B, _MM_PERM_CADA
= 0x8C,
113 _MM_PERM_CADB
= 0x8D, _MM_PERM_CADC
= 0x8E, _MM_PERM_CADD
= 0x8F,
114 _MM_PERM_CBAA
= 0x90, _MM_PERM_CBAB
= 0x91, _MM_PERM_CBAC
= 0x92,
115 _MM_PERM_CBAD
= 0x93, _MM_PERM_CBBA
= 0x94, _MM_PERM_CBBB
= 0x95,
116 _MM_PERM_CBBC
= 0x96, _MM_PERM_CBBD
= 0x97, _MM_PERM_CBCA
= 0x98,
117 _MM_PERM_CBCB
= 0x99, _MM_PERM_CBCC
= 0x9A, _MM_PERM_CBCD
= 0x9B,
118 _MM_PERM_CBDA
= 0x9C, _MM_PERM_CBDB
= 0x9D, _MM_PERM_CBDC
= 0x9E,
119 _MM_PERM_CBDD
= 0x9F, _MM_PERM_CCAA
= 0xA0, _MM_PERM_CCAB
= 0xA1,
120 _MM_PERM_CCAC
= 0xA2, _MM_PERM_CCAD
= 0xA3, _MM_PERM_CCBA
= 0xA4,
121 _MM_PERM_CCBB
= 0xA5, _MM_PERM_CCBC
= 0xA6, _MM_PERM_CCBD
= 0xA7,
122 _MM_PERM_CCCA
= 0xA8, _MM_PERM_CCCB
= 0xA9, _MM_PERM_CCCC
= 0xAA,
123 _MM_PERM_CCCD
= 0xAB, _MM_PERM_CCDA
= 0xAC, _MM_PERM_CCDB
= 0xAD,
124 _MM_PERM_CCDC
= 0xAE, _MM_PERM_CCDD
= 0xAF, _MM_PERM_CDAA
= 0xB0,
125 _MM_PERM_CDAB
= 0xB1, _MM_PERM_CDAC
= 0xB2, _MM_PERM_CDAD
= 0xB3,
126 _MM_PERM_CDBA
= 0xB4, _MM_PERM_CDBB
= 0xB5, _MM_PERM_CDBC
= 0xB6,
127 _MM_PERM_CDBD
= 0xB7, _MM_PERM_CDCA
= 0xB8, _MM_PERM_CDCB
= 0xB9,
128 _MM_PERM_CDCC
= 0xBA, _MM_PERM_CDCD
= 0xBB, _MM_PERM_CDDA
= 0xBC,
129 _MM_PERM_CDDB
= 0xBD, _MM_PERM_CDDC
= 0xBE, _MM_PERM_CDDD
= 0xBF,
130 _MM_PERM_DAAA
= 0xC0, _MM_PERM_DAAB
= 0xC1, _MM_PERM_DAAC
= 0xC2,
131 _MM_PERM_DAAD
= 0xC3, _MM_PERM_DABA
= 0xC4, _MM_PERM_DABB
= 0xC5,
132 _MM_PERM_DABC
= 0xC6, _MM_PERM_DABD
= 0xC7, _MM_PERM_DACA
= 0xC8,
133 _MM_PERM_DACB
= 0xC9, _MM_PERM_DACC
= 0xCA, _MM_PERM_DACD
= 0xCB,
134 _MM_PERM_DADA
= 0xCC, _MM_PERM_DADB
= 0xCD, _MM_PERM_DADC
= 0xCE,
135 _MM_PERM_DADD
= 0xCF, _MM_PERM_DBAA
= 0xD0, _MM_PERM_DBAB
= 0xD1,
136 _MM_PERM_DBAC
= 0xD2, _MM_PERM_DBAD
= 0xD3, _MM_PERM_DBBA
= 0xD4,
137 _MM_PERM_DBBB
= 0xD5, _MM_PERM_DBBC
= 0xD6, _MM_PERM_DBBD
= 0xD7,
138 _MM_PERM_DBCA
= 0xD8, _MM_PERM_DBCB
= 0xD9, _MM_PERM_DBCC
= 0xDA,
139 _MM_PERM_DBCD
= 0xDB, _MM_PERM_DBDA
= 0xDC, _MM_PERM_DBDB
= 0xDD,
140 _MM_PERM_DBDC
= 0xDE, _MM_PERM_DBDD
= 0xDF, _MM_PERM_DCAA
= 0xE0,
141 _MM_PERM_DCAB
= 0xE1, _MM_PERM_DCAC
= 0xE2, _MM_PERM_DCAD
= 0xE3,
142 _MM_PERM_DCBA
= 0xE4, _MM_PERM_DCBB
= 0xE5, _MM_PERM_DCBC
= 0xE6,
143 _MM_PERM_DCBD
= 0xE7, _MM_PERM_DCCA
= 0xE8, _MM_PERM_DCCB
= 0xE9,
144 _MM_PERM_DCCC
= 0xEA, _MM_PERM_DCCD
= 0xEB, _MM_PERM_DCDA
= 0xEC,
145 _MM_PERM_DCDB
= 0xED, _MM_PERM_DCDC
= 0xEE, _MM_PERM_DCDD
= 0xEF,
146 _MM_PERM_DDAA
= 0xF0, _MM_PERM_DDAB
= 0xF1, _MM_PERM_DDAC
= 0xF2,
147 _MM_PERM_DDAD
= 0xF3, _MM_PERM_DDBA
= 0xF4, _MM_PERM_DDBB
= 0xF5,
148 _MM_PERM_DDBC
= 0xF6, _MM_PERM_DDBD
= 0xF7, _MM_PERM_DDCA
= 0xF8,
149 _MM_PERM_DDCB
= 0xF9, _MM_PERM_DDCC
= 0xFA, _MM_PERM_DDCD
= 0xFB,
150 _MM_PERM_DDDA
= 0xFC, _MM_PERM_DDDB
= 0xFD, _MM_PERM_DDDC
= 0xFE,
156 _MM_MANT_NORM_1_2
, /* interval [1, 2) */
157 _MM_MANT_NORM_p5_2
, /* interval [0.5, 2) */
158 _MM_MANT_NORM_p5_1
, /* interval [0.5, 1) */
159 _MM_MANT_NORM_p75_1p5
/* interval [0.75, 1.5) */
160 } _MM_MANTISSA_NORM_ENUM
;
164 _MM_MANT_SIGN_src
, /* sign = sign(SRC) */
165 _MM_MANT_SIGN_zero
, /* sign = 0 */
166 _MM_MANT_SIGN_nan
/* DEST = NaN if sign(SRC) = 1 */
167 } _MM_MANTISSA_SIGN_ENUM
;
169 /* Define the default attributes for the functions in this file. */
170 #define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(512)))
171 #define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(128)))
172 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512f")))
174 /* Create vectors with repeated elements */
176 static __inline __m512i __DEFAULT_FN_ATTRS512
177 _mm512_setzero_si512(void)
179 return __extension__ (__m512i
)(__v8di
){ 0, 0, 0, 0, 0, 0, 0, 0 };
182 #define _mm512_setzero_epi32 _mm512_setzero_si512
184 static __inline__ __m512d __DEFAULT_FN_ATTRS512
185 _mm512_undefined_pd(void)
187 return (__m512d
)__builtin_ia32_undef512();
190 static __inline__ __m512 __DEFAULT_FN_ATTRS512
191 _mm512_undefined(void)
193 return (__m512
)__builtin_ia32_undef512();
196 static __inline__ __m512 __DEFAULT_FN_ATTRS512
197 _mm512_undefined_ps(void)
199 return (__m512
)__builtin_ia32_undef512();
202 static __inline__ __m512i __DEFAULT_FN_ATTRS512
203 _mm512_undefined_epi32(void)
205 return (__m512i
)__builtin_ia32_undef512();
208 static __inline__ __m512i __DEFAULT_FN_ATTRS512
209 _mm512_broadcastd_epi32 (__m128i __A
)
211 return (__m512i
)__builtin_shufflevector((__v4si
) __A
, (__v4si
) __A
,
212 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
215 static __inline__ __m512i __DEFAULT_FN_ATTRS512
216 _mm512_mask_broadcastd_epi32 (__m512i __O
, __mmask16 __M
, __m128i __A
)
218 return (__m512i
)__builtin_ia32_selectd_512(__M
,
219 (__v16si
) _mm512_broadcastd_epi32(__A
),
223 static __inline__ __m512i __DEFAULT_FN_ATTRS512
224 _mm512_maskz_broadcastd_epi32 (__mmask16 __M
, __m128i __A
)
226 return (__m512i
)__builtin_ia32_selectd_512(__M
,
227 (__v16si
) _mm512_broadcastd_epi32(__A
),
228 (__v16si
) _mm512_setzero_si512());
231 static __inline__ __m512i __DEFAULT_FN_ATTRS512
232 _mm512_broadcastq_epi64 (__m128i __A
)
234 return (__m512i
)__builtin_shufflevector((__v2di
) __A
, (__v2di
) __A
,
235 0, 0, 0, 0, 0, 0, 0, 0);
238 static __inline__ __m512i __DEFAULT_FN_ATTRS512
239 _mm512_mask_broadcastq_epi64 (__m512i __O
, __mmask8 __M
, __m128i __A
)
241 return (__m512i
)__builtin_ia32_selectq_512(__M
,
242 (__v8di
) _mm512_broadcastq_epi64(__A
),
247 static __inline__ __m512i __DEFAULT_FN_ATTRS512
248 _mm512_maskz_broadcastq_epi64 (__mmask8 __M
, __m128i __A
)
250 return (__m512i
)__builtin_ia32_selectq_512(__M
,
251 (__v8di
) _mm512_broadcastq_epi64(__A
),
252 (__v8di
) _mm512_setzero_si512());
256 static __inline __m512 __DEFAULT_FN_ATTRS512
257 _mm512_setzero_ps(void)
259 return __extension__ (__m512
){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
260 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
263 #define _mm512_setzero _mm512_setzero_ps
265 static __inline __m512d __DEFAULT_FN_ATTRS512
266 _mm512_setzero_pd(void)
268 return __extension__ (__m512d
){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
271 static __inline __m512 __DEFAULT_FN_ATTRS512
272 _mm512_set1_ps(float __w
)
274 return __extension__ (__m512
){ __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
275 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
};
278 static __inline __m512d __DEFAULT_FN_ATTRS512
279 _mm512_set1_pd(double __w
)
281 return __extension__ (__m512d
){ __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
};
284 static __inline __m512i __DEFAULT_FN_ATTRS512
285 _mm512_set1_epi8(char __w
)
287 return __extension__ (__m512i
)(__v64qi
){
288 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
289 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
290 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
291 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
292 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
293 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
294 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
295 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
};
298 static __inline __m512i __DEFAULT_FN_ATTRS512
299 _mm512_set1_epi16(short __w
)
301 return __extension__ (__m512i
)(__v32hi
){
302 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
303 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
304 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
,
305 __w
, __w
, __w
, __w
, __w
, __w
, __w
, __w
};
308 static __inline __m512i __DEFAULT_FN_ATTRS512
309 _mm512_set1_epi32(int __s
)
311 return __extension__ (__m512i
)(__v16si
){
312 __s
, __s
, __s
, __s
, __s
, __s
, __s
, __s
,
313 __s
, __s
, __s
, __s
, __s
, __s
, __s
, __s
};
316 static __inline __m512i __DEFAULT_FN_ATTRS512
317 _mm512_maskz_set1_epi32(__mmask16 __M
, int __A
)
319 return (__m512i
)__builtin_ia32_selectd_512(__M
,
320 (__v16si
)_mm512_set1_epi32(__A
),
321 (__v16si
)_mm512_setzero_si512());
324 static __inline __m512i __DEFAULT_FN_ATTRS512
325 _mm512_set1_epi64(long long __d
)
327 return __extension__(__m512i
)(__v8di
){ __d
, __d
, __d
, __d
, __d
, __d
, __d
, __d
};
330 static __inline __m512i __DEFAULT_FN_ATTRS512
331 _mm512_maskz_set1_epi64(__mmask8 __M
, long long __A
)
333 return (__m512i
)__builtin_ia32_selectq_512(__M
,
334 (__v8di
)_mm512_set1_epi64(__A
),
335 (__v8di
)_mm512_setzero_si512());
338 static __inline__ __m512 __DEFAULT_FN_ATTRS512
339 _mm512_broadcastss_ps(__m128 __A
)
341 return (__m512
)__builtin_shufflevector((__v4sf
) __A
, (__v4sf
) __A
,
342 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
345 static __inline __m512i __DEFAULT_FN_ATTRS512
346 _mm512_set4_epi32 (int __A
, int __B
, int __C
, int __D
)
348 return __extension__ (__m512i
)(__v16si
)
349 { __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
,
350 __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
};
353 static __inline __m512i __DEFAULT_FN_ATTRS512
354 _mm512_set4_epi64 (long long __A
, long long __B
, long long __C
,
357 return __extension__ (__m512i
) (__v8di
)
358 { __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
};
361 static __inline __m512d __DEFAULT_FN_ATTRS512
362 _mm512_set4_pd (double __A
, double __B
, double __C
, double __D
)
364 return __extension__ (__m512d
)
365 { __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
};
368 static __inline __m512 __DEFAULT_FN_ATTRS512
369 _mm512_set4_ps (float __A
, float __B
, float __C
, float __D
)
371 return __extension__ (__m512
)
372 { __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
,
373 __D
, __C
, __B
, __A
, __D
, __C
, __B
, __A
};
376 #define _mm512_setr4_epi32(e0,e1,e2,e3) \
377 _mm512_set4_epi32((e3),(e2),(e1),(e0))
379 #define _mm512_setr4_epi64(e0,e1,e2,e3) \
380 _mm512_set4_epi64((e3),(e2),(e1),(e0))
382 #define _mm512_setr4_pd(e0,e1,e2,e3) \
383 _mm512_set4_pd((e3),(e2),(e1),(e0))
385 #define _mm512_setr4_ps(e0,e1,e2,e3) \
386 _mm512_set4_ps((e3),(e2),(e1),(e0))
388 static __inline__ __m512d __DEFAULT_FN_ATTRS512
389 _mm512_broadcastsd_pd(__m128d __A
)
391 return (__m512d
)__builtin_shufflevector((__v2df
) __A
, (__v2df
) __A
,
392 0, 0, 0, 0, 0, 0, 0, 0);
395 /* Cast between vector types */
397 static __inline __m512d __DEFAULT_FN_ATTRS512
398 _mm512_castpd256_pd512(__m256d __a
)
400 return __builtin_shufflevector(__a
, __a
, 0, 1, 2, 3, -1, -1, -1, -1);
403 static __inline __m512 __DEFAULT_FN_ATTRS512
404 _mm512_castps256_ps512(__m256 __a
)
406 return __builtin_shufflevector(__a
, __a
, 0, 1, 2, 3, 4, 5, 6, 7,
407 -1, -1, -1, -1, -1, -1, -1, -1);
410 static __inline __m128d __DEFAULT_FN_ATTRS512
411 _mm512_castpd512_pd128(__m512d __a
)
413 return __builtin_shufflevector(__a
, __a
, 0, 1);
416 static __inline __m256d __DEFAULT_FN_ATTRS512
417 _mm512_castpd512_pd256 (__m512d __A
)
419 return __builtin_shufflevector(__A
, __A
, 0, 1, 2, 3);
422 static __inline __m128 __DEFAULT_FN_ATTRS512
423 _mm512_castps512_ps128(__m512 __a
)
425 return __builtin_shufflevector(__a
, __a
, 0, 1, 2, 3);
428 static __inline __m256 __DEFAULT_FN_ATTRS512
429 _mm512_castps512_ps256 (__m512 __A
)
431 return __builtin_shufflevector(__A
, __A
, 0, 1, 2, 3, 4, 5, 6, 7);
434 static __inline __m512 __DEFAULT_FN_ATTRS512
435 _mm512_castpd_ps (__m512d __A
)
437 return (__m512
) (__A
);
440 static __inline __m512i __DEFAULT_FN_ATTRS512
441 _mm512_castpd_si512 (__m512d __A
)
443 return (__m512i
) (__A
);
446 static __inline__ __m512d __DEFAULT_FN_ATTRS512
447 _mm512_castpd128_pd512 (__m128d __A
)
449 return __builtin_shufflevector( __A
, __A
, 0, 1, -1, -1, -1, -1, -1, -1);
452 static __inline __m512d __DEFAULT_FN_ATTRS512
453 _mm512_castps_pd (__m512 __A
)
455 return (__m512d
) (__A
);
458 static __inline __m512i __DEFAULT_FN_ATTRS512
459 _mm512_castps_si512 (__m512 __A
)
461 return (__m512i
) (__A
);
464 static __inline__ __m512 __DEFAULT_FN_ATTRS512
465 _mm512_castps128_ps512 (__m128 __A
)
467 return __builtin_shufflevector( __A
, __A
, 0, 1, 2, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
470 static __inline__ __m512i __DEFAULT_FN_ATTRS512
471 _mm512_castsi128_si512 (__m128i __A
)
473 return __builtin_shufflevector( __A
, __A
, 0, 1, -1, -1, -1, -1, -1, -1);
476 static __inline__ __m512i __DEFAULT_FN_ATTRS512
477 _mm512_castsi256_si512 (__m256i __A
)
479 return __builtin_shufflevector( __A
, __A
, 0, 1, 2, 3, -1, -1, -1, -1);
482 static __inline __m512 __DEFAULT_FN_ATTRS512
483 _mm512_castsi512_ps (__m512i __A
)
485 return (__m512
) (__A
);
488 static __inline __m512d __DEFAULT_FN_ATTRS512
489 _mm512_castsi512_pd (__m512i __A
)
491 return (__m512d
) (__A
);
494 static __inline __m128i __DEFAULT_FN_ATTRS512
495 _mm512_castsi512_si128 (__m512i __A
)
497 return (__m128i
)__builtin_shufflevector(__A
, __A
, 0, 1);
500 static __inline __m256i __DEFAULT_FN_ATTRS512
501 _mm512_castsi512_si256 (__m512i __A
)
503 return (__m256i
)__builtin_shufflevector(__A
, __A
, 0, 1, 2, 3);
506 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
507 _mm512_int2mask(int __a
)
509 return (__mmask16
)__a
;
512 static __inline__
int __DEFAULT_FN_ATTRS
513 _mm512_mask2int(__mmask16 __a
)
518 /// Constructs a 512-bit floating-point vector of [8 x double] from a
519 /// 128-bit floating-point vector of [2 x double]. The lower 128 bits
520 /// contain the value of the source vector. The upper 384 bits are set
523 /// \headerfile <x86intrin.h>
525 /// This intrinsic has no corresponding instruction.
528 /// A 128-bit vector of [2 x double].
529 /// \returns A 512-bit floating-point vector of [8 x double]. The lower 128 bits
530 /// contain the value of the parameter. The upper 384 bits are set to zero.
531 static __inline __m512d __DEFAULT_FN_ATTRS512
532 _mm512_zextpd128_pd512(__m128d __a
)
534 return __builtin_shufflevector((__v2df
)__a
, (__v2df
)_mm_setzero_pd(), 0, 1, 2, 3, 2, 3, 2, 3);
537 /// Constructs a 512-bit floating-point vector of [8 x double] from a
538 /// 256-bit floating-point vector of [4 x double]. The lower 256 bits
539 /// contain the value of the source vector. The upper 256 bits are set
542 /// \headerfile <x86intrin.h>
544 /// This intrinsic has no corresponding instruction.
547 /// A 256-bit vector of [4 x double].
548 /// \returns A 512-bit floating-point vector of [8 x double]. The lower 256 bits
549 /// contain the value of the parameter. The upper 256 bits are set to zero.
550 static __inline __m512d __DEFAULT_FN_ATTRS512
551 _mm512_zextpd256_pd512(__m256d __a
)
553 return __builtin_shufflevector((__v4df
)__a
, (__v4df
)_mm256_setzero_pd(), 0, 1, 2, 3, 4, 5, 6, 7);
556 /// Constructs a 512-bit floating-point vector of [16 x float] from a
557 /// 128-bit floating-point vector of [4 x float]. The lower 128 bits contain
558 /// the value of the source vector. The upper 384 bits are set to zero.
560 /// \headerfile <x86intrin.h>
562 /// This intrinsic has no corresponding instruction.
565 /// A 128-bit vector of [4 x float].
566 /// \returns A 512-bit floating-point vector of [16 x float]. The lower 128 bits
567 /// contain the value of the parameter. The upper 384 bits are set to zero.
568 static __inline __m512 __DEFAULT_FN_ATTRS512
569 _mm512_zextps128_ps512(__m128 __a
)
571 return __builtin_shufflevector((__v4sf
)__a
, (__v4sf
)_mm_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7);
574 /// Constructs a 512-bit floating-point vector of [16 x float] from a
575 /// 256-bit floating-point vector of [8 x float]. The lower 256 bits contain
576 /// the value of the source vector. The upper 256 bits are set to zero.
578 /// \headerfile <x86intrin.h>
580 /// This intrinsic has no corresponding instruction.
583 /// A 256-bit vector of [8 x float].
584 /// \returns A 512-bit floating-point vector of [16 x float]. The lower 256 bits
585 /// contain the value of the parameter. The upper 256 bits are set to zero.
586 static __inline __m512 __DEFAULT_FN_ATTRS512
587 _mm512_zextps256_ps512(__m256 __a
)
589 return __builtin_shufflevector((__v8sf
)__a
, (__v8sf
)_mm256_setzero_ps(), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
592 /// Constructs a 512-bit integer vector from a 128-bit integer vector.
593 /// The lower 128 bits contain the value of the source vector. The upper
594 /// 384 bits are set to zero.
596 /// \headerfile <x86intrin.h>
598 /// This intrinsic has no corresponding instruction.
601 /// A 128-bit integer vector.
602 /// \returns A 512-bit integer vector. The lower 128 bits contain the value of
603 /// the parameter. The upper 384 bits are set to zero.
604 static __inline __m512i __DEFAULT_FN_ATTRS512
605 _mm512_zextsi128_si512(__m128i __a
)
607 return __builtin_shufflevector((__v2di
)__a
, (__v2di
)_mm_setzero_si128(), 0, 1, 2, 3, 2, 3, 2, 3);
610 /// Constructs a 512-bit integer vector from a 256-bit integer vector.
611 /// The lower 256 bits contain the value of the source vector. The upper
612 /// 256 bits are set to zero.
614 /// \headerfile <x86intrin.h>
616 /// This intrinsic has no corresponding instruction.
619 /// A 256-bit integer vector.
620 /// \returns A 512-bit integer vector. The lower 256 bits contain the value of
621 /// the parameter. The upper 256 bits are set to zero.
622 static __inline __m512i __DEFAULT_FN_ATTRS512
623 _mm512_zextsi256_si512(__m256i __a
)
625 return __builtin_shufflevector((__v4di
)__a
, (__v4di
)_mm256_setzero_si256(), 0, 1, 2, 3, 4, 5, 6, 7);
628 /* Bitwise operators */
629 static __inline__ __m512i __DEFAULT_FN_ATTRS512
630 _mm512_and_epi32(__m512i __a
, __m512i __b
)
632 return (__m512i
)((__v16su
)__a
& (__v16su
)__b
);
635 static __inline__ __m512i __DEFAULT_FN_ATTRS512
636 _mm512_mask_and_epi32(__m512i __src
, __mmask16 __k
, __m512i __a
, __m512i __b
)
638 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__k
,
639 (__v16si
) _mm512_and_epi32(__a
, __b
),
643 static __inline__ __m512i __DEFAULT_FN_ATTRS512
644 _mm512_maskz_and_epi32(__mmask16 __k
, __m512i __a
, __m512i __b
)
646 return (__m512i
) _mm512_mask_and_epi32(_mm512_setzero_si512 (),
650 static __inline__ __m512i __DEFAULT_FN_ATTRS512
651 _mm512_and_epi64(__m512i __a
, __m512i __b
)
653 return (__m512i
)((__v8du
)__a
& (__v8du
)__b
);
656 static __inline__ __m512i __DEFAULT_FN_ATTRS512
657 _mm512_mask_and_epi64(__m512i __src
, __mmask8 __k
, __m512i __a
, __m512i __b
)
659 return (__m512i
) __builtin_ia32_selectq_512 ((__mmask8
) __k
,
660 (__v8di
) _mm512_and_epi64(__a
, __b
),
664 static __inline__ __m512i __DEFAULT_FN_ATTRS512
665 _mm512_maskz_and_epi64(__mmask8 __k
, __m512i __a
, __m512i __b
)
667 return (__m512i
) _mm512_mask_and_epi64(_mm512_setzero_si512 (),
671 static __inline__ __m512i __DEFAULT_FN_ATTRS512
672 _mm512_andnot_si512 (__m512i __A
, __m512i __B
)
674 return (__m512i
)(~(__v8du
)__A
& (__v8du
)__B
);
677 static __inline__ __m512i __DEFAULT_FN_ATTRS512
678 _mm512_andnot_epi32 (__m512i __A
, __m512i __B
)
680 return (__m512i
)(~(__v16su
)__A
& (__v16su
)__B
);
683 static __inline__ __m512i __DEFAULT_FN_ATTRS512
684 _mm512_mask_andnot_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
686 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
687 (__v16si
)_mm512_andnot_epi32(__A
, __B
),
691 static __inline__ __m512i __DEFAULT_FN_ATTRS512
692 _mm512_maskz_andnot_epi32(__mmask16 __U
, __m512i __A
, __m512i __B
)
694 return (__m512i
)_mm512_mask_andnot_epi32(_mm512_setzero_si512(),
698 static __inline__ __m512i __DEFAULT_FN_ATTRS512
699 _mm512_andnot_epi64(__m512i __A
, __m512i __B
)
701 return (__m512i
)(~(__v8du
)__A
& (__v8du
)__B
);
704 static __inline__ __m512i __DEFAULT_FN_ATTRS512
705 _mm512_mask_andnot_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
707 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
708 (__v8di
)_mm512_andnot_epi64(__A
, __B
),
712 static __inline__ __m512i __DEFAULT_FN_ATTRS512
713 _mm512_maskz_andnot_epi64(__mmask8 __U
, __m512i __A
, __m512i __B
)
715 return (__m512i
)_mm512_mask_andnot_epi64(_mm512_setzero_si512(),
719 static __inline__ __m512i __DEFAULT_FN_ATTRS512
720 _mm512_or_epi32(__m512i __a
, __m512i __b
)
722 return (__m512i
)((__v16su
)__a
| (__v16su
)__b
);
725 static __inline__ __m512i __DEFAULT_FN_ATTRS512
726 _mm512_mask_or_epi32(__m512i __src
, __mmask16 __k
, __m512i __a
, __m512i __b
)
728 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__k
,
729 (__v16si
)_mm512_or_epi32(__a
, __b
),
733 static __inline__ __m512i __DEFAULT_FN_ATTRS512
734 _mm512_maskz_or_epi32(__mmask16 __k
, __m512i __a
, __m512i __b
)
736 return (__m512i
)_mm512_mask_or_epi32(_mm512_setzero_si512(), __k
, __a
, __b
);
739 static __inline__ __m512i __DEFAULT_FN_ATTRS512
740 _mm512_or_epi64(__m512i __a
, __m512i __b
)
742 return (__m512i
)((__v8du
)__a
| (__v8du
)__b
);
745 static __inline__ __m512i __DEFAULT_FN_ATTRS512
746 _mm512_mask_or_epi64(__m512i __src
, __mmask8 __k
, __m512i __a
, __m512i __b
)
748 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__k
,
749 (__v8di
)_mm512_or_epi64(__a
, __b
),
753 static __inline__ __m512i __DEFAULT_FN_ATTRS512
754 _mm512_maskz_or_epi64(__mmask8 __k
, __m512i __a
, __m512i __b
)
756 return (__m512i
)_mm512_mask_or_epi64(_mm512_setzero_si512(), __k
, __a
, __b
);
759 static __inline__ __m512i __DEFAULT_FN_ATTRS512
760 _mm512_xor_epi32(__m512i __a
, __m512i __b
)
762 return (__m512i
)((__v16su
)__a
^ (__v16su
)__b
);
765 static __inline__ __m512i __DEFAULT_FN_ATTRS512
766 _mm512_mask_xor_epi32(__m512i __src
, __mmask16 __k
, __m512i __a
, __m512i __b
)
768 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__k
,
769 (__v16si
)_mm512_xor_epi32(__a
, __b
),
773 static __inline__ __m512i __DEFAULT_FN_ATTRS512
774 _mm512_maskz_xor_epi32(__mmask16 __k
, __m512i __a
, __m512i __b
)
776 return (__m512i
)_mm512_mask_xor_epi32(_mm512_setzero_si512(), __k
, __a
, __b
);
779 static __inline__ __m512i __DEFAULT_FN_ATTRS512
780 _mm512_xor_epi64(__m512i __a
, __m512i __b
)
782 return (__m512i
)((__v8du
)__a
^ (__v8du
)__b
);
785 static __inline__ __m512i __DEFAULT_FN_ATTRS512
786 _mm512_mask_xor_epi64(__m512i __src
, __mmask8 __k
, __m512i __a
, __m512i __b
)
788 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__k
,
789 (__v8di
)_mm512_xor_epi64(__a
, __b
),
793 static __inline__ __m512i __DEFAULT_FN_ATTRS512
794 _mm512_maskz_xor_epi64(__mmask8 __k
, __m512i __a
, __m512i __b
)
796 return (__m512i
)_mm512_mask_xor_epi64(_mm512_setzero_si512(), __k
, __a
, __b
);
799 static __inline__ __m512i __DEFAULT_FN_ATTRS512
800 _mm512_and_si512(__m512i __a
, __m512i __b
)
802 return (__m512i
)((__v8du
)__a
& (__v8du
)__b
);
805 static __inline__ __m512i __DEFAULT_FN_ATTRS512
806 _mm512_or_si512(__m512i __a
, __m512i __b
)
808 return (__m512i
)((__v8du
)__a
| (__v8du
)__b
);
811 static __inline__ __m512i __DEFAULT_FN_ATTRS512
812 _mm512_xor_si512(__m512i __a
, __m512i __b
)
814 return (__m512i
)((__v8du
)__a
^ (__v8du
)__b
);
819 static __inline __m512d __DEFAULT_FN_ATTRS512
820 _mm512_add_pd(__m512d __a
, __m512d __b
)
822 return (__m512d
)((__v8df
)__a
+ (__v8df
)__b
);
825 static __inline __m512 __DEFAULT_FN_ATTRS512
826 _mm512_add_ps(__m512 __a
, __m512 __b
)
828 return (__m512
)((__v16sf
)__a
+ (__v16sf
)__b
);
831 static __inline __m512d __DEFAULT_FN_ATTRS512
832 _mm512_mul_pd(__m512d __a
, __m512d __b
)
834 return (__m512d
)((__v8df
)__a
* (__v8df
)__b
);
837 static __inline __m512 __DEFAULT_FN_ATTRS512
838 _mm512_mul_ps(__m512 __a
, __m512 __b
)
840 return (__m512
)((__v16sf
)__a
* (__v16sf
)__b
);
843 static __inline __m512d __DEFAULT_FN_ATTRS512
844 _mm512_sub_pd(__m512d __a
, __m512d __b
)
846 return (__m512d
)((__v8df
)__a
- (__v8df
)__b
);
849 static __inline __m512 __DEFAULT_FN_ATTRS512
850 _mm512_sub_ps(__m512 __a
, __m512 __b
)
852 return (__m512
)((__v16sf
)__a
- (__v16sf
)__b
);
855 static __inline__ __m512i __DEFAULT_FN_ATTRS512
856 _mm512_add_epi64 (__m512i __A
, __m512i __B
)
858 return (__m512i
) ((__v8du
) __A
+ (__v8du
) __B
);
861 static __inline__ __m512i __DEFAULT_FN_ATTRS512
862 _mm512_mask_add_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
864 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
865 (__v8di
)_mm512_add_epi64(__A
, __B
),
869 static __inline__ __m512i __DEFAULT_FN_ATTRS512
870 _mm512_maskz_add_epi64(__mmask8 __U
, __m512i __A
, __m512i __B
)
872 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
873 (__v8di
)_mm512_add_epi64(__A
, __B
),
874 (__v8di
)_mm512_setzero_si512());
877 static __inline__ __m512i __DEFAULT_FN_ATTRS512
878 _mm512_sub_epi64 (__m512i __A
, __m512i __B
)
880 return (__m512i
) ((__v8du
) __A
- (__v8du
) __B
);
883 static __inline__ __m512i __DEFAULT_FN_ATTRS512
884 _mm512_mask_sub_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
886 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
887 (__v8di
)_mm512_sub_epi64(__A
, __B
),
891 static __inline__ __m512i __DEFAULT_FN_ATTRS512
892 _mm512_maskz_sub_epi64(__mmask8 __U
, __m512i __A
, __m512i __B
)
894 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
895 (__v8di
)_mm512_sub_epi64(__A
, __B
),
896 (__v8di
)_mm512_setzero_si512());
899 static __inline__ __m512i __DEFAULT_FN_ATTRS512
900 _mm512_add_epi32 (__m512i __A
, __m512i __B
)
902 return (__m512i
) ((__v16su
) __A
+ (__v16su
) __B
);
905 static __inline__ __m512i __DEFAULT_FN_ATTRS512
906 _mm512_mask_add_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
908 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
909 (__v16si
)_mm512_add_epi32(__A
, __B
),
913 static __inline__ __m512i __DEFAULT_FN_ATTRS512
914 _mm512_maskz_add_epi32 (__mmask16 __U
, __m512i __A
, __m512i __B
)
916 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
917 (__v16si
)_mm512_add_epi32(__A
, __B
),
918 (__v16si
)_mm512_setzero_si512());
921 static __inline__ __m512i __DEFAULT_FN_ATTRS512
922 _mm512_sub_epi32 (__m512i __A
, __m512i __B
)
924 return (__m512i
) ((__v16su
) __A
- (__v16su
) __B
);
927 static __inline__ __m512i __DEFAULT_FN_ATTRS512
928 _mm512_mask_sub_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
930 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
931 (__v16si
)_mm512_sub_epi32(__A
, __B
),
935 static __inline__ __m512i __DEFAULT_FN_ATTRS512
936 _mm512_maskz_sub_epi32(__mmask16 __U
, __m512i __A
, __m512i __B
)
938 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
939 (__v16si
)_mm512_sub_epi32(__A
, __B
),
940 (__v16si
)_mm512_setzero_si512());
943 #define _mm512_max_round_pd(A, B, R) \
944 ((__m512d)__builtin_ia32_maxpd512((__v8df)(__m512d)(A), \
945 (__v8df)(__m512d)(B), (int)(R)))
947 #define _mm512_mask_max_round_pd(W, U, A, B, R) \
948 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
949 (__v8df)_mm512_max_round_pd((A), (B), (R)), \
952 #define _mm512_maskz_max_round_pd(U, A, B, R) \
953 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
954 (__v8df)_mm512_max_round_pd((A), (B), (R)), \
955 (__v8df)_mm512_setzero_pd()))
957 static __inline__ __m512d __DEFAULT_FN_ATTRS512
958 _mm512_max_pd(__m512d __A
, __m512d __B
)
960 return (__m512d
) __builtin_ia32_maxpd512((__v8df
) __A
, (__v8df
) __B
,
961 _MM_FROUND_CUR_DIRECTION
);
964 static __inline__ __m512d __DEFAULT_FN_ATTRS512
965 _mm512_mask_max_pd (__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
)
967 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
968 (__v8df
)_mm512_max_pd(__A
, __B
),
972 static __inline__ __m512d __DEFAULT_FN_ATTRS512
973 _mm512_maskz_max_pd (__mmask8 __U
, __m512d __A
, __m512d __B
)
975 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
976 (__v8df
)_mm512_max_pd(__A
, __B
),
977 (__v8df
)_mm512_setzero_pd());
980 #define _mm512_max_round_ps(A, B, R) \
981 ((__m512)__builtin_ia32_maxps512((__v16sf)(__m512)(A), \
982 (__v16sf)(__m512)(B), (int)(R)))
984 #define _mm512_mask_max_round_ps(W, U, A, B, R) \
985 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
986 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \
989 #define _mm512_maskz_max_round_ps(U, A, B, R) \
990 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
991 (__v16sf)_mm512_max_round_ps((A), (B), (R)), \
992 (__v16sf)_mm512_setzero_ps()))
994 static __inline__ __m512 __DEFAULT_FN_ATTRS512
995 _mm512_max_ps(__m512 __A
, __m512 __B
)
997 return (__m512
) __builtin_ia32_maxps512((__v16sf
) __A
, (__v16sf
) __B
,
998 _MM_FROUND_CUR_DIRECTION
);
1001 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1002 _mm512_mask_max_ps (__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
)
1004 return (__m512
)__builtin_ia32_selectps_512(__U
,
1005 (__v16sf
)_mm512_max_ps(__A
, __B
),
1009 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1010 _mm512_maskz_max_ps (__mmask16 __U
, __m512 __A
, __m512 __B
)
1012 return (__m512
)__builtin_ia32_selectps_512(__U
,
1013 (__v16sf
)_mm512_max_ps(__A
, __B
),
1014 (__v16sf
)_mm512_setzero_ps());
1017 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1018 _mm_mask_max_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
1019 return (__m128
) __builtin_ia32_maxss_round_mask ((__v4sf
) __A
,
1023 _MM_FROUND_CUR_DIRECTION
);
1026 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1027 _mm_maskz_max_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
1028 return (__m128
) __builtin_ia32_maxss_round_mask ((__v4sf
) __A
,
1030 (__v4sf
) _mm_setzero_ps (),
1032 _MM_FROUND_CUR_DIRECTION
);
1035 #define _mm_max_round_ss(A, B, R) \
1036 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1037 (__v4sf)(__m128)(B), \
1038 (__v4sf)_mm_setzero_ps(), \
1039 (__mmask8)-1, (int)(R)))
1041 #define _mm_mask_max_round_ss(W, U, A, B, R) \
1042 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1043 (__v4sf)(__m128)(B), \
1044 (__v4sf)(__m128)(W), (__mmask8)(U), \
1047 #define _mm_maskz_max_round_ss(U, A, B, R) \
1048 ((__m128)__builtin_ia32_maxss_round_mask((__v4sf)(__m128)(A), \
1049 (__v4sf)(__m128)(B), \
1050 (__v4sf)_mm_setzero_ps(), \
1051 (__mmask8)(U), (int)(R)))
1053 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1054 _mm_mask_max_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
1055 return (__m128d
) __builtin_ia32_maxsd_round_mask ((__v2df
) __A
,
1059 _MM_FROUND_CUR_DIRECTION
);
1062 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1063 _mm_maskz_max_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
1064 return (__m128d
) __builtin_ia32_maxsd_round_mask ((__v2df
) __A
,
1066 (__v2df
) _mm_setzero_pd (),
1068 _MM_FROUND_CUR_DIRECTION
);
1071 #define _mm_max_round_sd(A, B, R) \
1072 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1073 (__v2df)(__m128d)(B), \
1074 (__v2df)_mm_setzero_pd(), \
1075 (__mmask8)-1, (int)(R)))
1077 #define _mm_mask_max_round_sd(W, U, A, B, R) \
1078 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1079 (__v2df)(__m128d)(B), \
1080 (__v2df)(__m128d)(W), \
1081 (__mmask8)(U), (int)(R)))
1083 #define _mm_maskz_max_round_sd(U, A, B, R) \
1084 ((__m128d)__builtin_ia32_maxsd_round_mask((__v2df)(__m128d)(A), \
1085 (__v2df)(__m128d)(B), \
1086 (__v2df)_mm_setzero_pd(), \
1087 (__mmask8)(U), (int)(R)))
1089 static __inline __m512i
1090 __DEFAULT_FN_ATTRS512
1091 _mm512_max_epi32(__m512i __A
, __m512i __B
)
1093 return (__m512i
)__builtin_elementwise_max((__v16si
)__A
, (__v16si
)__B
);
1096 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1097 _mm512_mask_max_epi32 (__m512i __W
, __mmask16 __M
, __m512i __A
, __m512i __B
)
1099 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1100 (__v16si
)_mm512_max_epi32(__A
, __B
),
1104 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1105 _mm512_maskz_max_epi32 (__mmask16 __M
, __m512i __A
, __m512i __B
)
1107 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1108 (__v16si
)_mm512_max_epi32(__A
, __B
),
1109 (__v16si
)_mm512_setzero_si512());
1112 static __inline __m512i __DEFAULT_FN_ATTRS512
1113 _mm512_max_epu32(__m512i __A
, __m512i __B
)
1115 return (__m512i
)__builtin_elementwise_max((__v16su
)__A
, (__v16su
)__B
);
1118 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1119 _mm512_mask_max_epu32 (__m512i __W
, __mmask16 __M
, __m512i __A
, __m512i __B
)
1121 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1122 (__v16si
)_mm512_max_epu32(__A
, __B
),
1126 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1127 _mm512_maskz_max_epu32 (__mmask16 __M
, __m512i __A
, __m512i __B
)
1129 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1130 (__v16si
)_mm512_max_epu32(__A
, __B
),
1131 (__v16si
)_mm512_setzero_si512());
1134 static __inline __m512i __DEFAULT_FN_ATTRS512
1135 _mm512_max_epi64(__m512i __A
, __m512i __B
)
1137 return (__m512i
)__builtin_elementwise_max((__v8di
)__A
, (__v8di
)__B
);
1140 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1141 _mm512_mask_max_epi64 (__m512i __W
, __mmask8 __M
, __m512i __A
, __m512i __B
)
1143 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1144 (__v8di
)_mm512_max_epi64(__A
, __B
),
1148 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1149 _mm512_maskz_max_epi64 (__mmask8 __M
, __m512i __A
, __m512i __B
)
1151 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1152 (__v8di
)_mm512_max_epi64(__A
, __B
),
1153 (__v8di
)_mm512_setzero_si512());
1156 static __inline __m512i __DEFAULT_FN_ATTRS512
1157 _mm512_max_epu64(__m512i __A
, __m512i __B
)
1159 return (__m512i
)__builtin_elementwise_max((__v8du
)__A
, (__v8du
)__B
);
1162 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1163 _mm512_mask_max_epu64 (__m512i __W
, __mmask8 __M
, __m512i __A
, __m512i __B
)
1165 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1166 (__v8di
)_mm512_max_epu64(__A
, __B
),
1170 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1171 _mm512_maskz_max_epu64 (__mmask8 __M
, __m512i __A
, __m512i __B
)
1173 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1174 (__v8di
)_mm512_max_epu64(__A
, __B
),
1175 (__v8di
)_mm512_setzero_si512());
1178 #define _mm512_min_round_pd(A, B, R) \
1179 ((__m512d)__builtin_ia32_minpd512((__v8df)(__m512d)(A), \
1180 (__v8df)(__m512d)(B), (int)(R)))
1182 #define _mm512_mask_min_round_pd(W, U, A, B, R) \
1183 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1184 (__v8df)_mm512_min_round_pd((A), (B), (R)), \
1187 #define _mm512_maskz_min_round_pd(U, A, B, R) \
1188 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1189 (__v8df)_mm512_min_round_pd((A), (B), (R)), \
1190 (__v8df)_mm512_setzero_pd()))
1192 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1193 _mm512_min_pd(__m512d __A
, __m512d __B
)
1195 return (__m512d
) __builtin_ia32_minpd512((__v8df
) __A
, (__v8df
) __B
,
1196 _MM_FROUND_CUR_DIRECTION
);
1199 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1200 _mm512_mask_min_pd (__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
)
1202 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
1203 (__v8df
)_mm512_min_pd(__A
, __B
),
1207 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1208 _mm512_maskz_min_pd (__mmask8 __U
, __m512d __A
, __m512d __B
)
1210 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
1211 (__v8df
)_mm512_min_pd(__A
, __B
),
1212 (__v8df
)_mm512_setzero_pd());
1215 #define _mm512_min_round_ps(A, B, R) \
1216 ((__m512)__builtin_ia32_minps512((__v16sf)(__m512)(A), \
1217 (__v16sf)(__m512)(B), (int)(R)))
1219 #define _mm512_mask_min_round_ps(W, U, A, B, R) \
1220 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1221 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \
1224 #define _mm512_maskz_min_round_ps(U, A, B, R) \
1225 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1226 (__v16sf)_mm512_min_round_ps((A), (B), (R)), \
1227 (__v16sf)_mm512_setzero_ps()))
1229 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1230 _mm512_min_ps(__m512 __A
, __m512 __B
)
1232 return (__m512
) __builtin_ia32_minps512((__v16sf
) __A
, (__v16sf
) __B
,
1233 _MM_FROUND_CUR_DIRECTION
);
1236 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1237 _mm512_mask_min_ps (__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
)
1239 return (__m512
)__builtin_ia32_selectps_512(__U
,
1240 (__v16sf
)_mm512_min_ps(__A
, __B
),
1244 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1245 _mm512_maskz_min_ps (__mmask16 __U
, __m512 __A
, __m512 __B
)
1247 return (__m512
)__builtin_ia32_selectps_512(__U
,
1248 (__v16sf
)_mm512_min_ps(__A
, __B
),
1249 (__v16sf
)_mm512_setzero_ps());
1252 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1253 _mm_mask_min_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
1254 return (__m128
) __builtin_ia32_minss_round_mask ((__v4sf
) __A
,
1258 _MM_FROUND_CUR_DIRECTION
);
1261 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1262 _mm_maskz_min_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
1263 return (__m128
) __builtin_ia32_minss_round_mask ((__v4sf
) __A
,
1265 (__v4sf
) _mm_setzero_ps (),
1267 _MM_FROUND_CUR_DIRECTION
);
1270 #define _mm_min_round_ss(A, B, R) \
1271 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1272 (__v4sf)(__m128)(B), \
1273 (__v4sf)_mm_setzero_ps(), \
1274 (__mmask8)-1, (int)(R)))
1276 #define _mm_mask_min_round_ss(W, U, A, B, R) \
1277 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1278 (__v4sf)(__m128)(B), \
1279 (__v4sf)(__m128)(W), (__mmask8)(U), \
1282 #define _mm_maskz_min_round_ss(U, A, B, R) \
1283 ((__m128)__builtin_ia32_minss_round_mask((__v4sf)(__m128)(A), \
1284 (__v4sf)(__m128)(B), \
1285 (__v4sf)_mm_setzero_ps(), \
1286 (__mmask8)(U), (int)(R)))
1288 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1289 _mm_mask_min_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
1290 return (__m128d
) __builtin_ia32_minsd_round_mask ((__v2df
) __A
,
1294 _MM_FROUND_CUR_DIRECTION
);
1297 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1298 _mm_maskz_min_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
1299 return (__m128d
) __builtin_ia32_minsd_round_mask ((__v2df
) __A
,
1301 (__v2df
) _mm_setzero_pd (),
1303 _MM_FROUND_CUR_DIRECTION
);
1306 #define _mm_min_round_sd(A, B, R) \
1307 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1308 (__v2df)(__m128d)(B), \
1309 (__v2df)_mm_setzero_pd(), \
1310 (__mmask8)-1, (int)(R)))
1312 #define _mm_mask_min_round_sd(W, U, A, B, R) \
1313 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1314 (__v2df)(__m128d)(B), \
1315 (__v2df)(__m128d)(W), \
1316 (__mmask8)(U), (int)(R)))
1318 #define _mm_maskz_min_round_sd(U, A, B, R) \
1319 ((__m128d)__builtin_ia32_minsd_round_mask((__v2df)(__m128d)(A), \
1320 (__v2df)(__m128d)(B), \
1321 (__v2df)_mm_setzero_pd(), \
1322 (__mmask8)(U), (int)(R)))
1324 static __inline __m512i
1325 __DEFAULT_FN_ATTRS512
1326 _mm512_min_epi32(__m512i __A
, __m512i __B
)
1328 return (__m512i
)__builtin_elementwise_min((__v16si
)__A
, (__v16si
)__B
);
1331 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1332 _mm512_mask_min_epi32 (__m512i __W
, __mmask16 __M
, __m512i __A
, __m512i __B
)
1334 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1335 (__v16si
)_mm512_min_epi32(__A
, __B
),
1339 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1340 _mm512_maskz_min_epi32 (__mmask16 __M
, __m512i __A
, __m512i __B
)
1342 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1343 (__v16si
)_mm512_min_epi32(__A
, __B
),
1344 (__v16si
)_mm512_setzero_si512());
1347 static __inline __m512i __DEFAULT_FN_ATTRS512
1348 _mm512_min_epu32(__m512i __A
, __m512i __B
)
1350 return (__m512i
)__builtin_elementwise_min((__v16su
)__A
, (__v16su
)__B
);
1353 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1354 _mm512_mask_min_epu32 (__m512i __W
, __mmask16 __M
, __m512i __A
, __m512i __B
)
1356 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1357 (__v16si
)_mm512_min_epu32(__A
, __B
),
1361 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1362 _mm512_maskz_min_epu32 (__mmask16 __M
, __m512i __A
, __m512i __B
)
1364 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1365 (__v16si
)_mm512_min_epu32(__A
, __B
),
1366 (__v16si
)_mm512_setzero_si512());
1369 static __inline __m512i __DEFAULT_FN_ATTRS512
1370 _mm512_min_epi64(__m512i __A
, __m512i __B
)
1372 return (__m512i
)__builtin_elementwise_min((__v8di
)__A
, (__v8di
)__B
);
1375 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1376 _mm512_mask_min_epi64 (__m512i __W
, __mmask8 __M
, __m512i __A
, __m512i __B
)
1378 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1379 (__v8di
)_mm512_min_epi64(__A
, __B
),
1383 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1384 _mm512_maskz_min_epi64 (__mmask8 __M
, __m512i __A
, __m512i __B
)
1386 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1387 (__v8di
)_mm512_min_epi64(__A
, __B
),
1388 (__v8di
)_mm512_setzero_si512());
1391 static __inline __m512i __DEFAULT_FN_ATTRS512
1392 _mm512_min_epu64(__m512i __A
, __m512i __B
)
1394 return (__m512i
)__builtin_elementwise_min((__v8du
)__A
, (__v8du
)__B
);
1397 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1398 _mm512_mask_min_epu64 (__m512i __W
, __mmask8 __M
, __m512i __A
, __m512i __B
)
1400 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1401 (__v8di
)_mm512_min_epu64(__A
, __B
),
1405 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1406 _mm512_maskz_min_epu64 (__mmask8 __M
, __m512i __A
, __m512i __B
)
1408 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1409 (__v8di
)_mm512_min_epu64(__A
, __B
),
1410 (__v8di
)_mm512_setzero_si512());
1413 static __inline __m512i __DEFAULT_FN_ATTRS512
1414 _mm512_mul_epi32(__m512i __X
, __m512i __Y
)
1416 return (__m512i
)__builtin_ia32_pmuldq512((__v16si
)__X
, (__v16si
) __Y
);
1419 static __inline __m512i __DEFAULT_FN_ATTRS512
1420 _mm512_mask_mul_epi32(__m512i __W
, __mmask8 __M
, __m512i __X
, __m512i __Y
)
1422 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1423 (__v8di
)_mm512_mul_epi32(__X
, __Y
),
1427 static __inline __m512i __DEFAULT_FN_ATTRS512
1428 _mm512_maskz_mul_epi32(__mmask8 __M
, __m512i __X
, __m512i __Y
)
1430 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1431 (__v8di
)_mm512_mul_epi32(__X
, __Y
),
1432 (__v8di
)_mm512_setzero_si512 ());
1435 static __inline __m512i __DEFAULT_FN_ATTRS512
1436 _mm512_mul_epu32(__m512i __X
, __m512i __Y
)
1438 return (__m512i
)__builtin_ia32_pmuludq512((__v16si
)__X
, (__v16si
)__Y
);
1441 static __inline __m512i __DEFAULT_FN_ATTRS512
1442 _mm512_mask_mul_epu32(__m512i __W
, __mmask8 __M
, __m512i __X
, __m512i __Y
)
1444 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1445 (__v8di
)_mm512_mul_epu32(__X
, __Y
),
1449 static __inline __m512i __DEFAULT_FN_ATTRS512
1450 _mm512_maskz_mul_epu32(__mmask8 __M
, __m512i __X
, __m512i __Y
)
1452 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
1453 (__v8di
)_mm512_mul_epu32(__X
, __Y
),
1454 (__v8di
)_mm512_setzero_si512 ());
1457 static __inline __m512i __DEFAULT_FN_ATTRS512
1458 _mm512_mullo_epi32 (__m512i __A
, __m512i __B
)
1460 return (__m512i
) ((__v16su
) __A
* (__v16su
) __B
);
1463 static __inline __m512i __DEFAULT_FN_ATTRS512
1464 _mm512_maskz_mullo_epi32(__mmask16 __M
, __m512i __A
, __m512i __B
)
1466 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1467 (__v16si
)_mm512_mullo_epi32(__A
, __B
),
1468 (__v16si
)_mm512_setzero_si512());
1471 static __inline __m512i __DEFAULT_FN_ATTRS512
1472 _mm512_mask_mullo_epi32(__m512i __W
, __mmask16 __M
, __m512i __A
, __m512i __B
)
1474 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
1475 (__v16si
)_mm512_mullo_epi32(__A
, __B
),
1479 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1480 _mm512_mullox_epi64 (__m512i __A
, __m512i __B
) {
1481 return (__m512i
) ((__v8du
) __A
* (__v8du
) __B
);
1484 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1485 _mm512_mask_mullox_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
) {
1486 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
1487 (__v8di
)_mm512_mullox_epi64(__A
, __B
),
1491 #define _mm512_sqrt_round_pd(A, R) \
1492 ((__m512d)__builtin_ia32_sqrtpd512((__v8df)(__m512d)(A), (int)(R)))
1494 #define _mm512_mask_sqrt_round_pd(W, U, A, R) \
1495 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1496 (__v8df)_mm512_sqrt_round_pd((A), (R)), \
1497 (__v8df)(__m512d)(W)))
1499 #define _mm512_maskz_sqrt_round_pd(U, A, R) \
1500 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1501 (__v8df)_mm512_sqrt_round_pd((A), (R)), \
1502 (__v8df)_mm512_setzero_pd()))
1504 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1505 _mm512_sqrt_pd(__m512d __A
)
1507 return (__m512d
)__builtin_ia32_sqrtpd512((__v8df
)__A
,
1508 _MM_FROUND_CUR_DIRECTION
);
1511 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1512 _mm512_mask_sqrt_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
1514 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
1515 (__v8df
)_mm512_sqrt_pd(__A
),
1519 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1520 _mm512_maskz_sqrt_pd (__mmask8 __U
, __m512d __A
)
1522 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
1523 (__v8df
)_mm512_sqrt_pd(__A
),
1524 (__v8df
)_mm512_setzero_pd());
1527 #define _mm512_sqrt_round_ps(A, R) \
1528 ((__m512)__builtin_ia32_sqrtps512((__v16sf)(__m512)(A), (int)(R)))
1530 #define _mm512_mask_sqrt_round_ps(W, U, A, R) \
1531 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1532 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \
1533 (__v16sf)(__m512)(W)))
1535 #define _mm512_maskz_sqrt_round_ps(U, A, R) \
1536 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
1537 (__v16sf)_mm512_sqrt_round_ps((A), (R)), \
1538 (__v16sf)_mm512_setzero_ps()))
1540 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1541 _mm512_sqrt_ps(__m512 __A
)
1543 return (__m512
)__builtin_ia32_sqrtps512((__v16sf
)__A
,
1544 _MM_FROUND_CUR_DIRECTION
);
1547 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1548 _mm512_mask_sqrt_ps(__m512 __W
, __mmask16 __U
, __m512 __A
)
1550 return (__m512
)__builtin_ia32_selectps_512(__U
,
1551 (__v16sf
)_mm512_sqrt_ps(__A
),
1555 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1556 _mm512_maskz_sqrt_ps( __mmask16 __U
, __m512 __A
)
1558 return (__m512
)__builtin_ia32_selectps_512(__U
,
1559 (__v16sf
)_mm512_sqrt_ps(__A
),
1560 (__v16sf
)_mm512_setzero_ps());
1563 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1564 _mm512_rsqrt14_pd(__m512d __A
)
1566 return (__m512d
) __builtin_ia32_rsqrt14pd512_mask ((__v8df
) __A
,
1568 _mm512_setzero_pd (),
1571 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1572 _mm512_mask_rsqrt14_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
1574 return (__m512d
) __builtin_ia32_rsqrt14pd512_mask ((__v8df
) __A
,
1579 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1580 _mm512_maskz_rsqrt14_pd (__mmask8 __U
, __m512d __A
)
1582 return (__m512d
) __builtin_ia32_rsqrt14pd512_mask ((__v8df
) __A
,
1584 _mm512_setzero_pd (),
1588 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1589 _mm512_rsqrt14_ps(__m512 __A
)
1591 return (__m512
) __builtin_ia32_rsqrt14ps512_mask ((__v16sf
) __A
,
1593 _mm512_setzero_ps (),
1597 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1598 _mm512_mask_rsqrt14_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
1600 return (__m512
) __builtin_ia32_rsqrt14ps512_mask ((__v16sf
) __A
,
1605 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1606 _mm512_maskz_rsqrt14_ps (__mmask16 __U
, __m512 __A
)
1608 return (__m512
) __builtin_ia32_rsqrt14ps512_mask ((__v16sf
) __A
,
1610 _mm512_setzero_ps (),
1614 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1615 _mm_rsqrt14_ss(__m128 __A
, __m128 __B
)
1617 return (__m128
) __builtin_ia32_rsqrt14ss_mask ((__v4sf
) __A
,
1624 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1625 _mm_mask_rsqrt14_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
1627 return (__m128
) __builtin_ia32_rsqrt14ss_mask ((__v4sf
) __A
,
1633 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1634 _mm_maskz_rsqrt14_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
1636 return (__m128
) __builtin_ia32_rsqrt14ss_mask ((__v4sf
) __A
,
1638 (__v4sf
) _mm_setzero_ps (),
1642 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1643 _mm_rsqrt14_sd(__m128d __A
, __m128d __B
)
1645 return (__m128d
) __builtin_ia32_rsqrt14sd_mask ((__v2df
) __A
,
1652 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1653 _mm_mask_rsqrt14_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
1655 return (__m128d
) __builtin_ia32_rsqrt14sd_mask ( (__v2df
) __A
,
1661 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1662 _mm_maskz_rsqrt14_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
1664 return (__m128d
) __builtin_ia32_rsqrt14sd_mask ( (__v2df
) __A
,
1666 (__v2df
) _mm_setzero_pd (),
1670 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1671 _mm512_rcp14_pd(__m512d __A
)
1673 return (__m512d
) __builtin_ia32_rcp14pd512_mask ((__v8df
) __A
,
1675 _mm512_setzero_pd (),
1679 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1680 _mm512_mask_rcp14_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
1682 return (__m512d
) __builtin_ia32_rcp14pd512_mask ((__v8df
) __A
,
1687 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1688 _mm512_maskz_rcp14_pd (__mmask8 __U
, __m512d __A
)
1690 return (__m512d
) __builtin_ia32_rcp14pd512_mask ((__v8df
) __A
,
1692 _mm512_setzero_pd (),
1696 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1697 _mm512_rcp14_ps(__m512 __A
)
1699 return (__m512
) __builtin_ia32_rcp14ps512_mask ((__v16sf
) __A
,
1701 _mm512_setzero_ps (),
1705 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1706 _mm512_mask_rcp14_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
1708 return (__m512
) __builtin_ia32_rcp14ps512_mask ((__v16sf
) __A
,
1713 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1714 _mm512_maskz_rcp14_ps (__mmask16 __U
, __m512 __A
)
1716 return (__m512
) __builtin_ia32_rcp14ps512_mask ((__v16sf
) __A
,
1718 _mm512_setzero_ps (),
1722 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1723 _mm_rcp14_ss(__m128 __A
, __m128 __B
)
1725 return (__m128
) __builtin_ia32_rcp14ss_mask ((__v4sf
) __A
,
1732 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1733 _mm_mask_rcp14_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
1735 return (__m128
) __builtin_ia32_rcp14ss_mask ((__v4sf
) __A
,
1741 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1742 _mm_maskz_rcp14_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
1744 return (__m128
) __builtin_ia32_rcp14ss_mask ((__v4sf
) __A
,
1746 (__v4sf
) _mm_setzero_ps (),
1750 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1751 _mm_rcp14_sd(__m128d __A
, __m128d __B
)
1753 return (__m128d
) __builtin_ia32_rcp14sd_mask ((__v2df
) __A
,
1760 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1761 _mm_mask_rcp14_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
1763 return (__m128d
) __builtin_ia32_rcp14sd_mask ( (__v2df
) __A
,
1769 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1770 _mm_maskz_rcp14_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
1772 return (__m128d
) __builtin_ia32_rcp14sd_mask ( (__v2df
) __A
,
1774 (__v2df
) _mm_setzero_pd (),
1778 static __inline __m512 __DEFAULT_FN_ATTRS512
1779 _mm512_floor_ps(__m512 __A
)
1781 return (__m512
) __builtin_ia32_rndscaleps_mask ((__v16sf
) __A
,
1783 (__v16sf
) __A
, (unsigned short)-1,
1784 _MM_FROUND_CUR_DIRECTION
);
1787 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1788 _mm512_mask_floor_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
1790 return (__m512
) __builtin_ia32_rndscaleps_mask ((__v16sf
) __A
,
1793 _MM_FROUND_CUR_DIRECTION
);
1796 static __inline __m512d __DEFAULT_FN_ATTRS512
1797 _mm512_floor_pd(__m512d __A
)
1799 return (__m512d
) __builtin_ia32_rndscalepd_mask ((__v8df
) __A
,
1801 (__v8df
) __A
, (unsigned char)-1,
1802 _MM_FROUND_CUR_DIRECTION
);
1805 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1806 _mm512_mask_floor_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
1808 return (__m512d
) __builtin_ia32_rndscalepd_mask ((__v8df
) __A
,
1811 _MM_FROUND_CUR_DIRECTION
);
1814 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1815 _mm512_mask_ceil_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
1817 return (__m512
) __builtin_ia32_rndscaleps_mask ((__v16sf
) __A
,
1820 _MM_FROUND_CUR_DIRECTION
);
1823 static __inline __m512 __DEFAULT_FN_ATTRS512
1824 _mm512_ceil_ps(__m512 __A
)
1826 return (__m512
) __builtin_ia32_rndscaleps_mask ((__v16sf
) __A
,
1828 (__v16sf
) __A
, (unsigned short)-1,
1829 _MM_FROUND_CUR_DIRECTION
);
1832 static __inline __m512d __DEFAULT_FN_ATTRS512
1833 _mm512_ceil_pd(__m512d __A
)
1835 return (__m512d
) __builtin_ia32_rndscalepd_mask ((__v8df
) __A
,
1837 (__v8df
) __A
, (unsigned char)-1,
1838 _MM_FROUND_CUR_DIRECTION
);
1841 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1842 _mm512_mask_ceil_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
1844 return (__m512d
) __builtin_ia32_rndscalepd_mask ((__v8df
) __A
,
1847 _MM_FROUND_CUR_DIRECTION
);
1850 static __inline __m512i __DEFAULT_FN_ATTRS512
1851 _mm512_abs_epi64(__m512i __A
)
1853 return (__m512i
)__builtin_elementwise_abs((__v8di
)__A
);
1856 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1857 _mm512_mask_abs_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
1859 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
1860 (__v8di
)_mm512_abs_epi64(__A
),
1864 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1865 _mm512_maskz_abs_epi64 (__mmask8 __U
, __m512i __A
)
1867 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
1868 (__v8di
)_mm512_abs_epi64(__A
),
1869 (__v8di
)_mm512_setzero_si512());
1872 static __inline __m512i __DEFAULT_FN_ATTRS512
1873 _mm512_abs_epi32(__m512i __A
)
1875 return (__m512i
)__builtin_elementwise_abs((__v16si
) __A
);
1878 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1879 _mm512_mask_abs_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
1881 return (__m512i
)__builtin_ia32_selectd_512(__U
,
1882 (__v16si
)_mm512_abs_epi32(__A
),
1886 static __inline__ __m512i __DEFAULT_FN_ATTRS512
1887 _mm512_maskz_abs_epi32 (__mmask16 __U
, __m512i __A
)
1889 return (__m512i
)__builtin_ia32_selectd_512(__U
,
1890 (__v16si
)_mm512_abs_epi32(__A
),
1891 (__v16si
)_mm512_setzero_si512());
1894 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1895 _mm_mask_add_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
1896 __A
= _mm_add_ss(__A
, __B
);
1897 return __builtin_ia32_selectss_128(__U
, __A
, __W
);
1900 static __inline__ __m128 __DEFAULT_FN_ATTRS128
1901 _mm_maskz_add_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
1902 __A
= _mm_add_ss(__A
, __B
);
1903 return __builtin_ia32_selectss_128(__U
, __A
, _mm_setzero_ps());
1906 #define _mm_add_round_ss(A, B, R) \
1907 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1908 (__v4sf)(__m128)(B), \
1909 (__v4sf)_mm_setzero_ps(), \
1910 (__mmask8)-1, (int)(R)))
1912 #define _mm_mask_add_round_ss(W, U, A, B, R) \
1913 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1914 (__v4sf)(__m128)(B), \
1915 (__v4sf)(__m128)(W), (__mmask8)(U), \
1918 #define _mm_maskz_add_round_ss(U, A, B, R) \
1919 ((__m128)__builtin_ia32_addss_round_mask((__v4sf)(__m128)(A), \
1920 (__v4sf)(__m128)(B), \
1921 (__v4sf)_mm_setzero_ps(), \
1922 (__mmask8)(U), (int)(R)))
1924 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1925 _mm_mask_add_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
1926 __A
= _mm_add_sd(__A
, __B
);
1927 return __builtin_ia32_selectsd_128(__U
, __A
, __W
);
1930 static __inline__ __m128d __DEFAULT_FN_ATTRS128
1931 _mm_maskz_add_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
1932 __A
= _mm_add_sd(__A
, __B
);
1933 return __builtin_ia32_selectsd_128(__U
, __A
, _mm_setzero_pd());
1935 #define _mm_add_round_sd(A, B, R) \
1936 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1937 (__v2df)(__m128d)(B), \
1938 (__v2df)_mm_setzero_pd(), \
1939 (__mmask8)-1, (int)(R)))
1941 #define _mm_mask_add_round_sd(W, U, A, B, R) \
1942 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1943 (__v2df)(__m128d)(B), \
1944 (__v2df)(__m128d)(W), \
1945 (__mmask8)(U), (int)(R)))
1947 #define _mm_maskz_add_round_sd(U, A, B, R) \
1948 ((__m128d)__builtin_ia32_addsd_round_mask((__v2df)(__m128d)(A), \
1949 (__v2df)(__m128d)(B), \
1950 (__v2df)_mm_setzero_pd(), \
1951 (__mmask8)(U), (int)(R)))
1953 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1954 _mm512_mask_add_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
) {
1955 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
1956 (__v8df
)_mm512_add_pd(__A
, __B
),
1960 static __inline__ __m512d __DEFAULT_FN_ATTRS512
1961 _mm512_maskz_add_pd(__mmask8 __U
, __m512d __A
, __m512d __B
) {
1962 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
1963 (__v8df
)_mm512_add_pd(__A
, __B
),
1964 (__v8df
)_mm512_setzero_pd());
1967 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1968 _mm512_mask_add_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
) {
1969 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
1970 (__v16sf
)_mm512_add_ps(__A
, __B
),
1974 static __inline__ __m512 __DEFAULT_FN_ATTRS512
1975 _mm512_maskz_add_ps(__mmask16 __U
, __m512 __A
, __m512 __B
) {
1976 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
1977 (__v16sf
)_mm512_add_ps(__A
, __B
),
1978 (__v16sf
)_mm512_setzero_ps());
1981 #define _mm512_add_round_pd(A, B, R) \
1982 ((__m512d)__builtin_ia32_addpd512((__v8df)(__m512d)(A), \
1983 (__v8df)(__m512d)(B), (int)(R)))
1985 #define _mm512_mask_add_round_pd(W, U, A, B, R) \
1986 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1987 (__v8df)_mm512_add_round_pd((A), (B), (R)), \
1988 (__v8df)(__m512d)(W)))
1990 #define _mm512_maskz_add_round_pd(U, A, B, R) \
1991 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
1992 (__v8df)_mm512_add_round_pd((A), (B), (R)), \
1993 (__v8df)_mm512_setzero_pd()))
1995 #define _mm512_add_round_ps(A, B, R) \
1996 ((__m512)__builtin_ia32_addps512((__v16sf)(__m512)(A), \
1997 (__v16sf)(__m512)(B), (int)(R)))
1999 #define _mm512_mask_add_round_ps(W, U, A, B, R) \
2000 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2001 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \
2002 (__v16sf)(__m512)(W)))
2004 #define _mm512_maskz_add_round_ps(U, A, B, R) \
2005 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2006 (__v16sf)_mm512_add_round_ps((A), (B), (R)), \
2007 (__v16sf)_mm512_setzero_ps()))
2009 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2010 _mm_mask_sub_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
2011 __A
= _mm_sub_ss(__A
, __B
);
2012 return __builtin_ia32_selectss_128(__U
, __A
, __W
);
2015 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2016 _mm_maskz_sub_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
2017 __A
= _mm_sub_ss(__A
, __B
);
2018 return __builtin_ia32_selectss_128(__U
, __A
, _mm_setzero_ps());
2020 #define _mm_sub_round_ss(A, B, R) \
2021 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2022 (__v4sf)(__m128)(B), \
2023 (__v4sf)_mm_setzero_ps(), \
2024 (__mmask8)-1, (int)(R)))
2026 #define _mm_mask_sub_round_ss(W, U, A, B, R) \
2027 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2028 (__v4sf)(__m128)(B), \
2029 (__v4sf)(__m128)(W), (__mmask8)(U), \
2032 #define _mm_maskz_sub_round_ss(U, A, B, R) \
2033 ((__m128)__builtin_ia32_subss_round_mask((__v4sf)(__m128)(A), \
2034 (__v4sf)(__m128)(B), \
2035 (__v4sf)_mm_setzero_ps(), \
2036 (__mmask8)(U), (int)(R)))
2038 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2039 _mm_mask_sub_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
2040 __A
= _mm_sub_sd(__A
, __B
);
2041 return __builtin_ia32_selectsd_128(__U
, __A
, __W
);
2044 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2045 _mm_maskz_sub_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
2046 __A
= _mm_sub_sd(__A
, __B
);
2047 return __builtin_ia32_selectsd_128(__U
, __A
, _mm_setzero_pd());
2050 #define _mm_sub_round_sd(A, B, R) \
2051 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2052 (__v2df)(__m128d)(B), \
2053 (__v2df)_mm_setzero_pd(), \
2054 (__mmask8)-1, (int)(R)))
2056 #define _mm_mask_sub_round_sd(W, U, A, B, R) \
2057 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2058 (__v2df)(__m128d)(B), \
2059 (__v2df)(__m128d)(W), \
2060 (__mmask8)(U), (int)(R)))
2062 #define _mm_maskz_sub_round_sd(U, A, B, R) \
2063 ((__m128d)__builtin_ia32_subsd_round_mask((__v2df)(__m128d)(A), \
2064 (__v2df)(__m128d)(B), \
2065 (__v2df)_mm_setzero_pd(), \
2066 (__mmask8)(U), (int)(R)))
2068 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2069 _mm512_mask_sub_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
) {
2070 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2071 (__v8df
)_mm512_sub_pd(__A
, __B
),
2075 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2076 _mm512_maskz_sub_pd(__mmask8 __U
, __m512d __A
, __m512d __B
) {
2077 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2078 (__v8df
)_mm512_sub_pd(__A
, __B
),
2079 (__v8df
)_mm512_setzero_pd());
2082 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2083 _mm512_mask_sub_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
) {
2084 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2085 (__v16sf
)_mm512_sub_ps(__A
, __B
),
2089 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2090 _mm512_maskz_sub_ps(__mmask16 __U
, __m512 __A
, __m512 __B
) {
2091 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2092 (__v16sf
)_mm512_sub_ps(__A
, __B
),
2093 (__v16sf
)_mm512_setzero_ps());
2096 #define _mm512_sub_round_pd(A, B, R) \
2097 ((__m512d)__builtin_ia32_subpd512((__v8df)(__m512d)(A), \
2098 (__v8df)(__m512d)(B), (int)(R)))
2100 #define _mm512_mask_sub_round_pd(W, U, A, B, R) \
2101 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2102 (__v8df)_mm512_sub_round_pd((A), (B), (R)), \
2103 (__v8df)(__m512d)(W)))
2105 #define _mm512_maskz_sub_round_pd(U, A, B, R) \
2106 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2107 (__v8df)_mm512_sub_round_pd((A), (B), (R)), \
2108 (__v8df)_mm512_setzero_pd()))
2110 #define _mm512_sub_round_ps(A, B, R) \
2111 ((__m512)__builtin_ia32_subps512((__v16sf)(__m512)(A), \
2112 (__v16sf)(__m512)(B), (int)(R)))
2114 #define _mm512_mask_sub_round_ps(W, U, A, B, R) \
2115 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2116 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \
2117 (__v16sf)(__m512)(W)))
2119 #define _mm512_maskz_sub_round_ps(U, A, B, R) \
2120 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2121 (__v16sf)_mm512_sub_round_ps((A), (B), (R)), \
2122 (__v16sf)_mm512_setzero_ps()))
2124 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2125 _mm_mask_mul_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
2126 __A
= _mm_mul_ss(__A
, __B
);
2127 return __builtin_ia32_selectss_128(__U
, __A
, __W
);
2130 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2131 _mm_maskz_mul_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
2132 __A
= _mm_mul_ss(__A
, __B
);
2133 return __builtin_ia32_selectss_128(__U
, __A
, _mm_setzero_ps());
2135 #define _mm_mul_round_ss(A, B, R) \
2136 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2137 (__v4sf)(__m128)(B), \
2138 (__v4sf)_mm_setzero_ps(), \
2139 (__mmask8)-1, (int)(R)))
2141 #define _mm_mask_mul_round_ss(W, U, A, B, R) \
2142 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2143 (__v4sf)(__m128)(B), \
2144 (__v4sf)(__m128)(W), (__mmask8)(U), \
2147 #define _mm_maskz_mul_round_ss(U, A, B, R) \
2148 ((__m128)__builtin_ia32_mulss_round_mask((__v4sf)(__m128)(A), \
2149 (__v4sf)(__m128)(B), \
2150 (__v4sf)_mm_setzero_ps(), \
2151 (__mmask8)(U), (int)(R)))
2153 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2154 _mm_mask_mul_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
2155 __A
= _mm_mul_sd(__A
, __B
);
2156 return __builtin_ia32_selectsd_128(__U
, __A
, __W
);
2159 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2160 _mm_maskz_mul_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
2161 __A
= _mm_mul_sd(__A
, __B
);
2162 return __builtin_ia32_selectsd_128(__U
, __A
, _mm_setzero_pd());
2165 #define _mm_mul_round_sd(A, B, R) \
2166 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2167 (__v2df)(__m128d)(B), \
2168 (__v2df)_mm_setzero_pd(), \
2169 (__mmask8)-1, (int)(R)))
2171 #define _mm_mask_mul_round_sd(W, U, A, B, R) \
2172 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2173 (__v2df)(__m128d)(B), \
2174 (__v2df)(__m128d)(W), \
2175 (__mmask8)(U), (int)(R)))
2177 #define _mm_maskz_mul_round_sd(U, A, B, R) \
2178 ((__m128d)__builtin_ia32_mulsd_round_mask((__v2df)(__m128d)(A), \
2179 (__v2df)(__m128d)(B), \
2180 (__v2df)_mm_setzero_pd(), \
2181 (__mmask8)(U), (int)(R)))
2183 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2184 _mm512_mask_mul_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
) {
2185 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2186 (__v8df
)_mm512_mul_pd(__A
, __B
),
2190 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2191 _mm512_maskz_mul_pd(__mmask8 __U
, __m512d __A
, __m512d __B
) {
2192 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2193 (__v8df
)_mm512_mul_pd(__A
, __B
),
2194 (__v8df
)_mm512_setzero_pd());
2197 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2198 _mm512_mask_mul_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
) {
2199 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2200 (__v16sf
)_mm512_mul_ps(__A
, __B
),
2204 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2205 _mm512_maskz_mul_ps(__mmask16 __U
, __m512 __A
, __m512 __B
) {
2206 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2207 (__v16sf
)_mm512_mul_ps(__A
, __B
),
2208 (__v16sf
)_mm512_setzero_ps());
2211 #define _mm512_mul_round_pd(A, B, R) \
2212 ((__m512d)__builtin_ia32_mulpd512((__v8df)(__m512d)(A), \
2213 (__v8df)(__m512d)(B), (int)(R)))
2215 #define _mm512_mask_mul_round_pd(W, U, A, B, R) \
2216 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2217 (__v8df)_mm512_mul_round_pd((A), (B), (R)), \
2218 (__v8df)(__m512d)(W)))
2220 #define _mm512_maskz_mul_round_pd(U, A, B, R) \
2221 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2222 (__v8df)_mm512_mul_round_pd((A), (B), (R)), \
2223 (__v8df)_mm512_setzero_pd()))
2225 #define _mm512_mul_round_ps(A, B, R) \
2226 ((__m512)__builtin_ia32_mulps512((__v16sf)(__m512)(A), \
2227 (__v16sf)(__m512)(B), (int)(R)))
2229 #define _mm512_mask_mul_round_ps(W, U, A, B, R) \
2230 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2231 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \
2232 (__v16sf)(__m512)(W)))
2234 #define _mm512_maskz_mul_round_ps(U, A, B, R) \
2235 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2236 (__v16sf)_mm512_mul_round_ps((A), (B), (R)), \
2237 (__v16sf)_mm512_setzero_ps()))
2239 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2240 _mm_mask_div_ss(__m128 __W
, __mmask8 __U
,__m128 __A
, __m128 __B
) {
2241 __A
= _mm_div_ss(__A
, __B
);
2242 return __builtin_ia32_selectss_128(__U
, __A
, __W
);
2245 static __inline__ __m128 __DEFAULT_FN_ATTRS128
2246 _mm_maskz_div_ss(__mmask8 __U
,__m128 __A
, __m128 __B
) {
2247 __A
= _mm_div_ss(__A
, __B
);
2248 return __builtin_ia32_selectss_128(__U
, __A
, _mm_setzero_ps());
2251 #define _mm_div_round_ss(A, B, R) \
2252 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2253 (__v4sf)(__m128)(B), \
2254 (__v4sf)_mm_setzero_ps(), \
2255 (__mmask8)-1, (int)(R)))
2257 #define _mm_mask_div_round_ss(W, U, A, B, R) \
2258 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2259 (__v4sf)(__m128)(B), \
2260 (__v4sf)(__m128)(W), (__mmask8)(U), \
2263 #define _mm_maskz_div_round_ss(U, A, B, R) \
2264 ((__m128)__builtin_ia32_divss_round_mask((__v4sf)(__m128)(A), \
2265 (__v4sf)(__m128)(B), \
2266 (__v4sf)_mm_setzero_ps(), \
2267 (__mmask8)(U), (int)(R)))
2269 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2270 _mm_mask_div_sd(__m128d __W
, __mmask8 __U
,__m128d __A
, __m128d __B
) {
2271 __A
= _mm_div_sd(__A
, __B
);
2272 return __builtin_ia32_selectsd_128(__U
, __A
, __W
);
2275 static __inline__ __m128d __DEFAULT_FN_ATTRS128
2276 _mm_maskz_div_sd(__mmask8 __U
,__m128d __A
, __m128d __B
) {
2277 __A
= _mm_div_sd(__A
, __B
);
2278 return __builtin_ia32_selectsd_128(__U
, __A
, _mm_setzero_pd());
2281 #define _mm_div_round_sd(A, B, R) \
2282 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2283 (__v2df)(__m128d)(B), \
2284 (__v2df)_mm_setzero_pd(), \
2285 (__mmask8)-1, (int)(R)))
2287 #define _mm_mask_div_round_sd(W, U, A, B, R) \
2288 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2289 (__v2df)(__m128d)(B), \
2290 (__v2df)(__m128d)(W), \
2291 (__mmask8)(U), (int)(R)))
2293 #define _mm_maskz_div_round_sd(U, A, B, R) \
2294 ((__m128d)__builtin_ia32_divsd_round_mask((__v2df)(__m128d)(A), \
2295 (__v2df)(__m128d)(B), \
2296 (__v2df)_mm_setzero_pd(), \
2297 (__mmask8)(U), (int)(R)))
2299 static __inline __m512d __DEFAULT_FN_ATTRS512
2300 _mm512_div_pd(__m512d __a
, __m512d __b
)
2302 return (__m512d
)((__v8df
)__a
/(__v8df
)__b
);
2305 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2306 _mm512_mask_div_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
) {
2307 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2308 (__v8df
)_mm512_div_pd(__A
, __B
),
2312 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2313 _mm512_maskz_div_pd(__mmask8 __U
, __m512d __A
, __m512d __B
) {
2314 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
2315 (__v8df
)_mm512_div_pd(__A
, __B
),
2316 (__v8df
)_mm512_setzero_pd());
2319 static __inline __m512 __DEFAULT_FN_ATTRS512
2320 _mm512_div_ps(__m512 __a
, __m512 __b
)
2322 return (__m512
)((__v16sf
)__a
/(__v16sf
)__b
);
2325 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2326 _mm512_mask_div_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
) {
2327 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2328 (__v16sf
)_mm512_div_ps(__A
, __B
),
2332 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2333 _mm512_maskz_div_ps(__mmask16 __U
, __m512 __A
, __m512 __B
) {
2334 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
2335 (__v16sf
)_mm512_div_ps(__A
, __B
),
2336 (__v16sf
)_mm512_setzero_ps());
2339 #define _mm512_div_round_pd(A, B, R) \
2340 ((__m512d)__builtin_ia32_divpd512((__v8df)(__m512d)(A), \
2341 (__v8df)(__m512d)(B), (int)(R)))
2343 #define _mm512_mask_div_round_pd(W, U, A, B, R) \
2344 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2345 (__v8df)_mm512_div_round_pd((A), (B), (R)), \
2346 (__v8df)(__m512d)(W)))
2348 #define _mm512_maskz_div_round_pd(U, A, B, R) \
2349 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
2350 (__v8df)_mm512_div_round_pd((A), (B), (R)), \
2351 (__v8df)_mm512_setzero_pd()))
2353 #define _mm512_div_round_ps(A, B, R) \
2354 ((__m512)__builtin_ia32_divps512((__v16sf)(__m512)(A), \
2355 (__v16sf)(__m512)(B), (int)(R)))
2357 #define _mm512_mask_div_round_ps(W, U, A, B, R) \
2358 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2359 (__v16sf)_mm512_div_round_ps((A), (B), (R)), \
2360 (__v16sf)(__m512)(W)))
2362 #define _mm512_maskz_div_round_ps(U, A, B, R) \
2363 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
2364 (__v16sf)_mm512_div_round_ps((A), (B), (R)), \
2365 (__v16sf)_mm512_setzero_ps()))
2367 #define _mm512_roundscale_ps(A, B) \
2368 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(B), \
2369 (__v16sf)_mm512_undefined_ps(), \
2371 _MM_FROUND_CUR_DIRECTION))
2373 #define _mm512_mask_roundscale_ps(A, B, C, imm) \
2374 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \
2375 (__v16sf)(__m512)(A), (__mmask16)(B), \
2376 _MM_FROUND_CUR_DIRECTION))
2378 #define _mm512_maskz_roundscale_ps(A, B, imm) \
2379 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \
2380 (__v16sf)_mm512_setzero_ps(), \
2382 _MM_FROUND_CUR_DIRECTION))
2384 #define _mm512_mask_roundscale_round_ps(A, B, C, imm, R) \
2385 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(C), (int)(imm), \
2386 (__v16sf)(__m512)(A), (__mmask16)(B), \
2389 #define _mm512_maskz_roundscale_round_ps(A, B, imm, R) \
2390 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(B), (int)(imm), \
2391 (__v16sf)_mm512_setzero_ps(), \
2392 (__mmask16)(A), (int)(R)))
2394 #define _mm512_roundscale_round_ps(A, imm, R) \
2395 ((__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(__m512)(A), (int)(imm), \
2396 (__v16sf)_mm512_undefined_ps(), \
2397 (__mmask16)-1, (int)(R)))
2399 #define _mm512_roundscale_pd(A, B) \
2400 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(B), \
2401 (__v8df)_mm512_undefined_pd(), \
2403 _MM_FROUND_CUR_DIRECTION))
2405 #define _mm512_mask_roundscale_pd(A, B, C, imm) \
2406 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \
2407 (__v8df)(__m512d)(A), (__mmask8)(B), \
2408 _MM_FROUND_CUR_DIRECTION))
2410 #define _mm512_maskz_roundscale_pd(A, B, imm) \
2411 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \
2412 (__v8df)_mm512_setzero_pd(), \
2414 _MM_FROUND_CUR_DIRECTION))
2416 #define _mm512_mask_roundscale_round_pd(A, B, C, imm, R) \
2417 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(C), (int)(imm), \
2418 (__v8df)(__m512d)(A), (__mmask8)(B), \
2421 #define _mm512_maskz_roundscale_round_pd(A, B, imm, R) \
2422 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(B), (int)(imm), \
2423 (__v8df)_mm512_setzero_pd(), \
2424 (__mmask8)(A), (int)(R)))
2426 #define _mm512_roundscale_round_pd(A, imm, R) \
2427 ((__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(imm), \
2428 (__v8df)_mm512_undefined_pd(), \
2429 (__mmask8)-1, (int)(R)))
2431 #define _mm512_fmadd_round_pd(A, B, C, R) \
2432 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2433 (__v8df)(__m512d)(B), \
2434 (__v8df)(__m512d)(C), \
2435 (__mmask8)-1, (int)(R)))
2438 #define _mm512_mask_fmadd_round_pd(A, U, B, C, R) \
2439 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2440 (__v8df)(__m512d)(B), \
2441 (__v8df)(__m512d)(C), \
2442 (__mmask8)(U), (int)(R)))
2445 #define _mm512_mask3_fmadd_round_pd(A, B, C, U, R) \
2446 ((__m512d)__builtin_ia32_vfmaddpd512_mask3((__v8df)(__m512d)(A), \
2447 (__v8df)(__m512d)(B), \
2448 (__v8df)(__m512d)(C), \
2449 (__mmask8)(U), (int)(R)))
2452 #define _mm512_maskz_fmadd_round_pd(U, A, B, C, R) \
2453 ((__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \
2454 (__v8df)(__m512d)(B), \
2455 (__v8df)(__m512d)(C), \
2456 (__mmask8)(U), (int)(R)))
2459 #define _mm512_fmsub_round_pd(A, B, C, R) \
2460 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2461 (__v8df)(__m512d)(B), \
2462 -(__v8df)(__m512d)(C), \
2463 (__mmask8)-1, (int)(R)))
2466 #define _mm512_mask_fmsub_round_pd(A, U, B, C, R) \
2467 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
2468 (__v8df)(__m512d)(B), \
2469 -(__v8df)(__m512d)(C), \
2470 (__mmask8)(U), (int)(R)))
2473 #define _mm512_maskz_fmsub_round_pd(U, A, B, C, R) \
2474 ((__m512d)__builtin_ia32_vfmaddpd512_maskz((__v8df)(__m512d)(A), \
2475 (__v8df)(__m512d)(B), \
2476 -(__v8df)(__m512d)(C), \
2477 (__mmask8)(U), (int)(R)))
2480 #define _mm512_fnmadd_round_pd(A, B, C, R) \
2481 ((__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \
2482 (__v8df)(__m512d)(B), \
2483 (__v8df)(__m512d)(C), \
2484 (__mmask8)-1, (int)(R)))
2487 #define _mm512_mask3_fnmadd_round_pd(A, B, C, U, R) \
2488 ((__m512d)__builtin_ia32_vfmaddpd512_mask3(-(__v8df)(__m512d)(A), \
2489 (__v8df)(__m512d)(B), \
2490 (__v8df)(__m512d)(C), \
2491 (__mmask8)(U), (int)(R)))
2494 #define _mm512_maskz_fnmadd_round_pd(U, A, B, C, R) \
2495 ((__m512d)__builtin_ia32_vfmaddpd512_maskz(-(__v8df)(__m512d)(A), \
2496 (__v8df)(__m512d)(B), \
2497 (__v8df)(__m512d)(C), \
2498 (__mmask8)(U), (int)(R)))
2501 #define _mm512_fnmsub_round_pd(A, B, C, R) \
2502 ((__m512d)__builtin_ia32_vfmaddpd512_mask(-(__v8df)(__m512d)(A), \
2503 (__v8df)(__m512d)(B), \
2504 -(__v8df)(__m512d)(C), \
2505 (__mmask8)-1, (int)(R)))
2508 #define _mm512_maskz_fnmsub_round_pd(U, A, B, C, R) \
2509 ((__m512d)__builtin_ia32_vfmaddpd512_maskz(-(__v8df)(__m512d)(A), \
2510 (__v8df)(__m512d)(B), \
2511 -(__v8df)(__m512d)(C), \
2512 (__mmask8)(U), (int)(R)))
2515 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2516 _mm512_fmadd_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2518 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2522 _MM_FROUND_CUR_DIRECTION
);
2525 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2526 _mm512_mask_fmadd_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
2528 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2532 _MM_FROUND_CUR_DIRECTION
);
2535 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2536 _mm512_mask3_fmadd_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
2538 return (__m512d
) __builtin_ia32_vfmaddpd512_mask3 ((__v8df
) __A
,
2542 _MM_FROUND_CUR_DIRECTION
);
2545 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2546 _mm512_maskz_fmadd_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2548 return (__m512d
) __builtin_ia32_vfmaddpd512_maskz ((__v8df
) __A
,
2552 _MM_FROUND_CUR_DIRECTION
);
2555 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2556 _mm512_fmsub_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2558 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2562 _MM_FROUND_CUR_DIRECTION
);
2565 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2566 _mm512_mask_fmsub_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
2568 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2572 _MM_FROUND_CUR_DIRECTION
);
2575 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2576 _mm512_maskz_fmsub_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2578 return (__m512d
) __builtin_ia32_vfmaddpd512_maskz ((__v8df
) __A
,
2582 _MM_FROUND_CUR_DIRECTION
);
2585 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2586 _mm512_fnmadd_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2588 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2592 _MM_FROUND_CUR_DIRECTION
);
2595 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2596 _mm512_mask3_fnmadd_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
2598 return (__m512d
) __builtin_ia32_vfmaddpd512_mask3 (-(__v8df
) __A
,
2602 _MM_FROUND_CUR_DIRECTION
);
2605 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2606 _mm512_maskz_fnmadd_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2608 return (__m512d
) __builtin_ia32_vfmaddpd512_maskz (-(__v8df
) __A
,
2612 _MM_FROUND_CUR_DIRECTION
);
2615 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2616 _mm512_fnmsub_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2618 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
2622 _MM_FROUND_CUR_DIRECTION
);
2625 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2626 _mm512_maskz_fnmsub_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2628 return (__m512d
) __builtin_ia32_vfmaddpd512_maskz (-(__v8df
) __A
,
2632 _MM_FROUND_CUR_DIRECTION
);
2635 #define _mm512_fmadd_round_ps(A, B, C, R) \
2636 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2637 (__v16sf)(__m512)(B), \
2638 (__v16sf)(__m512)(C), \
2639 (__mmask16)-1, (int)(R)))
2642 #define _mm512_mask_fmadd_round_ps(A, U, B, C, R) \
2643 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2644 (__v16sf)(__m512)(B), \
2645 (__v16sf)(__m512)(C), \
2646 (__mmask16)(U), (int)(R)))
2649 #define _mm512_mask3_fmadd_round_ps(A, B, C, U, R) \
2650 ((__m512)__builtin_ia32_vfmaddps512_mask3((__v16sf)(__m512)(A), \
2651 (__v16sf)(__m512)(B), \
2652 (__v16sf)(__m512)(C), \
2653 (__mmask16)(U), (int)(R)))
2656 #define _mm512_maskz_fmadd_round_ps(U, A, B, C, R) \
2657 ((__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \
2658 (__v16sf)(__m512)(B), \
2659 (__v16sf)(__m512)(C), \
2660 (__mmask16)(U), (int)(R)))
2663 #define _mm512_fmsub_round_ps(A, B, C, R) \
2664 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2665 (__v16sf)(__m512)(B), \
2666 -(__v16sf)(__m512)(C), \
2667 (__mmask16)-1, (int)(R)))
2670 #define _mm512_mask_fmsub_round_ps(A, U, B, C, R) \
2671 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2672 (__v16sf)(__m512)(B), \
2673 -(__v16sf)(__m512)(C), \
2674 (__mmask16)(U), (int)(R)))
2677 #define _mm512_maskz_fmsub_round_ps(U, A, B, C, R) \
2678 ((__m512)__builtin_ia32_vfmaddps512_maskz((__v16sf)(__m512)(A), \
2679 (__v16sf)(__m512)(B), \
2680 -(__v16sf)(__m512)(C), \
2681 (__mmask16)(U), (int)(R)))
2684 #define _mm512_fnmadd_round_ps(A, B, C, R) \
2685 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2686 -(__v16sf)(__m512)(B), \
2687 (__v16sf)(__m512)(C), \
2688 (__mmask16)-1, (int)(R)))
2691 #define _mm512_mask3_fnmadd_round_ps(A, B, C, U, R) \
2692 ((__m512)__builtin_ia32_vfmaddps512_mask3(-(__v16sf)(__m512)(A), \
2693 (__v16sf)(__m512)(B), \
2694 (__v16sf)(__m512)(C), \
2695 (__mmask16)(U), (int)(R)))
2698 #define _mm512_maskz_fnmadd_round_ps(U, A, B, C, R) \
2699 ((__m512)__builtin_ia32_vfmaddps512_maskz(-(__v16sf)(__m512)(A), \
2700 (__v16sf)(__m512)(B), \
2701 (__v16sf)(__m512)(C), \
2702 (__mmask16)(U), (int)(R)))
2705 #define _mm512_fnmsub_round_ps(A, B, C, R) \
2706 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
2707 -(__v16sf)(__m512)(B), \
2708 -(__v16sf)(__m512)(C), \
2709 (__mmask16)-1, (int)(R)))
2712 #define _mm512_maskz_fnmsub_round_ps(U, A, B, C, R) \
2713 ((__m512)__builtin_ia32_vfmaddps512_maskz(-(__v16sf)(__m512)(A), \
2714 (__v16sf)(__m512)(B), \
2715 -(__v16sf)(__m512)(C), \
2716 (__mmask16)(U), (int)(R)))
2719 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2720 _mm512_fmadd_ps(__m512 __A
, __m512 __B
, __m512 __C
)
2722 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2726 _MM_FROUND_CUR_DIRECTION
);
2729 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2730 _mm512_mask_fmadd_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
2732 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2736 _MM_FROUND_CUR_DIRECTION
);
2739 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2740 _mm512_mask3_fmadd_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
2742 return (__m512
) __builtin_ia32_vfmaddps512_mask3 ((__v16sf
) __A
,
2746 _MM_FROUND_CUR_DIRECTION
);
2749 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2750 _mm512_maskz_fmadd_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
2752 return (__m512
) __builtin_ia32_vfmaddps512_maskz ((__v16sf
) __A
,
2756 _MM_FROUND_CUR_DIRECTION
);
2759 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2760 _mm512_fmsub_ps(__m512 __A
, __m512 __B
, __m512 __C
)
2762 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2766 _MM_FROUND_CUR_DIRECTION
);
2769 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2770 _mm512_mask_fmsub_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
2772 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2776 _MM_FROUND_CUR_DIRECTION
);
2779 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2780 _mm512_maskz_fmsub_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
2782 return (__m512
) __builtin_ia32_vfmaddps512_maskz ((__v16sf
) __A
,
2786 _MM_FROUND_CUR_DIRECTION
);
2789 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2790 _mm512_fnmadd_ps(__m512 __A
, __m512 __B
, __m512 __C
)
2792 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2796 _MM_FROUND_CUR_DIRECTION
);
2799 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2800 _mm512_mask3_fnmadd_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
2802 return (__m512
) __builtin_ia32_vfmaddps512_mask3 (-(__v16sf
) __A
,
2806 _MM_FROUND_CUR_DIRECTION
);
2809 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2810 _mm512_maskz_fnmadd_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
2812 return (__m512
) __builtin_ia32_vfmaddps512_maskz (-(__v16sf
) __A
,
2816 _MM_FROUND_CUR_DIRECTION
);
2819 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2820 _mm512_fnmsub_ps(__m512 __A
, __m512 __B
, __m512 __C
)
2822 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
2826 _MM_FROUND_CUR_DIRECTION
);
2829 static __inline__ __m512 __DEFAULT_FN_ATTRS512
2830 _mm512_maskz_fnmsub_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
2832 return (__m512
) __builtin_ia32_vfmaddps512_maskz (-(__v16sf
) __A
,
2836 _MM_FROUND_CUR_DIRECTION
);
2839 #define _mm512_fmaddsub_round_pd(A, B, C, R) \
2840 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2841 (__v8df)(__m512d)(B), \
2842 (__v8df)(__m512d)(C), \
2843 (__mmask8)-1, (int)(R)))
2846 #define _mm512_mask_fmaddsub_round_pd(A, U, B, C, R) \
2847 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2848 (__v8df)(__m512d)(B), \
2849 (__v8df)(__m512d)(C), \
2850 (__mmask8)(U), (int)(R)))
2853 #define _mm512_mask3_fmaddsub_round_pd(A, B, C, U, R) \
2854 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask3((__v8df)(__m512d)(A), \
2855 (__v8df)(__m512d)(B), \
2856 (__v8df)(__m512d)(C), \
2857 (__mmask8)(U), (int)(R)))
2860 #define _mm512_maskz_fmaddsub_round_pd(U, A, B, C, R) \
2861 ((__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \
2862 (__v8df)(__m512d)(B), \
2863 (__v8df)(__m512d)(C), \
2864 (__mmask8)(U), (int)(R)))
2867 #define _mm512_fmsubadd_round_pd(A, B, C, R) \
2868 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2869 (__v8df)(__m512d)(B), \
2870 -(__v8df)(__m512d)(C), \
2871 (__mmask8)-1, (int)(R)))
2874 #define _mm512_mask_fmsubadd_round_pd(A, U, B, C, R) \
2875 ((__m512d)__builtin_ia32_vfmaddsubpd512_mask((__v8df)(__m512d)(A), \
2876 (__v8df)(__m512d)(B), \
2877 -(__v8df)(__m512d)(C), \
2878 (__mmask8)(U), (int)(R)))
2881 #define _mm512_maskz_fmsubadd_round_pd(U, A, B, C, R) \
2882 ((__m512d)__builtin_ia32_vfmaddsubpd512_maskz((__v8df)(__m512d)(A), \
2883 (__v8df)(__m512d)(B), \
2884 -(__v8df)(__m512d)(C), \
2885 (__mmask8)(U), (int)(R)))
2888 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2889 _mm512_fmaddsub_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2891 return (__m512d
) __builtin_ia32_vfmaddsubpd512_mask ((__v8df
) __A
,
2895 _MM_FROUND_CUR_DIRECTION
);
2898 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2899 _mm512_mask_fmaddsub_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
2901 return (__m512d
) __builtin_ia32_vfmaddsubpd512_mask ((__v8df
) __A
,
2905 _MM_FROUND_CUR_DIRECTION
);
2908 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2909 _mm512_mask3_fmaddsub_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
2911 return (__m512d
) __builtin_ia32_vfmaddsubpd512_mask3 ((__v8df
) __A
,
2915 _MM_FROUND_CUR_DIRECTION
);
2918 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2919 _mm512_maskz_fmaddsub_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2921 return (__m512d
) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df
) __A
,
2925 _MM_FROUND_CUR_DIRECTION
);
2928 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2929 _mm512_fmsubadd_pd(__m512d __A
, __m512d __B
, __m512d __C
)
2931 return (__m512d
) __builtin_ia32_vfmaddsubpd512_mask ((__v8df
) __A
,
2935 _MM_FROUND_CUR_DIRECTION
);
2938 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2939 _mm512_mask_fmsubadd_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
2941 return (__m512d
) __builtin_ia32_vfmaddsubpd512_mask ((__v8df
) __A
,
2945 _MM_FROUND_CUR_DIRECTION
);
2948 static __inline__ __m512d __DEFAULT_FN_ATTRS512
2949 _mm512_maskz_fmsubadd_pd(__mmask8 __U
, __m512d __A
, __m512d __B
, __m512d __C
)
2951 return (__m512d
) __builtin_ia32_vfmaddsubpd512_maskz ((__v8df
) __A
,
2955 _MM_FROUND_CUR_DIRECTION
);
2958 #define _mm512_fmaddsub_round_ps(A, B, C, R) \
2959 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2960 (__v16sf)(__m512)(B), \
2961 (__v16sf)(__m512)(C), \
2962 (__mmask16)-1, (int)(R)))
2965 #define _mm512_mask_fmaddsub_round_ps(A, U, B, C, R) \
2966 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2967 (__v16sf)(__m512)(B), \
2968 (__v16sf)(__m512)(C), \
2969 (__mmask16)(U), (int)(R)))
2972 #define _mm512_mask3_fmaddsub_round_ps(A, B, C, U, R) \
2973 ((__m512)__builtin_ia32_vfmaddsubps512_mask3((__v16sf)(__m512)(A), \
2974 (__v16sf)(__m512)(B), \
2975 (__v16sf)(__m512)(C), \
2976 (__mmask16)(U), (int)(R)))
2979 #define _mm512_maskz_fmaddsub_round_ps(U, A, B, C, R) \
2980 ((__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \
2981 (__v16sf)(__m512)(B), \
2982 (__v16sf)(__m512)(C), \
2983 (__mmask16)(U), (int)(R)))
2986 #define _mm512_fmsubadd_round_ps(A, B, C, R) \
2987 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2988 (__v16sf)(__m512)(B), \
2989 -(__v16sf)(__m512)(C), \
2990 (__mmask16)-1, (int)(R)))
2993 #define _mm512_mask_fmsubadd_round_ps(A, U, B, C, R) \
2994 ((__m512)__builtin_ia32_vfmaddsubps512_mask((__v16sf)(__m512)(A), \
2995 (__v16sf)(__m512)(B), \
2996 -(__v16sf)(__m512)(C), \
2997 (__mmask16)(U), (int)(R)))
3000 #define _mm512_maskz_fmsubadd_round_ps(U, A, B, C, R) \
3001 ((__m512)__builtin_ia32_vfmaddsubps512_maskz((__v16sf)(__m512)(A), \
3002 (__v16sf)(__m512)(B), \
3003 -(__v16sf)(__m512)(C), \
3004 (__mmask16)(U), (int)(R)))
3007 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3008 _mm512_fmaddsub_ps(__m512 __A
, __m512 __B
, __m512 __C
)
3010 return (__m512
) __builtin_ia32_vfmaddsubps512_mask ((__v16sf
) __A
,
3014 _MM_FROUND_CUR_DIRECTION
);
3017 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3018 _mm512_mask_fmaddsub_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
3020 return (__m512
) __builtin_ia32_vfmaddsubps512_mask ((__v16sf
) __A
,
3024 _MM_FROUND_CUR_DIRECTION
);
3027 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3028 _mm512_mask3_fmaddsub_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
3030 return (__m512
) __builtin_ia32_vfmaddsubps512_mask3 ((__v16sf
) __A
,
3034 _MM_FROUND_CUR_DIRECTION
);
3037 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3038 _mm512_maskz_fmaddsub_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
3040 return (__m512
) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf
) __A
,
3044 _MM_FROUND_CUR_DIRECTION
);
3047 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3048 _mm512_fmsubadd_ps(__m512 __A
, __m512 __B
, __m512 __C
)
3050 return (__m512
) __builtin_ia32_vfmaddsubps512_mask ((__v16sf
) __A
,
3054 _MM_FROUND_CUR_DIRECTION
);
3057 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3058 _mm512_mask_fmsubadd_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
3060 return (__m512
) __builtin_ia32_vfmaddsubps512_mask ((__v16sf
) __A
,
3064 _MM_FROUND_CUR_DIRECTION
);
3067 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3068 _mm512_maskz_fmsubadd_ps(__mmask16 __U
, __m512 __A
, __m512 __B
, __m512 __C
)
3070 return (__m512
) __builtin_ia32_vfmaddsubps512_maskz ((__v16sf
) __A
,
3074 _MM_FROUND_CUR_DIRECTION
);
3077 #define _mm512_mask3_fmsub_round_pd(A, B, C, U, R) \
3078 ((__m512d)__builtin_ia32_vfmsubpd512_mask3((__v8df)(__m512d)(A), \
3079 (__v8df)(__m512d)(B), \
3080 (__v8df)(__m512d)(C), \
3081 (__mmask8)(U), (int)(R)))
3084 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3085 _mm512_mask3_fmsub_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
3087 return (__m512d
)__builtin_ia32_vfmsubpd512_mask3 ((__v8df
) __A
,
3091 _MM_FROUND_CUR_DIRECTION
);
3094 #define _mm512_mask3_fmsub_round_ps(A, B, C, U, R) \
3095 ((__m512)__builtin_ia32_vfmsubps512_mask3((__v16sf)(__m512)(A), \
3096 (__v16sf)(__m512)(B), \
3097 (__v16sf)(__m512)(C), \
3098 (__mmask16)(U), (int)(R)))
3100 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3101 _mm512_mask3_fmsub_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
3103 return (__m512
)__builtin_ia32_vfmsubps512_mask3 ((__v16sf
) __A
,
3107 _MM_FROUND_CUR_DIRECTION
);
3110 #define _mm512_mask3_fmsubadd_round_pd(A, B, C, U, R) \
3111 ((__m512d)__builtin_ia32_vfmsubaddpd512_mask3((__v8df)(__m512d)(A), \
3112 (__v8df)(__m512d)(B), \
3113 (__v8df)(__m512d)(C), \
3114 (__mmask8)(U), (int)(R)))
3117 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3118 _mm512_mask3_fmsubadd_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
3120 return (__m512d
)__builtin_ia32_vfmsubaddpd512_mask3 ((__v8df
) __A
,
3124 _MM_FROUND_CUR_DIRECTION
);
3127 #define _mm512_mask3_fmsubadd_round_ps(A, B, C, U, R) \
3128 ((__m512)__builtin_ia32_vfmsubaddps512_mask3((__v16sf)(__m512)(A), \
3129 (__v16sf)(__m512)(B), \
3130 (__v16sf)(__m512)(C), \
3131 (__mmask16)(U), (int)(R)))
3134 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3135 _mm512_mask3_fmsubadd_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
3137 return (__m512
)__builtin_ia32_vfmsubaddps512_mask3 ((__v16sf
) __A
,
3141 _MM_FROUND_CUR_DIRECTION
);
3144 #define _mm512_mask_fnmadd_round_pd(A, U, B, C, R) \
3145 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
3146 -(__v8df)(__m512d)(B), \
3147 (__v8df)(__m512d)(C), \
3148 (__mmask8)(U), (int)(R)))
3151 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3152 _mm512_mask_fnmadd_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
3154 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
3158 _MM_FROUND_CUR_DIRECTION
);
3161 #define _mm512_mask_fnmadd_round_ps(A, U, B, C, R) \
3162 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3163 -(__v16sf)(__m512)(B), \
3164 (__v16sf)(__m512)(C), \
3165 (__mmask16)(U), (int)(R)))
3168 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3169 _mm512_mask_fnmadd_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
3171 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
3175 _MM_FROUND_CUR_DIRECTION
);
3178 #define _mm512_mask_fnmsub_round_pd(A, U, B, C, R) \
3179 ((__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \
3180 -(__v8df)(__m512d)(B), \
3181 -(__v8df)(__m512d)(C), \
3182 (__mmask8)(U), (int)(R)))
3185 #define _mm512_mask3_fnmsub_round_pd(A, B, C, U, R) \
3186 ((__m512d)__builtin_ia32_vfmsubpd512_mask3(-(__v8df)(__m512d)(A), \
3187 (__v8df)(__m512d)(B), \
3188 (__v8df)(__m512d)(C), \
3189 (__mmask8)(U), (int)(R)))
3192 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3193 _mm512_mask_fnmsub_pd(__m512d __A
, __mmask8 __U
, __m512d __B
, __m512d __C
)
3195 return (__m512d
) __builtin_ia32_vfmaddpd512_mask ((__v8df
) __A
,
3199 _MM_FROUND_CUR_DIRECTION
);
3202 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3203 _mm512_mask3_fnmsub_pd(__m512d __A
, __m512d __B
, __m512d __C
, __mmask8 __U
)
3205 return (__m512d
) __builtin_ia32_vfmsubpd512_mask3 (-(__v8df
) __A
,
3209 _MM_FROUND_CUR_DIRECTION
);
3212 #define _mm512_mask_fnmsub_round_ps(A, U, B, C, R) \
3213 ((__m512)__builtin_ia32_vfmaddps512_mask((__v16sf)(__m512)(A), \
3214 -(__v16sf)(__m512)(B), \
3215 -(__v16sf)(__m512)(C), \
3216 (__mmask16)(U), (int)(R)))
3219 #define _mm512_mask3_fnmsub_round_ps(A, B, C, U, R) \
3220 ((__m512)__builtin_ia32_vfmsubps512_mask3(-(__v16sf)(__m512)(A), \
3221 (__v16sf)(__m512)(B), \
3222 (__v16sf)(__m512)(C), \
3223 (__mmask16)(U), (int)(R)))
3226 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3227 _mm512_mask_fnmsub_ps(__m512 __A
, __mmask16 __U
, __m512 __B
, __m512 __C
)
3229 return (__m512
) __builtin_ia32_vfmaddps512_mask ((__v16sf
) __A
,
3233 _MM_FROUND_CUR_DIRECTION
);
3236 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3237 _mm512_mask3_fnmsub_ps(__m512 __A
, __m512 __B
, __m512 __C
, __mmask16 __U
)
3239 return (__m512
) __builtin_ia32_vfmsubps512_mask3 (-(__v16sf
) __A
,
3243 _MM_FROUND_CUR_DIRECTION
);
3248 /* Vector permutations */
3250 static __inline __m512i __DEFAULT_FN_ATTRS512
3251 _mm512_permutex2var_epi32(__m512i __A
, __m512i __I
, __m512i __B
)
3253 return (__m512i
)__builtin_ia32_vpermi2vard512((__v16si
)__A
, (__v16si
) __I
,
3257 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3258 _mm512_mask_permutex2var_epi32(__m512i __A
, __mmask16 __U
, __m512i __I
,
3261 return (__m512i
)__builtin_ia32_selectd_512(__U
,
3262 (__v16si
)_mm512_permutex2var_epi32(__A
, __I
, __B
),
3266 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3267 _mm512_mask2_permutex2var_epi32(__m512i __A
, __m512i __I
, __mmask16 __U
,
3270 return (__m512i
)__builtin_ia32_selectd_512(__U
,
3271 (__v16si
)_mm512_permutex2var_epi32(__A
, __I
, __B
),
3275 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3276 _mm512_maskz_permutex2var_epi32(__mmask16 __U
, __m512i __A
, __m512i __I
,
3279 return (__m512i
)__builtin_ia32_selectd_512(__U
,
3280 (__v16si
)_mm512_permutex2var_epi32(__A
, __I
, __B
),
3281 (__v16si
)_mm512_setzero_si512());
3284 static __inline __m512i __DEFAULT_FN_ATTRS512
3285 _mm512_permutex2var_epi64(__m512i __A
, __m512i __I
, __m512i __B
)
3287 return (__m512i
)__builtin_ia32_vpermi2varq512((__v8di
)__A
, (__v8di
) __I
,
3291 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3292 _mm512_mask_permutex2var_epi64(__m512i __A
, __mmask8 __U
, __m512i __I
,
3295 return (__m512i
)__builtin_ia32_selectq_512(__U
,
3296 (__v8di
)_mm512_permutex2var_epi64(__A
, __I
, __B
),
3300 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3301 _mm512_mask2_permutex2var_epi64(__m512i __A
, __m512i __I
, __mmask8 __U
,
3304 return (__m512i
)__builtin_ia32_selectq_512(__U
,
3305 (__v8di
)_mm512_permutex2var_epi64(__A
, __I
, __B
),
3309 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3310 _mm512_maskz_permutex2var_epi64(__mmask8 __U
, __m512i __A
, __m512i __I
,
3313 return (__m512i
)__builtin_ia32_selectq_512(__U
,
3314 (__v8di
)_mm512_permutex2var_epi64(__A
, __I
, __B
),
3315 (__v8di
)_mm512_setzero_si512());
3318 #define _mm512_alignr_epi64(A, B, I) \
3319 ((__m512i)__builtin_ia32_alignq512((__v8di)(__m512i)(A), \
3320 (__v8di)(__m512i)(B), (int)(I)))
3322 #define _mm512_mask_alignr_epi64(W, U, A, B, imm) \
3323 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
3324 (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \
3325 (__v8di)(__m512i)(W)))
3327 #define _mm512_maskz_alignr_epi64(U, A, B, imm) \
3328 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
3329 (__v8di)_mm512_alignr_epi64((A), (B), (imm)), \
3330 (__v8di)_mm512_setzero_si512()))
3332 #define _mm512_alignr_epi32(A, B, I) \
3333 ((__m512i)__builtin_ia32_alignd512((__v16si)(__m512i)(A), \
3334 (__v16si)(__m512i)(B), (int)(I)))
3336 #define _mm512_mask_alignr_epi32(W, U, A, B, imm) \
3337 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
3338 (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \
3339 (__v16si)(__m512i)(W)))
3341 #define _mm512_maskz_alignr_epi32(U, A, B, imm) \
3342 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
3343 (__v16si)_mm512_alignr_epi32((A), (B), (imm)), \
3344 (__v16si)_mm512_setzero_si512()))
3345 /* Vector Extract */
3347 #define _mm512_extractf64x4_pd(A, I) \
3348 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(I), \
3349 (__v4df)_mm256_undefined_pd(), \
3352 #define _mm512_mask_extractf64x4_pd(W, U, A, imm) \
3353 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \
3354 (__v4df)(__m256d)(W), \
3357 #define _mm512_maskz_extractf64x4_pd(U, A, imm) \
3358 ((__m256d)__builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), (int)(imm), \
3359 (__v4df)_mm256_setzero_pd(), \
3362 #define _mm512_extractf32x4_ps(A, I) \
3363 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(I), \
3364 (__v4sf)_mm_undefined_ps(), \
3367 #define _mm512_mask_extractf32x4_ps(W, U, A, imm) \
3368 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \
3369 (__v4sf)(__m128)(W), \
3372 #define _mm512_maskz_extractf32x4_ps(U, A, imm) \
3373 ((__m128)__builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), (int)(imm), \
3374 (__v4sf)_mm_setzero_ps(), \
3379 static __inline __m512d __DEFAULT_FN_ATTRS512
3380 _mm512_mask_blend_pd(__mmask8 __U
, __m512d __A
, __m512d __W
)
3382 return (__m512d
) __builtin_ia32_selectpd_512 ((__mmask8
) __U
,
3387 static __inline __m512 __DEFAULT_FN_ATTRS512
3388 _mm512_mask_blend_ps(__mmask16 __U
, __m512 __A
, __m512 __W
)
3390 return (__m512
) __builtin_ia32_selectps_512 ((__mmask16
) __U
,
3395 static __inline __m512i __DEFAULT_FN_ATTRS512
3396 _mm512_mask_blend_epi64(__mmask8 __U
, __m512i __A
, __m512i __W
)
3398 return (__m512i
) __builtin_ia32_selectq_512 ((__mmask8
) __U
,
3403 static __inline __m512i __DEFAULT_FN_ATTRS512
3404 _mm512_mask_blend_epi32(__mmask16 __U
, __m512i __A
, __m512i __W
)
3406 return (__m512i
) __builtin_ia32_selectd_512 ((__mmask16
) __U
,
3413 #define _mm512_cmp_round_ps_mask(A, B, P, R) \
3414 ((__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
3415 (__v16sf)(__m512)(B), (int)(P), \
3416 (__mmask16)-1, (int)(R)))
3418 #define _mm512_mask_cmp_round_ps_mask(U, A, B, P, R) \
3419 ((__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
3420 (__v16sf)(__m512)(B), (int)(P), \
3421 (__mmask16)(U), (int)(R)))
3423 #define _mm512_cmp_ps_mask(A, B, P) \
3424 _mm512_cmp_round_ps_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3425 #define _mm512_mask_cmp_ps_mask(U, A, B, P) \
3426 _mm512_mask_cmp_round_ps_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3428 #define _mm512_cmpeq_ps_mask(A, B) \
3429 _mm512_cmp_ps_mask((A), (B), _CMP_EQ_OQ)
3430 #define _mm512_mask_cmpeq_ps_mask(k, A, B) \
3431 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_EQ_OQ)
3433 #define _mm512_cmplt_ps_mask(A, B) \
3434 _mm512_cmp_ps_mask((A), (B), _CMP_LT_OS)
3435 #define _mm512_mask_cmplt_ps_mask(k, A, B) \
3436 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LT_OS)
3438 #define _mm512_cmple_ps_mask(A, B) \
3439 _mm512_cmp_ps_mask((A), (B), _CMP_LE_OS)
3440 #define _mm512_mask_cmple_ps_mask(k, A, B) \
3441 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_LE_OS)
3443 #define _mm512_cmpunord_ps_mask(A, B) \
3444 _mm512_cmp_ps_mask((A), (B), _CMP_UNORD_Q)
3445 #define _mm512_mask_cmpunord_ps_mask(k, A, B) \
3446 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_UNORD_Q)
3448 #define _mm512_cmpneq_ps_mask(A, B) \
3449 _mm512_cmp_ps_mask((A), (B), _CMP_NEQ_UQ)
3450 #define _mm512_mask_cmpneq_ps_mask(k, A, B) \
3451 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NEQ_UQ)
3453 #define _mm512_cmpnlt_ps_mask(A, B) \
3454 _mm512_cmp_ps_mask((A), (B), _CMP_NLT_US)
3455 #define _mm512_mask_cmpnlt_ps_mask(k, A, B) \
3456 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLT_US)
3458 #define _mm512_cmpnle_ps_mask(A, B) \
3459 _mm512_cmp_ps_mask((A), (B), _CMP_NLE_US)
3460 #define _mm512_mask_cmpnle_ps_mask(k, A, B) \
3461 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_NLE_US)
3463 #define _mm512_cmpord_ps_mask(A, B) \
3464 _mm512_cmp_ps_mask((A), (B), _CMP_ORD_Q)
3465 #define _mm512_mask_cmpord_ps_mask(k, A, B) \
3466 _mm512_mask_cmp_ps_mask((k), (A), (B), _CMP_ORD_Q)
3468 #define _mm512_cmp_round_pd_mask(A, B, P, R) \
3469 ((__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
3470 (__v8df)(__m512d)(B), (int)(P), \
3471 (__mmask8)-1, (int)(R)))
3473 #define _mm512_mask_cmp_round_pd_mask(U, A, B, P, R) \
3474 ((__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
3475 (__v8df)(__m512d)(B), (int)(P), \
3476 (__mmask8)(U), (int)(R)))
3478 #define _mm512_cmp_pd_mask(A, B, P) \
3479 _mm512_cmp_round_pd_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3480 #define _mm512_mask_cmp_pd_mask(U, A, B, P) \
3481 _mm512_mask_cmp_round_pd_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
3483 #define _mm512_cmpeq_pd_mask(A, B) \
3484 _mm512_cmp_pd_mask((A), (B), _CMP_EQ_OQ)
3485 #define _mm512_mask_cmpeq_pd_mask(k, A, B) \
3486 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_EQ_OQ)
3488 #define _mm512_cmplt_pd_mask(A, B) \
3489 _mm512_cmp_pd_mask((A), (B), _CMP_LT_OS)
3490 #define _mm512_mask_cmplt_pd_mask(k, A, B) \
3491 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LT_OS)
3493 #define _mm512_cmple_pd_mask(A, B) \
3494 _mm512_cmp_pd_mask((A), (B), _CMP_LE_OS)
3495 #define _mm512_mask_cmple_pd_mask(k, A, B) \
3496 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_LE_OS)
3498 #define _mm512_cmpunord_pd_mask(A, B) \
3499 _mm512_cmp_pd_mask((A), (B), _CMP_UNORD_Q)
3500 #define _mm512_mask_cmpunord_pd_mask(k, A, B) \
3501 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_UNORD_Q)
3503 #define _mm512_cmpneq_pd_mask(A, B) \
3504 _mm512_cmp_pd_mask((A), (B), _CMP_NEQ_UQ)
3505 #define _mm512_mask_cmpneq_pd_mask(k, A, B) \
3506 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NEQ_UQ)
3508 #define _mm512_cmpnlt_pd_mask(A, B) \
3509 _mm512_cmp_pd_mask((A), (B), _CMP_NLT_US)
3510 #define _mm512_mask_cmpnlt_pd_mask(k, A, B) \
3511 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLT_US)
3513 #define _mm512_cmpnle_pd_mask(A, B) \
3514 _mm512_cmp_pd_mask((A), (B), _CMP_NLE_US)
3515 #define _mm512_mask_cmpnle_pd_mask(k, A, B) \
3516 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_NLE_US)
3518 #define _mm512_cmpord_pd_mask(A, B) \
3519 _mm512_cmp_pd_mask((A), (B), _CMP_ORD_Q)
3520 #define _mm512_mask_cmpord_pd_mask(k, A, B) \
3521 _mm512_mask_cmp_pd_mask((k), (A), (B), _CMP_ORD_Q)
3525 #define _mm512_cvtt_roundps_epu32(A, R) \
3526 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3527 (__v16si)_mm512_undefined_epi32(), \
3528 (__mmask16)-1, (int)(R)))
3530 #define _mm512_mask_cvtt_roundps_epu32(W, U, A, R) \
3531 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3532 (__v16si)(__m512i)(W), \
3533 (__mmask16)(U), (int)(R)))
3535 #define _mm512_maskz_cvtt_roundps_epu32(U, A, R) \
3536 ((__m512i)__builtin_ia32_cvttps2udq512_mask((__v16sf)(__m512)(A), \
3537 (__v16si)_mm512_setzero_si512(), \
3538 (__mmask16)(U), (int)(R)))
3541 static __inline __m512i __DEFAULT_FN_ATTRS512
3542 _mm512_cvttps_epu32(__m512 __A
)
3544 return (__m512i
) __builtin_ia32_cvttps2udq512_mask ((__v16sf
) __A
,
3546 _mm512_setzero_si512 (),
3548 _MM_FROUND_CUR_DIRECTION
);
3551 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3552 _mm512_mask_cvttps_epu32 (__m512i __W
, __mmask16 __U
, __m512 __A
)
3554 return (__m512i
) __builtin_ia32_cvttps2udq512_mask ((__v16sf
) __A
,
3557 _MM_FROUND_CUR_DIRECTION
);
3560 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3561 _mm512_maskz_cvttps_epu32 (__mmask16 __U
, __m512 __A
)
3563 return (__m512i
) __builtin_ia32_cvttps2udq512_mask ((__v16sf
) __A
,
3564 (__v16si
) _mm512_setzero_si512 (),
3566 _MM_FROUND_CUR_DIRECTION
);
3569 #define _mm512_cvt_roundepi32_ps(A, R) \
3570 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3571 (__v16sf)_mm512_setzero_ps(), \
3572 (__mmask16)-1, (int)(R)))
3574 #define _mm512_mask_cvt_roundepi32_ps(W, U, A, R) \
3575 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3576 (__v16sf)(__m512)(W), \
3577 (__mmask16)(U), (int)(R)))
3579 #define _mm512_maskz_cvt_roundepi32_ps(U, A, R) \
3580 ((__m512)__builtin_ia32_cvtdq2ps512_mask((__v16si)(__m512i)(A), \
3581 (__v16sf)_mm512_setzero_ps(), \
3582 (__mmask16)(U), (int)(R)))
3584 #define _mm512_cvt_roundepu32_ps(A, R) \
3585 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3586 (__v16sf)_mm512_setzero_ps(), \
3587 (__mmask16)-1, (int)(R)))
3589 #define _mm512_mask_cvt_roundepu32_ps(W, U, A, R) \
3590 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3591 (__v16sf)(__m512)(W), \
3592 (__mmask16)(U), (int)(R)))
3594 #define _mm512_maskz_cvt_roundepu32_ps(U, A, R) \
3595 ((__m512)__builtin_ia32_cvtudq2ps512_mask((__v16si)(__m512i)(A), \
3596 (__v16sf)_mm512_setzero_ps(), \
3597 (__mmask16)(U), (int)(R)))
3599 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3600 _mm512_cvtepu32_ps (__m512i __A
)
3602 return (__m512
)__builtin_convertvector((__v16su
)__A
, __v16sf
);
3605 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3606 _mm512_mask_cvtepu32_ps (__m512 __W
, __mmask16 __U
, __m512i __A
)
3608 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
3609 (__v16sf
)_mm512_cvtepu32_ps(__A
),
3613 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3614 _mm512_maskz_cvtepu32_ps (__mmask16 __U
, __m512i __A
)
3616 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
3617 (__v16sf
)_mm512_cvtepu32_ps(__A
),
3618 (__v16sf
)_mm512_setzero_ps());
3621 static __inline __m512d __DEFAULT_FN_ATTRS512
3622 _mm512_cvtepi32_pd(__m256i __A
)
3624 return (__m512d
)__builtin_convertvector((__v8si
)__A
, __v8df
);
3627 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3628 _mm512_mask_cvtepi32_pd (__m512d __W
, __mmask8 __U
, __m256i __A
)
3630 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
3631 (__v8df
)_mm512_cvtepi32_pd(__A
),
3635 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3636 _mm512_maskz_cvtepi32_pd (__mmask8 __U
, __m256i __A
)
3638 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
3639 (__v8df
)_mm512_cvtepi32_pd(__A
),
3640 (__v8df
)_mm512_setzero_pd());
3643 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3644 _mm512_cvtepi32lo_pd(__m512i __A
)
3646 return (__m512d
) _mm512_cvtepi32_pd(_mm512_castsi512_si256(__A
));
3649 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3650 _mm512_mask_cvtepi32lo_pd(__m512d __W
, __mmask8 __U
,__m512i __A
)
3652 return (__m512d
) _mm512_mask_cvtepi32_pd(__W
, __U
, _mm512_castsi512_si256(__A
));
3655 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3656 _mm512_cvtepi32_ps (__m512i __A
)
3658 return (__m512
)__builtin_convertvector((__v16si
)__A
, __v16sf
);
3661 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3662 _mm512_mask_cvtepi32_ps (__m512 __W
, __mmask16 __U
, __m512i __A
)
3664 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
3665 (__v16sf
)_mm512_cvtepi32_ps(__A
),
3669 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3670 _mm512_maskz_cvtepi32_ps (__mmask16 __U
, __m512i __A
)
3672 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
3673 (__v16sf
)_mm512_cvtepi32_ps(__A
),
3674 (__v16sf
)_mm512_setzero_ps());
3677 static __inline __m512d __DEFAULT_FN_ATTRS512
3678 _mm512_cvtepu32_pd(__m256i __A
)
3680 return (__m512d
)__builtin_convertvector((__v8su
)__A
, __v8df
);
3683 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3684 _mm512_mask_cvtepu32_pd (__m512d __W
, __mmask8 __U
, __m256i __A
)
3686 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
3687 (__v8df
)_mm512_cvtepu32_pd(__A
),
3691 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3692 _mm512_maskz_cvtepu32_pd (__mmask8 __U
, __m256i __A
)
3694 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
3695 (__v8df
)_mm512_cvtepu32_pd(__A
),
3696 (__v8df
)_mm512_setzero_pd());
3699 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3700 _mm512_cvtepu32lo_pd(__m512i __A
)
3702 return (__m512d
) _mm512_cvtepu32_pd(_mm512_castsi512_si256(__A
));
3705 static __inline__ __m512d __DEFAULT_FN_ATTRS512
3706 _mm512_mask_cvtepu32lo_pd(__m512d __W
, __mmask8 __U
,__m512i __A
)
3708 return (__m512d
) _mm512_mask_cvtepu32_pd(__W
, __U
, _mm512_castsi512_si256(__A
));
3711 #define _mm512_cvt_roundpd_ps(A, R) \
3712 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3713 (__v8sf)_mm256_setzero_ps(), \
3714 (__mmask8)-1, (int)(R)))
3716 #define _mm512_mask_cvt_roundpd_ps(W, U, A, R) \
3717 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3718 (__v8sf)(__m256)(W), (__mmask8)(U), \
3721 #define _mm512_maskz_cvt_roundpd_ps(U, A, R) \
3722 ((__m256)__builtin_ia32_cvtpd2ps512_mask((__v8df)(__m512d)(A), \
3723 (__v8sf)_mm256_setzero_ps(), \
3724 (__mmask8)(U), (int)(R)))
3726 static __inline__ __m256 __DEFAULT_FN_ATTRS512
3727 _mm512_cvtpd_ps (__m512d __A
)
3729 return (__m256
) __builtin_ia32_cvtpd2ps512_mask ((__v8df
) __A
,
3730 (__v8sf
) _mm256_undefined_ps (),
3732 _MM_FROUND_CUR_DIRECTION
);
3735 static __inline__ __m256 __DEFAULT_FN_ATTRS512
3736 _mm512_mask_cvtpd_ps (__m256 __W
, __mmask8 __U
, __m512d __A
)
3738 return (__m256
) __builtin_ia32_cvtpd2ps512_mask ((__v8df
) __A
,
3741 _MM_FROUND_CUR_DIRECTION
);
3744 static __inline__ __m256 __DEFAULT_FN_ATTRS512
3745 _mm512_maskz_cvtpd_ps (__mmask8 __U
, __m512d __A
)
3747 return (__m256
) __builtin_ia32_cvtpd2ps512_mask ((__v8df
) __A
,
3748 (__v8sf
) _mm256_setzero_ps (),
3750 _MM_FROUND_CUR_DIRECTION
);
3753 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3754 _mm512_cvtpd_pslo (__m512d __A
)
3756 return (__m512
) __builtin_shufflevector((__v8sf
) _mm512_cvtpd_ps(__A
),
3757 (__v8sf
) _mm256_setzero_ps (),
3758 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
3761 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3762 _mm512_mask_cvtpd_pslo (__m512 __W
, __mmask8 __U
,__m512d __A
)
3764 return (__m512
) __builtin_shufflevector (
3765 (__v8sf
) _mm512_mask_cvtpd_ps (_mm512_castps512_ps256(__W
),
3767 (__v8sf
) _mm256_setzero_ps (),
3768 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
3771 #define _mm512_cvt_roundps_ph(A, I) \
3772 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3773 (__v16hi)_mm256_undefined_si256(), \
3776 #define _mm512_mask_cvt_roundps_ph(U, W, A, I) \
3777 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3778 (__v16hi)(__m256i)(U), \
3781 #define _mm512_maskz_cvt_roundps_ph(W, A, I) \
3782 ((__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(__m512)(A), (int)(I), \
3783 (__v16hi)_mm256_setzero_si256(), \
3786 #define _mm512_cvtps_ph _mm512_cvt_roundps_ph
3787 #define _mm512_mask_cvtps_ph _mm512_mask_cvt_roundps_ph
3788 #define _mm512_maskz_cvtps_ph _mm512_maskz_cvt_roundps_ph
3790 #define _mm512_cvt_roundph_ps(A, R) \
3791 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3792 (__v16sf)_mm512_undefined_ps(), \
3793 (__mmask16)-1, (int)(R)))
3795 #define _mm512_mask_cvt_roundph_ps(W, U, A, R) \
3796 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3797 (__v16sf)(__m512)(W), \
3798 (__mmask16)(U), (int)(R)))
3800 #define _mm512_maskz_cvt_roundph_ps(U, A, R) \
3801 ((__m512)__builtin_ia32_vcvtph2ps512_mask((__v16hi)(__m256i)(A), \
3802 (__v16sf)_mm512_setzero_ps(), \
3803 (__mmask16)(U), (int)(R)))
3806 static __inline __m512 __DEFAULT_FN_ATTRS512
3807 _mm512_cvtph_ps(__m256i __A
)
3809 return (__m512
) __builtin_ia32_vcvtph2ps512_mask ((__v16hi
) __A
,
3811 _mm512_setzero_ps (),
3813 _MM_FROUND_CUR_DIRECTION
);
3816 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3817 _mm512_mask_cvtph_ps (__m512 __W
, __mmask16 __U
, __m256i __A
)
3819 return (__m512
) __builtin_ia32_vcvtph2ps512_mask ((__v16hi
) __A
,
3822 _MM_FROUND_CUR_DIRECTION
);
3825 static __inline__ __m512 __DEFAULT_FN_ATTRS512
3826 _mm512_maskz_cvtph_ps (__mmask16 __U
, __m256i __A
)
3828 return (__m512
) __builtin_ia32_vcvtph2ps512_mask ((__v16hi
) __A
,
3829 (__v16sf
) _mm512_setzero_ps (),
3831 _MM_FROUND_CUR_DIRECTION
);
3834 #define _mm512_cvtt_roundpd_epi32(A, R) \
3835 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3836 (__v8si)_mm256_setzero_si256(), \
3837 (__mmask8)-1, (int)(R)))
3839 #define _mm512_mask_cvtt_roundpd_epi32(W, U, A, R) \
3840 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3841 (__v8si)(__m256i)(W), \
3842 (__mmask8)(U), (int)(R)))
3844 #define _mm512_maskz_cvtt_roundpd_epi32(U, A, R) \
3845 ((__m256i)__builtin_ia32_cvttpd2dq512_mask((__v8df)(__m512d)(A), \
3846 (__v8si)_mm256_setzero_si256(), \
3847 (__mmask8)(U), (int)(R)))
3849 static __inline __m256i __DEFAULT_FN_ATTRS512
3850 _mm512_cvttpd_epi32(__m512d __a
)
3852 return (__m256i
)__builtin_ia32_cvttpd2dq512_mask((__v8df
) __a
,
3853 (__v8si
)_mm256_setzero_si256(),
3855 _MM_FROUND_CUR_DIRECTION
);
3858 static __inline__ __m256i __DEFAULT_FN_ATTRS512
3859 _mm512_mask_cvttpd_epi32 (__m256i __W
, __mmask8 __U
, __m512d __A
)
3861 return (__m256i
) __builtin_ia32_cvttpd2dq512_mask ((__v8df
) __A
,
3864 _MM_FROUND_CUR_DIRECTION
);
3867 static __inline__ __m256i __DEFAULT_FN_ATTRS512
3868 _mm512_maskz_cvttpd_epi32 (__mmask8 __U
, __m512d __A
)
3870 return (__m256i
) __builtin_ia32_cvttpd2dq512_mask ((__v8df
) __A
,
3871 (__v8si
) _mm256_setzero_si256 (),
3873 _MM_FROUND_CUR_DIRECTION
);
3876 #define _mm512_cvtt_roundps_epi32(A, R) \
3877 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3878 (__v16si)_mm512_setzero_si512(), \
3879 (__mmask16)-1, (int)(R)))
3881 #define _mm512_mask_cvtt_roundps_epi32(W, U, A, R) \
3882 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3883 (__v16si)(__m512i)(W), \
3884 (__mmask16)(U), (int)(R)))
3886 #define _mm512_maskz_cvtt_roundps_epi32(U, A, R) \
3887 ((__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(__m512)(A), \
3888 (__v16si)_mm512_setzero_si512(), \
3889 (__mmask16)(U), (int)(R)))
3891 static __inline __m512i __DEFAULT_FN_ATTRS512
3892 _mm512_cvttps_epi32(__m512 __a
)
3895 __builtin_ia32_cvttps2dq512_mask((__v16sf
) __a
,
3896 (__v16si
) _mm512_setzero_si512 (),
3897 (__mmask16
) -1, _MM_FROUND_CUR_DIRECTION
);
3900 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3901 _mm512_mask_cvttps_epi32 (__m512i __W
, __mmask16 __U
, __m512 __A
)
3903 return (__m512i
) __builtin_ia32_cvttps2dq512_mask ((__v16sf
) __A
,
3906 _MM_FROUND_CUR_DIRECTION
);
3909 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3910 _mm512_maskz_cvttps_epi32 (__mmask16 __U
, __m512 __A
)
3912 return (__m512i
) __builtin_ia32_cvttps2dq512_mask ((__v16sf
) __A
,
3913 (__v16si
) _mm512_setzero_si512 (),
3915 _MM_FROUND_CUR_DIRECTION
);
3918 #define _mm512_cvt_roundps_epi32(A, R) \
3919 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3920 (__v16si)_mm512_setzero_si512(), \
3921 (__mmask16)-1, (int)(R)))
3923 #define _mm512_mask_cvt_roundps_epi32(W, U, A, R) \
3924 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3925 (__v16si)(__m512i)(W), \
3926 (__mmask16)(U), (int)(R)))
3928 #define _mm512_maskz_cvt_roundps_epi32(U, A, R) \
3929 ((__m512i)__builtin_ia32_cvtps2dq512_mask((__v16sf)(__m512)(A), \
3930 (__v16si)_mm512_setzero_si512(), \
3931 (__mmask16)(U), (int)(R)))
3933 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3934 _mm512_cvtps_epi32 (__m512 __A
)
3936 return (__m512i
) __builtin_ia32_cvtps2dq512_mask ((__v16sf
) __A
,
3937 (__v16si
) _mm512_undefined_epi32 (),
3939 _MM_FROUND_CUR_DIRECTION
);
3942 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3943 _mm512_mask_cvtps_epi32 (__m512i __W
, __mmask16 __U
, __m512 __A
)
3945 return (__m512i
) __builtin_ia32_cvtps2dq512_mask ((__v16sf
) __A
,
3948 _MM_FROUND_CUR_DIRECTION
);
3951 static __inline__ __m512i __DEFAULT_FN_ATTRS512
3952 _mm512_maskz_cvtps_epi32 (__mmask16 __U
, __m512 __A
)
3954 return (__m512i
) __builtin_ia32_cvtps2dq512_mask ((__v16sf
) __A
,
3956 _mm512_setzero_si512 (),
3958 _MM_FROUND_CUR_DIRECTION
);
3961 #define _mm512_cvt_roundpd_epi32(A, R) \
3962 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3963 (__v8si)_mm256_setzero_si256(), \
3964 (__mmask8)-1, (int)(R)))
3966 #define _mm512_mask_cvt_roundpd_epi32(W, U, A, R) \
3967 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3968 (__v8si)(__m256i)(W), \
3969 (__mmask8)(U), (int)(R)))
3971 #define _mm512_maskz_cvt_roundpd_epi32(U, A, R) \
3972 ((__m256i)__builtin_ia32_cvtpd2dq512_mask((__v8df)(__m512d)(A), \
3973 (__v8si)_mm256_setzero_si256(), \
3974 (__mmask8)(U), (int)(R)))
3976 static __inline__ __m256i __DEFAULT_FN_ATTRS512
3977 _mm512_cvtpd_epi32 (__m512d __A
)
3979 return (__m256i
) __builtin_ia32_cvtpd2dq512_mask ((__v8df
) __A
,
3981 _mm256_undefined_si256 (),
3983 _MM_FROUND_CUR_DIRECTION
);
3986 static __inline__ __m256i __DEFAULT_FN_ATTRS512
3987 _mm512_mask_cvtpd_epi32 (__m256i __W
, __mmask8 __U
, __m512d __A
)
3989 return (__m256i
) __builtin_ia32_cvtpd2dq512_mask ((__v8df
) __A
,
3992 _MM_FROUND_CUR_DIRECTION
);
3995 static __inline__ __m256i __DEFAULT_FN_ATTRS512
3996 _mm512_maskz_cvtpd_epi32 (__mmask8 __U
, __m512d __A
)
3998 return (__m256i
) __builtin_ia32_cvtpd2dq512_mask ((__v8df
) __A
,
4000 _mm256_setzero_si256 (),
4002 _MM_FROUND_CUR_DIRECTION
);
4005 #define _mm512_cvt_roundps_epu32(A, R) \
4006 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4007 (__v16si)_mm512_setzero_si512(), \
4008 (__mmask16)-1, (int)(R)))
4010 #define _mm512_mask_cvt_roundps_epu32(W, U, A, R) \
4011 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4012 (__v16si)(__m512i)(W), \
4013 (__mmask16)(U), (int)(R)))
4015 #define _mm512_maskz_cvt_roundps_epu32(U, A, R) \
4016 ((__m512i)__builtin_ia32_cvtps2udq512_mask((__v16sf)(__m512)(A), \
4017 (__v16si)_mm512_setzero_si512(), \
4018 (__mmask16)(U), (int)(R)))
4020 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4021 _mm512_cvtps_epu32 ( __m512 __A
)
4023 return (__m512i
) __builtin_ia32_cvtps2udq512_mask ((__v16sf
) __A
,\
4025 _mm512_undefined_epi32 (),
4027 _MM_FROUND_CUR_DIRECTION
);
4030 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4031 _mm512_mask_cvtps_epu32 (__m512i __W
, __mmask16 __U
, __m512 __A
)
4033 return (__m512i
) __builtin_ia32_cvtps2udq512_mask ((__v16sf
) __A
,
4036 _MM_FROUND_CUR_DIRECTION
);
4039 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4040 _mm512_maskz_cvtps_epu32 ( __mmask16 __U
, __m512 __A
)
4042 return (__m512i
) __builtin_ia32_cvtps2udq512_mask ((__v16sf
) __A
,
4044 _mm512_setzero_si512 (),
4046 _MM_FROUND_CUR_DIRECTION
);
4049 #define _mm512_cvt_roundpd_epu32(A, R) \
4050 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4051 (__v8si)_mm256_setzero_si256(), \
4052 (__mmask8)-1, (int)(R)))
4054 #define _mm512_mask_cvt_roundpd_epu32(W, U, A, R) \
4055 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4056 (__v8si)(__m256i)(W), \
4057 (__mmask8)(U), (int)(R)))
4059 #define _mm512_maskz_cvt_roundpd_epu32(U, A, R) \
4060 ((__m256i)__builtin_ia32_cvtpd2udq512_mask((__v8df)(__m512d)(A), \
4061 (__v8si)_mm256_setzero_si256(), \
4062 (__mmask8)(U), (int)(R)))
4064 static __inline__ __m256i __DEFAULT_FN_ATTRS512
4065 _mm512_cvtpd_epu32 (__m512d __A
)
4067 return (__m256i
) __builtin_ia32_cvtpd2udq512_mask ((__v8df
) __A
,
4069 _mm256_undefined_si256 (),
4071 _MM_FROUND_CUR_DIRECTION
);
4074 static __inline__ __m256i __DEFAULT_FN_ATTRS512
4075 _mm512_mask_cvtpd_epu32 (__m256i __W
, __mmask8 __U
, __m512d __A
)
4077 return (__m256i
) __builtin_ia32_cvtpd2udq512_mask ((__v8df
) __A
,
4080 _MM_FROUND_CUR_DIRECTION
);
4083 static __inline__ __m256i __DEFAULT_FN_ATTRS512
4084 _mm512_maskz_cvtpd_epu32 (__mmask8 __U
, __m512d __A
)
4086 return (__m256i
) __builtin_ia32_cvtpd2udq512_mask ((__v8df
) __A
,
4088 _mm256_setzero_si256 (),
4090 _MM_FROUND_CUR_DIRECTION
);
4093 static __inline__
double __DEFAULT_FN_ATTRS512
4094 _mm512_cvtsd_f64(__m512d __a
)
4099 static __inline__
float __DEFAULT_FN_ATTRS512
4100 _mm512_cvtss_f32(__m512 __a
)
4105 /* Unpack and Interleave */
4107 static __inline __m512d __DEFAULT_FN_ATTRS512
4108 _mm512_unpackhi_pd(__m512d __a
, __m512d __b
)
4110 return (__m512d
)__builtin_shufflevector((__v8df
)__a
, (__v8df
)__b
,
4111 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4114 static __inline__ __m512d __DEFAULT_FN_ATTRS512
4115 _mm512_mask_unpackhi_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
)
4117 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
4118 (__v8df
)_mm512_unpackhi_pd(__A
, __B
),
4122 static __inline__ __m512d __DEFAULT_FN_ATTRS512
4123 _mm512_maskz_unpackhi_pd(__mmask8 __U
, __m512d __A
, __m512d __B
)
4125 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
4126 (__v8df
)_mm512_unpackhi_pd(__A
, __B
),
4127 (__v8df
)_mm512_setzero_pd());
4130 static __inline __m512d __DEFAULT_FN_ATTRS512
4131 _mm512_unpacklo_pd(__m512d __a
, __m512d __b
)
4133 return (__m512d
)__builtin_shufflevector((__v8df
)__a
, (__v8df
)__b
,
4134 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4137 static __inline__ __m512d __DEFAULT_FN_ATTRS512
4138 _mm512_mask_unpacklo_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
)
4140 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
4141 (__v8df
)_mm512_unpacklo_pd(__A
, __B
),
4145 static __inline__ __m512d __DEFAULT_FN_ATTRS512
4146 _mm512_maskz_unpacklo_pd (__mmask8 __U
, __m512d __A
, __m512d __B
)
4148 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
) __U
,
4149 (__v8df
)_mm512_unpacklo_pd(__A
, __B
),
4150 (__v8df
)_mm512_setzero_pd());
4153 static __inline __m512 __DEFAULT_FN_ATTRS512
4154 _mm512_unpackhi_ps(__m512 __a
, __m512 __b
)
4156 return (__m512
)__builtin_shufflevector((__v16sf
)__a
, (__v16sf
)__b
,
4158 2+4, 18+4, 3+4, 19+4,
4159 2+8, 18+8, 3+8, 19+8,
4160 2+12, 18+12, 3+12, 19+12);
4163 static __inline__ __m512 __DEFAULT_FN_ATTRS512
4164 _mm512_mask_unpackhi_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
)
4166 return (__m512
)__builtin_ia32_selectps_512((__mmask16
) __U
,
4167 (__v16sf
)_mm512_unpackhi_ps(__A
, __B
),
4171 static __inline__ __m512 __DEFAULT_FN_ATTRS512
4172 _mm512_maskz_unpackhi_ps (__mmask16 __U
, __m512 __A
, __m512 __B
)
4174 return (__m512
)__builtin_ia32_selectps_512((__mmask16
) __U
,
4175 (__v16sf
)_mm512_unpackhi_ps(__A
, __B
),
4176 (__v16sf
)_mm512_setzero_ps());
4179 static __inline __m512 __DEFAULT_FN_ATTRS512
4180 _mm512_unpacklo_ps(__m512 __a
, __m512 __b
)
4182 return (__m512
)__builtin_shufflevector((__v16sf
)__a
, (__v16sf
)__b
,
4184 0+4, 16+4, 1+4, 17+4,
4185 0+8, 16+8, 1+8, 17+8,
4186 0+12, 16+12, 1+12, 17+12);
4189 static __inline__ __m512 __DEFAULT_FN_ATTRS512
4190 _mm512_mask_unpacklo_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
)
4192 return (__m512
)__builtin_ia32_selectps_512((__mmask16
) __U
,
4193 (__v16sf
)_mm512_unpacklo_ps(__A
, __B
),
4197 static __inline__ __m512 __DEFAULT_FN_ATTRS512
4198 _mm512_maskz_unpacklo_ps (__mmask16 __U
, __m512 __A
, __m512 __B
)
4200 return (__m512
)__builtin_ia32_selectps_512((__mmask16
) __U
,
4201 (__v16sf
)_mm512_unpacklo_ps(__A
, __B
),
4202 (__v16sf
)_mm512_setzero_ps());
4205 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4206 _mm512_unpackhi_epi32(__m512i __A
, __m512i __B
)
4208 return (__m512i
)__builtin_shufflevector((__v16si
)__A
, (__v16si
)__B
,
4210 2+4, 18+4, 3+4, 19+4,
4211 2+8, 18+8, 3+8, 19+8,
4212 2+12, 18+12, 3+12, 19+12);
4215 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4216 _mm512_mask_unpackhi_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
4218 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
) __U
,
4219 (__v16si
)_mm512_unpackhi_epi32(__A
, __B
),
4223 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4224 _mm512_maskz_unpackhi_epi32(__mmask16 __U
, __m512i __A
, __m512i __B
)
4226 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
) __U
,
4227 (__v16si
)_mm512_unpackhi_epi32(__A
, __B
),
4228 (__v16si
)_mm512_setzero_si512());
4231 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4232 _mm512_unpacklo_epi32(__m512i __A
, __m512i __B
)
4234 return (__m512i
)__builtin_shufflevector((__v16si
)__A
, (__v16si
)__B
,
4236 0+4, 16+4, 1+4, 17+4,
4237 0+8, 16+8, 1+8, 17+8,
4238 0+12, 16+12, 1+12, 17+12);
4241 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4242 _mm512_mask_unpacklo_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
4244 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
) __U
,
4245 (__v16si
)_mm512_unpacklo_epi32(__A
, __B
),
4249 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4250 _mm512_maskz_unpacklo_epi32(__mmask16 __U
, __m512i __A
, __m512i __B
)
4252 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
) __U
,
4253 (__v16si
)_mm512_unpacklo_epi32(__A
, __B
),
4254 (__v16si
)_mm512_setzero_si512());
4257 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4258 _mm512_unpackhi_epi64(__m512i __A
, __m512i __B
)
4260 return (__m512i
)__builtin_shufflevector((__v8di
)__A
, (__v8di
)__B
,
4261 1, 9, 1+2, 9+2, 1+4, 9+4, 1+6, 9+6);
4264 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4265 _mm512_mask_unpackhi_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
4267 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
) __U
,
4268 (__v8di
)_mm512_unpackhi_epi64(__A
, __B
),
4272 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4273 _mm512_maskz_unpackhi_epi64(__mmask8 __U
, __m512i __A
, __m512i __B
)
4275 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
) __U
,
4276 (__v8di
)_mm512_unpackhi_epi64(__A
, __B
),
4277 (__v8di
)_mm512_setzero_si512());
4280 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4281 _mm512_unpacklo_epi64 (__m512i __A
, __m512i __B
)
4283 return (__m512i
)__builtin_shufflevector((__v8di
)__A
, (__v8di
)__B
,
4284 0, 8, 0+2, 8+2, 0+4, 8+4, 0+6, 8+6);
4287 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4288 _mm512_mask_unpacklo_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
4290 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
) __U
,
4291 (__v8di
)_mm512_unpacklo_epi64(__A
, __B
),
4295 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4296 _mm512_maskz_unpacklo_epi64 (__mmask8 __U
, __m512i __A
, __m512i __B
)
4298 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
) __U
,
4299 (__v8di
)_mm512_unpacklo_epi64(__A
, __B
),
4300 (__v8di
)_mm512_setzero_si512());
4306 static __inline __m512i __DEFAULT_FN_ATTRS512
4307 _mm512_loadu_si512 (void const *__P
)
4309 struct __loadu_si512
{
4311 } __attribute__((__packed__
, __may_alias__
));
4312 return ((const struct __loadu_si512
*)__P
)->__v
;
4315 static __inline __m512i __DEFAULT_FN_ATTRS512
4316 _mm512_loadu_epi32 (void const *__P
)
4318 struct __loadu_epi32
{
4320 } __attribute__((__packed__
, __may_alias__
));
4321 return ((const struct __loadu_epi32
*)__P
)->__v
;
4324 static __inline __m512i __DEFAULT_FN_ATTRS512
4325 _mm512_mask_loadu_epi32 (__m512i __W
, __mmask16 __U
, void const *__P
)
4327 return (__m512i
) __builtin_ia32_loaddqusi512_mask ((const int *) __P
,
4333 static __inline __m512i __DEFAULT_FN_ATTRS512
4334 _mm512_maskz_loadu_epi32(__mmask16 __U
, void const *__P
)
4336 return (__m512i
) __builtin_ia32_loaddqusi512_mask ((const int *)__P
,
4338 _mm512_setzero_si512 (),
4342 static __inline __m512i __DEFAULT_FN_ATTRS512
4343 _mm512_loadu_epi64 (void const *__P
)
4345 struct __loadu_epi64
{
4347 } __attribute__((__packed__
, __may_alias__
));
4348 return ((const struct __loadu_epi64
*)__P
)->__v
;
4351 static __inline __m512i __DEFAULT_FN_ATTRS512
4352 _mm512_mask_loadu_epi64 (__m512i __W
, __mmask8 __U
, void const *__P
)
4354 return (__m512i
) __builtin_ia32_loaddqudi512_mask ((const long long *) __P
,
4359 static __inline __m512i __DEFAULT_FN_ATTRS512
4360 _mm512_maskz_loadu_epi64(__mmask8 __U
, void const *__P
)
4362 return (__m512i
) __builtin_ia32_loaddqudi512_mask ((const long long *)__P
,
4364 _mm512_setzero_si512 (),
4368 static __inline __m512 __DEFAULT_FN_ATTRS512
4369 _mm512_mask_loadu_ps (__m512 __W
, __mmask16 __U
, void const *__P
)
4371 return (__m512
) __builtin_ia32_loadups512_mask ((const float *) __P
,
4376 static __inline __m512 __DEFAULT_FN_ATTRS512
4377 _mm512_maskz_loadu_ps(__mmask16 __U
, void const *__P
)
4379 return (__m512
) __builtin_ia32_loadups512_mask ((const float *)__P
,
4381 _mm512_setzero_ps (),
4385 static __inline __m512d __DEFAULT_FN_ATTRS512
4386 _mm512_mask_loadu_pd (__m512d __W
, __mmask8 __U
, void const *__P
)
4388 return (__m512d
) __builtin_ia32_loadupd512_mask ((const double *) __P
,
4393 static __inline __m512d __DEFAULT_FN_ATTRS512
4394 _mm512_maskz_loadu_pd(__mmask8 __U
, void const *__P
)
4396 return (__m512d
) __builtin_ia32_loadupd512_mask ((const double *)__P
,
4398 _mm512_setzero_pd (),
4402 static __inline __m512d __DEFAULT_FN_ATTRS512
4403 _mm512_loadu_pd(void const *__p
)
4407 } __attribute__((__packed__
, __may_alias__
));
4408 return ((const struct __loadu_pd
*)__p
)->__v
;
4411 static __inline __m512 __DEFAULT_FN_ATTRS512
4412 _mm512_loadu_ps(void const *__p
)
4416 } __attribute__((__packed__
, __may_alias__
));
4417 return ((const struct __loadu_ps
*)__p
)->__v
;
4420 static __inline __m512 __DEFAULT_FN_ATTRS512
4421 _mm512_load_ps(void const *__p
)
4423 return *(const __m512
*)__p
;
4426 static __inline __m512 __DEFAULT_FN_ATTRS512
4427 _mm512_mask_load_ps (__m512 __W
, __mmask16 __U
, void const *__P
)
4429 return (__m512
) __builtin_ia32_loadaps512_mask ((const __v16sf
*) __P
,
4434 static __inline __m512 __DEFAULT_FN_ATTRS512
4435 _mm512_maskz_load_ps(__mmask16 __U
, void const *__P
)
4437 return (__m512
) __builtin_ia32_loadaps512_mask ((const __v16sf
*)__P
,
4439 _mm512_setzero_ps (),
4443 static __inline __m512d __DEFAULT_FN_ATTRS512
4444 _mm512_load_pd(void const *__p
)
4446 return *(const __m512d
*)__p
;
4449 static __inline __m512d __DEFAULT_FN_ATTRS512
4450 _mm512_mask_load_pd (__m512d __W
, __mmask8 __U
, void const *__P
)
4452 return (__m512d
) __builtin_ia32_loadapd512_mask ((const __v8df
*) __P
,
4457 static __inline __m512d __DEFAULT_FN_ATTRS512
4458 _mm512_maskz_load_pd(__mmask8 __U
, void const *__P
)
4460 return (__m512d
) __builtin_ia32_loadapd512_mask ((const __v8df
*)__P
,
4462 _mm512_setzero_pd (),
4466 static __inline __m512i __DEFAULT_FN_ATTRS512
4467 _mm512_load_si512 (void const *__P
)
4469 return *(const __m512i
*) __P
;
4472 static __inline __m512i __DEFAULT_FN_ATTRS512
4473 _mm512_load_epi32 (void const *__P
)
4475 return *(const __m512i
*) __P
;
4478 static __inline __m512i __DEFAULT_FN_ATTRS512
4479 _mm512_load_epi64 (void const *__P
)
4481 return *(const __m512i
*) __P
;
4484 /* SIMD store ops */
4486 static __inline
void __DEFAULT_FN_ATTRS512
4487 _mm512_storeu_epi64 (void *__P
, __m512i __A
)
4489 struct __storeu_epi64
{
4491 } __attribute__((__packed__
, __may_alias__
));
4492 ((struct __storeu_epi64
*)__P
)->__v
= __A
;
4495 static __inline
void __DEFAULT_FN_ATTRS512
4496 _mm512_mask_storeu_epi64(void *__P
, __mmask8 __U
, __m512i __A
)
4498 __builtin_ia32_storedqudi512_mask ((long long *)__P
, (__v8di
) __A
,
4502 static __inline
void __DEFAULT_FN_ATTRS512
4503 _mm512_storeu_si512 (void *__P
, __m512i __A
)
4505 struct __storeu_si512
{
4507 } __attribute__((__packed__
, __may_alias__
));
4508 ((struct __storeu_si512
*)__P
)->__v
= __A
;
4511 static __inline
void __DEFAULT_FN_ATTRS512
4512 _mm512_storeu_epi32 (void *__P
, __m512i __A
)
4514 struct __storeu_epi32
{
4516 } __attribute__((__packed__
, __may_alias__
));
4517 ((struct __storeu_epi32
*)__P
)->__v
= __A
;
4520 static __inline
void __DEFAULT_FN_ATTRS512
4521 _mm512_mask_storeu_epi32(void *__P
, __mmask16 __U
, __m512i __A
)
4523 __builtin_ia32_storedqusi512_mask ((int *)__P
, (__v16si
) __A
,
4527 static __inline
void __DEFAULT_FN_ATTRS512
4528 _mm512_mask_storeu_pd(void *__P
, __mmask8 __U
, __m512d __A
)
4530 __builtin_ia32_storeupd512_mask ((double *)__P
, (__v8df
) __A
, (__mmask8
) __U
);
4533 static __inline
void __DEFAULT_FN_ATTRS512
4534 _mm512_storeu_pd(void *__P
, __m512d __A
)
4536 struct __storeu_pd
{
4538 } __attribute__((__packed__
, __may_alias__
));
4539 ((struct __storeu_pd
*)__P
)->__v
= __A
;
4542 static __inline
void __DEFAULT_FN_ATTRS512
4543 _mm512_mask_storeu_ps(void *__P
, __mmask16 __U
, __m512 __A
)
4545 __builtin_ia32_storeups512_mask ((float *)__P
, (__v16sf
) __A
,
4549 static __inline
void __DEFAULT_FN_ATTRS512
4550 _mm512_storeu_ps(void *__P
, __m512 __A
)
4552 struct __storeu_ps
{
4554 } __attribute__((__packed__
, __may_alias__
));
4555 ((struct __storeu_ps
*)__P
)->__v
= __A
;
4558 static __inline
void __DEFAULT_FN_ATTRS512
4559 _mm512_mask_store_pd(void *__P
, __mmask8 __U
, __m512d __A
)
4561 __builtin_ia32_storeapd512_mask ((__v8df
*)__P
, (__v8df
) __A
, (__mmask8
) __U
);
4564 static __inline
void __DEFAULT_FN_ATTRS512
4565 _mm512_store_pd(void *__P
, __m512d __A
)
4567 *(__m512d
*)__P
= __A
;
4570 static __inline
void __DEFAULT_FN_ATTRS512
4571 _mm512_mask_store_ps(void *__P
, __mmask16 __U
, __m512 __A
)
4573 __builtin_ia32_storeaps512_mask ((__v16sf
*)__P
, (__v16sf
) __A
,
4577 static __inline
void __DEFAULT_FN_ATTRS512
4578 _mm512_store_ps(void *__P
, __m512 __A
)
4580 *(__m512
*)__P
= __A
;
4583 static __inline
void __DEFAULT_FN_ATTRS512
4584 _mm512_store_si512 (void *__P
, __m512i __A
)
4586 *(__m512i
*) __P
= __A
;
4589 static __inline
void __DEFAULT_FN_ATTRS512
4590 _mm512_store_epi32 (void *__P
, __m512i __A
)
4592 *(__m512i
*) __P
= __A
;
4595 static __inline
void __DEFAULT_FN_ATTRS512
4596 _mm512_store_epi64 (void *__P
, __m512i __A
)
4598 *(__m512i
*) __P
= __A
;
4603 static __inline __mmask16 __DEFAULT_FN_ATTRS
4604 _mm512_knot(__mmask16 __M
)
4606 return __builtin_ia32_knothi(__M
);
4609 /* Integer compare */
4611 #define _mm512_cmpeq_epi32_mask(A, B) \
4612 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_EQ)
4613 #define _mm512_mask_cmpeq_epi32_mask(k, A, B) \
4614 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_EQ)
4615 #define _mm512_cmpge_epi32_mask(A, B) \
4616 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GE)
4617 #define _mm512_mask_cmpge_epi32_mask(k, A, B) \
4618 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GE)
4619 #define _mm512_cmpgt_epi32_mask(A, B) \
4620 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_GT)
4621 #define _mm512_mask_cmpgt_epi32_mask(k, A, B) \
4622 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_GT)
4623 #define _mm512_cmple_epi32_mask(A, B) \
4624 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LE)
4625 #define _mm512_mask_cmple_epi32_mask(k, A, B) \
4626 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LE)
4627 #define _mm512_cmplt_epi32_mask(A, B) \
4628 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_LT)
4629 #define _mm512_mask_cmplt_epi32_mask(k, A, B) \
4630 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_LT)
4631 #define _mm512_cmpneq_epi32_mask(A, B) \
4632 _mm512_cmp_epi32_mask((A), (B), _MM_CMPINT_NE)
4633 #define _mm512_mask_cmpneq_epi32_mask(k, A, B) \
4634 _mm512_mask_cmp_epi32_mask((k), (A), (B), _MM_CMPINT_NE)
4636 #define _mm512_cmpeq_epu32_mask(A, B) \
4637 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_EQ)
4638 #define _mm512_mask_cmpeq_epu32_mask(k, A, B) \
4639 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_EQ)
4640 #define _mm512_cmpge_epu32_mask(A, B) \
4641 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GE)
4642 #define _mm512_mask_cmpge_epu32_mask(k, A, B) \
4643 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GE)
4644 #define _mm512_cmpgt_epu32_mask(A, B) \
4645 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_GT)
4646 #define _mm512_mask_cmpgt_epu32_mask(k, A, B) \
4647 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_GT)
4648 #define _mm512_cmple_epu32_mask(A, B) \
4649 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LE)
4650 #define _mm512_mask_cmple_epu32_mask(k, A, B) \
4651 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LE)
4652 #define _mm512_cmplt_epu32_mask(A, B) \
4653 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_LT)
4654 #define _mm512_mask_cmplt_epu32_mask(k, A, B) \
4655 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_LT)
4656 #define _mm512_cmpneq_epu32_mask(A, B) \
4657 _mm512_cmp_epu32_mask((A), (B), _MM_CMPINT_NE)
4658 #define _mm512_mask_cmpneq_epu32_mask(k, A, B) \
4659 _mm512_mask_cmp_epu32_mask((k), (A), (B), _MM_CMPINT_NE)
4661 #define _mm512_cmpeq_epi64_mask(A, B) \
4662 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_EQ)
4663 #define _mm512_mask_cmpeq_epi64_mask(k, A, B) \
4664 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_EQ)
4665 #define _mm512_cmpge_epi64_mask(A, B) \
4666 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GE)
4667 #define _mm512_mask_cmpge_epi64_mask(k, A, B) \
4668 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GE)
4669 #define _mm512_cmpgt_epi64_mask(A, B) \
4670 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_GT)
4671 #define _mm512_mask_cmpgt_epi64_mask(k, A, B) \
4672 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_GT)
4673 #define _mm512_cmple_epi64_mask(A, B) \
4674 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LE)
4675 #define _mm512_mask_cmple_epi64_mask(k, A, B) \
4676 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LE)
4677 #define _mm512_cmplt_epi64_mask(A, B) \
4678 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_LT)
4679 #define _mm512_mask_cmplt_epi64_mask(k, A, B) \
4680 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_LT)
4681 #define _mm512_cmpneq_epi64_mask(A, B) \
4682 _mm512_cmp_epi64_mask((A), (B), _MM_CMPINT_NE)
4683 #define _mm512_mask_cmpneq_epi64_mask(k, A, B) \
4684 _mm512_mask_cmp_epi64_mask((k), (A), (B), _MM_CMPINT_NE)
4686 #define _mm512_cmpeq_epu64_mask(A, B) \
4687 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_EQ)
4688 #define _mm512_mask_cmpeq_epu64_mask(k, A, B) \
4689 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_EQ)
4690 #define _mm512_cmpge_epu64_mask(A, B) \
4691 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GE)
4692 #define _mm512_mask_cmpge_epu64_mask(k, A, B) \
4693 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GE)
4694 #define _mm512_cmpgt_epu64_mask(A, B) \
4695 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_GT)
4696 #define _mm512_mask_cmpgt_epu64_mask(k, A, B) \
4697 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_GT)
4698 #define _mm512_cmple_epu64_mask(A, B) \
4699 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LE)
4700 #define _mm512_mask_cmple_epu64_mask(k, A, B) \
4701 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LE)
4702 #define _mm512_cmplt_epu64_mask(A, B) \
4703 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_LT)
4704 #define _mm512_mask_cmplt_epu64_mask(k, A, B) \
4705 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_LT)
4706 #define _mm512_cmpneq_epu64_mask(A, B) \
4707 _mm512_cmp_epu64_mask((A), (B), _MM_CMPINT_NE)
4708 #define _mm512_mask_cmpneq_epu64_mask(k, A, B) \
4709 _mm512_mask_cmp_epu64_mask((k), (A), (B), _MM_CMPINT_NE)
4711 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4712 _mm512_cvtepi8_epi32(__m128i __A
)
4714 /* This function always performs a signed extension, but __v16qi is a char
4715 which may be signed or unsigned, so use __v16qs. */
4716 return (__m512i
)__builtin_convertvector((__v16qs
)__A
, __v16si
);
4719 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4720 _mm512_mask_cvtepi8_epi32(__m512i __W
, __mmask16 __U
, __m128i __A
)
4722 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4723 (__v16si
)_mm512_cvtepi8_epi32(__A
),
4727 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4728 _mm512_maskz_cvtepi8_epi32(__mmask16 __U
, __m128i __A
)
4730 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4731 (__v16si
)_mm512_cvtepi8_epi32(__A
),
4732 (__v16si
)_mm512_setzero_si512());
4735 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4736 _mm512_cvtepi8_epi64(__m128i __A
)
4738 /* This function always performs a signed extension, but __v16qi is a char
4739 which may be signed or unsigned, so use __v16qs. */
4740 return (__m512i
)__builtin_convertvector(__builtin_shufflevector((__v16qs
)__A
, (__v16qs
)__A
, 0, 1, 2, 3, 4, 5, 6, 7), __v8di
);
4743 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4744 _mm512_mask_cvtepi8_epi64(__m512i __W
, __mmask8 __U
, __m128i __A
)
4746 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4747 (__v8di
)_mm512_cvtepi8_epi64(__A
),
4751 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4752 _mm512_maskz_cvtepi8_epi64(__mmask8 __U
, __m128i __A
)
4754 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4755 (__v8di
)_mm512_cvtepi8_epi64(__A
),
4756 (__v8di
)_mm512_setzero_si512 ());
4759 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4760 _mm512_cvtepi32_epi64(__m256i __X
)
4762 return (__m512i
)__builtin_convertvector((__v8si
)__X
, __v8di
);
4765 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4766 _mm512_mask_cvtepi32_epi64(__m512i __W
, __mmask8 __U
, __m256i __X
)
4768 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4769 (__v8di
)_mm512_cvtepi32_epi64(__X
),
4773 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4774 _mm512_maskz_cvtepi32_epi64(__mmask8 __U
, __m256i __X
)
4776 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4777 (__v8di
)_mm512_cvtepi32_epi64(__X
),
4778 (__v8di
)_mm512_setzero_si512());
4781 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4782 _mm512_cvtepi16_epi32(__m256i __A
)
4784 return (__m512i
)__builtin_convertvector((__v16hi
)__A
, __v16si
);
4787 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4788 _mm512_mask_cvtepi16_epi32(__m512i __W
, __mmask16 __U
, __m256i __A
)
4790 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4791 (__v16si
)_mm512_cvtepi16_epi32(__A
),
4795 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4796 _mm512_maskz_cvtepi16_epi32(__mmask16 __U
, __m256i __A
)
4798 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4799 (__v16si
)_mm512_cvtepi16_epi32(__A
),
4800 (__v16si
)_mm512_setzero_si512 ());
4803 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4804 _mm512_cvtepi16_epi64(__m128i __A
)
4806 return (__m512i
)__builtin_convertvector((__v8hi
)__A
, __v8di
);
4809 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4810 _mm512_mask_cvtepi16_epi64(__m512i __W
, __mmask8 __U
, __m128i __A
)
4812 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4813 (__v8di
)_mm512_cvtepi16_epi64(__A
),
4817 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4818 _mm512_maskz_cvtepi16_epi64(__mmask8 __U
, __m128i __A
)
4820 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4821 (__v8di
)_mm512_cvtepi16_epi64(__A
),
4822 (__v8di
)_mm512_setzero_si512());
4825 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4826 _mm512_cvtepu8_epi32(__m128i __A
)
4828 return (__m512i
)__builtin_convertvector((__v16qu
)__A
, __v16si
);
4831 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4832 _mm512_mask_cvtepu8_epi32(__m512i __W
, __mmask16 __U
, __m128i __A
)
4834 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4835 (__v16si
)_mm512_cvtepu8_epi32(__A
),
4839 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4840 _mm512_maskz_cvtepu8_epi32(__mmask16 __U
, __m128i __A
)
4842 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4843 (__v16si
)_mm512_cvtepu8_epi32(__A
),
4844 (__v16si
)_mm512_setzero_si512());
4847 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4848 _mm512_cvtepu8_epi64(__m128i __A
)
4850 return (__m512i
)__builtin_convertvector(__builtin_shufflevector((__v16qu
)__A
, (__v16qu
)__A
, 0, 1, 2, 3, 4, 5, 6, 7), __v8di
);
4853 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4854 _mm512_mask_cvtepu8_epi64(__m512i __W
, __mmask8 __U
, __m128i __A
)
4856 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4857 (__v8di
)_mm512_cvtepu8_epi64(__A
),
4861 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4862 _mm512_maskz_cvtepu8_epi64(__mmask8 __U
, __m128i __A
)
4864 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4865 (__v8di
)_mm512_cvtepu8_epi64(__A
),
4866 (__v8di
)_mm512_setzero_si512());
4869 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4870 _mm512_cvtepu32_epi64(__m256i __X
)
4872 return (__m512i
)__builtin_convertvector((__v8su
)__X
, __v8di
);
4875 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4876 _mm512_mask_cvtepu32_epi64(__m512i __W
, __mmask8 __U
, __m256i __X
)
4878 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4879 (__v8di
)_mm512_cvtepu32_epi64(__X
),
4883 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4884 _mm512_maskz_cvtepu32_epi64(__mmask8 __U
, __m256i __X
)
4886 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4887 (__v8di
)_mm512_cvtepu32_epi64(__X
),
4888 (__v8di
)_mm512_setzero_si512());
4891 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4892 _mm512_cvtepu16_epi32(__m256i __A
)
4894 return (__m512i
)__builtin_convertvector((__v16hu
)__A
, __v16si
);
4897 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4898 _mm512_mask_cvtepu16_epi32(__m512i __W
, __mmask16 __U
, __m256i __A
)
4900 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4901 (__v16si
)_mm512_cvtepu16_epi32(__A
),
4905 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4906 _mm512_maskz_cvtepu16_epi32(__mmask16 __U
, __m256i __A
)
4908 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
4909 (__v16si
)_mm512_cvtepu16_epi32(__A
),
4910 (__v16si
)_mm512_setzero_si512());
4913 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4914 _mm512_cvtepu16_epi64(__m128i __A
)
4916 return (__m512i
)__builtin_convertvector((__v8hu
)__A
, __v8di
);
4919 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4920 _mm512_mask_cvtepu16_epi64(__m512i __W
, __mmask8 __U
, __m128i __A
)
4922 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4923 (__v8di
)_mm512_cvtepu16_epi64(__A
),
4927 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4928 _mm512_maskz_cvtepu16_epi64(__mmask8 __U
, __m128i __A
)
4930 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
4931 (__v8di
)_mm512_cvtepu16_epi64(__A
),
4932 (__v8di
)_mm512_setzero_si512());
4935 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4936 _mm512_rorv_epi32 (__m512i __A
, __m512i __B
)
4938 return (__m512i
)__builtin_ia32_prorvd512((__v16si
)__A
, (__v16si
)__B
);
4941 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4942 _mm512_mask_rorv_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
4944 return (__m512i
)__builtin_ia32_selectd_512(__U
,
4945 (__v16si
)_mm512_rorv_epi32(__A
, __B
),
4949 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4950 _mm512_maskz_rorv_epi32 (__mmask16 __U
, __m512i __A
, __m512i __B
)
4952 return (__m512i
)__builtin_ia32_selectd_512(__U
,
4953 (__v16si
)_mm512_rorv_epi32(__A
, __B
),
4954 (__v16si
)_mm512_setzero_si512());
4957 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4958 _mm512_rorv_epi64 (__m512i __A
, __m512i __B
)
4960 return (__m512i
)__builtin_ia32_prorvq512((__v8di
)__A
, (__v8di
)__B
);
4963 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4964 _mm512_mask_rorv_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
4966 return (__m512i
)__builtin_ia32_selectq_512(__U
,
4967 (__v8di
)_mm512_rorv_epi64(__A
, __B
),
4971 static __inline__ __m512i __DEFAULT_FN_ATTRS512
4972 _mm512_maskz_rorv_epi64 (__mmask8 __U
, __m512i __A
, __m512i __B
)
4974 return (__m512i
)__builtin_ia32_selectq_512(__U
,
4975 (__v8di
)_mm512_rorv_epi64(__A
, __B
),
4976 (__v8di
)_mm512_setzero_si512());
4981 #define _mm512_cmp_epi32_mask(a, b, p) \
4982 ((__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \
4983 (__v16si)(__m512i)(b), (int)(p), \
4986 #define _mm512_cmp_epu32_mask(a, b, p) \
4987 ((__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \
4988 (__v16si)(__m512i)(b), (int)(p), \
4991 #define _mm512_cmp_epi64_mask(a, b, p) \
4992 ((__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \
4993 (__v8di)(__m512i)(b), (int)(p), \
4996 #define _mm512_cmp_epu64_mask(a, b, p) \
4997 ((__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \
4998 (__v8di)(__m512i)(b), (int)(p), \
5001 #define _mm512_mask_cmp_epi32_mask(m, a, b, p) \
5002 ((__mmask16)__builtin_ia32_cmpd512_mask((__v16si)(__m512i)(a), \
5003 (__v16si)(__m512i)(b), (int)(p), \
5006 #define _mm512_mask_cmp_epu32_mask(m, a, b, p) \
5007 ((__mmask16)__builtin_ia32_ucmpd512_mask((__v16si)(__m512i)(a), \
5008 (__v16si)(__m512i)(b), (int)(p), \
5011 #define _mm512_mask_cmp_epi64_mask(m, a, b, p) \
5012 ((__mmask8)__builtin_ia32_cmpq512_mask((__v8di)(__m512i)(a), \
5013 (__v8di)(__m512i)(b), (int)(p), \
5016 #define _mm512_mask_cmp_epu64_mask(m, a, b, p) \
5017 ((__mmask8)__builtin_ia32_ucmpq512_mask((__v8di)(__m512i)(a), \
5018 (__v8di)(__m512i)(b), (int)(p), \
5021 #define _mm512_rol_epi32(a, b) \
5022 ((__m512i)__builtin_ia32_prold512((__v16si)(__m512i)(a), (int)(b)))
5024 #define _mm512_mask_rol_epi32(W, U, a, b) \
5025 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5026 (__v16si)_mm512_rol_epi32((a), (b)), \
5027 (__v16si)(__m512i)(W)))
5029 #define _mm512_maskz_rol_epi32(U, a, b) \
5030 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5031 (__v16si)_mm512_rol_epi32((a), (b)), \
5032 (__v16si)_mm512_setzero_si512()))
5034 #define _mm512_rol_epi64(a, b) \
5035 ((__m512i)__builtin_ia32_prolq512((__v8di)(__m512i)(a), (int)(b)))
5037 #define _mm512_mask_rol_epi64(W, U, a, b) \
5038 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5039 (__v8di)_mm512_rol_epi64((a), (b)), \
5040 (__v8di)(__m512i)(W)))
5042 #define _mm512_maskz_rol_epi64(U, a, b) \
5043 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5044 (__v8di)_mm512_rol_epi64((a), (b)), \
5045 (__v8di)_mm512_setzero_si512()))
5047 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5048 _mm512_rolv_epi32 (__m512i __A
, __m512i __B
)
5050 return (__m512i
)__builtin_ia32_prolvd512((__v16si
)__A
, (__v16si
)__B
);
5053 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5054 _mm512_mask_rolv_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
, __m512i __B
)
5056 return (__m512i
)__builtin_ia32_selectd_512(__U
,
5057 (__v16si
)_mm512_rolv_epi32(__A
, __B
),
5061 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5062 _mm512_maskz_rolv_epi32 (__mmask16 __U
, __m512i __A
, __m512i __B
)
5064 return (__m512i
)__builtin_ia32_selectd_512(__U
,
5065 (__v16si
)_mm512_rolv_epi32(__A
, __B
),
5066 (__v16si
)_mm512_setzero_si512());
5069 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5070 _mm512_rolv_epi64 (__m512i __A
, __m512i __B
)
5072 return (__m512i
)__builtin_ia32_prolvq512((__v8di
)__A
, (__v8di
)__B
);
5075 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5076 _mm512_mask_rolv_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
, __m512i __B
)
5078 return (__m512i
)__builtin_ia32_selectq_512(__U
,
5079 (__v8di
)_mm512_rolv_epi64(__A
, __B
),
5083 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5084 _mm512_maskz_rolv_epi64 (__mmask8 __U
, __m512i __A
, __m512i __B
)
5086 return (__m512i
)__builtin_ia32_selectq_512(__U
,
5087 (__v8di
)_mm512_rolv_epi64(__A
, __B
),
5088 (__v8di
)_mm512_setzero_si512());
5091 #define _mm512_ror_epi32(A, B) \
5092 ((__m512i)__builtin_ia32_prord512((__v16si)(__m512i)(A), (int)(B)))
5094 #define _mm512_mask_ror_epi32(W, U, A, B) \
5095 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5096 (__v16si)_mm512_ror_epi32((A), (B)), \
5097 (__v16si)(__m512i)(W)))
5099 #define _mm512_maskz_ror_epi32(U, A, B) \
5100 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
5101 (__v16si)_mm512_ror_epi32((A), (B)), \
5102 (__v16si)_mm512_setzero_si512()))
5104 #define _mm512_ror_epi64(A, B) \
5105 ((__m512i)__builtin_ia32_prorq512((__v8di)(__m512i)(A), (int)(B)))
5107 #define _mm512_mask_ror_epi64(W, U, A, B) \
5108 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5109 (__v8di)_mm512_ror_epi64((A), (B)), \
5110 (__v8di)(__m512i)(W)))
5112 #define _mm512_maskz_ror_epi64(U, A, B) \
5113 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
5114 (__v8di)_mm512_ror_epi64((A), (B)), \
5115 (__v8di)_mm512_setzero_si512()))
5117 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5118 _mm512_slli_epi32(__m512i __A
, unsigned int __B
)
5120 return (__m512i
)__builtin_ia32_pslldi512((__v16si
)__A
, (int)__B
);
5123 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5124 _mm512_mask_slli_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
,
5127 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5128 (__v16si
)_mm512_slli_epi32(__A
, __B
),
5132 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5133 _mm512_maskz_slli_epi32(__mmask16 __U
, __m512i __A
, unsigned int __B
) {
5134 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5135 (__v16si
)_mm512_slli_epi32(__A
, __B
),
5136 (__v16si
)_mm512_setzero_si512());
5139 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5140 _mm512_slli_epi64(__m512i __A
, unsigned int __B
)
5142 return (__m512i
)__builtin_ia32_psllqi512((__v8di
)__A
, (int)__B
);
5145 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5146 _mm512_mask_slli_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, unsigned int __B
)
5148 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5149 (__v8di
)_mm512_slli_epi64(__A
, __B
),
5153 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5154 _mm512_maskz_slli_epi64(__mmask8 __U
, __m512i __A
, unsigned int __B
)
5156 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5157 (__v8di
)_mm512_slli_epi64(__A
, __B
),
5158 (__v8di
)_mm512_setzero_si512());
5161 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5162 _mm512_srli_epi32(__m512i __A
, unsigned int __B
)
5164 return (__m512i
)__builtin_ia32_psrldi512((__v16si
)__A
, (int)__B
);
5167 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5168 _mm512_mask_srli_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
,
5171 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5172 (__v16si
)_mm512_srli_epi32(__A
, __B
),
5176 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5177 _mm512_maskz_srli_epi32(__mmask16 __U
, __m512i __A
, unsigned int __B
) {
5178 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5179 (__v16si
)_mm512_srli_epi32(__A
, __B
),
5180 (__v16si
)_mm512_setzero_si512());
5183 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5184 _mm512_srli_epi64(__m512i __A
, unsigned int __B
)
5186 return (__m512i
)__builtin_ia32_psrlqi512((__v8di
)__A
, (int)__B
);
5189 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5190 _mm512_mask_srli_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
,
5193 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5194 (__v8di
)_mm512_srli_epi64(__A
, __B
),
5198 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5199 _mm512_maskz_srli_epi64(__mmask8 __U
, __m512i __A
,
5202 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5203 (__v8di
)_mm512_srli_epi64(__A
, __B
),
5204 (__v8di
)_mm512_setzero_si512());
5207 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5208 _mm512_mask_load_epi32 (__m512i __W
, __mmask16 __U
, void const *__P
)
5210 return (__m512i
) __builtin_ia32_movdqa32load512_mask ((const __v16si
*) __P
,
5215 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5216 _mm512_maskz_load_epi32 (__mmask16 __U
, void const *__P
)
5218 return (__m512i
) __builtin_ia32_movdqa32load512_mask ((const __v16si
*) __P
,
5220 _mm512_setzero_si512 (),
5224 static __inline__
void __DEFAULT_FN_ATTRS512
5225 _mm512_mask_store_epi32 (void *__P
, __mmask16 __U
, __m512i __A
)
5227 __builtin_ia32_movdqa32store512_mask ((__v16si
*) __P
, (__v16si
) __A
,
5231 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5232 _mm512_mask_mov_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
5234 return (__m512i
) __builtin_ia32_selectd_512 ((__mmask16
) __U
,
5239 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5240 _mm512_maskz_mov_epi32 (__mmask16 __U
, __m512i __A
)
5242 return (__m512i
) __builtin_ia32_selectd_512 ((__mmask16
) __U
,
5244 (__v16si
) _mm512_setzero_si512 ());
5247 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5248 _mm512_mask_mov_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
5250 return (__m512i
) __builtin_ia32_selectq_512 ((__mmask8
) __U
,
5255 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5256 _mm512_maskz_mov_epi64 (__mmask8 __U
, __m512i __A
)
5258 return (__m512i
) __builtin_ia32_selectq_512 ((__mmask8
) __U
,
5260 (__v8di
) _mm512_setzero_si512 ());
5263 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5264 _mm512_mask_load_epi64 (__m512i __W
, __mmask8 __U
, void const *__P
)
5266 return (__m512i
) __builtin_ia32_movdqa64load512_mask ((const __v8di
*) __P
,
5271 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5272 _mm512_maskz_load_epi64 (__mmask8 __U
, void const *__P
)
5274 return (__m512i
) __builtin_ia32_movdqa64load512_mask ((const __v8di
*) __P
,
5276 _mm512_setzero_si512 (),
5280 static __inline__
void __DEFAULT_FN_ATTRS512
5281 _mm512_mask_store_epi64 (void *__P
, __mmask8 __U
, __m512i __A
)
5283 __builtin_ia32_movdqa64store512_mask ((__v8di
*) __P
, (__v8di
) __A
,
5287 static __inline__ __m512d __DEFAULT_FN_ATTRS512
5288 _mm512_movedup_pd (__m512d __A
)
5290 return (__m512d
)__builtin_shufflevector((__v8df
)__A
, (__v8df
)__A
,
5291 0, 0, 2, 2, 4, 4, 6, 6);
5294 static __inline__ __m512d __DEFAULT_FN_ATTRS512
5295 _mm512_mask_movedup_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
5297 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
5298 (__v8df
)_mm512_movedup_pd(__A
),
5302 static __inline__ __m512d __DEFAULT_FN_ATTRS512
5303 _mm512_maskz_movedup_pd (__mmask8 __U
, __m512d __A
)
5305 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
5306 (__v8df
)_mm512_movedup_pd(__A
),
5307 (__v8df
)_mm512_setzero_pd());
5310 #define _mm512_fixupimm_round_pd(A, B, C, imm, R) \
5311 ((__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \
5312 (__v8df)(__m512d)(B), \
5313 (__v8di)(__m512i)(C), (int)(imm), \
5314 (__mmask8)-1, (int)(R)))
5316 #define _mm512_mask_fixupimm_round_pd(A, U, B, C, imm, R) \
5317 ((__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \
5318 (__v8df)(__m512d)(B), \
5319 (__v8di)(__m512i)(C), (int)(imm), \
5320 (__mmask8)(U), (int)(R)))
5322 #define _mm512_fixupimm_pd(A, B, C, imm) \
5323 ((__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \
5324 (__v8df)(__m512d)(B), \
5325 (__v8di)(__m512i)(C), (int)(imm), \
5327 _MM_FROUND_CUR_DIRECTION))
5329 #define _mm512_mask_fixupimm_pd(A, U, B, C, imm) \
5330 ((__m512d)__builtin_ia32_fixupimmpd512_mask((__v8df)(__m512d)(A), \
5331 (__v8df)(__m512d)(B), \
5332 (__v8di)(__m512i)(C), (int)(imm), \
5334 _MM_FROUND_CUR_DIRECTION))
5336 #define _mm512_maskz_fixupimm_round_pd(U, A, B, C, imm, R) \
5337 ((__m512d)__builtin_ia32_fixupimmpd512_maskz((__v8df)(__m512d)(A), \
5338 (__v8df)(__m512d)(B), \
5339 (__v8di)(__m512i)(C), \
5340 (int)(imm), (__mmask8)(U), \
5343 #define _mm512_maskz_fixupimm_pd(U, A, B, C, imm) \
5344 ((__m512d)__builtin_ia32_fixupimmpd512_maskz((__v8df)(__m512d)(A), \
5345 (__v8df)(__m512d)(B), \
5346 (__v8di)(__m512i)(C), \
5347 (int)(imm), (__mmask8)(U), \
5348 _MM_FROUND_CUR_DIRECTION))
5350 #define _mm512_fixupimm_round_ps(A, B, C, imm, R) \
5351 ((__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \
5352 (__v16sf)(__m512)(B), \
5353 (__v16si)(__m512i)(C), (int)(imm), \
5354 (__mmask16)-1, (int)(R)))
5356 #define _mm512_mask_fixupimm_round_ps(A, U, B, C, imm, R) \
5357 ((__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \
5358 (__v16sf)(__m512)(B), \
5359 (__v16si)(__m512i)(C), (int)(imm), \
5360 (__mmask16)(U), (int)(R)))
5362 #define _mm512_fixupimm_ps(A, B, C, imm) \
5363 ((__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \
5364 (__v16sf)(__m512)(B), \
5365 (__v16si)(__m512i)(C), (int)(imm), \
5367 _MM_FROUND_CUR_DIRECTION))
5369 #define _mm512_mask_fixupimm_ps(A, U, B, C, imm) \
5370 ((__m512)__builtin_ia32_fixupimmps512_mask((__v16sf)(__m512)(A), \
5371 (__v16sf)(__m512)(B), \
5372 (__v16si)(__m512i)(C), (int)(imm), \
5374 _MM_FROUND_CUR_DIRECTION))
5376 #define _mm512_maskz_fixupimm_round_ps(U, A, B, C, imm, R) \
5377 ((__m512)__builtin_ia32_fixupimmps512_maskz((__v16sf)(__m512)(A), \
5378 (__v16sf)(__m512)(B), \
5379 (__v16si)(__m512i)(C), \
5380 (int)(imm), (__mmask16)(U), \
5383 #define _mm512_maskz_fixupimm_ps(U, A, B, C, imm) \
5384 ((__m512)__builtin_ia32_fixupimmps512_maskz((__v16sf)(__m512)(A), \
5385 (__v16sf)(__m512)(B), \
5386 (__v16si)(__m512i)(C), \
5387 (int)(imm), (__mmask16)(U), \
5388 _MM_FROUND_CUR_DIRECTION))
5390 #define _mm_fixupimm_round_sd(A, B, C, imm, R) \
5391 ((__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \
5392 (__v2df)(__m128d)(B), \
5393 (__v2di)(__m128i)(C), (int)(imm), \
5394 (__mmask8)-1, (int)(R)))
5396 #define _mm_mask_fixupimm_round_sd(A, U, B, C, imm, R) \
5397 ((__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \
5398 (__v2df)(__m128d)(B), \
5399 (__v2di)(__m128i)(C), (int)(imm), \
5400 (__mmask8)(U), (int)(R)))
5402 #define _mm_fixupimm_sd(A, B, C, imm) \
5403 ((__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \
5404 (__v2df)(__m128d)(B), \
5405 (__v2di)(__m128i)(C), (int)(imm), \
5407 _MM_FROUND_CUR_DIRECTION))
5409 #define _mm_mask_fixupimm_sd(A, U, B, C, imm) \
5410 ((__m128d)__builtin_ia32_fixupimmsd_mask((__v2df)(__m128d)(A), \
5411 (__v2df)(__m128d)(B), \
5412 (__v2di)(__m128i)(C), (int)(imm), \
5414 _MM_FROUND_CUR_DIRECTION))
5416 #define _mm_maskz_fixupimm_round_sd(U, A, B, C, imm, R) \
5417 ((__m128d)__builtin_ia32_fixupimmsd_maskz((__v2df)(__m128d)(A), \
5418 (__v2df)(__m128d)(B), \
5419 (__v2di)(__m128i)(C), (int)(imm), \
5420 (__mmask8)(U), (int)(R)))
5422 #define _mm_maskz_fixupimm_sd(U, A, B, C, imm) \
5423 ((__m128d)__builtin_ia32_fixupimmsd_maskz((__v2df)(__m128d)(A), \
5424 (__v2df)(__m128d)(B), \
5425 (__v2di)(__m128i)(C), (int)(imm), \
5427 _MM_FROUND_CUR_DIRECTION))
5429 #define _mm_fixupimm_round_ss(A, B, C, imm, R) \
5430 ((__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \
5431 (__v4sf)(__m128)(B), \
5432 (__v4si)(__m128i)(C), (int)(imm), \
5433 (__mmask8)-1, (int)(R)))
5435 #define _mm_mask_fixupimm_round_ss(A, U, B, C, imm, R) \
5436 ((__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \
5437 (__v4sf)(__m128)(B), \
5438 (__v4si)(__m128i)(C), (int)(imm), \
5439 (__mmask8)(U), (int)(R)))
5441 #define _mm_fixupimm_ss(A, B, C, imm) \
5442 ((__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \
5443 (__v4sf)(__m128)(B), \
5444 (__v4si)(__m128i)(C), (int)(imm), \
5446 _MM_FROUND_CUR_DIRECTION))
5448 #define _mm_mask_fixupimm_ss(A, U, B, C, imm) \
5449 ((__m128)__builtin_ia32_fixupimmss_mask((__v4sf)(__m128)(A), \
5450 (__v4sf)(__m128)(B), \
5451 (__v4si)(__m128i)(C), (int)(imm), \
5453 _MM_FROUND_CUR_DIRECTION))
5455 #define _mm_maskz_fixupimm_round_ss(U, A, B, C, imm, R) \
5456 ((__m128)__builtin_ia32_fixupimmss_maskz((__v4sf)(__m128)(A), \
5457 (__v4sf)(__m128)(B), \
5458 (__v4si)(__m128i)(C), (int)(imm), \
5459 (__mmask8)(U), (int)(R)))
5461 #define _mm_maskz_fixupimm_ss(U, A, B, C, imm) \
5462 ((__m128)__builtin_ia32_fixupimmss_maskz((__v4sf)(__m128)(A), \
5463 (__v4sf)(__m128)(B), \
5464 (__v4si)(__m128i)(C), (int)(imm), \
5466 _MM_FROUND_CUR_DIRECTION))
5468 #define _mm_getexp_round_sd(A, B, R) \
5469 ((__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \
5470 (__v2df)(__m128d)(B), \
5471 (__v2df)_mm_setzero_pd(), \
5472 (__mmask8)-1, (int)(R)))
5475 static __inline__ __m128d __DEFAULT_FN_ATTRS128
5476 _mm_getexp_sd (__m128d __A
, __m128d __B
)
5478 return (__m128d
) __builtin_ia32_getexpsd128_round_mask ((__v2df
) __A
,
5479 (__v2df
) __B
, (__v2df
) _mm_setzero_pd(), (__mmask8
) -1, _MM_FROUND_CUR_DIRECTION
);
5482 static __inline__ __m128d __DEFAULT_FN_ATTRS128
5483 _mm_mask_getexp_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
5485 return (__m128d
) __builtin_ia32_getexpsd128_round_mask ( (__v2df
) __A
,
5489 _MM_FROUND_CUR_DIRECTION
);
5492 #define _mm_mask_getexp_round_sd(W, U, A, B, R) \
5493 ((__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \
5494 (__v2df)(__m128d)(B), \
5495 (__v2df)(__m128d)(W), \
5496 (__mmask8)(U), (int)(R)))
5498 static __inline__ __m128d __DEFAULT_FN_ATTRS128
5499 _mm_maskz_getexp_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
5501 return (__m128d
) __builtin_ia32_getexpsd128_round_mask ( (__v2df
) __A
,
5503 (__v2df
) _mm_setzero_pd (),
5505 _MM_FROUND_CUR_DIRECTION
);
5508 #define _mm_maskz_getexp_round_sd(U, A, B, R) \
5509 ((__m128d)__builtin_ia32_getexpsd128_round_mask((__v2df)(__m128d)(A), \
5510 (__v2df)(__m128d)(B), \
5511 (__v2df)_mm_setzero_pd(), \
5512 (__mmask8)(U), (int)(R)))
5514 #define _mm_getexp_round_ss(A, B, R) \
5515 ((__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \
5516 (__v4sf)(__m128)(B), \
5517 (__v4sf)_mm_setzero_ps(), \
5518 (__mmask8)-1, (int)(R)))
5520 static __inline__ __m128 __DEFAULT_FN_ATTRS128
5521 _mm_getexp_ss (__m128 __A
, __m128 __B
)
5523 return (__m128
) __builtin_ia32_getexpss128_round_mask ((__v4sf
) __A
,
5524 (__v4sf
) __B
, (__v4sf
) _mm_setzero_ps(), (__mmask8
) -1, _MM_FROUND_CUR_DIRECTION
);
5527 static __inline__ __m128 __DEFAULT_FN_ATTRS128
5528 _mm_mask_getexp_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
5530 return (__m128
) __builtin_ia32_getexpss128_round_mask ((__v4sf
) __A
,
5534 _MM_FROUND_CUR_DIRECTION
);
5537 #define _mm_mask_getexp_round_ss(W, U, A, B, R) \
5538 ((__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \
5539 (__v4sf)(__m128)(B), \
5540 (__v4sf)(__m128)(W), \
5541 (__mmask8)(U), (int)(R)))
5543 static __inline__ __m128 __DEFAULT_FN_ATTRS128
5544 _mm_maskz_getexp_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
5546 return (__m128
) __builtin_ia32_getexpss128_round_mask ((__v4sf
) __A
,
5548 (__v4sf
) _mm_setzero_ps (),
5550 _MM_FROUND_CUR_DIRECTION
);
5553 #define _mm_maskz_getexp_round_ss(U, A, B, R) \
5554 ((__m128)__builtin_ia32_getexpss128_round_mask((__v4sf)(__m128)(A), \
5555 (__v4sf)(__m128)(B), \
5556 (__v4sf)_mm_setzero_ps(), \
5557 (__mmask8)(U), (int)(R)))
5559 #define _mm_getmant_round_sd(A, B, C, D, R) \
5560 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5561 (__v2df)(__m128d)(B), \
5562 (int)(((D)<<2) | (C)), \
5563 (__v2df)_mm_setzero_pd(), \
5564 (__mmask8)-1, (int)(R)))
5566 #define _mm_getmant_sd(A, B, C, D) \
5567 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5568 (__v2df)(__m128d)(B), \
5569 (int)(((D)<<2) | (C)), \
5570 (__v2df)_mm_setzero_pd(), \
5572 _MM_FROUND_CUR_DIRECTION))
5574 #define _mm_mask_getmant_sd(W, U, A, B, C, D) \
5575 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5576 (__v2df)(__m128d)(B), \
5577 (int)(((D)<<2) | (C)), \
5578 (__v2df)(__m128d)(W), \
5580 _MM_FROUND_CUR_DIRECTION))
5582 #define _mm_mask_getmant_round_sd(W, U, A, B, C, D, R) \
5583 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5584 (__v2df)(__m128d)(B), \
5585 (int)(((D)<<2) | (C)), \
5586 (__v2df)(__m128d)(W), \
5587 (__mmask8)(U), (int)(R)))
5589 #define _mm_maskz_getmant_sd(U, A, B, C, D) \
5590 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5591 (__v2df)(__m128d)(B), \
5592 (int)(((D)<<2) | (C)), \
5593 (__v2df)_mm_setzero_pd(), \
5595 _MM_FROUND_CUR_DIRECTION))
5597 #define _mm_maskz_getmant_round_sd(U, A, B, C, D, R) \
5598 ((__m128d)__builtin_ia32_getmantsd_round_mask((__v2df)(__m128d)(A), \
5599 (__v2df)(__m128d)(B), \
5600 (int)(((D)<<2) | (C)), \
5601 (__v2df)_mm_setzero_pd(), \
5602 (__mmask8)(U), (int)(R)))
5604 #define _mm_getmant_round_ss(A, B, C, D, R) \
5605 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5606 (__v4sf)(__m128)(B), \
5607 (int)(((D)<<2) | (C)), \
5608 (__v4sf)_mm_setzero_ps(), \
5609 (__mmask8)-1, (int)(R)))
5611 #define _mm_getmant_ss(A, B, C, D) \
5612 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5613 (__v4sf)(__m128)(B), \
5614 (int)(((D)<<2) | (C)), \
5615 (__v4sf)_mm_setzero_ps(), \
5617 _MM_FROUND_CUR_DIRECTION))
5619 #define _mm_mask_getmant_ss(W, U, A, B, C, D) \
5620 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5621 (__v4sf)(__m128)(B), \
5622 (int)(((D)<<2) | (C)), \
5623 (__v4sf)(__m128)(W), \
5625 _MM_FROUND_CUR_DIRECTION))
5627 #define _mm_mask_getmant_round_ss(W, U, A, B, C, D, R) \
5628 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5629 (__v4sf)(__m128)(B), \
5630 (int)(((D)<<2) | (C)), \
5631 (__v4sf)(__m128)(W), \
5632 (__mmask8)(U), (int)(R)))
5634 #define _mm_maskz_getmant_ss(U, A, B, C, D) \
5635 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5636 (__v4sf)(__m128)(B), \
5637 (int)(((D)<<2) | (C)), \
5638 (__v4sf)_mm_setzero_ps(), \
5640 _MM_FROUND_CUR_DIRECTION))
5642 #define _mm_maskz_getmant_round_ss(U, A, B, C, D, R) \
5643 ((__m128)__builtin_ia32_getmantss_round_mask((__v4sf)(__m128)(A), \
5644 (__v4sf)(__m128)(B), \
5645 (int)(((D)<<2) | (C)), \
5646 (__v4sf)_mm_setzero_ps(), \
5647 (__mmask8)(U), (int)(R)))
5649 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
5650 _mm512_kmov (__mmask16 __A
)
5655 #define _mm_comi_round_sd(A, B, P, R) \
5656 ((int)__builtin_ia32_vcomisd((__v2df)(__m128d)(A), (__v2df)(__m128d)(B), \
5657 (int)(P), (int)(R)))
5659 #define _mm_comi_round_ss(A, B, P, R) \
5660 ((int)__builtin_ia32_vcomiss((__v4sf)(__m128)(A), (__v4sf)(__m128)(B), \
5661 (int)(P), (int)(R)))
5664 #define _mm_cvt_roundsd_si64(A, R) \
5665 ((long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)))
5668 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5669 _mm512_sll_epi32(__m512i __A
, __m128i __B
)
5671 return (__m512i
)__builtin_ia32_pslld512((__v16si
) __A
, (__v4si
)__B
);
5674 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5675 _mm512_mask_sll_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m128i __B
)
5677 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5678 (__v16si
)_mm512_sll_epi32(__A
, __B
),
5682 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5683 _mm512_maskz_sll_epi32(__mmask16 __U
, __m512i __A
, __m128i __B
)
5685 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5686 (__v16si
)_mm512_sll_epi32(__A
, __B
),
5687 (__v16si
)_mm512_setzero_si512());
5690 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5691 _mm512_sll_epi64(__m512i __A
, __m128i __B
)
5693 return (__m512i
)__builtin_ia32_psllq512((__v8di
)__A
, (__v2di
)__B
);
5696 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5697 _mm512_mask_sll_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m128i __B
)
5699 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5700 (__v8di
)_mm512_sll_epi64(__A
, __B
),
5704 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5705 _mm512_maskz_sll_epi64(__mmask8 __U
, __m512i __A
, __m128i __B
)
5707 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5708 (__v8di
)_mm512_sll_epi64(__A
, __B
),
5709 (__v8di
)_mm512_setzero_si512());
5712 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5713 _mm512_sllv_epi32(__m512i __X
, __m512i __Y
)
5715 return (__m512i
)__builtin_ia32_psllv16si((__v16si
)__X
, (__v16si
)__Y
);
5718 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5719 _mm512_mask_sllv_epi32(__m512i __W
, __mmask16 __U
, __m512i __X
, __m512i __Y
)
5721 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5722 (__v16si
)_mm512_sllv_epi32(__X
, __Y
),
5726 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5727 _mm512_maskz_sllv_epi32(__mmask16 __U
, __m512i __X
, __m512i __Y
)
5729 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5730 (__v16si
)_mm512_sllv_epi32(__X
, __Y
),
5731 (__v16si
)_mm512_setzero_si512());
5734 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5735 _mm512_sllv_epi64(__m512i __X
, __m512i __Y
)
5737 return (__m512i
)__builtin_ia32_psllv8di((__v8di
)__X
, (__v8di
)__Y
);
5740 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5741 _mm512_mask_sllv_epi64(__m512i __W
, __mmask8 __U
, __m512i __X
, __m512i __Y
)
5743 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5744 (__v8di
)_mm512_sllv_epi64(__X
, __Y
),
5748 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5749 _mm512_maskz_sllv_epi64(__mmask8 __U
, __m512i __X
, __m512i __Y
)
5751 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5752 (__v8di
)_mm512_sllv_epi64(__X
, __Y
),
5753 (__v8di
)_mm512_setzero_si512());
5756 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5757 _mm512_sra_epi32(__m512i __A
, __m128i __B
)
5759 return (__m512i
)__builtin_ia32_psrad512((__v16si
) __A
, (__v4si
)__B
);
5762 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5763 _mm512_mask_sra_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m128i __B
)
5765 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5766 (__v16si
)_mm512_sra_epi32(__A
, __B
),
5770 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5771 _mm512_maskz_sra_epi32(__mmask16 __U
, __m512i __A
, __m128i __B
)
5773 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5774 (__v16si
)_mm512_sra_epi32(__A
, __B
),
5775 (__v16si
)_mm512_setzero_si512());
5778 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5779 _mm512_sra_epi64(__m512i __A
, __m128i __B
)
5781 return (__m512i
)__builtin_ia32_psraq512((__v8di
)__A
, (__v2di
)__B
);
5784 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5785 _mm512_mask_sra_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m128i __B
)
5787 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5788 (__v8di
)_mm512_sra_epi64(__A
, __B
),
5792 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5793 _mm512_maskz_sra_epi64(__mmask8 __U
, __m512i __A
, __m128i __B
)
5795 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5796 (__v8di
)_mm512_sra_epi64(__A
, __B
),
5797 (__v8di
)_mm512_setzero_si512());
5800 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5801 _mm512_srav_epi32(__m512i __X
, __m512i __Y
)
5803 return (__m512i
)__builtin_ia32_psrav16si((__v16si
)__X
, (__v16si
)__Y
);
5806 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5807 _mm512_mask_srav_epi32(__m512i __W
, __mmask16 __U
, __m512i __X
, __m512i __Y
)
5809 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5810 (__v16si
)_mm512_srav_epi32(__X
, __Y
),
5814 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5815 _mm512_maskz_srav_epi32(__mmask16 __U
, __m512i __X
, __m512i __Y
)
5817 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5818 (__v16si
)_mm512_srav_epi32(__X
, __Y
),
5819 (__v16si
)_mm512_setzero_si512());
5822 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5823 _mm512_srav_epi64(__m512i __X
, __m512i __Y
)
5825 return (__m512i
)__builtin_ia32_psrav8di((__v8di
)__X
, (__v8di
)__Y
);
5828 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5829 _mm512_mask_srav_epi64(__m512i __W
, __mmask8 __U
, __m512i __X
, __m512i __Y
)
5831 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5832 (__v8di
)_mm512_srav_epi64(__X
, __Y
),
5836 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5837 _mm512_maskz_srav_epi64(__mmask8 __U
, __m512i __X
, __m512i __Y
)
5839 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5840 (__v8di
)_mm512_srav_epi64(__X
, __Y
),
5841 (__v8di
)_mm512_setzero_si512());
5844 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5845 _mm512_srl_epi32(__m512i __A
, __m128i __B
)
5847 return (__m512i
)__builtin_ia32_psrld512((__v16si
) __A
, (__v4si
)__B
);
5850 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5851 _mm512_mask_srl_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
, __m128i __B
)
5853 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5854 (__v16si
)_mm512_srl_epi32(__A
, __B
),
5858 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5859 _mm512_maskz_srl_epi32(__mmask16 __U
, __m512i __A
, __m128i __B
)
5861 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5862 (__v16si
)_mm512_srl_epi32(__A
, __B
),
5863 (__v16si
)_mm512_setzero_si512());
5866 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5867 _mm512_srl_epi64(__m512i __A
, __m128i __B
)
5869 return (__m512i
)__builtin_ia32_psrlq512((__v8di
)__A
, (__v2di
)__B
);
5872 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5873 _mm512_mask_srl_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, __m128i __B
)
5875 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5876 (__v8di
)_mm512_srl_epi64(__A
, __B
),
5880 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5881 _mm512_maskz_srl_epi64(__mmask8 __U
, __m512i __A
, __m128i __B
)
5883 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5884 (__v8di
)_mm512_srl_epi64(__A
, __B
),
5885 (__v8di
)_mm512_setzero_si512());
5888 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5889 _mm512_srlv_epi32(__m512i __X
, __m512i __Y
)
5891 return (__m512i
)__builtin_ia32_psrlv16si((__v16si
)__X
, (__v16si
)__Y
);
5894 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5895 _mm512_mask_srlv_epi32(__m512i __W
, __mmask16 __U
, __m512i __X
, __m512i __Y
)
5897 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5898 (__v16si
)_mm512_srlv_epi32(__X
, __Y
),
5902 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5903 _mm512_maskz_srlv_epi32(__mmask16 __U
, __m512i __X
, __m512i __Y
)
5905 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
5906 (__v16si
)_mm512_srlv_epi32(__X
, __Y
),
5907 (__v16si
)_mm512_setzero_si512());
5910 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5911 _mm512_srlv_epi64 (__m512i __X
, __m512i __Y
)
5913 return (__m512i
)__builtin_ia32_psrlv8di((__v8di
)__X
, (__v8di
)__Y
);
5916 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5917 _mm512_mask_srlv_epi64(__m512i __W
, __mmask8 __U
, __m512i __X
, __m512i __Y
)
5919 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5920 (__v8di
)_mm512_srlv_epi64(__X
, __Y
),
5924 static __inline__ __m512i __DEFAULT_FN_ATTRS512
5925 _mm512_maskz_srlv_epi64(__mmask8 __U
, __m512i __X
, __m512i __Y
)
5927 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
5928 (__v8di
)_mm512_srlv_epi64(__X
, __Y
),
5929 (__v8di
)_mm512_setzero_si512());
5932 /// \enum _MM_TERNLOG_ENUM
5933 /// A helper to represent the ternary logic operations among vector \a A,
5934 /// \a B and \a C. The representation is passed to \a imm.
5936 _MM_TERNLOG_A
= 0xF0,
5937 _MM_TERNLOG_B
= 0xCC,
5938 _MM_TERNLOG_C
= 0xAA
5941 #define _mm512_ternarylogic_epi32(A, B, C, imm) \
5942 ((__m512i)__builtin_ia32_pternlogd512_mask( \
5943 (__v16si)(__m512i)(A), (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), \
5944 (unsigned char)(imm), (__mmask16)-1))
5946 #define _mm512_mask_ternarylogic_epi32(A, U, B, C, imm) \
5947 ((__m512i)__builtin_ia32_pternlogd512_mask( \
5948 (__v16si)(__m512i)(A), (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), \
5949 (unsigned char)(imm), (__mmask16)(U)))
5951 #define _mm512_maskz_ternarylogic_epi32(U, A, B, C, imm) \
5952 ((__m512i)__builtin_ia32_pternlogd512_maskz( \
5953 (__v16si)(__m512i)(A), (__v16si)(__m512i)(B), (__v16si)(__m512i)(C), \
5954 (unsigned char)(imm), (__mmask16)(U)))
5956 #define _mm512_ternarylogic_epi64(A, B, C, imm) \
5957 ((__m512i)__builtin_ia32_pternlogq512_mask( \
5958 (__v8di)(__m512i)(A), (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), \
5959 (unsigned char)(imm), (__mmask8)-1))
5961 #define _mm512_mask_ternarylogic_epi64(A, U, B, C, imm) \
5962 ((__m512i)__builtin_ia32_pternlogq512_mask( \
5963 (__v8di)(__m512i)(A), (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), \
5964 (unsigned char)(imm), (__mmask8)(U)))
5966 #define _mm512_maskz_ternarylogic_epi64(U, A, B, C, imm) \
5967 ((__m512i)__builtin_ia32_pternlogq512_maskz( \
5968 (__v8di)(__m512i)(A), (__v8di)(__m512i)(B), (__v8di)(__m512i)(C), \
5969 (unsigned char)(imm), (__mmask8)(U)))
5972 #define _mm_cvt_roundsd_i64(A, R) \
5973 ((long long)__builtin_ia32_vcvtsd2si64((__v2df)(__m128d)(A), (int)(R)))
5976 #define _mm_cvt_roundsd_si32(A, R) \
5977 ((int)__builtin_ia32_vcvtsd2si32((__v2df)(__m128d)(A), (int)(R)))
5979 #define _mm_cvt_roundsd_i32(A, R) \
5980 ((int)__builtin_ia32_vcvtsd2si32((__v2df)(__m128d)(A), (int)(R)))
5982 #define _mm_cvt_roundsd_u32(A, R) \
5983 ((unsigned int)__builtin_ia32_vcvtsd2usi32((__v2df)(__m128d)(A), (int)(R)))
5985 static __inline__
unsigned __DEFAULT_FN_ATTRS128
5986 _mm_cvtsd_u32 (__m128d __A
)
5988 return (unsigned) __builtin_ia32_vcvtsd2usi32 ((__v2df
) __A
,
5989 _MM_FROUND_CUR_DIRECTION
);
5993 #define _mm_cvt_roundsd_u64(A, R) \
5994 ((unsigned long long)__builtin_ia32_vcvtsd2usi64((__v2df)(__m128d)(A), \
5997 static __inline__
unsigned long long __DEFAULT_FN_ATTRS128
5998 _mm_cvtsd_u64 (__m128d __A
)
6000 return (unsigned long long) __builtin_ia32_vcvtsd2usi64 ((__v2df
)
6002 _MM_FROUND_CUR_DIRECTION
);
6006 #define _mm_cvt_roundss_si32(A, R) \
6007 ((int)__builtin_ia32_vcvtss2si32((__v4sf)(__m128)(A), (int)(R)))
6009 #define _mm_cvt_roundss_i32(A, R) \
6010 ((int)__builtin_ia32_vcvtss2si32((__v4sf)(__m128)(A), (int)(R)))
6013 #define _mm_cvt_roundss_si64(A, R) \
6014 ((long long)__builtin_ia32_vcvtss2si64((__v4sf)(__m128)(A), (int)(R)))
6016 #define _mm_cvt_roundss_i64(A, R) \
6017 ((long long)__builtin_ia32_vcvtss2si64((__v4sf)(__m128)(A), (int)(R)))
6020 #define _mm_cvt_roundss_u32(A, R) \
6021 ((unsigned int)__builtin_ia32_vcvtss2usi32((__v4sf)(__m128)(A), (int)(R)))
6023 static __inline__
unsigned __DEFAULT_FN_ATTRS128
6024 _mm_cvtss_u32 (__m128 __A
)
6026 return (unsigned) __builtin_ia32_vcvtss2usi32 ((__v4sf
) __A
,
6027 _MM_FROUND_CUR_DIRECTION
);
6031 #define _mm_cvt_roundss_u64(A, R) \
6032 ((unsigned long long)__builtin_ia32_vcvtss2usi64((__v4sf)(__m128)(A), \
6035 static __inline__
unsigned long long __DEFAULT_FN_ATTRS128
6036 _mm_cvtss_u64 (__m128 __A
)
6038 return (unsigned long long) __builtin_ia32_vcvtss2usi64 ((__v4sf
)
6040 _MM_FROUND_CUR_DIRECTION
);
6044 #define _mm_cvtt_roundsd_i32(A, R) \
6045 ((int)__builtin_ia32_vcvttsd2si32((__v2df)(__m128d)(A), (int)(R)))
6047 #define _mm_cvtt_roundsd_si32(A, R) \
6048 ((int)__builtin_ia32_vcvttsd2si32((__v2df)(__m128d)(A), (int)(R)))
6050 static __inline__
int __DEFAULT_FN_ATTRS128
6051 _mm_cvttsd_i32 (__m128d __A
)
6053 return (int) __builtin_ia32_vcvttsd2si32 ((__v2df
) __A
,
6054 _MM_FROUND_CUR_DIRECTION
);
6058 #define _mm_cvtt_roundsd_si64(A, R) \
6059 ((long long)__builtin_ia32_vcvttsd2si64((__v2df)(__m128d)(A), (int)(R)))
6061 #define _mm_cvtt_roundsd_i64(A, R) \
6062 ((long long)__builtin_ia32_vcvttsd2si64((__v2df)(__m128d)(A), (int)(R)))
6064 static __inline__
long long __DEFAULT_FN_ATTRS128
6065 _mm_cvttsd_i64 (__m128d __A
)
6067 return (long long) __builtin_ia32_vcvttsd2si64 ((__v2df
) __A
,
6068 _MM_FROUND_CUR_DIRECTION
);
6072 #define _mm_cvtt_roundsd_u32(A, R) \
6073 ((unsigned int)__builtin_ia32_vcvttsd2usi32((__v2df)(__m128d)(A), (int)(R)))
6075 static __inline__
unsigned __DEFAULT_FN_ATTRS128
6076 _mm_cvttsd_u32 (__m128d __A
)
6078 return (unsigned) __builtin_ia32_vcvttsd2usi32 ((__v2df
) __A
,
6079 _MM_FROUND_CUR_DIRECTION
);
6083 #define _mm_cvtt_roundsd_u64(A, R) \
6084 ((unsigned long long)__builtin_ia32_vcvttsd2usi64((__v2df)(__m128d)(A), \
6087 static __inline__
unsigned long long __DEFAULT_FN_ATTRS128
6088 _mm_cvttsd_u64 (__m128d __A
)
6090 return (unsigned long long) __builtin_ia32_vcvttsd2usi64 ((__v2df
)
6092 _MM_FROUND_CUR_DIRECTION
);
6096 #define _mm_cvtt_roundss_i32(A, R) \
6097 ((int)__builtin_ia32_vcvttss2si32((__v4sf)(__m128)(A), (int)(R)))
6099 #define _mm_cvtt_roundss_si32(A, R) \
6100 ((int)__builtin_ia32_vcvttss2si32((__v4sf)(__m128)(A), (int)(R)))
6102 static __inline__
int __DEFAULT_FN_ATTRS128
6103 _mm_cvttss_i32 (__m128 __A
)
6105 return (int) __builtin_ia32_vcvttss2si32 ((__v4sf
) __A
,
6106 _MM_FROUND_CUR_DIRECTION
);
6110 #define _mm_cvtt_roundss_i64(A, R) \
6111 ((long long)__builtin_ia32_vcvttss2si64((__v4sf)(__m128)(A), (int)(R)))
6113 #define _mm_cvtt_roundss_si64(A, R) \
6114 ((long long)__builtin_ia32_vcvttss2si64((__v4sf)(__m128)(A), (int)(R)))
6116 static __inline__
long long __DEFAULT_FN_ATTRS128
6117 _mm_cvttss_i64 (__m128 __A
)
6119 return (long long) __builtin_ia32_vcvttss2si64 ((__v4sf
) __A
,
6120 _MM_FROUND_CUR_DIRECTION
);
6124 #define _mm_cvtt_roundss_u32(A, R) \
6125 ((unsigned int)__builtin_ia32_vcvttss2usi32((__v4sf)(__m128)(A), (int)(R)))
6127 static __inline__
unsigned __DEFAULT_FN_ATTRS128
6128 _mm_cvttss_u32 (__m128 __A
)
6130 return (unsigned) __builtin_ia32_vcvttss2usi32 ((__v4sf
) __A
,
6131 _MM_FROUND_CUR_DIRECTION
);
6135 #define _mm_cvtt_roundss_u64(A, R) \
6136 ((unsigned long long)__builtin_ia32_vcvttss2usi64((__v4sf)(__m128)(A), \
6139 static __inline__
unsigned long long __DEFAULT_FN_ATTRS128
6140 _mm_cvttss_u64 (__m128 __A
)
6142 return (unsigned long long) __builtin_ia32_vcvttss2usi64 ((__v4sf
)
6144 _MM_FROUND_CUR_DIRECTION
);
6148 #define _mm512_permute_pd(X, C) \
6149 ((__m512d)__builtin_ia32_vpermilpd512((__v8df)(__m512d)(X), (int)(C)))
6151 #define _mm512_mask_permute_pd(W, U, X, C) \
6152 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6153 (__v8df)_mm512_permute_pd((X), (C)), \
6154 (__v8df)(__m512d)(W)))
6156 #define _mm512_maskz_permute_pd(U, X, C) \
6157 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6158 (__v8df)_mm512_permute_pd((X), (C)), \
6159 (__v8df)_mm512_setzero_pd()))
6161 #define _mm512_permute_ps(X, C) \
6162 ((__m512)__builtin_ia32_vpermilps512((__v16sf)(__m512)(X), (int)(C)))
6164 #define _mm512_mask_permute_ps(W, U, X, C) \
6165 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6166 (__v16sf)_mm512_permute_ps((X), (C)), \
6167 (__v16sf)(__m512)(W)))
6169 #define _mm512_maskz_permute_ps(U, X, C) \
6170 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6171 (__v16sf)_mm512_permute_ps((X), (C)), \
6172 (__v16sf)_mm512_setzero_ps()))
6174 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6175 _mm512_permutevar_pd(__m512d __A
, __m512i __C
)
6177 return (__m512d
)__builtin_ia32_vpermilvarpd512((__v8df
)__A
, (__v8di
)__C
);
6180 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6181 _mm512_mask_permutevar_pd(__m512d __W
, __mmask8 __U
, __m512d __A
, __m512i __C
)
6183 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
6184 (__v8df
)_mm512_permutevar_pd(__A
, __C
),
6188 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6189 _mm512_maskz_permutevar_pd(__mmask8 __U
, __m512d __A
, __m512i __C
)
6191 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
6192 (__v8df
)_mm512_permutevar_pd(__A
, __C
),
6193 (__v8df
)_mm512_setzero_pd());
6196 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6197 _mm512_permutevar_ps(__m512 __A
, __m512i __C
)
6199 return (__m512
)__builtin_ia32_vpermilvarps512((__v16sf
)__A
, (__v16si
)__C
);
6202 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6203 _mm512_mask_permutevar_ps(__m512 __W
, __mmask16 __U
, __m512 __A
, __m512i __C
)
6205 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
6206 (__v16sf
)_mm512_permutevar_ps(__A
, __C
),
6210 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6211 _mm512_maskz_permutevar_ps(__mmask16 __U
, __m512 __A
, __m512i __C
)
6213 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
6214 (__v16sf
)_mm512_permutevar_ps(__A
, __C
),
6215 (__v16sf
)_mm512_setzero_ps());
6218 static __inline __m512d __DEFAULT_FN_ATTRS512
6219 _mm512_permutex2var_pd(__m512d __A
, __m512i __I
, __m512d __B
)
6221 return (__m512d
)__builtin_ia32_vpermi2varpd512((__v8df
)__A
, (__v8di
)__I
,
6225 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6226 _mm512_mask_permutex2var_pd(__m512d __A
, __mmask8 __U
, __m512i __I
, __m512d __B
)
6228 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
6229 (__v8df
)_mm512_permutex2var_pd(__A
, __I
, __B
),
6233 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6234 _mm512_mask2_permutex2var_pd(__m512d __A
, __m512i __I
, __mmask8 __U
,
6237 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
6238 (__v8df
)_mm512_permutex2var_pd(__A
, __I
, __B
),
6239 (__v8df
)(__m512d
)__I
);
6242 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6243 _mm512_maskz_permutex2var_pd(__mmask8 __U
, __m512d __A
, __m512i __I
,
6246 return (__m512d
)__builtin_ia32_selectpd_512(__U
,
6247 (__v8df
)_mm512_permutex2var_pd(__A
, __I
, __B
),
6248 (__v8df
)_mm512_setzero_pd());
6251 static __inline __m512 __DEFAULT_FN_ATTRS512
6252 _mm512_permutex2var_ps(__m512 __A
, __m512i __I
, __m512 __B
)
6254 return (__m512
)__builtin_ia32_vpermi2varps512((__v16sf
)__A
, (__v16si
)__I
,
6258 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6259 _mm512_mask_permutex2var_ps(__m512 __A
, __mmask16 __U
, __m512i __I
, __m512 __B
)
6261 return (__m512
)__builtin_ia32_selectps_512(__U
,
6262 (__v16sf
)_mm512_permutex2var_ps(__A
, __I
, __B
),
6266 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6267 _mm512_mask2_permutex2var_ps(__m512 __A
, __m512i __I
, __mmask16 __U
, __m512 __B
)
6269 return (__m512
)__builtin_ia32_selectps_512(__U
,
6270 (__v16sf
)_mm512_permutex2var_ps(__A
, __I
, __B
),
6271 (__v16sf
)(__m512
)__I
);
6274 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6275 _mm512_maskz_permutex2var_ps(__mmask16 __U
, __m512 __A
, __m512i __I
, __m512 __B
)
6277 return (__m512
)__builtin_ia32_selectps_512(__U
,
6278 (__v16sf
)_mm512_permutex2var_ps(__A
, __I
, __B
),
6279 (__v16sf
)_mm512_setzero_ps());
6283 #define _mm512_cvtt_roundpd_epu32(A, R) \
6284 ((__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \
6285 (__v8si)_mm256_undefined_si256(), \
6286 (__mmask8)-1, (int)(R)))
6288 #define _mm512_mask_cvtt_roundpd_epu32(W, U, A, R) \
6289 ((__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \
6290 (__v8si)(__m256i)(W), \
6291 (__mmask8)(U), (int)(R)))
6293 #define _mm512_maskz_cvtt_roundpd_epu32(U, A, R) \
6294 ((__m256i)__builtin_ia32_cvttpd2udq512_mask((__v8df)(__m512d)(A), \
6295 (__v8si)_mm256_setzero_si256(), \
6296 (__mmask8)(U), (int)(R)))
6298 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6299 _mm512_cvttpd_epu32 (__m512d __A
)
6301 return (__m256i
) __builtin_ia32_cvttpd2udq512_mask ((__v8df
) __A
,
6303 _mm256_undefined_si256 (),
6305 _MM_FROUND_CUR_DIRECTION
);
6308 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6309 _mm512_mask_cvttpd_epu32 (__m256i __W
, __mmask8 __U
, __m512d __A
)
6311 return (__m256i
) __builtin_ia32_cvttpd2udq512_mask ((__v8df
) __A
,
6314 _MM_FROUND_CUR_DIRECTION
);
6317 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6318 _mm512_maskz_cvttpd_epu32 (__mmask8 __U
, __m512d __A
)
6320 return (__m256i
) __builtin_ia32_cvttpd2udq512_mask ((__v8df
) __A
,
6322 _mm256_setzero_si256 (),
6324 _MM_FROUND_CUR_DIRECTION
);
6327 #define _mm_roundscale_round_sd(A, B, imm, R) \
6328 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6329 (__v2df)(__m128d)(B), \
6330 (__v2df)_mm_setzero_pd(), \
6331 (__mmask8)-1, (int)(imm), \
6334 #define _mm_roundscale_sd(A, B, imm) \
6335 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6336 (__v2df)(__m128d)(B), \
6337 (__v2df)_mm_setzero_pd(), \
6338 (__mmask8)-1, (int)(imm), \
6339 _MM_FROUND_CUR_DIRECTION))
6341 #define _mm_mask_roundscale_sd(W, U, A, B, imm) \
6342 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6343 (__v2df)(__m128d)(B), \
6344 (__v2df)(__m128d)(W), \
6345 (__mmask8)(U), (int)(imm), \
6346 _MM_FROUND_CUR_DIRECTION))
6348 #define _mm_mask_roundscale_round_sd(W, U, A, B, I, R) \
6349 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6350 (__v2df)(__m128d)(B), \
6351 (__v2df)(__m128d)(W), \
6352 (__mmask8)(U), (int)(I), \
6355 #define _mm_maskz_roundscale_sd(U, A, B, I) \
6356 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6357 (__v2df)(__m128d)(B), \
6358 (__v2df)_mm_setzero_pd(), \
6359 (__mmask8)(U), (int)(I), \
6360 _MM_FROUND_CUR_DIRECTION))
6362 #define _mm_maskz_roundscale_round_sd(U, A, B, I, R) \
6363 ((__m128d)__builtin_ia32_rndscalesd_round_mask((__v2df)(__m128d)(A), \
6364 (__v2df)(__m128d)(B), \
6365 (__v2df)_mm_setzero_pd(), \
6366 (__mmask8)(U), (int)(I), \
6369 #define _mm_roundscale_round_ss(A, B, imm, R) \
6370 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6371 (__v4sf)(__m128)(B), \
6372 (__v4sf)_mm_setzero_ps(), \
6373 (__mmask8)-1, (int)(imm), \
6376 #define _mm_roundscale_ss(A, B, imm) \
6377 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6378 (__v4sf)(__m128)(B), \
6379 (__v4sf)_mm_setzero_ps(), \
6380 (__mmask8)-1, (int)(imm), \
6381 _MM_FROUND_CUR_DIRECTION))
6383 #define _mm_mask_roundscale_ss(W, U, A, B, I) \
6384 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6385 (__v4sf)(__m128)(B), \
6386 (__v4sf)(__m128)(W), \
6387 (__mmask8)(U), (int)(I), \
6388 _MM_FROUND_CUR_DIRECTION))
6390 #define _mm_mask_roundscale_round_ss(W, U, A, B, I, R) \
6391 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6392 (__v4sf)(__m128)(B), \
6393 (__v4sf)(__m128)(W), \
6394 (__mmask8)(U), (int)(I), \
6397 #define _mm_maskz_roundscale_ss(U, A, B, I) \
6398 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6399 (__v4sf)(__m128)(B), \
6400 (__v4sf)_mm_setzero_ps(), \
6401 (__mmask8)(U), (int)(I), \
6402 _MM_FROUND_CUR_DIRECTION))
6404 #define _mm_maskz_roundscale_round_ss(U, A, B, I, R) \
6405 ((__m128)__builtin_ia32_rndscaless_round_mask((__v4sf)(__m128)(A), \
6406 (__v4sf)(__m128)(B), \
6407 (__v4sf)_mm_setzero_ps(), \
6408 (__mmask8)(U), (int)(I), \
6411 #define _mm512_scalef_round_pd(A, B, R) \
6412 ((__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \
6413 (__v8df)(__m512d)(B), \
6414 (__v8df)_mm512_undefined_pd(), \
6415 (__mmask8)-1, (int)(R)))
6417 #define _mm512_mask_scalef_round_pd(W, U, A, B, R) \
6418 ((__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \
6419 (__v8df)(__m512d)(B), \
6420 (__v8df)(__m512d)(W), \
6421 (__mmask8)(U), (int)(R)))
6423 #define _mm512_maskz_scalef_round_pd(U, A, B, R) \
6424 ((__m512d)__builtin_ia32_scalefpd512_mask((__v8df)(__m512d)(A), \
6425 (__v8df)(__m512d)(B), \
6426 (__v8df)_mm512_setzero_pd(), \
6427 (__mmask8)(U), (int)(R)))
6429 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6430 _mm512_scalef_pd (__m512d __A
, __m512d __B
)
6432 return (__m512d
) __builtin_ia32_scalefpd512_mask ((__v8df
) __A
,
6435 _mm512_undefined_pd (),
6437 _MM_FROUND_CUR_DIRECTION
);
6440 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6441 _mm512_mask_scalef_pd (__m512d __W
, __mmask8 __U
, __m512d __A
, __m512d __B
)
6443 return (__m512d
) __builtin_ia32_scalefpd512_mask ((__v8df
) __A
,
6447 _MM_FROUND_CUR_DIRECTION
);
6450 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6451 _mm512_maskz_scalef_pd (__mmask8 __U
, __m512d __A
, __m512d __B
)
6453 return (__m512d
) __builtin_ia32_scalefpd512_mask ((__v8df
) __A
,
6456 _mm512_setzero_pd (),
6458 _MM_FROUND_CUR_DIRECTION
);
6461 #define _mm512_scalef_round_ps(A, B, R) \
6462 ((__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \
6463 (__v16sf)(__m512)(B), \
6464 (__v16sf)_mm512_undefined_ps(), \
6465 (__mmask16)-1, (int)(R)))
6467 #define _mm512_mask_scalef_round_ps(W, U, A, B, R) \
6468 ((__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \
6469 (__v16sf)(__m512)(B), \
6470 (__v16sf)(__m512)(W), \
6471 (__mmask16)(U), (int)(R)))
6473 #define _mm512_maskz_scalef_round_ps(U, A, B, R) \
6474 ((__m512)__builtin_ia32_scalefps512_mask((__v16sf)(__m512)(A), \
6475 (__v16sf)(__m512)(B), \
6476 (__v16sf)_mm512_setzero_ps(), \
6477 (__mmask16)(U), (int)(R)))
6479 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6480 _mm512_scalef_ps (__m512 __A
, __m512 __B
)
6482 return (__m512
) __builtin_ia32_scalefps512_mask ((__v16sf
) __A
,
6485 _mm512_undefined_ps (),
6487 _MM_FROUND_CUR_DIRECTION
);
6490 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6491 _mm512_mask_scalef_ps (__m512 __W
, __mmask16 __U
, __m512 __A
, __m512 __B
)
6493 return (__m512
) __builtin_ia32_scalefps512_mask ((__v16sf
) __A
,
6497 _MM_FROUND_CUR_DIRECTION
);
6500 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6501 _mm512_maskz_scalef_ps (__mmask16 __U
, __m512 __A
, __m512 __B
)
6503 return (__m512
) __builtin_ia32_scalefps512_mask ((__v16sf
) __A
,
6506 _mm512_setzero_ps (),
6508 _MM_FROUND_CUR_DIRECTION
);
6511 #define _mm_scalef_round_sd(A, B, R) \
6512 ((__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \
6513 (__v2df)(__m128d)(B), \
6514 (__v2df)_mm_setzero_pd(), \
6515 (__mmask8)-1, (int)(R)))
6517 static __inline__ __m128d __DEFAULT_FN_ATTRS128
6518 _mm_scalef_sd (__m128d __A
, __m128d __B
)
6520 return (__m128d
) __builtin_ia32_scalefsd_round_mask ((__v2df
) __A
,
6521 (__v2df
)( __B
), (__v2df
) _mm_setzero_pd(),
6523 _MM_FROUND_CUR_DIRECTION
);
6526 static __inline__ __m128d __DEFAULT_FN_ATTRS128
6527 _mm_mask_scalef_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
6529 return (__m128d
) __builtin_ia32_scalefsd_round_mask ( (__v2df
) __A
,
6533 _MM_FROUND_CUR_DIRECTION
);
6536 #define _mm_mask_scalef_round_sd(W, U, A, B, R) \
6537 ((__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \
6538 (__v2df)(__m128d)(B), \
6539 (__v2df)(__m128d)(W), \
6540 (__mmask8)(U), (int)(R)))
6542 static __inline__ __m128d __DEFAULT_FN_ATTRS128
6543 _mm_maskz_scalef_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
6545 return (__m128d
) __builtin_ia32_scalefsd_round_mask ( (__v2df
) __A
,
6547 (__v2df
) _mm_setzero_pd (),
6549 _MM_FROUND_CUR_DIRECTION
);
6552 #define _mm_maskz_scalef_round_sd(U, A, B, R) \
6553 ((__m128d)__builtin_ia32_scalefsd_round_mask((__v2df)(__m128d)(A), \
6554 (__v2df)(__m128d)(B), \
6555 (__v2df)_mm_setzero_pd(), \
6556 (__mmask8)(U), (int)(R)))
6558 #define _mm_scalef_round_ss(A, B, R) \
6559 ((__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \
6560 (__v4sf)(__m128)(B), \
6561 (__v4sf)_mm_setzero_ps(), \
6562 (__mmask8)-1, (int)(R)))
6564 static __inline__ __m128 __DEFAULT_FN_ATTRS128
6565 _mm_scalef_ss (__m128 __A
, __m128 __B
)
6567 return (__m128
) __builtin_ia32_scalefss_round_mask ((__v4sf
) __A
,
6568 (__v4sf
)( __B
), (__v4sf
) _mm_setzero_ps(),
6570 _MM_FROUND_CUR_DIRECTION
);
6573 static __inline__ __m128 __DEFAULT_FN_ATTRS128
6574 _mm_mask_scalef_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
6576 return (__m128
) __builtin_ia32_scalefss_round_mask ( (__v4sf
) __A
,
6580 _MM_FROUND_CUR_DIRECTION
);
6583 #define _mm_mask_scalef_round_ss(W, U, A, B, R) \
6584 ((__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \
6585 (__v4sf)(__m128)(B), \
6586 (__v4sf)(__m128)(W), \
6587 (__mmask8)(U), (int)(R)))
6589 static __inline__ __m128 __DEFAULT_FN_ATTRS128
6590 _mm_maskz_scalef_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
6592 return (__m128
) __builtin_ia32_scalefss_round_mask ( (__v4sf
) __A
,
6594 (__v4sf
) _mm_setzero_ps (),
6596 _MM_FROUND_CUR_DIRECTION
);
6599 #define _mm_maskz_scalef_round_ss(U, A, B, R) \
6600 ((__m128)__builtin_ia32_scalefss_round_mask((__v4sf)(__m128)(A), \
6601 (__v4sf)(__m128)(B), \
6602 (__v4sf)_mm_setzero_ps(), \
6606 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6607 _mm512_srai_epi32(__m512i __A
, unsigned int __B
)
6609 return (__m512i
)__builtin_ia32_psradi512((__v16si
)__A
, (int)__B
);
6612 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6613 _mm512_mask_srai_epi32(__m512i __W
, __mmask16 __U
, __m512i __A
,
6616 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
6617 (__v16si
)_mm512_srai_epi32(__A
, __B
),
6621 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6622 _mm512_maskz_srai_epi32(__mmask16 __U
, __m512i __A
,
6624 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__U
,
6625 (__v16si
)_mm512_srai_epi32(__A
, __B
),
6626 (__v16si
)_mm512_setzero_si512());
6629 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6630 _mm512_srai_epi64(__m512i __A
, unsigned int __B
)
6632 return (__m512i
)__builtin_ia32_psraqi512((__v8di
)__A
, (int)__B
);
6635 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6636 _mm512_mask_srai_epi64(__m512i __W
, __mmask8 __U
, __m512i __A
, unsigned int __B
)
6638 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
6639 (__v8di
)_mm512_srai_epi64(__A
, __B
),
6643 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6644 _mm512_maskz_srai_epi64(__mmask8 __U
, __m512i __A
, unsigned int __B
)
6646 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__U
,
6647 (__v8di
)_mm512_srai_epi64(__A
, __B
),
6648 (__v8di
)_mm512_setzero_si512());
6651 #define _mm512_shuffle_f32x4(A, B, imm) \
6652 ((__m512)__builtin_ia32_shuf_f32x4((__v16sf)(__m512)(A), \
6653 (__v16sf)(__m512)(B), (int)(imm)))
6655 #define _mm512_mask_shuffle_f32x4(W, U, A, B, imm) \
6656 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6657 (__v16sf)_mm512_shuffle_f32x4((A), (B), (imm)), \
6658 (__v16sf)(__m512)(W)))
6660 #define _mm512_maskz_shuffle_f32x4(U, A, B, imm) \
6661 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6662 (__v16sf)_mm512_shuffle_f32x4((A), (B), (imm)), \
6663 (__v16sf)_mm512_setzero_ps()))
6665 #define _mm512_shuffle_f64x2(A, B, imm) \
6666 ((__m512d)__builtin_ia32_shuf_f64x2((__v8df)(__m512d)(A), \
6667 (__v8df)(__m512d)(B), (int)(imm)))
6669 #define _mm512_mask_shuffle_f64x2(W, U, A, B, imm) \
6670 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6671 (__v8df)_mm512_shuffle_f64x2((A), (B), (imm)), \
6672 (__v8df)(__m512d)(W)))
6674 #define _mm512_maskz_shuffle_f64x2(U, A, B, imm) \
6675 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6676 (__v8df)_mm512_shuffle_f64x2((A), (B), (imm)), \
6677 (__v8df)_mm512_setzero_pd()))
6679 #define _mm512_shuffle_i32x4(A, B, imm) \
6680 ((__m512i)__builtin_ia32_shuf_i32x4((__v16si)(__m512i)(A), \
6681 (__v16si)(__m512i)(B), (int)(imm)))
6683 #define _mm512_mask_shuffle_i32x4(W, U, A, B, imm) \
6684 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
6685 (__v16si)_mm512_shuffle_i32x4((A), (B), (imm)), \
6686 (__v16si)(__m512i)(W)))
6688 #define _mm512_maskz_shuffle_i32x4(U, A, B, imm) \
6689 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
6690 (__v16si)_mm512_shuffle_i32x4((A), (B), (imm)), \
6691 (__v16si)_mm512_setzero_si512()))
6693 #define _mm512_shuffle_i64x2(A, B, imm) \
6694 ((__m512i)__builtin_ia32_shuf_i64x2((__v8di)(__m512i)(A), \
6695 (__v8di)(__m512i)(B), (int)(imm)))
6697 #define _mm512_mask_shuffle_i64x2(W, U, A, B, imm) \
6698 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
6699 (__v8di)_mm512_shuffle_i64x2((A), (B), (imm)), \
6700 (__v8di)(__m512i)(W)))
6702 #define _mm512_maskz_shuffle_i64x2(U, A, B, imm) \
6703 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
6704 (__v8di)_mm512_shuffle_i64x2((A), (B), (imm)), \
6705 (__v8di)_mm512_setzero_si512()))
6707 #define _mm512_shuffle_pd(A, B, M) \
6708 ((__m512d)__builtin_ia32_shufpd512((__v8df)(__m512d)(A), \
6709 (__v8df)(__m512d)(B), (int)(M)))
6711 #define _mm512_mask_shuffle_pd(W, U, A, B, M) \
6712 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6713 (__v8df)_mm512_shuffle_pd((A), (B), (M)), \
6714 (__v8df)(__m512d)(W)))
6716 #define _mm512_maskz_shuffle_pd(U, A, B, M) \
6717 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
6718 (__v8df)_mm512_shuffle_pd((A), (B), (M)), \
6719 (__v8df)_mm512_setzero_pd()))
6721 #define _mm512_shuffle_ps(A, B, M) \
6722 ((__m512)__builtin_ia32_shufps512((__v16sf)(__m512)(A), \
6723 (__v16sf)(__m512)(B), (int)(M)))
6725 #define _mm512_mask_shuffle_ps(W, U, A, B, M) \
6726 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6727 (__v16sf)_mm512_shuffle_ps((A), (B), (M)), \
6728 (__v16sf)(__m512)(W)))
6730 #define _mm512_maskz_shuffle_ps(U, A, B, M) \
6731 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
6732 (__v16sf)_mm512_shuffle_ps((A), (B), (M)), \
6733 (__v16sf)_mm512_setzero_ps()))
6735 #define _mm_sqrt_round_sd(A, B, R) \
6736 ((__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \
6737 (__v2df)(__m128d)(B), \
6738 (__v2df)_mm_setzero_pd(), \
6739 (__mmask8)-1, (int)(R)))
6741 static __inline__ __m128d __DEFAULT_FN_ATTRS128
6742 _mm_mask_sqrt_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
6744 return (__m128d
) __builtin_ia32_sqrtsd_round_mask ( (__v2df
) __A
,
6748 _MM_FROUND_CUR_DIRECTION
);
6751 #define _mm_mask_sqrt_round_sd(W, U, A, B, R) \
6752 ((__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \
6753 (__v2df)(__m128d)(B), \
6754 (__v2df)(__m128d)(W), \
6755 (__mmask8)(U), (int)(R)))
6757 static __inline__ __m128d __DEFAULT_FN_ATTRS128
6758 _mm_maskz_sqrt_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
6760 return (__m128d
) __builtin_ia32_sqrtsd_round_mask ( (__v2df
) __A
,
6762 (__v2df
) _mm_setzero_pd (),
6764 _MM_FROUND_CUR_DIRECTION
);
6767 #define _mm_maskz_sqrt_round_sd(U, A, B, R) \
6768 ((__m128d)__builtin_ia32_sqrtsd_round_mask((__v2df)(__m128d)(A), \
6769 (__v2df)(__m128d)(B), \
6770 (__v2df)_mm_setzero_pd(), \
6771 (__mmask8)(U), (int)(R)))
6773 #define _mm_sqrt_round_ss(A, B, R) \
6774 ((__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \
6775 (__v4sf)(__m128)(B), \
6776 (__v4sf)_mm_setzero_ps(), \
6777 (__mmask8)-1, (int)(R)))
6779 static __inline__ __m128 __DEFAULT_FN_ATTRS128
6780 _mm_mask_sqrt_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
6782 return (__m128
) __builtin_ia32_sqrtss_round_mask ( (__v4sf
) __A
,
6786 _MM_FROUND_CUR_DIRECTION
);
6789 #define _mm_mask_sqrt_round_ss(W, U, A, B, R) \
6790 ((__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \
6791 (__v4sf)(__m128)(B), \
6792 (__v4sf)(__m128)(W), (__mmask8)(U), \
6795 static __inline__ __m128 __DEFAULT_FN_ATTRS128
6796 _mm_maskz_sqrt_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
6798 return (__m128
) __builtin_ia32_sqrtss_round_mask ( (__v4sf
) __A
,
6800 (__v4sf
) _mm_setzero_ps (),
6802 _MM_FROUND_CUR_DIRECTION
);
6805 #define _mm_maskz_sqrt_round_ss(U, A, B, R) \
6806 ((__m128)__builtin_ia32_sqrtss_round_mask((__v4sf)(__m128)(A), \
6807 (__v4sf)(__m128)(B), \
6808 (__v4sf)_mm_setzero_ps(), \
6809 (__mmask8)(U), (int)(R)))
6811 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6812 _mm512_broadcast_f32x4(__m128 __A
)
6814 return (__m512
)__builtin_shufflevector((__v4sf
)__A
, (__v4sf
)__A
,
6815 0, 1, 2, 3, 0, 1, 2, 3,
6816 0, 1, 2, 3, 0, 1, 2, 3);
6819 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6820 _mm512_mask_broadcast_f32x4(__m512 __O
, __mmask16 __M
, __m128 __A
)
6822 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__M
,
6823 (__v16sf
)_mm512_broadcast_f32x4(__A
),
6827 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6828 _mm512_maskz_broadcast_f32x4(__mmask16 __M
, __m128 __A
)
6830 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__M
,
6831 (__v16sf
)_mm512_broadcast_f32x4(__A
),
6832 (__v16sf
)_mm512_setzero_ps());
6835 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6836 _mm512_broadcast_f64x4(__m256d __A
)
6838 return (__m512d
)__builtin_shufflevector((__v4df
)__A
, (__v4df
)__A
,
6839 0, 1, 2, 3, 0, 1, 2, 3);
6842 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6843 _mm512_mask_broadcast_f64x4(__m512d __O
, __mmask8 __M
, __m256d __A
)
6845 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__M
,
6846 (__v8df
)_mm512_broadcast_f64x4(__A
),
6850 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6851 _mm512_maskz_broadcast_f64x4(__mmask8 __M
, __m256d __A
)
6853 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__M
,
6854 (__v8df
)_mm512_broadcast_f64x4(__A
),
6855 (__v8df
)_mm512_setzero_pd());
6858 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6859 _mm512_broadcast_i32x4(__m128i __A
)
6861 return (__m512i
)__builtin_shufflevector((__v4si
)__A
, (__v4si
)__A
,
6862 0, 1, 2, 3, 0, 1, 2, 3,
6863 0, 1, 2, 3, 0, 1, 2, 3);
6866 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6867 _mm512_mask_broadcast_i32x4(__m512i __O
, __mmask16 __M
, __m128i __A
)
6869 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
6870 (__v16si
)_mm512_broadcast_i32x4(__A
),
6874 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6875 _mm512_maskz_broadcast_i32x4(__mmask16 __M
, __m128i __A
)
6877 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
6878 (__v16si
)_mm512_broadcast_i32x4(__A
),
6879 (__v16si
)_mm512_setzero_si512());
6882 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6883 _mm512_broadcast_i64x4(__m256i __A
)
6885 return (__m512i
)__builtin_shufflevector((__v4di
)__A
, (__v4di
)__A
,
6886 0, 1, 2, 3, 0, 1, 2, 3);
6889 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6890 _mm512_mask_broadcast_i64x4(__m512i __O
, __mmask8 __M
, __m256i __A
)
6892 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
6893 (__v8di
)_mm512_broadcast_i64x4(__A
),
6897 static __inline__ __m512i __DEFAULT_FN_ATTRS512
6898 _mm512_maskz_broadcast_i64x4(__mmask8 __M
, __m256i __A
)
6900 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
6901 (__v8di
)_mm512_broadcast_i64x4(__A
),
6902 (__v8di
)_mm512_setzero_si512());
6905 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6906 _mm512_mask_broadcastsd_pd (__m512d __O
, __mmask8 __M
, __m128d __A
)
6908 return (__m512d
)__builtin_ia32_selectpd_512(__M
,
6909 (__v8df
) _mm512_broadcastsd_pd(__A
),
6913 static __inline__ __m512d __DEFAULT_FN_ATTRS512
6914 _mm512_maskz_broadcastsd_pd (__mmask8 __M
, __m128d __A
)
6916 return (__m512d
)__builtin_ia32_selectpd_512(__M
,
6917 (__v8df
) _mm512_broadcastsd_pd(__A
),
6918 (__v8df
) _mm512_setzero_pd());
6921 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6922 _mm512_mask_broadcastss_ps (__m512 __O
, __mmask16 __M
, __m128 __A
)
6924 return (__m512
)__builtin_ia32_selectps_512(__M
,
6925 (__v16sf
) _mm512_broadcastss_ps(__A
),
6929 static __inline__ __m512 __DEFAULT_FN_ATTRS512
6930 _mm512_maskz_broadcastss_ps (__mmask16 __M
, __m128 __A
)
6932 return (__m512
)__builtin_ia32_selectps_512(__M
,
6933 (__v16sf
) _mm512_broadcastss_ps(__A
),
6934 (__v16sf
) _mm512_setzero_ps());
6937 static __inline__ __m128i __DEFAULT_FN_ATTRS512
6938 _mm512_cvtsepi32_epi8 (__m512i __A
)
6940 return (__m128i
) __builtin_ia32_pmovsdb512_mask ((__v16si
) __A
,
6941 (__v16qi
) _mm_undefined_si128 (),
6945 static __inline__ __m128i __DEFAULT_FN_ATTRS512
6946 _mm512_mask_cvtsepi32_epi8 (__m128i __O
, __mmask16 __M
, __m512i __A
)
6948 return (__m128i
) __builtin_ia32_pmovsdb512_mask ((__v16si
) __A
,
6949 (__v16qi
) __O
, __M
);
6952 static __inline__ __m128i __DEFAULT_FN_ATTRS512
6953 _mm512_maskz_cvtsepi32_epi8 (__mmask16 __M
, __m512i __A
)
6955 return (__m128i
) __builtin_ia32_pmovsdb512_mask ((__v16si
) __A
,
6956 (__v16qi
) _mm_setzero_si128 (),
6960 static __inline__
void __DEFAULT_FN_ATTRS512
6961 _mm512_mask_cvtsepi32_storeu_epi8 (void * __P
, __mmask16 __M
, __m512i __A
)
6963 __builtin_ia32_pmovsdb512mem_mask ((__v16qi
*) __P
, (__v16si
) __A
, __M
);
6966 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6967 _mm512_cvtsepi32_epi16 (__m512i __A
)
6969 return (__m256i
) __builtin_ia32_pmovsdw512_mask ((__v16si
) __A
,
6970 (__v16hi
) _mm256_undefined_si256 (),
6974 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6975 _mm512_mask_cvtsepi32_epi16 (__m256i __O
, __mmask16 __M
, __m512i __A
)
6977 return (__m256i
) __builtin_ia32_pmovsdw512_mask ((__v16si
) __A
,
6978 (__v16hi
) __O
, __M
);
6981 static __inline__ __m256i __DEFAULT_FN_ATTRS512
6982 _mm512_maskz_cvtsepi32_epi16 (__mmask16 __M
, __m512i __A
)
6984 return (__m256i
) __builtin_ia32_pmovsdw512_mask ((__v16si
) __A
,
6985 (__v16hi
) _mm256_setzero_si256 (),
6989 static __inline__
void __DEFAULT_FN_ATTRS512
6990 _mm512_mask_cvtsepi32_storeu_epi16 (void *__P
, __mmask16 __M
, __m512i __A
)
6992 __builtin_ia32_pmovsdw512mem_mask ((__v16hi
*) __P
, (__v16si
) __A
, __M
);
6995 static __inline__ __m128i __DEFAULT_FN_ATTRS512
6996 _mm512_cvtsepi64_epi8 (__m512i __A
)
6998 return (__m128i
) __builtin_ia32_pmovsqb512_mask ((__v8di
) __A
,
6999 (__v16qi
) _mm_undefined_si128 (),
7003 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7004 _mm512_mask_cvtsepi64_epi8 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7006 return (__m128i
) __builtin_ia32_pmovsqb512_mask ((__v8di
) __A
,
7007 (__v16qi
) __O
, __M
);
7010 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7011 _mm512_maskz_cvtsepi64_epi8 (__mmask8 __M
, __m512i __A
)
7013 return (__m128i
) __builtin_ia32_pmovsqb512_mask ((__v8di
) __A
,
7014 (__v16qi
) _mm_setzero_si128 (),
7018 static __inline__
void __DEFAULT_FN_ATTRS512
7019 _mm512_mask_cvtsepi64_storeu_epi8 (void * __P
, __mmask8 __M
, __m512i __A
)
7021 __builtin_ia32_pmovsqb512mem_mask ((__v16qi
*) __P
, (__v8di
) __A
, __M
);
7024 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7025 _mm512_cvtsepi64_epi32 (__m512i __A
)
7027 return (__m256i
) __builtin_ia32_pmovsqd512_mask ((__v8di
) __A
,
7028 (__v8si
) _mm256_undefined_si256 (),
7032 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7033 _mm512_mask_cvtsepi64_epi32 (__m256i __O
, __mmask8 __M
, __m512i __A
)
7035 return (__m256i
) __builtin_ia32_pmovsqd512_mask ((__v8di
) __A
,
7039 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7040 _mm512_maskz_cvtsepi64_epi32 (__mmask8 __M
, __m512i __A
)
7042 return (__m256i
) __builtin_ia32_pmovsqd512_mask ((__v8di
) __A
,
7043 (__v8si
) _mm256_setzero_si256 (),
7047 static __inline__
void __DEFAULT_FN_ATTRS512
7048 _mm512_mask_cvtsepi64_storeu_epi32 (void *__P
, __mmask8 __M
, __m512i __A
)
7050 __builtin_ia32_pmovsqd512mem_mask ((__v8si
*) __P
, (__v8di
) __A
, __M
);
7053 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7054 _mm512_cvtsepi64_epi16 (__m512i __A
)
7056 return (__m128i
) __builtin_ia32_pmovsqw512_mask ((__v8di
) __A
,
7057 (__v8hi
) _mm_undefined_si128 (),
7061 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7062 _mm512_mask_cvtsepi64_epi16 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7064 return (__m128i
) __builtin_ia32_pmovsqw512_mask ((__v8di
) __A
,
7068 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7069 _mm512_maskz_cvtsepi64_epi16 (__mmask8 __M
, __m512i __A
)
7071 return (__m128i
) __builtin_ia32_pmovsqw512_mask ((__v8di
) __A
,
7072 (__v8hi
) _mm_setzero_si128 (),
7076 static __inline__
void __DEFAULT_FN_ATTRS512
7077 _mm512_mask_cvtsepi64_storeu_epi16 (void * __P
, __mmask8 __M
, __m512i __A
)
7079 __builtin_ia32_pmovsqw512mem_mask ((__v8hi
*) __P
, (__v8di
) __A
, __M
);
7082 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7083 _mm512_cvtusepi32_epi8 (__m512i __A
)
7085 return (__m128i
) __builtin_ia32_pmovusdb512_mask ((__v16si
) __A
,
7086 (__v16qi
) _mm_undefined_si128 (),
7090 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7091 _mm512_mask_cvtusepi32_epi8 (__m128i __O
, __mmask16 __M
, __m512i __A
)
7093 return (__m128i
) __builtin_ia32_pmovusdb512_mask ((__v16si
) __A
,
7098 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7099 _mm512_maskz_cvtusepi32_epi8 (__mmask16 __M
, __m512i __A
)
7101 return (__m128i
) __builtin_ia32_pmovusdb512_mask ((__v16si
) __A
,
7102 (__v16qi
) _mm_setzero_si128 (),
7106 static __inline__
void __DEFAULT_FN_ATTRS512
7107 _mm512_mask_cvtusepi32_storeu_epi8 (void * __P
, __mmask16 __M
, __m512i __A
)
7109 __builtin_ia32_pmovusdb512mem_mask ((__v16qi
*) __P
, (__v16si
) __A
, __M
);
7112 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7113 _mm512_cvtusepi32_epi16 (__m512i __A
)
7115 return (__m256i
) __builtin_ia32_pmovusdw512_mask ((__v16si
) __A
,
7116 (__v16hi
) _mm256_undefined_si256 (),
7120 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7121 _mm512_mask_cvtusepi32_epi16 (__m256i __O
, __mmask16 __M
, __m512i __A
)
7123 return (__m256i
) __builtin_ia32_pmovusdw512_mask ((__v16si
) __A
,
7128 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7129 _mm512_maskz_cvtusepi32_epi16 (__mmask16 __M
, __m512i __A
)
7131 return (__m256i
) __builtin_ia32_pmovusdw512_mask ((__v16si
) __A
,
7132 (__v16hi
) _mm256_setzero_si256 (),
7136 static __inline__
void __DEFAULT_FN_ATTRS512
7137 _mm512_mask_cvtusepi32_storeu_epi16 (void *__P
, __mmask16 __M
, __m512i __A
)
7139 __builtin_ia32_pmovusdw512mem_mask ((__v16hi
*) __P
, (__v16si
) __A
, __M
);
7142 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7143 _mm512_cvtusepi64_epi8 (__m512i __A
)
7145 return (__m128i
) __builtin_ia32_pmovusqb512_mask ((__v8di
) __A
,
7146 (__v16qi
) _mm_undefined_si128 (),
7150 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7151 _mm512_mask_cvtusepi64_epi8 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7153 return (__m128i
) __builtin_ia32_pmovusqb512_mask ((__v8di
) __A
,
7158 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7159 _mm512_maskz_cvtusepi64_epi8 (__mmask8 __M
, __m512i __A
)
7161 return (__m128i
) __builtin_ia32_pmovusqb512_mask ((__v8di
) __A
,
7162 (__v16qi
) _mm_setzero_si128 (),
7166 static __inline__
void __DEFAULT_FN_ATTRS512
7167 _mm512_mask_cvtusepi64_storeu_epi8 (void * __P
, __mmask8 __M
, __m512i __A
)
7169 __builtin_ia32_pmovusqb512mem_mask ((__v16qi
*) __P
, (__v8di
) __A
, __M
);
7172 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7173 _mm512_cvtusepi64_epi32 (__m512i __A
)
7175 return (__m256i
) __builtin_ia32_pmovusqd512_mask ((__v8di
) __A
,
7176 (__v8si
) _mm256_undefined_si256 (),
7180 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7181 _mm512_mask_cvtusepi64_epi32 (__m256i __O
, __mmask8 __M
, __m512i __A
)
7183 return (__m256i
) __builtin_ia32_pmovusqd512_mask ((__v8di
) __A
,
7187 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7188 _mm512_maskz_cvtusepi64_epi32 (__mmask8 __M
, __m512i __A
)
7190 return (__m256i
) __builtin_ia32_pmovusqd512_mask ((__v8di
) __A
,
7191 (__v8si
) _mm256_setzero_si256 (),
7195 static __inline__
void __DEFAULT_FN_ATTRS512
7196 _mm512_mask_cvtusepi64_storeu_epi32 (void* __P
, __mmask8 __M
, __m512i __A
)
7198 __builtin_ia32_pmovusqd512mem_mask ((__v8si
*) __P
, (__v8di
) __A
, __M
);
7201 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7202 _mm512_cvtusepi64_epi16 (__m512i __A
)
7204 return (__m128i
) __builtin_ia32_pmovusqw512_mask ((__v8di
) __A
,
7205 (__v8hi
) _mm_undefined_si128 (),
7209 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7210 _mm512_mask_cvtusepi64_epi16 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7212 return (__m128i
) __builtin_ia32_pmovusqw512_mask ((__v8di
) __A
,
7216 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7217 _mm512_maskz_cvtusepi64_epi16 (__mmask8 __M
, __m512i __A
)
7219 return (__m128i
) __builtin_ia32_pmovusqw512_mask ((__v8di
) __A
,
7220 (__v8hi
) _mm_setzero_si128 (),
7224 static __inline__
void __DEFAULT_FN_ATTRS512
7225 _mm512_mask_cvtusepi64_storeu_epi16 (void *__P
, __mmask8 __M
, __m512i __A
)
7227 __builtin_ia32_pmovusqw512mem_mask ((__v8hi
*) __P
, (__v8di
) __A
, __M
);
7230 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7231 _mm512_cvtepi32_epi8 (__m512i __A
)
7233 return (__m128i
) __builtin_ia32_pmovdb512_mask ((__v16si
) __A
,
7234 (__v16qi
) _mm_undefined_si128 (),
7238 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7239 _mm512_mask_cvtepi32_epi8 (__m128i __O
, __mmask16 __M
, __m512i __A
)
7241 return (__m128i
) __builtin_ia32_pmovdb512_mask ((__v16si
) __A
,
7242 (__v16qi
) __O
, __M
);
7245 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7246 _mm512_maskz_cvtepi32_epi8 (__mmask16 __M
, __m512i __A
)
7248 return (__m128i
) __builtin_ia32_pmovdb512_mask ((__v16si
) __A
,
7249 (__v16qi
) _mm_setzero_si128 (),
7253 static __inline__
void __DEFAULT_FN_ATTRS512
7254 _mm512_mask_cvtepi32_storeu_epi8 (void * __P
, __mmask16 __M
, __m512i __A
)
7256 __builtin_ia32_pmovdb512mem_mask ((__v16qi
*) __P
, (__v16si
) __A
, __M
);
7259 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7260 _mm512_cvtepi32_epi16 (__m512i __A
)
7262 return (__m256i
) __builtin_ia32_pmovdw512_mask ((__v16si
) __A
,
7263 (__v16hi
) _mm256_undefined_si256 (),
7267 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7268 _mm512_mask_cvtepi32_epi16 (__m256i __O
, __mmask16 __M
, __m512i __A
)
7270 return (__m256i
) __builtin_ia32_pmovdw512_mask ((__v16si
) __A
,
7271 (__v16hi
) __O
, __M
);
7274 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7275 _mm512_maskz_cvtepi32_epi16 (__mmask16 __M
, __m512i __A
)
7277 return (__m256i
) __builtin_ia32_pmovdw512_mask ((__v16si
) __A
,
7278 (__v16hi
) _mm256_setzero_si256 (),
7282 static __inline__
void __DEFAULT_FN_ATTRS512
7283 _mm512_mask_cvtepi32_storeu_epi16 (void * __P
, __mmask16 __M
, __m512i __A
)
7285 __builtin_ia32_pmovdw512mem_mask ((__v16hi
*) __P
, (__v16si
) __A
, __M
);
7288 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7289 _mm512_cvtepi64_epi8 (__m512i __A
)
7291 return (__m128i
) __builtin_ia32_pmovqb512_mask ((__v8di
) __A
,
7292 (__v16qi
) _mm_undefined_si128 (),
7296 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7297 _mm512_mask_cvtepi64_epi8 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7299 return (__m128i
) __builtin_ia32_pmovqb512_mask ((__v8di
) __A
,
7300 (__v16qi
) __O
, __M
);
7303 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7304 _mm512_maskz_cvtepi64_epi8 (__mmask8 __M
, __m512i __A
)
7306 return (__m128i
) __builtin_ia32_pmovqb512_mask ((__v8di
) __A
,
7307 (__v16qi
) _mm_setzero_si128 (),
7311 static __inline__
void __DEFAULT_FN_ATTRS512
7312 _mm512_mask_cvtepi64_storeu_epi8 (void * __P
, __mmask8 __M
, __m512i __A
)
7314 __builtin_ia32_pmovqb512mem_mask ((__v16qi
*) __P
, (__v8di
) __A
, __M
);
7317 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7318 _mm512_cvtepi64_epi32 (__m512i __A
)
7320 return (__m256i
) __builtin_ia32_pmovqd512_mask ((__v8di
) __A
,
7321 (__v8si
) _mm256_undefined_si256 (),
7325 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7326 _mm512_mask_cvtepi64_epi32 (__m256i __O
, __mmask8 __M
, __m512i __A
)
7328 return (__m256i
) __builtin_ia32_pmovqd512_mask ((__v8di
) __A
,
7332 static __inline__ __m256i __DEFAULT_FN_ATTRS512
7333 _mm512_maskz_cvtepi64_epi32 (__mmask8 __M
, __m512i __A
)
7335 return (__m256i
) __builtin_ia32_pmovqd512_mask ((__v8di
) __A
,
7336 (__v8si
) _mm256_setzero_si256 (),
7340 static __inline__
void __DEFAULT_FN_ATTRS512
7341 _mm512_mask_cvtepi64_storeu_epi32 (void* __P
, __mmask8 __M
, __m512i __A
)
7343 __builtin_ia32_pmovqd512mem_mask ((__v8si
*) __P
, (__v8di
) __A
, __M
);
7346 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7347 _mm512_cvtepi64_epi16 (__m512i __A
)
7349 return (__m128i
) __builtin_ia32_pmovqw512_mask ((__v8di
) __A
,
7350 (__v8hi
) _mm_undefined_si128 (),
7354 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7355 _mm512_mask_cvtepi64_epi16 (__m128i __O
, __mmask8 __M
, __m512i __A
)
7357 return (__m128i
) __builtin_ia32_pmovqw512_mask ((__v8di
) __A
,
7361 static __inline__ __m128i __DEFAULT_FN_ATTRS512
7362 _mm512_maskz_cvtepi64_epi16 (__mmask8 __M
, __m512i __A
)
7364 return (__m128i
) __builtin_ia32_pmovqw512_mask ((__v8di
) __A
,
7365 (__v8hi
) _mm_setzero_si128 (),
7369 static __inline__
void __DEFAULT_FN_ATTRS512
7370 _mm512_mask_cvtepi64_storeu_epi16 (void *__P
, __mmask8 __M
, __m512i __A
)
7372 __builtin_ia32_pmovqw512mem_mask ((__v8hi
*) __P
, (__v8di
) __A
, __M
);
7375 #define _mm512_extracti32x4_epi32(A, imm) \
7376 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \
7377 (__v4si)_mm_undefined_si128(), \
7380 #define _mm512_mask_extracti32x4_epi32(W, U, A, imm) \
7381 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \
7382 (__v4si)(__m128i)(W), \
7385 #define _mm512_maskz_extracti32x4_epi32(U, A, imm) \
7386 ((__m128i)__builtin_ia32_extracti32x4_mask((__v16si)(__m512i)(A), (int)(imm), \
7387 (__v4si)_mm_setzero_si128(), \
7390 #define _mm512_extracti64x4_epi64(A, imm) \
7391 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \
7392 (__v4di)_mm256_undefined_si256(), \
7395 #define _mm512_mask_extracti64x4_epi64(W, U, A, imm) \
7396 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \
7397 (__v4di)(__m256i)(W), \
7400 #define _mm512_maskz_extracti64x4_epi64(U, A, imm) \
7401 ((__m256i)__builtin_ia32_extracti64x4_mask((__v8di)(__m512i)(A), (int)(imm), \
7402 (__v4di)_mm256_setzero_si256(), \
7405 #define _mm512_insertf64x4(A, B, imm) \
7406 ((__m512d)__builtin_ia32_insertf64x4((__v8df)(__m512d)(A), \
7407 (__v4df)(__m256d)(B), (int)(imm)))
7409 #define _mm512_mask_insertf64x4(W, U, A, B, imm) \
7410 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
7411 (__v8df)_mm512_insertf64x4((A), (B), (imm)), \
7412 (__v8df)(__m512d)(W)))
7414 #define _mm512_maskz_insertf64x4(U, A, B, imm) \
7415 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
7416 (__v8df)_mm512_insertf64x4((A), (B), (imm)), \
7417 (__v8df)_mm512_setzero_pd()))
7419 #define _mm512_inserti64x4(A, B, imm) \
7420 ((__m512i)__builtin_ia32_inserti64x4((__v8di)(__m512i)(A), \
7421 (__v4di)(__m256i)(B), (int)(imm)))
7423 #define _mm512_mask_inserti64x4(W, U, A, B, imm) \
7424 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
7425 (__v8di)_mm512_inserti64x4((A), (B), (imm)), \
7426 (__v8di)(__m512i)(W)))
7428 #define _mm512_maskz_inserti64x4(U, A, B, imm) \
7429 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
7430 (__v8di)_mm512_inserti64x4((A), (B), (imm)), \
7431 (__v8di)_mm512_setzero_si512()))
7433 #define _mm512_insertf32x4(A, B, imm) \
7434 ((__m512)__builtin_ia32_insertf32x4((__v16sf)(__m512)(A), \
7435 (__v4sf)(__m128)(B), (int)(imm)))
7437 #define _mm512_mask_insertf32x4(W, U, A, B, imm) \
7438 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
7439 (__v16sf)_mm512_insertf32x4((A), (B), (imm)), \
7440 (__v16sf)(__m512)(W)))
7442 #define _mm512_maskz_insertf32x4(U, A, B, imm) \
7443 ((__m512)__builtin_ia32_selectps_512((__mmask16)(U), \
7444 (__v16sf)_mm512_insertf32x4((A), (B), (imm)), \
7445 (__v16sf)_mm512_setzero_ps()))
7447 #define _mm512_inserti32x4(A, B, imm) \
7448 ((__m512i)__builtin_ia32_inserti32x4((__v16si)(__m512i)(A), \
7449 (__v4si)(__m128i)(B), (int)(imm)))
7451 #define _mm512_mask_inserti32x4(W, U, A, B, imm) \
7452 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
7453 (__v16si)_mm512_inserti32x4((A), (B), (imm)), \
7454 (__v16si)(__m512i)(W)))
7456 #define _mm512_maskz_inserti32x4(U, A, B, imm) \
7457 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
7458 (__v16si)_mm512_inserti32x4((A), (B), (imm)), \
7459 (__v16si)_mm512_setzero_si512()))
7461 #define _mm512_getmant_round_pd(A, B, C, R) \
7462 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7463 (int)(((C)<<2) | (B)), \
7464 (__v8df)_mm512_undefined_pd(), \
7465 (__mmask8)-1, (int)(R)))
7467 #define _mm512_mask_getmant_round_pd(W, U, A, B, C, R) \
7468 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7469 (int)(((C)<<2) | (B)), \
7470 (__v8df)(__m512d)(W), \
7471 (__mmask8)(U), (int)(R)))
7473 #define _mm512_maskz_getmant_round_pd(U, A, B, C, R) \
7474 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7475 (int)(((C)<<2) | (B)), \
7476 (__v8df)_mm512_setzero_pd(), \
7477 (__mmask8)(U), (int)(R)))
7479 #define _mm512_getmant_pd(A, B, C) \
7480 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7481 (int)(((C)<<2) | (B)), \
7482 (__v8df)_mm512_setzero_pd(), \
7484 _MM_FROUND_CUR_DIRECTION))
7486 #define _mm512_mask_getmant_pd(W, U, A, B, C) \
7487 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7488 (int)(((C)<<2) | (B)), \
7489 (__v8df)(__m512d)(W), \
7491 _MM_FROUND_CUR_DIRECTION))
7493 #define _mm512_maskz_getmant_pd(U, A, B, C) \
7494 ((__m512d)__builtin_ia32_getmantpd512_mask((__v8df)(__m512d)(A), \
7495 (int)(((C)<<2) | (B)), \
7496 (__v8df)_mm512_setzero_pd(), \
7498 _MM_FROUND_CUR_DIRECTION))
7500 #define _mm512_getmant_round_ps(A, B, C, R) \
7501 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7502 (int)(((C)<<2) | (B)), \
7503 (__v16sf)_mm512_undefined_ps(), \
7504 (__mmask16)-1, (int)(R)))
7506 #define _mm512_mask_getmant_round_ps(W, U, A, B, C, R) \
7507 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7508 (int)(((C)<<2) | (B)), \
7509 (__v16sf)(__m512)(W), \
7510 (__mmask16)(U), (int)(R)))
7512 #define _mm512_maskz_getmant_round_ps(U, A, B, C, R) \
7513 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7514 (int)(((C)<<2) | (B)), \
7515 (__v16sf)_mm512_setzero_ps(), \
7516 (__mmask16)(U), (int)(R)))
7518 #define _mm512_getmant_ps(A, B, C) \
7519 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7520 (int)(((C)<<2)|(B)), \
7521 (__v16sf)_mm512_undefined_ps(), \
7523 _MM_FROUND_CUR_DIRECTION))
7525 #define _mm512_mask_getmant_ps(W, U, A, B, C) \
7526 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7527 (int)(((C)<<2)|(B)), \
7528 (__v16sf)(__m512)(W), \
7530 _MM_FROUND_CUR_DIRECTION))
7532 #define _mm512_maskz_getmant_ps(U, A, B, C) \
7533 ((__m512)__builtin_ia32_getmantps512_mask((__v16sf)(__m512)(A), \
7534 (int)(((C)<<2)|(B)), \
7535 (__v16sf)_mm512_setzero_ps(), \
7537 _MM_FROUND_CUR_DIRECTION))
7539 #define _mm512_getexp_round_pd(A, R) \
7540 ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \
7541 (__v8df)_mm512_undefined_pd(), \
7542 (__mmask8)-1, (int)(R)))
7544 #define _mm512_mask_getexp_round_pd(W, U, A, R) \
7545 ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \
7546 (__v8df)(__m512d)(W), \
7547 (__mmask8)(U), (int)(R)))
7549 #define _mm512_maskz_getexp_round_pd(U, A, R) \
7550 ((__m512d)__builtin_ia32_getexppd512_mask((__v8df)(__m512d)(A), \
7551 (__v8df)_mm512_setzero_pd(), \
7552 (__mmask8)(U), (int)(R)))
7554 static __inline__ __m512d __DEFAULT_FN_ATTRS512
7555 _mm512_getexp_pd (__m512d __A
)
7557 return (__m512d
) __builtin_ia32_getexppd512_mask ((__v8df
) __A
,
7558 (__v8df
) _mm512_undefined_pd (),
7560 _MM_FROUND_CUR_DIRECTION
);
7563 static __inline__ __m512d __DEFAULT_FN_ATTRS512
7564 _mm512_mask_getexp_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
7566 return (__m512d
) __builtin_ia32_getexppd512_mask ((__v8df
) __A
,
7569 _MM_FROUND_CUR_DIRECTION
);
7572 static __inline__ __m512d __DEFAULT_FN_ATTRS512
7573 _mm512_maskz_getexp_pd (__mmask8 __U
, __m512d __A
)
7575 return (__m512d
) __builtin_ia32_getexppd512_mask ((__v8df
) __A
,
7576 (__v8df
) _mm512_setzero_pd (),
7578 _MM_FROUND_CUR_DIRECTION
);
7581 #define _mm512_getexp_round_ps(A, R) \
7582 ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \
7583 (__v16sf)_mm512_undefined_ps(), \
7584 (__mmask16)-1, (int)(R)))
7586 #define _mm512_mask_getexp_round_ps(W, U, A, R) \
7587 ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \
7588 (__v16sf)(__m512)(W), \
7589 (__mmask16)(U), (int)(R)))
7591 #define _mm512_maskz_getexp_round_ps(U, A, R) \
7592 ((__m512)__builtin_ia32_getexpps512_mask((__v16sf)(__m512)(A), \
7593 (__v16sf)_mm512_setzero_ps(), \
7594 (__mmask16)(U), (int)(R)))
7596 static __inline__ __m512 __DEFAULT_FN_ATTRS512
7597 _mm512_getexp_ps (__m512 __A
)
7599 return (__m512
) __builtin_ia32_getexpps512_mask ((__v16sf
) __A
,
7600 (__v16sf
) _mm512_undefined_ps (),
7602 _MM_FROUND_CUR_DIRECTION
);
7605 static __inline__ __m512 __DEFAULT_FN_ATTRS512
7606 _mm512_mask_getexp_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
7608 return (__m512
) __builtin_ia32_getexpps512_mask ((__v16sf
) __A
,
7611 _MM_FROUND_CUR_DIRECTION
);
7614 static __inline__ __m512 __DEFAULT_FN_ATTRS512
7615 _mm512_maskz_getexp_ps (__mmask16 __U
, __m512 __A
)
7617 return (__m512
) __builtin_ia32_getexpps512_mask ((__v16sf
) __A
,
7618 (__v16sf
) _mm512_setzero_ps (),
7620 _MM_FROUND_CUR_DIRECTION
);
7623 #define _mm512_i64gather_ps(index, addr, scale) \
7624 ((__m256)__builtin_ia32_gatherdiv16sf((__v8sf)_mm256_undefined_ps(), \
7625 (void const *)(addr), \
7626 (__v8di)(__m512i)(index), (__mmask8)-1, \
7629 #define _mm512_mask_i64gather_ps(v1_old, mask, index, addr, scale) \
7630 ((__m256)__builtin_ia32_gatherdiv16sf((__v8sf)(__m256)(v1_old),\
7631 (void const *)(addr), \
7632 (__v8di)(__m512i)(index), \
7633 (__mmask8)(mask), (int)(scale)))
7635 #define _mm512_i64gather_epi32(index, addr, scale) \
7636 ((__m256i)__builtin_ia32_gatherdiv16si((__v8si)_mm256_undefined_si256(), \
7637 (void const *)(addr), \
7638 (__v8di)(__m512i)(index), \
7639 (__mmask8)-1, (int)(scale)))
7641 #define _mm512_mask_i64gather_epi32(v1_old, mask, index, addr, scale) \
7642 ((__m256i)__builtin_ia32_gatherdiv16si((__v8si)(__m256i)(v1_old), \
7643 (void const *)(addr), \
7644 (__v8di)(__m512i)(index), \
7645 (__mmask8)(mask), (int)(scale)))
7647 #define _mm512_i64gather_pd(index, addr, scale) \
7648 ((__m512d)__builtin_ia32_gatherdiv8df((__v8df)_mm512_undefined_pd(), \
7649 (void const *)(addr), \
7650 (__v8di)(__m512i)(index), (__mmask8)-1, \
7653 #define _mm512_mask_i64gather_pd(v1_old, mask, index, addr, scale) \
7654 ((__m512d)__builtin_ia32_gatherdiv8df((__v8df)(__m512d)(v1_old), \
7655 (void const *)(addr), \
7656 (__v8di)(__m512i)(index), \
7657 (__mmask8)(mask), (int)(scale)))
7659 #define _mm512_i64gather_epi64(index, addr, scale) \
7660 ((__m512i)__builtin_ia32_gatherdiv8di((__v8di)_mm512_undefined_epi32(), \
7661 (void const *)(addr), \
7662 (__v8di)(__m512i)(index), (__mmask8)-1, \
7665 #define _mm512_mask_i64gather_epi64(v1_old, mask, index, addr, scale) \
7666 ((__m512i)__builtin_ia32_gatherdiv8di((__v8di)(__m512i)(v1_old), \
7667 (void const *)(addr), \
7668 (__v8di)(__m512i)(index), \
7669 (__mmask8)(mask), (int)(scale)))
7671 #define _mm512_i32gather_ps(index, addr, scale) \
7672 ((__m512)__builtin_ia32_gathersiv16sf((__v16sf)_mm512_undefined_ps(), \
7673 (void const *)(addr), \
7674 (__v16si)(__m512)(index), \
7675 (__mmask16)-1, (int)(scale)))
7677 #define _mm512_mask_i32gather_ps(v1_old, mask, index, addr, scale) \
7678 ((__m512)__builtin_ia32_gathersiv16sf((__v16sf)(__m512)(v1_old), \
7679 (void const *)(addr), \
7680 (__v16si)(__m512)(index), \
7681 (__mmask16)(mask), (int)(scale)))
7683 #define _mm512_i32gather_epi32(index, addr, scale) \
7684 ((__m512i)__builtin_ia32_gathersiv16si((__v16si)_mm512_undefined_epi32(), \
7685 (void const *)(addr), \
7686 (__v16si)(__m512i)(index), \
7687 (__mmask16)-1, (int)(scale)))
7689 #define _mm512_mask_i32gather_epi32(v1_old, mask, index, addr, scale) \
7690 ((__m512i)__builtin_ia32_gathersiv16si((__v16si)(__m512i)(v1_old), \
7691 (void const *)(addr), \
7692 (__v16si)(__m512i)(index), \
7693 (__mmask16)(mask), (int)(scale)))
7695 #define _mm512_i32gather_pd(index, addr, scale) \
7696 ((__m512d)__builtin_ia32_gathersiv8df((__v8df)_mm512_undefined_pd(), \
7697 (void const *)(addr), \
7698 (__v8si)(__m256i)(index), (__mmask8)-1, \
7701 #define _mm512_mask_i32gather_pd(v1_old, mask, index, addr, scale) \
7702 ((__m512d)__builtin_ia32_gathersiv8df((__v8df)(__m512d)(v1_old), \
7703 (void const *)(addr), \
7704 (__v8si)(__m256i)(index), \
7705 (__mmask8)(mask), (int)(scale)))
7707 #define _mm512_i32gather_epi64(index, addr, scale) \
7708 ((__m512i)__builtin_ia32_gathersiv8di((__v8di)_mm512_undefined_epi32(), \
7709 (void const *)(addr), \
7710 (__v8si)(__m256i)(index), (__mmask8)-1, \
7713 #define _mm512_mask_i32gather_epi64(v1_old, mask, index, addr, scale) \
7714 ((__m512i)__builtin_ia32_gathersiv8di((__v8di)(__m512i)(v1_old), \
7715 (void const *)(addr), \
7716 (__v8si)(__m256i)(index), \
7717 (__mmask8)(mask), (int)(scale)))
7719 #define _mm512_i64scatter_ps(addr, index, v1, scale) \
7720 __builtin_ia32_scatterdiv16sf((void *)(addr), (__mmask8)-1, \
7721 (__v8di)(__m512i)(index), \
7722 (__v8sf)(__m256)(v1), (int)(scale))
7724 #define _mm512_mask_i64scatter_ps(addr, mask, index, v1, scale) \
7725 __builtin_ia32_scatterdiv16sf((void *)(addr), (__mmask8)(mask), \
7726 (__v8di)(__m512i)(index), \
7727 (__v8sf)(__m256)(v1), (int)(scale))
7729 #define _mm512_i64scatter_epi32(addr, index, v1, scale) \
7730 __builtin_ia32_scatterdiv16si((void *)(addr), (__mmask8)-1, \
7731 (__v8di)(__m512i)(index), \
7732 (__v8si)(__m256i)(v1), (int)(scale))
7734 #define _mm512_mask_i64scatter_epi32(addr, mask, index, v1, scale) \
7735 __builtin_ia32_scatterdiv16si((void *)(addr), (__mmask8)(mask), \
7736 (__v8di)(__m512i)(index), \
7737 (__v8si)(__m256i)(v1), (int)(scale))
7739 #define _mm512_i64scatter_pd(addr, index, v1, scale) \
7740 __builtin_ia32_scatterdiv8df((void *)(addr), (__mmask8)-1, \
7741 (__v8di)(__m512i)(index), \
7742 (__v8df)(__m512d)(v1), (int)(scale))
7744 #define _mm512_mask_i64scatter_pd(addr, mask, index, v1, scale) \
7745 __builtin_ia32_scatterdiv8df((void *)(addr), (__mmask8)(mask), \
7746 (__v8di)(__m512i)(index), \
7747 (__v8df)(__m512d)(v1), (int)(scale))
7749 #define _mm512_i64scatter_epi64(addr, index, v1, scale) \
7750 __builtin_ia32_scatterdiv8di((void *)(addr), (__mmask8)-1, \
7751 (__v8di)(__m512i)(index), \
7752 (__v8di)(__m512i)(v1), (int)(scale))
7754 #define _mm512_mask_i64scatter_epi64(addr, mask, index, v1, scale) \
7755 __builtin_ia32_scatterdiv8di((void *)(addr), (__mmask8)(mask), \
7756 (__v8di)(__m512i)(index), \
7757 (__v8di)(__m512i)(v1), (int)(scale))
7759 #define _mm512_i32scatter_ps(addr, index, v1, scale) \
7760 __builtin_ia32_scattersiv16sf((void *)(addr), (__mmask16)-1, \
7761 (__v16si)(__m512i)(index), \
7762 (__v16sf)(__m512)(v1), (int)(scale))
7764 #define _mm512_mask_i32scatter_ps(addr, mask, index, v1, scale) \
7765 __builtin_ia32_scattersiv16sf((void *)(addr), (__mmask16)(mask), \
7766 (__v16si)(__m512i)(index), \
7767 (__v16sf)(__m512)(v1), (int)(scale))
7769 #define _mm512_i32scatter_epi32(addr, index, v1, scale) \
7770 __builtin_ia32_scattersiv16si((void *)(addr), (__mmask16)-1, \
7771 (__v16si)(__m512i)(index), \
7772 (__v16si)(__m512i)(v1), (int)(scale))
7774 #define _mm512_mask_i32scatter_epi32(addr, mask, index, v1, scale) \
7775 __builtin_ia32_scattersiv16si((void *)(addr), (__mmask16)(mask), \
7776 (__v16si)(__m512i)(index), \
7777 (__v16si)(__m512i)(v1), (int)(scale))
7779 #define _mm512_i32scatter_pd(addr, index, v1, scale) \
7780 __builtin_ia32_scattersiv8df((void *)(addr), (__mmask8)-1, \
7781 (__v8si)(__m256i)(index), \
7782 (__v8df)(__m512d)(v1), (int)(scale))
7784 #define _mm512_mask_i32scatter_pd(addr, mask, index, v1, scale) \
7785 __builtin_ia32_scattersiv8df((void *)(addr), (__mmask8)(mask), \
7786 (__v8si)(__m256i)(index), \
7787 (__v8df)(__m512d)(v1), (int)(scale))
7789 #define _mm512_i32scatter_epi64(addr, index, v1, scale) \
7790 __builtin_ia32_scattersiv8di((void *)(addr), (__mmask8)-1, \
7791 (__v8si)(__m256i)(index), \
7792 (__v8di)(__m512i)(v1), (int)(scale))
7794 #define _mm512_mask_i32scatter_epi64(addr, mask, index, v1, scale) \
7795 __builtin_ia32_scattersiv8di((void *)(addr), (__mmask8)(mask), \
7796 (__v8si)(__m256i)(index), \
7797 (__v8di)(__m512i)(v1), (int)(scale))
7799 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7800 _mm_mask_fmadd_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
7802 return __builtin_ia32_vfmaddss3_mask((__v4sf
)__W
,
7806 _MM_FROUND_CUR_DIRECTION
);
7809 #define _mm_fmadd_round_ss(A, B, C, R) \
7810 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(A), \
7811 (__v4sf)(__m128)(B), \
7812 (__v4sf)(__m128)(C), (__mmask8)-1, \
7815 #define _mm_mask_fmadd_round_ss(W, U, A, B, R) \
7816 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \
7817 (__v4sf)(__m128)(A), \
7818 (__v4sf)(__m128)(B), (__mmask8)(U), \
7821 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7822 _mm_maskz_fmadd_ss (__mmask8 __U
, __m128 __A
, __m128 __B
, __m128 __C
)
7824 return __builtin_ia32_vfmaddss3_maskz((__v4sf
)__A
,
7828 _MM_FROUND_CUR_DIRECTION
);
7831 #define _mm_maskz_fmadd_round_ss(U, A, B, C, R) \
7832 ((__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \
7833 (__v4sf)(__m128)(B), \
7834 (__v4sf)(__m128)(C), (__mmask8)(U), \
7837 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7838 _mm_mask3_fmadd_ss (__m128 __W
, __m128 __X
, __m128 __Y
, __mmask8 __U
)
7840 return __builtin_ia32_vfmaddss3_mask3((__v4sf
)__W
,
7844 _MM_FROUND_CUR_DIRECTION
);
7847 #define _mm_mask3_fmadd_round_ss(W, X, Y, U, R) \
7848 ((__m128)__builtin_ia32_vfmaddss3_mask3((__v4sf)(__m128)(W), \
7849 (__v4sf)(__m128)(X), \
7850 (__v4sf)(__m128)(Y), (__mmask8)(U), \
7853 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7854 _mm_mask_fmsub_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
7856 return __builtin_ia32_vfmaddss3_mask((__v4sf
)__W
,
7860 _MM_FROUND_CUR_DIRECTION
);
7863 #define _mm_fmsub_round_ss(A, B, C, R) \
7864 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(A), \
7865 (__v4sf)(__m128)(B), \
7866 -(__v4sf)(__m128)(C), (__mmask8)-1, \
7869 #define _mm_mask_fmsub_round_ss(W, U, A, B, R) \
7870 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \
7871 (__v4sf)(__m128)(A), \
7872 -(__v4sf)(__m128)(B), (__mmask8)(U), \
7875 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7876 _mm_maskz_fmsub_ss (__mmask8 __U
, __m128 __A
, __m128 __B
, __m128 __C
)
7878 return __builtin_ia32_vfmaddss3_maskz((__v4sf
)__A
,
7882 _MM_FROUND_CUR_DIRECTION
);
7885 #define _mm_maskz_fmsub_round_ss(U, A, B, C, R) \
7886 ((__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \
7887 (__v4sf)(__m128)(B), \
7888 -(__v4sf)(__m128)(C), (__mmask8)(U), \
7891 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7892 _mm_mask3_fmsub_ss (__m128 __W
, __m128 __X
, __m128 __Y
, __mmask8 __U
)
7894 return __builtin_ia32_vfmsubss3_mask3((__v4sf
)__W
,
7898 _MM_FROUND_CUR_DIRECTION
);
7901 #define _mm_mask3_fmsub_round_ss(W, X, Y, U, R) \
7902 ((__m128)__builtin_ia32_vfmsubss3_mask3((__v4sf)(__m128)(W), \
7903 (__v4sf)(__m128)(X), \
7904 (__v4sf)(__m128)(Y), (__mmask8)(U), \
7907 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7908 _mm_mask_fnmadd_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
7910 return __builtin_ia32_vfmaddss3_mask((__v4sf
)__W
,
7914 _MM_FROUND_CUR_DIRECTION
);
7917 #define _mm_fnmadd_round_ss(A, B, C, R) \
7918 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(A), \
7919 -(__v4sf)(__m128)(B), \
7920 (__v4sf)(__m128)(C), (__mmask8)-1, \
7923 #define _mm_mask_fnmadd_round_ss(W, U, A, B, R) \
7924 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \
7925 -(__v4sf)(__m128)(A), \
7926 (__v4sf)(__m128)(B), (__mmask8)(U), \
7929 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7930 _mm_maskz_fnmadd_ss (__mmask8 __U
, __m128 __A
, __m128 __B
, __m128 __C
)
7932 return __builtin_ia32_vfmaddss3_maskz((__v4sf
)__A
,
7936 _MM_FROUND_CUR_DIRECTION
);
7939 #define _mm_maskz_fnmadd_round_ss(U, A, B, C, R) \
7940 ((__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \
7941 -(__v4sf)(__m128)(B), \
7942 (__v4sf)(__m128)(C), (__mmask8)(U), \
7945 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7946 _mm_mask3_fnmadd_ss (__m128 __W
, __m128 __X
, __m128 __Y
, __mmask8 __U
)
7948 return __builtin_ia32_vfmaddss3_mask3((__v4sf
)__W
,
7952 _MM_FROUND_CUR_DIRECTION
);
7955 #define _mm_mask3_fnmadd_round_ss(W, X, Y, U, R) \
7956 ((__m128)__builtin_ia32_vfmaddss3_mask3((__v4sf)(__m128)(W), \
7957 -(__v4sf)(__m128)(X), \
7958 (__v4sf)(__m128)(Y), (__mmask8)(U), \
7961 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7962 _mm_mask_fnmsub_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
7964 return __builtin_ia32_vfmaddss3_mask((__v4sf
)__W
,
7968 _MM_FROUND_CUR_DIRECTION
);
7971 #define _mm_fnmsub_round_ss(A, B, C, R) \
7972 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(A), \
7973 -(__v4sf)(__m128)(B), \
7974 -(__v4sf)(__m128)(C), (__mmask8)-1, \
7977 #define _mm_mask_fnmsub_round_ss(W, U, A, B, R) \
7978 ((__m128)__builtin_ia32_vfmaddss3_mask((__v4sf)(__m128)(W), \
7979 -(__v4sf)(__m128)(A), \
7980 -(__v4sf)(__m128)(B), (__mmask8)(U), \
7983 static __inline__ __m128 __DEFAULT_FN_ATTRS128
7984 _mm_maskz_fnmsub_ss (__mmask8 __U
, __m128 __A
, __m128 __B
, __m128 __C
)
7986 return __builtin_ia32_vfmaddss3_maskz((__v4sf
)__A
,
7990 _MM_FROUND_CUR_DIRECTION
);
7993 #define _mm_maskz_fnmsub_round_ss(U, A, B, C, R) \
7994 ((__m128)__builtin_ia32_vfmaddss3_maskz((__v4sf)(__m128)(A), \
7995 -(__v4sf)(__m128)(B), \
7996 -(__v4sf)(__m128)(C), (__mmask8)(U), \
7999 static __inline__ __m128 __DEFAULT_FN_ATTRS128
8000 _mm_mask3_fnmsub_ss (__m128 __W
, __m128 __X
, __m128 __Y
, __mmask8 __U
)
8002 return __builtin_ia32_vfmsubss3_mask3((__v4sf
)__W
,
8006 _MM_FROUND_CUR_DIRECTION
);
8009 #define _mm_mask3_fnmsub_round_ss(W, X, Y, U, R) \
8010 ((__m128)__builtin_ia32_vfmsubss3_mask3((__v4sf)(__m128)(W), \
8011 -(__v4sf)(__m128)(X), \
8012 (__v4sf)(__m128)(Y), (__mmask8)(U), \
8015 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8016 _mm_mask_fmadd_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
8018 return __builtin_ia32_vfmaddsd3_mask((__v2df
)__W
,
8022 _MM_FROUND_CUR_DIRECTION
);
8025 #define _mm_fmadd_round_sd(A, B, C, R) \
8026 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(A), \
8027 (__v2df)(__m128d)(B), \
8028 (__v2df)(__m128d)(C), (__mmask8)-1, \
8031 #define _mm_mask_fmadd_round_sd(W, U, A, B, R) \
8032 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \
8033 (__v2df)(__m128d)(A), \
8034 (__v2df)(__m128d)(B), (__mmask8)(U), \
8037 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8038 _mm_maskz_fmadd_sd (__mmask8 __U
, __m128d __A
, __m128d __B
, __m128d __C
)
8040 return __builtin_ia32_vfmaddsd3_maskz((__v2df
)__A
,
8044 _MM_FROUND_CUR_DIRECTION
);
8047 #define _mm_maskz_fmadd_round_sd(U, A, B, C, R) \
8048 ((__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \
8049 (__v2df)(__m128d)(B), \
8050 (__v2df)(__m128d)(C), (__mmask8)(U), \
8053 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8054 _mm_mask3_fmadd_sd (__m128d __W
, __m128d __X
, __m128d __Y
, __mmask8 __U
)
8056 return __builtin_ia32_vfmaddsd3_mask3((__v2df
)__W
,
8060 _MM_FROUND_CUR_DIRECTION
);
8063 #define _mm_mask3_fmadd_round_sd(W, X, Y, U, R) \
8064 ((__m128d)__builtin_ia32_vfmaddsd3_mask3((__v2df)(__m128d)(W), \
8065 (__v2df)(__m128d)(X), \
8066 (__v2df)(__m128d)(Y), (__mmask8)(U), \
8069 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8070 _mm_mask_fmsub_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
8072 return __builtin_ia32_vfmaddsd3_mask((__v2df
)__W
,
8076 _MM_FROUND_CUR_DIRECTION
);
8079 #define _mm_fmsub_round_sd(A, B, C, R) \
8080 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(A), \
8081 (__v2df)(__m128d)(B), \
8082 -(__v2df)(__m128d)(C), (__mmask8)-1, \
8085 #define _mm_mask_fmsub_round_sd(W, U, A, B, R) \
8086 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \
8087 (__v2df)(__m128d)(A), \
8088 -(__v2df)(__m128d)(B), (__mmask8)(U), \
8091 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8092 _mm_maskz_fmsub_sd (__mmask8 __U
, __m128d __A
, __m128d __B
, __m128d __C
)
8094 return __builtin_ia32_vfmaddsd3_maskz((__v2df
)__A
,
8098 _MM_FROUND_CUR_DIRECTION
);
8101 #define _mm_maskz_fmsub_round_sd(U, A, B, C, R) \
8102 ((__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \
8103 (__v2df)(__m128d)(B), \
8104 -(__v2df)(__m128d)(C), \
8105 (__mmask8)(U), (int)(R)))
8107 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8108 _mm_mask3_fmsub_sd (__m128d __W
, __m128d __X
, __m128d __Y
, __mmask8 __U
)
8110 return __builtin_ia32_vfmsubsd3_mask3((__v2df
)__W
,
8114 _MM_FROUND_CUR_DIRECTION
);
8117 #define _mm_mask3_fmsub_round_sd(W, X, Y, U, R) \
8118 ((__m128d)__builtin_ia32_vfmsubsd3_mask3((__v2df)(__m128d)(W), \
8119 (__v2df)(__m128d)(X), \
8120 (__v2df)(__m128d)(Y), \
8121 (__mmask8)(U), (int)(R)))
8123 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8124 _mm_mask_fnmadd_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
8126 return __builtin_ia32_vfmaddsd3_mask((__v2df
)__W
,
8130 _MM_FROUND_CUR_DIRECTION
);
8133 #define _mm_fnmadd_round_sd(A, B, C, R) \
8134 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(A), \
8135 -(__v2df)(__m128d)(B), \
8136 (__v2df)(__m128d)(C), (__mmask8)-1, \
8139 #define _mm_mask_fnmadd_round_sd(W, U, A, B, R) \
8140 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \
8141 -(__v2df)(__m128d)(A), \
8142 (__v2df)(__m128d)(B), (__mmask8)(U), \
8145 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8146 _mm_maskz_fnmadd_sd (__mmask8 __U
, __m128d __A
, __m128d __B
, __m128d __C
)
8148 return __builtin_ia32_vfmaddsd3_maskz((__v2df
)__A
,
8152 _MM_FROUND_CUR_DIRECTION
);
8155 #define _mm_maskz_fnmadd_round_sd(U, A, B, C, R) \
8156 ((__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \
8157 -(__v2df)(__m128d)(B), \
8158 (__v2df)(__m128d)(C), (__mmask8)(U), \
8161 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8162 _mm_mask3_fnmadd_sd (__m128d __W
, __m128d __X
, __m128d __Y
, __mmask8 __U
)
8164 return __builtin_ia32_vfmaddsd3_mask3((__v2df
)__W
,
8168 _MM_FROUND_CUR_DIRECTION
);
8171 #define _mm_mask3_fnmadd_round_sd(W, X, Y, U, R) \
8172 ((__m128d)__builtin_ia32_vfmaddsd3_mask3((__v2df)(__m128d)(W), \
8173 -(__v2df)(__m128d)(X), \
8174 (__v2df)(__m128d)(Y), (__mmask8)(U), \
8177 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8178 _mm_mask_fnmsub_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
8180 return __builtin_ia32_vfmaddsd3_mask((__v2df
)__W
,
8184 _MM_FROUND_CUR_DIRECTION
);
8187 #define _mm_fnmsub_round_sd(A, B, C, R) \
8188 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(A), \
8189 -(__v2df)(__m128d)(B), \
8190 -(__v2df)(__m128d)(C), (__mmask8)-1, \
8193 #define _mm_mask_fnmsub_round_sd(W, U, A, B, R) \
8194 ((__m128d)__builtin_ia32_vfmaddsd3_mask((__v2df)(__m128d)(W), \
8195 -(__v2df)(__m128d)(A), \
8196 -(__v2df)(__m128d)(B), (__mmask8)(U), \
8199 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8200 _mm_maskz_fnmsub_sd (__mmask8 __U
, __m128d __A
, __m128d __B
, __m128d __C
)
8202 return __builtin_ia32_vfmaddsd3_maskz((__v2df
)__A
,
8206 _MM_FROUND_CUR_DIRECTION
);
8209 #define _mm_maskz_fnmsub_round_sd(U, A, B, C, R) \
8210 ((__m128d)__builtin_ia32_vfmaddsd3_maskz((__v2df)(__m128d)(A), \
8211 -(__v2df)(__m128d)(B), \
8212 -(__v2df)(__m128d)(C), \
8216 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8217 _mm_mask3_fnmsub_sd (__m128d __W
, __m128d __X
, __m128d __Y
, __mmask8 __U
)
8219 return __builtin_ia32_vfmsubsd3_mask3((__v2df
)__W
,
8223 _MM_FROUND_CUR_DIRECTION
);
8226 #define _mm_mask3_fnmsub_round_sd(W, X, Y, U, R) \
8227 ((__m128d)__builtin_ia32_vfmsubsd3_mask3((__v2df)(__m128d)(W), \
8228 -(__v2df)(__m128d)(X), \
8229 (__v2df)(__m128d)(Y), \
8230 (__mmask8)(U), (int)(R)))
8232 #define _mm512_permutex_pd(X, C) \
8233 ((__m512d)__builtin_ia32_permdf512((__v8df)(__m512d)(X), (int)(C)))
8235 #define _mm512_mask_permutex_pd(W, U, X, C) \
8236 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
8237 (__v8df)_mm512_permutex_pd((X), (C)), \
8238 (__v8df)(__m512d)(W)))
8240 #define _mm512_maskz_permutex_pd(U, X, C) \
8241 ((__m512d)__builtin_ia32_selectpd_512((__mmask8)(U), \
8242 (__v8df)_mm512_permutex_pd((X), (C)), \
8243 (__v8df)_mm512_setzero_pd()))
8245 #define _mm512_permutex_epi64(X, C) \
8246 ((__m512i)__builtin_ia32_permdi512((__v8di)(__m512i)(X), (int)(C)))
8248 #define _mm512_mask_permutex_epi64(W, U, X, C) \
8249 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
8250 (__v8di)_mm512_permutex_epi64((X), (C)), \
8251 (__v8di)(__m512i)(W)))
8253 #define _mm512_maskz_permutex_epi64(U, X, C) \
8254 ((__m512i)__builtin_ia32_selectq_512((__mmask8)(U), \
8255 (__v8di)_mm512_permutex_epi64((X), (C)), \
8256 (__v8di)_mm512_setzero_si512()))
8258 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8259 _mm512_permutexvar_pd (__m512i __X
, __m512d __Y
)
8261 return (__m512d
)__builtin_ia32_permvardf512((__v8df
) __Y
, (__v8di
) __X
);
8264 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8265 _mm512_mask_permutexvar_pd (__m512d __W
, __mmask8 __U
, __m512i __X
, __m512d __Y
)
8267 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
8268 (__v8df
)_mm512_permutexvar_pd(__X
, __Y
),
8272 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8273 _mm512_maskz_permutexvar_pd (__mmask8 __U
, __m512i __X
, __m512d __Y
)
8275 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
8276 (__v8df
)_mm512_permutexvar_pd(__X
, __Y
),
8277 (__v8df
)_mm512_setzero_pd());
8280 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8281 _mm512_permutexvar_epi64 (__m512i __X
, __m512i __Y
)
8283 return (__m512i
)__builtin_ia32_permvardi512((__v8di
)__Y
, (__v8di
)__X
);
8286 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8287 _mm512_maskz_permutexvar_epi64 (__mmask8 __M
, __m512i __X
, __m512i __Y
)
8289 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
8290 (__v8di
)_mm512_permutexvar_epi64(__X
, __Y
),
8291 (__v8di
)_mm512_setzero_si512());
8294 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8295 _mm512_mask_permutexvar_epi64 (__m512i __W
, __mmask8 __M
, __m512i __X
,
8298 return (__m512i
)__builtin_ia32_selectq_512((__mmask8
)__M
,
8299 (__v8di
)_mm512_permutexvar_epi64(__X
, __Y
),
8303 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8304 _mm512_permutexvar_ps (__m512i __X
, __m512 __Y
)
8306 return (__m512
)__builtin_ia32_permvarsf512((__v16sf
)__Y
, (__v16si
)__X
);
8309 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8310 _mm512_mask_permutexvar_ps (__m512 __W
, __mmask16 __U
, __m512i __X
, __m512 __Y
)
8312 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8313 (__v16sf
)_mm512_permutexvar_ps(__X
, __Y
),
8317 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8318 _mm512_maskz_permutexvar_ps (__mmask16 __U
, __m512i __X
, __m512 __Y
)
8320 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8321 (__v16sf
)_mm512_permutexvar_ps(__X
, __Y
),
8322 (__v16sf
)_mm512_setzero_ps());
8325 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8326 _mm512_permutexvar_epi32 (__m512i __X
, __m512i __Y
)
8328 return (__m512i
)__builtin_ia32_permvarsi512((__v16si
)__Y
, (__v16si
)__X
);
8331 #define _mm512_permutevar_epi32 _mm512_permutexvar_epi32
8333 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8334 _mm512_maskz_permutexvar_epi32 (__mmask16 __M
, __m512i __X
, __m512i __Y
)
8336 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
8337 (__v16si
)_mm512_permutexvar_epi32(__X
, __Y
),
8338 (__v16si
)_mm512_setzero_si512());
8341 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8342 _mm512_mask_permutexvar_epi32 (__m512i __W
, __mmask16 __M
, __m512i __X
,
8345 return (__m512i
)__builtin_ia32_selectd_512((__mmask16
)__M
,
8346 (__v16si
)_mm512_permutexvar_epi32(__X
, __Y
),
8350 #define _mm512_mask_permutevar_epi32 _mm512_mask_permutexvar_epi32
8352 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8353 _mm512_kand (__mmask16 __A
, __mmask16 __B
)
8355 return (__mmask16
) __builtin_ia32_kandhi ((__mmask16
) __A
, (__mmask16
) __B
);
8358 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8359 _mm512_kandn (__mmask16 __A
, __mmask16 __B
)
8361 return (__mmask16
) __builtin_ia32_kandnhi ((__mmask16
) __A
, (__mmask16
) __B
);
8364 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8365 _mm512_kor (__mmask16 __A
, __mmask16 __B
)
8367 return (__mmask16
) __builtin_ia32_korhi ((__mmask16
) __A
, (__mmask16
) __B
);
8370 static __inline__
int __DEFAULT_FN_ATTRS
8371 _mm512_kortestc (__mmask16 __A
, __mmask16 __B
)
8373 return __builtin_ia32_kortestchi ((__mmask16
) __A
, (__mmask16
) __B
);
8376 static __inline__
int __DEFAULT_FN_ATTRS
8377 _mm512_kortestz (__mmask16 __A
, __mmask16 __B
)
8379 return __builtin_ia32_kortestzhi ((__mmask16
) __A
, (__mmask16
) __B
);
8382 static __inline__
unsigned char __DEFAULT_FN_ATTRS
8383 _kortestc_mask16_u8(__mmask16 __A
, __mmask16 __B
)
8385 return (unsigned char)__builtin_ia32_kortestchi(__A
, __B
);
8388 static __inline__
unsigned char __DEFAULT_FN_ATTRS
8389 _kortestz_mask16_u8(__mmask16 __A
, __mmask16 __B
)
8391 return (unsigned char)__builtin_ia32_kortestzhi(__A
, __B
);
8394 static __inline__
unsigned char __DEFAULT_FN_ATTRS
8395 _kortest_mask16_u8(__mmask16 __A
, __mmask16 __B
, unsigned char *__C
) {
8396 *__C
= (unsigned char)__builtin_ia32_kortestchi(__A
, __B
);
8397 return (unsigned char)__builtin_ia32_kortestzhi(__A
, __B
);
8400 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8401 _mm512_kunpackb (__mmask16 __A
, __mmask16 __B
)
8403 return (__mmask16
) __builtin_ia32_kunpckhi ((__mmask16
) __A
, (__mmask16
) __B
);
8406 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8407 _mm512_kxnor (__mmask16 __A
, __mmask16 __B
)
8409 return (__mmask16
) __builtin_ia32_kxnorhi ((__mmask16
) __A
, (__mmask16
) __B
);
8412 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8413 _mm512_kxor (__mmask16 __A
, __mmask16 __B
)
8415 return (__mmask16
) __builtin_ia32_kxorhi ((__mmask16
) __A
, (__mmask16
) __B
);
8418 #define _kand_mask16 _mm512_kand
8419 #define _kandn_mask16 _mm512_kandn
8420 #define _knot_mask16 _mm512_knot
8421 #define _kor_mask16 _mm512_kor
8422 #define _kxnor_mask16 _mm512_kxnor
8423 #define _kxor_mask16 _mm512_kxor
8425 #define _kshiftli_mask16(A, I) \
8426 ((__mmask16)__builtin_ia32_kshiftlihi((__mmask16)(A), (unsigned int)(I)))
8428 #define _kshiftri_mask16(A, I) \
8429 ((__mmask16)__builtin_ia32_kshiftrihi((__mmask16)(A), (unsigned int)(I)))
8431 static __inline__
unsigned int __DEFAULT_FN_ATTRS
8432 _cvtmask16_u32(__mmask16 __A
) {
8433 return (unsigned int)__builtin_ia32_kmovw((__mmask16
)__A
);
8436 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8437 _cvtu32_mask16(unsigned int __A
) {
8438 return (__mmask16
)__builtin_ia32_kmovw((__mmask16
)__A
);
8441 static __inline__ __mmask16 __DEFAULT_FN_ATTRS
8442 _load_mask16(__mmask16
*__A
) {
8443 return (__mmask16
)__builtin_ia32_kmovw(*(__mmask16
*)__A
);
8446 static __inline__
void __DEFAULT_FN_ATTRS
8447 _store_mask16(__mmask16
*__A
, __mmask16 __B
) {
8448 *(__mmask16
*)__A
= __builtin_ia32_kmovw((__mmask16
)__B
);
8451 static __inline__
void __DEFAULT_FN_ATTRS512
8452 _mm512_stream_si512 (void * __P
, __m512i __A
)
8454 typedef __v8di __v8di_aligned
__attribute__((aligned(64)));
8455 __builtin_nontemporal_store((__v8di_aligned
)__A
, (__v8di_aligned
*)__P
);
8458 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8459 _mm512_stream_load_si512 (void const *__P
)
8461 typedef __v8di __v8di_aligned
__attribute__((aligned(64)));
8462 return (__m512i
) __builtin_nontemporal_load((const __v8di_aligned
*)__P
);
8465 static __inline__
void __DEFAULT_FN_ATTRS512
8466 _mm512_stream_pd (void *__P
, __m512d __A
)
8468 typedef __v8df __v8df_aligned
__attribute__((aligned(64)));
8469 __builtin_nontemporal_store((__v8df_aligned
)__A
, (__v8df_aligned
*)__P
);
8472 static __inline__
void __DEFAULT_FN_ATTRS512
8473 _mm512_stream_ps (void *__P
, __m512 __A
)
8475 typedef __v16sf __v16sf_aligned
__attribute__((aligned(64)));
8476 __builtin_nontemporal_store((__v16sf_aligned
)__A
, (__v16sf_aligned
*)__P
);
8479 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8480 _mm512_mask_compress_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
8482 return (__m512d
) __builtin_ia32_compressdf512_mask ((__v8df
) __A
,
8487 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8488 _mm512_maskz_compress_pd (__mmask8 __U
, __m512d __A
)
8490 return (__m512d
) __builtin_ia32_compressdf512_mask ((__v8df
) __A
,
8492 _mm512_setzero_pd (),
8496 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8497 _mm512_mask_compress_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
8499 return (__m512i
) __builtin_ia32_compressdi512_mask ((__v8di
) __A
,
8504 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8505 _mm512_maskz_compress_epi64 (__mmask8 __U
, __m512i __A
)
8507 return (__m512i
) __builtin_ia32_compressdi512_mask ((__v8di
) __A
,
8509 _mm512_setzero_si512 (),
8513 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8514 _mm512_mask_compress_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
8516 return (__m512
) __builtin_ia32_compresssf512_mask ((__v16sf
) __A
,
8521 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8522 _mm512_maskz_compress_ps (__mmask16 __U
, __m512 __A
)
8524 return (__m512
) __builtin_ia32_compresssf512_mask ((__v16sf
) __A
,
8526 _mm512_setzero_ps (),
8530 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8531 _mm512_mask_compress_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
8533 return (__m512i
) __builtin_ia32_compresssi512_mask ((__v16si
) __A
,
8538 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8539 _mm512_maskz_compress_epi32 (__mmask16 __U
, __m512i __A
)
8541 return (__m512i
) __builtin_ia32_compresssi512_mask ((__v16si
) __A
,
8543 _mm512_setzero_si512 (),
8547 #define _mm_cmp_round_ss_mask(X, Y, P, R) \
8548 ((__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \
8549 (__v4sf)(__m128)(Y), (int)(P), \
8550 (__mmask8)-1, (int)(R)))
8552 #define _mm_mask_cmp_round_ss_mask(M, X, Y, P, R) \
8553 ((__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \
8554 (__v4sf)(__m128)(Y), (int)(P), \
8555 (__mmask8)(M), (int)(R)))
8557 #define _mm_cmp_ss_mask(X, Y, P) \
8558 ((__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \
8559 (__v4sf)(__m128)(Y), (int)(P), \
8561 _MM_FROUND_CUR_DIRECTION))
8563 #define _mm_mask_cmp_ss_mask(M, X, Y, P) \
8564 ((__mmask8)__builtin_ia32_cmpss_mask((__v4sf)(__m128)(X), \
8565 (__v4sf)(__m128)(Y), (int)(P), \
8567 _MM_FROUND_CUR_DIRECTION))
8569 #define _mm_cmp_round_sd_mask(X, Y, P, R) \
8570 ((__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \
8571 (__v2df)(__m128d)(Y), (int)(P), \
8572 (__mmask8)-1, (int)(R)))
8574 #define _mm_mask_cmp_round_sd_mask(M, X, Y, P, R) \
8575 ((__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \
8576 (__v2df)(__m128d)(Y), (int)(P), \
8577 (__mmask8)(M), (int)(R)))
8579 #define _mm_cmp_sd_mask(X, Y, P) \
8580 ((__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \
8581 (__v2df)(__m128d)(Y), (int)(P), \
8583 _MM_FROUND_CUR_DIRECTION))
8585 #define _mm_mask_cmp_sd_mask(M, X, Y, P) \
8586 ((__mmask8)__builtin_ia32_cmpsd_mask((__v2df)(__m128d)(X), \
8587 (__v2df)(__m128d)(Y), (int)(P), \
8589 _MM_FROUND_CUR_DIRECTION))
8593 static __inline __mmask16 __DEFAULT_FN_ATTRS512
8594 _mm512_test_epi32_mask (__m512i __A
, __m512i __B
)
8596 return _mm512_cmpneq_epi32_mask (_mm512_and_epi32(__A
, __B
),
8597 _mm512_setzero_si512());
8600 static __inline__ __mmask16 __DEFAULT_FN_ATTRS512
8601 _mm512_mask_test_epi32_mask (__mmask16 __U
, __m512i __A
, __m512i __B
)
8603 return _mm512_mask_cmpneq_epi32_mask (__U
, _mm512_and_epi32 (__A
, __B
),
8604 _mm512_setzero_si512());
8607 static __inline __mmask8 __DEFAULT_FN_ATTRS512
8608 _mm512_test_epi64_mask (__m512i __A
, __m512i __B
)
8610 return _mm512_cmpneq_epi64_mask (_mm512_and_epi32 (__A
, __B
),
8611 _mm512_setzero_si512());
8614 static __inline__ __mmask8 __DEFAULT_FN_ATTRS512
8615 _mm512_mask_test_epi64_mask (__mmask8 __U
, __m512i __A
, __m512i __B
)
8617 return _mm512_mask_cmpneq_epi64_mask (__U
, _mm512_and_epi32 (__A
, __B
),
8618 _mm512_setzero_si512());
8621 static __inline__ __mmask16 __DEFAULT_FN_ATTRS512
8622 _mm512_testn_epi32_mask (__m512i __A
, __m512i __B
)
8624 return _mm512_cmpeq_epi32_mask (_mm512_and_epi32 (__A
, __B
),
8625 _mm512_setzero_si512());
8628 static __inline__ __mmask16 __DEFAULT_FN_ATTRS512
8629 _mm512_mask_testn_epi32_mask (__mmask16 __U
, __m512i __A
, __m512i __B
)
8631 return _mm512_mask_cmpeq_epi32_mask (__U
, _mm512_and_epi32 (__A
, __B
),
8632 _mm512_setzero_si512());
8635 static __inline__ __mmask8 __DEFAULT_FN_ATTRS512
8636 _mm512_testn_epi64_mask (__m512i __A
, __m512i __B
)
8638 return _mm512_cmpeq_epi64_mask (_mm512_and_epi32 (__A
, __B
),
8639 _mm512_setzero_si512());
8642 static __inline__ __mmask8 __DEFAULT_FN_ATTRS512
8643 _mm512_mask_testn_epi64_mask (__mmask8 __U
, __m512i __A
, __m512i __B
)
8645 return _mm512_mask_cmpeq_epi64_mask (__U
, _mm512_and_epi32 (__A
, __B
),
8646 _mm512_setzero_si512());
8649 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8650 _mm512_movehdup_ps (__m512 __A
)
8652 return (__m512
)__builtin_shufflevector((__v16sf
)__A
, (__v16sf
)__A
,
8653 1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, 15, 15);
8656 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8657 _mm512_mask_movehdup_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
8659 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8660 (__v16sf
)_mm512_movehdup_ps(__A
),
8664 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8665 _mm512_maskz_movehdup_ps (__mmask16 __U
, __m512 __A
)
8667 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8668 (__v16sf
)_mm512_movehdup_ps(__A
),
8669 (__v16sf
)_mm512_setzero_ps());
8672 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8673 _mm512_moveldup_ps (__m512 __A
)
8675 return (__m512
)__builtin_shufflevector((__v16sf
)__A
, (__v16sf
)__A
,
8676 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14);
8679 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8680 _mm512_mask_moveldup_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
8682 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8683 (__v16sf
)_mm512_moveldup_ps(__A
),
8687 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8688 _mm512_maskz_moveldup_ps (__mmask16 __U
, __m512 __A
)
8690 return (__m512
)__builtin_ia32_selectps_512((__mmask16
)__U
,
8691 (__v16sf
)_mm512_moveldup_ps(__A
),
8692 (__v16sf
)_mm512_setzero_ps());
8695 static __inline__ __m128 __DEFAULT_FN_ATTRS128
8696 _mm_mask_move_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128 __B
)
8698 return __builtin_ia32_selectss_128(__U
, _mm_move_ss(__A
, __B
), __W
);
8701 static __inline__ __m128 __DEFAULT_FN_ATTRS128
8702 _mm_maskz_move_ss (__mmask8 __U
, __m128 __A
, __m128 __B
)
8704 return __builtin_ia32_selectss_128(__U
, _mm_move_ss(__A
, __B
),
8708 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8709 _mm_mask_move_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128d __B
)
8711 return __builtin_ia32_selectsd_128(__U
, _mm_move_sd(__A
, __B
), __W
);
8714 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8715 _mm_maskz_move_sd (__mmask8 __U
, __m128d __A
, __m128d __B
)
8717 return __builtin_ia32_selectsd_128(__U
, _mm_move_sd(__A
, __B
),
8721 static __inline__
void __DEFAULT_FN_ATTRS128
8722 _mm_mask_store_ss (float * __W
, __mmask8 __U
, __m128 __A
)
8724 __builtin_ia32_storess128_mask ((__v4sf
*)__W
, __A
, __U
& 1);
8727 static __inline__
void __DEFAULT_FN_ATTRS128
8728 _mm_mask_store_sd (double * __W
, __mmask8 __U
, __m128d __A
)
8730 __builtin_ia32_storesd128_mask ((__v2df
*)__W
, __A
, __U
& 1);
8733 static __inline__ __m128 __DEFAULT_FN_ATTRS128
8734 _mm_mask_load_ss (__m128 __W
, __mmask8 __U
, const float* __A
)
8736 __m128 src
= (__v4sf
) __builtin_shufflevector((__v4sf
) __W
,
8737 (__v4sf
)_mm_setzero_ps(),
8740 return (__m128
) __builtin_ia32_loadss128_mask ((const __v4sf
*) __A
, src
, __U
& 1);
8743 static __inline__ __m128 __DEFAULT_FN_ATTRS128
8744 _mm_maskz_load_ss (__mmask8 __U
, const float* __A
)
8746 return (__m128
)__builtin_ia32_loadss128_mask ((const __v4sf
*) __A
,
8747 (__v4sf
) _mm_setzero_ps(),
8751 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8752 _mm_mask_load_sd (__m128d __W
, __mmask8 __U
, const double* __A
)
8754 __m128d src
= (__v2df
) __builtin_shufflevector((__v2df
) __W
,
8755 (__v2df
)_mm_setzero_pd(),
8758 return (__m128d
) __builtin_ia32_loadsd128_mask ((const __v2df
*) __A
, src
, __U
& 1);
8761 static __inline__ __m128d __DEFAULT_FN_ATTRS128
8762 _mm_maskz_load_sd (__mmask8 __U
, const double* __A
)
8764 return (__m128d
) __builtin_ia32_loadsd128_mask ((const __v2df
*) __A
,
8765 (__v2df
) _mm_setzero_pd(),
8769 #define _mm512_shuffle_epi32(A, I) \
8770 ((__m512i)__builtin_ia32_pshufd512((__v16si)(__m512i)(A), (int)(I)))
8772 #define _mm512_mask_shuffle_epi32(W, U, A, I) \
8773 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
8774 (__v16si)_mm512_shuffle_epi32((A), (I)), \
8775 (__v16si)(__m512i)(W)))
8777 #define _mm512_maskz_shuffle_epi32(U, A, I) \
8778 ((__m512i)__builtin_ia32_selectd_512((__mmask16)(U), \
8779 (__v16si)_mm512_shuffle_epi32((A), (I)), \
8780 (__v16si)_mm512_setzero_si512()))
8782 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8783 _mm512_mask_expand_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
8785 return (__m512d
) __builtin_ia32_expanddf512_mask ((__v8df
) __A
,
8790 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8791 _mm512_maskz_expand_pd (__mmask8 __U
, __m512d __A
)
8793 return (__m512d
) __builtin_ia32_expanddf512_mask ((__v8df
) __A
,
8794 (__v8df
) _mm512_setzero_pd (),
8798 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8799 _mm512_mask_expand_epi64 (__m512i __W
, __mmask8 __U
, __m512i __A
)
8801 return (__m512i
) __builtin_ia32_expanddi512_mask ((__v8di
) __A
,
8806 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8807 _mm512_maskz_expand_epi64 ( __mmask8 __U
, __m512i __A
)
8809 return (__m512i
) __builtin_ia32_expanddi512_mask ((__v8di
) __A
,
8810 (__v8di
) _mm512_setzero_si512 (),
8814 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8815 _mm512_mask_expandloadu_pd(__m512d __W
, __mmask8 __U
, void const *__P
)
8817 return (__m512d
) __builtin_ia32_expandloaddf512_mask ((const __v8df
*)__P
,
8822 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8823 _mm512_maskz_expandloadu_pd(__mmask8 __U
, void const *__P
)
8825 return (__m512d
) __builtin_ia32_expandloaddf512_mask ((const __v8df
*)__P
,
8826 (__v8df
) _mm512_setzero_pd(),
8830 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8831 _mm512_mask_expandloadu_epi64(__m512i __W
, __mmask8 __U
, void const *__P
)
8833 return (__m512i
) __builtin_ia32_expandloaddi512_mask ((const __v8di
*)__P
,
8838 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8839 _mm512_maskz_expandloadu_epi64(__mmask8 __U
, void const *__P
)
8841 return (__m512i
) __builtin_ia32_expandloaddi512_mask ((const __v8di
*)__P
,
8842 (__v8di
) _mm512_setzero_si512(),
8846 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8847 _mm512_mask_expandloadu_ps(__m512 __W
, __mmask16 __U
, void const *__P
)
8849 return (__m512
) __builtin_ia32_expandloadsf512_mask ((const __v16sf
*)__P
,
8854 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8855 _mm512_maskz_expandloadu_ps(__mmask16 __U
, void const *__P
)
8857 return (__m512
) __builtin_ia32_expandloadsf512_mask ((const __v16sf
*)__P
,
8858 (__v16sf
) _mm512_setzero_ps(),
8862 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8863 _mm512_mask_expandloadu_epi32(__m512i __W
, __mmask16 __U
, void const *__P
)
8865 return (__m512i
) __builtin_ia32_expandloadsi512_mask ((const __v16si
*)__P
,
8870 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8871 _mm512_maskz_expandloadu_epi32(__mmask16 __U
, void const *__P
)
8873 return (__m512i
) __builtin_ia32_expandloadsi512_mask ((const __v16si
*)__P
,
8874 (__v16si
) _mm512_setzero_si512(),
8878 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8879 _mm512_mask_expand_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
8881 return (__m512
) __builtin_ia32_expandsf512_mask ((__v16sf
) __A
,
8886 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8887 _mm512_maskz_expand_ps (__mmask16 __U
, __m512 __A
)
8889 return (__m512
) __builtin_ia32_expandsf512_mask ((__v16sf
) __A
,
8890 (__v16sf
) _mm512_setzero_ps(),
8894 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8895 _mm512_mask_expand_epi32 (__m512i __W
, __mmask16 __U
, __m512i __A
)
8897 return (__m512i
) __builtin_ia32_expandsi512_mask ((__v16si
) __A
,
8902 static __inline__ __m512i __DEFAULT_FN_ATTRS512
8903 _mm512_maskz_expand_epi32 (__mmask16 __U
, __m512i __A
)
8905 return (__m512i
) __builtin_ia32_expandsi512_mask ((__v16si
) __A
,
8906 (__v16si
) _mm512_setzero_si512(),
8910 #define _mm512_cvt_roundps_pd(A, R) \
8911 ((__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \
8912 (__v8df)_mm512_undefined_pd(), \
8913 (__mmask8)-1, (int)(R)))
8915 #define _mm512_mask_cvt_roundps_pd(W, U, A, R) \
8916 ((__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \
8917 (__v8df)(__m512d)(W), \
8918 (__mmask8)(U), (int)(R)))
8920 #define _mm512_maskz_cvt_roundps_pd(U, A, R) \
8921 ((__m512d)__builtin_ia32_cvtps2pd512_mask((__v8sf)(__m256)(A), \
8922 (__v8df)_mm512_setzero_pd(), \
8923 (__mmask8)(U), (int)(R)))
8925 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8926 _mm512_cvtps_pd (__m256 __A
)
8928 return (__m512d
) __builtin_convertvector((__v8sf
)__A
, __v8df
);
8931 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8932 _mm512_mask_cvtps_pd (__m512d __W
, __mmask8 __U
, __m256 __A
)
8934 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
8935 (__v8df
)_mm512_cvtps_pd(__A
),
8939 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8940 _mm512_maskz_cvtps_pd (__mmask8 __U
, __m256 __A
)
8942 return (__m512d
)__builtin_ia32_selectpd_512((__mmask8
)__U
,
8943 (__v8df
)_mm512_cvtps_pd(__A
),
8944 (__v8df
)_mm512_setzero_pd());
8947 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8948 _mm512_cvtpslo_pd (__m512 __A
)
8950 return (__m512d
) _mm512_cvtps_pd(_mm512_castps512_ps256(__A
));
8953 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8954 _mm512_mask_cvtpslo_pd (__m512d __W
, __mmask8 __U
, __m512 __A
)
8956 return (__m512d
) _mm512_mask_cvtps_pd(__W
, __U
, _mm512_castps512_ps256(__A
));
8959 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8960 _mm512_mask_mov_pd (__m512d __W
, __mmask8 __U
, __m512d __A
)
8962 return (__m512d
) __builtin_ia32_selectpd_512 ((__mmask8
) __U
,
8967 static __inline__ __m512d __DEFAULT_FN_ATTRS512
8968 _mm512_maskz_mov_pd (__mmask8 __U
, __m512d __A
)
8970 return (__m512d
) __builtin_ia32_selectpd_512 ((__mmask8
) __U
,
8972 (__v8df
) _mm512_setzero_pd ());
8975 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8976 _mm512_mask_mov_ps (__m512 __W
, __mmask16 __U
, __m512 __A
)
8978 return (__m512
) __builtin_ia32_selectps_512 ((__mmask16
) __U
,
8983 static __inline__ __m512 __DEFAULT_FN_ATTRS512
8984 _mm512_maskz_mov_ps (__mmask16 __U
, __m512 __A
)
8986 return (__m512
) __builtin_ia32_selectps_512 ((__mmask16
) __U
,
8988 (__v16sf
) _mm512_setzero_ps ());
8991 static __inline__
void __DEFAULT_FN_ATTRS512
8992 _mm512_mask_compressstoreu_pd (void *__P
, __mmask8 __U
, __m512d __A
)
8994 __builtin_ia32_compressstoredf512_mask ((__v8df
*) __P
, (__v8df
) __A
,
8998 static __inline__
void __DEFAULT_FN_ATTRS512
8999 _mm512_mask_compressstoreu_epi64 (void *__P
, __mmask8 __U
, __m512i __A
)
9001 __builtin_ia32_compressstoredi512_mask ((__v8di
*) __P
, (__v8di
) __A
,
9005 static __inline__
void __DEFAULT_FN_ATTRS512
9006 _mm512_mask_compressstoreu_ps (void *__P
, __mmask16 __U
, __m512 __A
)
9008 __builtin_ia32_compressstoresf512_mask ((__v16sf
*) __P
, (__v16sf
) __A
,
9012 static __inline__
void __DEFAULT_FN_ATTRS512
9013 _mm512_mask_compressstoreu_epi32 (void *__P
, __mmask16 __U
, __m512i __A
)
9015 __builtin_ia32_compressstoresi512_mask ((__v16si
*) __P
, (__v16si
) __A
,
9019 #define _mm_cvt_roundsd_ss(A, B, R) \
9020 ((__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \
9021 (__v2df)(__m128d)(B), \
9022 (__v4sf)_mm_undefined_ps(), \
9023 (__mmask8)-1, (int)(R)))
9025 #define _mm_mask_cvt_roundsd_ss(W, U, A, B, R) \
9026 ((__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \
9027 (__v2df)(__m128d)(B), \
9028 (__v4sf)(__m128)(W), \
9029 (__mmask8)(U), (int)(R)))
9031 #define _mm_maskz_cvt_roundsd_ss(U, A, B, R) \
9032 ((__m128)__builtin_ia32_cvtsd2ss_round_mask((__v4sf)(__m128)(A), \
9033 (__v2df)(__m128d)(B), \
9034 (__v4sf)_mm_setzero_ps(), \
9035 (__mmask8)(U), (int)(R)))
9037 static __inline__ __m128 __DEFAULT_FN_ATTRS128
9038 _mm_mask_cvtsd_ss (__m128 __W
, __mmask8 __U
, __m128 __A
, __m128d __B
)
9040 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf
)__A
,
9043 (__mmask8
)__U
, _MM_FROUND_CUR_DIRECTION
);
9046 static __inline__ __m128 __DEFAULT_FN_ATTRS128
9047 _mm_maskz_cvtsd_ss (__mmask8 __U
, __m128 __A
, __m128d __B
)
9049 return __builtin_ia32_cvtsd2ss_round_mask ((__v4sf
)__A
,
9051 (__v4sf
)_mm_setzero_ps(),
9052 (__mmask8
)__U
, _MM_FROUND_CUR_DIRECTION
);
9055 #define _mm_cvtss_i32 _mm_cvtss_si32
9056 #define _mm_cvtsd_i32 _mm_cvtsd_si32
9057 #define _mm_cvti32_sd _mm_cvtsi32_sd
9058 #define _mm_cvti32_ss _mm_cvtsi32_ss
9060 #define _mm_cvtss_i64 _mm_cvtss_si64
9061 #define _mm_cvtsd_i64 _mm_cvtsd_si64
9062 #define _mm_cvti64_sd _mm_cvtsi64_sd
9063 #define _mm_cvti64_ss _mm_cvtsi64_ss
9067 #define _mm_cvt_roundi64_sd(A, B, R) \
9068 ((__m128d)__builtin_ia32_cvtsi2sd64((__v2df)(__m128d)(A), (long long)(B), \
9071 #define _mm_cvt_roundsi64_sd(A, B, R) \
9072 ((__m128d)__builtin_ia32_cvtsi2sd64((__v2df)(__m128d)(A), (long long)(B), \
9076 #define _mm_cvt_roundsi32_ss(A, B, R) \
9077 ((__m128)__builtin_ia32_cvtsi2ss32((__v4sf)(__m128)(A), (int)(B), (int)(R)))
9079 #define _mm_cvt_roundi32_ss(A, B, R) \
9080 ((__m128)__builtin_ia32_cvtsi2ss32((__v4sf)(__m128)(A), (int)(B), (int)(R)))
9083 #define _mm_cvt_roundsi64_ss(A, B, R) \
9084 ((__m128)__builtin_ia32_cvtsi2ss64((__v4sf)(__m128)(A), (long long)(B), \
9087 #define _mm_cvt_roundi64_ss(A, B, R) \
9088 ((__m128)__builtin_ia32_cvtsi2ss64((__v4sf)(__m128)(A), (long long)(B), \
9092 #define _mm_cvt_roundss_sd(A, B, R) \
9093 ((__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \
9094 (__v4sf)(__m128)(B), \
9095 (__v2df)_mm_undefined_pd(), \
9096 (__mmask8)-1, (int)(R)))
9098 #define _mm_mask_cvt_roundss_sd(W, U, A, B, R) \
9099 ((__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \
9100 (__v4sf)(__m128)(B), \
9101 (__v2df)(__m128d)(W), \
9102 (__mmask8)(U), (int)(R)))
9104 #define _mm_maskz_cvt_roundss_sd(U, A, B, R) \
9105 ((__m128d)__builtin_ia32_cvtss2sd_round_mask((__v2df)(__m128d)(A), \
9106 (__v4sf)(__m128)(B), \
9107 (__v2df)_mm_setzero_pd(), \
9108 (__mmask8)(U), (int)(R)))
9110 static __inline__ __m128d __DEFAULT_FN_ATTRS128
9111 _mm_mask_cvtss_sd (__m128d __W
, __mmask8 __U
, __m128d __A
, __m128 __B
)
9113 return __builtin_ia32_cvtss2sd_round_mask((__v2df
)__A
,
9116 (__mmask8
)__U
, _MM_FROUND_CUR_DIRECTION
);
9119 static __inline__ __m128d __DEFAULT_FN_ATTRS128
9120 _mm_maskz_cvtss_sd (__mmask8 __U
, __m128d __A
, __m128 __B
)
9122 return __builtin_ia32_cvtss2sd_round_mask((__v2df
)__A
,
9124 (__v2df
)_mm_setzero_pd(),
9125 (__mmask8
)__U
, _MM_FROUND_CUR_DIRECTION
);
9128 static __inline__ __m128d __DEFAULT_FN_ATTRS128
9129 _mm_cvtu32_sd (__m128d __A
, unsigned __B
)
9136 #define _mm_cvt_roundu64_sd(A, B, R) \
9137 ((__m128d)__builtin_ia32_cvtusi2sd64((__v2df)(__m128d)(A), \
9138 (unsigned long long)(B), (int)(R)))
9140 static __inline__ __m128d __DEFAULT_FN_ATTRS128
9141 _mm_cvtu64_sd (__m128d __A
, unsigned long long __B
)
9148 #define _mm_cvt_roundu32_ss(A, B, R) \
9149 ((__m128)__builtin_ia32_cvtusi2ss32((__v4sf)(__m128)(A), (unsigned int)(B), \
9152 static __inline__ __m128 __DEFAULT_FN_ATTRS128
9153 _mm_cvtu32_ss (__m128 __A
, unsigned __B
)
9160 #define _mm_cvt_roundu64_ss(A, B, R) \
9161 ((__m128)__builtin_ia32_cvtusi2ss64((__v4sf)(__m128)(A), \
9162 (unsigned long long)(B), (int)(R)))
9164 static __inline__ __m128 __DEFAULT_FN_ATTRS128
9165 _mm_cvtu64_ss (__m128 __A
, unsigned long long __B
)
9172 static __inline__ __m512i __DEFAULT_FN_ATTRS512
9173 _mm512_mask_set1_epi32 (__m512i __O
, __mmask16 __M
, int __A
)
9175 return (__m512i
) __builtin_ia32_selectd_512(__M
,
9176 (__v16si
) _mm512_set1_epi32(__A
),
9180 static __inline__ __m512i __DEFAULT_FN_ATTRS512
9181 _mm512_mask_set1_epi64 (__m512i __O
, __mmask8 __M
, long long __A
)
9183 return (__m512i
) __builtin_ia32_selectq_512(__M
,
9184 (__v8di
) _mm512_set1_epi64(__A
),
9188 static __inline __m512i __DEFAULT_FN_ATTRS512
9189 _mm512_set_epi8 (char __e63
, char __e62
, char __e61
, char __e60
, char __e59
,
9190 char __e58
, char __e57
, char __e56
, char __e55
, char __e54
, char __e53
,
9191 char __e52
, char __e51
, char __e50
, char __e49
, char __e48
, char __e47
,
9192 char __e46
, char __e45
, char __e44
, char __e43
, char __e42
, char __e41
,
9193 char __e40
, char __e39
, char __e38
, char __e37
, char __e36
, char __e35
,
9194 char __e34
, char __e33
, char __e32
, char __e31
, char __e30
, char __e29
,
9195 char __e28
, char __e27
, char __e26
, char __e25
, char __e24
, char __e23
,
9196 char __e22
, char __e21
, char __e20
, char __e19
, char __e18
, char __e17
,
9197 char __e16
, char __e15
, char __e14
, char __e13
, char __e12
, char __e11
,
9198 char __e10
, char __e9
, char __e8
, char __e7
, char __e6
, char __e5
,
9199 char __e4
, char __e3
, char __e2
, char __e1
, char __e0
) {
9201 return __extension__ (__m512i
)(__v64qi
)
9202 {__e0
, __e1
, __e2
, __e3
, __e4
, __e5
, __e6
, __e7
,
9203 __e8
, __e9
, __e10
, __e11
, __e12
, __e13
, __e14
, __e15
,
9204 __e16
, __e17
, __e18
, __e19
, __e20
, __e21
, __e22
, __e23
,
9205 __e24
, __e25
, __e26
, __e27
, __e28
, __e29
, __e30
, __e31
,
9206 __e32
, __e33
, __e34
, __e35
, __e36
, __e37
, __e38
, __e39
,
9207 __e40
, __e41
, __e42
, __e43
, __e44
, __e45
, __e46
, __e47
,
9208 __e48
, __e49
, __e50
, __e51
, __e52
, __e53
, __e54
, __e55
,
9209 __e56
, __e57
, __e58
, __e59
, __e60
, __e61
, __e62
, __e63
};
9212 static __inline __m512i __DEFAULT_FN_ATTRS512
9213 _mm512_set_epi16(short __e31
, short __e30
, short __e29
, short __e28
,
9214 short __e27
, short __e26
, short __e25
, short __e24
, short __e23
,
9215 short __e22
, short __e21
, short __e20
, short __e19
, short __e18
,
9216 short __e17
, short __e16
, short __e15
, short __e14
, short __e13
,
9217 short __e12
, short __e11
, short __e10
, short __e9
, short __e8
,
9218 short __e7
, short __e6
, short __e5
, short __e4
, short __e3
,
9219 short __e2
, short __e1
, short __e0
) {
9220 return __extension__ (__m512i
)(__v32hi
)
9221 {__e0
, __e1
, __e2
, __e3
, __e4
, __e5
, __e6
, __e7
,
9222 __e8
, __e9
, __e10
, __e11
, __e12
, __e13
, __e14
, __e15
,
9223 __e16
, __e17
, __e18
, __e19
, __e20
, __e21
, __e22
, __e23
,
9224 __e24
, __e25
, __e26
, __e27
, __e28
, __e29
, __e30
, __e31
};
9227 static __inline __m512i __DEFAULT_FN_ATTRS512
9228 _mm512_set_epi32 (int __A
, int __B
, int __C
, int __D
,
9229 int __E
, int __F
, int __G
, int __H
,
9230 int __I
, int __J
, int __K
, int __L
,
9231 int __M
, int __N
, int __O
, int __P
)
9233 return __extension__ (__m512i
)(__v16si
)
9234 { __P
, __O
, __N
, __M
, __L
, __K
, __J
, __I
,
9235 __H
, __G
, __F
, __E
, __D
, __C
, __B
, __A
};
9238 #define _mm512_setr_epi32(e0,e1,e2,e3,e4,e5,e6,e7, \
9239 e8,e9,e10,e11,e12,e13,e14,e15) \
9240 _mm512_set_epi32((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6), \
9241 (e5),(e4),(e3),(e2),(e1),(e0))
9243 static __inline__ __m512i __DEFAULT_FN_ATTRS512
9244 _mm512_set_epi64 (long long __A
, long long __B
, long long __C
,
9245 long long __D
, long long __E
, long long __F
,
9246 long long __G
, long long __H
)
9248 return __extension__ (__m512i
) (__v8di
)
9249 { __H
, __G
, __F
, __E
, __D
, __C
, __B
, __A
};
9252 #define _mm512_setr_epi64(e0,e1,e2,e3,e4,e5,e6,e7) \
9253 _mm512_set_epi64((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0))
9255 static __inline__ __m512d __DEFAULT_FN_ATTRS512
9256 _mm512_set_pd (double __A
, double __B
, double __C
, double __D
,
9257 double __E
, double __F
, double __G
, double __H
)
9259 return __extension__ (__m512d
)
9260 { __H
, __G
, __F
, __E
, __D
, __C
, __B
, __A
};
9263 #define _mm512_setr_pd(e0,e1,e2,e3,e4,e5,e6,e7) \
9264 _mm512_set_pd((e7),(e6),(e5),(e4),(e3),(e2),(e1),(e0))
9266 static __inline__ __m512 __DEFAULT_FN_ATTRS512
9267 _mm512_set_ps (float __A
, float __B
, float __C
, float __D
,
9268 float __E
, float __F
, float __G
, float __H
,
9269 float __I
, float __J
, float __K
, float __L
,
9270 float __M
, float __N
, float __O
, float __P
)
9272 return __extension__ (__m512
)
9273 { __P
, __O
, __N
, __M
, __L
, __K
, __J
, __I
,
9274 __H
, __G
, __F
, __E
, __D
, __C
, __B
, __A
};
9277 #define _mm512_setr_ps(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15) \
9278 _mm512_set_ps((e15),(e14),(e13),(e12),(e11),(e10),(e9),(e8),(e7),(e6),(e5), \
9279 (e4),(e3),(e2),(e1),(e0))
9281 static __inline__ __m512 __DEFAULT_FN_ATTRS512
9282 _mm512_abs_ps(__m512 __A
)
9284 return (__m512
)_mm512_and_epi32(_mm512_set1_epi32(0x7FFFFFFF),(__m512i
)__A
) ;
9287 static __inline__ __m512 __DEFAULT_FN_ATTRS512
9288 _mm512_mask_abs_ps(__m512 __W
, __mmask16 __K
, __m512 __A
)
9290 return (__m512
)_mm512_mask_and_epi32((__m512i
)__W
, __K
, _mm512_set1_epi32(0x7FFFFFFF),(__m512i
)__A
) ;
9293 static __inline__ __m512d __DEFAULT_FN_ATTRS512
9294 _mm512_abs_pd(__m512d __A
)
9296 return (__m512d
)_mm512_and_epi64(_mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di
)__A
) ;
9299 static __inline__ __m512d __DEFAULT_FN_ATTRS512
9300 _mm512_mask_abs_pd(__m512d __W
, __mmask8 __K
, __m512d __A
)
9302 return (__m512d
)_mm512_mask_and_epi64((__v8di
)__W
, __K
, _mm512_set1_epi64(0x7FFFFFFFFFFFFFFF),(__v8di
)__A
);
9305 /* Vector-reduction arithmetic accepts vectors as inputs and produces scalars as
9306 * outputs. This class of vector operation forms the basis of many scientific
9307 * computations. In vector-reduction arithmetic, the evaluation order is
9308 * independent of the order of the input elements of V.
9310 * For floating-point intrinsics:
9311 * 1. When using fadd/fmul intrinsics, the order of operations within the
9312 * vector is unspecified (associative math).
9313 * 2. When using fmin/fmax intrinsics, NaN or -0.0 elements within the vector
9314 * produce unspecified results.
9316 * Used bisection method. At each step, we partition the vector with previous
9317 * step in half, and the operation is performed on its two halves.
9318 * This takes log2(n) steps where n is the number of elements in the vector.
9321 static __inline__
long long __DEFAULT_FN_ATTRS512
_mm512_reduce_add_epi64(__m512i __W
) {
9322 return __builtin_reduce_add((__v8di
)__W
);
9325 static __inline__
long long __DEFAULT_FN_ATTRS512
_mm512_reduce_mul_epi64(__m512i __W
) {
9326 return __builtin_reduce_mul((__v8di
)__W
);
9329 static __inline__
long long __DEFAULT_FN_ATTRS512
_mm512_reduce_and_epi64(__m512i __W
) {
9330 return __builtin_reduce_and((__v8di
)__W
);
9333 static __inline__
long long __DEFAULT_FN_ATTRS512
_mm512_reduce_or_epi64(__m512i __W
) {
9334 return __builtin_reduce_or((__v8di
)__W
);
9337 static __inline__
long long __DEFAULT_FN_ATTRS512
9338 _mm512_mask_reduce_add_epi64(__mmask8 __M
, __m512i __W
) {
9339 __W
= _mm512_maskz_mov_epi64(__M
, __W
);
9340 return __builtin_reduce_add((__v8di
)__W
);
9343 static __inline__
long long __DEFAULT_FN_ATTRS512
9344 _mm512_mask_reduce_mul_epi64(__mmask8 __M
, __m512i __W
) {
9345 __W
= _mm512_mask_mov_epi64(_mm512_set1_epi64(1), __M
, __W
);
9346 return __builtin_reduce_mul((__v8di
)__W
);
9349 static __inline__
long long __DEFAULT_FN_ATTRS512
9350 _mm512_mask_reduce_and_epi64(__mmask8 __M
, __m512i __W
) {
9351 __W
= _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M
, __W
);
9352 return __builtin_reduce_and((__v8di
)__W
);
9355 static __inline__
long long __DEFAULT_FN_ATTRS512
9356 _mm512_mask_reduce_or_epi64(__mmask8 __M
, __m512i __W
) {
9357 __W
= _mm512_maskz_mov_epi64(__M
, __W
);
9358 return __builtin_reduce_or((__v8di
)__W
);
9361 // -0.0 is used to ignore the start value since it is the neutral value of
9362 // floating point addition. For more information, please refer to
9363 // https://llvm.org/docs/LangRef.html#llvm-vector-reduce-fadd-intrinsic
9364 static __inline__
double __DEFAULT_FN_ATTRS512
_mm512_reduce_add_pd(__m512d __W
) {
9365 return __builtin_ia32_reduce_fadd_pd512(-0.0, __W
);
9368 static __inline__
double __DEFAULT_FN_ATTRS512
_mm512_reduce_mul_pd(__m512d __W
) {
9369 return __builtin_ia32_reduce_fmul_pd512(1.0, __W
);
9372 static __inline__
double __DEFAULT_FN_ATTRS512
9373 _mm512_mask_reduce_add_pd(__mmask8 __M
, __m512d __W
) {
9374 __W
= _mm512_maskz_mov_pd(__M
, __W
);
9375 return __builtin_ia32_reduce_fadd_pd512(-0.0, __W
);
9378 static __inline__
double __DEFAULT_FN_ATTRS512
9379 _mm512_mask_reduce_mul_pd(__mmask8 __M
, __m512d __W
) {
9380 __W
= _mm512_mask_mov_pd(_mm512_set1_pd(1.0), __M
, __W
);
9381 return __builtin_ia32_reduce_fmul_pd512(1.0, __W
);
9384 static __inline__
int __DEFAULT_FN_ATTRS512
9385 _mm512_reduce_add_epi32(__m512i __W
) {
9386 return __builtin_reduce_add((__v16si
)__W
);
9389 static __inline__
int __DEFAULT_FN_ATTRS512
9390 _mm512_reduce_mul_epi32(__m512i __W
) {
9391 return __builtin_reduce_mul((__v16si
)__W
);
9394 static __inline__
int __DEFAULT_FN_ATTRS512
9395 _mm512_reduce_and_epi32(__m512i __W
) {
9396 return __builtin_reduce_and((__v16si
)__W
);
9399 static __inline__
int __DEFAULT_FN_ATTRS512
9400 _mm512_reduce_or_epi32(__m512i __W
) {
9401 return __builtin_reduce_or((__v16si
)__W
);
9404 static __inline__
int __DEFAULT_FN_ATTRS512
9405 _mm512_mask_reduce_add_epi32( __mmask16 __M
, __m512i __W
) {
9406 __W
= _mm512_maskz_mov_epi32(__M
, __W
);
9407 return __builtin_reduce_add((__v16si
)__W
);
9410 static __inline__
int __DEFAULT_FN_ATTRS512
9411 _mm512_mask_reduce_mul_epi32( __mmask16 __M
, __m512i __W
) {
9412 __W
= _mm512_mask_mov_epi32(_mm512_set1_epi32(1), __M
, __W
);
9413 return __builtin_reduce_mul((__v16si
)__W
);
9416 static __inline__
int __DEFAULT_FN_ATTRS512
9417 _mm512_mask_reduce_and_epi32( __mmask16 __M
, __m512i __W
) {
9418 __W
= _mm512_mask_mov_epi32(_mm512_set1_epi32(-1), __M
, __W
);
9419 return __builtin_reduce_and((__v16si
)__W
);
9422 static __inline__
int __DEFAULT_FN_ATTRS512
9423 _mm512_mask_reduce_or_epi32(__mmask16 __M
, __m512i __W
) {
9424 __W
= _mm512_maskz_mov_epi32(__M
, __W
);
9425 return __builtin_reduce_or((__v16si
)__W
);
9428 static __inline__
float __DEFAULT_FN_ATTRS512
9429 _mm512_reduce_add_ps(__m512 __W
) {
9430 return __builtin_ia32_reduce_fadd_ps512(-0.0f
, __W
);
9433 static __inline__
float __DEFAULT_FN_ATTRS512
9434 _mm512_reduce_mul_ps(__m512 __W
) {
9435 return __builtin_ia32_reduce_fmul_ps512(1.0f
, __W
);
9438 static __inline__
float __DEFAULT_FN_ATTRS512
9439 _mm512_mask_reduce_add_ps(__mmask16 __M
, __m512 __W
) {
9440 __W
= _mm512_maskz_mov_ps(__M
, __W
);
9441 return __builtin_ia32_reduce_fadd_ps512(-0.0f
, __W
);
9444 static __inline__
float __DEFAULT_FN_ATTRS512
9445 _mm512_mask_reduce_mul_ps(__mmask16 __M
, __m512 __W
) {
9446 __W
= _mm512_mask_mov_ps(_mm512_set1_ps(1.0f
), __M
, __W
);
9447 return __builtin_ia32_reduce_fmul_ps512(1.0f
, __W
);
9450 static __inline__
long long __DEFAULT_FN_ATTRS512
9451 _mm512_reduce_max_epi64(__m512i __V
) {
9452 return __builtin_reduce_max((__v8di
)__V
);
9455 static __inline__
unsigned long long __DEFAULT_FN_ATTRS512
9456 _mm512_reduce_max_epu64(__m512i __V
) {
9457 return __builtin_reduce_max((__v8du
)__V
);
9460 static __inline__
long long __DEFAULT_FN_ATTRS512
9461 _mm512_reduce_min_epi64(__m512i __V
) {
9462 return __builtin_reduce_min((__v8di
)__V
);
9465 static __inline__
unsigned long long __DEFAULT_FN_ATTRS512
9466 _mm512_reduce_min_epu64(__m512i __V
) {
9467 return __builtin_reduce_min((__v8du
)__V
);
9470 static __inline__
long long __DEFAULT_FN_ATTRS512
9471 _mm512_mask_reduce_max_epi64(__mmask8 __M
, __m512i __V
) {
9472 __V
= _mm512_mask_mov_epi64(_mm512_set1_epi64(-__LONG_LONG_MAX__
- 1LL), __M
, __V
);
9473 return __builtin_reduce_max((__v8di
)__V
);
9476 static __inline__
unsigned long long __DEFAULT_FN_ATTRS512
9477 _mm512_mask_reduce_max_epu64(__mmask8 __M
, __m512i __V
) {
9478 __V
= _mm512_maskz_mov_epi64(__M
, __V
);
9479 return __builtin_reduce_max((__v8du
)__V
);
9482 static __inline__
long long __DEFAULT_FN_ATTRS512
9483 _mm512_mask_reduce_min_epi64(__mmask8 __M
, __m512i __V
) {
9484 __V
= _mm512_mask_mov_epi64(_mm512_set1_epi64(__LONG_LONG_MAX__
), __M
, __V
);
9485 return __builtin_reduce_min((__v8di
)__V
);
9488 static __inline__
unsigned long long __DEFAULT_FN_ATTRS512
9489 _mm512_mask_reduce_min_epu64(__mmask8 __M
, __m512i __V
) {
9490 __V
= _mm512_mask_mov_epi64(_mm512_set1_epi64(-1LL), __M
, __V
);
9491 return __builtin_reduce_min((__v8du
)__V
);
9493 static __inline__
int __DEFAULT_FN_ATTRS512
9494 _mm512_reduce_max_epi32(__m512i __V
) {
9495 return __builtin_reduce_max((__v16si
)__V
);
9498 static __inline__
unsigned int __DEFAULT_FN_ATTRS512
9499 _mm512_reduce_max_epu32(__m512i __V
) {
9500 return __builtin_reduce_max((__v16su
)__V
);
9503 static __inline__
int __DEFAULT_FN_ATTRS512
9504 _mm512_reduce_min_epi32(__m512i __V
) {
9505 return __builtin_reduce_min((__v16si
)__V
);
9508 static __inline__
unsigned int __DEFAULT_FN_ATTRS512
9509 _mm512_reduce_min_epu32(__m512i __V
) {
9510 return __builtin_reduce_min((__v16su
)__V
);
9513 static __inline__
int __DEFAULT_FN_ATTRS512
9514 _mm512_mask_reduce_max_epi32(__mmask16 __M
, __m512i __V
) {
9515 __V
= _mm512_mask_mov_epi32(_mm512_set1_epi32(-__INT_MAX__
- 1), __M
, __V
);
9516 return __builtin_reduce_max((__v16si
)__V
);
9519 static __inline__
unsigned int __DEFAULT_FN_ATTRS512
9520 _mm512_mask_reduce_max_epu32(__mmask16 __M
, __m512i __V
) {
9521 __V
= _mm512_maskz_mov_epi32(__M
, __V
);
9522 return __builtin_reduce_max((__v16su
)__V
);
9525 static __inline__
int __DEFAULT_FN_ATTRS512
9526 _mm512_mask_reduce_min_epi32(__mmask16 __M
, __m512i __V
) {
9527 __V
= _mm512_mask_mov_epi32(_mm512_set1_epi32(__INT_MAX__
), __M
, __V
);
9528 return __builtin_reduce_min((__v16si
)__V
);
9531 static __inline__
unsigned int __DEFAULT_FN_ATTRS512
9532 _mm512_mask_reduce_min_epu32(__mmask16 __M
, __m512i __V
) {
9533 __V
= _mm512_mask_mov_epi32(_mm512_set1_epi32(-1), __M
, __V
);
9534 return __builtin_reduce_min((__v16su
)__V
);
9537 static __inline__
double __DEFAULT_FN_ATTRS512
9538 _mm512_reduce_max_pd(__m512d __V
) {
9539 return __builtin_ia32_reduce_fmax_pd512(__V
);
9542 static __inline__
double __DEFAULT_FN_ATTRS512
9543 _mm512_reduce_min_pd(__m512d __V
) {
9544 return __builtin_ia32_reduce_fmin_pd512(__V
);
9547 static __inline__
double __DEFAULT_FN_ATTRS512
9548 _mm512_mask_reduce_max_pd(__mmask8 __M
, __m512d __V
) {
9549 __V
= _mm512_mask_mov_pd(_mm512_set1_pd(-__builtin_inf()), __M
, __V
);
9550 return __builtin_ia32_reduce_fmax_pd512(__V
);
9553 static __inline__
double __DEFAULT_FN_ATTRS512
9554 _mm512_mask_reduce_min_pd(__mmask8 __M
, __m512d __V
) {
9555 __V
= _mm512_mask_mov_pd(_mm512_set1_pd(__builtin_inf()), __M
, __V
);
9556 return __builtin_ia32_reduce_fmin_pd512(__V
);
9559 static __inline__
float __DEFAULT_FN_ATTRS512
9560 _mm512_reduce_max_ps(__m512 __V
) {
9561 return __builtin_ia32_reduce_fmax_ps512(__V
);
9564 static __inline__
float __DEFAULT_FN_ATTRS512
9565 _mm512_reduce_min_ps(__m512 __V
) {
9566 return __builtin_ia32_reduce_fmin_ps512(__V
);
9569 static __inline__
float __DEFAULT_FN_ATTRS512
9570 _mm512_mask_reduce_max_ps(__mmask16 __M
, __m512 __V
) {
9571 __V
= _mm512_mask_mov_ps(_mm512_set1_ps(-__builtin_inff()), __M
, __V
);
9572 return __builtin_ia32_reduce_fmax_ps512(__V
);
9575 static __inline__
float __DEFAULT_FN_ATTRS512
9576 _mm512_mask_reduce_min_ps(__mmask16 __M
, __m512 __V
) {
9577 __V
= _mm512_mask_mov_ps(_mm512_set1_ps(__builtin_inff()), __M
, __V
);
9578 return __builtin_ia32_reduce_fmin_ps512(__V
);
9581 /// Moves the least significant 32 bits of a vector of [16 x i32] to a
9582 /// 32-bit signed integer value.
9584 /// \headerfile <x86intrin.h>
9586 /// This intrinsic corresponds to the <c> VMOVD / MOVD </c> instruction.
9589 /// A vector of [16 x i32]. The least significant 32 bits are moved to the
9591 /// \returns A 32-bit signed integer containing the moved value.
9592 static __inline__
int __DEFAULT_FN_ATTRS512
9593 _mm512_cvtsi512_si32(__m512i __A
) {
9594 __v16si __b
= (__v16si
)__A
;
9598 /// Loads 8 double-precision (64-bit) floating-point elements stored at memory
9599 /// locations starting at location \a base_addr at packed 32-bit integer indices
9600 /// stored in the lower half of \a vindex scaled by \a scale them in dst.
9602 /// This intrinsic corresponds to the <c> VGATHERDPD </c> instructions.
9604 /// \code{.operation}
9608 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9609 /// dst[i+63:i] := MEM[addr+63:addr]
9611 /// dst[MAX:512] := 0
9613 #define _mm512_i32logather_pd(vindex, base_addr, scale) \
9614 _mm512_i32gather_pd(_mm512_castsi512_si256(vindex), (base_addr), (scale))
9616 /// Loads 8 double-precision (64-bit) floating-point elements from memory
9617 /// starting at location \a base_addr at packed 32-bit integer indices stored in
9618 /// the lower half of \a vindex scaled by \a scale into dst using writemask
9619 /// \a mask (elements are copied from \a src when the corresponding mask bit is
9622 /// This intrinsic corresponds to the <c> VGATHERDPD </c> instructions.
9624 /// \code{.operation}
9629 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9630 /// dst[i+63:i] := MEM[addr+63:addr]
9632 /// dst[i+63:i] := src[i+63:i]
9635 /// dst[MAX:512] := 0
9637 #define _mm512_mask_i32logather_pd(src, mask, vindex, base_addr, scale) \
9638 _mm512_mask_i32gather_pd((src), (mask), _mm512_castsi512_si256(vindex), \
9639 (base_addr), (scale))
9641 /// Loads 8 64-bit integer elements from memory starting at location \a base_addr
9642 /// at packed 32-bit integer indices stored in the lower half of \a vindex
9643 /// scaled by \a scale and stores them in dst.
9645 /// This intrinsic corresponds to the <c> VPGATHERDQ </c> instructions.
9647 /// \code{.operation}
9651 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9652 /// dst[i+63:i] := MEM[addr+63:addr]
9654 /// dst[MAX:512] := 0
9656 #define _mm512_i32logather_epi64(vindex, base_addr, scale) \
9657 _mm512_i32gather_epi64(_mm512_castsi512_si256(vindex), (base_addr), (scale))
9659 /// Loads 8 64-bit integer elements from memory starting at location \a base_addr
9660 /// at packed 32-bit integer indices stored in the lower half of \a vindex
9661 /// scaled by \a scale and stores them in dst using writemask \a mask (elements
9662 /// are copied from \a src when the corresponding mask bit is not set).
9664 /// This intrinsic corresponds to the <c> VPGATHERDQ </c> instructions.
9666 /// \code{.operation}
9671 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9672 /// dst[i+63:i] := MEM[addr+63:addr]
9674 /// dst[i+63:i] := src[i+63:i]
9677 /// dst[MAX:512] := 0
9679 #define _mm512_mask_i32logather_epi64(src, mask, vindex, base_addr, scale) \
9680 _mm512_mask_i32gather_epi64((src), (mask), _mm512_castsi512_si256(vindex), \
9681 (base_addr), (scale))
9683 /// Stores 8 packed double-precision (64-bit) floating-point elements in \a v1
9684 /// and to memory locations starting at location \a base_addr at packed 32-bit
9685 /// integer indices stored in \a vindex scaled by \a scale.
9687 /// This intrinsic corresponds to the <c> VSCATTERDPD </c> instructions.
9689 /// \code{.operation}
9693 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9694 /// MEM[addr+63:addr] := v1[i+63:i]
9697 #define _mm512_i32loscatter_pd(base_addr, vindex, v1, scale) \
9698 _mm512_i32scatter_pd((base_addr), _mm512_castsi512_si256(vindex), (v1), (scale))
9700 /// Stores 8 packed double-precision (64-bit) floating-point elements in \a v1
9701 /// to memory locations starting at location \a base_addr at packed 32-bit
9702 /// integer indices stored in \a vindex scaled by \a scale. Only those elements
9703 /// whose corresponding mask bit is set in writemask \a mask are written to
9706 /// This intrinsic corresponds to the <c> VSCATTERDPD </c> instructions.
9708 /// \code{.operation}
9713 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9714 /// MEM[addr+63:addr] := a[i+63:i]
9718 #define _mm512_mask_i32loscatter_pd(base_addr, mask, vindex, v1, scale) \
9719 _mm512_mask_i32scatter_pd((base_addr), (mask), \
9720 _mm512_castsi512_si256(vindex), (v1), (scale))
9722 /// Stores 8 packed 64-bit integer elements located in \a v1 and stores them in
9723 /// memory locations starting at location \a base_addr at packed 32-bit integer
9724 /// indices stored in \a vindex scaled by \a scale.
9726 /// This intrinsic corresponds to the <c> VPSCATTERDQ </c> instructions.
9728 /// \code{.operation}
9732 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9733 /// MEM[addr+63:addr] := a[i+63:i]
9736 #define _mm512_i32loscatter_epi64(base_addr, vindex, v1, scale) \
9737 _mm512_i32scatter_epi64((base_addr), \
9738 _mm512_castsi512_si256(vindex), (v1), (scale))
9740 /// Stores 8 packed 64-bit integer elements located in a and stores them in
9741 /// memory locations starting at location \a base_addr at packed 32-bit integer
9742 /// indices stored in \a vindex scaled by scale using writemask \a mask (elements
9743 /// whose corresponding mask bit is not set are not written to memory).
9745 /// This intrinsic corresponds to the <c> VPSCATTERDQ </c> instructions.
9747 /// \code{.operation}
9752 /// addr := base_addr + SignExtend64(vindex[m+31:m]) * ZeroExtend64(scale) * 8
9753 /// MEM[addr+63:addr] := a[i+63:i]
9757 #define _mm512_mask_i32loscatter_epi64(base_addr, mask, vindex, v1, scale) \
9758 _mm512_mask_i32scatter_epi64((base_addr), (mask), \
9759 _mm512_castsi512_si256(vindex), (v1), (scale))
9761 #undef __DEFAULT_FN_ATTRS512
9762 #undef __DEFAULT_FN_ATTRS128
9763 #undef __DEFAULT_FN_ATTRS
9765 #endif /* __AVX512FINTRIN_H */